jbrowse-plugin-protein3d 0.0.10 → 0.0.11
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.
|
@@ -7343,7 +7343,7 @@ void main() {
|
|
|
7343
7343
|
gl_FragColor.rgb = packIntToRGB(vGroup);
|
|
7344
7344
|
#endif
|
|
7345
7345
|
}
|
|
7346
|
-
`});function cWe(e){return e.namedFramebuffers[gv]||(e.namedFramebuffers[gv]=e.resources.framebuffer()),e.namedFramebuffers[gv]}function uWe(e,t,r,n,o,i){let a=`${gv}-${e}`;return t.namedTextures[a]||(t.namedTextures[a]=t.resources.texture(r,n,o,i)),t.namedTextures[a]}function Ase(e,t,r,n,o,i){return e.isWebGL2?cVt(e,t,r,n,o,i):Tq(e,t,r,n,!1,o,i)}function Tq(e,t,r,n,o,i,a){Ye&&e.timer.mark("GaussianDensityTexture2d");let s=dVt(e,t,r,n,o,i,a);return Ye&&e.timer.markEnd("GaussianDensityTexture2d"),dWe(s)}function cVt(e,t,r,n,o,i){Ye&&e.timer.mark("GaussianDensityTexture3d");let a=fVt(e,t,r,n,o,i);return Ye&&e.timer.markEnd("GaussianDensityTexture3d"),dWe(a)}function dWe({texture:e,scale:t,bbox:r,gridDim:n,gridTexDim:o,gridTexScale:i,radiusFactor:a,resolution:s,maxRadius:l}){return{transform:uVt(t,r),texture:e,bbox:r,gridDim:n,gridTexDim:o,gridTexScale:i,radiusFactor:a,resolution:s,maxRadius:l}}function uVt(e,t){let r=H.identity();return H.fromScaling(r,e),H.setTranslation(r,t.min),r}function dVt(e,t,r,n,o,i,a){let{gl:s,resources:l,state:c,extensions:{colorBufferFloat:u,textureFloat:d,colorBufferHalfFloat:f,textureHalfFloat:m,blendMinMax:p}}=e,{smoothness:h,resolution:g}=i,{drawCount:y,positions:b,radii:x,groups:C,scale:S,expandedBox:w,dim:A,maxRadius:T}=fWe(t,r,n,i),[D,E,I]=A,{texDimX:k,texDimY:R,texCols:B,powerOfTwoSize:O}=pVt(A),F=v.create(k,R,0),q=Ce.create(k/O,R/O),W=T*2,j=o?O:k,L=o?O:R,V=uWe("min-dist-2d",e,"image-uint8","rgba","ubyte","nearest");V.define(j,L);let U=mWe(e,y,b,x,C,V,w,A,F,q,h,g,W),{uCurrentSlice:z,uCurrentX:ie,uCurrentY:oe}=U.values,X=cWe(e);X.bind(),pWe(e),a||(a=f&&m?l.texture("image-float16","rgba","fp16","linear"):u&&d?l.texture("image-float32","rgba","float","linear"):l.texture("image-uint8","rgba","ubyte","linear")),a.define(j,L);function Y(ne,K){c.currentRenderItemId=-1,ne.attachFramebuffer(X,0),K&&(c.viewport(0,0,j,L),c.scissor(0,0,j,L),s.clear(s.COLOR_BUFFER_BIT)),P.update(oe,0);let $=0,Z=0,de=0;for(let Q=0;Q<I;++Q)$>=B&&($-=B,Z+=E,de=0,P.update(oe,Z)),P.update(ie,de),P.update(z,Q),c.viewport(de,Z,D,E),c.scissor(de,Z,D,E),U.render(),++$,de+=D;s.flush()}return gWe(e,U),Y(a,!0),p&&(hWe(e,U),Y(V,!0),yWe(e,U),Y(a,!1)),{texture:a,scale:S,bbox:w,gridDim:A,gridTexDim:F,gridTexScale:q,radiusFactor:W,resolution:g,maxRadius:T}}function fVt(e,t,r,n,o,i){let{gl:a,resources:s,state:l,extensions:{colorBufferFloat:c,textureFloat:u,colorBufferHalfFloat:d,textureHalfFloat:f}}=e,{smoothness:m,resolution:p}=o,{drawCount:h,positions:g,radii:y,groups:b,scale:x,expandedBox:C,dim:S,maxRadius:w}=fWe(t,r,n,o),[A,T,D]=S,E=uWe("min-dist-3d",e,"volume-uint8","rgba","ubyte","nearest");E.define(A,T,D);let I=Ce.create(1,1),k=w*2,R=mWe(e,h,g,y,b,E,C,S,S,I,m,p,k),{uCurrentSlice:B}=R.values,O=cWe(e);O.bind(),pWe(e),l.viewport(0,0,A,T),l.scissor(0,0,A,T),i||(i=d&&f?s.texture("volume-float16","rgba","fp16","linear"):c&&u?s.texture("volume-float32","rgba","float","linear"):s.texture("volume-uint8","rgba","ubyte","linear")),i.define(A,T,D);function F(q,W){l.currentRenderItemId=-1;for(let j=0;j<D;++j)P.update(B,j),q.attachFramebuffer(O,0,j),W&&a.clear(a.COLOR_BUFFER_BIT),R.render();a.flush()}return gWe(e,R),F(i,!0),hWe(e,R),F(E,!0),yWe(e,R),F(i,!1),{texture:i,scale:x,bbox:C,gridDim:S,gridTexDim:S,gridTexScale:I,radiusFactor:k,resolution:p,maxRadius:w}}function fWe(e,t,r,n){let{resolution:o,radiusOffset:i}=n,a=1/o,{indices:s,x:l,y:c,z:u,id:d}=e,f=Se.size(s),m=new Float32Array(f*3),p=new Float32Array(f),h=new Float32Array(f),g=0;for(let w=0;w<f;++w){let A=Se.getAt(s,w);m[w*3]=l[A],m[w*3+1]=c[A],m[w*3+2]=u[A];let T=r(A)+i;g<T&&(g=T),p[w]=T,h[w]=d?d[w]:w}let y=g*2+o*4,b=Ct.expand(Ct(),t,v.create(y,y,y)),x=Ct.scale(Ct(),b,a),C=Ct.size(v(),x);v.ceil(C,C);let S=v.create(o,o,o);return{drawCount:f,positions:m,radii:p,groups:h,scale:S,expandedBox:b,dim:C,maxRadius:g}}function mWe(e,t,r,n,o,i,a,s,l,c,u,d,f){if(e.namedComputeRenderables[gv]){let m=v.sub(v(),a.max,a.min),p=e.namedComputeRenderables[gv].values;P.updateIfChanged(p.drawCount,t),P.updateIfChanged(p.instanceCount,1),P.update(p.aRadius,n),P.update(p.aPosition,r),P.update(p.aGroup,o),P.updateIfChanged(p.uCurrentSlice,0),P.updateIfChanged(p.uCurrentX,0),P.updateIfChanged(p.uCurrentY,0),P.update(p.uBboxMin,a.min),P.update(p.uBboxSize,m),P.update(p.uGridDim,s),P.update(p.uGridTexDim,l),P.update(p.uGridTexScale,c),P.updateIfChanged(p.uAlpha,u),P.updateIfChanged(p.uResolution,d),P.updateIfChanged(p.uRadiusFactorInv,1/f),P.update(p.tMinDistanceTex,i),P.updateIfChanged(p.dGridTexType,i.getDepth()>0?"3d":"2d"),P.updateIfChanged(p.dCalcType,"density"),e.namedComputeRenderables[gv].update()}else e.namedComputeRenderables[gv]=mVt(e,t,r,n,o,i,a,s,l,c,u,d,f);return e.namedComputeRenderables[gv]}function mVt(e,t,r,n,o,i,a,s,l,c,u,d,f){let m=v.sub(v(),a.max,a.min),p={drawCount:P.create(t),instanceCount:P.create(1),aRadius:P.create(n),aPosition:P.create(r),aGroup:P.create(o),uCurrentSlice:P.create(0),uCurrentX:P.create(0),uCurrentY:P.create(0),uBboxMin:P.create(a.min),uBboxSize:P.create(m),uGridDim:P.create(s),uGridTexDim:P.create(l),uGridTexScale:P.create(c),uAlpha:P.create(u),uResolution:P.create(d),uRadiusFactorInv:P.create(1/f),tMinDistanceTex:P.create(i),dGridTexType:P.create(i.getDepth()>0?"3d":"2d"),dCalcType:P.create("density")},h={...lVt},g=Yr(gv,iWe,sWe),y=bn(e,"points",g,h,p);return xn(y,p)}function pWe(e){let{gl:t,state:r}=e;r.disable(t.CULL_FACE),r.enable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.clearColor(0,0,0,0)}function hWe(e,t){let{gl:r,state:n}=e;if(P.update(t.values.dCalcType,"minDistance"),t.update(),n.colorMask(!1,!1,!1,!0),n.blendFunc(r.ONE,r.ONE),!e.extensions.blendMinMax)throw new Error("GPU gaussian surface calculation requires EXT_blend_minmax");n.blendEquation(e.extensions.blendMinMax.MAX)}function gWe(e,t){let{gl:r,state:n}=e;P.update(t.values.dCalcType,"density"),t.update(),n.colorMask(!1,!1,!1,!0),n.blendFunc(r.ONE,r.ONE),n.blendEquation(r.FUNC_ADD)}function yWe(e,t){let{gl:r,state:n}=e;P.update(t.values.dCalcType,"groupId"),t.update(),n.colorMask(!0,!0,!0,!1),n.blendFunc(r.ONE,r.ZERO),n.blendEquation(r.FUNC_ADD)}function pVt(e){let t=e[0]*e[1]*e[2],r=Math.sqrt(t),n=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))),o=0,i=e[1],a=1,s=e[2];return n<e[0]*e[2]?(s=Math.floor(n/e[0]),a=Math.ceil(e[2]/s),o=s*e[0],i*=a):o=e[0]*e[2],{texDimX:o,texDimY:i,texRows:a,texCols:s,powerOfTwoSize:i<n?n:n*2}}var lVt,gv,vWe=M(()=>{or();Ut();Ge();Vt();Ti();gy();hi();wi();vi();aWe();lWe();Fn();lVt={drawCount:go("number"),instanceCount:go("number"),aRadius:eo("float32",1,0),aPosition:eo("float32",3,0),aGroup:eo("float32",1,0),uCurrentSlice:he("f"),uCurrentX:he("f"),uCurrentY:he("f"),uBboxMin:he("v3","material"),uBboxSize:he("v3","material"),uGridDim:he("v3","material"),uGridTexDim:he("v3","material"),uGridTexScale:he("v2","material"),uAlpha:he("f","material"),uResolution:he("f","material"),uRadiusFactorInv:he("f","material"),tMinDistanceTex:wt("texture","rgba","float","nearest","material"),dGridTexType:vt("string",["2d","3d"]),dCalcType:vt("string",["density","minDistance","groupId"])},gv="gaussian-density"});async function Pse(e,t,r,n,o){let{resolution:i,radiusOffset:a,smoothness:s}=o,l=1/i,{indices:c,x:u,y:d,z:f,id:m}=t,p=Se.size(c),h=new Float32Array(p),g=0;for(let X=0;X<p;++X){let Y=n(Se.getAt(c,X))+a;g<Y&&(g=Y),h[X]=Y}let y=g*2+i,b=Ct.expand(Ct(),r,v.create(y,y,y)),x=b.min,C=Ct.scale(Ct(),b,l),S=Ct.size(v(),C);v.ceil(S,S);let w=Rr.Space(S,[0,1,2],Float32Array),A=w.create(),T=Rr.create(w,A),D=w.create();D.fill(-1);let E=Rr.create(w,D),[I,k,R]=S,B=R,O=k,F=B*O,q=Z1(S[0],x[0],i),W=Z1(S[1],x[1],i),j=Z1(S[2],x[2],i),L=w.create(),V=s,U=Math.ceil(1e5/(Math.pow(Math.pow(g,3),3)*l));function z(X,Y){for(let ne=X;ne<Y;++ne){let K=Se.getAt(c,ne),$=u[K],Z=d[K],de=f[K],Q=h[ne],ye=1/(Q*Q),we=Q*2,re=we*we,ee=Math.ceil(we*l),le=Math.floor(l*($-x[0])),pe=Math.floor(l*(Z-x[1])),ke=Math.floor(l*(de-x[2])),Ve=Math.max(0,le-ee),Xe=Math.max(0,pe-ee),pt=Math.max(0,ke-ee),_e=Math.min(I,le+ee+2),Ie=Math.min(k,pe+ee+2),Re=Math.min(R,ke+ee+2);for(let ze=Ve;ze<_e;++ze){let N=q[ze]-$,J=ze*F;for(let Ae=Xe;Ae<Ie;++Ae){let qe=W[Ae]-Z,Be=N*N+qe*qe,Qe=Ae*B+J;for(let at=pt;at<Re;++at){let ft=j[at]-de,mt=Be+ft*ft;if(mt<=re){let dt=iUe(-V*(mt*ye)),Pt=at+Qe;A[Pt]+=dt,dt>L[Pt]&&(L[Pt]=dt,D[Pt]=m?m[ne]:ne)}}}}}}async function ie(){for(let X=0;X<p;X+=U)z(X,Math.min(X+U,p)),e.shouldUpdate&&await e.update({message:"filling density grid",current:X,max:p})}await ie();let oe=H.identity();return H.fromScaling(oe,v.create(i,i,i)),H.setTranslation(oe,b.min),{field:T,idField:E,transform:oe,radiusFactor:1,resolution:i,maxRadius:g}}var bWe=M(()=>{or();Ge();Ut();Fre()});function xWe(e,t){let r=e.maxTextureSize/3;return r*r/Math.max(1,t?t.units.length/16:1)}function Aq(e,t,r,n){let{position:o,boundary:i,radius:a}=EP(e,t,r,n),s=Fy(i.box,n);return Me.create("Gaussian Density",async l=>await Pse(l,o,i.box,a,s))}function SWe(e,t,r,n,o,i){let{position:a,boundary:s,radius:l}=EP(e,t,r,n),c=Fy(s.box,n,xWe(o,e));return Ase(o,a,s.box,l,c,i)}function _We(e,t,r,n,o,i,a){let{position:s,boundary:l,radius:c}=EP(e,t,r,o),u=Fy(l.box,o,xWe(i,e));return Tq(i,s,l.box,c,n,u,a)}function CWe(e,t,r){let{position:n,boundary:o,radius:i}=DP(e,t,r),a=Fy(o.box,r);return Me.create("Gaussian Density",async s=>await Pse(s,n,o.box,i,a))}function wWe(e,t,r,n,o){let{position:i,boundary:a,radius:s}=DP(e,t,r),l=Fy(a.box,r);return Ase(n,i,a.box,s,l,o)}function TWe(e,t,r,n,o,i){let{box:a}=e.lookup3d.boundary,{position:s,boundary:l,radius:c}=DP(e,t,n),u=Fy(l.box,n);return Tq(o,s,a,c,r,u,i)}var a_,Qio,Pq=M(()=>{hr();Ue();vWe();Ps();Gn();bWe();a_={resolution:_.Numeric(1,{min:.1,max:20,step:.1},{description:"Grid resolution/cell spacing.",...$e.CustomQualityParamInfo}),radiusOffset:_.Numeric(0,{min:0,max:10,step:.1},{description:"Extra/offset radius added to the atoms/coarse elements for gaussian calculation. Useful to create coarse, low resolution surfaces."}),smoothness:_.Numeric(1.5,{min:.5,max:2.5,step:.1},{description:"Smoothness of the gausian surface, lower is smoother."}),...LC},Qio=_.getDefaultValues(a_)});function IWe(e){return e.extensions.colorBufferFloat&&e.extensions.textureFloat&&e.extensions.textureFloatLinear&&e.extensions.blendMinMax&&e.extensions.drawBuffers}function E3(e,t,r){if(t.resolution>1)return!1;let n=r.maxTextureSize/3,{areaCells:o,maxAreaCells:i}=Vte(e.boundary.box,t.resolution,n*n);return o<i}function EWe(e,t,r,n){return r.tryUseGpu&&n&&IWe(n)&&E3(t,r,n)?xVt(e):gVt(e)}function DWe(e,t,r,n){return r.tryUseGpu&&n&&IWe(n)&&E3(t,r,n)?_Vt(e):vVt(e)}async function hVt(e,t,r,n,o,i){let{smoothness:a}=o,{transform:s,field:l,idField:c,radiusFactor:u,resolution:d,maxRadius:f}=await Aq(r,t,n.size,o).runInContext(e.runtime),m={isoLevel:Math.exp(-a)/u,scalarField:l,idField:c},p=await rv(m,i).runAsChild(e.runtime);p.meta.resolution=d,xt.transform(p,s),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(p),P.updateIfChanged(p.varyingGroup,!1)):P.updateIfChanged(p.varyingGroup,!0);let h=be.expand(be(),t.boundary.sphere,f);return p.setBoundingSphere(h),p}function gVt(e){return ii({defaultProps:_.getDefaultValues(Iq),createGeometry:hVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&E3(t.structure,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}async function yVt(e,t,r,n,o){let{smoothness:i}=n,{transform:a,field:s,idField:l,radiusFactor:c,resolution:u,maxRadius:d}=await CWe(t,r.size,n).runInContext(e.runtime),f={isoLevel:Math.exp(-i)/c,scalarField:s,idField:l},m=await rv(f,o).runAsChild(e.runtime);m.meta.resolution=u,xt.transform(m,a),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(m),P.updateIfChanged(m.varyingGroup,!1)):P.updateIfChanged(m.varyingGroup,!0);let p=be.expand(be(),t.boundary.sphere,d);return m.setBoundingSphere(p),m}function vVt(e){return Sl({defaultProps:_.getDefaultValues(PWe),createGeometry:yVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&E3(t,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function bVt(e,t,r,n,o,i){let{webgl:a}=e;if(!a)throw new Error("webgl context required to create gaussian surface texture-mesh");let{namedTextures:s,resources:l,extensions:{colorBufferFloat:c,textureFloat:u,colorBufferHalfFloat:d,textureHalfFloat:f}}=a;s[I3]||(s[I3]=d&&f?l.texture("image-float16","rgba","fp16","linear"):c&&u?l.texture("image-float32","rgba","float","linear"):l.texture("image-uint8","rgba","ubyte","linear"));let m=v.create(0,1,2),p=t.elements.length,h=y=>{Ye&&a.timer.mark("createGaussianSurfaceTextureMesh");let b=_We(r,t,n.size,!0,o,a,s[I3]),x=Math.exp(-o.smoothness)/b.radiusFactor,C=y?.doubleBuffer.get(),S=QC(a,b.texture,b.gridDim,b.gridTexDim,b.gridTexScale,b.transform,x,!1,!0,m,!0,C?.vertex,C?.group,C?.normal);Ye&&a.timer.markEnd("createGaussianSurfaceTextureMesh");let w=be.expand(be(),t.boundary.sphere,b.maxRadius),A=Hs.create(S.vertexCount,p,S.vertexTexture,S.groupTexture,S.normalTexture,w,y);return A.meta.resolution=b.resolution,A},g=h(i);return g.meta.webgl=a,g.meta.reset=()=>{h(g)},g}function xVt(e){return NFe({defaultProps:_.getDefaultValues(Iq),createGeometry:bVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!E3(t.structure,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&i&&(cte(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy(),(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function SVt(e,t,r,n,o){let{webgl:i}=e;if(!i)throw new Error("webgl context required to create structure gaussian surface texture-mesh");let{namedTextures:a,resources:s,extensions:{colorBufferFloat:l,textureFloat:c,colorBufferHalfFloat:u,textureHalfFloat:d}}=i;a[I3]||(a[I3]=u&&d?s.texture("image-float16","rgba","fp16","linear"):l&&c?s.texture("image-float32","rgba","float","linear"):s.texture("image-uint8","rgba","ubyte","linear"));let f=v.create(0,1,2),m=t.elementCount,p=g=>{Ye&&i.timer.mark("createStructureGaussianSurfaceTextureMesh");let y=TWe(t,r.size,!0,n,i,a[I3]),b=Math.exp(-n.smoothness)/y.radiusFactor,x=g?.doubleBuffer.get(),C=QC(i,y.texture,y.gridDim,y.gridTexDim,y.gridTexScale,y.transform,b,!1,!0,f,!0,x?.vertex,x?.group,x?.normal);Ye&&i.timer.markEnd("createStructureGaussianSurfaceTextureMesh");let S=be.expand(be(),t.boundary.sphere,y.maxRadius),w=Hs.create(C.vertexCount,m,C.vertexTexture,C.groupTexture,C.normalTexture,S,g);return w.meta.resolution=y.resolution,w},h=p(o);return h.meta.webgl=i,h.meta.reset=()=>{p(h)},h}function _Vt(e){return DFe({defaultProps:_.getDefaultValues(PWe),createGeometry:SVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!E3(t,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&i&&(cte(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy(),(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}var AWe,Iq,PWe,I3,kWe=M(()=>{Ue();ka();Pq();uo();$C();yp();Jx();Dz();or();cc();Ps();MM();ute();Gn();Ge();Fn();rd();AWe={...a_,...RN,ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),tryUseGpu:_.Boolean(!0),includeParent:_.Boolean(!1,{isHidden:!0})},Iq={...Uo,...FFe,...AWe},PWe={...Ed,...EFe,...AWe};I3="gaussian-surface"});async function CVt(e,t,r,n,o,i){let{smoothness:a}=o,{transform:s,field:l,idField:c,maxRadius:u}=await Aq(r,t,n.size,o).runInContext(e.runtime),d={isoLevel:Math.exp(-a),scalarField:l,idField:c},f=await DI(d,i).runAsChild(e.runtime);Hn.transform(f,s);let m=be.expand(be(),t.boundary.sphere,u);return f.setBoundingSphere(m),f}function MWe(e){return bS({defaultProps:_.getDefaultValues(Ise),createGeometry:CVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)}},e)}var Ise,BWe=M(()=>{Ue();Td();Pq();$C();ka();yp();or();Ise={...vS,...a_,sizeFactor:_.Numeric(3,{min:0,max:10,step:.1}),lineSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),includeParent:_.Boolean(!1,{isHidden:!0})}});function wVt(e,t){return OWe}function TVt(e,t){return Zt.createMulti("Gaussian Surface",e,t,No,RWe)}var RWe,OWe,LWe,FWe=M(()=>{kWe();fh();BWe();Ue();sc();Eo();Gn();RWe={"gaussian-surface-mesh":(e,t)=>bo("Gaussian surface mesh",e,t,EWe),"structure-gaussian-surface-mesh":(e,t)=>oi("Structure-Gaussian surface mesh",e,t,DWe),"gaussian-surface-wireframe":(e,t)=>bo("Gaussian surface wireframe",e,t,MWe)},OWe={...Iq,...Ise,visuals:_.MultiSelect(["gaussian-surface-mesh"],_.objectToOptions(RWe)),bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.5,{min:0,max:1,step:.01},$e.ShadingCategory)};LWe={name:"gaussian-surface",label:"Gaussian Surface",description:"Displays a gaussian molecular surface.",factory:TVt,getParams:wVt,defaultValues:_.getDefaultValues(OWe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function NWe(e){return AFe({defaultProps:_.getDefaultValues(Ese),createGeometry:AVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{t.createGeometry=r.level!==n.level||r.level==="chain"&&r.chainScale!==n.chainScale||r.level==="residue"&&r.residueScale!==n.residueScale||r.level==="element"&&r.elementScale!==n.elementScale||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant}},e)}function AVt(e,t,r,n,o){switch(n.level){case"chain":return PVt(e,t,r,n,o);case"residue":return IVt(e,t,r,n,o);case"element":return EVt(e,t,r,n,o)}}function PVt(e,t,r,n,o){let i=te.Location.create(t),{units:a,serialMapping:s}=t,{auth_asym_id:l,label_asym_id:c}=nt.chain,{cumulativeUnitElementCount:u}=s,d=a.length,{chainScale:f}=n,m=Ad.create(n,d,d/2,o);for(let p=0,h=a.length;p<h;++p){let g=a[p];i.unit=g,i.element=g.elements[0];let{center:y,radius:b}=g.lookup3d.boundary.sphere;v.transformMat4(jh,y,g.conformation.operator.matrix);let x=l(i),C=c(i),S=x===C?C:`${C} [${x}]`;m.add(S,jh[0],jh[1],jh[2],b,f,u[p])}return m.getText()}function IVt(e,t,r,n,o){let i=te.Location.create(t),{units:a,serialMapping:s}=t,{label_comp_id:l}=nt.atom,{auth_seq_id:c}=nt.residue,{cumulativeUnitElementCount:u}=s,d=t.polymerResidueCount*2,{residueScale:f}=n,m=Ad.create(n,d,d/2,o);for(let p=0,h=a.length;p<h;++p){let g=a[p],y=g.conformation,{elements:b}=g;i.unit=g,i.element=g.elements[0];let x=g.model.atomicHierarchy.residueAtomSegments.index,C=u[p],S=0,w=b.length;for(;S<w;){let A=S,T=x[b[S]];for(S++;S<w&&x[b[S]]===T;)S++;pR.reset();for(let B=A;B<S;B++)y.position(b[B],jh),pR.includePosition(jh);pR.finishedIncludeStep();for(let B=A;B<S;B++)y.position(b[B],jh),pR.radiusPosition(jh);i.element=b[A];let{center:D,radius:E}=pR.getSphere(),I=c(i),R=`${l(i)} ${I}`;m.add(R,D[0],D[1],D[2],E,f,C+A)}}return m.getText()}function EVt(e,t,r,n,o){let i=te.Location.create(t),{units:a,serialMapping:s}=t,{label_atom_id:l,label_alt_id:c}=nt.atom,{cumulativeUnitElementCount:u}=s,d=r.size,f=t.elementCount,{elementScale:m}=n,p=Ad.create(n,f,f/2,o);for(let h=0,g=a.length;h<g;++h){let y=a[h],b=y.conformation,{elements:x}=y;i.unit=y;let C=u[h],S=If(t,y,{...n,traceOnly:!1});for(let w=0,A=x.length;w<A;w++){if(S&&S(x[w]))continue;i.element=x[w],b.position(i.element,jh);let T=l(i),D=c(i),E=D?`${T}%${D}`:T;p.add(E,jh[0],jh[1],jh[2],d.size(i),m,C+w)}}return p.getText()}var Ese,jh,pR,UWe=M(()=>{Ue();gt();IC();cc();yp();ya();Ge();Bp();yp();Ese={...TFe,background:_.Boolean(!1),backgroundMargin:_.Numeric(0,{min:0,max:1,step:.01}),backgroundColor:_.Color(mr.black),backgroundOpacity:_.Numeric(.5,{min:0,max:1,step:.01}),borderWidth:_.Numeric(.25,{min:0,max:.5,step:.01}),level:_.Select("residue",[["chain","Chain"],["residue","Residue"],["element","Element"]],{isEssential:!0}),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),chainScale:_.Numeric(10,{min:0,max:20,step:.1}),residueScale:_.Numeric(1,{min:0,max:20,step:.1}),elementScale:_.Numeric(.5,{min:0,max:20,step:.1})};jh=v(),pR=new Va("98")});function DVt(e,t){return zWe}function kVt(e,t){let r=Zt.createMulti("Label",e,t,No,VWe);return r.setState({pickable:!1,markerActions:ar.None}),r}var VWe,zWe,qWe,jWe=M(()=>{Ue();sc();Eo();UWe();bl();VWe={"label-text":(e,t)=>oi("Label text",e,t,NWe)},zWe={...Ese,visuals:_.MultiSelect(["label-text"],_.objectToOptions(VWe))};qWe={name:"label",label:"Label",description:"Displays labels.",factory:kVt,getParams:DVt,defaultValues:_.getDefaultValues(zWe),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function MVt(e,t){return e[0]=e[1]=e[2]=1,t[0]!==0?e[0]=(t[1]+t[2])/-t[0]:t[1]!==0?e[1]=(t[0]+t[2])/-t[1]:t[2]!==0&&(e[2]=(t[0]+t[1])/-t[2]),e}function BVt(e){let t=0,r=2*Math.PI/e,n=new Float32Array(e),o=new Float32Array(e);for(let i=0;i<e;i++)n[i]=Math.cos(t),o[i]=Math.sin(t),t+=r;return{cosTable:n,sinTable:o}}async function GWe(e,t,r,n,o,i){let a=-1;function s(Ve,Xe,pt,_e,Ie){if(a!==-1){let Re=a;if(Re!==_e&&Re!==Ie&&l(Re,Ve,Xe,pt))return Re;a=-1}for(let Re=0,ze=D.count;Re<ze;++Re){let N=Se.getAt(E,D.indices[Re]);if(N!==_e&&N!==Ie&&l(N,Ve,Xe,pt))return a=N,N}return-1}function l(Ve,Xe,pt,_e){let Ie=O[Ve],Re=I[Ve]-Xe,ze=k[Ve]-pt,N=R[Ve]-_e;return Re*Re+ze*ze+N*N<Ie*Ie}function c(Ve,Xe){for(let pt=Ve;pt<Xe;++pt){let _e=Se.getAt(E,pt),Ie=I[_e],Re=k[_e],ze=R[_e],N=O[_e],J=N*N;T.find(Ie,Re,ze,N);let Ae=Math.ceil(N*S),qe=Math.floor(S*(Ie-j)),Be=Math.floor(S*(Re-L)),Qe=Math.floor(S*(ze-V)),at=Math.max(0,qe-Ae),ft=Math.max(0,Be-Ae),mt=Math.max(0,Qe-Ae),dt=Math.min(ie,qe+Ae+2),Pt=Math.min(oe,Be+Ae+2),Lt=Math.min(X,Qe+Ae+2);for(let Jt=at;Jt<dt;++Jt){let Rt=ye[Jt]-Ie,tr=Jt*K;for(let Kt=ft;Kt<Pt;++Kt){let vr=we[Kt]-Re,mn=Rt*Rt+vr*vr,Zn=Kt*Y+tr;for(let jr=mt;jr<Lt;++jr){let me=re[jr]-ze,Te=mn+me*me;if(Te<J){let Pe=jr+Zn;Q[Pe]<0&&(Q[Pe]*=-1);let it=Math.sqrt(Te),Mt=N/it,Et=Rt*Mt+Ie,Nr=vr*Mt+Re,pn=me*Mt+ze;if(s(Et,Nr,pn,_e,-1)===-1){let _n=N-it;_n<Q[Pe]&&(Q[Pe]=_n,ae[Pe]=B[pt])}}}}}}}async function u(){for(let Ve=0;Ve<F;Ve+=ee)c(Ve,Math.min(Ve+ee,F)),e.shouldUpdate&&await e.update({message:"projecting points",current:Ve,max:F})}let d=v(),f=v(),m=v(),p=v();function h(Ve,Xe){let pt=O[Ve],_e=O[Xe],Ie=d[0]=I[Xe]-I[Ve],Re=d[1]=k[Xe]-k[Ve],ze=d[2]=R[Xe]-R[Ve],N=Ie*Ie+Re*Re+ze*ze,J=Math.sqrt(N),Ae=(pt*pt+J*J-_e*_e)/(2*pt*J),qe=pt*Ae;v.normalize(d,d),MVt(m,d),v.normalize(m,m),v.cross(p,d,m),v.normalize(p,p);let Be=Math.sqrt(pt*pt-qe*qe);v.scale(m,m,Be),v.scale(p,p,Be),v.scale(d,d,qe),f[0]=d[0]+I[Ve],f[1]=d[1]+k[Ve],f[2]=d[2]+R[Ve],a=-1;for(let Qe=0;Qe<C;++Qe){let at=$[Qe],ft=Z[Qe],mt=f[0]+at*m[0]+ft*p[0],dt=f[1]+at*m[1]+ft*p[1],Pt=f[2]+at*m[2]+ft*p[2];if(s(mt,dt,Pt,Ve,Xe)===-1){let Lt=Math.floor(S*(mt-j)),Jt=Math.floor(S*(dt-L)),Rt=Math.floor(S*(Pt-V)),tr=Math.max(0,Lt-w),Kt=Math.max(0,Jt-w),vr=Math.max(0,Rt-w),mn=Math.min(ie,Lt+w+2),Zn=Math.min(oe,Jt+w+2),jr=Math.min(X,Rt+w+2);for(let me=tr;me<mn;++me){let Te=mt-ye[me],Pe=me*K;for(let it=Kt;it<Zn;++it){let Mt=dt-we[it],Et=Te*Te+Mt*Mt,Nr=it*Y+Pe;for(let pn=vr;pn<jr;++pn){let _n=Pt-re[pn],ao=Et+_n*_n,qn=pn+Nr,ps=Q[qn];if(ps>0&&ao<ps*ps){Q[qn]=Math.sqrt(ao);let Eu=Te*d[0]+Mt*d[1]+_n*d[2];ae[qn]=B[Se.indexOf(E,Eu<0?Xe:Ve)]}}}}}}}function g(Ve,Xe){for(let pt=Ve;pt<Xe;++pt){let _e=Se.getAt(E,pt);T.find(I[_e],k[_e],R[_e],O[_e]);for(let Ie=0,Re=D.count;Ie<Re;++Ie){let ze=Se.getAt(E,D.indices[Ie]);_e<ze&&h(_e,ze)}}}async function y(){for(let Ve=0;Ve<F;Ve+=ee)g(Ve,Math.min(Ve+ee,F)),e.shouldUpdate&&await e.update({message:"projecting torii",current:Ve,max:F})}let{resolution:b,probeRadius:x,probePositions:C}=i,S=1/b,w=Math.max(5,2+Math.floor(x*S)),A=v.create(n,n,n);v.scale(A,A,2);let T=Kd(t,r,A),D=T.result;o===null&&(o=T.boundary.box);let{indices:E,x:I,y:k,z:R,id:B,radius:O}=t,F=Se.size(E),q=n+b,W=Ct.expand(Ct(),o,v.create(q,q,q)),[j,L,V]=W.min,U=Ct.scale(Ct(),W,S),z=Ct.size(v(),U);v.ceil(z,z);let[ie,oe,X]=z,Y=X,ne=oe,K=Y*ne,{cosTable:$,sinTable:Z}=BVt(C),de=Rr.Space(z,[0,1,2],Float32Array),Q=de.create(),ae=de.create();Q.fill(-1001),ae.fill(-1);let ye=Z1(ie,j,b),we=Z1(oe,L,b),re=Z1(X,V,b),ee=Math.ceil(1e5/(Math.pow(Math.pow(n,3),3)*S));await u(),await y();let le=Rr.create(de,Q),pe=Rr.create(de,ae),ke=H.identity();return H.fromScaling(ke,v.create(b,b,b)),H.setTranslation(ke,W.min),{field:le,idField:pe,transform:ke,resolution:b,maxRadius:n}}var hR,rso,Eq=M(()=>{Ge();Ue();Ut();Of();or();Gn();hR={probeRadius:_.Numeric(1.4,{min:0,max:10,step:.1},{description:"Radius of the probe tracing the molecular surface."}),resolution:_.Numeric(.5,{min:.01,max:20,step:.01},{description:"Grid resolution/cell spacing.",...$e.CustomQualityParamInfo}),probePositions:_.Numeric(36,{min:12,max:90,step:1},{description:"Number of positions tested for probe target intersection.",...$e.CustomQualityParamInfo})},rso=_.getDefaultValues(hR)});function RVt(e,t,r,n){let{probeRadius:o}=n,{position:i,boundary:a,radius:s}=EP(e,t,r,n),{indices:l}=i,c=Se.size(l),u=new Float32Array(Se.end(l)),d=0;for(let f=0;f<c;++f){let m=Se.getAt(l,f),p=s(m);d<p&&(d=p),u[m]=p+o}return{position:{...i,radius:u},boundary:a,maxRadius:d}}function Dq(e,t,r,n){let{position:o,boundary:i,maxRadius:a}=RVt(e,t,r,n),s=Fy(i.box,n);return Me.create("Molecular Surface",async l=>await WWe(l,o,i,a,i.box,s))}function OVt(e,t,r){let{probeRadius:n}=r,{position:o,boundary:i,radius:a}=DP(e,t,r),{indices:s}=o,l=Se.size(s),c=new Float32Array(Se.end(s)),u=0;for(let d=0;d<l;++d){let f=Se.getAt(s,d),m=a(f);u<m&&(u=m),c[f]=m+n}return{position:{...o,radius:c},boundary:i,maxRadius:u}}function HWe(e,t,r){let{position:n,boundary:o,maxRadius:i}=OVt(e,t,r),a=Fy(o.box,r);return Me.create("Molecular Surface",async s=>await WWe(s,n,o,i,o.box,a))}async function WWe(e,t,r,n,o,i){return GWe(e,t,r,n,o,i)}var Dse=M(()=>{hr();Ps();Eq();Ut()});async function LVt(e,t,r,n,o,i){let{transform:a,field:s,idField:l,resolution:c,maxRadius:u}=await Dq(r,t,n.size,o).runInContext(e.runtime),d={isoLevel:o.probeRadius,scalarField:s,idField:l},f=await rv(d,i).runAsChild(e.runtime);if(o.includeParent){let p=Math.ceil(2/o.resolution);xt.smoothEdges(f,{iterations:p,maxNewEdgeLength:Math.sqrt(2)})}xt.transform(f,a),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(f),P.updateIfChanged(f.varyingGroup,!1)):P.updateIfChanged(f.varyingGroup,!0);let m=be.expand(be(),t.boundary.sphere,u);return f.setBoundingSphere(m),f.meta.resolution=c,f}function KWe(e){return ii({defaultProps:_.getDefaultValues(kq),createGeometry:LVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}async function FVt(e,t,r,n,o){let{transform:i,field:a,idField:s,resolution:l,maxRadius:c}=await HWe(t,r.size,n).runInContext(e.runtime),u={isoLevel:n.probeRadius,scalarField:a,idField:s},d=await rv(u,o).runAsChild(e.runtime);if(n.includeParent){let m=Math.ceil(2/n.resolution);xt.smoothEdges(d,{iterations:m,maxNewEdgeLength:Math.sqrt(2)})}xt.transform(d,i),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(d),P.updateIfChanged(d.varyingGroup,!1)):P.updateIfChanged(d.varyingGroup,!0);let f=be.expand(be(),t.boundary.sphere,c);return d.setBoundingSphere(f),d.meta.resolution=l,d}function YWe(e){return Sl({defaultProps:_.getDefaultValues(kq),createGeometry:FVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}var kq,XWe=M(()=>{Ue();ka();Eq();uo();Dse();$C();yp();Ps();or();MM();Gn();Vt();cc();kq={...Uo,...hR,...LC,...RN}});async function NVt(e,t,r,n,o,i){let{transform:a,field:s,idField:l,maxRadius:c}=await Dq(r,t,n.size,o).runInContext(e.runtime),u={isoLevel:o.probeRadius,scalarField:s,idField:l},d=await DI(u,i).runAsChild(e.runtime);Hn.transform(d,a);let f=be.expand(be(),t.boundary.sphere,c);return d.setBoundingSphere(f),d}function ZWe(e){return bS({defaultProps:_.getDefaultValues(kse),createGeometry:NVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)}},e)}var kse,$We=M(()=>{Ue();ka();Eq();Td();Dse();$C();yp();Ps();or();kse={...vS,...hR,...LC,sizeFactor:_.Numeric(1.5,{min:0,max:10,step:.1})}});function UVt(e,t){return JWe}function VVt(e,t){return Zt.createMulti("Molecular Surface",e,t,No,QWe)}var QWe,JWe,eKe,tKe=M(()=>{XWe();fh();Ue();sc();Eo();$We();Gn();QWe={"molecular-surface-mesh":(e,t)=>bo("Molecular surface mesh",e,t,KWe),"structure-molecular-surface-mesh":(e,t)=>oi("Structure Molecular surface mesh",e,t,YWe),"molecular-surface-wireframe":(e,t)=>bo("Molecular surface wireframe",e,t,ZWe)},JWe={...kq,...kse,visuals:_.MultiSelect(["molecular-surface-mesh"],_.objectToOptions(QWe)),bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.5,{min:0,max:1,step:.01},$e.ShadingCategory)};eKe={name:"molecular-surface",label:"Molecular Surface",description:"Displays a molecular surface.",factory:VVt,getParams:UVt,defaultValues:_.getDefaultValues(JWe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function rKe(e){return ii({defaultProps:_.getDefaultValues(Mse),createGeometry:qVt,createLocationIterator:jVt,getLoci:GVt,eachLocation:HVt,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail}},e)}function zVt(e){if(fe.Traits.is(e.traits,fe.Trait.MultiChain)||fe.Traits.is(e.traits,fe.Trait.Partitioned))return!1;if(fe.isCoarse(e))return!0;if(e.elements.length===0)return!1;e.model.atomicHierarchy.derived.residue.moleculeType;let t=e.residueIndex[e.elements[0]],r=e.model.atomicHierarchy.derived.residue.moleculeType[t];return!(r===_r.Ion||r===_r.Water)}function qVt(e,t,r,n,o,i){if(!zVt(t))return xt.createEmpty(i);let{detail:a,sizeFactor:s}=o,l=256,c=st.createState(l,l/2,i),u=t.principalAxes.boxAxes,{origin:d,dirA:f,dirB:m}=u,p=Na.size(v(),u);v.scale(p,p,s/2);let h=v.create(p[2],p[1],p[0]);c.currentGroup=0,MC(c,d,f,m,h,a+1);let g=st.getMesh(c),y=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return g.setBoundingSphere(y),g}function jVt(e){let{group:t,structure:r}=e,n=1,o=t.units.length,i=te.Location.create(r);return Tn(n,o,1,(s,l)=>{let c=t.units[l];return i.unit=c,i.element=c.elements[s],i})}function GVt(e,t,r){let{objectId:n,instanceId:o}=e;if(r===n){let{structure:i,group:a}=t,s=a.units[o],l=Se.ofBounds(0,s.elements.length);return te.Loci(i,[{unit:s,indices:l}])}return Pr}function HVt(e,t,r){let n=!1;if(!te.Loci.is(e))return!1;let{structure:o,group:i}=t;if(!Oe.areEquivalent(e.structure,o))return!1;let a=i.elements.length;for(let s of e.elements){let l=i.unitIndexMap.get(s.unit.id);l!==void 0&&Se.size(s.indices)===a&&r(xe.ofSingleton(l))&&(n=!0)}return n}var Mse,nKe=M(()=>{Ue();ka();gt();uo();yi();Ge();aU();or();Ut();Sn();Ci();Br();Gn();Mse={...Uo,sizeFactor:_.Numeric(1,{min:0,max:2,step:.1}),detail:_.Numeric(0,{min:0,max:3,step:1},$e.CustomQualityParamInfo)}});function WVt(e,t){return iKe}function KVt(e,t){return Zt.createMulti("Orientation",e,t,No,oKe)}var oKe,iKe,aKe,sKe=M(()=>{fh();Ue();sc();Eo();nKe();Gn();oKe={"orientation-ellipsoid-mesh":(e,t)=>bo("Orientation ellipsoid mesh",e,t,rKe)},iKe={...Mse,visuals:_.MultiSelect(["orientation-ellipsoid-mesh"],_.objectToOptions(oKe)),bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory)};aKe={name:"orientation",label:"Orientation",description:"Displays orientation ellipsoids for polymer chains.",factory:KVt,getParams:WVt,defaultValues:_.getDefaultValues(iKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0}});function YVt(e,t,r,n,o,i){let{child:a}=r,s=a?.unitMap.get(t.id);if(a&&!s)return ac.createEmpty(i);let{stride:l}=o,c=t.elements,u=c.length,d=JC.create(u,u/10,i),f=v(),m=t.conformation,p=If(r,t,o),h=v(),g=0;if(l&&l>1||p)for(let C=0;C<u;++C)l&&C%l!==0||p&&p(c[C])||(m.invariantPosition(c[C],f),Mq(h,h,f),g+=1,d.add(f[0],f[1],f[2],C));else for(let C=0;C<u;++C)m.invariantPosition(c[C],f),Mq(h,h,f),g+=1,d.add(f[0],f[1],f[2],C);let y=d.getPoints();if(g===0)return y;let b;v.scale(h,h,1/g);let x=i?be.clone(i.boundingSphere):void 0;return x&&v.distance(h,x.center)/x.radius<.1?b=x:b=be.expand(be(),(s??t).boundary.sphere,1*o.sizeFactor),y.setBoundingSphere(b),y}function Bq(e){return RFe({defaultProps:_.getDefaultValues(gR),createGeometry:YVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride}},e)}function XVt(e,t,r,n,o){let{child:i}=t,{stride:a}=n,{getSerialIndex:s}=t.serialMapping,l=t.elementCount,c=JC.create(l,l/2,o),u=v(),d=0;for(let h of t.units){let g=i?.unitMap.get(h.id);if(i&&!g)return ac.createEmpty(o);let{elements:y,conformation:b}=h,x=y.length,C=v(),S=If(t,h,n);if(a&&a>1||S)for(let w=0;w<x;w++){let A=y[w];a&&w%a!==0||S&&S(A)||(b.position(A,C),c.add(C[0],C[1],C[2],s(h,A)),Mq(u,u,C),d+=1)}else{for(let w=0;w<x;w++){let A=y[w];b.position(A,C),c.add(C[0],C[1],C[2],s(h,A)),Mq(u,u,C)}d+=x}}let f=c.getPoints();if(d===0)return f;let m;v.scale(u,u,1/d);let p=o?be.clone(o.boundingSphere):void 0;return p&&v.distance(u,p.center)/p.radius<1?m=p:m=be.expand(be(),(i??t).boundary.sphere,1*n.sizeFactor),f.setBoundingSphere(m),f}function Rq(e){return wFe({defaultProps:_.getDefaultValues(ZVt),createGeometry:XVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride}},e)}var Mq,gR,ZVt,Bse=M(()=>{Ue();ka();kb();Foe();Ge();yp();or();cc();Mq=v.add,gR={...BFe,pointSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),stride:_.Numeric(1,{min:1,max:100,step:1})};ZVt={...CFe,pointSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),stride:_.Numeric(1,{min:1,max:100,step:1})}});function $Vt(e,t){let r=cKe;return t.unitSymmetryGroups.length>5e3&&(r=_.clone(r),r.visuals.defaultValue=["structure-element-point"]),r}function QVt(e,t){return Zt.createMulti("Point",e,t,No,lKe)}var lKe,cKe,uKe,dKe=M(()=>{Bse();fh();Ue();sc();Eo();Gn();lKe={"element-point":(e,t)=>bo("Element points",e,t,Bq),"structure-element-point":(e,t)=>oi("Structure element points",e,t,Rq)},cKe={...gR,density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory),visuals:_.MultiSelect(["element-point"],_.objectToOptions(lKe))};uKe={name:"point",label:"Point",description:"Displays elements (atoms, coarse spheres) as points.",factory:QVt,getParams:$Vt,defaultValues:_.getDefaultValues(cKe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0}});function JVt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return xt.createEmpty(i);let{sizeFactor:s,detail:l,linearSegments:c,radialSegments:u}=o,d=c*u*a+(u+1)*a*2,f=st.createState(d,d/10,i),m=r3(c),{curvePoints:p,normalVectors:h,binormalVectors:g,widthValues:y,heightValues:b}=m,x=0,C=QI(t,r,{ignoreSecondaryStructure:!0});for(;C.hasNext;){let A=C.move();f.currentGroup=x;let D=$a(A.moleculeType)?uw:cw;n3(m,A,Q8,D);let E=A.coarseBackboneFirst||A.first,I=A.coarseBackboneLast||A.last,k=n.size.size(A.centerPrev)*s,R=n.size.size(A.center)*s,B=n.size.size(A.centerNext)*s;cR(m,k,R,B,k,R,B,D);let O=c;if(A.initial){O=Math.max(Math.round(c*D),1);let F=c-O;p.copyWithin(0,F*3),g.copyWithin(0,F*3),h.copyWithin(0,F*3),y.copyWithin(0,F*3),b.copyWithin(0,F*3),v.fromArray(bm,p,3),v.normalize(bm,v.sub(bm,A.p2,bm)),v.scaleAndAdd(bm,A.p2,bm,R*o3),v.toArray(bm,p,0)}else A.final&&(O=Math.max(Math.round(c*(1-D)),1),v.fromArray(bm,p,O*3-3),v.normalize(bm,v.sub(bm,A.p2,bm)),v.scaleAndAdd(bm,A.p2,bm,R*o3),v.toArray(bm,p,O*3));A.initial===!0&&A.final===!0?Xr(f,A.p2,R*2,l):u===2?P3(f,p,h,g,O,y,b,0):u===4?T3(f,p,h,g,O,y,b,0,E,I):fR(f,p,h,g,O,u,y,b,E,I,"elliptical"),++x}let S=st.getMesh(f),w=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return S.setBoundingSphere(w),S}function mKe(e){return ii({defaultProps:_.getDefaultValues(Rse),createGeometry:JVt,createLocationIterator:t=>hm.fromGroup(t,{asSecondary:!0}),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail||r.linearSegments!==n.linearSegments||r.radialSegments!==n.radialSegments}},e)}var fKe,Flo,bm,Rse,pKe=M(()=>{Ue();uo();yi();l0();Br();vse();ka();pse();Cse();Ge();iu();Gn();or();fKe={sizeFactor:_.Numeric(.2,{min:0,max:10,step:.01}),detail:_.Numeric(0,{min:0,max:3,step:1},$e.CustomQualityParamInfo),linearSegments:_.Numeric(8,{min:1,max:48,step:1},$e.CustomQualityParamInfo),radialSegments:_.Numeric(16,{min:2,max:56,step:2},$e.CustomQualityParamInfo)},Flo=_.getDefaultValues(fKe),bm=v();Rse={...Uo,...fKe}});function ezt(e,t){let r=_.clone(gKe),n=!1,o=!1;return t.units.forEach(i=>{!n&&fe.isAtomic(i)&&i.nucleotideElements.length&&(n=!0),!o&&i.gapElements.length&&(o=!0)}),r.visuals.defaultValue=["polymer-tube"],o&&r.visuals.defaultValue.push("polymer-gap"),r}function tzt(e,t){return Zt.createMulti("Putty",e,t,No,hKe)}var hKe,gKe,yKe,vKe=M(()=>{pKe();bq();Ue();fh();sc();Eo();gt();Gn();hKe={"polymer-tube":(e,t)=>bo("Polymer tube mesh",e,t,mKe),"polymer-gap":(e,t)=>bo("Polymer gap cylinder",e,t,C3)},gKe={...Rse,...pw,sizeFactor:_.Numeric(.2,{min:0,max:10,step:.01}),visuals:_.MultiSelect(["polymer-tube","polymer-gap"],_.objectToOptions(hKe)),bumpFrequency:_.Numeric(2,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory)};yKe={name:"putty",label:"Putty",description:"Displays a tube smoothly following the trace atoms of polymers.",factory:tzt,getParams:ezt,defaultValues:_.getDefaultValues(gKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uncertainty"},isApplicable:e=>e.polymerResidueCount>0}});function rzt(e,t){let r=Ose;return t.isCoarseGrained&&(Oq||(Oq=_.clone(Ose),Oq.sizeFactor.defaultValue=2),r=Oq),t.unitSymmetryGroups.length>5e3&&(r=_.clone(r),r.visuals.defaultValue=["structure-element-sphere"]),r}function nzt(e,t){return Zt.createMulti("Spacefill",e,t,No,bKe)}var bKe,Ose,Oq,xKe,SKe=M(()=>{_ae();fh();Ue();sc();Eo();Gn();bKe={"element-sphere":(e,t)=>bo("Sphere mesh/impostor",e,t,j8),"structure-element-sphere":(e,t)=>oi("Structure sphere mesh/impostor",e,t,G8)},Ose={...$I,bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.5,{min:0,max:1,step:.01},$e.ShadingCategory),visuals:_.MultiSelect(["element-sphere"],_.objectToOptions(bKe))};xKe={name:"spacefill",label:"Spacefill",description:"Displays atomic/coarse elements as spheres.",factory:nzt,getParams:rzt,defaultValues:_.getDefaultValues(Ose),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function _Ke(e,t,r,n){let o=te.Location.create(t,e),i=e.elements,a=e.bonds,{edgeCount:s,a:l,b:c,edgeProps:u,offset:d}=a,{order:f,flags:m}=u,{sizeFactor:p,aromaticBonds:h,includeTypes:g,excludeTypes:y,multipleBonds:b}=n,x=b==="off",C=b==="symmetric",S=Tt.fromNames(g),w=Tt.fromNames(y),A=HI(S,w,Tt.Flag.Computed),T=v(),D=e.conformation,{elementRingIndices:E,elementAromaticRingIndices:I}=e.rings,k=h?e.resonance.delocalizedTriplets:void 0;return{linkCount:s*2,referencePosition:R=>{let B=l[R],O=c[R],F=k?.getThirdElement(B,O);if(F!==void 0)return D.invariantPosition(i[F],T);B>O&&([B,O]=[O,B]),d[B+1]-d[B]===1&&([B,O]=[O,B]);let q=I.get(B)||E.get(B),W=0;for(let j=d[B],L=d[B+1];j<L;++j){let V=c[j];if(V!==O&&V!==B)if(q){let U=I.get(V)||E.get(V);if(!U)continue;let z=rT(q,U);z>W&&(W=z,D.invariantPosition(i[V],T))}else return D.invariantPosition(i[V],T)}return W>0?T:null},position:(R,B,O,F)=>{D.invariantPosition(i[l[O]],R),D.invariantPosition(i[c[O]],B)},style:R=>{let B=f[R],O=m[R];if(Lse(O,Tt.Flag.MetallicCoordination)||Lse(O,Tt.Flag.HydrogenBond))return Gt.Dashed;if(B===3)return x?Gt.Solid:C?Gt.Triple:Gt.OffsetTriple;if(h){let F=l[R],q=c[R],W=I.get(F),j=I.get(q),L=W&&j?rT(W,j):0;if(Lse(O,Tt.Flag.Aromatic)||L&&!A)return L===2?Gt.MirroredAromatic:Gt.Aromatic}return B!==2||x?Gt.Solid:C?Gt.Double:Gt.OffsetDouble},radius:R=>{o.element=i[l[R]];let B=r.size.size(o);o.element=i[c[R]];let O=r.size.size(o);return Math.min(B,O)*p},ignore:N8(t,e,n)}}function ozt(e,t,r,n,o,i){if(!fe.isAtomic(t))return Hn.createEmpty(i);if(!i1(t,o))return Hn.createEmpty(i);if(!t.bonds.edgeCount)return Hn.createEmpty(i);let{child:a}=r,s=a?.unitMap.get(t.id);if(a&&!s)return Hn.createEmpty(i);let l=_Ke(t,r,n,o),{lines:c,boundingSphere:u}=XM(e,l,o,i);if(u)c.setBoundingSphere(u);else if(c.lineCount>0){let d=be.expand(be(),(s??t).boundary.sphere,1*o.sizeFactor);c.setBoundingSphere(d)}return c}function CKe(e){return bS({defaultProps:_.getDefaultValues(Fse),createGeometry:ozt,createLocationIterator:t=>Pf.fromGroup(t),getLoci:WI,eachLocation:tR,setUpdateState:(t,r,n,o,i,a,s)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!La(r.includeTypes,n.includeTypes)||!La(r.excludeTypes,n.excludeTypes)||r.aromaticBonds!==n.aromaticBonds||r.multipleBonds!==n.multipleBonds;let l=a.group.units[0],c=s.group.units[0];fe.isAtomic(l)&&fe.isAtomic(c)&&(Ns.areEqual(l.bonds,c.bonds)||(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0))}},e)}function izt(e,t,r){let n=[],{bondCount:o,unitIndex:i,unitEdgeIndex:a,unitGroupIndex:s}=e.intraUnitBondMapping,{child:l}=e;for(let c of e.unitSymmetryGroups){let u=c.units[0],d=l?.unitMap.get(u.id),f=fe.isAtomic(u)&&!(l&&!d)?_Ke(u,e,t,r):GU;n.push({group:c,props:f})}return{linkCount:o,referencePosition:c=>{let{group:u,props:d}=n[i[c]];if(!d.referencePosition)return null;let f=d.referencePosition(a[c]);if(!f)return null;let m=u.units[s[c]];return v.transformMat4(f,f,m.conformation.operator.matrix),f},position:(c,u,d,f)=>{let{group:m,props:p}=n[i[d]];p.position(c,u,a[d],f);let h=m.units[s[d]];v.transformMat4(c,c,h.conformation.operator.matrix),v.transformMat4(u,u,h.conformation.operator.matrix)},style:c=>{let{props:u}=n[i[c]];return u.style?u.style(a[c]):Gt.Solid},radius:c=>{let{props:u}=n[i[c]];return u.radius(a[c])},ignore:c=>{let{props:u}=n[i[c]];return u.ignore?u.ignore(a[c]):!1},stub:c=>{let{props:u}=n[i[c]];return u.stub?u.stub(a[c]):!1}}}function azt(e,t,r,n,o){if(!Pl(t,n))return Hn.createEmpty(o);if(!t.intraUnitBondMapping.bondCount)return Hn.createEmpty(o);let i=izt(t,r,n),{lines:a,boundingSphere:s}=XM(e,i,n,o);if(s)a.setBoundingSphere(s);else if(a.lineCount>0){let{child:l}=t,c=be.expand(be(),(l??t).boundary.sphere,1*n.sizeFactor);a.setBoundingSphere(c)}return a}function wKe(e){return MP({defaultProps:_.getDefaultValues(szt),createGeometry:azt,createLocationIterator:(t,r)=>Pl(t,r)?Pf.fromStructureGroups(t):ly,getLoci:oR,eachLocation:iR,setUpdateState:(t,r,n,o,i,a,s)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!La(r.includeTypes,n.includeTypes)||!La(r.excludeTypes,n.excludeTypes)||r.multipleBonds!==n.multipleBonds,Pl(a,r)&&a.interUnitBonds!==s.interUnitBonds&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0)}},e)}var Lse,Fse,szt,TKe=M(()=>{Ue();gt();Ge();Vt();Wg();ka();Br();KI();or();Td();P0();Jn();cc();Ci();Lse=Tt.is;Fse={...vS,...GI,includeParent:_.Boolean(!1)};szt={...kP,...GI,includeParent:_.Boolean(!1)}});function AKe(e,t,r,n){for(Nse.setElement(t,r,n);Nse.hasNext;){let o=Nse.move();return o.otherUnit.conformation.position(o.otherUnit.elements[o.otherIndex],e),e}return null}function lzt(e,t,r){let n=e.interUnitBonds,{edgeCount:o,edges:i}=n,{sizeFactor:a,aromaticBonds:s,multipleBonds:l}=r,c=l==="off",u=l==="symmetric",d=v(),f=te.Location.create();return{linkCount:o,referencePosition:m=>{let p=i[m],h,g,y,b;if(p.unitA<p.unitB)h=e.unitMap.get(p.unitA),g=e.unitMap.get(p.unitB),y=p.indexA,b=p.indexB;else if(p.unitA>p.unitB)h=e.unitMap.get(p.unitB),g=e.unitMap.get(p.unitA),y=p.indexB,b=p.indexA;else throw new Error("same units in createInterUnitBondLines");return AKe(d,e,h,y)||AKe(d,e,g,b)},position:(m,p,h,g)=>{let y=i[h],b=e.unitMap.get(y.unitA),x=e.unitMap.get(y.unitB);b.conformation.position(b.elements[y.indexA],m),x.conformation.position(x.elements[y.indexB],p)},style:m=>{let p=i[m].props.order,h=Ka.create(i[m].props.flag);return Tt.is(h,Tt.Flag.MetallicCoordination)||Tt.is(h,Tt.Flag.HydrogenBond)?Gt.Dashed:p===3?c?Gt.Solid:u?Gt.Triple:Gt.OffsetTriple:s&&Tt.is(h,Tt.Flag.Aromatic)?Gt.Aromatic:p!==2||c?Gt.Solid:u?Gt.Double:Gt.OffsetDouble},radius:m=>{let p=i[m];f.structure=e,f.unit=e.unitMap.get(p.unitA),f.element=f.unit.elements[p.indexA];let h=t.size.size(f);f.unit=e.unitMap.get(p.unitB),f.element=f.unit.elements[p.indexB];let g=t.size.size(f);return Math.min(h,g)*a},ignore:U8(e,r)}}function czt(e,t,r,n,o){if(!Pl(t,n))return Hn.createEmpty(o);if(!t.interUnitBonds.edgeCount)return Hn.createEmpty(o);let i=lzt(t,r,n),{lines:a,boundingSphere:s}=XM(e,i,n,o);if(s)a.setBoundingSphere(s);else if(a.lineCount>0){let{child:l}=t,c=be.expand(be(),(l??t).boundary.sphere,1*n.sizeFactor);a.setBoundingSphere(c)}return a}function PKe(e){return MP({defaultProps:_.getDefaultValues(Use),createGeometry:czt,createLocationIterator:(t,r)=>Pl(t,r)?Pf.fromStructure(t):ly,getLoci:rR,eachLocation:nR,setUpdateState:(t,r,n,o,i,a,s)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!La(r.includeTypes,n.includeTypes)||!La(r.excludeTypes,n.excludeTypes)||r.multipleBonds!==n.multipleBonds,Pl(a,r)&&a.interUnitBonds!==s.interUnitBonds&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0)}},e)}var Nse,Use,IKe=M(()=>{Ue();gt();Ge();Vt();Wg();cc();Br();KI();Td();or();Ci();Nse=new kt.ElementBondIterator;Use={...kP,...GI,includeParent:_.Boolean(!1)}});function uzt(e,t,r,n,o,i){let{child:a}=r;if(a&&!a.unitMap.get(t.id))return Hn.createEmpty(i);let s=t.elements,l=s.length,c=hl.create(l,l/10,i),u=v(),d=v(),f=v(),m=t.conformation,p=If(r,t,o),h=o.crossSize/2,g=o.crosses==="lone",y=v(),b=0;for(let w=0;w<l;++w)p&&p(s[w])||g&&fe.isAtomic(t)&&i1(t,o)&&vf(r,t,w)!==0||(m.invariantPosition(s[w],u),EKe(y,y,u),b+=1,Gh(d,u,Lq,h),Gh(f,u,Lq,-h),c.add(d[0],d[1],d[2],f[0],f[1],f[2],w),Gh(d,u,Fq,h),Gh(f,u,Fq,-h),c.add(d[0],d[1],d[2],f[0],f[1],f[2],w),Gh(d,u,Nq,h),Gh(f,u,Nq,-h),c.add(d[0],d[1],d[2],f[0],f[1],f[2],w));let x=c.getLines();if(b===0)return x;let C;v.scale(y,y,1/b);let S=i?be.clone(i.boundingSphere):void 0;return S&&v.distance(y,S.center)/S.radius<.1?C=S:C=be.expand(be(),t.boundary.sphere,1*o.sizeFactor),x.setBoundingSphere(C),x}function DKe(e){return bS({defaultProps:_.getDefaultValues(Vse),createGeometry:uzt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.crosses!==n.crosses||r.crossSize!==n.crossSize}},e)}function dzt(e,t,r,n,o){let{child:i}=t,{getSerialIndex:a}=t.serialMapping,s=t.elementCount,l=hl.create(s,s/2,o),c=v(),u=v(),d=v(),f=n.crossSize/2,m=n.crosses==="lone",p=v(),h=0;for(let x of t.units){let C=i?.unitMap.get(x.id);if(i&&!C)return Hn.createEmpty(o);let{elements:S,conformation:w}=x,A=S.length,T=If(t,x,n);for(let D=0;D<A;D++){if(T&&T(S[D])||m&&fe.isAtomic(x)&&i1(x,n)&&vf(t,x,D)!==0)continue;w.position(S[D],c),EKe(p,p,c),h+=1;let E=a(x,S[D]);Gh(u,c,Lq,f),Gh(d,c,Lq,-f),l.add(u[0],u[1],u[2],d[0],d[1],d[2],E),Gh(u,c,Fq,f),Gh(d,c,Fq,-f),l.add(u[0],u[1],u[2],d[0],d[1],d[2],E),Gh(u,c,Nq,f),Gh(d,c,Nq,-f),l.add(u[0],u[1],u[2],d[0],d[1],d[2],E)}}let g=l.getLines();if(h===0)return g;let y;v.scale(p,p,1/h);let b=o?be.clone(o.boundingSphere):void 0;return b&&v.distance(p,b.center)/b.radius<1?y=b:y=be.expand(be(),(i??t).boundary.sphere,1*n.sizeFactor),g.setBoundingSphere(y),g}function kKe(e){return MP({defaultProps:_.getDefaultValues(fzt),createGeometry:dzt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.crosses!==n.crosses||r.crossSize!==n.crossSize}},e)}var EKe,Gh,Lq,Fq,Nq,Vse,fzt,MKe=M(()=>{Ue();ka();gt();Ge();yp();or();Td();Qx();lp();KI();cc();EKe=v.add,Gh=v.scaleAndAdd,Lq=v.unitX,Fq=v.unitY,Nq=v.unitZ,Vse={...vS,lineSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),crosses:_.Select("lone",_.arrayToOptions(["lone","all"])),crossSize:_.Numeric(.35,{min:0,max:2,step:.01})};fzt={...kP,lineSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),crosses:_.Select("lone",_.arrayToOptions(["lone","all"])),crossSize:_.Numeric(.35,{min:0,max:2,step:.01})}});function mzt(e,t){let r=RKe;return Oe.getSize(t)>=Oe.Size.Huge?(r=_.clone(r),r.visuals.defaultValue=["intra-bond","element-point","element-cross"]):t.unitSymmetryGroups.length>5e3&&(r=_.clone(r),r.visuals.defaultValue=["structure-intra-bond","structure-element-point","structure-element-cross"]),r}function pzt(e,t){return Zt.createMulti("Line",e,t,No,BKe)}var BKe,RKe,OKe,LKe=M(()=>{TKe();IKe();Ue();fh();zM();sc();Eo();gt();FC();Bse();MKe();kb();Gn();BKe={"intra-bond":(e,t)=>bo("Intra-unit bond line",e,t,CKe),"inter-bond":(e,t)=>oi("Inter-unit bond line",e,t,PKe),"element-point":(e,t)=>bo("Points",e,t,Bq),"element-cross":(e,t)=>bo("Crosses",e,t,DKe),"structure-intra-bond":(e,t)=>oi("Structure intra-unit bond line",e,t,wKe),"structure-element-point":(e,t)=>oi("Structure element points",e,t,Rq),"structure-element-cross":(e,t)=>oi("Structure element crosses",e,t,kKe)},RKe={...Fse,...Use,...gR,...Vse,pointStyle:_.Select("circle",_.objectToOptions(ac.StyleTypes)),multipleBonds:_.Select("offset",_.arrayToOptions(["off","symmetric","offset"])),includeParent:_.Boolean(!1),sizeFactor:_.Numeric(2,{min:.01,max:10,step:.01}),unitKinds:zb(["atomic"]),visuals:_.MultiSelect(["intra-bond","inter-bond","element-point","element-cross"],_.objectToOptions(BKe)),density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory)};OKe={name:"line",label:"Line",description:"Displays bonds as lines and atoms as points or croses.",factory:pzt,getParams:mzt,defaultValues:_.getDefaultValues(RKe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0,getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent}});function hzt(e,t,r,n,o){let{webgl:i}=e;if(!i)throw new Error("GaussianDensityVolume requires `webgl`");let a=v.create(0,1,2),s={min:0,max:1,mean:.04,sigma:.01},l=u=>{let d=u?u.gridTexture.ref.value:void 0,f=wWe(t,r.size,n,i,d),{transform:m,texture:p,bbox:h,gridDim:g}=f,y=H.mul(H(),m,H.fromScaling(H(),g)),b=H.getScaling(v(),m),x=Bc.create(h,g,m,y,b,p,s,!0,a,"byte",u),C=be.expand(be(),t.boundary.sphere,f.maxRadius);return x.setBoundingSphere(C),x},c=l(o);return c.meta.reset=()=>{l(c)},c}function FKe(e){return IFe({defaultProps:_.getDefaultValues(zse),createGeometry:hzt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)},dispose:t=>{t.gridTexture.ref.value.destroy()}},e)}function gzt(e,t,r,n,o,i){let{webgl:a}=e;if(!a)throw new Error("GaussianDensityVolume requires `webgl`");let s=v.create(0,1,2),l={min:0,max:1,mean:.04,sigma:.01},c=d=>{let f=d?d.gridTexture.ref.value:void 0,m=SWe(r,t,n.size,o,a,f),{transform:p,texture:h,bbox:g,gridDim:y}=m,b=H.mul(H(),p,H.fromScaling(H(),y)),x=H.getScaling(v(),p),C=Bc.create(g,y,p,b,x,h,l,!0,s,"byte",d),S=be.expand(be(),t.boundary.sphere,m.maxRadius);return C.setBoundingSphere(S),C},u=c(i);return u.meta.reset=()=>{c(u)},u}function NKe(e){return LFe({defaultProps:_.getDefaultValues(yzt),createGeometry:gzt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)},dispose:t=>{t.gridTexture.ref.value.destroy()}},e)}var zse,yzt,UKe=M(()=>{Ue();Pq();bC();cc();Ge();yp();or();ka();zse={...PFe,...a_,ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),includeParent:_.Boolean(!1,{isHidden:!0})};yzt={...OFe,...a_,ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),includeParent:_.Boolean(!1,{isHidden:!0})}});function vzt(e,t){return zKe}function bzt(e,t){return Zt.createMulti("Gaussian Volume",e,t,No,VKe)}var VKe,zKe,qKe,jKe=M(()=>{Ue();UKe();sc();Eo();VKe={"gaussian-volume":(e,t)=>oi("Gaussian volume",e,t,FKe),"units-gaussian-volume":(e,t)=>bo("Units-Gaussian volume",e,t,NKe)},zKe={...zse,jumpLength:_.Numeric(4,{min:0,max:20,step:.1}),visuals:_.MultiSelect(["gaussian-volume"],_.objectToOptions(VKe))};qKe={name:"gaussian-volume",label:"Gaussian Volume",description:"Displays a gaussian molecular density using direct volume rendering.",factory:bzt,getParams:vzt,defaultValues:_.getDefaultValues(zKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function GKe(e,t,r,n){return r.tryUseImpostor&&hS(n)?wzt(e):Azt(e)}function Czt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return ba.createEmpty(i);let s=a*2,l=_S.create(s,s/4,i),c=t.conformation,u=v(),d=v(),f=v();Nae(t,function(g,y,b,x,C){c.invariantPosition(g,u),c.invariantPosition(y,d);let w=$a(C)?uw:cw;Szt(f,u,xzt(f,_zt(f,d,u),w)),l.add(u[0],u[1],u[2],f[0],f[1],f[2],1,!1,!1,2,b),l.add(f[0],f[1],f[2],d[0],d[1],d[2],1,!1,!1,2,x)});let p=l.getCylinders(),h=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return p.setBoundingSphere(h),p}function wzt(e){return LP({defaultProps:_.getDefaultValues(Uq),createGeometry:Czt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function Tzt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return xt.createEmpty(i);let{radialSegments:s,sizeFactor:l}=o,c=s*2*a*2,u=st.createState(c,c/10,i),d=t.conformation,f=v(),m=v(),p={radiusTop:1,radiusBottom:1,radialSegments:s},h=te.Location.create(r,t),g=te.Location.create(r,t);Nae(t,function(C,S,w,A,T){h.element=C,g.element=S,d.invariantPosition(h.element,f),d.invariantPosition(g.element,m);let E=$a(T)?uw:cw;p.radiusTop=p.radiusBottom=n.size.size(h)*l,u.currentGroup=w,An(u,f,m,E,p),p.radiusTop=p.radiusBottom=n.size.size(g)*l,u.currentGroup=A,An(u,m,f,1-E,p)});let b=st.getMesh(u),x=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return b.setBoundingSphere(x),b}function Azt(e){return ii({defaultProps:_.getDefaultValues(Uq),createGeometry:Tzt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.radialSegments!==n.radialSegments},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var xzt,Szt,_zt,Uq,HKe=M(()=>{Ue();gt();uo();yi();Ge();l0();rp();ka();Gn();or();Br();Ug();jU();W8();Ps();xzt=v.scale,Szt=v.add,_zt=v.sub,Uq={...Uo,...OP,sizeFactor:_.Numeric(.3,{min:0,max:10,step:.01}),radialSegments:_.Numeric(16,{min:2,max:56,step:2},$e.CustomQualityParamInfo),tryUseImpostor:_.Boolean(!0)}});function WKe(e,t,r,n){return r.tryUseImpostor&&IP(n)?Izt(e):Dzt(e)}function Pzt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return yl.createEmpty(i);let s=i0.create(a,a/2,i),l=t.conformation,c=v();Uae(t,(m,p)=>{l.invariantPosition(m,c),s.add(c[0],c[1],c[2],p)});let d=s.getSpheres(),f=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return d.setBoundingSphere(f),d}function Izt(e){return RP({defaultProps:_.getDefaultValues(Vq),createGeometry:Pzt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function Ezt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return xt.createEmpty(i);let{detail:s,sizeFactor:l}=o,c=a*om(s),u=st.createState(c,c/2,i),d=t.conformation,f=v(),m=te.Location.create(r,t);Uae(t,(y,b)=>{m.element=y,d.invariantPosition(m.element,f),u.currentGroup=b,Xr(u,f,n.size.size(m)*l,s)});let h=st.getMesh(u),g=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return h.setBoundingSphere(g),h}function Dzt(e){return ii({defaultProps:_.getDefaultValues(Vq),createGeometry:Ezt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var Vq,KKe=M(()=>{Ue();gt();uo();yi();Ge();l0();ka();Gn();or();iu();Zx();yy();OB();W8();Ps();Vq={...Uo,...BP,sizeFactor:_.Numeric(.3,{min:0,max:10,step:.01}),detail:_.Numeric(0,{min:0,max:3,step:1},$e.CustomQualityParamInfo),tryUseImpostor:_.Boolean(!0)}});function kzt(e,t){let r=_.clone(XKe),n=!1;return t.units.forEach(o=>{!n&&o.gapElements.length&&(n=!0)}),r.visuals.defaultValue=["polymer-backbone-cylinder","polymer-backbone-sphere"],n&&r.visuals.defaultValue.push("polymer-gap"),r}function Mzt(e,t){return Zt.createMulti("Backbone",e,t,No,YKe)}var YKe,XKe,ZKe,$Ke=M(()=>{HKe();Ue();fh();sc();Eo();KKe();bq();Gn();YKe={"polymer-backbone-cylinder":(e,t)=>bo("Polymer backbone cylinder",e,t,GKe),"polymer-backbone-sphere":(e,t)=>bo("Polymer backbone sphere",e,t,WKe),"polymer-gap":(e,t)=>bo("Polymer gap cylinder",e,t,C3)},XKe={...Vq,...Uq,...pw,sizeAspectRatio:_.Numeric(1,{min:.1,max:3,step:.1}),visuals:_.MultiSelect(["polymer-backbone-cylinder","polymer-backbone-sphere","polymer-gap"],_.objectToOptions(YKe)),bumpFrequency:_.Numeric(0,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory),colorMode:_.Select("default",_.arrayToOptions(["default","interpolate"]),{...$e.ShadingCategory,isHidden:!0})};ZKe={name:"backbone",label:"Backbone",description:"Displays polymer backbone with cylinders and spheres.",factory:Mzt,getParams:kzt,defaultValues:_.getDefaultValues(XKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.polymerResidueCount>0}});function QKe(e){return MFe({defaultProps:_.getDefaultValues(qse),createGeometry:Fzt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n,o,i)=>{t.createGeometry=r.imageResolution!==n.imageResolution||r.mode!==n.mode||r.margin!==n.margin||r.frame!==n.frame||r.extent!==n.extent||!v.equals(r.rotation.axis,n.rotation.axis)||r.rotation.angle!==n.rotation.angle||r.offset!==n.offset||r.axis!==n.axis||!v.equals(r.plane.point,n.plane.point)||!v.equals(r.plane.normal,n.plane.normal)||r.antialias!==n.antialias||r.cutout!==n.cutout||r.defaultColor!==n.defaultColor||!Ws.areEqual(o.color,i.color)||!Yo.areEqual(o.size,i.size)}},e)}function Lzt(e,t){let{mode:r,axis:n,frame:o,extent:i,margin:a,rotation:s,plane:l,includeParent:c}=t;c&&e.child&&(e=e.child);let u=v(),d=v(),f=v(),m=v(),p=v(),h=v(),g=0,y=0,b=0,x,C,S;if(o==="principalAxes"){let T=Oe.getPrincipalAxes(e).boxAxes;[g,y,b]=Na.size(v(),T),x=T.dirA,C=T.dirB,S=T.dirC,v.copy(h,T.origin)}else[g,y,b]=Ct.size(v(),e.boundary.box),x=v.create(1,0,0),C=v.create(0,1,0),S=v.create(0,0,1),v.copy(h,e.boundary.sphere.center);if(v.set(d,g,y,b),n==="c"?(v.set(u,g,y,b),v.copy(f,x),v.copy(m,C),v.copy(p,S)):n==="b"?(v.set(u,g,b,y),v.copy(f,x),v.copy(p,C),v.copy(m,S)):(v.set(u,y,b,g),v.copy(p,x),v.copy(f,C),v.copy(m,S)),s.angle!==0){let T=v();v.scaleAndAdd(T,T,x,s.axis[0]),v.scaleAndAdd(T,T,C,s.axis[1]),v.scaleAndAdd(T,T,S,s.axis[2]),v.normalize(T,T);let D=H.fromRotation(H(),zr(s.angle),T);v.transformDirection(f,f,D),v.transformDirection(m,m,D),v.transformDirection(p,p,D)}if(i==="sphere"||s.angle!==0){let T=e.boundary.sphere.radius*2,D=v.magnitude(Ct.size(v(),Ct.fromSphere3D(Ct(),e.boundary.sphere)));v.set(u,D,D,T),i==="sphere"&&v.set(d,T,T,T)}v.addScalar(u,u,a*2),v.addScalar(d,d,a*2);let w=Kr.identity();o==="principalAxes"&&Kr.fromBasis(w,v.normalize(v(),x),v.normalize(v(),C),v.normalize(v(),S)),r==="plane"&&(v.copy(h,l.point),v.copy(p,l.normal),v.cross(f,p,v.unitX),v.dot(f,f)<1e-6&&v.cross(f,p,v.unitY),v.normalize(f,f),v.cross(m,p,f),v.normalize(m,m));let A={type:i==="sphere"?2:3,center:h,scale:d,rotation:w,transform:H.identity()};return{size:u,major:f,minor:m,normal:p,center:h,trim:A}}function Fzt(e,t,r,n,o){let{imageResolution:i,offset:a,antialias:s,cutout:l,defaultColor:c}=n,u=1/i,d="color"in r.color&&r.color.color?r.color.color:()=>De(16777215),{size:f,major:m,minor:p,normal:h,center:g,trim:y}=Lzt(t,n),b=v.create(f[0],f[1],1),x=v.setMagnitude(v(),h,f[2]/2),C=Math.floor(f[1]*u),S=Math.floor(f[0]*u),w=H.identity(),A=v(),T=v();v.add(A,g,m),H.targetTo(w,g,A,p),v.scaleAndAdd(T,g,x,a),H.setTranslation(w,T),H.mul(w,w,H.rotY90),H.scale(w,w,b);let{getSerialIndex:D}=t.serialMapping,E=r.color.granularity.startsWith("vertex"),I=Ko.fromNormalAndCoplanarPoint(Ko(),v.normalize(v(),h),T),k=H.invert(H(),w),R=Ul(v(),v()),B=te.Location.create(t),{units:O}=t,F=0;for(let Y=0,ne=O.length;Y<ne;++Y){let{elements:K}=O[Y];B.unit=O[Y];for(let $=0,Z=K.length;$<Z;++$){B.element=K[$];let de=r.size.size(B);de>F&&(F=de)}}let q=new Uint8Array(C*S*4),W=new Uint8Array(C*S*4),j=new Float32Array(C*S);j.fill(Number.MAX_VALUE);let L=v(),V=v(),U=v();if(E){let Y=0;for(let ne=0;ne<S;++ne)for(let K=0;K<C;++K){let $=en(K+.5,0,C-1)/C-.5,Z=en(ne+.5,0,S-1)/S-.5;v.set(A,Z,-$,0),v.transformMat4(A,A,w),v.copy(R.position,A);let de=d(R,!1);De.toArray(de,q,Y),q[Y+3]=l?0:255,Y+=4}}else for(let Y=0,ne=C*S*4;Y<ne;Y+=4)De.toArray(c,q,Y),q[Y+3]=l?0:255;for(let Y=0,ne=O.length;Y<ne;++Y){let K=O[Y],{elements:$,conformation:Z}=K;B.unit=O[Y];for(let de=0,Q=$.length;de<Q;++de){let ae=$[de];B.element=ae,Z.position(ae,L);let ye=Ko.distanceToPoint(I,L);if(Math.abs(ye)>F)continue;let we=r.size.size(B);if(Math.abs(ye)>we)continue;let re=Math.cos(Math.abs(ye)/we),ee=s?i*re:0,le=we+ee/2,pe=le*le;v.scaleAndAdd(V,L,I.normal,-ye),v.transformMat4(U,V,k),v.addScalar(U,U,.5);let ke=Math.floor(U[0]*S),Ve=C-Math.ceil(U[1]*C),Xe=Math.ceil(we*u),pt=Math.max(0,ke-Xe),_e=Math.max(0,Ve-Xe),Ie=Math.min(S,ke+Xe+2),Re=Math.min(C,Ve+Xe+2);v.copy(R.position,V);let ze=E?c:d(B,!1),N=D(B.unit,B.element);for(let J=pt;J<Ie;++J)for(let Ae=_e;Ae<Re;++Ae){let qe=en(J+.5,0,S-1)/S-.5,Be=en(Ae+.5,0,C-1)/C-.5;Bzt(A,qe,-Be,0),Rzt(A,A,w);let Qe=Ozt(A,L);if(Qe>pe)continue;let at=J*C+Ae;if(Qe<j[at]){let ft=at*4,mt=Math.sqrt(Qe)-we+ee/2,dt=mt>0?1-mt/ee:1;E?dt===1?j[at]=Qe:l&&(W[ft]!==0||W[ft+1]!==0||W[ft+2]!==0)&&(dt=1):dt===1?(j[at]=Qe,De.toArray(ze,q,ft)):l?(De.toArray(ze,q,ft),(W[ft]!==0||W[ft+1]!==0||W[ft+2]!==0)&&(dt=1)):De.toArray(De.interpolate(De.fromArray(q,ft),ze,dt),q,ft),Lg(N,W,ft),W[ft+3]=s?Math.round(255*dt):255,l&&(q[at*4+3]=s?Math.round(255*dt):255)}}}}let z={width:C,height:S,array:q,flipY:!0},ie={width:C,height:S,array:W,flipY:!0},oe={width:1,height:1,array:new Float32Array(1),flipY:!0},X=new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]);return ff(w,X,0,4),pu.create(z,X,ie,oe,y,-1,o)}var Bzt,Rzt,Ozt,qse,JKe=M(()=>{Ue();gt();Ge();or();cc();yp();eS();cy();Gn();Ci();Zl();sa();By();gy();Ry();WA();la();Bzt=v.set,Rzt=v.transformMat4,Ozt=v.squaredDistance,qse={...kFe,interpolation:_.Select("nearest",_.objectToOptions(m6)),imageResolution:_.Numeric(.5,{min:.01,max:20,step:.01},{description:"Grid resolution/cell spacing.",...$e.CustomQualityParamInfo}),mode:_.Select("frame",_.arrayToOptions(["frame","plane"]),{description:"Frame: slice through the structure along arbitrary axes in any step size. Plane: an arbitrary plane defined by point and normal."}),offset:_.Numeric(0,{min:-1,max:1,step:.01},{isEssential:!0,immediateUpdate:!0,hideIf:e=>e.mode!=="frame",description:"Relative offset from center."}),axis:_.Select("c",_.arrayToOptions(["a","b","c"]),{isEssential:!0,hideIf:e=>e.mode!=="frame"}),rotation:_.Group({axis:_.Vec3(v.create(1,0,0),{},{description:"Axis of rotation"}),angle:_.Numeric(0,{min:-180,max:180,step:1},{immediateUpdate:!0,description:"Axis rotation angle in Degrees"})},{isExpanded:!0,hideIf:e=>e.mode!=="frame"}),plane:_.Group({point:_.Vec3(v.create(0,0,0),{},{description:"Plane point"}),normal:_.Vec3(v.create(1,0,0),{},{description:"Plane normal"})},{isExpanded:!0,hideIf:e=>e.mode!=="plane"}),extent:_.Select("frame",_.arrayToOptions(["frame","sphere"]),{description:"Extent of the plane, either box (frame) or sphere."}),margin:_.Numeric(4,{min:0,max:50,step:1},{immediateUpdate:!0,description:"Margin around the structure in Angstrom"}),frame:_.Select("principalAxes",_.arrayToOptions(["principalAxes","boundingBox"])),antialias:_.Boolean(!0,{description:"Antialiasing of structure edges."}),cutout:_.Boolean(!1,{description:"Cutout the structure from the image."}),defaultColor:_.Color(De(13421772),{description:"Default color for parts of the image that are not covered by the color theme."}),includeParent:_.Boolean(!1,{description:"Show parent structure (but within extent of this structure)."})}});function Nzt(e,t){return tYe}function Uzt(e,t){return Zt.createMulti("Plane",e,t,No,eYe)}var eYe,tYe,rYe,nYe=M(()=>{Ue();sc();Eo();JKe();eYe={"plane-image":(e,t)=>oi("Plane image",e,t,QKe)},tYe={...qse,visuals:_.MultiSelect(["plane-image"],_.objectToOptions(eYe))};rYe={name:"plane",label:"Plane",description:"Displays planes.",factory:Uzt,getParams:Nzt,defaultValues:_.getDefaultValues(tYe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0,getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent}});var D3,oYe=M(()=>{Aa();Eo();m7e();N7e();ZHe();oWe();FWe();jWe();tKe();sKe();dKe();vKe();SKe();LKe();jKe();$Ke();nYe();D3=class e extends yP{constructor(){super(),pa(e.BuiltIn,(t,r)=>{if(t.name!==r)throw new Error(`Fix BuiltInStructureRepresentations to have matching names. ${t.name} ${r}`);this.add(t)})}};(function(e){e.BuiltIn={cartoon:XHe,backbone:ZKe,"ball-and-stick":f7e,carbohydrate:F7e,ellipsoid:nWe,"gaussian-surface":LWe,"gaussian-volume":qKe,label:qWe,line:OKe,"molecular-surface":eKe,orientation:aKe,plane:rYe,point:uKe,putty:yKe,spacefill:xKe}})(D3||(D3={}))});var Vzt,zq,iYe=M(()=>{ed();Fn();XN();Vzt=1e3/30,zq=class{get isAnimating(){return this._isAnimating}async tick(t,r){var n,o;if(await this.plugin.managers.animation.tick(t,r?.isSynchronous,r?.animation),(n=this.plugin.canvas3d)===null||n===void 0||n.tick(t,r),Ye){let i=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.webgl.timer.resolve();if(i)for(let a of i)fM([a])}}resetTime(t){var r;(r=this.plugin.canvas3d)===null||r===void 0||r.resetTime(t)}start(t){var r,n;(r=this.plugin.canvas3d)===null||r===void 0||r.resume(),this._isAnimating=!0,this.resetTime(0),this.properTimeT=0,this.lastTickT=Kn(),t?.immediate?this.frame():this.currentFrame=(n=this.plugin.canvas3d)===null||n===void 0?void 0:n.requestAnimationFrame(this.frame)}stop(t){var r,n;this._isAnimating=!1,this.currentFrame!==void 0&&((r=this.plugin.canvas3d)===null||r===void 0||r.cancelAnimationFrame(this.currentFrame),this.currentFrame=void 0),t?.noDraw&&((n=this.plugin.canvas3d)===null||n===void 0||n.pause(t?.noDraw))}constructor(t){this.plugin=t,this.lastTickT=0,this.properTimeT=0,this.currentFrame=void 0,this._isAnimating=!1,this.frame=(r,n)=>{var o;let i=Kn(),a=i-this.lastTickT;this.lastTickT=i,this.properTimeT+=Math.min(a,Vzt),this.tick(this.properTimeT,{xrFrame:n}),this._isAnimating&&(this.currentFrame=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.requestAnimationFrame(this.frame))}}}});var qq,aYe=M(()=>{_o();yn();qx();qq=class{getDecorator(t){let r=this.plugin.state.data.tree,n=r.children.get(t);if(n.size!==1)return t;let o=n.first();return o&&r.transforms.get(o).transformer.definition.isDecorator?this.getDecorator(o):t}get(t,r=!1){let n=this.root.get(t);if(n)return r?this.plugin.state.data.cells.get(n.ref):this.plugin.state.data.cells.get(this.getDecorator(n.ref))}addMapping(t,r,n){if(!ue.Molecule.Structure.is(n))return!1;if(this.tracked.set(r,n.data),this.root.has(n.data)){let o=this.root.get(n.data);o.count++}else{let o=t.select(ir.Generators.byRef(r).rootOfType([ue.Molecule.Structure]))[0];o?this.root.set(n.data,{ref:o.transform.ref,count:1}):this.root.set(n.data,{ref:r,count:1})}return!0}removeMapping(t){if(!this.tracked.has(t))return!1;let r=this.tracked.get(t);this.tracked.delete(t);let n=this.root.get(r);return n.count>1?n.count--:this.root.delete(r),!0}updateMapping(t,r,n,o){return ue.Molecule.Structure.is(o)?(this.removeMapping(r),this.addMapping(t,r,o),!0):!1}dispose(){this.ev.dispose()}constructor(t){this.plugin=t,this.ev=_d.create(),this.events={updated:this.ev(),removed:this.ev()},this.root=new Map,this.tracked=new Map,t.state.data.events.object.created.subscribe(r=>{this.addMapping(r.state,r.ref,r.obj)}),t.state.data.events.object.removed.subscribe(r=>{this.removeMapping(r.ref)&&this.events.removed.next({ref:r.ref,obj:r.obj})}),t.state.data.events.object.updated.subscribe(r=>{this.updateMapping(r.state,r.ref,r.oldObj,r.obj)&&this.events.updated.next({ref:r.ref,oldObj:r.oldObj,obj:r.obj})})}}});var k3,sYe=M(()=>{hr();qx();ed();jH();Jn();k3=class{constructor(){this.ev=_d.create(),this.id=0,this.runningTasks=new Set,this.abortRequests=new Map,this.options=new Map,this.currentContext=[],this.events={progress:this.ev(),finished:this.ev()}}tryGetAbortTaskId(t){if(this.abortRequests.has(t.progress.taskId))return t.progress.taskId;for(let r of t.children){let n=this.tryGetAbortTaskId(r);if(n!==void 0)return n}}track(t,r){return n=>{var o;if(n.canAbort&&n.requestAbort){let a=this.tryGetAbortTaskId(n.root);a!==void 0&&n.requestAbort(this.abortRequests.get(a))}let i=Kn()-n.root.progress.startedTime;this.events.progress.next({id:t,useOverlay:(o=this.options.get(r))===null||o===void 0?void 0:o.useOverlay,level:i<250?"none":"background",progress:n})}}async run(t,r){let n=this.id++,o;r?.createNewContext||this.currentContext.length===0?o={ctx:fme(t,this.track(n,t.id),100),refCount:1}:(o=this.currentContext[this.currentContext.length-1],o.refCount++);try{return this.options.set(t.id,{useOverlay:!!r?.useOverlay}),this.runningTasks.add(t.id),await l4(o.ctx,t)}finally{this.options.delete(t.id),this.runningTasks.delete(t.id),this.events.finished.next({id:n}),this.abortRequests.delete(t.id),o.refCount--,o.refCount===0&&tg(this.currentContext,o)}}requestAbortAll(t){this.runningTasks.forEach(r=>this.abortRequests.set(r,t))}requestAbort(t,r){let n=typeof t=="number"?t:t.root.progress.taskId;this.abortRequests.set(n,r)}dispose(){this.ev.dispose()}};(function(e){function t(n){return new Promise(o=>setTimeout(o,n))}function r(n){return Me.create("Test",async o=>{let i=0;for(;i<n;)await t(100+Math.random()*200),o.shouldUpdate&&await o.update({message:"Step "+i,current:i,max:n,isIndeterminate:!1}),i++})}e.testTask=r})(k3||(k3={}))});var jq,lYe=M(()=>{Cf();vb();Ri();jq=class extends uc{findByKey(t){return this.state.entries.find(r=>!!r&&r.key===t)}show(t){let r=this.state.entries,n,o=++this.serialId,i;t.key&&(n=this.findByKey(t.key))?(n.timeout!==void 0&&clearTimeout(n.timeout),i=n.serialNumber,r=r.remove(n.id)):i=++this.serialNumber,n={id:o,serialNumber:i,key:t.key,title:t.title,message:t.message,timeout:this.timeout(o,t.timeoutMs),hide:()=>this.hideId(o)},this.updateState({entries:r.set(o,n)})&&this.events.changed.next(void 0)}timeout(t,r){if(r!==void 0)return r<0&&(r=500),setTimeout(()=>{let n=this.state.entries.get(t);n.timeout=void 0,this.hide(n)},r)}hideId(t){this.hide(this.state.entries.get(t))}hide(t){t&&(t.timeout!==void 0&&clearTimeout(t.timeout),t.hide=void 0,this.updateState({entries:this.state.entries.delete(t.id)})&&this.events.changed.next(void 0))}constructor(t){super({entries:rc()}),this.events={changed:this.ev()},this.serialNumber=0,this.serialId=0,St.Toast.Show.subscribe(t,r=>this.show(r)),St.Toast.Hide.subscribe(t,r=>this.hide(this.findByKey(r.key)))}}});function zzt(){let e=document.createElement("canvas");return e.getContext&&e.getContext("2d")?e.toDataURL("image/webp").indexOf("data:image/webp")===0:!1}var Gq,cYe=M(()=>{sI();OV();Gd();Cf();_o();yn();hr();Jr();FV();Ue();Nf();Gq=class extends dp{createParams(){let t=8192;if(this.plugin.canvas3d){let{webgl:r}=this.plugin.canvas3d;t=Math.floor(Math.min(r.maxRenderbufferSize,r.maxTextureSize)/2)}return{resolution:_.MappedStatic("viewport",{viewport:_.Group({}),hd:_.Group({}),"full-hd":_.Group({}),"ultra-hd":_.Group({}),custom:_.Group({width:_.Numeric(1920,{min:128,max:t,step:1}),height:_.Numeric(1080,{min:128,max:t,step:1})},{isFlat:!0})},{options:[["viewport","Viewport"],["hd","HD (1280 x 720)"],["full-hd","Full HD (1920 x 1080)"],["ultra-hd","Ultra HD (3840 x 2160)"],["custom","Custom"]]}),format:_.MappedStatic("png",{png:_.Group({}),webp:_.Group({quality:_.Numeric(.9,{min:0,max:1,step:.01})}),jpeg:_.Group({quality:_.Numeric(.9,{min:0,max:1,step:.01})})},{options:[["png","PNG"],["jpeg","JPEG"],...zzt()?[["webp","WebP"]]:[]]}),transparent:_.Boolean(!1),axes:IS.axes,illumination:_.Group({extraIterations:_.Numeric(1,{min:0,max:5,step:1}),targetIterationTimeMs:_.Numeric(300,{min:100,max:3e3,step:10})})}}get params(){return this._params?this._params:this._params=this.createParams()}get values(){return this.behaviors.values.value}get cropParams(){return this.behaviors.cropParams.value}get relativeCrop(){return this.behaviors.relativeCrop.value}getCanvasSize(){var t,r;return{width:((t=this.plugin.canvas3d)===null||t===void 0?void 0:t.webgl.gl.drawingBufferWidth)||0,height:((r=this.plugin.canvas3d)===null||r===void 0?void 0:r.webgl.gl.drawingBufferHeight)||0}}getSize(){let t=this.values;switch(t.resolution.name){case"viewport":return this.getCanvasSize();case"hd":return{width:1280,height:720};case"full-hd":return{width:1920,height:1080};case"ultra-hd":return{width:3840,height:2160};default:return{width:t.resolution.params.width,height:t.resolution.params.height}}}getPostprocessingProps(){let t=this.plugin.canvas3d,r=t.props.postprocessing.occlusion;return{...t.props.postprocessing,occlusion:r.name==="on"?{name:"on",params:{...r.params,samples:128,resolutionScale:t.webgl.pixelRatio,transparentThreshold:1}}:r}}getIlluminationProps(t){let n=this.plugin.canvas3d.props.illumination,{extraIterations:o,targetIterationTimeMs:i}=this.values.illumination;return{...n,enabled:t?!1:n.enabled,maxIterations:Math.ceil(Math.log2(Math.pow(2,n.maxIterations+o)*n.rendersPerFrame[1])),targetFps:1e3/i,denoiseThreshold:[n.denoiseThreshold[0],n.denoiseThreshold[0]],rendersPerFrame:[1,1]}}createPass(t){let r=this.plugin.canvas3d,{colorBufferFloat:n,textureFloat:o}=r.webgl.extensions;return r.getImagePass({transparentBackground:this.values.transparent,cameraHelper:{axes:this.values.axes},multiSample:{...r.props.multiSample,mode:t?"off":"on",sampleLevel:n&&o?4:2,reuseOcclusion:!1},postprocessing:this.getPostprocessingProps(),marking:{...r.props.marking},illumination:this.getIlluminationProps(t)})}get previewPass(){return this._previewPass||(this._previewPass=this.createPass(!0))}get imagePass(){if(this._imagePass){let t=this.plugin.canvas3d;return this._imagePass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:this.getPostprocessingProps(),marking:{...t.props.marking},illumination:this.getIlluminationProps(!1)}),this._imagePass}return this._imagePass=this.createPass(!1)}getFilename(t){typeof t!="string"&&(t=this.extension);let r=this.plugin.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Model)).map(i=>i.obj.data),n=new Set;return r.forEach(i=>n.add(i.entryId.toUpperCase())),`${So.toArray(n).join("-")||"molstar-image"}${t}`}resetCrop(){this.behaviors.relativeCrop.next({x:0,y:0,width:1,height:1})}toggleAutocrop(){this.cropParams.auto?(this.behaviors.cropParams.next({...this.cropParams,auto:!1}),this.resetCrop()):this.behaviors.cropParams.next({...this.cropParams,auto:!0})}get isFullFrame(){let t=this.relativeCrop;return Lo(t.x,0,1e-5)&&Lo(t.y,0,1e-5)&&Lo(t.width,1,1e-5)&&Lo(t.height,1,1e-5)}autocrop(t=this.cropParams.relativePadding){let{data:r,width:n,height:o}=this.previewData.image,i=this.previewData.transparent,a=i?this.previewData.background:4278190080|this.previewData.background,s=n,l=0,c=o,u=0;for(let p=0;p<o;p++){let h=p*n;for(let g=0;g<n;g++){let y=4*(h+g);if(i){if(r[y+3]===0)continue}else if((r[y]<<16|r[y+1]<<8|r[y+2]|r[y+3]<<24)===a)continue;g<s&&(s=g),g>l&&(l=g),p<c&&(c=p),p>u&&(u=p)}}if(s>l){let p=s;s=l,l=p}if(c>u){let p=c;c=u,u=p}let d=l-s+1,f=u-c+1;s-=t*d,l+=t*d,c-=t*f,u+=t*f;let m={x:Math.max(0,s/n),y:Math.max(0,c/o),width:Math.min(1,(l-s+1)/n),height:Math.min(1,(u-c+1)/o)};this.behaviors.relativeCrop.next(m)}async getPreview(t,r=320){let{width:n,height:o}=this.getSize();if(n<=0||o<=0)return;let i=n/o,a=0,s=0;i>1?(a=r,s=Math.round(r/i)):(s=r,a=Math.round(r*i));let l=this.plugin.canvas3d.props;this.previewPass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:l.postprocessing,marking:l.marking});let c=await this.previewPass.getImageData(t,a,s),u=this.previewCanvas;u.width=c.width,u.height=c.height,this.previewData.image=c,this.previewData.background=l.renderer.backgroundColor,this.previewData.transparent=this.values.transparent;let d=u.getContext("2d");if(!d)throw new Error("Could not create canvas 2d context");return d.putImageData(c,0,0),this.cropParams.auto&&this.autocrop(),this.events.previewed.next(void 0),{canvas:u,width:a,height:s}}getSizeAndViewport(){let{width:t,height:r}=this.getSize(),n=this.relativeCrop,o={x:Math.floor(n.x*t),y:Math.floor(n.y*r),width:Math.ceil(n.width*t),height:Math.ceil(n.height*r)};return o.width+o.x>t&&(o.width=t-o.x),o.height+o.y>r&&(o.height=r-o.y),{width:t,height:r,viewport:o}}async draw(t){let{width:r,height:n,viewport:o}=this.getSizeAndViewport();if(!(r<=0||n<=0)){this.plugin.animationLoop.stop({noDraw:!0});try{await t.update("Rendering image...");let i=this.imagePass;await i.updateBackground();let a=await i.getImageData(t,r,n,o);await t.update("Encoding image...");let s=this.canvas;s.width=a.width,s.height=a.height;let l=s.getContext("2d");if(!l)throw new Error("Could not create canvas 2d context");l.putImageData(a,0,0)}finally{this.plugin.animationLoop.start({immediate:!0})}}}copyToClipboardTask(){let t=navigator.clipboard;if(!t?.write){this.plugin.log.error("clipboard.write not supported!");return}return Me.create("Copy Image",async r=>{await this.draw(r),await r.update("Converting image...");let n=this.mimeType,o=await mB(this.canvas,n,this.quality),i=new ClipboardItem({[n]:o});await t.write([i]),this.plugin.log.message("Image copied to clipboard.")})}get mimeType(){var t,r;return`image/${(r=(t=this.values.format)===null||t===void 0?void 0:t.name)!==null&&r!==void 0?r:"png"}`}get extension(){var t,r,n;switch((t=this.values.format)===null||t===void 0?void 0:t.name){case"jpeg":return".jpg";default:return`.${(n=(r=this.values.format)===null||r===void 0?void 0:r.name)!==null&&n!==void 0?n:"png"}`}}get quality(){var t,r,n,o;switch((t=this.values.format)===null||t===void 0?void 0:t.name){case"webp":case"jpeg":return(o=(n=(r=this.values.format)===null||r===void 0?void 0:r.params)===null||n===void 0?void 0:n.quality)!==null&&o!==void 0?o:.9;default:return}}getImageDataUri(){return this.plugin.runTask(Me.create("Generate Image",async t=>(await this.draw(t),await t.update("Converting image..."),this.canvas.toDataURL(this.mimeType))))}copyToClipboard(){let t=this.copyToClipboardTask();if(t)return this.plugin.runTask(t)}downloadTask(t){return Me.create("Download Image",async r=>{await this.draw(r),await r.update("Downloading image...");let n=await mB(this.canvas,this.mimeType,this.quality);fI(n,t??this.getFilename(this.extension))})}download(t){return this.plugin.runTask(this.downloadTask(t),{useOverlay:!0})}constructor(t){super(),this.plugin=t,this._params=void 0,this.behaviors={values:this.ev.behavior({transparent:this.params.transparent.defaultValue,format:{name:"png",params:{}},axes:{name:"off",params:{}},resolution:this.params.resolution.defaultValue,illumination:this.params.illumination.defaultValue}),cropParams:this.ev.behavior({auto:!0,relativePadding:.1}),relativeCrop:this.ev.behavior({x:0,y:0,width:1,height:1})},this.events={previewed:this.ev()},this.canvas=(function(){return document.createElement("canvas")})(),this.previewCanvas=(function(){return document.createElement("canvas")})(),this.previewData={image:{data:new Uint8ClampedArray(1),width:1,height:0},background:De(0),transparent:!1}}}});function qzt(e,t){let r=t.filter(n=>{let o=n.name.toLowerCase();return o.endsWith(".molx")||o.endsWith(".molj")});r.length>0?St.State.Snapshots.OpenFile(e,{file:r[0]}):e.runTask(e.state.data.applyAction(XB,{files:t.map(n=>Un.File(n)),format:{name:"auto",params:{}},visuals:!0}))}var Hq,uYe=M(()=>{S8();Lm();Ri();Hq=class{addHandler(t,r){let n=this.handlers.findIndex(o=>o[0]===t);n<0?this.handlers.push([t,r]):this.handlers[n][1]=r}removeHandler(t){let r=this.handlers.findIndex(n=>n[0]===t);r>=0&&this.handlers.splice(r,1)}async handle(t){for(let r=this.handlers.length-1;r>=0;r--){let n=this.handlers[r][1];if(await n(t,this.plugin))return}qzt(this.plugin,t)}dispose(){this.handlers.length=0}constructor(t){this.plugin=t,this.handlers=[]}}});var Wq,dYe=M(()=>{Wq=class{constructor(){this.errors=Object.create(null)}get(t){var r;return(r=this.errors[t])!==null&&r!==void 0?r:[]}add(t,r){t in this.errors&&Array.isArray(this.errors[t])?this.errors[t].push(r):this.errors[t]=[r]}clear(t){delete this.errors[t]}}});var Kq,fYe=M(()=>{Kq=class{mount(t){var r;this.parent.parentElement!==t&&((r=this.parent.parentElement)===null||r===void 0||r.removeChild(this.parent)),t.appendChild(this.parent)}unmount(){var t;(t=this.parent.parentElement)===null||t===void 0||t.removeChild(this.parent)}constructor(t){this.options=t;let r=document.createElement("div");Object.assign(r.style,{position:"absolute",left:0,top:0,right:0,bottom:0,"-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none","touch-action":"manipulation"});let n=t?.canvas;n||(n=document.createElement("canvas"),t?.checkeredCanvasBackground&&Object.assign(n.style,{"background-image":"linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey), linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey)","background-size":"60px 60px","background-position":"0 0, 30px 30px"}),r.appendChild(n)),this.canvas=n,this.parent=r}}});var Yq,mYe=M(()=>{Ab();vb();es();n8();cI();OV();Ge();_Ge();CGe();DGe();FGe();_y();NGe();KGe();doe();YGe();zre();iz();XGe();cz();uoe();fae();xoe();$Ge();QGe();Eo();oYe();joe();yn();hr();By();Ry();Lm();Jr();OD();Fn();hh();dQ();Aa();qx();iYe();fB();_f();Vre();Ri();vu();uI();aYe();sYe();lYe();cYe();dI();h2();uYe();dYe();fYe();Yq=class{get isInitialized(){return this._isInitialized}build(){return this.state.data.build()}async initViewerAsync(t,r,n){return this._initViewer(t,r,n)}async initContainerAsync(t){return this._initContainer(t)}async mountAsync(t,r){return this._mount(t,r)}_initContainer(t){var r;if(this.container)return!0;let n=new Kq({checkeredCanvasBackground:t?.checkeredCanvasBackground,canvas:(r=t?.canvas3dContext)===null||r===void 0?void 0:r.canvas});return this._initViewer(n.canvas,n.parent,t?.canvas3dContext)?(this.container=n,!0):!1}_mount(t,r){var n;if(this.disposed)throw new Error("Cannot mount a disposed context");return this._initContainer(r)?((n=this.container)===null||n===void 0||n.mount(t),this.handleResize(),!0):!1}unmount(){var t;(t=this.container)===null||t===void 0||t.unmount()}_initViewer(t,r,n){var o,i,a,s,l,c;try{this.layout.setRoot(r),this.spec.layout&&this.spec.layout.initial&&this.layout.setProps(this.spec.layout.initial),n||(n=bh.fromCanvas(t,this.managers.asset,{antialias:!((o=this.config.get(on.General.DisableAntialiasing))!==null&&o!==void 0&&o),preserveDrawingBuffer:!((i=this.config.get(on.General.DisablePreserveDrawingBuffer))!==null&&i!==void 0&&i),preferWebGl1:this.config.get(on.General.PreferWebGl1)||!1,failIfMajorPerformanceCaveat:!((a=this.config.get(on.General.AllowMajorPerformanceCaveat))!==null&&a!==void 0&&a),powerPreference:this.config.get(on.General.PowerPreference)||"high-performance",handleResize:this.handleResize},{pixelScale:this.config.get(on.General.PixelScale)||1,pickScale:this.config.get(on.General.PickScale)||.25,transparency:this.config.get(on.General.Transparency)||"wboit",resolutionMode:this.config.get(on.General.ResolutionMode)||"auto"})),this.canvas3dContext=n,this.canvas3d=BV.create(this.canvas3dContext),this.canvas3dInit.next(!0);let u=this.spec.canvas3d,d=De(16579577);return u?(((l=u.renderer)===null||l===void 0?void 0:l.backgroundColor)===void 0&&(u=Vu(u,f=>{f.renderer?f.renderer.backgroundColor=d:f.renderer={backgroundColor:d}})),(c=this.canvas3d)===null||c===void 0||c.setProps(u)):(s=this.canvas3d)===null||s===void 0||s.setProps({renderer:{backgroundColor:d}}),this.animationLoop.start(),this.helpers.viewportScreenshot=new Gq(this),this.subs.push(this.canvas3d.interaction.click.subscribe(f=>this.behaviors.interaction.click.next(f))),this.subs.push(this.canvas3d.interaction.drag.subscribe(f=>this.behaviors.interaction.drag.next(f))),this.subs.push(this.canvas3d.interaction.hover.subscribe(f=>this.behaviors.interaction.hover.next(f))),this.subs.push(this.canvas3d.input.resize.pipe(zx(50),Sd(100,void 0,{leading:!1,trailing:!0})).subscribe(()=>this.handleResize())),this.subs.push(this.canvas3d.input.keyDown.subscribe(f=>this.behaviors.interaction.key.next(f))),this.subs.push(this.canvas3d.input.keyUp.subscribe(f=>this.behaviors.interaction.keyReleased.next(f))),this.subs.push(this.canvas3d.xr.isPresenting.subscribe(f=>this.log.info(`WebXR ${f?"enabled":"disabled"}`))),this.subs.push(this.canvas3d.xr.requestFailed.subscribe(f=>this.log.error(`WebXR request failed: ${f}`))),this.subs.push(this.layout.events.updated.subscribe(()=>requestAnimationFrame(()=>this.handleResize()))),this.handleResize(),rg.setImmediate(()=>this.initCanvas3dPromiseCallbacks[0]()),!0}catch(u){return this.log.error(""+u),console.error(u),rg.setImmediate(()=>this.initCanvas3dPromiseCallbacks[1](u)),!1}}get isBusy(){return this.behaviors.state.isAnimating.value||this.behaviors.state.isUpdating.value}get selectionMode(){return this.behaviors.interaction.selectionMode.value}set selectionMode(t){this.behaviors.interaction.selectionMode.next(t)}dataTransaction(t,r){return this.runTask(this.state.data.transaction(t,r))}clear(t=!1){var r;return t&&((r=this.canvas3d)===null||r===void 0||r.setProps(uB)),St.State.RemoveObject(this,{state:this.state.data,ref:Ur.RootRef})}dispose(t){var r,n;if(!this.disposed){for(let o of this.subs)o.unsubscribe();this.subs=[],this.managers.markdownExtensions.audio.dispose(),this.animationLoop.stop(),this.commands.dispose(),(r=this.canvas3d)===null||r===void 0||r.dispose(),t?.doNotDisposeCanvas3DContext||(n=this.canvas3dContext)===null||n===void 0||n.dispose(t),this.ev.dispose(),this.state.dispose(),this.helpers.substructureParent.dispose(),pa(this.managers,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),pa(this.managers.structure,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),pa(this.managers.volume,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),this.unmount(),this.container=void 0,this.customState={},this.disposed=!0}}initBehaviorEvents(){this.subs.push(xd(this.state.data.behaviors.isUpdating,this.state.behaviors.behaviors.isUpdating).subscribe(a=>{this.behaviors.state.isUpdating.value!==a&&this.behaviors.state.isUpdating.next(a)}));let t=this.config.get(on.General.IsBusyTimeoutMs)||750,r=this.behaviors.state.isBusy,n,o=()=>{r.value||r.next(!0)},i=()=>{n!==void 0&&clearTimeout(n),n=void 0};this.subs.push(xd(this.behaviors.state.isUpdating,this.behaviors.state.isAnimating).subscribe(a=>{let s=this.behaviors.state.isUpdating.value,l=this.behaviors.state.isAnimating.value;s||l?r.value||(i(),n=setTimeout(o,t)):(i(),r.next(!1))})),this.subs.push(this.behaviors.interaction.selectionMode.subscribe(a=>{var s;a||(s=this.managers.interactivity)===null||s===void 0||s.lociSelects.deselectAll()}))}initBuiltInBehavior(){vB.State.registerDefault(this),vB.Representation.registerDefault(this),vB.Camera.registerDefault(this),vB.Misc.registerDefault(this),this.subs.push(xd(this.state.data.events.log,this.state.behaviors.events.log).subscribe(t=>this.events.log.next(t)))}async initBehaviors(){let t=this.state.behaviors.build();for(let r of Object.keys(cn.Categories))t.toRoot().apply(cn.CreateCategory,{label:cn.Categories[r]},{ref:r,state:{isLocked:!0}});for(let r of this.spec.behaviors)cn.getCategoryId(r.transformer)==="custom-props"&&t.to(cn.getCategoryId(r.transformer)).apply(r.transformer,r.defaultParams,{ref:r.transformer.id});await this.runTask(this.state.behaviors.updateTree(t,{doNotUpdateCurrent:!0,doNotLogTiming:!0})),t=this.state.behaviors.build();for(let r of this.spec.behaviors)cn.getCategoryId(r.transformer)!=="custom-props"&&t.to(cn.getCategoryId(r.transformer)).apply(r.transformer,r.defaultParams,{ref:r.transformer.id});await this.runTask(this.state.behaviors.updateTree(t,{doNotUpdateCurrent:!0,doNotLogTiming:!0}))}initCustomFormats(){if(this.spec.customFormats)for(let t of this.spec.customFormats)this.dataFormats.add(t[0],t[1])}initAnimations(){if(this.spec.animations)for(let t of this.spec.animations)this.managers.animation.register(t)}initDataActions(){if(this.spec.actions)for(let t of this.spec.actions)this.state.data.actions.add(t.action)}async init(){try{this.subs.push(this.events.log.subscribe(t=>this.log.entries=this.log.entries.push(t))),this.initCustomFormats(),this.initBehaviorEvents(),this.initBuiltInBehavior(),this.managers.interactivity=new FS(this),this.managers.lociLabels=new B8(this),this.builders.structure=new I8(this),this.initAnimations(),this.initDataActions(),await this.initBehaviors(),this.log.message(`Mol* Plugin ${Hy} [${_Ue.toLocaleString()}]`),q1||this.log.message("Development mode enabled"),lr&&this.log.message("Debug mode enabled"),this._isInitialized=!0,this.initializedPromiseCallbacks[0]()}catch(t){throw this.initializedPromiseCallbacks[1](t),t}}constructor(t){var r;this.spec=t,this.runTask=(n,o)=>this.managers.task.run(n,o),this.resolveTask=n=>{if(n)return Me.is(n)?this.runTask(n):n},this.subs=[],this.initCanvas3dPromiseCallbacks=[()=>{},()=>{}],this._isInitialized=!1,this.initializedPromiseCallbacks=[()=>{},()=>{}],this.disposed=!1,this.container=void 0,this.ev=_d.create(),this.config=new hU(this.spec.config),this.state=new Su(this),this.commands=new RV,this.canvas3dInit=this.ev.behavior(!1),this.behaviors={state:{isAnimating:this.ev.behavior(!1),isUpdating:this.ev.behavior(!1),isBusy:this.ev.behavior(!1)},interaction:{hover:this.ev.behavior({current:Zt.Loci.Empty,modifiers:_l.None,buttons:0,button:0}),click:this.ev.behavior({current:Zt.Loci.Empty,modifiers:_l.None,buttons:0,button:0}),drag:this.ev.behavior({current:Zt.Loci.Empty,modifiers:_l.None,buttons:0,button:0,pageStart:Ce(),pageEnd:Ce()}),key:this.ev.behavior(gre),keyReleased:this.ev.behavior(gre),selectionMode:this.ev.behavior(!1)},labels:{highlight:this.ev.behavior({labels:[]})},layout:{leftPanelTabName:this.ev.behavior("root")},canvas3d:{initialized:this.canvas3dInit.pipe(oy(n=>!!n),G$(1))}},this.canvas3dInitialized=new Promise((n,o)=>{this.initCanvas3dPromiseCallbacks=[n,o]}),this.initialized=new Promise((n,o)=>{this.initializedPromiseCallbacks=[n,o]}),this.layout=new F8(this),this.animationLoop=new zq(this),this.representation={structure:{registry:new D3,themes:{colorThemeRegistry:Ws.createRegistry(),sizeThemeRegistry:Yo.createRegistry()}},volume:{registry:new GS,themes:{colorThemeRegistry:Ws.createRegistry(),sizeThemeRegistry:Yo.createRegistry()}}},this.query={structure:{registry:new fU}},this.dataFormats=new E8,this.builders={data:new C8(this),structure:void 0},this.helpers={substructureParent:new qq(this),viewportScreenshot:void 0},this.managers={structure:{hierarchy:new ev(this),component:new _h(this),measurement:new pz(this),selection:new R8(this),focus:new O8(this)},volume:{hierarchy:new US(this)},interactivity:void 0,camera:new M8(this),animation:new D8(this),snapshot:new Xg(this),lociLabels:void 0,toast:new jq(this),asset:new TL,task:new k3,markdownExtensions:new L8(this),dragAndDrop:new Hq(this)},this.events={log:this.ev(),task:this.managers.task.events,canvas3d:{settingsUpdated:this.ev()}},this.customModelProperties=new ZB.Registry,this.customStructureProperties=new ZB.Registry,this.customStructureControls=new Map,this.customImportControls=new Map,this.genericRepresentationControls=new Map,this.errorContext=new Wq,this.customState=Object.create(null),this.handleResize=()=>{var n,o;let i=(n=this.canvas3dContext)===null||n===void 0?void 0:n.canvas,a=this.layout.root;a&&i&&(CUe(i,a,this.canvas3dContext.pixelScale),this.canvas3dContext.syncPixelScale(),(o=this.canvas3d)===null||o===void 0||o.requestResize())},this.log={entries:ry(),entry:n=>this.events.log.next(n),error:n=>this.events.log.next(Kp.error(n)),message:n=>this.events.log.next(Kp.message(n)),info:n=>this.events.log.next(Kp.info(n)),warn:n=>this.events.log.next(Kp.warning(n))},this.fetch=RD,phe((r=this.config.get(on.Structure.SaccharideCompIdMapType))!==null&&r!==void 0?r:"default")}}});var Xq,pYe=M(()=>{mYe();Xq=class extends Yq{initCustomParamEditors(){if(this.spec.customParamEditors)for(let[t,r]of this.spec.customParamEditors)this.customParamEditors.set(t.id,r)}dispose(t){super.dispose(t),this.layout.dispose()}constructor(t){super(t),this.spec=t,this.customParamEditors=new Map,this.customUIState={},this.initCustomParamEditors()}}});var hYe,gYe=M(()=>{ES();_o();Da();yn();Ri();Ue();hYe=Wu.create({name:"built-in.animate-assembly-unwind",display:{name:"Unwind Assembly"},isExportable:!0,params:e=>{let t=[["all","All"]],r=e.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Structure));for(let n of r)t.push([n.transform.ref,n.obj.data.models[0].label]);return{durationInMs:_.Numeric(3e3,{min:100,max:1e4,step:100}),playOnce:_.Boolean(!1),target:_.Select(t[0][0],t)}},canApply(e){let t=e.state.data,r=Ur.RootRef;return{canApply:t.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3D,r)).length>0}},getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),initialState:()=>({t:0}),setup(e,t,r){let n=r.state.data,o=!e.target||e.target==="all"?Ur.RootRef:e.target,i=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3D,o)),a=n.build(),s=!1;for(let l of i)n.select(ir.Generators.ofTransformer(Je.Representation.UnwindStructureAssemblyRepresentation3D,l.transform.ref)).length>0||(s=!0,a.to(l).apply(Je.Representation.UnwindStructureAssemblyRepresentation3D,{t:0},{tags:"animate-assembly-unwind"}));if(s)return a.commit({doNotUpdateCurrent:!0})},teardown(e,t,r){let n=r.state.data,o=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3DState).withTag("animate-assembly-unwind"));if(o.length===0)return;let i=n.build();for(let a of o)i.delete(a.transform.ref);return i.commit()},async apply(e,t,r){let n=r.plugin.state.data,o=!r.params.target||r.params.target==="all"?Ur.RootRef:r.params.target,i=n.select(ir.Generators.ofTransformer(Je.Representation.UnwindStructureAssemblyRepresentation3D,o));if(i.length===0)return{kind:"finished"};let a=n.build(),s=(t.current-t.lastApplied)/r.params.durationInMs,l=e.t+s,c=!1;r.params.playOnce&&l>=1?(c=!0,l=1):l=l%1;for(let u of i)a.to(u).update({t:l});return await St.State.Update(r.plugin,{state:n,tree:a,options:{doNotLogTiming:!0}}),c?{kind:"finished"}:{kind:"next",state:{t:l}}}})});var Zq,yYe,vYe,bYe,xYe=M(()=>{sa();M1();$i();Ue();ES();Zq=v(),yYe=v(),vYe=Kr(),bYe=Wu.create({name:"built-in.animate-camera-spin",display:{name:"Camera Spin",description:"Spin the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:_.Numeric(4e3,{min:100,max:2e4,step:100}),speed:_.Numeric(1,{min:1,max:10,step:1},{description:"How many times to spin in the specified duration."}),direction:_.Select("cw",[["cw","Clockwise"],["ccw","Counter Clockwise"]],{cycle:!0})}),initialState:(e,t)=>{var r;return{snapshot:(r=t.canvas3d)===null||r===void 0?void 0:r.camera.getSnapshot()}},getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),teardown:(e,t,r)=>{var n;(n=r.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t.snapshot,durationMs:0})},async apply(e,t,r){var n,o;if(t.current===0)return{kind:"next",state:e};let i=e.snapshot;if(i.radiusMax<1e-4)return{kind:"finished"};let a=t.animation?((n=t.animation)===null||n===void 0?void 0:n.currentFrame)/(t.animation.frameCount+1):en(t.current/r.params.durationInMs,0,1),s=2*Math.PI*a*r.params.speed*(r.params.direction==="ccw"?-1:1);v.sub(Zq,i.position,i.target),v.normalize(yYe,i.up),Kr.setAxisAngle(vYe,yYe,s),v.transformQuat(Zq,Zq,vYe);let l=v.add(v(),i.target,Zq);return(o=r.plugin.canvas3d)===null||o===void 0||o.requestCameraReset({snapshot:{...i,position:l},durationMs:0}),a>=.99999?{kind:"finished"}:{kind:"next",state:e}}})});var SYe,_Ye=M(()=>{Ri();yn();Ue();_o();Da();ES();SYe=Wu.create({name:"built-in.animate-model-index",display:{name:"Animate Trajectory"},isExportable:!0,params:()=>({mode:_.MappedStatic("loop",{palindrome:_.Group({}),loop:_.Group({direction:_.Select("forward",[["forward","Forward"],["backward","Backward"]])}),once:_.Group({direction:_.Select("forward",[["forward","Forward"],["backward","Backward"]])},{isFlat:!0})},{options:[["palindrome","Palindrome"],["loop","Loop"],["once","Once"]]}),duration:_.MappedStatic("fixed",{fixed:_.Group({durationInS:_.Numeric(5,{min:1,max:120,step:.1},{description:"Duration in seconds"})},{isFlat:!0}),computed:_.Group({targetFps:_.Numeric(30,{min:5,max:250,step:1},{label:"Target FPS"})},{isFlat:!0}),sequential:_.Group({maxFps:_.Numeric(30,{min:5,max:60,step:1})},{isFlat:!0})})}),canApply(e){let t=e.state.data,r=t.select(ir.Generators.ofTransformer(Je.Model.ModelFromTrajectory));for(let n of r){let o=ir.findAncestorOfType(t.tree,t.cells,n.transform.ref,ue.Molecule.Trajectory);if(o&&o.obj&&o.obj.data.frameCount>1)return{canApply:!0}}return{canApply:!1,reason:"No trajectory to animate"}},getDuration:(e,t)=>{var r;if(((r=e.duration)===null||r===void 0?void 0:r.name)==="fixed")return{kind:"fixed",durationMs:e.duration.params.durationInS*1e3};if(e.duration.name==="computed"){let n=t.state.data,o=n.select(ir.Generators.ofTransformer(Je.Model.ModelFromTrajectory)),i=0;for(let a of o){let s=ir.findAncestorOfType(n.tree,n.cells,a.transform.ref,ue.Molecule.Trajectory);if(!s||!s.obj)continue;let l=s.obj;i=Math.max(Math.ceil(1e3*l.data.frameCount/e.duration.params.targetFps),i)}return{kind:"fixed",durationMs:i}}return{kind:"unknown"}},initialState:()=>({}),async apply(e,t,r){if(r.params.duration.name==="sequential"&&t.current>0&&t.current-t.lastApplied<1e3/r.params.duration.params.maxFps)return{kind:"skip"};let n=r.plugin.state.data,o=n.select(ir.Generators.ofTransformer(Je.Model.ModelFromTrajectory));if(o.length===0)return{kind:"finished"};let i=n.build(),a=r.params,s=e.palindromeDirections||{},l=!1,c=!0;for(let u of o){let d=ir.findAncestorOfType(n.tree,n.cells,u.transform.ref,ue.Molecule.Trajectory);if(!d||!d.obj)continue;let f=d.obj;f.data.frameCount<=1||i.to(u).update(m=>{let p=f.data.frameCount;if(p!==1)c=!1;else return m;if(a.duration.name==="sequential"){let h=1;if(a.mode.name==="once"){if(h=a.mode.params.direction==="backward"?-1:1,h===-1&&m.modelIndex===0||h===1&&m.modelIndex===p-1)return l=!0,m}else a.mode.name==="palindrome"&&(m.modelIndex===0?h=1:m.modelIndex===p-1?h=-1:h=s[u.transform.ref]||1);s[u.transform.ref]=h;let g=(m.modelIndex+h)%p;return g<0&&(g+=p),l=l||h===-1&&g===0||h===1&&g===p-1,{modelIndex:g}}else{let h=a.duration.name==="fixed"?a.duration.params.durationInS*1e3:Math.ceil(1e3*f.data.frameCount/a.duration.params.targetFps);if(a.mode.name==="once"&&t.current>=h)return l=!0,{modelIndex:f.data.frameCount-1};let g=t.current%h/h;return a.mode.name==="loop"&&a.mode.params.direction==="backward"&&(g=1-g),a.mode.name==="palindrome"&&(g=2*g,g>1&&(g=2-g)),{modelIndex:Math.min(Math.floor(f.data.frameCount*g),f.data.frameCount-1)}}})}return c||await St.State.Update(r.plugin,{state:n,tree:i,options:{doNotLogTiming:!0}}),c||a.mode.name==="once"&&l?{kind:"finished"}:a.mode.name==="palindrome"?{kind:"next",state:{palindromeDirections:s}}:{kind:"next",state:{}}}})});var Gse={};ci(Gse,{AssignColorVolume:()=>jse,DownloadDensity:()=>jzt});var jzt,jse,Hse=M(()=>{yn();hr();SB();Ue();_o();Lm();Da();Oo();jzt=nc.build({from:ue.Root,display:{name:"Download Density",description:"Load a density from the provided source and create its default visual."},params:(e,t)=>{let{options:r}=t.dataFormats;return{source:_.MappedStatic("pdb-xray",{"pdb-xray":_.Group({provider:_.Group({id:_.Text("1tqn",{label:"Id"}),server:_.Select("pdbe",[["pdbe","PDBe"]])},{pivot:"id"}),type:_.Select("2fofc",[["2fofc","2Fo-Fc"],["fofc","Fo-Fc"]])},{isFlat:!0}),"pdb-xray-ds":_.Group({provider:_.Group({id:_.Text("1tqn",{label:"Id"}),server:_.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:_.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),"pdb-emd-ds":_.Group({provider:_.Group({id:_.Text("emd-8004",{label:"Id"}),server:_.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:_.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),url:_.Group({url:_.Url(""),isBinary:_.Boolean(!1),format:_.Select("auto",r)},{isFlat:!0})},{options:[["pdb-xray","PDB X-ray maps"],["pdb-emd-ds","PDB EMD Density Server"],["pdb-xray-ds","PDB X-ray Density Server"],["url","URL"]]})}}})(({params:e},t)=>Me.create("Download Density",async r=>{var n,o;let i=e.source,a,s;switch(i.name){case"url":a=i.params;break;case"pdb-xray":a={url:Un.Url(i.params.type==="2fofc"?`https://www.ebi.ac.uk/pdbe/coordinates/files/${i.params.provider.id.toLowerCase()}.ccp4`:`https://www.ebi.ac.uk/pdbe/coordinates/files/${i.params.provider.id.toLowerCase()}_diff.ccp4`),isBinary:!0,label:`PDBe X-ray map: ${i.params.provider.id}`};break;case"pdb-emd-ds":a=i.params.provider.server==="pdbe"?{url:Un.Url(`https://www.ebi.ac.uk/pdbe/densities/emd/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`PDBe EMD Density Server: ${i.params.provider.id}`}:{url:Un.Url(`https://maps.rcsb.org/em/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`RCSB PDB EMD Density Server: ${i.params.provider.id}`};break;case"pdb-xray-ds":a=i.params.provider.server==="pdbe"?{url:Un.Url(`https://www.ebi.ac.uk/pdbe/densities/x-ray/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`PDBe X-ray Density Server: ${i.params.provider.id}`}:{url:Un.Url(`https://maps.rcsb.org/x-ray/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`RCSB PDB X-ray Density Server: ${i.params.provider.id}`};break;default:Er(i)}let l=await t.builders.data.download(a),c;switch(i.name){case"url":a=i.params,s=i.params.format==="auto"?t.dataFormats.auto(Qb(Un.getUrl(a.url)),(n=l.cell)===null||n===void 0?void 0:n.obj):t.dataFormats.get(i.params.format);break;case"pdb-xray":c=i.params.provider.id,s=t.dataFormats.get("ccp4");break;case"pdb-emd-ds":case"pdb-xray-ds":c=i.params.provider.id,s=t.dataFormats.get("dscif");break;default:Er(i)}if(!s){t.log.warn("DownloadDensity: Format provider not found.");return}let u=await s.parse(t,l,{entryId:c});await((o=s.visuals)===null||o===void 0?void 0:o.call(s,t,u))})),jse=nc.build({display:{name:"Assign Volume Colors",description:"Assigns another volume to be available for coloring."},from:ue.Volume.Data,isApplicable(e){return!e.data.colorVolume},params(e,t){let r=t.state.data.select(ir.Generators.root.subtree().ofType(ue.Volume.Data).filter(n=>{var o;return!!n.obj&&!(!((o=n.obj)===null||o===void 0)&&o.data.colorVolume)&&n.obj!==e}));return r.length===0?{ref:_.Text("",{isHidden:!0,label:"Volume"})}:{ref:_.Select(r[0].transform.ref,r.map(n=>[n.transform.ref,n.obj.label]),{label:"Volume"})}}})(({ref:e,params:t,state:r},n)=>n.build().to(e).apply(Je.Volume.AssignColorVolume,{ref:t.ref},{dependsOn:[t.ref]}).commit())});var s_,CYe=M(()=>{bne();Hse();S8();s_={Structure:vne,Volume:Gse,DataFormat:eae}});var wYe,TYe=M(()=>{Ri();yn();Vt();Ue();ES();wYe=Wu.create({name:"built-in.animate-state-interpolation",display:{name:"Animate State (experimental)"},params:()=>({transtionDurationInMs:_.Numeric(2e3,{min:100,max:3e4,step:10})}),canApply(e){return{canApply:e.managers.snapshot.state.entries.size>1}},initialState:()=>({}),async apply(e,t,r){let n=r.plugin.managers.snapshot.state.entries;if(n.size<2)return{kind:"finished"};let o=t.current%r.params.transtionDurationInMs/r.params.transtionDurationInMs,i=Math.floor(t.current/r.params.transtionDurationInMs)%n.size,a=Math.ceil(t.current/r.params.transtionDurationInMs);a===i&&a++,a=a%n.size;let s=n.get(i).snapshot,l=n.get(a).snapshot;if(!s.data||!l.data)return{kind:"skip"};let c=s.data.tree.transforms,u=l.data.tree.transforms,d=r.plugin.state.data,f=d.build();for(let m of c)for(let p of u){if(p.ref!==m.ref||p.version===m.version)continue;let h=Ur.fromJSON(m),g=Ur.fromJSON(p),y=d.cells.get(m.ref);if(!y)continue;let b;h.transformer.definition.interpolate?b=h.transformer.definition.interpolate(h.params,g.params,o,r.plugin):b=o<=.5?h.params:g.params,Hv(y,b)||f.to(m.ref).update(b)}return await St.State.Update(r.plugin,{state:d,tree:f,options:{doNotLogTiming:!0}}),{kind:"next",state:{}}}})});var AYe,PYe=M(()=>{Ri();yn();Ue();_o();Da();ES();AYe=Wu.create({name:"built-in.animate-structure-spin",display:{name:"Spin Structure"},isExportable:!0,params:()=>({durationInMs:_.Numeric(3e3,{min:100,max:1e4,step:100})}),initialState:()=>({t:0}),getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),async setup(e,t,r){let n=r.state.data,o=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3D)),i=n.build(),a=!1;for(let s of o)n.select(ir.Generators.ofTransformer(Je.Representation.SpinStructureRepresentation3D,s.transform.ref)).length>0||(a=!0,i.to(s.transform.ref).apply(Je.Representation.SpinStructureRepresentation3D,{t:0},{tags:"animate-structure-spin"}));if(a)return i.commit({doNotUpdateCurrent:!0})},teardown(e,t,r){let n=r.state.data,o=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3DState).withTag("animate-structure-spin"));if(o.length===0)return;let i=n.build();for(let a of o)i.delete(a.transform.ref);return i.commit()},async apply(e,t,r){var n;let o=r.plugin.state.data,i=o.select(ir.Generators.ofTransformer(Je.Representation.SpinStructureRepresentation3D));if(i.length===0)return{kind:"finished"};let a=o.build(),s=(t.current-t.lastApplied)/r.params.durationInMs,l=(e.t+s)%1;for(let c of i)a.to(c).update({...(n=c.params)===null||n===void 0?void 0:n.values,t:l});return await St.State.Update(r.plugin,{state:o,tree:a,options:{doNotLogTiming:!0}}),{kind:"next",state:{t:l}}}})});var $q,IYe,EYe,DYe,kYe=M(()=>{sa();M1();$i();la();Ue();ES();$q=v(),IYe=v(),EYe=Kr(),DYe=Wu.create({name:"built-in.animate-camera-rock",display:{name:"Camera Rock",description:"Rock the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:_.Numeric(4e3,{min:100,max:2e4,step:100}),speed:_.Numeric(1,{min:1,max:10,step:1},{description:"How many times to rock from side to side."}),angle:_.Numeric(10,{min:0,max:180,step:1},{description:"How many degrees to rotate in each direction."})}),initialState:(e,t)=>({snapshot:t.canvas3d.camera.getSnapshot()}),getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),teardown:(e,t,r)=>{var n;(n=r.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t.snapshot,durationMs:0})},async apply(e,t,r){var n,o;if(t.current===0)return{kind:"next",state:e};let i=e.snapshot;if(i.radiusMax<1e-4)return{kind:"finished"};let a=t.animation?((n=t.animation)===null||n===void 0?void 0:n.currentFrame)/(t.animation.frameCount+1):en(t.current/r.params.durationInMs,0,1),s=Math.sin(a*r.params.speed*Math.PI*2)*zr(r.params.angle);v.sub($q,i.position,i.target),v.normalize(IYe,i.up),Kr.setAxisAngle(EYe,IYe,s),v.transformQuat($q,$q,EYe);let l=v.add(v(),i.target,$q);return(o=r.plugin.canvas3d)===null||o===void 0||o.requestCameraReset({snapshot:{...i,position:l},durationMs:0}),a>=.99999?{kind:"finished"}:{kind:"next",state:e}}})});var qr,MYe,Wse=M(()=>{gYe();xYe();_Ye();dB();fB();jV();CYe();Hse();Da();Rz();TYe();PYe();kYe();(function(e){function t(n,o){return{action:n,customControl:o&&o.customControl,autoUpdate:o&&o.autoUpdate}}e.Action=t;function r(n,o={}){return{transformer:n,defaultParams:o}}e.Behavior=r})(qr||(qr={}));MYe=()=>({actions:[qr.Action(s_.Structure.DownloadStructure),qr.Action(s_.Volume.DownloadDensity),qr.Action(s_.DataFormat.DownloadFile),qr.Action(s_.DataFormat.OpenFiles),qr.Action(s_.Structure.LoadTrajectory),qr.Action(s_.Structure.EnableModelCustomProps),qr.Action(s_.Structure.EnableStructureCustomProps),qr.Action(LB),qr.Action(pqe),qr.Action(FB),qr.Action(Je.Data.Download),qr.Action(Je.Data.ParseCif),qr.Action(Je.Data.ParseCcp4),qr.Action(Je.Data.ParseDsn6),qr.Action(Je.Model.TrajectoryFromMmCif),qr.Action(Je.Model.TrajectoryFromCifCore),qr.Action(Je.Model.TrajectoryFromPDB),qr.Action(Je.Model.TransformStructureConformation),qr.Action(Je.Model.StructureInstances),qr.Action(Je.Model.StructureFromModel),qr.Action(Je.Model.StructureFromTrajectory),qr.Action(Je.Model.ModelFromTrajectory),qr.Action(Je.Model.StructureSelectionFromScript),qr.Action(Je.Representation.StructureRepresentation3D),qr.Action(Je.Representation.StructureSelectionsDistance3D),qr.Action(Je.Representation.StructureSelectionsAngle3D),qr.Action(Je.Representation.StructureSelectionsDihedral3D),qr.Action(Je.Representation.StructureSelectionsLabel3D),qr.Action(Je.Representation.StructureSelectionsOrientation3D),qr.Action(Je.Representation.ModelUnitcell3D),qr.Action(Je.Representation.StructureBoundingBox3D),qr.Action(Je.Representation.ExplodeStructureRepresentation3D),qr.Action(Je.Representation.SpinStructureRepresentation3D),qr.Action(Je.Representation.UnwindStructureAssemblyRepresentation3D),qr.Action(Je.Representation.OverpaintStructureRepresentation3DFromScript),qr.Action(Je.Representation.TransparencyStructureRepresentation3DFromScript),qr.Action(Je.Representation.ClippingStructureRepresentation3DFromScript),qr.Action(Je.Representation.SubstanceStructureRepresentation3DFromScript),qr.Action(Je.Representation.ThemeStrengthRepresentation3D),qr.Action(jse),qr.Action(Je.Volume.VolumeFromCcp4),qr.Action(Je.Volume.VolumeFromDsn6),qr.Action(Je.Volume.VolumeFromCube),qr.Action(Je.Volume.VolumeFromDx),qr.Action(Je.Representation.VolumeRepresentation3D),qr.Action(Je.Volume.VolumeTransform),qr.Action(Je.Volume.VolumeInstances)],behaviors:[qr.Behavior(Od.Representation.HighlightLoci),qr.Behavior(Od.Representation.SelectLoci),qr.Behavior(Od.Representation.DefaultLociLabelProvider),qr.Behavior(Od.Representation.FocusLoci),qr.Behavior(Od.Camera.FocusLoci),qr.Behavior(Od.Camera.CameraAxisHelper),qr.Behavior(Od.Camera.CameraControls),qr.Behavior(Od.State.SnapshotControls),qr.Behavior(GC),qr.Behavior(Od.CustomProps.StructureInfo),qr.Behavior(Od.CustomProps.AccessibleSurfaceArea),qr.Behavior(Od.CustomProps.BestDatabaseSequenceMapping),qr.Behavior(Od.CustomProps.Interactions),qr.Behavior(Od.CustomProps.SecondaryStructure),qr.Behavior(Od.CustomProps.ValenceModel),qr.Behavior(Od.CustomProps.CrossLinkRestraint)],animations:[SYe,bYe,DYe,SUe,kS,hYe,AYe,wYe]})});var Vd,Gzt,Hzt,M3,Qq,BYe=M(()=>{Vd=et(gn());Vi();IB();Ea();Ue();Fd();XV();gl();Ge();ya();rb();yn();mI();ha();Gzt={color:_.Color(mr.black,{description:"Display color of the volume."}),wireframe:_.Boolean(!1,{description:"Control display of the volume as a wireframe."}),opacity:_.Numeric(.3,{min:0,max:1,step:.01},{description:"Opacity of the volume."})},Hzt=new Map([["em",[-5,5]],["2fo-fc",[0,3]],["fo-fc(+ve)",[1,5]],["fo-fc(-ve)",[-5,-1]]]),M3=class extends Vr{constructor(){super(...arguments),this.ref=ir.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name),this.getVisible=()=>{let t=this.plugin.state.data,r=this.ref;return r?!t.cells.get(r).state.isHidden:!1},this.toggleVisible=()=>{let t=this.plugin.state.data,r=this.ref;r&&Zg(t,r,!t.cells.get(r).state.isHidden)}}componentDidUpdate(){this.ref=ir.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name)}componentDidMount(){this.subscribe(this.plugin.state.data.events.cell.stateUpdated,t=>{this.ref===t.ref&&this.forceUpdate()})}render(){let t=this.props,{isRelative:r,stats:n}=t,o=t.channels[t.name],{min:i,max:a,mean:s,sigma:l}=n,c=Math.round(100*(o.isoValue.kind==="relative"?o.isoValue.relativeValue:o.isoValue.absoluteValue))/100,u=(i-s)/l,d=(a-s)/l;if(!this.props.isUnbounded){let y=Hzt.get(this.props.name);this.props.name==="em"?(u=Math.max(y[0],u),d=Math.min(y[1],d)):(u=y[0],d=y[1])}let f=s+l*u,m=s+l*d,p=hD(r?Math.round((m-f)/l)/100:l/100,2),h=r?u:f,g=r?d:m;return(0,Vd.jsx)(LF,{label:t.label+(t.isRelative?" \u03C3":""),colorStripe:o.color,pivot:(0,Vd.jsxs)("div",{className:"msp-volume-channel-inline-controls",children:[(0,Vd.jsx)(LS,{value:c,min:h,max:g,step:p,onChange:y=>t.changeIso(t.name,y,r),onChangeImmediate:y=>t.changeIso(t.name,y,r),disabled:t.params.isDisabled,onEnter:t.params.events.onEnter}),(0,Vd.jsx)(yr,{svg:this.getVisible()?Wf:Gm,onClick:this.toggleVisible,toggleState:!1,disabled:t.params.isDisabled})]}),controls:(0,Vd.jsx)(xo,{onChange:({name:y,value:b})=>t.changeParams(t.name,y,b),params:Gzt,values:o,onEnter:t.params.events.onEnter,isDisabled:t.params.isDisabled})})}},Qq=class extends Vr{constructor(){super(...arguments),this.changeIso=(t,r,n)=>{let o=this.props.params;this.newParams({...o,entry:{name:o.entry.name,params:{...o.entry.params,channels:{...o.entry.params.channels,[t]:{...o.entry.params.channels[t],isoValue:n?We.IsoValue.relative(r):We.IsoValue.absolute(r)}}}}})},this.changeParams=(t,r,n)=>{let o=this.props.params;this.newParams({...o,entry:{name:o.entry.name,params:{...o.entry.params,channels:{...o.entry.params.channels,[t]:{...o.entry.params.channels[t],[r]:n}}}}})},this.changeOption=({name:t,value:r})=>{let n=this.props.params;if(t==="entry")this.newParams({...n,entry:{name:r,params:n.entry.params}});else{let o=this.props.b.data,i=o.info.kind==="em",a=r.params.isRelative,s=o.info.header.sampling[0],l=n.entry.params.channels,u={...n.entry.params.view.name===r.name?n.entry.params.view.params:this.props.info.params.entry.map(n.entry.name).params.view.map(r.name).defaultValue};r.name==="selection-box"?u.radius=r.params.radius:r.name==="camera-target"?(u.radius=r.params.radius,u.dynamicDetailLevel=r.params.dynamicDetailLevel):r.name==="box"?(u.bottomLeft=r.params.bottomLeft,u.topRight=r.params.topRight):r.name==="auto"&&(u.radius=r.params.radius,u.selectionDetailLevel=r.params.selectionDetailLevel),u.isUnbounded=!!r.params.isUnbounded,this.newParams({...n,entry:{name:n.entry.name,params:{...n.entry.params,view:{name:r.name,params:u},detailLevel:r.params.detailLevel,channels:i?{em:this.convert(l.em,s.valuesInfo[0],a)}:{"2fo-fc":this.convert(l["2fo-fc"],s.valuesInfo[0],a),"fo-fc(+ve)":this.convert(l["fo-fc(+ve)"],s.valuesInfo[1],a),"fo-fc(-ve)":this.convert(l["fo-fc(-ve)"],s.valuesInfo[1],a)}}}})}}}areInitial(t){return _.areEqual(this.props.info.params,t,this.props.info.initialValues)}newParams(t){this.props.events.onChange(t,this.areInitial(t))}convert(t,r,n){return{...t,isoValue:n?We.IsoValue.toRelative(t.isoValue,r):We.IsoValue.toAbsolute(t.isoValue,r)}}render(){if(!this.props.b)return null;let t=this.props.b.data,r=t.info.kind==="em",n=r?"em":"2fo-fc",o=this.props.params,i=this.props.info.params.entry.map(o.entry.name),a=i.params.detailLevel,s={...a,label:"Dynamic Detail",defaultValue:i.params.view.map("camera-target").params.dynamicDetailLevel.defaultValue},l={...a,label:"Selection Detail",defaultValue:i.params.view.map("auto").params.selectionDetailLevel.defaultValue},c=t.info.header.sampling[0],u=o.entry.params.channels[n].isoValue.kind==="relative",d=_.Boolean(u,{description:"Use normalized or absolute isocontour scale.",label:"Normalized"}),f=!!o.entry.params.view.params.isUnbounded,m=_.Boolean(f,{description:"Show full/limited range of iso-values for more fine-grained control.",label:"Unbounded"}),p=o.entry.params.view.name==="off",h={entry:_.Select(o.entry.name,t.data.entries.map(y=>[y.dataId,y.dataId]),{isHidden:p,description:"Which entry with volume data to display."}),view:_.MappedStatic(o.entry.params.view.name,{off:_.Group({isRelative:_.Boolean(u,{isHidden:!0}),isUnbounded:_.Boolean(f,{isHidden:!0})},{description:"Display off."}),box:_.Group({bottomLeft:_.Vec3(v.zero()),topRight:_.Vec3(v.zero()),detailLevel:a,isRelative:d,isUnbounded:m},{description:"Static box defined by cartesian coords."}),"selection-box":_.Group({radius:_.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),detailLevel:a,isRelative:d,isUnbounded:m},{description:"Box around focused element."}),"camera-target":_.Group({radius:_.Numeric(.5,{min:0,max:1,step:.05},{description:"Radius within which the volume is shown (relative to the field of view)."}),detailLevel:{...a,isHidden:!0},dynamicDetailLevel:s,isRelative:d,isUnbounded:m},{description:"Box around camera target."}),cell:_.Group({detailLevel:a,isRelative:d,isUnbounded:m},{description:"Box around the structure's bounding box."}),auto:_.Group({radius:_.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),detailLevel:a,selectionDetailLevel:l,isRelative:d,isUnbounded:m},{description:"Box around focused element."})},{options:wl.ViewTypeOptions,description:'Controls what of the volume is displayed. "Off" hides the volume alltogether. "Bounded box" shows the volume inside the given box. "Around Focus" shows the volume around the element/atom last interacted with. "Around Camera" shows the volume around the point the camera is targeting. "Whole Structure" shows the volume for the whole structure.'})},g={entry:o.entry.name,view:{name:o.entry.params.view.name,params:{detailLevel:o.entry.params.detailLevel,radius:o.entry.params.view.params.radius,bottomLeft:o.entry.params.view.params.bottomLeft,topRight:o.entry.params.view.params.topRight,selectionDetailLevel:o.entry.params.view.params.selectionDetailLevel,dynamicDetailLevel:o.entry.params.view.params.dynamicDetailLevel,isRelative:u,isUnbounded:f}}};return p?(0,Vd.jsx)(xo,{onChange:this.changeOption,params:h,values:g,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled}):(0,Vd.jsxs)(Vd.Fragment,{children:[!r&&(0,Vd.jsx)(M3,{label:"2Fo-Fc",name:"2fo-fc",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[0],isUnbounded:f}),!r&&(0,Vd.jsx)(M3,{label:"Fo-Fc(+ve)",name:"fo-fc(+ve)",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[1],isUnbounded:f}),!r&&(0,Vd.jsx)(M3,{label:"Fo-Fc(-ve)",name:"fo-fc(-ve)",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[1],isUnbounded:f}),r&&(0,Vd.jsx)(M3,{label:"EM",name:"em",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[0],isUnbounded:f}),(0,Vd.jsx)(xo,{onChange:this.changeOption,params:h,values:g,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled})]})}}});var yR,Kse=M(()=>{Rz();Wse();BYe();yR=()=>({...MYe(),customParamEditors:[[FB,Qq]]})});async function Jq(e){let{spec:t,target:r,onBeforeUIRender:n,render:o}=e,i=new Xq(t||yR());await i.init(),n&&await n(i),o((0,RYe.createElement)(xGe,{plugin:i}),r);try{await i.canvas3dInitialized}catch{}return i}var RYe,Yse=M(()=>{RYe=et(Wr());SGe();pYe();Kse()});var Xse=ve((aho,OYe)=>{OYe.exports=JBrowseExports["react-dom/client"]});function ej(e,t){(0,LYe.createRoot)(t).render(e)}var LYe,Zse=M(()=>{LYe=et(Xse())});var tle=ve((qho,zYe)=>{zYe.exports=JBrowseExports["@jbrowse/core/pluggableElementTypes"]});var jYe=ve((jho,qYe)=>{qYe.exports=JBrowseExports["@jbrowse/core/util/types/mst"]});var bR=ve((Gho,GYe)=>{GYe.exports=JBrowseExports.mobx});var f0=ve((Hho,HYe)=>{HYe.exports=JBrowseExports["mobx-state-tree"]});var QYe=ve(nle=>{"use strict";Object.defineProperty(nle,"__esModule",{value:!0});nle.genomeToTranscriptSeqMapping=n8t;function n8t(e){var t,r;let n=e.strand,o=e.refName,i=(r=(t=e.subfeatures)===null||t===void 0?void 0:t.filter(c=>c.type==="CDS").sort((c,u)=>n*(c.start-u.start)))!==null&&r!==void 0?r:[],a={},s={},l=0;if(n!==-1)for(let c of i)for(let u=c.start;u<c.end;u++){let d=Math.floor(l++/3);a[u]=d,s[d]||(s[d]=u)}else for(let c of i)for(let u=c.end;u>c.start;u--){let d=Math.floor(l++/3);a[u]=d,s[d]||(s[d]=u)}return{g2p:a,p2g:s,refName:o,strand:n}}});function oXe({model:e,structureSeqPos:t}){let{genomeToTranscriptSeqMapping:r,pairwiseAlignment:n,structureSeqToTranscriptSeqPosition:o}=e;if(!r||!n)return;let{p2g:i,strand:a}=r,s=o?.[t+1];if(s===void 0)return;let l=i[s];if(l===void 0)return;let c=l,u=c+3*a;return[Math.min(c,u),Math.max(c,u)]}async function aj({model:e,structureSeqPos:t}){let r=(0,nXe.getSession)(e),n=oXe({structureSeqPos:t,model:e}),{connectedView:o,genomeToTranscriptSeqMapping:i,zoomToBaseLevel:a}=e,{assemblyManager:s}=r;if(!i||n===void 0)return;let[l,c]=n,{strand:u,refName:d}=i,f=o?.assemblyNames[0];if(f)if(e.setClickGenomeHighlights([{assemblyName:f,refName:d,start:l,end:c}]),a)await o.navToLocString(`${d}:${l}-${c}${u===-1?"[rev]":""}`);else{let m=s.get(o.assemblyNames[0]);o.centerAt(l,m?.getCanonicalRefName(d)??d)}}function sj({model:e,structureSeqPos:t}){if(t===void 0){e.setHoverGenomeHighlights([]);return}let r=oXe({structureSeqPos:t,model:e}),{genomeToTranscriptSeqMapping:n,connectedView:o}=e,i=o?.assemblyNames[0];if(n&&r&&i){let[a,s]=r;e.setHoverGenomeHighlights([{assemblyName:i,refName:n.refName,start:a,end:s}])}}var nXe,ale=M(()=>{"use strict";nXe=et(Du())});var Sm=ve((Mgo,CR)=>{function a8t(e){return e&&e.__esModule?e:{default:e}}CR.exports=a8t,CR.exports.__esModule=!0,CR.exports.default=CR.exports});var gw=ve(cle=>{"use strict";"use client";Object.defineProperty(cle,"__esModule",{value:!0});Object.defineProperty(cle,"default",{enumerable:!0,get:function(){return s8t.createSvgIcon}});var s8t=IY()});var uXe=ve(lj=>{"use strict";"use client";var l8t=Sm().default;Object.defineProperty(lj,"__esModule",{value:!0});lj.default=void 0;var c8t=l8t(gw()),u8t=gn(),Rgo=lj.default=(0,c8t.default)((0,u8t.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight")});var dXe=ve(u1=>{"use strict";var d8t=u1&&u1.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),f8t=u1&&u1.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),m8t=u1&&u1.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&d8t(r,t,n[o]);return f8t(r,t),r}})();Object.defineProperty(u1,"__esModule",{value:!0});var p8t=gn(),h8t=m8t(Wr()),g8t=Jl(),y8t=h8t.forwardRef(function(t,r){return(0,p8t.jsx)(g8t.Menu,{...t,ref:r,style:{pointerEvents:"none",...t.style},slotProps:{...t.slotProps,paper:{style:{pointerEvents:"auto"}}}})});u1.default=y8t});var fXe=ve(cj=>{"use strict";"use client";var v8t=Sm().default;Object.defineProperty(cj,"__esModule",{value:!0});cj.default=void 0;var b8t=v8t(gw()),x8t=gn(),Fgo=cj.default=(0,b8t.default)((0,x8t.jsx)("path",{d:"m10 17 5-5-5-5z"}),"ArrowRight")});var mXe=ve(uj=>{"use strict";"use client";var S8t=Sm().default;Object.defineProperty(uj,"__esModule",{value:!0});uj.default=void 0;var _8t=S8t(gw()),C8t=gn(),Ugo=uj.default=(0,_8t.default)((0,C8t.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckBox")});var pXe=ve(dj=>{"use strict";"use client";var w8t=Sm().default;Object.defineProperty(dj,"__esModule",{value:!0});dj.default=void 0;var T8t=w8t(gw()),A8t=gn(),zgo=dj.default=(0,T8t.default)((0,A8t.jsx)("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"CheckBoxOutlineBlank")});var hXe=ve(fj=>{"use strict";"use client";var P8t=Sm().default;Object.defineProperty(fj,"__esModule",{value:!0});fj.default=void 0;var I8t=P8t(gw()),E8t=gn(),jgo=fj.default=(0,I8t.default)((0,E8t.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonChecked")});var gXe=ve(mj=>{"use strict";"use client";var D8t=Sm().default;Object.defineProperty(mj,"__esModule",{value:!0});mj.default=void 0;var k8t=D8t(gw()),M8t=gn(),Hgo=mj.default=(0,k8t.default)((0,M8t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonUnchecked")});var yXe=ve(vv=>{"use strict";Object.defineProperty(vv,"__esModule",{value:!0});vv.TWO_PWR_32_DBL=vv.TWO_PWR_16_DBL=void 0;vv.longFromBytesToUnsigned=B8t;vv.TWO_PWR_16_DBL=65536;vv.TWO_PWR_32_DBL=vv.TWO_PWR_16_DBL*vv.TWO_PWR_16_DBL;function B8t(e,t=0){let r=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24;return((e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0)*vv.TWO_PWR_32_DBL+(r>>>0)}});var bXe=ve(fle=>{"use strict";Object.defineProperty(fle,"__esModule",{value:!0});var ule=yXe(),pj=1;function vXe(e,t,r){let n=t[pj],o=r?r[pj]:1/0;return n<=e&&o>e?0:n<e?-1:1}var dle=class{constructor({filehandle:t}){this.filehandle=t}_getIndex(){return this.index||(this.index=this._readIndex().catch(t=>{throw this.index=void 0,t})),this.index}async _readIndex(){let t=await this.filehandle.read(8,0),r=(0,ule.longFromBytesToUnsigned)(t);if(!r)return[[0,0]];let n=new Array(r+1);n[0]=[0,0];let o=16*r;if(o>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");let i=await this.filehandle.read(o,8);for(let a=0;a<r;a+=1){let s=(0,ule.longFromBytesToUnsigned)(i,a*16),l=(0,ule.longFromBytesToUnsigned)(i,a*16+8);n[a+1]=[s,l]}return n}async getLastBlock(){return(await this._getIndex()).at(-1)}async getRelevantBlocksForRead(t,r){let n=r+t;if(t===0)return[];let o=await this._getIndex(),i=[],a=0,s=o.length-1,l=Math.floor(o.length/2),c=vXe(r,o[l],o[l+1]);for(;c!==0;)c>0?s=l-1:c<0&&(a=l+1),l=Math.ceil((s-a)/2)+a,c=vXe(r,o[l],o[l+1]);i.push(o[l]);let u=l+1;for(;u<o.length&&(i.push(o[u]),!(o[u][pj]>=n));u+=1);return i[i.length-1][pj]<n&&i.push([]),i}};fle.default=dle});var d1=ve(Df=>{"use strict";var R8t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function O8t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Df.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)O8t(r,n)&&(e[n]=r[n])}}return e};Df.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var L8t={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),o);return}for(var i=0;i<n;i++)e[o+i]=t[r+i]},flattenChunks:function(e){var t,r,n,o,i,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),o=0,t=0,r=e.length;t<r;t++)i=e[t],a.set(i,o),o+=i.length;return a}},F8t={arraySet:function(e,t,r,n,o){for(var i=0;i<n;i++)e[o+i]=t[r+i]},flattenChunks:function(e){return[].concat.apply([],e)}};Df.setTyped=function(e){e?(Df.Buf8=Uint8Array,Df.Buf16=Uint16Array,Df.Buf32=Int32Array,Df.assign(Df,L8t)):(Df.Buf8=Array,Df.Buf16=Array,Df.Buf32=Array,Df.assign(Df,F8t))};Df.setTyped(R8t)});var qXe=ve(O3=>{"use strict";var N8t=d1(),U8t=4,xXe=0,SXe=1,V8t=2;function R3(e){for(var t=e.length;--t>=0;)e[t]=0}var z8t=0,PXe=1,q8t=2,j8t=3,G8t=258,ble=29,ER=256,TR=ER+1+ble,B3=30,xle=19,IXe=2*TR+1,yw=15,mle=16,H8t=7,Sle=256,EXe=16,DXe=17,kXe=18,yle=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],hj=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],W8t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],MXe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K8t=512,f1=new Array((TR+2)*2);R3(f1);var wR=new Array(B3*2);R3(wR);var AR=new Array(K8t);R3(AR);var PR=new Array(G8t-j8t+1);R3(PR);var _le=new Array(ble);R3(_le);var gj=new Array(B3);R3(gj);function ple(e,t,r,n,o){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=e&&e.length}var BXe,RXe,OXe;function hle(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function LXe(e){return e<256?AR[e]:AR[256+(e>>>7)]}function IR(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function _m(e,t,r){e.bi_valid>mle-r?(e.bi_buf|=t<<e.bi_valid&65535,IR(e,e.bi_buf),e.bi_buf=t>>mle-e.bi_valid,e.bi_valid+=r-mle):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function bv(e,t,r){_m(e,r[t*2],r[t*2+1])}function FXe(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Y8t(e){e.bi_valid===16?(IR(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function X8t(e,t){var r=t.dyn_tree,n=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,d,f,m,p,h=0;for(f=0;f<=yw;f++)e.bl_count[f]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<IXe;c++)u=e.heap[c],f=r[r[u*2+1]*2+1]+1,f>l&&(f=l,h++),r[u*2+1]=f,!(u>n)&&(e.bl_count[f]++,m=0,u>=s&&(m=a[u-s]),p=r[u*2],e.opt_len+=p*(f+m),i&&(e.static_len+=p*(o[u*2+1]+m)));if(h!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,h-=2}while(h>0);for(f=l;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(e.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),u--)}}function NXe(e,t,r){var n=new Array(yw+1),o=0,i,a;for(i=1;i<=yw;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=FXe(n[s]++,s))}}function Z8t(){var e,t,r,n,o,i=new Array(yw+1);for(r=0,n=0;n<ble-1;n++)for(_le[n]=r,e=0;e<1<<yle[n];e++)PR[r++]=n;for(PR[r-1]=n,o=0,n=0;n<16;n++)for(gj[n]=o,e=0;e<1<<hj[n];e++)AR[o++]=n;for(o>>=7;n<B3;n++)for(gj[n]=o<<7,e=0;e<1<<hj[n]-7;e++)AR[256+o++]=n;for(t=0;t<=yw;t++)i[t]=0;for(e=0;e<=143;)f1[e*2+1]=8,e++,i[8]++;for(;e<=255;)f1[e*2+1]=9,e++,i[9]++;for(;e<=279;)f1[e*2+1]=7,e++,i[7]++;for(;e<=287;)f1[e*2+1]=8,e++,i[8]++;for(NXe(f1,TR+1,i),e=0;e<B3;e++)wR[e*2+1]=5,wR[e*2]=FXe(e,5);BXe=new ple(f1,yle,ER+1,TR,yw),RXe=new ple(wR,hj,0,B3,yw),OXe=new ple(new Array(0),W8t,0,xle,H8t)}function UXe(e){var t;for(t=0;t<TR;t++)e.dyn_ltree[t*2]=0;for(t=0;t<B3;t++)e.dyn_dtree[t*2]=0;for(t=0;t<xle;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Sle*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function VXe(e){e.bi_valid>8?IR(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function $8t(e,t,r,n){VXe(e),n&&(IR(e,r),IR(e,~r)),N8t.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function _Xe(e,t,r,n){var o=t*2,i=r*2;return e[o]<e[i]||e[o]===e[i]&&n[t]<=n[r]}function gle(e,t,r){for(var n=e.heap[r],o=r<<1;o<=e.heap_len&&(o<e.heap_len&&_Xe(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!_Xe(t,n,e.heap[o],e.depth));)e.heap[r]=e.heap[o],r=o,o<<=1;e.heap[r]=n}function CXe(e,t,r){var n,o,i=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+i*2]<<8|e.pending_buf[e.d_buf+i*2+1],o=e.pending_buf[e.l_buf+i],i++,n===0?bv(e,o,t):(a=PR[o],bv(e,a+ER+1,t),s=yle[a],s!==0&&(o-=_le[a],_m(e,o,s)),n--,a=LXe(n),bv(e,a,r),s=hj[a],s!==0&&(n-=gj[a],_m(e,n,s)));while(i<e.last_lit);bv(e,Sle,t)}function vle(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems,a,s,l=-1,c;for(e.heap_len=0,e.heap_max=IXe,a=0;a<i;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=n[c*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)gle(e,r,a);c=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],gle(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[c*2]=r[a*2]+r[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=c,e.heap[1]=c++,gle(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],X8t(e,t),NXe(r,l,e.bl_count)}function wXe(e,t,r){var n,o=-1,i,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=t[(n+1)*2+1],!(++s<l&&i===a)&&(s<c?e.bl_tree[i*2]+=s:i!==0?(i!==o&&e.bl_tree[i*2]++,e.bl_tree[EXe*2]++):s<=10?e.bl_tree[DXe*2]++:e.bl_tree[kXe*2]++,s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function TXe(e,t,r){var n,o=-1,i,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),n=0;n<=r;n++)if(i=a,a=t[(n+1)*2+1],!(++s<l&&i===a)){if(s<c)do bv(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==o&&(bv(e,i,e.bl_tree),s--),bv(e,EXe,e.bl_tree),_m(e,s-3,2)):s<=10?(bv(e,DXe,e.bl_tree),_m(e,s-3,3)):(bv(e,kXe,e.bl_tree),_m(e,s-11,7));s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}function Q8t(e){var t;for(wXe(e,e.dyn_ltree,e.l_desc.max_code),wXe(e,e.dyn_dtree,e.d_desc.max_code),vle(e,e.bl_desc),t=xle-1;t>=3&&e.bl_tree[MXe[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function J8t(e,t,r,n){var o;for(_m(e,t-257,5),_m(e,r-1,5),_m(e,n-4,4),o=0;o<n;o++)_m(e,e.bl_tree[MXe[o]*2+1],3);TXe(e,e.dyn_ltree,t-1),TXe(e,e.dyn_dtree,r-1)}function eqt(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return xXe;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return SXe;for(r=32;r<ER;r++)if(e.dyn_ltree[r*2]!==0)return SXe;return xXe}var AXe=!1;function tqt(e){AXe||(Z8t(),AXe=!0),e.l_desc=new hle(e.dyn_ltree,BXe),e.d_desc=new hle(e.dyn_dtree,RXe),e.bl_desc=new hle(e.bl_tree,OXe),e.bi_buf=0,e.bi_valid=0,UXe(e)}function zXe(e,t,r,n){_m(e,(z8t<<1)+(n?1:0),3),$8t(e,t,r,!0)}function rqt(e){_m(e,PXe<<1,3),bv(e,Sle,f1),Y8t(e)}function nqt(e,t,r,n){var o,i,a=0;e.level>0?(e.strm.data_type===V8t&&(e.strm.data_type=eqt(e)),vle(e,e.l_desc),vle(e,e.d_desc),a=Q8t(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&t!==-1?zXe(e,t,r,n):e.strategy===U8t||i===o?(_m(e,(PXe<<1)+(n?1:0),3),CXe(e,f1,wR)):(_m(e,(q8t<<1)+(n?1:0),3),J8t(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),CXe(e,e.dyn_ltree,e.dyn_dtree)),UXe(e),n&&VXe(e)}function oqt(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(PR[r]+ER+1)*2]++,e.dyn_dtree[LXe(t)*2]++),e.last_lit===e.lit_bufsize-1}O3._tr_init=tqt;O3._tr_stored_block=zXe;O3._tr_flush_block=nqt;O3._tr_tally=oqt;O3._tr_align=rqt});var Cle=ve(($go,jXe)=>{"use strict";function iqt(e,t,r,n){for(var o=e&65535|0,i=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do o=o+t[n++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0}jXe.exports=iqt});var wle=ve((Qgo,GXe)=>{"use strict";function aqt(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var sqt=aqt();function lqt(e,t,r,n){var o=sqt,i=n+r;e^=-1;for(var a=n;a<i;a++)e=e>>>8^o[(e^t[a])&255];return e^-1}GXe.exports=lqt});var yj=ve((Jgo,HXe)=>{"use strict";HXe.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var eZe=ve(_v=>{"use strict";var kf=d1(),Hh=qXe(),XXe=Cle(),c_=wle(),cqt=yj(),Sw=0,uqt=1,dqt=3,p_=4,WXe=5,Sv=0,KXe=1,Wh=-2,fqt=-3,Tle=-5,mqt=-1,pqt=1,vj=2,hqt=3,gqt=4,yqt=0,vqt=2,_j=8,bqt=9,xqt=15,Sqt=8,_qt=29,Cqt=256,Ple=Cqt+1+_qt,wqt=30,Tqt=19,Aqt=2*Ple+1,Pqt=15,xi=3,f_=258,m0=f_+xi+1,Iqt=32,Cj=42,Ile=69,bj=73,xj=91,Sj=103,vw=113,kR=666,Lc=1,MR=2,bw=3,N3=4,Eqt=3;function m_(e,t){return e.msg=cqt[t],t}function YXe(e){return(e<<1)-(e>4?9:0)}function d_(e){for(var t=e.length;--t>=0;)e[t]=0}function u_(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(kf.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function Yu(e,t){Hh._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,u_(e.strm)}function Ki(e,t){e.pending_buf[e.pending++]=t}function DR(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Dqt(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),o===0?0:(e.avail_in-=o,kf.arraySet(t,e.input,e.next_in,o,r),e.state.wrap===1?e.adler=XXe(e.adler,t,o,r):e.state.wrap===2&&(e.adler=c_(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function ZXe(e,t){var r=e.max_chain_length,n=e.strstart,o,i,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-m0?e.strstart-(e.w_size-m0):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+f_,m=c[n+a-1],p=c[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+a]!==p||c[o+a-1]!==m||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<f);if(i=f_-(f-n),n=f-f_,i>a){if(e.match_start=t,a=i,i>=s)break;m=c[n+a-1],p=c[n+a]}}while((t=d[t&u])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function xw(e){var t=e.w_size,r,n,o,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-m0)){kf.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do o=e.head[--r],e.head[r]=o>=t?o-t:0;while(--n);n=t,r=n;do o=e.prev[--r],e.prev[r]=o>=t?o-t:0;while(--n);i+=t}if(e.strm.avail_in===0)break;if(n=Dqt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=n,e.lookahead+e.insert>=xi)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+xi-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<xi)););}while(e.lookahead<m0&&e.strm.avail_in!==0)}function kqt(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(xw(e),e.lookahead===0&&t===Sw)return Lc;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Yu(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-m0&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=0,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):(e.strstart>e.block_start&&(Yu(e,!1),e.strm.avail_out===0),Lc)}function Ale(e,t){for(var r,n;;){if(e.lookahead<m0){if(xw(e),e.lookahead<m0&&t===Sw)return Lc;if(e.lookahead===0)break}if(r=0,e.lookahead>=xi&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-m0&&(e.match_length=ZXe(e,r)),e.match_length>=xi)if(n=Hh._tr_tally(e,e.strstart-e.match_start,e.match_length-xi),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=xi){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Hh._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=e.strstart<xi-1?e.strstart:xi-1,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function L3(e,t){for(var r,n,o;;){if(e.lookahead<m0){if(xw(e),e.lookahead<m0&&t===Sw)return Lc;if(e.lookahead===0)break}if(r=0,e.lookahead>=xi&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=xi-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-m0&&(e.match_length=ZXe(e,r),e.match_length<=5&&(e.strategy===pqt||e.match_length===xi&&e.strstart-e.match_start>4096)&&(e.match_length=xi-1)),e.prev_length>=xi&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-xi,n=Hh._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-xi),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=xi-1,e.strstart++,n&&(Yu(e,!1),e.strm.avail_out===0))return Lc}else if(e.match_available){if(n=Hh._tr_tally(e,0,e.window[e.strstart-1]),n&&Yu(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Lc}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Hh._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<xi-1?e.strstart:xi-1,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function Mqt(e,t){for(var r,n,o,i,a=e.window;;){if(e.lookahead<=f_){if(xw(e),e.lookahead<=f_&&t===Sw)return Lc;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=xi&&e.strstart>0&&(o=e.strstart-1,n=a[o],n===a[++o]&&n===a[++o]&&n===a[++o])){i=e.strstart+f_;do;while(n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&o<i);e.match_length=f_-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=xi?(r=Hh._tr_tally(e,1,e.match_length-xi),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Hh._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=0,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function Bqt(e,t){for(var r;;){if(e.lookahead===0&&(xw(e),e.lookahead===0)){if(t===Sw)return Lc;break}if(e.match_length=0,r=Hh._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=0,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function xv(e,t,r,n,o){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=o}var F3;F3=[new xv(0,0,0,0,kqt),new xv(4,4,8,4,Ale),new xv(4,5,16,8,Ale),new xv(4,6,32,32,Ale),new xv(4,4,16,16,L3),new xv(8,16,32,32,L3),new xv(8,16,128,128,L3),new xv(8,32,128,256,L3),new xv(32,128,258,1024,L3),new xv(32,258,258,4096,L3)];function Rqt(e){e.window_size=2*e.w_size,d_(e.head),e.max_lazy_match=F3[e.level].max_lazy,e.good_match=F3[e.level].good_length,e.nice_match=F3[e.level].nice_length,e.max_chain_length=F3[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=xi-1,e.match_available=0,e.ins_h=0}function Oqt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_j,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new kf.Buf16(Aqt*2),this.dyn_dtree=new kf.Buf16((2*wqt+1)*2),this.bl_tree=new kf.Buf16((2*Tqt+1)*2),d_(this.dyn_ltree),d_(this.dyn_dtree),d_(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new kf.Buf16(Pqt+1),this.heap=new kf.Buf16(2*Ple+1),d_(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new kf.Buf16(2*Ple+1),d_(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function $Xe(e){var t;return!e||!e.state?m_(e,Wh):(e.total_in=e.total_out=0,e.data_type=vqt,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Cj:vw,e.adler=t.wrap===2?0:1,t.last_flush=Sw,Hh._tr_init(t),Sv)}function QXe(e){var t=$Xe(e);return t===Sv&&Rqt(e.state),t}function Lqt(e,t){return!e||!e.state||e.state.wrap!==2?Wh:(e.state.gzhead=t,Sv)}function JXe(e,t,r,n,o,i){if(!e)return Wh;var a=1;if(t===mqt&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>bqt||r!==_j||n<8||n>15||t<0||t>9||i<0||i>gqt)return m_(e,Wh);n===8&&(n=9);var s=new Oqt;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+xi-1)/xi),s.window=new kf.Buf8(s.w_size*2),s.head=new kf.Buf16(s.hash_size),s.prev=new kf.Buf16(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new kf.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=i,s.method=r,QXe(e)}function Fqt(e,t){return JXe(e,t,_j,xqt,Sqt,yqt)}function Nqt(e,t){var r,n,o,i;if(!e||!e.state||t>WXe||t<0)return e?m_(e,Wh):Wh;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===kR&&t!==p_)return m_(e,e.avail_out===0?Tle:Wh);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Cj)if(n.wrap===2)e.adler=0,Ki(n,31),Ki(n,139),Ki(n,8),n.gzhead?(Ki(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ki(n,n.gzhead.time&255),Ki(n,n.gzhead.time>>8&255),Ki(n,n.gzhead.time>>16&255),Ki(n,n.gzhead.time>>24&255),Ki(n,n.level===9?2:n.strategy>=vj||n.level<2?4:0),Ki(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Ki(n,n.gzhead.extra.length&255),Ki(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=c_(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Ile):(Ki(n,0),Ki(n,0),Ki(n,0),Ki(n,0),Ki(n,0),Ki(n,n.level===9?2:n.strategy>=vj||n.level<2?4:0),Ki(n,Eqt),n.status=vw);else{var a=_j+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=vj||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=Iqt),a+=31-a%31,n.status=vw,DR(n,a),n.strstart!==0&&(DR(n,e.adler>>>16),DR(n,e.adler&65535)),e.adler=1}if(n.status===Ile)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),u_(e),o=n.pending,n.pending===n.pending_buf_size));)Ki(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=bj)}else n.status=bj;if(n.status===bj)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),u_(e),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.name.length?i=n.gzhead.name.charCodeAt(n.gzindex++)&255:i=0,Ki(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.gzindex=0,n.status=xj)}else n.status=xj;if(n.status===xj)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),u_(e),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.comment.length?i=n.gzhead.comment.charCodeAt(n.gzindex++)&255:i=0,Ki(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.status=Sj)}else n.status=Sj;if(n.status===Sj&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&u_(e),n.pending+2<=n.pending_buf_size&&(Ki(n,e.adler&255),Ki(n,e.adler>>8&255),e.adler=0,n.status=vw)):n.status=vw),n.pending!==0){if(u_(e),e.avail_out===0)return n.last_flush=-1,Sv}else if(e.avail_in===0&&YXe(t)<=YXe(r)&&t!==p_)return m_(e,Tle);if(n.status===kR&&e.avail_in!==0)return m_(e,Tle);if(e.avail_in!==0||n.lookahead!==0||t!==Sw&&n.status!==kR){var l=n.strategy===vj?Bqt(n,t):n.strategy===hqt?Mqt(n,t):F3[n.level].func(n,t);if((l===bw||l===N3)&&(n.status=kR),l===Lc||l===bw)return e.avail_out===0&&(n.last_flush=-1),Sv;if(l===MR&&(t===uqt?Hh._tr_align(n):t!==WXe&&(Hh._tr_stored_block(n,0,0,!1),t===dqt&&(d_(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),u_(e),e.avail_out===0))return n.last_flush=-1,Sv}return t!==p_?Sv:n.wrap<=0?KXe:(n.wrap===2?(Ki(n,e.adler&255),Ki(n,e.adler>>8&255),Ki(n,e.adler>>16&255),Ki(n,e.adler>>24&255),Ki(n,e.total_in&255),Ki(n,e.total_in>>8&255),Ki(n,e.total_in>>16&255),Ki(n,e.total_in>>24&255)):(DR(n,e.adler>>>16),DR(n,e.adler&65535)),u_(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Sv:KXe)}function Uqt(e){var t;return!e||!e.state?Wh:(t=e.state.status,t!==Cj&&t!==Ile&&t!==bj&&t!==xj&&t!==Sj&&t!==vw&&t!==kR?m_(e,Wh):(e.state=null,t===vw?m_(e,fqt):Sv))}function Vqt(e,t){var r=t.length,n,o,i,a,s,l,c,u;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==Cj||n.lookahead))return Wh;for(a===1&&(e.adler=XXe(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(d_(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new kf.Buf8(n.w_size),kf.arraySet(u,t,r-n.w_size,n.w_size,0),t=u,r=n.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,xw(n);n.lookahead>=xi;){o=n.strstart,i=n.lookahead-(xi-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+xi-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--i);n.strstart=o,n.lookahead=xi-1,xw(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=xi-1,n.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,n.wrap=a,Sv}_v.deflateInit=Fqt;_v.deflateInit2=JXe;_v.deflateReset=QXe;_v.deflateResetKeep=$Xe;_v.deflateSetHeader=Lqt;_v.deflate=Nqt;_v.deflateEnd=Uqt;_v.deflateSetDictionary=Vqt;_v.deflateInfo="pako deflate (from Nodeca project)"});var Ele=ve(U3=>{"use strict";var wj=d1(),tZe=!0,rZe=!0;try{String.fromCharCode.apply(null,[0])}catch{tZe=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{rZe=!1}var BR=new wj.Buf8(256);for(m1=0;m1<256;m1++)BR[m1]=m1>=252?6:m1>=248?5:m1>=240?4:m1>=224?3:m1>=192?2:1;var m1;BR[254]=BR[254]=1;U3.string2buf=function(e){var t,r,n,o,i,a=e.length,s=0;for(o=0;o<a;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<a&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new wj.Buf8(s),i=0,o=0;i<s;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<a&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|r&63):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|r&63):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|r&63);return t};function nZe(e,t){if(t<65534&&(e.subarray&&rZe||!e.subarray&&tZe))return String.fromCharCode.apply(null,wj.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}U3.buf2binstring=function(e){return nZe(e,e.length)};U3.binstring2buf=function(e){for(var t=new wj.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};U3.buf2string=function(e,t){var r,n,o,i,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(o=e[r++],o<128){s[n++]=o;continue}if(i=BR[o],i>4){s[n++]=65533,r+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&r<a;)o=o<<6|e[r++]&63,i--;if(i>1){s[n++]=65533;continue}o<65536?s[n++]=o:(o-=65536,s[n++]=55296|o>>10&1023,s[n++]=56320|o&1023)}return nZe(s,n)};U3.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+BR[e[r]]>t?r:t}});var Dle=ve((r0o,oZe)=>{"use strict";function zqt(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}oZe.exports=zqt});var lZe=ve(LR=>{"use strict";var RR=eZe(),OR=d1(),Mle=Ele(),Ble=yj(),qqt=Dle(),sZe=Object.prototype.toString,jqt=0,kle=4,V3=0,iZe=1,aZe=2,Gqt=-1,Hqt=0,Wqt=8;function _w(e){if(!(this instanceof _w))return new _w(e);this.options=OR.assign({level:Gqt,method:Wqt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Hqt,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qqt,this.strm.avail_out=0;var r=RR.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==V3)throw new Error(Ble[r]);if(t.header&&RR.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Mle.string2buf(t.dictionary):sZe.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=RR.deflateSetDictionary(this.strm,n),r!==V3)throw new Error(Ble[r]);this._dict_set=!0}}_w.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o,i;if(this.ended)return!1;i=t===~~t?t:t===!0?kle:jqt,typeof e=="string"?r.input=Mle.string2buf(e):sZe.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new OR.Buf8(n),r.next_out=0,r.avail_out=n),o=RR.deflate(r,i),o!==iZe&&o!==V3)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(i===kle||i===aZe))&&(this.options.to==="string"?this.onData(Mle.buf2binstring(OR.shrinkBuf(r.output,r.next_out))):this.onData(OR.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==iZe);return i===kle?(o=RR.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===V3):(i===aZe&&(this.onEnd(V3),r.avail_out=0),!0)};_w.prototype.onData=function(e){this.chunks.push(e)};_w.prototype.onEnd=function(e){e===V3&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=OR.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Rle(e,t){var r=new _w(t);if(r.push(e,!0),r.err)throw r.msg||Ble[r.err];return r.result}function Kqt(e,t){return t=t||{},t.raw=!0,Rle(e,t)}function Yqt(e,t){return t=t||{},t.gzip=!0,Rle(e,t)}LR.Deflate=_w;LR.deflate=Rle;LR.deflateRaw=Kqt;LR.gzip=Yqt});var uZe=ve((o0o,cZe)=>{"use strict";var Tj=30,Xqt=12;cZe.exports=function(t,r){var n,o,i,a,s,l,c,u,d,f,m,p,h,g,y,b,x,C,S,w,A,T,D,E,I;n=t.state,o=t.next_in,E=t.input,i=o+(t.avail_in-5),a=t.next_out,I=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),c=n.dmax,u=n.wsize,d=n.whave,f=n.wnext,m=n.window,p=n.hold,h=n.bits,g=n.lencode,y=n.distcode,b=(1<<n.lenbits)-1,x=(1<<n.distbits)-1;e:do{h<15&&(p+=E[o++]<<h,h+=8,p+=E[o++]<<h,h+=8),C=g[p&b];t:for(;;){if(S=C>>>24,p>>>=S,h-=S,S=C>>>16&255,S===0)I[a++]=C&65535;else if(S&16){w=C&65535,S&=15,S&&(h<S&&(p+=E[o++]<<h,h+=8),w+=p&(1<<S)-1,p>>>=S,h-=S),h<15&&(p+=E[o++]<<h,h+=8,p+=E[o++]<<h,h+=8),C=y[p&x];r:for(;;){if(S=C>>>24,p>>>=S,h-=S,S=C>>>16&255,S&16){if(A=C&65535,S&=15,h<S&&(p+=E[o++]<<h,h+=8,h<S&&(p+=E[o++]<<h,h+=8)),A+=p&(1<<S)-1,A>c){t.msg="invalid distance too far back",n.mode=Tj;break e}if(p>>>=S,h-=S,S=a-s,A>S){if(S=A-S,S>d&&n.sane){t.msg="invalid distance too far back",n.mode=Tj;break e}if(T=0,D=m,f===0){if(T+=u-S,S<w){w-=S;do I[a++]=m[T++];while(--S);T=a-A,D=I}}else if(f<S){if(T+=u+f-S,S-=f,S<w){w-=S;do I[a++]=m[T++];while(--S);if(T=0,f<w){S=f,w-=S;do I[a++]=m[T++];while(--S);T=a-A,D=I}}}else if(T+=f-S,S<w){w-=S;do I[a++]=m[T++];while(--S);T=a-A,D=I}for(;w>2;)I[a++]=D[T++],I[a++]=D[T++],I[a++]=D[T++],w-=3;w&&(I[a++]=D[T++],w>1&&(I[a++]=D[T++]))}else{T=a-A;do I[a++]=I[T++],I[a++]=I[T++],I[a++]=I[T++],w-=3;while(w>2);w&&(I[a++]=I[T++],w>1&&(I[a++]=I[T++]))}}else if((S&64)===0){C=y[(C&65535)+(p&(1<<S)-1)];continue r}else{t.msg="invalid distance code",n.mode=Tj;break e}break}}else if((S&64)===0){C=g[(C&65535)+(p&(1<<S)-1)];continue t}else if(S&32){n.mode=Xqt;break e}else{t.msg="invalid literal/length code",n.mode=Tj;break e}break}}while(o<i&&a<l);w=h>>3,o-=w,h-=w<<3,p&=(1<<h)-1,t.next_in=o,t.next_out=a,t.avail_in=o<i?5+(i-o):5-(o-i),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=p,n.bits=h}});var yZe=ve((i0o,gZe)=>{"use strict";var dZe=d1(),z3=15,fZe=852,mZe=592,pZe=0,Ole=1,hZe=2,Zqt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],$qt=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Qqt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Jqt=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];gZe.exports=function(t,r,n,o,i,a,s,l){var c=l.bits,u=0,d=0,f=0,m=0,p=0,h=0,g=0,y=0,b=0,x=0,C,S,w,A,T,D=null,E=0,I,k=new dZe.Buf16(z3+1),R=new dZe.Buf16(z3+1),B=null,O=0,F,q,W;for(u=0;u<=z3;u++)k[u]=0;for(d=0;d<o;d++)k[r[n+d]]++;for(p=c,m=z3;m>=1&&k[m]===0;m--);if(p>m&&(p=m),m===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f<m&&k[f]===0;f++);for(p<f&&(p=f),y=1,u=1;u<=z3;u++)if(y<<=1,y-=k[u],y<0)return-1;if(y>0&&(t===pZe||m!==1))return-1;for(R[1]=0,u=1;u<z3;u++)R[u+1]=R[u]+k[u];for(d=0;d<o;d++)r[n+d]!==0&&(s[R[r[n+d]]++]=d);if(t===pZe?(D=B=s,I=19):t===Ole?(D=Zqt,E-=257,B=$qt,O-=257,I=256):(D=Qqt,B=Jqt,I=-1),x=0,d=0,u=f,T=a,h=p,g=0,w=-1,b=1<<p,A=b-1,t===Ole&&b>fZe||t===hZe&&b>mZe)return 1;for(;;){F=u-g,s[d]<I?(q=0,W=s[d]):s[d]>I?(q=B[O+s[d]],W=D[E+s[d]]):(q=96,W=0),C=1<<u-g,S=1<<h,f=S;do S-=C,i[T+(x>>g)+S]=F<<24|q<<16|W|0;while(S!==0);for(C=1<<u-1;x&C;)C>>=1;if(C!==0?(x&=C-1,x+=C):x=0,d++,--k[u]===0){if(u===m)break;u=r[n+s[d]]}if(u>p&&(x&A)!==w){for(g===0&&(g=p),T+=f,h=u-g,y=1<<h;h+g<m&&(y-=k[h+g],!(y<=0));)h++,y<<=1;if(b+=1<<h,t===Ole&&b>fZe||t===hZe&&b>mZe)return 1;w=x&A,i[w]=p<<24|h<<16|T-a|0}}return x!==0&&(i[T+x]=u-g<<24|64<<16|0),l.bits=p,0}});var QZe=ve(p0=>{"use strict";var xp=d1(),zle=Cle(),Cv=wle(),ejt=uZe(),FR=yZe(),tjt=0,jZe=1,GZe=2,vZe=4,rjt=5,Aj=6,Cw=0,njt=1,ojt=2,Kh=-2,HZe=-3,qle=-4,ijt=-5,bZe=8,WZe=1,xZe=2,SZe=3,_Ze=4,CZe=5,wZe=6,TZe=7,AZe=8,PZe=9,IZe=10,Ej=11,p1=12,Lle=13,EZe=14,Fle=15,DZe=16,kZe=17,MZe=18,BZe=19,Pj=20,Ij=21,RZe=22,OZe=23,LZe=24,FZe=25,NZe=26,Nle=27,UZe=28,VZe=29,ks=30,jle=31,ajt=32,sjt=852,ljt=592,cjt=15,ujt=cjt;function zZe(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function djt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new xp.Buf16(320),this.work=new xp.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function KZe(e){var t;return!e||!e.state?Kh:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=WZe,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new xp.Buf32(sjt),t.distcode=t.distdyn=new xp.Buf32(ljt),t.sane=1,t.back=-1,Cw)}function YZe(e){var t;return!e||!e.state?Kh:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,KZe(e))}function XZe(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Kh:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,YZe(e))}function ZZe(e,t){var r,n;return e?(n=new djt,e.state=n,n.window=null,r=XZe(e,t),r!==Cw&&(e.state=null),r):Kh}function fjt(e){return ZZe(e,ujt)}var qZe=!0,Ule,Vle;function mjt(e){if(qZe){var t;for(Ule=new xp.Buf32(512),Vle=new xp.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(FR(jZe,e.lens,0,288,Ule,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;FR(GZe,e.lens,0,32,Vle,0,e.work,{bits:5}),qZe=!1}e.lencode=Ule,e.lenbits=9,e.distcode=Vle,e.distbits=5}function $Ze(e,t,r,n){var o,i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new xp.Buf8(i.wsize)),n>=i.wsize?(xp.arraySet(i.window,t,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),xp.arraySet(i.window,t,r-n,o,i.wnext),n-=o,n?(xp.arraySet(i.window,t,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}function pjt(e,t){var r,n,o,i,a,s,l,c,u,d,f,m,p,h,g=0,y,b,x,C,S,w,A,T,D=new xp.Buf8(4),E,I,k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Kh;r=e.state,r.mode===p1&&(r.mode=Lle),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,d=s,f=l,T=Cw;e:for(;;)switch(r.mode){case WZe:if(r.wrap===0){r.mode=Lle;break}for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0),c=0,u=0,r.mode=xZe;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ks;break}if((c&15)!==bZe){e.msg="unknown compression method",r.mode=ks;break}if(c>>>=4,u-=4,A=(c&15)+8,r.wbits===0)r.wbits=A;else if(A>r.wbits){e.msg="invalid window size",r.mode=ks;break}r.dmax=1<<A,e.adler=r.check=1,r.mode=c&512?IZe:p1,c=0,u=0;break;case xZe:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==bZe){e.msg="unknown compression method",r.mode=ks;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=ks;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0)),c=0,u=0,r.mode=SZe;case SZe:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,D[2]=c>>>16&255,D[3]=c>>>24&255,r.check=Cv(r.check,D,4,0)),c=0,u=0,r.mode=_Ze;case _Ze:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0)),c=0,u=0,r.mode=CZe;case CZe:if(r.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=wZe;case wZe:if(r.flags&1024&&(m=r.length,m>s&&(m=s),m&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),xp.arraySet(r.head.extra,n,i,m,A)),r.flags&512&&(r.check=Cv(r.check,n,m,i)),s-=m,i+=m,r.length-=m),r.length))break e;r.length=0,r.mode=TZe;case TZe:if(r.flags&2048){if(s===0)break e;m=0;do A=n[i+m++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A));while(A&&m<s);if(r.flags&512&&(r.check=Cv(r.check,n,m,i)),s-=m,i+=m,A)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=AZe;case AZe:if(r.flags&4096){if(s===0)break e;m=0;do A=n[i+m++],r.head&&A&&r.length<65536&&(r.head.comment+=String.fromCharCode(A));while(A&&m<s);if(r.flags&512&&(r.check=Cv(r.check,n,m,i)),s-=m,i+=m,A)break e}else r.head&&(r.head.comment=null);r.mode=PZe;case PZe:if(r.flags&512){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=ks;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=p1;break;case IZe:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}e.adler=r.check=zZe(c),c=0,u=0,r.mode=Ej;case Ej:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,ojt;e.adler=r.check=1,r.mode=p1;case p1:if(t===rjt||t===Aj)break e;case Lle:if(r.last){c>>>=u&7,u-=u&7,r.mode=Nle;break}for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=EZe;break;case 1:if(mjt(r),r.mode=Pj,t===Aj){c>>>=2,u-=2;break e}break;case 2:r.mode=kZe;break;case 3:e.msg="invalid block type",r.mode=ks}c>>>=2,u-=2;break;case EZe:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=ks;break}if(r.length=c&65535,c=0,u=0,r.mode=Fle,t===Aj)break e;case Fle:r.mode=DZe;case DZe:if(m=r.length,m){if(m>s&&(m=s),m>l&&(m=l),m===0)break e;xp.arraySet(o,n,i,m,a),s-=m,i+=m,l-=m,a+=m,r.length-=m;break}r.mode=p1;break;case kZe:for(;u<14;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ks;break}r.have=0,r.mode=MZe;case MZe:for(;r.have<r.ncode;){for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.lens[k[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[k[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,E={bits:r.lenbits},T=FR(tjt,r.lens,0,19,r.lencode,0,r.work,E),r.lenbits=E.bits,T){e.msg="invalid code lengths set",r.mode=ks;break}r.have=0,r.mode=BZe;case BZe:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[c&(1<<r.lenbits)-1],y=g>>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(x<16)c>>>=y,u-=y,r.lens[r.have++]=x;else{if(x===16){for(I=y+2;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c>>>=y,u-=y,r.have===0){e.msg="invalid bit length repeat",r.mode=ks;break}A=r.lens[r.have-1],m=3+(c&3),c>>>=2,u-=2}else if(x===17){for(I=y+3;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=y,u-=y,A=0,m=3+(c&7),c>>>=3,u-=3}else{for(I=y+7;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=y,u-=y,A=0,m=11+(c&127),c>>>=7,u-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ks;break}for(;m--;)r.lens[r.have++]=A}}if(r.mode===ks)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=ks;break}if(r.lenbits=9,E={bits:r.lenbits},T=FR(jZe,r.lens,0,r.nlen,r.lencode,0,r.work,E),r.lenbits=E.bits,T){e.msg="invalid literal/lengths set",r.mode=ks;break}if(r.distbits=6,r.distcode=r.distdyn,E={bits:r.distbits},T=FR(GZe,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,E),r.distbits=E.bits,T){e.msg="invalid distances set",r.mode=ks;break}if(r.mode=Pj,t===Aj)break e;case Pj:r.mode=Ij;case Ij:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,ejt(e,f),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,r.mode===p1&&(r.back=-1);break}for(r.back=0;g=r.lencode[c&(1<<r.lenbits)-1],y=g>>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(b&&(b&240)===0){for(C=y,S=b,w=x;g=r.lencode[w+((c&(1<<C+S)-1)>>C)],y=g>>>24,b=g>>>16&255,x=g&65535,!(C+y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,r.length=x,b===0){r.mode=NZe;break}if(b&32){r.back=-1,r.mode=p1;break}if(b&64){e.msg="invalid literal/length code",r.mode=ks;break}r.extra=b&15,r.mode=RZe;case RZe:if(r.extra){for(I=r.extra;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=OZe;case OZe:for(;g=r.distcode[c&(1<<r.distbits)-1],y=g>>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if((b&240)===0){for(C=y,S=b,w=x;g=r.distcode[w+((c&(1<<C+S)-1)>>C)],y=g>>>24,b=g>>>16&255,x=g&65535,!(C+y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,b&64){e.msg="invalid distance code",r.mode=ks;break}r.offset=x,r.extra=b&15,r.mode=LZe;case LZe:if(r.extra){for(I=r.extra;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ks;break}r.mode=FZe;case FZe:if(l===0)break e;if(m=f-l,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ks;break}m>r.wnext?(m-=r.wnext,p=r.wsize-m):p=r.wnext-m,m>r.length&&(m=r.length),h=r.window}else h=o,p=a-r.offset,m=r.length;m>l&&(m=l),l-=m,r.length-=m;do o[a++]=h[p++];while(--m);r.length===0&&(r.mode=Ij);break;case NZe:if(l===0)break e;o[a++]=r.length,l--,r.mode=Ij;break;case Nle:if(r.wrap){for(;u<32;){if(s===0)break e;s--,c|=n[i++]<<u,u+=8}if(f-=l,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?Cv(r.check,o,f,a-f):zle(r.check,o,f,a-f)),f=l,(r.flags?c:zZe(c))!==r.check){e.msg="incorrect data check",r.mode=ks;break}c=0,u=0}r.mode=UZe;case UZe:if(r.wrap&&r.flags){for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=ks;break}c=0,u=0}r.mode=VZe;case VZe:T=njt;break e;case ks:T=HZe;break e;case jle:return qle;case ajt:default:return Kh}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||f!==e.avail_out&&r.mode<ks&&(r.mode<Nle||t!==vZe))&&$Ze(e,e.output,e.next_out,f-e.avail_out)?(r.mode=jle,qle):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?Cv(r.check,o,f,e.next_out-f):zle(r.check,o,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===p1?128:0)+(r.mode===Pj||r.mode===Fle?256:0),(d===0&&f===0||t===vZe)&&T===Cw&&(T=ijt),T)}function hjt(e){if(!e||!e.state)return Kh;var t=e.state;return t.window&&(t.window=null),e.state=null,Cw}function gjt(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)===0)?Kh:(r.head=t,t.done=!1,Cw)}function yjt(e,t){var r=t.length,n,o,i;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Ej)?Kh:n.mode===Ej&&(o=1,o=zle(o,t,r,0),o!==n.check)?HZe:(i=$Ze(e,t,r,r),i?(n.mode=jle,qle):(n.havedict=1,Cw))}p0.inflateReset=YZe;p0.inflateReset2=XZe;p0.inflateResetKeep=KZe;p0.inflateInit=fjt;p0.inflateInit2=ZZe;p0.inflate=pjt;p0.inflateEnd=hjt;p0.inflateGetHeader=gjt;p0.inflateSetDictionary=yjt;p0.inflateInfo="pako inflate (from Nodeca project)"});var Gle=ve((s0o,JZe)=>{"use strict";JZe.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var t$e=ve((l0o,e$e)=>{"use strict";function vjt(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e$e.exports=vjt});var n$e=ve(UR=>{"use strict";var q3=QZe(),NR=d1(),Dj=Ele(),Gl=Gle(),Hle=yj(),bjt=Dle(),xjt=t$e(),r$e=Object.prototype.toString;function ww(e){if(!(this instanceof ww))return new ww(e);this.options=NR.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bjt,this.strm.avail_out=0;var r=q3.inflateInit2(this.strm,t.windowBits);if(r!==Gl.Z_OK)throw new Error(Hle[r]);if(this.header=new xjt,q3.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Dj.string2buf(t.dictionary):r$e.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=q3.inflateSetDictionary(this.strm,t.dictionary),r!==Gl.Z_OK)))throw new Error(Hle[r])}ww.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,i,a,s,l,c,u=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?Gl.Z_FINISH:Gl.Z_NO_FLUSH,typeof e=="string"?r.input=Dj.binstring2buf(e):r$e.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new NR.Buf8(n),r.next_out=0,r.avail_out=n),i=q3.inflate(r,Gl.Z_NO_FLUSH),i===Gl.Z_NEED_DICT&&o&&(i=q3.inflateSetDictionary(this.strm,o)),i===Gl.Z_BUF_ERROR&&u===!0&&(i=Gl.Z_OK,u=!1),i!==Gl.Z_STREAM_END&&i!==Gl.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(r.avail_out===0||i===Gl.Z_STREAM_END||r.avail_in===0&&(a===Gl.Z_FINISH||a===Gl.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=Dj.utf8border(r.output,r.next_out),l=r.next_out-s,c=Dj.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&NR.arraySet(r.output,r.output,s,l,0),this.onData(c)):this.onData(NR.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&i!==Gl.Z_STREAM_END);return i===Gl.Z_STREAM_END&&(a=Gl.Z_FINISH),a===Gl.Z_FINISH?(i=q3.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Gl.Z_OK):(a===Gl.Z_SYNC_FLUSH&&(this.onEnd(Gl.Z_OK),r.avail_out=0),!0)};ww.prototype.onData=function(e){this.chunks.push(e)};ww.prototype.onEnd=function(e){e===Gl.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=NR.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Wle(e,t){var r=new ww(t);if(r.push(e,!0),r.err)throw r.msg||Hle[r.err];return r.result}function Sjt(e,t){return t=t||{},t.raw=!0,Wle(e,t)}UR.Inflate=ww;UR.inflate=Wle;UR.inflateRaw=Sjt;UR.ungzip=Wle});var a$e=ve((u0o,i$e)=>{"use strict";var _jt=d1().assign,Cjt=lZe(),wjt=n$e(),Tjt=Gle(),o$e={};_jt(o$e,Cjt,wjt,Tjt);i$e.exports=o$e});var Kle=ve(kj=>{"use strict";Object.defineProperty(kj,"__esModule",{value:!0});kj.sum=s$e;kj.concatUint8Array=Ajt;function s$e(e){let t=0;for(let r of e)t+=r.length;return t}function Ajt(e){let t=new Uint8Array(s$e(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}});var Yle=ve(j3=>{"use strict";var Pjt=j3&&j3.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j3,"__esModule",{value:!0});j3.unzip=Djt;j3.unzipChunkSlice=kjt;var Ijt=Pjt(a$e()),l$e=Kle(),{Z_SYNC_FLUSH:c$e,Inflate:u$e}=Ijt.default;function Ejt(e,t){let r=t.subarray(0,Math.min(32,t.length)),n=0,o=r.length;for(let i=0;i<o;i++)n=(n<<5)-n+r[i]&4294967295;return`${e}_${n}`}async function Djt(e){try{let t,r=0,n,o=[];do{let i=e.subarray(r);if(n=new u$e,{strm:t}=n,n.push(i,c$e),n.err)throw new Error(n.msg);r+=t.next_in,o.push(n.result)}while(t.avail_in);return(0,l$e.concatUint8Array)(o)}catch(t){throw/incorrect header check/.exec(`${t}`)?new Error("problem decompressing block: incorrect gzip header check"):t}}async function kjt(e,t,r){try{let n,{minv:o,maxv:i}=t,a=o.blockPosition,s=o.dataPosition,l=[],c=[],u=[],d=0,f=!1;do{let m=e.subarray(a-o.blockPosition),p=Ejt(a,m),h,g,y=r?.get(p);if(y)h=y.buffer,g=y.nextIn,f=!0;else{let C=new u$e;if({strm:n}=C,C.push(m,c$e),C.err)throw new Error(C.msg);h=C.result,g=n.next_in,f=!1,r?.set(p,{buffer:h,nextIn:g})}l.push(h);let b=h.length;c.push(a),u.push(s),l.length===1&&o.dataPosition&&(l[0]=l[0].subarray(o.dataPosition),b=l[0].length);let x=a;if(a+=g,s+=b,x>=i.blockPosition){l[d]=l[d].subarray(0,i.blockPosition===o.blockPosition?i.dataPosition-o.dataPosition+1:i.dataPosition+1),c.push(a),u.push(s);break}d++}while(f?a<e.length+o.blockPosition:n.avail_in);return{buffer:(0,l$e.concatUint8Array)(l),cpositions:c,dpositions:u}}catch(n){throw/incorrect header check/.exec(`${n}`)?new Error("problem decompressing block: incorrect gzip header check"):n}}});var d$e=ve(VR=>{"use strict";var Mjt=VR&&VR.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(VR,"__esModule",{value:!0});var Bjt=Mjt(bXe()),Rjt=Yle(),Ojt=Kle(),Xle=class{constructor({filehandle:t,gziFilehandle:r}){this.filehandle=t,this.gzi=new Bjt.default({filehandle:r})}async _readAndUncompressBlock(t,r){let n=r;n||(n=(await this.filehandle.stat()).size);let o=n-t,i=await this.filehandle.read(o,t);return(0,Rjt.unzip)(i)}async read(t,r){let n=await this.gzi.getRelevantBlocksForRead(t,r),o=[];for(let i=0;i<n.length-1;i+=1){let a=await this._readAndUncompressBlock(n[i][0],n[i+1][0]),[,s]=n[i],l=s>=r?0:r-s,c=Math.min(r+t,s+a.length)-s;l>=0&&l<a.length&&o.push(a.subarray(l,c))}return(0,Ojt.concatUint8Array)(o)}};VR.default=Xle});var m$e=ve(wv=>{"use strict";var Ljt=wv&&wv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wv,"__esModule",{value:!0});wv.unzipChunkSlice=wv.unzip=wv.BgzfFilehandle=void 0;var Fjt=d$e();Object.defineProperty(wv,"BgzfFilehandle",{enumerable:!0,get:function(){return Ljt(Fjt).default}});var f$e=Yle();Object.defineProperty(wv,"unzip",{enumerable:!0,get:function(){return f$e.unzip}});Object.defineProperty(wv,"unzipChunkSlice",{enumerable:!0,get:function(){return f$e.unzipChunkSlice}})});var p$e=ve($le=>{"use strict";Object.defineProperty($le,"__esModule",{value:!0});$le.default=Njt;var Zle=Wr();function Njt(){let e=(0,Zle.useRef)(null),[t,r]=(0,Zle.useState)({width:void 0,height:void 0});return(0,Zle.useEffect)(()=>{if(!e.current)return;let n=typeof window<"u"&&"ResizeObserver"in window?window.ResizeObserver:void 0;if(!n)return;let o=new n(i=>{r({width:i[0].contentRect.width,height:i[0].contentRect.height})});return o.observe(e.current),()=>{o.disconnect()}},[]),[e,t]}});var g$e=ve((g0o,h$e)=>{h$e.exports=JBrowseExports["react-dom"]});var rce=ve(Tw=>{Object.defineProperty(Tw,"__esModule",{value:!0});var Ujt={grad:.9,turn:360,rad:360/(2*Math.PI)},h1=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Iu=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},Yh=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},w$e=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},y$e=function(e){return{r:Yh(e.r,0,255),g:Yh(e.g,0,255),b:Yh(e.b,0,255),a:Yh(e.a)}},Qle=function(e){return{r:Iu(e.r),g:Iu(e.g),b:Iu(e.b),a:Iu(e.a,3)}},Vjt=/^#([0-9a-f]{3,8})$/i,Mj=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},T$e=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=Math.max(t,r,n),a=i-Math.min(t,r,n),s=a?i===t?(r-n)/a:i===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:o}},A$e=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var i=Math.floor(t),a=n*(1-r),s=n*(1-(t-i)*r),l=n*(1-(1-t+i)*r),c=i%6;return{r:255*[n,s,a,a,l,n][c],g:255*[l,n,n,s,a,a][c],b:255*[a,a,l,n,n,s][c],a:o}},v$e=function(e){return{h:w$e(e.h),s:Yh(e.s,0,100),l:Yh(e.l,0,100),a:Yh(e.a)}},b$e=function(e){return{h:Iu(e.h),s:Iu(e.s),l:Iu(e.l),a:Iu(e.a,3)}},x$e=function(e){return A$e((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},zR=function(e){return{h:(t=T$e(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},zjt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qjt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jjt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gjt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tce={string:[[function(e){var t=Vjt.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Iu(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Iu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=jjt.exec(e)||Gjt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:y$e({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=zjt.exec(e)||qjt.exec(e);if(!t)return null;var r,n,o=v$e({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(Ujt[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return x$e(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=o===void 0?1:o;return h1(t)&&h1(r)&&h1(n)?y$e({r:Number(t),g:Number(r),b:Number(n),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,i=o===void 0?1:o;if(!h1(t)||!h1(r)||!h1(n))return null;var a=v$e({h:Number(t),s:Number(r),l:Number(n),a:Number(i)});return x$e(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,i=o===void 0?1:o;if(!h1(t)||!h1(r)||!h1(n))return null;var a=(function(s){return{h:w$e(s.h),s:Yh(s.s,0,100),v:Yh(s.v,0,100),a:Yh(s.a)}})({h:Number(t),s:Number(r),v:Number(n),a:Number(i)});return A$e(a)},"hsv"]]},S$e=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},P$e=function(e){return typeof e=="string"?S$e(e.trim(),tce.string):typeof e=="object"&&e!==null?S$e(e,tce.object):[null,void 0]},Jle=function(e,t){var r=zR(e);return{h:r.h,s:Yh(r.s+100*t,0,100),l:r.l,a:r.a}},ece=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},_$e=function(e,t){var r=zR(e);return{h:r.h,s:r.s,l:Yh(r.l+100*t,0,100),a:r.a}},qR=(function(){function e(t){this.parsed=P$e(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Iu(ece(this.rgba),2)},e.prototype.isDark=function(){return ece(this.rgba)<.5},e.prototype.isLight=function(){return ece(this.rgba)>=.5},e.prototype.toHex=function(){return t=Qle(this.rgba),r=t.r,n=t.g,o=t.b,a=(i=t.a)<1?Mj(Iu(255*i)):"","#"+Mj(r)+Mj(n)+Mj(o)+a;var t,r,n,o,i,a},e.prototype.toRgb=function(){return Qle(this.rgba)},e.prototype.toRgbString=function(){return t=Qle(this.rgba),r=t.r,n=t.g,o=t.b,(i=t.a)<1?"rgba("+r+", "+n+", "+o+", "+i+")":"rgb("+r+", "+n+", "+o+")";var t,r,n,o,i},e.prototype.toHsl=function(){return b$e(zR(this.rgba))},e.prototype.toHslString=function(){return t=b$e(zR(this.rgba)),r=t.h,n=t.s,o=t.l,(i=t.a)<1?"hsla("+r+", "+n+"%, "+o+"%, "+i+")":"hsl("+r+", "+n+"%, "+o+"%)";var t,r,n,o,i},e.prototype.toHsv=function(){return t=T$e(this.rgba),{h:Iu(t.h),s:Iu(t.s),v:Iu(t.v),a:Iu(t.a,3)};var t},e.prototype.invert=function(){return Tv({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),Tv(Jle(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),Tv(Jle(this.rgba,-t))},e.prototype.grayscale=function(){return Tv(Jle(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),Tv(_$e(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),Tv(_$e(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?Tv({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):Iu(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=zR(this.rgba);return typeof t=="number"?Tv({h:t,s:r.s,l:r.l,a:r.a}):Iu(r.h)},e.prototype.isEqual=function(t){return this.toHex()===Tv(t).toHex()},e})(),Tv=function(e){return e instanceof qR?e:new qR(e)},C$e=[];Tw.Colord=qR,Tw.colord=Tv,Tw.extend=function(e){e.forEach(function(t){C$e.indexOf(t)<0&&(t(qR,tce),C$e.push(t))})},Tw.getFormat=function(e){return P$e(e)[1]},Tw.random=function(){return new qR({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}});var D$e=ve((v0o,E$e)=>{var Av=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},nce=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},oce=function(e){return 255*(e>.0031308?1.055*Math.pow(e,.4166666666666667)-.055:12.92*e)},ice=96.422,ace=100,sce=82.521,Hjt=function(e){var t,r,n={x:.9555766*(t=e).x+-.0230393*t.y+.0631636*t.z,y:-.0282895*t.x+1.0099416*t.y+.0210077*t.z,z:.0122982*t.x+-.020483*t.y+1.3299098*t.z};return r={r:oce(.032404542*n.x-.015371385*n.y-.004985314*n.z),g:oce(-.00969266*n.x+.018760108*n.y+41556e-8*n.z),b:oce(556434e-9*n.x-.002040259*n.y+.010572252*n.z),a:e.a},{r:Av(r.r,0,255),g:Av(r.g,0,255),b:Av(r.b,0,255),a:Av(r.a)}},Wjt=function(e){var t=nce(e.r),r=nce(e.g),n=nce(e.b);return(function(o){return{x:Av(o.x,0,ice),y:Av(o.y,0,ace),z:Av(o.z,0,sce),a:Av(o.a)}})((function(o){return{x:1.0478112*o.x+.0228866*o.y+-.050127*o.z,y:.0295424*o.x+.9904844*o.y+-.0170491*o.z,z:-.0092345*o.x+.0150436*o.y+.7521316*o.z,a:o.a}})({x:100*(.4124564*t+.3575761*r+.1804375*n),y:100*(.2126729*t+.7151522*r+.072175*n),z:100*(.0193339*t+.119192*r+.9503041*n),a:e.a}))},jR=216/24389,G3=24389/27,I$e=function(e){var t=Wjt(e),r=t.x/ice,n=t.y/ace,o=t.z/sce;return r=r>jR?Math.cbrt(r):(G3*r+16)/116,{l:116*(n=n>jR?Math.cbrt(n):(G3*n+16)/116)-16,a:500*(r-n),b:200*(n-(o=o>jR?Math.cbrt(o):(G3*o+16)/116)),alpha:t.a}},Kjt=function(e,t,r){var n,o=I$e(e),i=I$e(t);return(function(a){var s=(a.l+16)/116,l=a.a/500+s,c=s-a.b/200;return Hjt({x:(Math.pow(l,3)>jR?Math.pow(l,3):(116*l-16)/G3)*ice,y:(a.l>8?Math.pow((a.l+16)/116,3):a.l/G3)*ace,z:(Math.pow(c,3)>jR?Math.pow(c,3):(116*c-16)/G3)*sce,a:a.alpha})})({l:Av((n={l:o.l*(1-r)+i.l*r,a:o.a*(1-r)+i.a*r,b:o.b*(1-r)+i.b*r,alpha:o.alpha*(1-r)+i.alpha*r}).l,0,400),a:n.a,b:n.b,alpha:Av(n.alpha)})};E$e.exports=function(e){function t(r,n,o){o===void 0&&(o=5);for(var i=[],a=1/(o-1),s=0;s<=o-1;s++)i.push(r.mix(n,a*s));return i}e.prototype.mix=function(r,n){n===void 0&&(n=.5);var o=r instanceof e?r:new e(r),i=Kjt(this.toRgb(),o.toRgb(),n);return new e(i)},e.prototype.tints=function(r){return t(this,"#fff",r)},e.prototype.shades=function(r){return t(this,"#000",r)},e.prototype.tones=function(r){return t(this,"#808080",r)}}});var M$e=ve((b0o,k$e)=>{k$e.exports=function(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var o in r)n[r[o]]=o;var i={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,l,c=n[this.toHex()];if(c)return c;if(a?.closest){var u=this.toRgb(),d=1/0,f="black";if(!i.length)for(var m in r)i[m]=new e(r[m]).toRgb();for(var p in r){var h=(s=u,l=i[p],Math.pow(s.r-l.r,2)+Math.pow(s.g-l.g,2)+Math.pow(s.b-l.b,2));h<d&&(d=h,f=p)}return f}},t.string.push([function(a){var s=a.toLowerCase(),l=s==="transparent"?"#0000":r[s];return l?new e(l).toRgb():null},"name"])}});var O$e=ve(h_=>{"use strict";var B$e=h_&&h_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h_,"__esModule",{value:!0});h_.colord=h_.Colord=void 0;var Yjt=rce(),Xjt=B$e(D$e()),Zjt=B$e(M$e());(0,Yjt.extend)([Xjt.default,Zjt.default]);var R$e=rce();Object.defineProperty(h_,"Colord",{enumerable:!0,get:function(){return R$e.Colord}});Object.defineProperty(h_,"colord",{enumerable:!0,get:function(){return R$e.colord}})});var lce=ve(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0});GR.createStopToken=Qjt;GR.stopStopToken=Jjt;GR.checkStopToken=e9t;function $jt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Qjt(){var e;return((e=URL.createObjectURL)===null||e===void 0?void 0:e.call(URL,new Blob))||`${Math.random()}`}function Jjt(e){var t;(t=URL.revokeObjectURL)===null||t===void 0||t.call(URL,e)}function e9t(e){if(typeof jest>"u"&&e!==void 0&&$jt()){let t=new XMLHttpRequest;t.open("GET",e,!1);try{t.send(null)}catch{throw new Error("aborted")}}}});var F$e=ve(L$e=>{"use strict";Object.defineProperty(L$e,"__esModule",{value:!0})});var G$e=ve((C0o,j$e)=>{"use strict";var z$e=(e,t)=>e>t?1:e<t?-1:0,cce=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),N$e="eexxaacctt",t9t=/\p{P}/gu,r9t=["en",{numeric:!0,sensitivity:"base"}],H3=(e,t,r)=>e.replace("A-Z",t).replace("a-z",r),U$e={unicode:!1,alpha:null,interSplit:"[^A-Za-z\\d']+",intraSplit:"[a-z][A-Z]",interBound:"[^A-Za-z\\d]",intraBound:"[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:1/0,intraChars:"[a-z\\d']",intraIns:null,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,1/0],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,r)=>!0,toUpper:e=>e.toLocaleUpperCase(),toLower:e=>e.toLocaleLowerCase(),compare:null,sort:(e,t,r,n=z$e)=>{let{idx:o,chars:i,terms:a,interLft2:s,interLft1:l,start:c,intraIns:u,interIns:d,cases:f}=e;return o.map((m,p)=>p).sort((m,p)=>i[p]-i[m]||u[m]-u[p]||a[p]+s[p]+.5*l[p]-(a[m]+s[m]+.5*l[m])||d[m]-d[p]||c[m]-c[p]||f[p]-f[m]||n(t[o[m]],t[o[p]]))}},uce=(e,t)=>t==0?"":t==1?e+"??":t==1/0?e+"*?":e+`{0,${t}}?`,V$e="(?:\\b|_)";function Bj(e){e=Object.assign({},U$e,e);let{unicode:t,interLft:r,interRgt:n,intraMode:o,intraSlice:i,intraIns:a,intraSub:s,intraTrn:l,intraDel:c,intraContr:u,intraSplit:d,interSplit:f,intraBound:m,interBound:p,intraChars:h,toUpper:g,toLower:y,compare:b}=e;a??=o,s??=o,l??=o,c??=o,b??=typeof Intl>"u"?z$e:new Intl.Collator(...r9t).compare;let x=e.letters??e.alpha;if(x!=null){let oe=g(x),X=y(x);f=H3(f,oe,X),d=H3(d,oe,X),p=H3(p,oe,X),m=H3(m,oe,X),h=H3(h,oe,X),u=H3(u,oe,X)}let C=t?"u":"",S='".+?"',w=new RegExp(S,"gi"+C),A=new RegExp(`(?:\\s+|^)-(?:${h}+|${S})`,"gi"+C),{intraRules:T}=e;T==null&&(T=oe=>{let X=U$e.intraSlice,Y=0,ne=0,K=0,$=0;if(/[^\d]/.test(oe)){let Z=oe.length;Z<=4?Z>=3&&(K=Math.min(l,1),Z==4&&(Y=Math.min(a,1))):(X=i,Y=a,ne=s,K=l,$=c)}return{intraSlice:X,intraIns:Y,intraSub:ne,intraTrn:K,intraDel:$}});let D=!!d,E=new RegExp(d,"g"+C),I=new RegExp(f,"g"+C),k=new RegExp("^"+f+"|"+f+"$","g"+C),R=new RegExp(u,"gi"+C),B=(oe,X=!1)=>{let Y=[];oe=oe.replace(w,K=>(Y.push(K),N$e)),oe=oe.replace(k,""),X||(oe=y(oe)),D&&(oe=oe.replace(E,K=>K[0]+" "+K[1]));let ne=0;return oe.split(I).filter(K=>K!="").map(K=>K===N$e?Y[ne++]:K)},O=/[^\d]+|\d+/g,F=(oe,X=0,Y=!1)=>{let ne=B(oe);if(ne.length==0)return[];let K=Array(ne.length).fill("");ne=ne.map((ae,ye)=>ae.replace(R,we=>(K[ye]=we,"")));let $;if(o==1)$=ne.map((ae,ye)=>{if(ae[0]==='"')return cce(ae.slice(1,-1));let we="";for(let re of ae.matchAll(O)){let ee=re[0],{intraSlice:le,intraIns:pe,intraSub:ke,intraTrn:Ve,intraDel:Xe}=T(ee);if(pe+ke+Ve+Xe==0)we+=ee+K[ye];else{let[pt,_e]=le,Ie=ee.slice(0,pt),Re=ee.slice(_e),ze=ee.slice(pt,_e);pe==1&&Ie.length==1&&Ie!=ze[0]&&(Ie+="(?!"+Ie+")");let N=ze.length,J=[ee];if(ke)for(let Ae=0;Ae<N;Ae++)J.push(Ie+ze.slice(0,Ae)+h+ze.slice(Ae+1)+Re);if(Ve)for(let Ae=0;Ae<N-1;Ae++)ze[Ae]!=ze[Ae+1]&&J.push(Ie+ze.slice(0,Ae)+ze[Ae+1]+ze[Ae]+ze.slice(Ae+2)+Re);if(Xe)for(let Ae=0;Ae<N;Ae++)J.push(Ie+ze.slice(0,Ae+1)+"?"+ze.slice(Ae+1)+Re);if(pe){let Ae=uce(h,1);for(let qe=0;qe<N;qe++)J.push(Ie+ze.slice(0,qe)+Ae+ze.slice(qe)+Re)}we+="(?:"+J.join("|")+")"+K[ye]}}return we});else{let ae=uce(h,a);X==2&&a>0&&(ae=")("+ae+")("),$=ne.map((ye,we)=>ye[0]==='"'?cce(ye.slice(1,-1)):ye.split("").map((re,ee,le)=>(a==1&&ee==0&&le.length>1&&re!=le[ee+1]&&(re+="(?!"+re+")"),re)).join(ae)+K[we])}let Z=r==2?V$e:"",de=n==2?V$e:"",Q=de+uce(e.interChars,e.interIns)+Z;return X>0?Y?$=Z+"("+$.join(")"+de+"|"+Z+"(")+")"+de:($="("+$.join(")("+Q+")(")+")",$="(.??"+Z+")"+$+"("+de+".*)"):($=$.join(Q),$=Z+$+de),[new RegExp($,"i"+C),ne,K]},q=(oe,X,Y)=>{let[ne]=F(X);if(ne==null)return null;let K=[];if(Y!=null)for(let $=0;$<Y.length;$++){let Z=Y[$];ne.test(oe[Z])&&K.push(Z)}else for(let $=0;$<oe.length;$++)ne.test(oe[$])&&K.push($);return K},W=!!m,j=new RegExp(p,C),L=new RegExp(m,C),V=(oe,X,Y)=>{let[ne,K,$]=F(Y,1),Z=B(Y,!0),[de]=F(Y,2),Q=K.length,ae=Array(Q),ye=Array(Q);for(let ke=0;ke<Q;ke++){let Ve=K[ke],Xe=Z[ke],pt=Ve[0]=='"'?Ve.slice(1,-1):Ve+$[ke],_e=Xe[0]=='"'?Xe.slice(1,-1):Xe+$[ke];ae[ke]=pt,ye[ke]=_e}let we=oe.length,re=Array(we).fill(0),ee={idx:Array(we),start:re.slice(),chars:re.slice(),cases:re.slice(),terms:re.slice(),interIns:re.slice(),intraIns:re.slice(),interLft2:re.slice(),interRgt2:re.slice(),interLft1:re.slice(),interRgt1:re.slice(),ranges:Array(we)},le=r==1||n==1,pe=0;for(let ke=0;ke<oe.length;ke++){let Ve=X[oe[ke]],Xe=Ve.match(ne),pt=Xe.index+Xe[1].length,_e=pt,Ie=!1,Re=0,ze=0,N=0,J=0,Ae=0,qe=0,Be=0,Qe=0,at=0,ft=[];for(let mt=0,dt=2;mt<Q;mt++,dt+=2){let Pt=y(Xe[dt]),Lt=ae[mt],Jt=ye[mt],Rt=Lt.length,tr=Pt.length,Kt=Pt==Lt;if(Xe[dt]==Jt&&Be++,!Kt&&Xe[dt+1].length>=Rt){let vr=y(Xe[dt+1]).indexOf(Lt);vr>-1&&(ft.push(_e,tr,vr,Rt),_e+=U(Xe,dt,vr,Rt),Pt=Lt,tr=Rt,Kt=!0,mt==0&&(pt=_e))}if(le||Kt){let vr=_e-1,mn=_e+tr,Zn=!1,jr=!1;if(vr==-1||j.test(Ve[vr]))Kt&&Re++,Zn=!0;else{if(r==2){Ie=!0;break}if(W&&L.test(Ve[vr]+Ve[vr+1]))Kt&&ze++,Zn=!0;else if(r==1){let me=Xe[dt+1],Te=_e+tr;if(me.length>=Rt){let Pe=0,it=!1,Mt=new RegExp(Lt,"ig"+C),Et;for(;Et=Mt.exec(me);){Pe=Et.index;let Nr=Te+Pe,pn=Nr-1;if(pn==-1||j.test(Ve[pn])){Re++,it=!0;break}else if(L.test(Ve[pn]+Ve[Nr])){ze++,it=!0;break}}it&&(Zn=!0,ft.push(_e,tr,Pe,Rt),_e+=U(Xe,dt,Pe,Rt),Pt=Lt,tr=Rt,Kt=!0,mt==0&&(pt=_e))}if(!Zn){Ie=!0;break}}}if(mn==Ve.length||j.test(Ve[mn]))Kt&&N++,jr=!0;else{if(n==2){Ie=!0;break}if(W&&L.test(Ve[mn-1]+Ve[mn]))Kt&&J++,jr=!0;else if(n==1){Ie=!0;break}}Kt&&(Ae+=Rt,Zn&&jr&&qe++)}if(tr>Rt&&(at+=tr-Rt),mt>0&&(Qe+=Xe[dt-1].length),!e.intraFilt(Lt,Pt,_e)){Ie=!0;break}mt<Q-1&&(_e+=tr+Xe[dt+1].length)}if(!Ie){ee.idx[pe]=oe[ke],ee.interLft2[pe]=Re,ee.interLft1[pe]=ze,ee.interRgt2[pe]=N,ee.interRgt1[pe]=J,ee.chars[pe]=Ae,ee.terms[pe]=qe,ee.cases[pe]=Be,ee.interIns[pe]=Qe,ee.intraIns[pe]=at,ee.start[pe]=pt;let mt=Ve.match(de),dt=mt.index+mt[1].length,Pt=ft.length,Lt=Pt>0?0:1/0,Jt=Pt-4;for(let vr=2;vr<mt.length;){let mn=mt[vr].length;if(Lt<=Jt&&ft[Lt]==dt){let Zn=ft[Lt+1],jr=ft[Lt+2],me=ft[Lt+3],Te=vr,Pe="";for(let it=0;it<Zn;Te++)Pe+=mt[Te],it+=mt[Te].length;mt.splice(vr,Te-vr,Pe),dt+=U(mt,vr,jr,me),Lt+=4}else dt+=mn,vr++}dt=mt.index+mt[1].length;let Rt=ee.ranges[pe]=[],tr=dt,Kt=dt;for(let vr=2;vr<mt.length;vr++){let mn=mt[vr].length;dt+=mn,vr%2==0?Kt=dt:mn>0&&(Rt.push(tr,Kt),tr=Kt=dt)}Kt>tr&&Rt.push(tr,Kt),pe++}}if(pe<oe.length)for(let ke in ee)ee[ke]=ee[ke].slice(0,pe);return ee},U=(oe,X,Y,ne)=>{let K=oe[X]+oe[X+1].slice(0,Y);return oe[X-1]+=K,oe[X]=oe[X+1].slice(Y,Y+ne),oe[X+1]=oe[X+1].slice(Y+ne),K.length},z=5,ie=(oe,X,Y,ne=1e3,K)=>{Y=Y?Y===!0?z:Y:0;let $=null,Z=null,de=[];X=X.replace(A,ee=>{let le=ee.trim().slice(1);return le=le[0]==='"'?cce(le.slice(1,-1)):le.replace(t9t,""),le!=""&&de.push(le),""});let Q=B(X),ae;if(de.length>0){if(ae=new RegExp(de.join("|"),"i"+C),Q.length==0){let ee=[];for(let le=0;le<oe.length;le++)ae.test(oe[le])||ee.push(le);return[ee,null,null]}}else if(Q.length==0)return[null,null,null];if(Y>0){let ee=B(X);if(ee.length>1){let le=ee.slice().sort((ke,Ve)=>Ve.length-ke.length);for(let ke=0;ke<le.length;ke++){if(K?.length==0)return[[],null,null];K=q(oe,le[ke],K)}if(ee.length>Y)return[K,null,null];$=q$e(ee).map(ke=>ke.join(" ")),Z=[];let pe=new Set;for(let ke=0;ke<$.length;ke++)if(pe.size<K.length){let Ve=K.filter(pt=>!pe.has(pt)),Xe=q(oe,$[ke],Ve);for(let pt=0;pt<Xe.length;pt++)pe.add(Xe[pt]);Z.push(Xe)}else Z.push([])}}$==null&&($=[X],Z=[K?.length>0?K:q(oe,X)]);let ye=null,we=null;if(de.length>0&&(Z=Z.map(ee=>ee.filter(le=>!ae.test(oe[le])))),Z.reduce((ee,le)=>ee+le.length,0)<=ne){ye={},we=[];for(let ee=0;ee<Z.length;ee++){let le=Z[ee];if(le==null||le.length==0)continue;let pe=$[ee],ke=V(le,oe,pe),Ve=e.sort(ke,oe,pe,b);if(ee>0)for(let Xe=0;Xe<Ve.length;Xe++)Ve[Xe]+=we.length;for(let Xe in ke)ye[Xe]=(ye[Xe]??[]).concat(ke[Xe]);we=we.concat(Ve)}}return[[].concat(...Z),ye,we]};return{search:(...oe)=>ie(...oe),split:B,filter:q,info:V,sort:e.sort}}var n9t=(()=>{let e={A:"\xC1\xC0\xC3\xC2\xC4\u0104\u0102\xC5",a:"\xE1\xE0\xE3\xE2\xE4\u0105\u0103\xE5",E:"\xC9\xC8\xCA\xCB\u0116\u011A",e:"\xE9\xE8\xEA\xEB\u0119\u011B",I:"\xCD\xCC\xCE\xCF\u012E\u0130",i:"\xED\xEC\xEE\xEF\u012F\u0131",O:"\xD3\xD2\xD4\xD5\xD6",o:"\xF3\xF2\xF4\xF5\xF6",U:"\xDA\xD9\xDB\xDC\u016A\u0172\u016E\u0170",u:"\xFA\xF9\xFB\xFC\u016B\u0173\u016F\u0171",C:"\xC7\u010C\u0106",c:"\xE7\u010D\u0107",D:"\u010E",d:"\u010F",G:"\u011E",g:"\u011F",L:"\u0141",l:"\u0142",N:"\xD1\u0143\u0147",n:"\xF1\u0144\u0148",S:"\u0160\u015A\u0218\u015E",s:"\u0161\u015B\u0219\u015F",T:"\u0162\u021A\u0164",t:"\u0163\u021B\u0165",Y:"\xDD",y:"\xFD",Z:"\u017B\u0179\u017D",z:"\u017C\u017A\u017E"},t={},r="";for(let i in e)e[i].split("").forEach(a=>{r+=a,t[a]=i});let n=new RegExp(`[${r}]`,"g"),o=i=>t[i];return i=>{if(typeof i=="string")return i.replace(n,o);let a=Array(i.length);for(let s=0;s<i.length;s++)a[s]=i[s].replace(n,o);return a}})();function q$e(e){e=e.slice();let t=e.length,r=[e.slice()],n=new Array(t).fill(0),o=1,i,a;for(;o<t;)n[o]<o?(i=o%2&&n[o],a=e[o],e[o]=e[i],e[i]=a,++n[o],o=1,r.push(e.slice())):(n[o]=0,++o);return r}var o9t=(e,t)=>t?`<mark>${e}</mark>`:e,i9t=(e,t)=>e+t;function a9t(e,t,r=o9t,n="",o=i9t){n=o(n,r(e.substring(0,t[0]),!1))??n;for(let i=0;i<t.length;i+=2){let a=t[i],s=t[i+1];n=o(n,r(e.substring(a,s),!0))??n,i<t.length-3&&(n=o(n,r(e.substring(t[i+1],t[i+2]),!1))??n)}return n=o(n,r(e.substring(t[t.length-1]),!1))??n,n}Bj.latinize=n9t;Bj.permute=e=>q$e([...Array(e.length).keys()]).sort((r,n)=>{for(let o=0;o<r.length;o++)if(r[o]!=n[o])return r[o]-n[o];return 0}).map(r=>r.map(n=>e[n]));Bj.highlight=a9t;j$e.exports=Bj});var fce=ve((w0o,g1)=>{function dce(e){"@babel/helpers - typeof";return g1.exports=dce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g1.exports.__esModule=!0,g1.exports.default=g1.exports,dce(e)}g1.exports=dce,g1.exports.__esModule=!0,g1.exports.default=g1.exports});var W$e=ve((T0o,HR)=>{var H$e=fce().default;function s9t(e,t){if(H$e(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(H$e(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}HR.exports=s9t,HR.exports.__esModule=!0,HR.exports.default=HR.exports});var mce=ve((A0o,WR)=>{var l9t=fce().default,c9t=W$e();function u9t(e){var t=c9t(e,"string");return l9t(t)=="symbol"?t:t+""}WR.exports=u9t,WR.exports.__esModule=!0,WR.exports.default=WR.exports});var K$e=ve((P0o,KR)=>{var d9t=mce();function f9t(e,t,r){return(t=d9t(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}KR.exports=f9t,KR.exports.__esModule=!0,KR.exports.default=KR.exports});var Aw=ve((I0o,YR)=>{function m9t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}YR.exports=m9t,YR.exports.__esModule=!0,YR.exports.default=YR.exports});var Pw=ve((E0o,XR)=>{var p9t=mce();function Y$e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p9t(n.key),n)}}function h9t(e,t,r){return t&&Y$e(e.prototype,t),r&&Y$e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}XR.exports=h9t,XR.exports.__esModule=!0,XR.exports.default=XR.exports});var pce=ve((D0o,ZR)=>{function g9t(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}ZR.exports=g9t,ZR.exports.__esModule=!0,ZR.exports.default=ZR.exports});var X$e=ve((k0o,$R)=>{var y9t=pce();function v9t(e){if(Array.isArray(e))return y9t(e)}$R.exports=v9t,$R.exports.__esModule=!0,$R.exports.default=$R.exports});var Z$e=ve((M0o,QR)=>{function b9t(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}QR.exports=b9t,QR.exports.__esModule=!0,QR.exports.default=QR.exports});var Q$e=ve((B0o,JR)=>{var $$e=pce();function x9t(e,t){if(e){if(typeof e=="string")return $$e(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$$e(e,t):void 0}}JR.exports=x9t,JR.exports.__esModule=!0,JR.exports.default=JR.exports});var J$e=ve((R0o,eO)=>{function S9t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
7346
|
+
`});function cWe(e){return e.namedFramebuffers[gv]||(e.namedFramebuffers[gv]=e.resources.framebuffer()),e.namedFramebuffers[gv]}function uWe(e,t,r,n,o,i){let a=`${gv}-${e}`;return t.namedTextures[a]||(t.namedTextures[a]=t.resources.texture(r,n,o,i)),t.namedTextures[a]}function Ase(e,t,r,n,o,i){return e.isWebGL2?cVt(e,t,r,n,o,i):Tq(e,t,r,n,!1,o,i)}function Tq(e,t,r,n,o,i,a){Ye&&e.timer.mark("GaussianDensityTexture2d");let s=dVt(e,t,r,n,o,i,a);return Ye&&e.timer.markEnd("GaussianDensityTexture2d"),dWe(s)}function cVt(e,t,r,n,o,i){Ye&&e.timer.mark("GaussianDensityTexture3d");let a=fVt(e,t,r,n,o,i);return Ye&&e.timer.markEnd("GaussianDensityTexture3d"),dWe(a)}function dWe({texture:e,scale:t,bbox:r,gridDim:n,gridTexDim:o,gridTexScale:i,radiusFactor:a,resolution:s,maxRadius:l}){return{transform:uVt(t,r),texture:e,bbox:r,gridDim:n,gridTexDim:o,gridTexScale:i,radiusFactor:a,resolution:s,maxRadius:l}}function uVt(e,t){let r=H.identity();return H.fromScaling(r,e),H.setTranslation(r,t.min),r}function dVt(e,t,r,n,o,i,a){let{gl:s,resources:l,state:c,extensions:{colorBufferFloat:u,textureFloat:d,colorBufferHalfFloat:f,textureHalfFloat:m,blendMinMax:p}}=e,{smoothness:h,resolution:g}=i,{drawCount:y,positions:b,radii:x,groups:C,scale:S,expandedBox:w,dim:A,maxRadius:T}=fWe(t,r,n,i),[D,E,I]=A,{texDimX:k,texDimY:R,texCols:B,powerOfTwoSize:O}=pVt(A),F=v.create(k,R,0),q=Ce.create(k/O,R/O),W=T*2,j=o?O:k,L=o?O:R,V=uWe("min-dist-2d",e,"image-uint8","rgba","ubyte","nearest");V.define(j,L);let U=mWe(e,y,b,x,C,V,w,A,F,q,h,g,W),{uCurrentSlice:z,uCurrentX:ie,uCurrentY:oe}=U.values,X=cWe(e);X.bind(),pWe(e),a||(a=f&&m?l.texture("image-float16","rgba","fp16","linear"):u&&d?l.texture("image-float32","rgba","float","linear"):l.texture("image-uint8","rgba","ubyte","linear")),a.define(j,L);function Y(ne,K){c.currentRenderItemId=-1,ne.attachFramebuffer(X,0),K&&(c.viewport(0,0,j,L),c.scissor(0,0,j,L),s.clear(s.COLOR_BUFFER_BIT)),P.update(oe,0);let $=0,Z=0,de=0;for(let Q=0;Q<I;++Q)$>=B&&($-=B,Z+=E,de=0,P.update(oe,Z)),P.update(ie,de),P.update(z,Q),c.viewport(de,Z,D,E),c.scissor(de,Z,D,E),U.render(),++$,de+=D;s.flush()}return gWe(e,U),Y(a,!0),p&&(hWe(e,U),Y(V,!0),yWe(e,U),Y(a,!1)),{texture:a,scale:S,bbox:w,gridDim:A,gridTexDim:F,gridTexScale:q,radiusFactor:W,resolution:g,maxRadius:T}}function fVt(e,t,r,n,o,i){let{gl:a,resources:s,state:l,extensions:{colorBufferFloat:c,textureFloat:u,colorBufferHalfFloat:d,textureHalfFloat:f}}=e,{smoothness:m,resolution:p}=o,{drawCount:h,positions:g,radii:y,groups:b,scale:x,expandedBox:C,dim:S,maxRadius:w}=fWe(t,r,n,o),[A,T,D]=S,E=uWe("min-dist-3d",e,"volume-uint8","rgba","ubyte","nearest");E.define(A,T,D);let I=Ce.create(1,1),k=w*2,R=mWe(e,h,g,y,b,E,C,S,S,I,m,p,k),{uCurrentSlice:B}=R.values,O=cWe(e);O.bind(),pWe(e),l.viewport(0,0,A,T),l.scissor(0,0,A,T),i||(i=d&&f?s.texture("volume-float16","rgba","fp16","linear"):c&&u?s.texture("volume-float32","rgba","float","linear"):s.texture("volume-uint8","rgba","ubyte","linear")),i.define(A,T,D);function F(q,W){l.currentRenderItemId=-1;for(let j=0;j<D;++j)P.update(B,j),q.attachFramebuffer(O,0,j),W&&a.clear(a.COLOR_BUFFER_BIT),R.render();a.flush()}return gWe(e,R),F(i,!0),hWe(e,R),F(E,!0),yWe(e,R),F(i,!1),{texture:i,scale:x,bbox:C,gridDim:S,gridTexDim:S,gridTexScale:I,radiusFactor:k,resolution:p,maxRadius:w}}function fWe(e,t,r,n){let{resolution:o,radiusOffset:i}=n,a=1/o,{indices:s,x:l,y:c,z:u,id:d}=e,f=Se.size(s),m=new Float32Array(f*3),p=new Float32Array(f),h=new Float32Array(f),g=0;for(let w=0;w<f;++w){let A=Se.getAt(s,w);m[w*3]=l[A],m[w*3+1]=c[A],m[w*3+2]=u[A];let T=r(A)+i;g<T&&(g=T),p[w]=T,h[w]=d?d[w]:w}let y=g*2+o*4,b=Ct.expand(Ct(),t,v.create(y,y,y)),x=Ct.scale(Ct(),b,a),C=Ct.size(v(),x);v.ceil(C,C);let S=v.create(o,o,o);return{drawCount:f,positions:m,radii:p,groups:h,scale:S,expandedBox:b,dim:C,maxRadius:g}}function mWe(e,t,r,n,o,i,a,s,l,c,u,d,f){if(e.namedComputeRenderables[gv]){let m=v.sub(v(),a.max,a.min),p=e.namedComputeRenderables[gv].values;P.updateIfChanged(p.drawCount,t),P.updateIfChanged(p.instanceCount,1),P.update(p.aRadius,n),P.update(p.aPosition,r),P.update(p.aGroup,o),P.updateIfChanged(p.uCurrentSlice,0),P.updateIfChanged(p.uCurrentX,0),P.updateIfChanged(p.uCurrentY,0),P.update(p.uBboxMin,a.min),P.update(p.uBboxSize,m),P.update(p.uGridDim,s),P.update(p.uGridTexDim,l),P.update(p.uGridTexScale,c),P.updateIfChanged(p.uAlpha,u),P.updateIfChanged(p.uResolution,d),P.updateIfChanged(p.uRadiusFactorInv,1/f),P.update(p.tMinDistanceTex,i),P.updateIfChanged(p.dGridTexType,i.getDepth()>0?"3d":"2d"),P.updateIfChanged(p.dCalcType,"density"),e.namedComputeRenderables[gv].update()}else e.namedComputeRenderables[gv]=mVt(e,t,r,n,o,i,a,s,l,c,u,d,f);return e.namedComputeRenderables[gv]}function mVt(e,t,r,n,o,i,a,s,l,c,u,d,f){let m=v.sub(v(),a.max,a.min),p={drawCount:P.create(t),instanceCount:P.create(1),aRadius:P.create(n),aPosition:P.create(r),aGroup:P.create(o),uCurrentSlice:P.create(0),uCurrentX:P.create(0),uCurrentY:P.create(0),uBboxMin:P.create(a.min),uBboxSize:P.create(m),uGridDim:P.create(s),uGridTexDim:P.create(l),uGridTexScale:P.create(c),uAlpha:P.create(u),uResolution:P.create(d),uRadiusFactorInv:P.create(1/f),tMinDistanceTex:P.create(i),dGridTexType:P.create(i.getDepth()>0?"3d":"2d"),dCalcType:P.create("density")},h={...lVt},g=Yr(gv,iWe,sWe),y=bn(e,"points",g,h,p);return xn(y,p)}function pWe(e){let{gl:t,state:r}=e;r.disable(t.CULL_FACE),r.enable(t.BLEND),r.disable(t.DEPTH_TEST),r.enable(t.SCISSOR_TEST),r.depthMask(!1),r.clearColor(0,0,0,0)}function hWe(e,t){let{gl:r,state:n}=e;if(P.update(t.values.dCalcType,"minDistance"),t.update(),n.colorMask(!1,!1,!1,!0),n.blendFunc(r.ONE,r.ONE),!e.extensions.blendMinMax)throw new Error("GPU gaussian surface calculation requires EXT_blend_minmax");n.blendEquation(e.extensions.blendMinMax.MAX)}function gWe(e,t){let{gl:r,state:n}=e;P.update(t.values.dCalcType,"density"),t.update(),n.colorMask(!1,!1,!1,!0),n.blendFunc(r.ONE,r.ONE),n.blendEquation(r.FUNC_ADD)}function yWe(e,t){let{gl:r,state:n}=e;P.update(t.values.dCalcType,"groupId"),t.update(),n.colorMask(!0,!0,!0,!1),n.blendFunc(r.ONE,r.ZERO),n.blendEquation(r.FUNC_ADD)}function pVt(e){let t=e[0]*e[1]*e[2],r=Math.sqrt(t),n=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))),o=0,i=e[1],a=1,s=e[2];return n<e[0]*e[2]?(s=Math.floor(n/e[0]),a=Math.ceil(e[2]/s),o=s*e[0],i*=a):o=e[0]*e[2],{texDimX:o,texDimY:i,texRows:a,texCols:s,powerOfTwoSize:i<n?n:n*2}}var lVt,gv,vWe=M(()=>{or();Ut();Ge();Vt();Ti();gy();hi();wi();vi();aWe();lWe();Fn();lVt={drawCount:go("number"),instanceCount:go("number"),aRadius:eo("float32",1,0),aPosition:eo("float32",3,0),aGroup:eo("float32",1,0),uCurrentSlice:he("f"),uCurrentX:he("f"),uCurrentY:he("f"),uBboxMin:he("v3","material"),uBboxSize:he("v3","material"),uGridDim:he("v3","material"),uGridTexDim:he("v3","material"),uGridTexScale:he("v2","material"),uAlpha:he("f","material"),uResolution:he("f","material"),uRadiusFactorInv:he("f","material"),tMinDistanceTex:wt("texture","rgba","float","nearest","material"),dGridTexType:vt("string",["2d","3d"]),dCalcType:vt("string",["density","minDistance","groupId"])},gv="gaussian-density"});async function Pse(e,t,r,n,o){let{resolution:i,radiusOffset:a,smoothness:s}=o,l=1/i,{indices:c,x:u,y:d,z:f,id:m}=t,p=Se.size(c),h=new Float32Array(p),g=0;for(let X=0;X<p;++X){let Y=n(Se.getAt(c,X))+a;g<Y&&(g=Y),h[X]=Y}let y=g*2+i,b=Ct.expand(Ct(),r,v.create(y,y,y)),x=b.min,C=Ct.scale(Ct(),b,l),S=Ct.size(v(),C);v.ceil(S,S);let w=Rr.Space(S,[0,1,2],Float32Array),A=w.create(),T=Rr.create(w,A),D=w.create();D.fill(-1);let E=Rr.create(w,D),[I,k,R]=S,B=R,O=k,F=B*O,q=Z1(S[0],x[0],i),W=Z1(S[1],x[1],i),j=Z1(S[2],x[2],i),L=w.create(),V=s,U=Math.ceil(1e5/(Math.pow(Math.pow(g,3),3)*l));function z(X,Y){for(let ne=X;ne<Y;++ne){let K=Se.getAt(c,ne),$=u[K],Z=d[K],de=f[K],Q=h[ne],ye=1/(Q*Q),we=Q*2,re=we*we,ee=Math.ceil(we*l),le=Math.floor(l*($-x[0])),pe=Math.floor(l*(Z-x[1])),ke=Math.floor(l*(de-x[2])),Ve=Math.max(0,le-ee),Xe=Math.max(0,pe-ee),pt=Math.max(0,ke-ee),_e=Math.min(I,le+ee+2),Ie=Math.min(k,pe+ee+2),Re=Math.min(R,ke+ee+2);for(let ze=Ve;ze<_e;++ze){let N=q[ze]-$,J=ze*F;for(let Ae=Xe;Ae<Ie;++Ae){let qe=W[Ae]-Z,Be=N*N+qe*qe,Qe=Ae*B+J;for(let at=pt;at<Re;++at){let ft=j[at]-de,mt=Be+ft*ft;if(mt<=re){let dt=iUe(-V*(mt*ye)),Pt=at+Qe;A[Pt]+=dt,dt>L[Pt]&&(L[Pt]=dt,D[Pt]=m?m[ne]:ne)}}}}}}async function ie(){for(let X=0;X<p;X+=U)z(X,Math.min(X+U,p)),e.shouldUpdate&&await e.update({message:"filling density grid",current:X,max:p})}await ie();let oe=H.identity();return H.fromScaling(oe,v.create(i,i,i)),H.setTranslation(oe,b.min),{field:T,idField:E,transform:oe,radiusFactor:1,resolution:i,maxRadius:g}}var bWe=M(()=>{or();Ge();Ut();Fre()});function xWe(e,t){let r=e.maxTextureSize/3;return r*r/Math.max(1,t?t.units.length/16:1)}function Aq(e,t,r,n){let{position:o,boundary:i,radius:a}=EP(e,t,r,n),s=Fy(i.box,n);return Me.create("Gaussian Density",async l=>await Pse(l,o,i.box,a,s))}function SWe(e,t,r,n,o,i){let{position:a,boundary:s,radius:l}=EP(e,t,r,n),c=Fy(s.box,n,xWe(o,e));return Ase(o,a,s.box,l,c,i)}function _We(e,t,r,n,o,i,a){let{position:s,boundary:l,radius:c}=EP(e,t,r,o),u=Fy(l.box,o,xWe(i,e));return Tq(i,s,l.box,c,n,u,a)}function CWe(e,t,r){let{position:n,boundary:o,radius:i}=DP(e,t,r),a=Fy(o.box,r);return Me.create("Gaussian Density",async s=>await Pse(s,n,o.box,i,a))}function wWe(e,t,r,n,o){let{position:i,boundary:a,radius:s}=DP(e,t,r),l=Fy(a.box,r);return Ase(n,i,a.box,s,l,o)}function TWe(e,t,r,n,o,i){let{box:a}=e.lookup3d.boundary,{position:s,boundary:l,radius:c}=DP(e,t,n),u=Fy(l.box,n);return Tq(o,s,a,c,r,u,i)}var a_,Qio,Pq=M(()=>{hr();Ue();vWe();Ps();Gn();bWe();a_={resolution:_.Numeric(1,{min:.1,max:20,step:.1},{description:"Grid resolution/cell spacing.",...$e.CustomQualityParamInfo}),radiusOffset:_.Numeric(0,{min:0,max:10,step:.1},{description:"Extra/offset radius added to the atoms/coarse elements for gaussian calculation. Useful to create coarse, low resolution surfaces."}),smoothness:_.Numeric(1.5,{min:.5,max:2.5,step:.1},{description:"Smoothness of the gausian surface, lower is smoother."}),...LC},Qio=_.getDefaultValues(a_)});function IWe(e){return e.extensions.colorBufferFloat&&e.extensions.textureFloat&&e.extensions.textureFloatLinear&&e.extensions.blendMinMax&&e.extensions.drawBuffers}function E3(e,t,r){if(t.resolution>1)return!1;let n=r.maxTextureSize/3,{areaCells:o,maxAreaCells:i}=Vte(e.boundary.box,t.resolution,n*n);return o<i}function EWe(e,t,r,n){return r.tryUseGpu&&n&&IWe(n)&&E3(t,r,n)?xVt(e):gVt(e)}function DWe(e,t,r,n){return r.tryUseGpu&&n&&IWe(n)&&E3(t,r,n)?_Vt(e):vVt(e)}async function hVt(e,t,r,n,o,i){let{smoothness:a}=o,{transform:s,field:l,idField:c,radiusFactor:u,resolution:d,maxRadius:f}=await Aq(r,t,n.size,o).runInContext(e.runtime),m={isoLevel:Math.exp(-a)/u,scalarField:l,idField:c},p=await rv(m,i).runAsChild(e.runtime);p.meta.resolution=d,xt.transform(p,s),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(p),P.updateIfChanged(p.varyingGroup,!1)):P.updateIfChanged(p.varyingGroup,!0);let h=be.expand(be(),t.boundary.sphere,f);return p.setBoundingSphere(h),p}function gVt(e){return ii({defaultProps:_.getDefaultValues(Iq),createGeometry:hVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&E3(t.structure,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}async function yVt(e,t,r,n,o){let{smoothness:i}=n,{transform:a,field:s,idField:l,radiusFactor:c,resolution:u,maxRadius:d}=await CWe(t,r.size,n).runInContext(e.runtime),f={isoLevel:Math.exp(-i)/c,scalarField:s,idField:l},m=await rv(f,o).runAsChild(e.runtime);m.meta.resolution=u,xt.transform(m,a),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(m),P.updateIfChanged(m.varyingGroup,!1)):P.updateIfChanged(m.varyingGroup,!0);let p=be.expand(be(),t.boundary.sphere,d);return m.setBoundingSphere(p),m}function vVt(e){return Sl({defaultProps:_.getDefaultValues(PWe),createGeometry:yVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>r.tryUseGpu&&!!n&&E3(t,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function bVt(e,t,r,n,o,i){let{webgl:a}=e;if(!a)throw new Error("webgl context required to create gaussian surface texture-mesh");let{namedTextures:s,resources:l,extensions:{colorBufferFloat:c,textureFloat:u,colorBufferHalfFloat:d,textureHalfFloat:f}}=a;s[I3]||(s[I3]=d&&f?l.texture("image-float16","rgba","fp16","linear"):c&&u?l.texture("image-float32","rgba","float","linear"):l.texture("image-uint8","rgba","ubyte","linear"));let m=v.create(0,1,2),p=t.elements.length,h=y=>{Ye&&a.timer.mark("createGaussianSurfaceTextureMesh");let b=_We(r,t,n.size,!0,o,a,s[I3]),x=Math.exp(-o.smoothness)/b.radiusFactor,C=y?.doubleBuffer.get(),S=QC(a,b.texture,b.gridDim,b.gridTexDim,b.gridTexScale,b.transform,x,!1,!0,m,!0,C?.vertex,C?.group,C?.normal);Ye&&a.timer.markEnd("createGaussianSurfaceTextureMesh");let w=be.expand(be(),t.boundary.sphere,b.maxRadius),A=Hs.create(S.vertexCount,p,S.vertexTexture,S.groupTexture,S.normalTexture,w,y);return A.meta.resolution=b.resolution,A},g=h(i);return g.meta.webgl=a,g.meta.reset=()=>{h(g)},g}function xVt(e){return NFe({defaultProps:_.getDefaultValues(Iq),createGeometry:bVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!E3(t.structure,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&i&&(cte(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy(),(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}function SVt(e,t,r,n,o){let{webgl:i}=e;if(!i)throw new Error("webgl context required to create structure gaussian surface texture-mesh");let{namedTextures:a,resources:s,extensions:{colorBufferFloat:l,textureFloat:c,colorBufferHalfFloat:u,textureHalfFloat:d}}=i;a[I3]||(a[I3]=u&&d?s.texture("image-float16","rgba","fp16","linear"):l&&c?s.texture("image-float32","rgba","float","linear"):s.texture("image-uint8","rgba","ubyte","linear"));let f=v.create(0,1,2),m=t.elementCount,p=g=>{Ye&&i.timer.mark("createStructureGaussianSurfaceTextureMesh");let y=TWe(t,r.size,!0,n,i,a[I3]),b=Math.exp(-n.smoothness)/y.radiusFactor,x=g?.doubleBuffer.get(),C=QC(i,y.texture,y.gridDim,y.gridTexDim,y.gridTexScale,y.transform,b,!1,!0,f,!0,x?.vertex,x?.group,x?.normal);Ye&&i.timer.markEnd("createStructureGaussianSurfaceTextureMesh");let S=be.expand(be(),t.boundary.sphere,y.maxRadius),w=Hs.create(C.vertexCount,m,C.vertexTexture,C.groupTexture,C.normalTexture,S,g);return w.meta.resolution=y.resolution,w},h=p(o);return h.meta.webgl=i,h.meta.reset=()=>{p(h)},h}function _Vt(e){return DFe({defaultProps:_.getDefaultValues(PWe),createGeometry:SVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},mustRecreate:(t,r,n)=>!r.tryUseGpu||!n||!E3(t,r,n),processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&i&&(cte(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;t.vertexTexture.ref.value.destroy(),t.groupTexture.ref.value.destroy(),t.normalTexture.ref.value.destroy(),t.doubleBuffer.destroy(),(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}var AWe,Iq,PWe,I3,kWe=M(()=>{Ue();ka();Pq();uo();$C();yp();Jx();Dz();or();cc();Ps();MM();ute();Gn();Ge();Fn();rd();AWe={...a_,...RN,ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),tryUseGpu:_.Boolean(!0),includeParent:_.Boolean(!1,{isHidden:!0})},Iq={...Uo,...FFe,...AWe},PWe={...Ed,...EFe,...AWe};I3="gaussian-surface"});async function CVt(e,t,r,n,o,i){let{smoothness:a}=o,{transform:s,field:l,idField:c,maxRadius:u}=await Aq(r,t,n.size,o).runInContext(e.runtime),d={isoLevel:Math.exp(-a),scalarField:l,idField:c},f=await DI(d,i).runAsChild(e.runtime);Hn.transform(f,s);let m=be.expand(be(),t.boundary.sphere,u);return f.setBoundingSphere(m),f}function MWe(e){return bS({defaultProps:_.getDefaultValues(Ise),createGeometry:CVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)}},e)}var Ise,BWe=M(()=>{Ue();Td();Pq();$C();ka();yp();or();Ise={...vS,...a_,sizeFactor:_.Numeric(3,{min:0,max:10,step:.1}),lineSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),includeParent:_.Boolean(!1,{isHidden:!0})}});function wVt(e,t){return OWe}function TVt(e,t){return Zt.createMulti("Gaussian Surface",e,t,No,RWe)}var RWe,OWe,LWe,FWe=M(()=>{kWe();fh();BWe();Ue();sc();Eo();Gn();RWe={"gaussian-surface-mesh":(e,t)=>bo("Gaussian surface mesh",e,t,EWe),"structure-gaussian-surface-mesh":(e,t)=>oi("Structure-Gaussian surface mesh",e,t,DWe),"gaussian-surface-wireframe":(e,t)=>bo("Gaussian surface wireframe",e,t,MWe)},OWe={...Iq,...Ise,visuals:_.MultiSelect(["gaussian-surface-mesh"],_.objectToOptions(RWe)),bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.5,{min:0,max:1,step:.01},$e.ShadingCategory)};LWe={name:"gaussian-surface",label:"Gaussian Surface",description:"Displays a gaussian molecular surface.",factory:TVt,getParams:wVt,defaultValues:_.getDefaultValues(OWe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function NWe(e){return AFe({defaultProps:_.getDefaultValues(Ese),createGeometry:AVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{t.createGeometry=r.level!==n.level||r.level==="chain"&&r.chainScale!==n.chainScale||r.level==="residue"&&r.residueScale!==n.residueScale||r.level==="element"&&r.elementScale!==n.elementScale||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant}},e)}function AVt(e,t,r,n,o){switch(n.level){case"chain":return PVt(e,t,r,n,o);case"residue":return IVt(e,t,r,n,o);case"element":return EVt(e,t,r,n,o)}}function PVt(e,t,r,n,o){let i=te.Location.create(t),{units:a,serialMapping:s}=t,{auth_asym_id:l,label_asym_id:c}=nt.chain,{cumulativeUnitElementCount:u}=s,d=a.length,{chainScale:f}=n,m=Ad.create(n,d,d/2,o);for(let p=0,h=a.length;p<h;++p){let g=a[p];i.unit=g,i.element=g.elements[0];let{center:y,radius:b}=g.lookup3d.boundary.sphere;v.transformMat4(jh,y,g.conformation.operator.matrix);let x=l(i),C=c(i),S=x===C?C:`${C} [${x}]`;m.add(S,jh[0],jh[1],jh[2],b,f,u[p])}return m.getText()}function IVt(e,t,r,n,o){let i=te.Location.create(t),{units:a,serialMapping:s}=t,{label_comp_id:l}=nt.atom,{auth_seq_id:c}=nt.residue,{cumulativeUnitElementCount:u}=s,d=t.polymerResidueCount*2,{residueScale:f}=n,m=Ad.create(n,d,d/2,o);for(let p=0,h=a.length;p<h;++p){let g=a[p],y=g.conformation,{elements:b}=g;i.unit=g,i.element=g.elements[0];let x=g.model.atomicHierarchy.residueAtomSegments.index,C=u[p],S=0,w=b.length;for(;S<w;){let A=S,T=x[b[S]];for(S++;S<w&&x[b[S]]===T;)S++;pR.reset();for(let B=A;B<S;B++)y.position(b[B],jh),pR.includePosition(jh);pR.finishedIncludeStep();for(let B=A;B<S;B++)y.position(b[B],jh),pR.radiusPosition(jh);i.element=b[A];let{center:D,radius:E}=pR.getSphere(),I=c(i),R=`${l(i)} ${I}`;m.add(R,D[0],D[1],D[2],E,f,C+A)}}return m.getText()}function EVt(e,t,r,n,o){let i=te.Location.create(t),{units:a,serialMapping:s}=t,{label_atom_id:l,label_alt_id:c}=nt.atom,{cumulativeUnitElementCount:u}=s,d=r.size,f=t.elementCount,{elementScale:m}=n,p=Ad.create(n,f,f/2,o);for(let h=0,g=a.length;h<g;++h){let y=a[h],b=y.conformation,{elements:x}=y;i.unit=y;let C=u[h],S=If(t,y,{...n,traceOnly:!1});for(let w=0,A=x.length;w<A;w++){if(S&&S(x[w]))continue;i.element=x[w],b.position(i.element,jh);let T=l(i),D=c(i),E=D?`${T}%${D}`:T;p.add(E,jh[0],jh[1],jh[2],d.size(i),m,C+w)}}return p.getText()}var Ese,jh,pR,UWe=M(()=>{Ue();gt();IC();cc();yp();ya();Ge();Bp();yp();Ese={...TFe,background:_.Boolean(!1),backgroundMargin:_.Numeric(0,{min:0,max:1,step:.01}),backgroundColor:_.Color(mr.black),backgroundOpacity:_.Numeric(.5,{min:0,max:1,step:.01}),borderWidth:_.Numeric(.25,{min:0,max:.5,step:.01}),level:_.Select("residue",[["chain","Chain"],["residue","Residue"],["element","Element"]],{isEssential:!0}),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),chainScale:_.Numeric(10,{min:0,max:20,step:.1}),residueScale:_.Numeric(1,{min:0,max:20,step:.1}),elementScale:_.Numeric(.5,{min:0,max:20,step:.1})};jh=v(),pR=new Va("98")});function DVt(e,t){return zWe}function kVt(e,t){let r=Zt.createMulti("Label",e,t,No,VWe);return r.setState({pickable:!1,markerActions:ar.None}),r}var VWe,zWe,qWe,jWe=M(()=>{Ue();sc();Eo();UWe();bl();VWe={"label-text":(e,t)=>oi("Label text",e,t,NWe)},zWe={...Ese,visuals:_.MultiSelect(["label-text"],_.objectToOptions(VWe))};qWe={name:"label",label:"Label",description:"Displays labels.",factory:kVt,getParams:DVt,defaultValues:_.getDefaultValues(zWe),defaultColorTheme:{name:"uniform"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function MVt(e,t){return e[0]=e[1]=e[2]=1,t[0]!==0?e[0]=(t[1]+t[2])/-t[0]:t[1]!==0?e[1]=(t[0]+t[2])/-t[1]:t[2]!==0&&(e[2]=(t[0]+t[1])/-t[2]),e}function BVt(e){let t=0,r=2*Math.PI/e,n=new Float32Array(e),o=new Float32Array(e);for(let i=0;i<e;i++)n[i]=Math.cos(t),o[i]=Math.sin(t),t+=r;return{cosTable:n,sinTable:o}}async function GWe(e,t,r,n,o,i){let a=-1;function s(Ve,Xe,pt,_e,Ie){if(a!==-1){let Re=a;if(Re!==_e&&Re!==Ie&&l(Re,Ve,Xe,pt))return Re;a=-1}for(let Re=0,ze=D.count;Re<ze;++Re){let N=Se.getAt(E,D.indices[Re]);if(N!==_e&&N!==Ie&&l(N,Ve,Xe,pt))return a=N,N}return-1}function l(Ve,Xe,pt,_e){let Ie=O[Ve],Re=I[Ve]-Xe,ze=k[Ve]-pt,N=R[Ve]-_e;return Re*Re+ze*ze+N*N<Ie*Ie}function c(Ve,Xe){for(let pt=Ve;pt<Xe;++pt){let _e=Se.getAt(E,pt),Ie=I[_e],Re=k[_e],ze=R[_e],N=O[_e],J=N*N;T.find(Ie,Re,ze,N);let Ae=Math.ceil(N*S),qe=Math.floor(S*(Ie-j)),Be=Math.floor(S*(Re-L)),Qe=Math.floor(S*(ze-V)),at=Math.max(0,qe-Ae),ft=Math.max(0,Be-Ae),mt=Math.max(0,Qe-Ae),dt=Math.min(ie,qe+Ae+2),Pt=Math.min(oe,Be+Ae+2),Lt=Math.min(X,Qe+Ae+2);for(let Jt=at;Jt<dt;++Jt){let Rt=ye[Jt]-Ie,tr=Jt*K;for(let Kt=ft;Kt<Pt;++Kt){let vr=we[Kt]-Re,mn=Rt*Rt+vr*vr,Zn=Kt*Y+tr;for(let jr=mt;jr<Lt;++jr){let me=re[jr]-ze,Te=mn+me*me;if(Te<J){let Pe=jr+Zn;Q[Pe]<0&&(Q[Pe]*=-1);let it=Math.sqrt(Te),Mt=N/it,Et=Rt*Mt+Ie,Nr=vr*Mt+Re,pn=me*Mt+ze;if(s(Et,Nr,pn,_e,-1)===-1){let _n=N-it;_n<Q[Pe]&&(Q[Pe]=_n,ae[Pe]=B[pt])}}}}}}}async function u(){for(let Ve=0;Ve<F;Ve+=ee)c(Ve,Math.min(Ve+ee,F)),e.shouldUpdate&&await e.update({message:"projecting points",current:Ve,max:F})}let d=v(),f=v(),m=v(),p=v();function h(Ve,Xe){let pt=O[Ve],_e=O[Xe],Ie=d[0]=I[Xe]-I[Ve],Re=d[1]=k[Xe]-k[Ve],ze=d[2]=R[Xe]-R[Ve],N=Ie*Ie+Re*Re+ze*ze,J=Math.sqrt(N),Ae=(pt*pt+J*J-_e*_e)/(2*pt*J),qe=pt*Ae;v.normalize(d,d),MVt(m,d),v.normalize(m,m),v.cross(p,d,m),v.normalize(p,p);let Be=Math.sqrt(pt*pt-qe*qe);v.scale(m,m,Be),v.scale(p,p,Be),v.scale(d,d,qe),f[0]=d[0]+I[Ve],f[1]=d[1]+k[Ve],f[2]=d[2]+R[Ve],a=-1;for(let Qe=0;Qe<C;++Qe){let at=$[Qe],ft=Z[Qe],mt=f[0]+at*m[0]+ft*p[0],dt=f[1]+at*m[1]+ft*p[1],Pt=f[2]+at*m[2]+ft*p[2];if(s(mt,dt,Pt,Ve,Xe)===-1){let Lt=Math.floor(S*(mt-j)),Jt=Math.floor(S*(dt-L)),Rt=Math.floor(S*(Pt-V)),tr=Math.max(0,Lt-w),Kt=Math.max(0,Jt-w),vr=Math.max(0,Rt-w),mn=Math.min(ie,Lt+w+2),Zn=Math.min(oe,Jt+w+2),jr=Math.min(X,Rt+w+2);for(let me=tr;me<mn;++me){let Te=mt-ye[me],Pe=me*K;for(let it=Kt;it<Zn;++it){let Mt=dt-we[it],Et=Te*Te+Mt*Mt,Nr=it*Y+Pe;for(let pn=vr;pn<jr;++pn){let _n=Pt-re[pn],ao=Et+_n*_n,qn=pn+Nr,ps=Q[qn];if(ps>0&&ao<ps*ps){Q[qn]=Math.sqrt(ao);let Eu=Te*d[0]+Mt*d[1]+_n*d[2];ae[qn]=B[Se.indexOf(E,Eu<0?Xe:Ve)]}}}}}}}function g(Ve,Xe){for(let pt=Ve;pt<Xe;++pt){let _e=Se.getAt(E,pt);T.find(I[_e],k[_e],R[_e],O[_e]);for(let Ie=0,Re=D.count;Ie<Re;++Ie){let ze=Se.getAt(E,D.indices[Ie]);_e<ze&&h(_e,ze)}}}async function y(){for(let Ve=0;Ve<F;Ve+=ee)g(Ve,Math.min(Ve+ee,F)),e.shouldUpdate&&await e.update({message:"projecting torii",current:Ve,max:F})}let{resolution:b,probeRadius:x,probePositions:C}=i,S=1/b,w=Math.max(5,2+Math.floor(x*S)),A=v.create(n,n,n);v.scale(A,A,2);let T=Kd(t,r,A),D=T.result;o===null&&(o=T.boundary.box);let{indices:E,x:I,y:k,z:R,id:B,radius:O}=t,F=Se.size(E),q=n+b,W=Ct.expand(Ct(),o,v.create(q,q,q)),[j,L,V]=W.min,U=Ct.scale(Ct(),W,S),z=Ct.size(v(),U);v.ceil(z,z);let[ie,oe,X]=z,Y=X,ne=oe,K=Y*ne,{cosTable:$,sinTable:Z}=BVt(C),de=Rr.Space(z,[0,1,2],Float32Array),Q=de.create(),ae=de.create();Q.fill(-1001),ae.fill(-1);let ye=Z1(ie,j,b),we=Z1(oe,L,b),re=Z1(X,V,b),ee=Math.ceil(1e5/(Math.pow(Math.pow(n,3),3)*S));await u(),await y();let le=Rr.create(de,Q),pe=Rr.create(de,ae),ke=H.identity();return H.fromScaling(ke,v.create(b,b,b)),H.setTranslation(ke,W.min),{field:le,idField:pe,transform:ke,resolution:b,maxRadius:n}}var hR,rso,Eq=M(()=>{Ge();Ue();Ut();Of();or();Gn();hR={probeRadius:_.Numeric(1.4,{min:0,max:10,step:.1},{description:"Radius of the probe tracing the molecular surface."}),resolution:_.Numeric(.5,{min:.01,max:20,step:.01},{description:"Grid resolution/cell spacing.",...$e.CustomQualityParamInfo}),probePositions:_.Numeric(36,{min:12,max:90,step:1},{description:"Number of positions tested for probe target intersection.",...$e.CustomQualityParamInfo})},rso=_.getDefaultValues(hR)});function RVt(e,t,r,n){let{probeRadius:o}=n,{position:i,boundary:a,radius:s}=EP(e,t,r,n),{indices:l}=i,c=Se.size(l),u=new Float32Array(Se.end(l)),d=0;for(let f=0;f<c;++f){let m=Se.getAt(l,f),p=s(m);d<p&&(d=p),u[m]=p+o}return{position:{...i,radius:u},boundary:a,maxRadius:d}}function Dq(e,t,r,n){let{position:o,boundary:i,maxRadius:a}=RVt(e,t,r,n),s=Fy(i.box,n);return Me.create("Molecular Surface",async l=>await WWe(l,o,i,a,i.box,s))}function OVt(e,t,r){let{probeRadius:n}=r,{position:o,boundary:i,radius:a}=DP(e,t,r),{indices:s}=o,l=Se.size(s),c=new Float32Array(Se.end(s)),u=0;for(let d=0;d<l;++d){let f=Se.getAt(s,d),m=a(f);u<m&&(u=m),c[f]=m+n}return{position:{...o,radius:c},boundary:i,maxRadius:u}}function HWe(e,t,r){let{position:n,boundary:o,maxRadius:i}=OVt(e,t,r),a=Fy(o.box,r);return Me.create("Molecular Surface",async s=>await WWe(s,n,o,i,o.box,a))}async function WWe(e,t,r,n,o,i){return GWe(e,t,r,n,o,i)}var Dse=M(()=>{hr();Ps();Eq();Ut()});async function LVt(e,t,r,n,o,i){let{transform:a,field:s,idField:l,resolution:c,maxRadius:u}=await Dq(r,t,n.size,o).runInContext(e.runtime),d={isoLevel:o.probeRadius,scalarField:s,idField:l},f=await rv(d,i).runAsChild(e.runtime);if(o.includeParent){let p=Math.ceil(2/o.resolution);xt.smoothEdges(f,{iterations:p,maxNewEdgeLength:Math.sqrt(2)})}xt.transform(f,a),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(f),P.updateIfChanged(f.varyingGroup,!1)):P.updateIfChanged(f.varyingGroup,!0);let m=be.expand(be(),t.boundary.sphere,u);return f.setBoundingSphere(m),f.meta.resolution=c,f}function KWe(e){return ii({defaultProps:_.getDefaultValues(kq),createGeometry:LVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}async function FVt(e,t,r,n,o){let{transform:i,field:a,idField:s,resolution:l,maxRadius:c}=await HWe(t,r.size,n).runInContext(e.runtime),u={isoLevel:n.probeRadius,scalarField:a,idField:s},d=await rv(u,o).runAsChild(e.runtime);if(n.includeParent){let m=Math.ceil(2/n.resolution);xt.smoothEdges(d,{iterations:m,maxNewEdgeLength:Math.sqrt(2)})}xt.transform(d,i),e.webgl&&!e.webgl.isWebGL2?(xt.uniformTriangleGroup(d),P.updateIfChanged(d.varyingGroup,!1)):P.updateIfChanged(d.varyingGroup,!0);let f=be.expand(be(),t.boundary.sphere,c);return d.setBoundingSphere(f),d.meta.resolution=l,d}function YWe(e){return Sl({defaultProps:_.getDefaultValues(kq),createGeometry:FVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0),r.smoothColors.name!==n.smoothColors.name?t.updateColor=!0:r.smoothColors.name==="on"&&n.smoothColors.name==="on"&&(r.smoothColors.params.resolutionFactor!==n.smoothColors.params.resolutionFactor&&(t.updateColor=!0),r.smoothColors.params.sampleStride!==n.smoothColors.params.sampleStride&&(t.updateColor=!0))},processValues:(t,r,n,o,i)=>{let{resolution:a,colorTexture:s}=r.meta,l=qu(n.smoothColors,o.color.preferSmoothing,a);l&&(fP(t,l.resolution,l.stride,i,s),r.meta.colorTexture=t.tColorGrid.ref.value)},dispose:t=>{var r;(r=t.meta.colorTexture)===null||r===void 0||r.destroy()}},e)}var kq,XWe=M(()=>{Ue();ka();Eq();uo();Dse();$C();yp();Ps();or();MM();Gn();Vt();cc();kq={...Uo,...hR,...LC,...RN}});async function NVt(e,t,r,n,o,i){let{transform:a,field:s,idField:l,maxRadius:c}=await Dq(r,t,n.size,o).runInContext(e.runtime),u={isoLevel:o.probeRadius,scalarField:s,idField:l},d=await DI(u,i).runAsChild(e.runtime);Hn.transform(d,a);let f=be.expand(be(),t.boundary.sphere,c);return d.setBoundingSphere(f),d}function ZWe(e){return bS({defaultProps:_.getDefaultValues(kse),createGeometry:NVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.probeRadius!==n.probeRadius&&(t.createGeometry=!0),r.probePositions!==n.probePositions&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)}},e)}var kse,$We=M(()=>{Ue();ka();Eq();Td();Dse();$C();yp();Ps();or();kse={...vS,...hR,...LC,sizeFactor:_.Numeric(1.5,{min:0,max:10,step:.1})}});function UVt(e,t){return JWe}function VVt(e,t){return Zt.createMulti("Molecular Surface",e,t,No,QWe)}var QWe,JWe,eKe,tKe=M(()=>{XWe();fh();Ue();sc();Eo();$We();Gn();QWe={"molecular-surface-mesh":(e,t)=>bo("Molecular surface mesh",e,t,KWe),"structure-molecular-surface-mesh":(e,t)=>oi("Structure Molecular surface mesh",e,t,YWe),"molecular-surface-wireframe":(e,t)=>bo("Molecular surface wireframe",e,t,ZWe)},JWe={...kq,...kse,visuals:_.MultiSelect(["molecular-surface-mesh"],_.objectToOptions(QWe)),bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.5,{min:0,max:1,step:.01},$e.ShadingCategory)};eKe={name:"molecular-surface",label:"Molecular Surface",description:"Displays a molecular surface.",factory:VVt,getParams:UVt,defaultValues:_.getDefaultValues(JWe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function rKe(e){return ii({defaultProps:_.getDefaultValues(Mse),createGeometry:qVt,createLocationIterator:jVt,getLoci:GVt,eachLocation:HVt,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail}},e)}function zVt(e){if(fe.Traits.is(e.traits,fe.Trait.MultiChain)||fe.Traits.is(e.traits,fe.Trait.Partitioned))return!1;if(fe.isCoarse(e))return!0;if(e.elements.length===0)return!1;e.model.atomicHierarchy.derived.residue.moleculeType;let t=e.residueIndex[e.elements[0]],r=e.model.atomicHierarchy.derived.residue.moleculeType[t];return!(r===_r.Ion||r===_r.Water)}function qVt(e,t,r,n,o,i){if(!zVt(t))return xt.createEmpty(i);let{detail:a,sizeFactor:s}=o,l=256,c=st.createState(l,l/2,i),u=t.principalAxes.boxAxes,{origin:d,dirA:f,dirB:m}=u,p=Na.size(v(),u);v.scale(p,p,s/2);let h=v.create(p[2],p[1],p[0]);c.currentGroup=0,MC(c,d,f,m,h,a+1);let g=st.getMesh(c),y=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return g.setBoundingSphere(y),g}function jVt(e){let{group:t,structure:r}=e,n=1,o=t.units.length,i=te.Location.create(r);return Tn(n,o,1,(s,l)=>{let c=t.units[l];return i.unit=c,i.element=c.elements[s],i})}function GVt(e,t,r){let{objectId:n,instanceId:o}=e;if(r===n){let{structure:i,group:a}=t,s=a.units[o],l=Se.ofBounds(0,s.elements.length);return te.Loci(i,[{unit:s,indices:l}])}return Pr}function HVt(e,t,r){let n=!1;if(!te.Loci.is(e))return!1;let{structure:o,group:i}=t;if(!Oe.areEquivalent(e.structure,o))return!1;let a=i.elements.length;for(let s of e.elements){let l=i.unitIndexMap.get(s.unit.id);l!==void 0&&Se.size(s.indices)===a&&r(xe.ofSingleton(l))&&(n=!0)}return n}var Mse,nKe=M(()=>{Ue();ka();gt();uo();yi();Ge();aU();or();Ut();Sn();Ci();Br();Gn();Mse={...Uo,sizeFactor:_.Numeric(1,{min:0,max:2,step:.1}),detail:_.Numeric(0,{min:0,max:3,step:1},$e.CustomQualityParamInfo)}});function WVt(e,t){return iKe}function KVt(e,t){return Zt.createMulti("Orientation",e,t,No,oKe)}var oKe,iKe,aKe,sKe=M(()=>{fh();Ue();sc();Eo();nKe();Gn();oKe={"orientation-ellipsoid-mesh":(e,t)=>bo("Orientation ellipsoid mesh",e,t,rKe)},iKe={...Mse,visuals:_.MultiSelect(["orientation-ellipsoid-mesh"],_.objectToOptions(oKe)),bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory)};aKe={name:"orientation",label:"Orientation",description:"Displays orientation ellipsoids for polymer chains.",factory:KVt,getParams:WVt,defaultValues:_.getDefaultValues(iKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0}});function YVt(e,t,r,n,o,i){let{child:a}=r,s=a?.unitMap.get(t.id);if(a&&!s)return ac.createEmpty(i);let{stride:l}=o,c=t.elements,u=c.length,d=JC.create(u,u/10,i),f=v(),m=t.conformation,p=If(r,t,o),h=v(),g=0;if(l&&l>1||p)for(let C=0;C<u;++C)l&&C%l!==0||p&&p(c[C])||(m.invariantPosition(c[C],f),Mq(h,h,f),g+=1,d.add(f[0],f[1],f[2],C));else for(let C=0;C<u;++C)m.invariantPosition(c[C],f),Mq(h,h,f),g+=1,d.add(f[0],f[1],f[2],C);let y=d.getPoints();if(g===0)return y;let b;v.scale(h,h,1/g);let x=i?be.clone(i.boundingSphere):void 0;return x&&v.distance(h,x.center)/x.radius<.1?b=x:b=be.expand(be(),(s??t).boundary.sphere,1*o.sizeFactor),y.setBoundingSphere(b),y}function Bq(e){return RFe({defaultProps:_.getDefaultValues(gR),createGeometry:YVt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride}},e)}function XVt(e,t,r,n,o){let{child:i}=t,{stride:a}=n,{getSerialIndex:s}=t.serialMapping,l=t.elementCount,c=JC.create(l,l/2,o),u=v(),d=0;for(let h of t.units){let g=i?.unitMap.get(h.id);if(i&&!g)return ac.createEmpty(o);let{elements:y,conformation:b}=h,x=y.length,C=v(),S=If(t,h,n);if(a&&a>1||S)for(let w=0;w<x;w++){let A=y[w];a&&w%a!==0||S&&S(A)||(b.position(A,C),c.add(C[0],C[1],C[2],s(h,A)),Mq(u,u,C),d+=1)}else{for(let w=0;w<x;w++){let A=y[w];b.position(A,C),c.add(C[0],C[1],C[2],s(h,A)),Mq(u,u,C)}d+=x}}let f=c.getPoints();if(d===0)return f;let m;v.scale(u,u,1/d);let p=o?be.clone(o.boundingSphere):void 0;return p&&v.distance(u,p.center)/p.radius<1?m=p:m=be.expand(be(),(i??t).boundary.sphere,1*n.sizeFactor),f.setBoundingSphere(m),f}function Rq(e){return wFe({defaultProps:_.getDefaultValues(ZVt),createGeometry:XVt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.stride!==n.stride}},e)}var Mq,gR,ZVt,Bse=M(()=>{Ue();ka();kb();Foe();Ge();yp();or();cc();Mq=v.add,gR={...BFe,pointSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),stride:_.Numeric(1,{min:1,max:100,step:1})};ZVt={...CFe,pointSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),stride:_.Numeric(1,{min:1,max:100,step:1})}});function $Vt(e,t){let r=cKe;return t.unitSymmetryGroups.length>5e3&&(r=_.clone(r),r.visuals.defaultValue=["structure-element-point"]),r}function QVt(e,t){return Zt.createMulti("Point",e,t,No,lKe)}var lKe,cKe,uKe,dKe=M(()=>{Bse();fh();Ue();sc();Eo();Gn();lKe={"element-point":(e,t)=>bo("Element points",e,t,Bq),"structure-element-point":(e,t)=>oi("Structure element points",e,t,Rq)},cKe={...gR,density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory),visuals:_.MultiSelect(["element-point"],_.objectToOptions(lKe))};uKe={name:"point",label:"Point",description:"Displays elements (atoms, coarse spheres) as points.",factory:QVt,getParams:$Vt,defaultValues:_.getDefaultValues(cKe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0}});function JVt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return xt.createEmpty(i);let{sizeFactor:s,detail:l,linearSegments:c,radialSegments:u}=o,d=c*u*a+(u+1)*a*2,f=st.createState(d,d/10,i),m=r3(c),{curvePoints:p,normalVectors:h,binormalVectors:g,widthValues:y,heightValues:b}=m,x=0,C=QI(t,r,{ignoreSecondaryStructure:!0});for(;C.hasNext;){let A=C.move();f.currentGroup=x;let D=$a(A.moleculeType)?uw:cw;n3(m,A,Q8,D);let E=A.coarseBackboneFirst||A.first,I=A.coarseBackboneLast||A.last,k=n.size.size(A.centerPrev)*s,R=n.size.size(A.center)*s,B=n.size.size(A.centerNext)*s;cR(m,k,R,B,k,R,B,D);let O=c;if(A.initial){O=Math.max(Math.round(c*D),1);let F=c-O;p.copyWithin(0,F*3),g.copyWithin(0,F*3),h.copyWithin(0,F*3),y.copyWithin(0,F*3),b.copyWithin(0,F*3),v.fromArray(bm,p,3),v.normalize(bm,v.sub(bm,A.p2,bm)),v.scaleAndAdd(bm,A.p2,bm,R*o3),v.toArray(bm,p,0)}else A.final&&(O=Math.max(Math.round(c*(1-D)),1),v.fromArray(bm,p,O*3-3),v.normalize(bm,v.sub(bm,A.p2,bm)),v.scaleAndAdd(bm,A.p2,bm,R*o3),v.toArray(bm,p,O*3));A.initial===!0&&A.final===!0?Xr(f,A.p2,R*2,l):u===2?P3(f,p,h,g,O,y,b,0):u===4?T3(f,p,h,g,O,y,b,0,E,I):fR(f,p,h,g,O,u,y,b,E,I,"elliptical"),++x}let S=st.getMesh(f),w=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return S.setBoundingSphere(w),S}function mKe(e){return ii({defaultProps:_.getDefaultValues(Rse),createGeometry:JVt,createLocationIterator:t=>hm.fromGroup(t,{asSecondary:!0}),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail||r.linearSegments!==n.linearSegments||r.radialSegments!==n.radialSegments}},e)}var fKe,Flo,bm,Rse,pKe=M(()=>{Ue();uo();yi();l0();Br();vse();ka();pse();Cse();Ge();iu();Gn();or();fKe={sizeFactor:_.Numeric(.2,{min:0,max:10,step:.01}),detail:_.Numeric(0,{min:0,max:3,step:1},$e.CustomQualityParamInfo),linearSegments:_.Numeric(8,{min:1,max:48,step:1},$e.CustomQualityParamInfo),radialSegments:_.Numeric(16,{min:2,max:56,step:2},$e.CustomQualityParamInfo)},Flo=_.getDefaultValues(fKe),bm=v();Rse={...Uo,...fKe}});function ezt(e,t){let r=_.clone(gKe),n=!1,o=!1;return t.units.forEach(i=>{!n&&fe.isAtomic(i)&&i.nucleotideElements.length&&(n=!0),!o&&i.gapElements.length&&(o=!0)}),r.visuals.defaultValue=["polymer-tube"],o&&r.visuals.defaultValue.push("polymer-gap"),r}function tzt(e,t){return Zt.createMulti("Putty",e,t,No,hKe)}var hKe,gKe,yKe,vKe=M(()=>{pKe();bq();Ue();fh();sc();Eo();gt();Gn();hKe={"polymer-tube":(e,t)=>bo("Polymer tube mesh",e,t,mKe),"polymer-gap":(e,t)=>bo("Polymer gap cylinder",e,t,C3)},gKe={...Rse,...pw,sizeFactor:_.Numeric(.2,{min:0,max:10,step:.01}),visuals:_.MultiSelect(["polymer-tube","polymer-gap"],_.objectToOptions(hKe)),bumpFrequency:_.Numeric(2,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory)};yKe={name:"putty",label:"Putty",description:"Displays a tube smoothly following the trace atoms of polymers.",factory:tzt,getParams:ezt,defaultValues:_.getDefaultValues(gKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uncertainty"},isApplicable:e=>e.polymerResidueCount>0}});function rzt(e,t){let r=Ose;return t.isCoarseGrained&&(Oq||(Oq=_.clone(Ose),Oq.sizeFactor.defaultValue=2),r=Oq),t.unitSymmetryGroups.length>5e3&&(r=_.clone(r),r.visuals.defaultValue=["structure-element-sphere"]),r}function nzt(e,t){return Zt.createMulti("Spacefill",e,t,No,bKe)}var bKe,Ose,Oq,xKe,SKe=M(()=>{_ae();fh();Ue();sc();Eo();Gn();bKe={"element-sphere":(e,t)=>bo("Sphere mesh/impostor",e,t,j8),"structure-element-sphere":(e,t)=>oi("Structure sphere mesh/impostor",e,t,G8)},Ose={...$I,bumpFrequency:_.Numeric(1,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.5,{min:0,max:1,step:.01},$e.ShadingCategory),visuals:_.MultiSelect(["element-sphere"],_.objectToOptions(bKe))};xKe={name:"spacefill",label:"Spacefill",description:"Displays atomic/coarse elements as spheres.",factory:nzt,getParams:rzt,defaultValues:_.getDefaultValues(Ose),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function _Ke(e,t,r,n){let o=te.Location.create(t,e),i=e.elements,a=e.bonds,{edgeCount:s,a:l,b:c,edgeProps:u,offset:d}=a,{order:f,flags:m}=u,{sizeFactor:p,aromaticBonds:h,includeTypes:g,excludeTypes:y,multipleBonds:b}=n,x=b==="off",C=b==="symmetric",S=Tt.fromNames(g),w=Tt.fromNames(y),A=HI(S,w,Tt.Flag.Computed),T=v(),D=e.conformation,{elementRingIndices:E,elementAromaticRingIndices:I}=e.rings,k=h?e.resonance.delocalizedTriplets:void 0;return{linkCount:s*2,referencePosition:R=>{let B=l[R],O=c[R],F=k?.getThirdElement(B,O);if(F!==void 0)return D.invariantPosition(i[F],T);B>O&&([B,O]=[O,B]),d[B+1]-d[B]===1&&([B,O]=[O,B]);let q=I.get(B)||E.get(B),W=0;for(let j=d[B],L=d[B+1];j<L;++j){let V=c[j];if(V!==O&&V!==B)if(q){let U=I.get(V)||E.get(V);if(!U)continue;let z=rT(q,U);z>W&&(W=z,D.invariantPosition(i[V],T))}else return D.invariantPosition(i[V],T)}return W>0?T:null},position:(R,B,O,F)=>{D.invariantPosition(i[l[O]],R),D.invariantPosition(i[c[O]],B)},style:R=>{let B=f[R],O=m[R];if(Lse(O,Tt.Flag.MetallicCoordination)||Lse(O,Tt.Flag.HydrogenBond))return Gt.Dashed;if(B===3)return x?Gt.Solid:C?Gt.Triple:Gt.OffsetTriple;if(h){let F=l[R],q=c[R],W=I.get(F),j=I.get(q),L=W&&j?rT(W,j):0;if(Lse(O,Tt.Flag.Aromatic)||L&&!A)return L===2?Gt.MirroredAromatic:Gt.Aromatic}return B!==2||x?Gt.Solid:C?Gt.Double:Gt.OffsetDouble},radius:R=>{o.element=i[l[R]];let B=r.size.size(o);o.element=i[c[R]];let O=r.size.size(o);return Math.min(B,O)*p},ignore:N8(t,e,n)}}function ozt(e,t,r,n,o,i){if(!fe.isAtomic(t))return Hn.createEmpty(i);if(!i1(t,o))return Hn.createEmpty(i);if(!t.bonds.edgeCount)return Hn.createEmpty(i);let{child:a}=r,s=a?.unitMap.get(t.id);if(a&&!s)return Hn.createEmpty(i);let l=_Ke(t,r,n,o),{lines:c,boundingSphere:u}=XM(e,l,o,i);if(u)c.setBoundingSphere(u);else if(c.lineCount>0){let d=be.expand(be(),(s??t).boundary.sphere,1*o.sizeFactor);c.setBoundingSphere(d)}return c}function CKe(e){return bS({defaultProps:_.getDefaultValues(Fse),createGeometry:ozt,createLocationIterator:t=>Pf.fromGroup(t),getLoci:WI,eachLocation:tR,setUpdateState:(t,r,n,o,i,a,s)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!La(r.includeTypes,n.includeTypes)||!La(r.excludeTypes,n.excludeTypes)||r.aromaticBonds!==n.aromaticBonds||r.multipleBonds!==n.multipleBonds;let l=a.group.units[0],c=s.group.units[0];fe.isAtomic(l)&&fe.isAtomic(c)&&(Ns.areEqual(l.bonds,c.bonds)||(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0))}},e)}function izt(e,t,r){let n=[],{bondCount:o,unitIndex:i,unitEdgeIndex:a,unitGroupIndex:s}=e.intraUnitBondMapping,{child:l}=e;for(let c of e.unitSymmetryGroups){let u=c.units[0],d=l?.unitMap.get(u.id),f=fe.isAtomic(u)&&!(l&&!d)?_Ke(u,e,t,r):GU;n.push({group:c,props:f})}return{linkCount:o,referencePosition:c=>{let{group:u,props:d}=n[i[c]];if(!d.referencePosition)return null;let f=d.referencePosition(a[c]);if(!f)return null;let m=u.units[s[c]];return v.transformMat4(f,f,m.conformation.operator.matrix),f},position:(c,u,d,f)=>{let{group:m,props:p}=n[i[d]];p.position(c,u,a[d],f);let h=m.units[s[d]];v.transformMat4(c,c,h.conformation.operator.matrix),v.transformMat4(u,u,h.conformation.operator.matrix)},style:c=>{let{props:u}=n[i[c]];return u.style?u.style(a[c]):Gt.Solid},radius:c=>{let{props:u}=n[i[c]];return u.radius(a[c])},ignore:c=>{let{props:u}=n[i[c]];return u.ignore?u.ignore(a[c]):!1},stub:c=>{let{props:u}=n[i[c]];return u.stub?u.stub(a[c]):!1}}}function azt(e,t,r,n,o){if(!Pl(t,n))return Hn.createEmpty(o);if(!t.intraUnitBondMapping.bondCount)return Hn.createEmpty(o);let i=izt(t,r,n),{lines:a,boundingSphere:s}=XM(e,i,n,o);if(s)a.setBoundingSphere(s);else if(a.lineCount>0){let{child:l}=t,c=be.expand(be(),(l??t).boundary.sphere,1*n.sizeFactor);a.setBoundingSphere(c)}return a}function wKe(e){return MP({defaultProps:_.getDefaultValues(szt),createGeometry:azt,createLocationIterator:(t,r)=>Pl(t,r)?Pf.fromStructureGroups(t):ly,getLoci:oR,eachLocation:iR,setUpdateState:(t,r,n,o,i,a,s)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!La(r.includeTypes,n.includeTypes)||!La(r.excludeTypes,n.excludeTypes)||r.multipleBonds!==n.multipleBonds,Pl(a,r)&&a.interUnitBonds!==s.interUnitBonds&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0)}},e)}var Lse,Fse,szt,TKe=M(()=>{Ue();gt();Ge();Vt();Wg();ka();Br();KI();or();Td();P0();Jn();cc();Ci();Lse=Tt.is;Fse={...vS,...GI,includeParent:_.Boolean(!1)};szt={...kP,...GI,includeParent:_.Boolean(!1)}});function AKe(e,t,r,n){for(Nse.setElement(t,r,n);Nse.hasNext;){let o=Nse.move();return o.otherUnit.conformation.position(o.otherUnit.elements[o.otherIndex],e),e}return null}function lzt(e,t,r){let n=e.interUnitBonds,{edgeCount:o,edges:i}=n,{sizeFactor:a,aromaticBonds:s,multipleBonds:l}=r,c=l==="off",u=l==="symmetric",d=v(),f=te.Location.create();return{linkCount:o,referencePosition:m=>{let p=i[m],h,g,y,b;if(p.unitA<p.unitB)h=e.unitMap.get(p.unitA),g=e.unitMap.get(p.unitB),y=p.indexA,b=p.indexB;else if(p.unitA>p.unitB)h=e.unitMap.get(p.unitB),g=e.unitMap.get(p.unitA),y=p.indexB,b=p.indexA;else throw new Error("same units in createInterUnitBondLines");return AKe(d,e,h,y)||AKe(d,e,g,b)},position:(m,p,h,g)=>{let y=i[h],b=e.unitMap.get(y.unitA),x=e.unitMap.get(y.unitB);b.conformation.position(b.elements[y.indexA],m),x.conformation.position(x.elements[y.indexB],p)},style:m=>{let p=i[m].props.order,h=Ka.create(i[m].props.flag);return Tt.is(h,Tt.Flag.MetallicCoordination)||Tt.is(h,Tt.Flag.HydrogenBond)?Gt.Dashed:p===3?c?Gt.Solid:u?Gt.Triple:Gt.OffsetTriple:s&&Tt.is(h,Tt.Flag.Aromatic)?Gt.Aromatic:p!==2||c?Gt.Solid:u?Gt.Double:Gt.OffsetDouble},radius:m=>{let p=i[m];f.structure=e,f.unit=e.unitMap.get(p.unitA),f.element=f.unit.elements[p.indexA];let h=t.size.size(f);f.unit=e.unitMap.get(p.unitB),f.element=f.unit.elements[p.indexB];let g=t.size.size(f);return Math.min(h,g)*a},ignore:U8(e,r)}}function czt(e,t,r,n,o){if(!Pl(t,n))return Hn.createEmpty(o);if(!t.interUnitBonds.edgeCount)return Hn.createEmpty(o);let i=lzt(t,r,n),{lines:a,boundingSphere:s}=XM(e,i,n,o);if(s)a.setBoundingSphere(s);else if(a.lineCount>0){let{child:l}=t,c=be.expand(be(),(l??t).boundary.sphere,1*n.sizeFactor);a.setBoundingSphere(c)}return a}function PKe(e){return MP({defaultProps:_.getDefaultValues(Use),createGeometry:czt,createLocationIterator:(t,r)=>Pl(t,r)?Pf.fromStructure(t):ly,getLoci:rR,eachLocation:nR,setUpdateState:(t,r,n,o,i,a,s)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.linkScale!==n.linkScale||r.linkSpacing!==n.linkSpacing||r.aromaticDashCount!==n.aromaticDashCount||r.dashCount!==n.dashCount||r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||!La(r.includeTypes,n.includeTypes)||!La(r.excludeTypes,n.excludeTypes)||r.multipleBonds!==n.multipleBonds,Pl(a,r)&&a.interUnitBonds!==s.interUnitBonds&&(t.createGeometry=!0,t.updateTransform=!0,t.updateColor=!0,t.updateSize=!0)}},e)}var Nse,Use,IKe=M(()=>{Ue();gt();Ge();Vt();Wg();cc();Br();KI();Td();or();Ci();Nse=new kt.ElementBondIterator;Use={...kP,...GI,includeParent:_.Boolean(!1)}});function uzt(e,t,r,n,o,i){let{child:a}=r;if(a&&!a.unitMap.get(t.id))return Hn.createEmpty(i);let s=t.elements,l=s.length,c=hl.create(l,l/10,i),u=v(),d=v(),f=v(),m=t.conformation,p=If(r,t,o),h=o.crossSize/2,g=o.crosses==="lone",y=v(),b=0;for(let w=0;w<l;++w)p&&p(s[w])||g&&fe.isAtomic(t)&&i1(t,o)&&vf(r,t,w)!==0||(m.invariantPosition(s[w],u),EKe(y,y,u),b+=1,Gh(d,u,Lq,h),Gh(f,u,Lq,-h),c.add(d[0],d[1],d[2],f[0],f[1],f[2],w),Gh(d,u,Fq,h),Gh(f,u,Fq,-h),c.add(d[0],d[1],d[2],f[0],f[1],f[2],w),Gh(d,u,Nq,h),Gh(f,u,Nq,-h),c.add(d[0],d[1],d[2],f[0],f[1],f[2],w));let x=c.getLines();if(b===0)return x;let C;v.scale(y,y,1/b);let S=i?be.clone(i.boundingSphere):void 0;return S&&v.distance(y,S.center)/S.radius<.1?C=S:C=be.expand(be(),t.boundary.sphere,1*o.sizeFactor),x.setBoundingSphere(C),x}function DKe(e){return bS({defaultProps:_.getDefaultValues(Vse),createGeometry:uzt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.crosses!==n.crosses||r.crossSize!==n.crossSize}},e)}function dzt(e,t,r,n,o){let{child:i}=t,{getSerialIndex:a}=t.serialMapping,s=t.elementCount,l=hl.create(s,s/2,o),c=v(),u=v(),d=v(),f=n.crossSize/2,m=n.crosses==="lone",p=v(),h=0;for(let x of t.units){let C=i?.unitMap.get(x.id);if(i&&!C)return Hn.createEmpty(o);let{elements:S,conformation:w}=x,A=S.length,T=If(t,x,n);for(let D=0;D<A;D++){if(T&&T(S[D])||m&&fe.isAtomic(x)&&i1(x,n)&&vf(t,x,D)!==0)continue;w.position(S[D],c),EKe(p,p,c),h+=1;let E=a(x,S[D]);Gh(u,c,Lq,f),Gh(d,c,Lq,-f),l.add(u[0],u[1],u[2],d[0],d[1],d[2],E),Gh(u,c,Fq,f),Gh(d,c,Fq,-f),l.add(u[0],u[1],u[2],d[0],d[1],d[2],E),Gh(u,c,Nq,f),Gh(d,c,Nq,-f),l.add(u[0],u[1],u[2],d[0],d[1],d[2],E)}}let g=l.getLines();if(h===0)return g;let y;v.scale(p,p,1/h);let b=o?be.clone(o.boundingSphere):void 0;return b&&v.distance(p,b.center)/b.radius<1?y=b:y=be.expand(be(),(i??t).boundary.sphere,1*n.sizeFactor),g.setBoundingSphere(y),g}function kKe(e){return MP({defaultProps:_.getDefaultValues(fzt),createGeometry:dzt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{t.createGeometry=r.ignoreHydrogens!==n.ignoreHydrogens||r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant||r.traceOnly!==n.traceOnly||r.crosses!==n.crosses||r.crossSize!==n.crossSize}},e)}var EKe,Gh,Lq,Fq,Nq,Vse,fzt,MKe=M(()=>{Ue();ka();gt();Ge();yp();or();Td();Qx();lp();KI();cc();EKe=v.add,Gh=v.scaleAndAdd,Lq=v.unitX,Fq=v.unitY,Nq=v.unitZ,Vse={...vS,lineSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),crosses:_.Select("lone",_.arrayToOptions(["lone","all"])),crossSize:_.Numeric(.35,{min:0,max:2,step:.01})};fzt={...kP,lineSizeAttenuation:_.Boolean(!1),ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),traceOnly:_.Boolean(!1),crosses:_.Select("lone",_.arrayToOptions(["lone","all"])),crossSize:_.Numeric(.35,{min:0,max:2,step:.01})}});function mzt(e,t){let r=RKe;return Oe.getSize(t)>=Oe.Size.Huge?(r=_.clone(r),r.visuals.defaultValue=["intra-bond","element-point","element-cross"]):t.unitSymmetryGroups.length>5e3&&(r=_.clone(r),r.visuals.defaultValue=["structure-intra-bond","structure-element-point","structure-element-cross"]),r}function pzt(e,t){return Zt.createMulti("Line",e,t,No,BKe)}var BKe,RKe,OKe,LKe=M(()=>{TKe();IKe();Ue();fh();zM();sc();Eo();gt();FC();Bse();MKe();kb();Gn();BKe={"intra-bond":(e,t)=>bo("Intra-unit bond line",e,t,CKe),"inter-bond":(e,t)=>oi("Inter-unit bond line",e,t,PKe),"element-point":(e,t)=>bo("Points",e,t,Bq),"element-cross":(e,t)=>bo("Crosses",e,t,DKe),"structure-intra-bond":(e,t)=>oi("Structure intra-unit bond line",e,t,wKe),"structure-element-point":(e,t)=>oi("Structure element points",e,t,Rq),"structure-element-cross":(e,t)=>oi("Structure element crosses",e,t,kKe)},RKe={...Fse,...Use,...gR,...Vse,pointStyle:_.Select("circle",_.objectToOptions(ac.StyleTypes)),multipleBonds:_.Select("offset",_.arrayToOptions(["off","symmetric","offset"])),includeParent:_.Boolean(!1),sizeFactor:_.Numeric(2,{min:.01,max:10,step:.01}),unitKinds:zb(["atomic"]),visuals:_.MultiSelect(["intra-bond","inter-bond","element-point","element-cross"],_.objectToOptions(BKe)),density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory)};OKe={name:"line",label:"Line",description:"Displays bonds as lines and atoms as points or croses.",factory:pzt,getParams:mzt,defaultValues:_.getDefaultValues(RKe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.elementCount>0,getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent}});function hzt(e,t,r,n,o){let{webgl:i}=e;if(!i)throw new Error("GaussianDensityVolume requires `webgl`");let a=v.create(0,1,2),s={min:0,max:1,mean:.04,sigma:.01},l=u=>{let d=u?u.gridTexture.ref.value:void 0,f=wWe(t,r.size,n,i,d),{transform:m,texture:p,bbox:h,gridDim:g}=f,y=H.mul(H(),m,H.fromScaling(H(),g)),b=H.getScaling(v(),m),x=Bc.create(h,g,m,y,b,p,s,!0,a,"byte",u),C=be.expand(be(),t.boundary.sphere,f.maxRadius);return x.setBoundingSphere(C),x},c=l(o);return c.meta.reset=()=>{l(c)},c}function FKe(e){return IFe({defaultProps:_.getDefaultValues(zse),createGeometry:hzt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)},dispose:t=>{t.gridTexture.ref.value.destroy()}},e)}function gzt(e,t,r,n,o,i){let{webgl:a}=e;if(!a)throw new Error("GaussianDensityVolume requires `webgl`");let s=v.create(0,1,2),l={min:0,max:1,mean:.04,sigma:.01},c=d=>{let f=d?d.gridTexture.ref.value:void 0,m=SWe(r,t,n.size,o,a,f),{transform:p,texture:h,bbox:g,gridDim:y}=m,b=H.mul(H(),p,H.fromScaling(H(),y)),x=H.getScaling(v(),p),C=Bc.create(g,y,p,b,x,h,l,!0,s,"byte",d),S=be.expand(be(),t.boundary.sphere,m.maxRadius);return C.setBoundingSphere(S),C},u=c(i);return u.meta.reset=()=>{c(u)},u}function NKe(e){return LFe({defaultProps:_.getDefaultValues(yzt),createGeometry:gzt,createLocationIterator:bi.fromGroup,getLoci:pc,eachLocation:mc,setUpdateState:(t,r,n)=>{r.resolution!==n.resolution&&(t.createGeometry=!0),r.radiusOffset!==n.radiusOffset&&(t.createGeometry=!0),r.smoothness!==n.smoothness&&(t.createGeometry=!0),r.ignoreHydrogens!==n.ignoreHydrogens&&(t.createGeometry=!0),r.ignoreHydrogensVariant!==n.ignoreHydrogensVariant&&(t.createGeometry=!0),r.traceOnly!==n.traceOnly&&(t.createGeometry=!0),r.includeParent!==n.includeParent&&(t.createGeometry=!0)},dispose:t=>{t.gridTexture.ref.value.destroy()}},e)}var zse,yzt,UKe=M(()=>{Ue();Pq();bC();cc();Ge();yp();or();ka();zse={...PFe,...a_,ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),includeParent:_.Boolean(!1,{isHidden:!0})};yzt={...OFe,...a_,ignoreHydrogens:_.Boolean(!1),ignoreHydrogensVariant:_.Select("all",_.arrayToOptions(["all","non-polar"])),includeParent:_.Boolean(!1,{isHidden:!0})}});function vzt(e,t){return zKe}function bzt(e,t){return Zt.createMulti("Gaussian Volume",e,t,No,VKe)}var VKe,zKe,qKe,jKe=M(()=>{Ue();UKe();sc();Eo();VKe={"gaussian-volume":(e,t)=>oi("Gaussian volume",e,t,FKe),"units-gaussian-volume":(e,t)=>bo("Units-Gaussian volume",e,t,NKe)},zKe={...zse,jumpLength:_.Numeric(4,{min:0,max:20,step:.1}),visuals:_.MultiSelect(["gaussian-volume"],_.objectToOptions(VKe))};qKe={name:"gaussian-volume",label:"Gaussian Volume",description:"Displays a gaussian molecular density using direct volume rendering.",factory:bzt,getParams:vzt,defaultValues:_.getDefaultValues(zKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0}});function GKe(e,t,r,n){return r.tryUseImpostor&&hS(n)?wzt(e):Azt(e)}function Czt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return ba.createEmpty(i);let s=a*2,l=_S.create(s,s/4,i),c=t.conformation,u=v(),d=v(),f=v();Nae(t,function(g,y,b,x,C){c.invariantPosition(g,u),c.invariantPosition(y,d);let w=$a(C)?uw:cw;Szt(f,u,xzt(f,_zt(f,d,u),w)),l.add(u[0],u[1],u[2],f[0],f[1],f[2],1,!1,!1,2,b),l.add(f[0],f[1],f[2],d[0],d[1],d[2],1,!1,!1,2,x)});let p=l.getCylinders(),h=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return p.setBoundingSphere(h),p}function wzt(e){return LP({defaultProps:_.getDefaultValues(Uq),createGeometry:Czt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function Tzt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return xt.createEmpty(i);let{radialSegments:s,sizeFactor:l}=o,c=s*2*a*2,u=st.createState(c,c/10,i),d=t.conformation,f=v(),m=v(),p={radiusTop:1,radiusBottom:1,radialSegments:s},h=te.Location.create(r,t),g=te.Location.create(r,t);Nae(t,function(C,S,w,A,T){h.element=C,g.element=S,d.invariantPosition(h.element,f),d.invariantPosition(g.element,m);let E=$a(T)?uw:cw;p.radiusTop=p.radiusBottom=n.size.size(h)*l,u.currentGroup=w,An(u,f,m,E,p),p.radiusTop=p.radiusBottom=n.size.size(g)*l,u.currentGroup=A,An(u,m,f,1-E,p)});let b=st.getMesh(u),x=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return b.setBoundingSphere(x),b}function Azt(e){return ii({defaultProps:_.getDefaultValues(Uq),createGeometry:Tzt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.radialSegments!==n.radialSegments},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var xzt,Szt,_zt,Uq,HKe=M(()=>{Ue();gt();uo();yi();Ge();l0();rp();ka();Gn();or();Br();Ug();jU();W8();Ps();xzt=v.scale,Szt=v.add,_zt=v.sub,Uq={...Uo,...OP,sizeFactor:_.Numeric(.3,{min:0,max:10,step:.01}),radialSegments:_.Numeric(16,{min:2,max:56,step:2},$e.CustomQualityParamInfo),tryUseImpostor:_.Boolean(!0)}});function WKe(e,t,r,n){return r.tryUseImpostor&&IP(n)?Izt(e):Dzt(e)}function Pzt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return yl.createEmpty(i);let s=i0.create(a,a/2,i),l=t.conformation,c=v();Uae(t,(m,p)=>{l.invariantPosition(m,c),s.add(c[0],c[1],c[2],p)});let d=s.getSpheres(),f=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return d.setBoundingSphere(f),d}function Izt(e){return RP({defaultProps:_.getDefaultValues(Vq),createGeometry:Pzt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{},mustRecreate:(t,r,n)=>!r.tryUseImpostor||!n},e)}function Ezt(e,t,r,n,o,i){let a=t.polymerElements.length;if(!a)return xt.createEmpty(i);let{detail:s,sizeFactor:l}=o,c=a*om(s),u=st.createState(c,c/2,i),d=t.conformation,f=v(),m=te.Location.create(r,t);Uae(t,(y,b)=>{m.element=y,d.invariantPosition(m.element,f),u.currentGroup=b,Xr(u,f,n.size.size(m)*l,s)});let h=st.getMesh(u),g=be.expand(be(),t.boundary.sphere,1*o.sizeFactor);return h.setBoundingSphere(g),h}function Dzt(e){return ii({defaultProps:_.getDefaultValues(Vq),createGeometry:Ezt,createLocationIterator:t=>hm.fromGroup(t),getLoci:Ph,eachLocation:Ih,setUpdateState:(t,r,n)=>{t.createGeometry=r.sizeFactor!==n.sizeFactor||r.detail!==n.detail},mustRecreate:(t,r,n)=>r.tryUseImpostor&&!!n},e)}var Vq,KKe=M(()=>{Ue();gt();uo();yi();Ge();l0();ka();Gn();or();iu();Zx();yy();OB();W8();Ps();Vq={...Uo,...BP,sizeFactor:_.Numeric(.3,{min:0,max:10,step:.01}),detail:_.Numeric(0,{min:0,max:3,step:1},$e.CustomQualityParamInfo),tryUseImpostor:_.Boolean(!0)}});function kzt(e,t){let r=_.clone(XKe),n=!1;return t.units.forEach(o=>{!n&&o.gapElements.length&&(n=!0)}),r.visuals.defaultValue=["polymer-backbone-cylinder","polymer-backbone-sphere"],n&&r.visuals.defaultValue.push("polymer-gap"),r}function Mzt(e,t){return Zt.createMulti("Backbone",e,t,No,YKe)}var YKe,XKe,ZKe,$Ke=M(()=>{HKe();Ue();fh();sc();Eo();KKe();bq();Gn();YKe={"polymer-backbone-cylinder":(e,t)=>bo("Polymer backbone cylinder",e,t,GKe),"polymer-backbone-sphere":(e,t)=>bo("Polymer backbone sphere",e,t,WKe),"polymer-gap":(e,t)=>bo("Polymer gap cylinder",e,t,C3)},XKe={...Vq,...Uq,...pw,sizeAspectRatio:_.Numeric(1,{min:.1,max:3,step:.1}),visuals:_.MultiSelect(["polymer-backbone-cylinder","polymer-backbone-sphere","polymer-gap"],_.objectToOptions(YKe)),bumpFrequency:_.Numeric(0,{min:0,max:10,step:.1},$e.ShadingCategory),density:_.Numeric(.1,{min:0,max:1,step:.01},$e.ShadingCategory),colorMode:_.Select("default",_.arrayToOptions(["default","interpolate"]),{...$e.ShadingCategory,isHidden:!0})};ZKe={name:"backbone",label:"Backbone",description:"Displays polymer backbone with cylinders and spheres.",factory:Mzt,getParams:kzt,defaultValues:_.getDefaultValues(XKe),defaultColorTheme:{name:"chain-id"},defaultSizeTheme:{name:"uniform"},isApplicable:e=>e.polymerResidueCount>0}});function QKe(e){return MFe({defaultProps:_.getDefaultValues(qse),createGeometry:Fzt,createLocationIterator:bi.fromStructure,getLoci:gc,eachLocation:hc,setUpdateState:(t,r,n,o,i)=>{t.createGeometry=r.imageResolution!==n.imageResolution||r.mode!==n.mode||r.margin!==n.margin||r.frame!==n.frame||r.extent!==n.extent||!v.equals(r.rotation.axis,n.rotation.axis)||r.rotation.angle!==n.rotation.angle||r.offset!==n.offset||r.axis!==n.axis||!v.equals(r.plane.point,n.plane.point)||!v.equals(r.plane.normal,n.plane.normal)||r.antialias!==n.antialias||r.cutout!==n.cutout||r.defaultColor!==n.defaultColor||!Ws.areEqual(o.color,i.color)||!Yo.areEqual(o.size,i.size)}},e)}function Lzt(e,t){let{mode:r,axis:n,frame:o,extent:i,margin:a,rotation:s,plane:l,includeParent:c}=t;c&&e.child&&(e=e.child);let u=v(),d=v(),f=v(),m=v(),p=v(),h=v(),g=0,y=0,b=0,x,C,S;if(o==="principalAxes"){let T=Oe.getPrincipalAxes(e).boxAxes;[g,y,b]=Na.size(v(),T),x=T.dirA,C=T.dirB,S=T.dirC,v.copy(h,T.origin)}else[g,y,b]=Ct.size(v(),e.boundary.box),x=v.create(1,0,0),C=v.create(0,1,0),S=v.create(0,0,1),v.copy(h,e.boundary.sphere.center);if(v.set(d,g,y,b),n==="c"?(v.set(u,g,y,b),v.copy(f,x),v.copy(m,C),v.copy(p,S)):n==="b"?(v.set(u,g,b,y),v.copy(f,x),v.copy(p,C),v.copy(m,S)):(v.set(u,y,b,g),v.copy(p,x),v.copy(f,C),v.copy(m,S)),s.angle!==0){let T=v();v.scaleAndAdd(T,T,x,s.axis[0]),v.scaleAndAdd(T,T,C,s.axis[1]),v.scaleAndAdd(T,T,S,s.axis[2]),v.normalize(T,T);let D=H.fromRotation(H(),zr(s.angle),T);v.transformDirection(f,f,D),v.transformDirection(m,m,D),v.transformDirection(p,p,D)}if(i==="sphere"||s.angle!==0){let T=e.boundary.sphere.radius*2,D=v.magnitude(Ct.size(v(),Ct.fromSphere3D(Ct(),e.boundary.sphere)));v.set(u,D,D,T),i==="sphere"&&v.set(d,T,T,T)}v.addScalar(u,u,a*2),v.addScalar(d,d,a*2);let w=Kr.identity();o==="principalAxes"&&Kr.fromBasis(w,v.normalize(v(),x),v.normalize(v(),C),v.normalize(v(),S)),r==="plane"&&(v.copy(h,l.point),v.copy(p,l.normal),v.cross(f,p,v.unitX),v.dot(f,f)<1e-6&&v.cross(f,p,v.unitY),v.normalize(f,f),v.cross(m,p,f),v.normalize(m,m));let A={type:i==="sphere"?2:3,center:h,scale:d,rotation:w,transform:H.identity()};return{size:u,major:f,minor:m,normal:p,center:h,trim:A}}function Fzt(e,t,r,n,o){let{imageResolution:i,offset:a,antialias:s,cutout:l,defaultColor:c}=n,u=1/i,d="color"in r.color&&r.color.color?r.color.color:()=>De(16777215),{size:f,major:m,minor:p,normal:h,center:g,trim:y}=Lzt(t,n),b=v.create(f[0],f[1],1),x=v.setMagnitude(v(),h,f[2]/2),C=Math.floor(f[1]*u),S=Math.floor(f[0]*u),w=H.identity(),A=v(),T=v();v.add(A,g,m),H.targetTo(w,g,A,p),v.scaleAndAdd(T,g,x,a),H.setTranslation(w,T),H.mul(w,w,H.rotY90),H.scale(w,w,b);let{getSerialIndex:D}=t.serialMapping,E=r.color.granularity.startsWith("vertex"),I=Ko.fromNormalAndCoplanarPoint(Ko(),v.normalize(v(),h),T),k=H.invert(H(),w),R=Ul(v(),v()),B=te.Location.create(t),{units:O}=t,F=0;for(let Y=0,ne=O.length;Y<ne;++Y){let{elements:K}=O[Y];B.unit=O[Y];for(let $=0,Z=K.length;$<Z;++$){B.element=K[$];let de=r.size.size(B);de>F&&(F=de)}}let q=new Uint8Array(C*S*4),W=new Uint8Array(C*S*4),j=new Float32Array(C*S);j.fill(Number.MAX_VALUE);let L=v(),V=v(),U=v();if(E){let Y=0;for(let ne=0;ne<S;++ne)for(let K=0;K<C;++K){let $=en(K+.5,0,C-1)/C-.5,Z=en(ne+.5,0,S-1)/S-.5;v.set(A,Z,-$,0),v.transformMat4(A,A,w),v.copy(R.position,A);let de=d(R,!1);De.toArray(de,q,Y),q[Y+3]=l?0:255,Y+=4}}else for(let Y=0,ne=C*S*4;Y<ne;Y+=4)De.toArray(c,q,Y),q[Y+3]=l?0:255;for(let Y=0,ne=O.length;Y<ne;++Y){let K=O[Y],{elements:$,conformation:Z}=K;B.unit=O[Y];for(let de=0,Q=$.length;de<Q;++de){let ae=$[de];B.element=ae,Z.position(ae,L);let ye=Ko.distanceToPoint(I,L);if(Math.abs(ye)>F)continue;let we=r.size.size(B);if(Math.abs(ye)>we)continue;let re=Math.cos(Math.abs(ye)/we),ee=s?i*re:0,le=we+ee/2,pe=le*le;v.scaleAndAdd(V,L,I.normal,-ye),v.transformMat4(U,V,k),v.addScalar(U,U,.5);let ke=Math.floor(U[0]*S),Ve=C-Math.ceil(U[1]*C),Xe=Math.ceil(we*u),pt=Math.max(0,ke-Xe),_e=Math.max(0,Ve-Xe),Ie=Math.min(S,ke+Xe+2),Re=Math.min(C,Ve+Xe+2);v.copy(R.position,V);let ze=E?c:d(B,!1),N=D(B.unit,B.element);for(let J=pt;J<Ie;++J)for(let Ae=_e;Ae<Re;++Ae){let qe=en(J+.5,0,S-1)/S-.5,Be=en(Ae+.5,0,C-1)/C-.5;Bzt(A,qe,-Be,0),Rzt(A,A,w);let Qe=Ozt(A,L);if(Qe>pe)continue;let at=J*C+Ae;if(Qe<j[at]){let ft=at*4,mt=Math.sqrt(Qe)-we+ee/2,dt=mt>0?1-mt/ee:1;E?dt===1?j[at]=Qe:l&&(W[ft]!==0||W[ft+1]!==0||W[ft+2]!==0)&&(dt=1):dt===1?(j[at]=Qe,De.toArray(ze,q,ft)):l?(De.toArray(ze,q,ft),(W[ft]!==0||W[ft+1]!==0||W[ft+2]!==0)&&(dt=1)):De.toArray(De.interpolate(De.fromArray(q,ft),ze,dt),q,ft),Lg(N,W,ft),W[ft+3]=s?Math.round(255*dt):255,l&&(q[at*4+3]=s?Math.round(255*dt):255)}}}}let z={width:C,height:S,array:q,flipY:!0},ie={width:C,height:S,array:W,flipY:!0},oe={width:1,height:1,array:new Float32Array(1),flipY:!0},X=new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]);return ff(w,X,0,4),pu.create(z,X,ie,oe,y,-1,o)}var Bzt,Rzt,Ozt,qse,JKe=M(()=>{Ue();gt();Ge();or();cc();yp();eS();cy();Gn();Ci();Zl();sa();By();gy();Ry();WA();la();Bzt=v.set,Rzt=v.transformMat4,Ozt=v.squaredDistance,qse={...kFe,interpolation:_.Select("nearest",_.objectToOptions(m6)),imageResolution:_.Numeric(.5,{min:.01,max:20,step:.01},{description:"Grid resolution/cell spacing.",...$e.CustomQualityParamInfo}),mode:_.Select("frame",_.arrayToOptions(["frame","plane"]),{description:"Frame: slice through the structure along arbitrary axes in any step size. Plane: an arbitrary plane defined by point and normal."}),offset:_.Numeric(0,{min:-1,max:1,step:.01},{isEssential:!0,immediateUpdate:!0,hideIf:e=>e.mode!=="frame",description:"Relative offset from center."}),axis:_.Select("c",_.arrayToOptions(["a","b","c"]),{isEssential:!0,hideIf:e=>e.mode!=="frame"}),rotation:_.Group({axis:_.Vec3(v.create(1,0,0),{},{description:"Axis of rotation"}),angle:_.Numeric(0,{min:-180,max:180,step:1},{immediateUpdate:!0,description:"Axis rotation angle in Degrees"})},{isExpanded:!0,hideIf:e=>e.mode!=="frame"}),plane:_.Group({point:_.Vec3(v.create(0,0,0),{},{description:"Plane point"}),normal:_.Vec3(v.create(1,0,0),{},{description:"Plane normal"})},{isExpanded:!0,hideIf:e=>e.mode!=="plane"}),extent:_.Select("frame",_.arrayToOptions(["frame","sphere"]),{description:"Extent of the plane, either box (frame) or sphere."}),margin:_.Numeric(4,{min:0,max:50,step:1},{immediateUpdate:!0,description:"Margin around the structure in Angstrom"}),frame:_.Select("principalAxes",_.arrayToOptions(["principalAxes","boundingBox"])),antialias:_.Boolean(!0,{description:"Antialiasing of structure edges."}),cutout:_.Boolean(!1,{description:"Cutout the structure from the image."}),defaultColor:_.Color(De(13421772),{description:"Default color for parts of the image that are not covered by the color theme."}),includeParent:_.Boolean(!1,{description:"Show parent structure (but within extent of this structure)."})}});function Nzt(e,t){return tYe}function Uzt(e,t){return Zt.createMulti("Plane",e,t,No,eYe)}var eYe,tYe,rYe,nYe=M(()=>{Ue();sc();Eo();JKe();eYe={"plane-image":(e,t)=>oi("Plane image",e,t,QKe)},tYe={...qse,visuals:_.MultiSelect(["plane-image"],_.objectToOptions(eYe))};rYe={name:"plane",label:"Plane",description:"Displays planes.",factory:Uzt,getParams:Nzt,defaultValues:_.getDefaultValues(tYe),defaultColorTheme:{name:"element-symbol"},defaultSizeTheme:{name:"physical"},isApplicable:e=>e.elementCount>0,getData:(e,t)=>t.includeParent?e.asParent():e,mustRecreate:(e,t)=>e.includeParent!==t.includeParent}});var D3,oYe=M(()=>{Aa();Eo();m7e();N7e();ZHe();oWe();FWe();jWe();tKe();sKe();dKe();vKe();SKe();LKe();jKe();$Ke();nYe();D3=class e extends yP{constructor(){super(),pa(e.BuiltIn,(t,r)=>{if(t.name!==r)throw new Error(`Fix BuiltInStructureRepresentations to have matching names. ${t.name} ${r}`);this.add(t)})}};(function(e){e.BuiltIn={cartoon:XHe,backbone:ZKe,"ball-and-stick":f7e,carbohydrate:F7e,ellipsoid:nWe,"gaussian-surface":LWe,"gaussian-volume":qKe,label:qWe,line:OKe,"molecular-surface":eKe,orientation:aKe,plane:rYe,point:uKe,putty:yKe,spacefill:xKe}})(D3||(D3={}))});var Vzt,zq,iYe=M(()=>{ed();Fn();XN();Vzt=1e3/30,zq=class{get isAnimating(){return this._isAnimating}async tick(t,r){var n,o;if(await this.plugin.managers.animation.tick(t,r?.isSynchronous,r?.animation),(n=this.plugin.canvas3d)===null||n===void 0||n.tick(t,r),Ye){let i=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.webgl.timer.resolve();if(i)for(let a of i)fM([a])}}resetTime(t){var r;(r=this.plugin.canvas3d)===null||r===void 0||r.resetTime(t)}start(t){var r,n;(r=this.plugin.canvas3d)===null||r===void 0||r.resume(),this._isAnimating=!0,this.resetTime(0),this.properTimeT=0,this.lastTickT=Kn(),t?.immediate?this.frame():this.currentFrame=(n=this.plugin.canvas3d)===null||n===void 0?void 0:n.requestAnimationFrame(this.frame)}stop(t){var r,n;this._isAnimating=!1,this.currentFrame!==void 0&&((r=this.plugin.canvas3d)===null||r===void 0||r.cancelAnimationFrame(this.currentFrame),this.currentFrame=void 0),t?.noDraw&&((n=this.plugin.canvas3d)===null||n===void 0||n.pause(t?.noDraw))}constructor(t){this.plugin=t,this.lastTickT=0,this.properTimeT=0,this.currentFrame=void 0,this._isAnimating=!1,this.frame=(r,n)=>{var o;let i=Kn(),a=i-this.lastTickT;this.lastTickT=i,this.properTimeT+=Math.min(a,Vzt),this.tick(this.properTimeT,{xrFrame:n}),this._isAnimating&&(this.currentFrame=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.requestAnimationFrame(this.frame))}}}});var qq,aYe=M(()=>{_o();yn();qx();qq=class{getDecorator(t){let r=this.plugin.state.data.tree,n=r.children.get(t);if(n.size!==1)return t;let o=n.first();return o&&r.transforms.get(o).transformer.definition.isDecorator?this.getDecorator(o):t}get(t,r=!1){let n=this.root.get(t);if(n)return r?this.plugin.state.data.cells.get(n.ref):this.plugin.state.data.cells.get(this.getDecorator(n.ref))}addMapping(t,r,n){if(!ue.Molecule.Structure.is(n))return!1;if(this.tracked.set(r,n.data),this.root.has(n.data)){let o=this.root.get(n.data);o.count++}else{let o=t.select(ir.Generators.byRef(r).rootOfType([ue.Molecule.Structure]))[0];o?this.root.set(n.data,{ref:o.transform.ref,count:1}):this.root.set(n.data,{ref:r,count:1})}return!0}removeMapping(t){if(!this.tracked.has(t))return!1;let r=this.tracked.get(t);this.tracked.delete(t);let n=this.root.get(r);return n.count>1?n.count--:this.root.delete(r),!0}updateMapping(t,r,n,o){return ue.Molecule.Structure.is(o)?(this.removeMapping(r),this.addMapping(t,r,o),!0):!1}dispose(){this.ev.dispose()}constructor(t){this.plugin=t,this.ev=_d.create(),this.events={updated:this.ev(),removed:this.ev()},this.root=new Map,this.tracked=new Map,t.state.data.events.object.created.subscribe(r=>{this.addMapping(r.state,r.ref,r.obj)}),t.state.data.events.object.removed.subscribe(r=>{this.removeMapping(r.ref)&&this.events.removed.next({ref:r.ref,obj:r.obj})}),t.state.data.events.object.updated.subscribe(r=>{this.updateMapping(r.state,r.ref,r.oldObj,r.obj)&&this.events.updated.next({ref:r.ref,oldObj:r.oldObj,obj:r.obj})})}}});var k3,sYe=M(()=>{hr();qx();ed();jH();Jn();k3=class{constructor(){this.ev=_d.create(),this.id=0,this.runningTasks=new Set,this.abortRequests=new Map,this.options=new Map,this.currentContext=[],this.events={progress:this.ev(),finished:this.ev()}}tryGetAbortTaskId(t){if(this.abortRequests.has(t.progress.taskId))return t.progress.taskId;for(let r of t.children){let n=this.tryGetAbortTaskId(r);if(n!==void 0)return n}}track(t,r){return n=>{var o;if(n.canAbort&&n.requestAbort){let a=this.tryGetAbortTaskId(n.root);a!==void 0&&n.requestAbort(this.abortRequests.get(a))}let i=Kn()-n.root.progress.startedTime;this.events.progress.next({id:t,useOverlay:(o=this.options.get(r))===null||o===void 0?void 0:o.useOverlay,level:i<250?"none":"background",progress:n})}}async run(t,r){let n=this.id++,o;r?.createNewContext||this.currentContext.length===0?o={ctx:fme(t,this.track(n,t.id),100),refCount:1}:(o=this.currentContext[this.currentContext.length-1],o.refCount++);try{return this.options.set(t.id,{useOverlay:!!r?.useOverlay}),this.runningTasks.add(t.id),await l4(o.ctx,t)}finally{this.options.delete(t.id),this.runningTasks.delete(t.id),this.events.finished.next({id:n}),this.abortRequests.delete(t.id),o.refCount--,o.refCount===0&&tg(this.currentContext,o)}}requestAbortAll(t){this.runningTasks.forEach(r=>this.abortRequests.set(r,t))}requestAbort(t,r){let n=typeof t=="number"?t:t.root.progress.taskId;this.abortRequests.set(n,r)}dispose(){this.ev.dispose()}};(function(e){function t(n){return new Promise(o=>setTimeout(o,n))}function r(n){return Me.create("Test",async o=>{let i=0;for(;i<n;)await t(100+Math.random()*200),o.shouldUpdate&&await o.update({message:"Step "+i,current:i,max:n,isIndeterminate:!1}),i++})}e.testTask=r})(k3||(k3={}))});var jq,lYe=M(()=>{Cf();vb();Ri();jq=class extends uc{findByKey(t){return this.state.entries.find(r=>!!r&&r.key===t)}show(t){let r=this.state.entries,n,o=++this.serialId,i;t.key&&(n=this.findByKey(t.key))?(n.timeout!==void 0&&clearTimeout(n.timeout),i=n.serialNumber,r=r.remove(n.id)):i=++this.serialNumber,n={id:o,serialNumber:i,key:t.key,title:t.title,message:t.message,timeout:this.timeout(o,t.timeoutMs),hide:()=>this.hideId(o)},this.updateState({entries:r.set(o,n)})&&this.events.changed.next(void 0)}timeout(t,r){if(r!==void 0)return r<0&&(r=500),setTimeout(()=>{let n=this.state.entries.get(t);n.timeout=void 0,this.hide(n)},r)}hideId(t){this.hide(this.state.entries.get(t))}hide(t){t&&(t.timeout!==void 0&&clearTimeout(t.timeout),t.hide=void 0,this.updateState({entries:this.state.entries.delete(t.id)})&&this.events.changed.next(void 0))}constructor(t){super({entries:rc()}),this.events={changed:this.ev()},this.serialNumber=0,this.serialId=0,St.Toast.Show.subscribe(t,r=>this.show(r)),St.Toast.Hide.subscribe(t,r=>this.hide(this.findByKey(r.key)))}}});function zzt(){let e=document.createElement("canvas");return e.getContext&&e.getContext("2d")?e.toDataURL("image/webp").indexOf("data:image/webp")===0:!1}var Gq,cYe=M(()=>{sI();OV();Gd();Cf();_o();yn();hr();Jr();FV();Ue();Nf();Gq=class extends dp{createParams(){let t=8192;if(this.plugin.canvas3d){let{webgl:r}=this.plugin.canvas3d;t=Math.floor(Math.min(r.maxRenderbufferSize,r.maxTextureSize)/2)}return{resolution:_.MappedStatic("viewport",{viewport:_.Group({}),hd:_.Group({}),"full-hd":_.Group({}),"ultra-hd":_.Group({}),custom:_.Group({width:_.Numeric(1920,{min:128,max:t,step:1}),height:_.Numeric(1080,{min:128,max:t,step:1})},{isFlat:!0})},{options:[["viewport","Viewport"],["hd","HD (1280 x 720)"],["full-hd","Full HD (1920 x 1080)"],["ultra-hd","Ultra HD (3840 x 2160)"],["custom","Custom"]]}),format:_.MappedStatic("png",{png:_.Group({}),webp:_.Group({quality:_.Numeric(.9,{min:0,max:1,step:.01})}),jpeg:_.Group({quality:_.Numeric(.9,{min:0,max:1,step:.01})})},{options:[["png","PNG"],["jpeg","JPEG"],...zzt()?[["webp","WebP"]]:[]]}),transparent:_.Boolean(!1),axes:IS.axes,illumination:_.Group({extraIterations:_.Numeric(1,{min:0,max:5,step:1}),targetIterationTimeMs:_.Numeric(300,{min:100,max:3e3,step:10})})}}get params(){return this._params?this._params:this._params=this.createParams()}get values(){return this.behaviors.values.value}get cropParams(){return this.behaviors.cropParams.value}get relativeCrop(){return this.behaviors.relativeCrop.value}getCanvasSize(){var t,r;return{width:((t=this.plugin.canvas3d)===null||t===void 0?void 0:t.webgl.gl.drawingBufferWidth)||0,height:((r=this.plugin.canvas3d)===null||r===void 0?void 0:r.webgl.gl.drawingBufferHeight)||0}}getSize(){let t=this.values;switch(t.resolution.name){case"viewport":return this.getCanvasSize();case"hd":return{width:1280,height:720};case"full-hd":return{width:1920,height:1080};case"ultra-hd":return{width:3840,height:2160};default:return{width:t.resolution.params.width,height:t.resolution.params.height}}}getPostprocessingProps(){let t=this.plugin.canvas3d,r=t.props.postprocessing.occlusion;return{...t.props.postprocessing,occlusion:r.name==="on"?{name:"on",params:{...r.params,samples:128,resolutionScale:t.webgl.pixelRatio,transparentThreshold:1}}:r}}getIlluminationProps(t){let n=this.plugin.canvas3d.props.illumination,{extraIterations:o,targetIterationTimeMs:i}=this.values.illumination;return{...n,enabled:t?!1:n.enabled,maxIterations:Math.ceil(Math.log2(Math.pow(2,n.maxIterations+o)*n.rendersPerFrame[1])),targetFps:1e3/i,denoiseThreshold:[n.denoiseThreshold[0],n.denoiseThreshold[0]],rendersPerFrame:[1,1]}}createPass(t){let r=this.plugin.canvas3d,{colorBufferFloat:n,textureFloat:o}=r.webgl.extensions;return r.getImagePass({transparentBackground:this.values.transparent,cameraHelper:{axes:this.values.axes},multiSample:{...r.props.multiSample,mode:t?"off":"on",sampleLevel:n&&o?4:2,reuseOcclusion:!1},postprocessing:this.getPostprocessingProps(),marking:{...r.props.marking},illumination:this.getIlluminationProps(t)})}get previewPass(){return this._previewPass||(this._previewPass=this.createPass(!0))}get imagePass(){if(this._imagePass){let t=this.plugin.canvas3d;return this._imagePass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:this.getPostprocessingProps(),marking:{...t.props.marking},illumination:this.getIlluminationProps(!1)}),this._imagePass}return this._imagePass=this.createPass(!1)}getFilename(t){typeof t!="string"&&(t=this.extension);let r=this.plugin.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Model)).map(i=>i.obj.data),n=new Set;return r.forEach(i=>n.add(i.entryId.toUpperCase())),`${So.toArray(n).join("-")||"molstar-image"}${t}`}resetCrop(){this.behaviors.relativeCrop.next({x:0,y:0,width:1,height:1})}toggleAutocrop(){this.cropParams.auto?(this.behaviors.cropParams.next({...this.cropParams,auto:!1}),this.resetCrop()):this.behaviors.cropParams.next({...this.cropParams,auto:!0})}get isFullFrame(){let t=this.relativeCrop;return Lo(t.x,0,1e-5)&&Lo(t.y,0,1e-5)&&Lo(t.width,1,1e-5)&&Lo(t.height,1,1e-5)}autocrop(t=this.cropParams.relativePadding){let{data:r,width:n,height:o}=this.previewData.image,i=this.previewData.transparent,a=i?this.previewData.background:4278190080|this.previewData.background,s=n,l=0,c=o,u=0;for(let p=0;p<o;p++){let h=p*n;for(let g=0;g<n;g++){let y=4*(h+g);if(i){if(r[y+3]===0)continue}else if((r[y]<<16|r[y+1]<<8|r[y+2]|r[y+3]<<24)===a)continue;g<s&&(s=g),g>l&&(l=g),p<c&&(c=p),p>u&&(u=p)}}if(s>l){let p=s;s=l,l=p}if(c>u){let p=c;c=u,u=p}let d=l-s+1,f=u-c+1;s-=t*d,l+=t*d,c-=t*f,u+=t*f;let m={x:Math.max(0,s/n),y:Math.max(0,c/o),width:Math.min(1,(l-s+1)/n),height:Math.min(1,(u-c+1)/o)};this.behaviors.relativeCrop.next(m)}async getPreview(t,r=320){let{width:n,height:o}=this.getSize();if(n<=0||o<=0)return;let i=n/o,a=0,s=0;i>1?(a=r,s=Math.round(r/i)):(s=r,a=Math.round(r*i));let l=this.plugin.canvas3d.props;this.previewPass.setProps({cameraHelper:{axes:this.values.axes},transparentBackground:this.values.transparent,postprocessing:l.postprocessing,marking:l.marking});let c=await this.previewPass.getImageData(t,a,s),u=this.previewCanvas;u.width=c.width,u.height=c.height,this.previewData.image=c,this.previewData.background=l.renderer.backgroundColor,this.previewData.transparent=this.values.transparent;let d=u.getContext("2d");if(!d)throw new Error("Could not create canvas 2d context");return d.putImageData(c,0,0),this.cropParams.auto&&this.autocrop(),this.events.previewed.next(void 0),{canvas:u,width:a,height:s}}getSizeAndViewport(){let{width:t,height:r}=this.getSize(),n=this.relativeCrop,o={x:Math.floor(n.x*t),y:Math.floor(n.y*r),width:Math.ceil(n.width*t),height:Math.ceil(n.height*r)};return o.width+o.x>t&&(o.width=t-o.x),o.height+o.y>r&&(o.height=r-o.y),{width:t,height:r,viewport:o}}async draw(t){let{width:r,height:n,viewport:o}=this.getSizeAndViewport();if(!(r<=0||n<=0)){this.plugin.animationLoop.stop({noDraw:!0});try{await t.update("Rendering image...");let i=this.imagePass;await i.updateBackground();let a=await i.getImageData(t,r,n,o);await t.update("Encoding image...");let s=this.canvas;s.width=a.width,s.height=a.height;let l=s.getContext("2d");if(!l)throw new Error("Could not create canvas 2d context");l.putImageData(a,0,0)}finally{this.plugin.animationLoop.start({immediate:!0})}}}copyToClipboardTask(){let t=navigator.clipboard;if(!t?.write){this.plugin.log.error("clipboard.write not supported!");return}return Me.create("Copy Image",async r=>{await this.draw(r),await r.update("Converting image...");let n=this.mimeType,o=await mB(this.canvas,n,this.quality),i=new ClipboardItem({[n]:o});await t.write([i]),this.plugin.log.message("Image copied to clipboard.")})}get mimeType(){var t,r;return`image/${(r=(t=this.values.format)===null||t===void 0?void 0:t.name)!==null&&r!==void 0?r:"png"}`}get extension(){var t,r,n;switch((t=this.values.format)===null||t===void 0?void 0:t.name){case"jpeg":return".jpg";default:return`.${(n=(r=this.values.format)===null||r===void 0?void 0:r.name)!==null&&n!==void 0?n:"png"}`}}get quality(){var t,r,n,o;switch((t=this.values.format)===null||t===void 0?void 0:t.name){case"webp":case"jpeg":return(o=(n=(r=this.values.format)===null||r===void 0?void 0:r.params)===null||n===void 0?void 0:n.quality)!==null&&o!==void 0?o:.9;default:return}}getImageDataUri(){return this.plugin.runTask(Me.create("Generate Image",async t=>(await this.draw(t),await t.update("Converting image..."),this.canvas.toDataURL(this.mimeType))))}copyToClipboard(){let t=this.copyToClipboardTask();if(t)return this.plugin.runTask(t)}downloadTask(t){return Me.create("Download Image",async r=>{await this.draw(r),await r.update("Downloading image...");let n=await mB(this.canvas,this.mimeType,this.quality);fI(n,t??this.getFilename(this.extension))})}download(t){return this.plugin.runTask(this.downloadTask(t),{useOverlay:!0})}constructor(t){super(),this.plugin=t,this._params=void 0,this.behaviors={values:this.ev.behavior({transparent:this.params.transparent.defaultValue,format:{name:"png",params:{}},axes:{name:"off",params:{}},resolution:this.params.resolution.defaultValue,illumination:this.params.illumination.defaultValue}),cropParams:this.ev.behavior({auto:!0,relativePadding:.1}),relativeCrop:this.ev.behavior({x:0,y:0,width:1,height:1})},this.events={previewed:this.ev()},this.canvas=(function(){return document.createElement("canvas")})(),this.previewCanvas=(function(){return document.createElement("canvas")})(),this.previewData={image:{data:new Uint8ClampedArray(1),width:1,height:0},background:De(0),transparent:!1}}}});function qzt(e,t){let r=t.filter(n=>{let o=n.name.toLowerCase();return o.endsWith(".molx")||o.endsWith(".molj")});r.length>0?St.State.Snapshots.OpenFile(e,{file:r[0]}):e.runTask(e.state.data.applyAction(XB,{files:t.map(n=>Un.File(n)),format:{name:"auto",params:{}},visuals:!0}))}var Hq,uYe=M(()=>{S8();Lm();Ri();Hq=class{addHandler(t,r){let n=this.handlers.findIndex(o=>o[0]===t);n<0?this.handlers.push([t,r]):this.handlers[n][1]=r}removeHandler(t){let r=this.handlers.findIndex(n=>n[0]===t);r>=0&&this.handlers.splice(r,1)}async handle(t){for(let r=this.handlers.length-1;r>=0;r--){let n=this.handlers[r][1];if(await n(t,this.plugin))return}qzt(this.plugin,t)}dispose(){this.handlers.length=0}constructor(t){this.plugin=t,this.handlers=[]}}});var Wq,dYe=M(()=>{Wq=class{constructor(){this.errors=Object.create(null)}get(t){var r;return(r=this.errors[t])!==null&&r!==void 0?r:[]}add(t,r){t in this.errors&&Array.isArray(this.errors[t])?this.errors[t].push(r):this.errors[t]=[r]}clear(t){delete this.errors[t]}}});var Kq,fYe=M(()=>{Kq=class{mount(t){var r;this.parent.parentElement!==t&&((r=this.parent.parentElement)===null||r===void 0||r.removeChild(this.parent)),t.appendChild(this.parent)}unmount(){var t;(t=this.parent.parentElement)===null||t===void 0||t.removeChild(this.parent)}constructor(t){this.options=t;let r=document.createElement("div");Object.assign(r.style,{position:"absolute",left:0,top:0,right:0,bottom:0,"-webkit-user-select":"none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none","touch-action":"manipulation"});let n=t?.canvas;n||(n=document.createElement("canvas"),t?.checkeredCanvasBackground&&Object.assign(n.style,{"background-image":"linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey), linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%, lightgrey)","background-size":"60px 60px","background-position":"0 0, 30px 30px"}),r.appendChild(n)),this.canvas=n,this.parent=r}}});var Yq,mYe=M(()=>{Ab();vb();es();n8();cI();OV();Ge();_Ge();CGe();DGe();FGe();_y();NGe();KGe();doe();YGe();zre();iz();XGe();cz();uoe();fae();xoe();$Ge();QGe();Eo();oYe();joe();yn();hr();By();Ry();Lm();Jr();OD();Fn();hh();dQ();Aa();qx();iYe();fB();_f();Vre();Ri();vu();uI();aYe();sYe();lYe();cYe();dI();h2();uYe();dYe();fYe();Yq=class{get isInitialized(){return this._isInitialized}build(){return this.state.data.build()}async initViewerAsync(t,r,n){return this._initViewer(t,r,n)}async initContainerAsync(t){return this._initContainer(t)}async mountAsync(t,r){return this._mount(t,r)}_initContainer(t){var r;if(this.container)return!0;let n=new Kq({checkeredCanvasBackground:t?.checkeredCanvasBackground,canvas:(r=t?.canvas3dContext)===null||r===void 0?void 0:r.canvas});return this._initViewer(n.canvas,n.parent,t?.canvas3dContext)?(this.container=n,!0):!1}_mount(t,r){var n;if(this.disposed)throw new Error("Cannot mount a disposed context");return this._initContainer(r)?((n=this.container)===null||n===void 0||n.mount(t),this.handleResize(),!0):!1}unmount(){var t;(t=this.container)===null||t===void 0||t.unmount()}_initViewer(t,r,n){var o,i,a,s,l,c;try{this.layout.setRoot(r),this.spec.layout&&this.spec.layout.initial&&this.layout.setProps(this.spec.layout.initial),n||(n=bh.fromCanvas(t,this.managers.asset,{antialias:!((o=this.config.get(on.General.DisableAntialiasing))!==null&&o!==void 0&&o),preserveDrawingBuffer:!((i=this.config.get(on.General.DisablePreserveDrawingBuffer))!==null&&i!==void 0&&i),preferWebGl1:this.config.get(on.General.PreferWebGl1)||!1,failIfMajorPerformanceCaveat:!((a=this.config.get(on.General.AllowMajorPerformanceCaveat))!==null&&a!==void 0&&a),powerPreference:this.config.get(on.General.PowerPreference)||"high-performance",handleResize:this.handleResize},{pixelScale:this.config.get(on.General.PixelScale)||1,pickScale:this.config.get(on.General.PickScale)||.25,transparency:this.config.get(on.General.Transparency)||"wboit",resolutionMode:this.config.get(on.General.ResolutionMode)||"auto"})),this.canvas3dContext=n,this.canvas3d=BV.create(this.canvas3dContext),this.canvas3dInit.next(!0);let u=this.spec.canvas3d,d=De(16579577);return u?(((l=u.renderer)===null||l===void 0?void 0:l.backgroundColor)===void 0&&(u=Vu(u,f=>{f.renderer?f.renderer.backgroundColor=d:f.renderer={backgroundColor:d}})),(c=this.canvas3d)===null||c===void 0||c.setProps(u)):(s=this.canvas3d)===null||s===void 0||s.setProps({renderer:{backgroundColor:d}}),this.animationLoop.start(),this.helpers.viewportScreenshot=new Gq(this),this.subs.push(this.canvas3d.interaction.click.subscribe(f=>this.behaviors.interaction.click.next(f))),this.subs.push(this.canvas3d.interaction.drag.subscribe(f=>this.behaviors.interaction.drag.next(f))),this.subs.push(this.canvas3d.interaction.hover.subscribe(f=>this.behaviors.interaction.hover.next(f))),this.subs.push(this.canvas3d.input.resize.pipe(zx(50),Sd(100,void 0,{leading:!1,trailing:!0})).subscribe(()=>this.handleResize())),this.subs.push(this.canvas3d.input.keyDown.subscribe(f=>this.behaviors.interaction.key.next(f))),this.subs.push(this.canvas3d.input.keyUp.subscribe(f=>this.behaviors.interaction.keyReleased.next(f))),this.subs.push(this.canvas3d.xr.isPresenting.subscribe(f=>this.log.info(`WebXR ${f?"enabled":"disabled"}`))),this.subs.push(this.canvas3d.xr.requestFailed.subscribe(f=>this.log.error(`WebXR request failed: ${f}`))),this.subs.push(this.layout.events.updated.subscribe(()=>requestAnimationFrame(()=>this.handleResize()))),this.handleResize(),rg.setImmediate(()=>this.initCanvas3dPromiseCallbacks[0]()),!0}catch(u){return this.log.error(""+u),console.error(u),rg.setImmediate(()=>this.initCanvas3dPromiseCallbacks[1](u)),!1}}get isBusy(){return this.behaviors.state.isAnimating.value||this.behaviors.state.isUpdating.value}get selectionMode(){return this.behaviors.interaction.selectionMode.value}set selectionMode(t){this.behaviors.interaction.selectionMode.next(t)}dataTransaction(t,r){return this.runTask(this.state.data.transaction(t,r))}clear(t=!1){var r;return t&&((r=this.canvas3d)===null||r===void 0||r.setProps(uB)),St.State.RemoveObject(this,{state:this.state.data,ref:Ur.RootRef})}dispose(t){var r,n;if(!this.disposed){for(let o of this.subs)o.unsubscribe();this.subs=[],this.managers.markdownExtensions.audio.dispose(),this.animationLoop.stop(),this.commands.dispose(),(r=this.canvas3d)===null||r===void 0||r.dispose(),t?.doNotDisposeCanvas3DContext||(n=this.canvas3dContext)===null||n===void 0||n.dispose(t),this.ev.dispose(),this.state.dispose(),this.helpers.substructureParent.dispose(),pa(this.managers,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),pa(this.managers.structure,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),pa(this.managers.volume,o=>{var i;return(i=o?.dispose)===null||i===void 0?void 0:i.call(o)}),this.unmount(),this.container=void 0,this.customState={},this.disposed=!0}}initBehaviorEvents(){this.subs.push(xd(this.state.data.behaviors.isUpdating,this.state.behaviors.behaviors.isUpdating).subscribe(a=>{this.behaviors.state.isUpdating.value!==a&&this.behaviors.state.isUpdating.next(a)}));let t=this.config.get(on.General.IsBusyTimeoutMs)||750,r=this.behaviors.state.isBusy,n,o=()=>{r.value||r.next(!0)},i=()=>{n!==void 0&&clearTimeout(n),n=void 0};this.subs.push(xd(this.behaviors.state.isUpdating,this.behaviors.state.isAnimating).subscribe(a=>{let s=this.behaviors.state.isUpdating.value,l=this.behaviors.state.isAnimating.value;s||l?r.value||(i(),n=setTimeout(o,t)):(i(),r.next(!1))})),this.subs.push(this.behaviors.interaction.selectionMode.subscribe(a=>{var s;a||(s=this.managers.interactivity)===null||s===void 0||s.lociSelects.deselectAll()}))}initBuiltInBehavior(){vB.State.registerDefault(this),vB.Representation.registerDefault(this),vB.Camera.registerDefault(this),vB.Misc.registerDefault(this),this.subs.push(xd(this.state.data.events.log,this.state.behaviors.events.log).subscribe(t=>this.events.log.next(t)))}async initBehaviors(){let t=this.state.behaviors.build();for(let r of Object.keys(cn.Categories))t.toRoot().apply(cn.CreateCategory,{label:cn.Categories[r]},{ref:r,state:{isLocked:!0}});for(let r of this.spec.behaviors)cn.getCategoryId(r.transformer)==="custom-props"&&t.to(cn.getCategoryId(r.transformer)).apply(r.transformer,r.defaultParams,{ref:r.transformer.id});await this.runTask(this.state.behaviors.updateTree(t,{doNotUpdateCurrent:!0,doNotLogTiming:!0})),t=this.state.behaviors.build();for(let r of this.spec.behaviors)cn.getCategoryId(r.transformer)!=="custom-props"&&t.to(cn.getCategoryId(r.transformer)).apply(r.transformer,r.defaultParams,{ref:r.transformer.id});await this.runTask(this.state.behaviors.updateTree(t,{doNotUpdateCurrent:!0,doNotLogTiming:!0}))}initCustomFormats(){if(this.spec.customFormats)for(let t of this.spec.customFormats)this.dataFormats.add(t[0],t[1])}initAnimations(){if(this.spec.animations)for(let t of this.spec.animations)this.managers.animation.register(t)}initDataActions(){if(this.spec.actions)for(let t of this.spec.actions)this.state.data.actions.add(t.action)}async init(){try{this.subs.push(this.events.log.subscribe(t=>this.log.entries=this.log.entries.push(t))),this.initCustomFormats(),this.initBehaviorEvents(),this.initBuiltInBehavior(),this.managers.interactivity=new FS(this),this.managers.lociLabels=new B8(this),this.builders.structure=new I8(this),this.initAnimations(),this.initDataActions(),await this.initBehaviors(),this.log.message(`Mol* Plugin ${Hy} [${_Ue.toLocaleString()}]`),q1||this.log.message("Development mode enabled"),lr&&this.log.message("Debug mode enabled"),this._isInitialized=!0,this.initializedPromiseCallbacks[0]()}catch(t){throw this.initializedPromiseCallbacks[1](t),t}}constructor(t){var r;this.spec=t,this.runTask=(n,o)=>this.managers.task.run(n,o),this.resolveTask=n=>{if(n)return Me.is(n)?this.runTask(n):n},this.subs=[],this.initCanvas3dPromiseCallbacks=[()=>{},()=>{}],this._isInitialized=!1,this.initializedPromiseCallbacks=[()=>{},()=>{}],this.disposed=!1,this.container=void 0,this.ev=_d.create(),this.config=new hU(this.spec.config),this.state=new Su(this),this.commands=new RV,this.canvas3dInit=this.ev.behavior(!1),this.behaviors={state:{isAnimating:this.ev.behavior(!1),isUpdating:this.ev.behavior(!1),isBusy:this.ev.behavior(!1)},interaction:{hover:this.ev.behavior({current:Zt.Loci.Empty,modifiers:_l.None,buttons:0,button:0}),click:this.ev.behavior({current:Zt.Loci.Empty,modifiers:_l.None,buttons:0,button:0}),drag:this.ev.behavior({current:Zt.Loci.Empty,modifiers:_l.None,buttons:0,button:0,pageStart:Ce(),pageEnd:Ce()}),key:this.ev.behavior(gre),keyReleased:this.ev.behavior(gre),selectionMode:this.ev.behavior(!1)},labels:{highlight:this.ev.behavior({labels:[]})},layout:{leftPanelTabName:this.ev.behavior("root")},canvas3d:{initialized:this.canvas3dInit.pipe(oy(n=>!!n),G$(1))}},this.canvas3dInitialized=new Promise((n,o)=>{this.initCanvas3dPromiseCallbacks=[n,o]}),this.initialized=new Promise((n,o)=>{this.initializedPromiseCallbacks=[n,o]}),this.layout=new F8(this),this.animationLoop=new zq(this),this.representation={structure:{registry:new D3,themes:{colorThemeRegistry:Ws.createRegistry(),sizeThemeRegistry:Yo.createRegistry()}},volume:{registry:new GS,themes:{colorThemeRegistry:Ws.createRegistry(),sizeThemeRegistry:Yo.createRegistry()}}},this.query={structure:{registry:new fU}},this.dataFormats=new E8,this.builders={data:new C8(this),structure:void 0},this.helpers={substructureParent:new qq(this),viewportScreenshot:void 0},this.managers={structure:{hierarchy:new ev(this),component:new _h(this),measurement:new pz(this),selection:new R8(this),focus:new O8(this)},volume:{hierarchy:new US(this)},interactivity:void 0,camera:new M8(this),animation:new D8(this),snapshot:new Xg(this),lociLabels:void 0,toast:new jq(this),asset:new TL,task:new k3,markdownExtensions:new L8(this),dragAndDrop:new Hq(this)},this.events={log:this.ev(),task:this.managers.task.events,canvas3d:{settingsUpdated:this.ev()}},this.customModelProperties=new ZB.Registry,this.customStructureProperties=new ZB.Registry,this.customStructureControls=new Map,this.customImportControls=new Map,this.genericRepresentationControls=new Map,this.errorContext=new Wq,this.customState=Object.create(null),this.handleResize=()=>{var n,o;let i=(n=this.canvas3dContext)===null||n===void 0?void 0:n.canvas,a=this.layout.root;a&&i&&(CUe(i,a,this.canvas3dContext.pixelScale),this.canvas3dContext.syncPixelScale(),(o=this.canvas3d)===null||o===void 0||o.requestResize())},this.log={entries:ry(),entry:n=>this.events.log.next(n),error:n=>this.events.log.next(Kp.error(n)),message:n=>this.events.log.next(Kp.message(n)),info:n=>this.events.log.next(Kp.info(n)),warn:n=>this.events.log.next(Kp.warning(n))},this.fetch=RD,phe((r=this.config.get(on.Structure.SaccharideCompIdMapType))!==null&&r!==void 0?r:"default")}}});var Xq,pYe=M(()=>{mYe();Xq=class extends Yq{initCustomParamEditors(){if(this.spec.customParamEditors)for(let[t,r]of this.spec.customParamEditors)this.customParamEditors.set(t.id,r)}dispose(t){super.dispose(t),this.layout.dispose()}constructor(t){super(t),this.spec=t,this.customParamEditors=new Map,this.customUIState={},this.initCustomParamEditors()}}});var hYe,gYe=M(()=>{ES();_o();Da();yn();Ri();Ue();hYe=Wu.create({name:"built-in.animate-assembly-unwind",display:{name:"Unwind Assembly"},isExportable:!0,params:e=>{let t=[["all","All"]],r=e.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Structure));for(let n of r)t.push([n.transform.ref,n.obj.data.models[0].label]);return{durationInMs:_.Numeric(3e3,{min:100,max:1e4,step:100}),playOnce:_.Boolean(!1),target:_.Select(t[0][0],t)}},canApply(e){let t=e.state.data,r=Ur.RootRef;return{canApply:t.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3D,r)).length>0}},getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),initialState:()=>({t:0}),setup(e,t,r){let n=r.state.data,o=!e.target||e.target==="all"?Ur.RootRef:e.target,i=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3D,o)),a=n.build(),s=!1;for(let l of i)n.select(ir.Generators.ofTransformer(Je.Representation.UnwindStructureAssemblyRepresentation3D,l.transform.ref)).length>0||(s=!0,a.to(l).apply(Je.Representation.UnwindStructureAssemblyRepresentation3D,{t:0},{tags:"animate-assembly-unwind"}));if(s)return a.commit({doNotUpdateCurrent:!0})},teardown(e,t,r){let n=r.state.data,o=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3DState).withTag("animate-assembly-unwind"));if(o.length===0)return;let i=n.build();for(let a of o)i.delete(a.transform.ref);return i.commit()},async apply(e,t,r){let n=r.plugin.state.data,o=!r.params.target||r.params.target==="all"?Ur.RootRef:r.params.target,i=n.select(ir.Generators.ofTransformer(Je.Representation.UnwindStructureAssemblyRepresentation3D,o));if(i.length===0)return{kind:"finished"};let a=n.build(),s=(t.current-t.lastApplied)/r.params.durationInMs,l=e.t+s,c=!1;r.params.playOnce&&l>=1?(c=!0,l=1):l=l%1;for(let u of i)a.to(u).update({t:l});return await St.State.Update(r.plugin,{state:n,tree:a,options:{doNotLogTiming:!0}}),c?{kind:"finished"}:{kind:"next",state:{t:l}}}})});var Zq,yYe,vYe,bYe,xYe=M(()=>{sa();M1();$i();Ue();ES();Zq=v(),yYe=v(),vYe=Kr(),bYe=Wu.create({name:"built-in.animate-camera-spin",display:{name:"Camera Spin",description:"Spin the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:_.Numeric(4e3,{min:100,max:2e4,step:100}),speed:_.Numeric(1,{min:1,max:10,step:1},{description:"How many times to spin in the specified duration."}),direction:_.Select("cw",[["cw","Clockwise"],["ccw","Counter Clockwise"]],{cycle:!0})}),initialState:(e,t)=>{var r;return{snapshot:(r=t.canvas3d)===null||r===void 0?void 0:r.camera.getSnapshot()}},getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),teardown:(e,t,r)=>{var n;(n=r.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t.snapshot,durationMs:0})},async apply(e,t,r){var n,o;if(t.current===0)return{kind:"next",state:e};let i=e.snapshot;if(i.radiusMax<1e-4)return{kind:"finished"};let a=t.animation?((n=t.animation)===null||n===void 0?void 0:n.currentFrame)/(t.animation.frameCount+1):en(t.current/r.params.durationInMs,0,1),s=2*Math.PI*a*r.params.speed*(r.params.direction==="ccw"?-1:1);v.sub(Zq,i.position,i.target),v.normalize(yYe,i.up),Kr.setAxisAngle(vYe,yYe,s),v.transformQuat(Zq,Zq,vYe);let l=v.add(v(),i.target,Zq);return(o=r.plugin.canvas3d)===null||o===void 0||o.requestCameraReset({snapshot:{...i,position:l},durationMs:0}),a>=.99999?{kind:"finished"}:{kind:"next",state:e}}})});var SYe,_Ye=M(()=>{Ri();yn();Ue();_o();Da();ES();SYe=Wu.create({name:"built-in.animate-model-index",display:{name:"Animate Trajectory"},isExportable:!0,params:()=>({mode:_.MappedStatic("loop",{palindrome:_.Group({}),loop:_.Group({direction:_.Select("forward",[["forward","Forward"],["backward","Backward"]])}),once:_.Group({direction:_.Select("forward",[["forward","Forward"],["backward","Backward"]])},{isFlat:!0})},{options:[["palindrome","Palindrome"],["loop","Loop"],["once","Once"]]}),duration:_.MappedStatic("fixed",{fixed:_.Group({durationInS:_.Numeric(5,{min:1,max:120,step:.1},{description:"Duration in seconds"})},{isFlat:!0}),computed:_.Group({targetFps:_.Numeric(30,{min:5,max:250,step:1},{label:"Target FPS"})},{isFlat:!0}),sequential:_.Group({maxFps:_.Numeric(30,{min:5,max:60,step:1})},{isFlat:!0})})}),canApply(e){let t=e.state.data,r=t.select(ir.Generators.ofTransformer(Je.Model.ModelFromTrajectory));for(let n of r){let o=ir.findAncestorOfType(t.tree,t.cells,n.transform.ref,ue.Molecule.Trajectory);if(o&&o.obj&&o.obj.data.frameCount>1)return{canApply:!0}}return{canApply:!1,reason:"No trajectory to animate"}},getDuration:(e,t)=>{var r;if(((r=e.duration)===null||r===void 0?void 0:r.name)==="fixed")return{kind:"fixed",durationMs:e.duration.params.durationInS*1e3};if(e.duration.name==="computed"){let n=t.state.data,o=n.select(ir.Generators.ofTransformer(Je.Model.ModelFromTrajectory)),i=0;for(let a of o){let s=ir.findAncestorOfType(n.tree,n.cells,a.transform.ref,ue.Molecule.Trajectory);if(!s||!s.obj)continue;let l=s.obj;i=Math.max(Math.ceil(1e3*l.data.frameCount/e.duration.params.targetFps),i)}return{kind:"fixed",durationMs:i}}return{kind:"unknown"}},initialState:()=>({}),async apply(e,t,r){if(r.params.duration.name==="sequential"&&t.current>0&&t.current-t.lastApplied<1e3/r.params.duration.params.maxFps)return{kind:"skip"};let n=r.plugin.state.data,o=n.select(ir.Generators.ofTransformer(Je.Model.ModelFromTrajectory));if(o.length===0)return{kind:"finished"};let i=n.build(),a=r.params,s=e.palindromeDirections||{},l=!1,c=!0;for(let u of o){let d=ir.findAncestorOfType(n.tree,n.cells,u.transform.ref,ue.Molecule.Trajectory);if(!d||!d.obj)continue;let f=d.obj;f.data.frameCount<=1||i.to(u).update(m=>{let p=f.data.frameCount;if(p!==1)c=!1;else return m;if(a.duration.name==="sequential"){let h=1;if(a.mode.name==="once"){if(h=a.mode.params.direction==="backward"?-1:1,h===-1&&m.modelIndex===0||h===1&&m.modelIndex===p-1)return l=!0,m}else a.mode.name==="palindrome"&&(m.modelIndex===0?h=1:m.modelIndex===p-1?h=-1:h=s[u.transform.ref]||1);s[u.transform.ref]=h;let g=(m.modelIndex+h)%p;return g<0&&(g+=p),l=l||h===-1&&g===0||h===1&&g===p-1,{modelIndex:g}}else{let h=a.duration.name==="fixed"?a.duration.params.durationInS*1e3:Math.ceil(1e3*f.data.frameCount/a.duration.params.targetFps);if(a.mode.name==="once"&&t.current>=h)return l=!0,{modelIndex:f.data.frameCount-1};let g=t.current%h/h;return a.mode.name==="loop"&&a.mode.params.direction==="backward"&&(g=1-g),a.mode.name==="palindrome"&&(g=2*g,g>1&&(g=2-g)),{modelIndex:Math.min(Math.floor(f.data.frameCount*g),f.data.frameCount-1)}}})}return c||await St.State.Update(r.plugin,{state:n,tree:i,options:{doNotLogTiming:!0}}),c||a.mode.name==="once"&&l?{kind:"finished"}:a.mode.name==="palindrome"?{kind:"next",state:{palindromeDirections:s}}:{kind:"next",state:{}}}})});var Gse={};ci(Gse,{AssignColorVolume:()=>jse,DownloadDensity:()=>jzt});var jzt,jse,Hse=M(()=>{yn();hr();SB();Ue();_o();Lm();Da();Oo();jzt=nc.build({from:ue.Root,display:{name:"Download Density",description:"Load a density from the provided source and create its default visual."},params:(e,t)=>{let{options:r}=t.dataFormats;return{source:_.MappedStatic("pdb-xray",{"pdb-xray":_.Group({provider:_.Group({id:_.Text("1tqn",{label:"Id"}),server:_.Select("pdbe",[["pdbe","PDBe"]])},{pivot:"id"}),type:_.Select("2fofc",[["2fofc","2Fo-Fc"],["fofc","Fo-Fc"]])},{isFlat:!0}),"pdb-xray-ds":_.Group({provider:_.Group({id:_.Text("1tqn",{label:"Id"}),server:_.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:_.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),"pdb-emd-ds":_.Group({provider:_.Group({id:_.Text("emd-8004",{label:"Id"}),server:_.Select("pdbe",[["pdbe","PDBe"],["rcsb","RCSB PDB"]])},{pivot:"id"}),detail:_.Numeric(3,{min:0,max:6,step:1},{label:"Detail"})},{isFlat:!0}),url:_.Group({url:_.Url(""),isBinary:_.Boolean(!1),format:_.Select("auto",r)},{isFlat:!0})},{options:[["pdb-xray","PDB X-ray maps"],["pdb-emd-ds","PDB EMD Density Server"],["pdb-xray-ds","PDB X-ray Density Server"],["url","URL"]]})}}})(({params:e},t)=>Me.create("Download Density",async r=>{var n,o;let i=e.source,a,s;switch(i.name){case"url":a=i.params;break;case"pdb-xray":a={url:Un.Url(i.params.type==="2fofc"?`https://www.ebi.ac.uk/pdbe/coordinates/files/${i.params.provider.id.toLowerCase()}.ccp4`:`https://www.ebi.ac.uk/pdbe/coordinates/files/${i.params.provider.id.toLowerCase()}_diff.ccp4`),isBinary:!0,label:`PDBe X-ray map: ${i.params.provider.id}`};break;case"pdb-emd-ds":a=i.params.provider.server==="pdbe"?{url:Un.Url(`https://www.ebi.ac.uk/pdbe/densities/emd/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`PDBe EMD Density Server: ${i.params.provider.id}`}:{url:Un.Url(`https://maps.rcsb.org/em/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`RCSB PDB EMD Density Server: ${i.params.provider.id}`};break;case"pdb-xray-ds":a=i.params.provider.server==="pdbe"?{url:Un.Url(`https://www.ebi.ac.uk/pdbe/densities/x-ray/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`PDBe X-ray Density Server: ${i.params.provider.id}`}:{url:Un.Url(`https://maps.rcsb.org/x-ray/${i.params.provider.id.toLowerCase()}/cell?detail=${i.params.detail}`),isBinary:!0,label:`RCSB PDB X-ray Density Server: ${i.params.provider.id}`};break;default:Er(i)}let l=await t.builders.data.download(a),c;switch(i.name){case"url":a=i.params,s=i.params.format==="auto"?t.dataFormats.auto(Qb(Un.getUrl(a.url)),(n=l.cell)===null||n===void 0?void 0:n.obj):t.dataFormats.get(i.params.format);break;case"pdb-xray":c=i.params.provider.id,s=t.dataFormats.get("ccp4");break;case"pdb-emd-ds":case"pdb-xray-ds":c=i.params.provider.id,s=t.dataFormats.get("dscif");break;default:Er(i)}if(!s){t.log.warn("DownloadDensity: Format provider not found.");return}let u=await s.parse(t,l,{entryId:c});await((o=s.visuals)===null||o===void 0?void 0:o.call(s,t,u))})),jse=nc.build({display:{name:"Assign Volume Colors",description:"Assigns another volume to be available for coloring."},from:ue.Volume.Data,isApplicable(e){return!e.data.colorVolume},params(e,t){let r=t.state.data.select(ir.Generators.root.subtree().ofType(ue.Volume.Data).filter(n=>{var o;return!!n.obj&&!(!((o=n.obj)===null||o===void 0)&&o.data.colorVolume)&&n.obj!==e}));return r.length===0?{ref:_.Text("",{isHidden:!0,label:"Volume"})}:{ref:_.Select(r[0].transform.ref,r.map(n=>[n.transform.ref,n.obj.label]),{label:"Volume"})}}})(({ref:e,params:t,state:r},n)=>n.build().to(e).apply(Je.Volume.AssignColorVolume,{ref:t.ref},{dependsOn:[t.ref]}).commit())});var s_,CYe=M(()=>{bne();Hse();S8();s_={Structure:vne,Volume:Gse,DataFormat:eae}});var wYe,TYe=M(()=>{Ri();yn();Vt();Ue();ES();wYe=Wu.create({name:"built-in.animate-state-interpolation",display:{name:"Animate State (experimental)"},params:()=>({transtionDurationInMs:_.Numeric(2e3,{min:100,max:3e4,step:10})}),canApply(e){return{canApply:e.managers.snapshot.state.entries.size>1}},initialState:()=>({}),async apply(e,t,r){let n=r.plugin.managers.snapshot.state.entries;if(n.size<2)return{kind:"finished"};let o=t.current%r.params.transtionDurationInMs/r.params.transtionDurationInMs,i=Math.floor(t.current/r.params.transtionDurationInMs)%n.size,a=Math.ceil(t.current/r.params.transtionDurationInMs);a===i&&a++,a=a%n.size;let s=n.get(i).snapshot,l=n.get(a).snapshot;if(!s.data||!l.data)return{kind:"skip"};let c=s.data.tree.transforms,u=l.data.tree.transforms,d=r.plugin.state.data,f=d.build();for(let m of c)for(let p of u){if(p.ref!==m.ref||p.version===m.version)continue;let h=Ur.fromJSON(m),g=Ur.fromJSON(p),y=d.cells.get(m.ref);if(!y)continue;let b;h.transformer.definition.interpolate?b=h.transformer.definition.interpolate(h.params,g.params,o,r.plugin):b=o<=.5?h.params:g.params,Hv(y,b)||f.to(m.ref).update(b)}return await St.State.Update(r.plugin,{state:d,tree:f,options:{doNotLogTiming:!0}}),{kind:"next",state:{}}}})});var AYe,PYe=M(()=>{Ri();yn();Ue();_o();Da();ES();AYe=Wu.create({name:"built-in.animate-structure-spin",display:{name:"Spin Structure"},isExportable:!0,params:()=>({durationInMs:_.Numeric(3e3,{min:100,max:1e4,step:100})}),initialState:()=>({t:0}),getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),async setup(e,t,r){let n=r.state.data,o=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3D)),i=n.build(),a=!1;for(let s of o)n.select(ir.Generators.ofTransformer(Je.Representation.SpinStructureRepresentation3D,s.transform.ref)).length>0||(a=!0,i.to(s.transform.ref).apply(Je.Representation.SpinStructureRepresentation3D,{t:0},{tags:"animate-structure-spin"}));if(a)return i.commit({doNotUpdateCurrent:!0})},teardown(e,t,r){let n=r.state.data,o=n.select(ir.Generators.ofType(ue.Molecule.Structure.Representation3DState).withTag("animate-structure-spin"));if(o.length===0)return;let i=n.build();for(let a of o)i.delete(a.transform.ref);return i.commit()},async apply(e,t,r){var n;let o=r.plugin.state.data,i=o.select(ir.Generators.ofTransformer(Je.Representation.SpinStructureRepresentation3D));if(i.length===0)return{kind:"finished"};let a=o.build(),s=(t.current-t.lastApplied)/r.params.durationInMs,l=(e.t+s)%1;for(let c of i)a.to(c).update({...(n=c.params)===null||n===void 0?void 0:n.values,t:l});return await St.State.Update(r.plugin,{state:o,tree:a,options:{doNotLogTiming:!0}}),{kind:"next",state:{t:l}}}})});var $q,IYe,EYe,DYe,kYe=M(()=>{sa();M1();$i();la();Ue();ES();$q=v(),IYe=v(),EYe=Kr(),DYe=Wu.create({name:"built-in.animate-camera-rock",display:{name:"Camera Rock",description:"Rock the 3D scene around the x-axis in view space"},isExportable:!0,params:()=>({durationInMs:_.Numeric(4e3,{min:100,max:2e4,step:100}),speed:_.Numeric(1,{min:1,max:10,step:1},{description:"How many times to rock from side to side."}),angle:_.Numeric(10,{min:0,max:180,step:1},{description:"How many degrees to rotate in each direction."})}),initialState:(e,t)=>({snapshot:t.canvas3d.camera.getSnapshot()}),getDuration:e=>({kind:"fixed",durationMs:e.durationInMs}),teardown:(e,t,r)=>{var n;(n=r.canvas3d)===null||n===void 0||n.requestCameraReset({snapshot:t.snapshot,durationMs:0})},async apply(e,t,r){var n,o;if(t.current===0)return{kind:"next",state:e};let i=e.snapshot;if(i.radiusMax<1e-4)return{kind:"finished"};let a=t.animation?((n=t.animation)===null||n===void 0?void 0:n.currentFrame)/(t.animation.frameCount+1):en(t.current/r.params.durationInMs,0,1),s=Math.sin(a*r.params.speed*Math.PI*2)*zr(r.params.angle);v.sub($q,i.position,i.target),v.normalize(IYe,i.up),Kr.setAxisAngle(EYe,IYe,s),v.transformQuat($q,$q,EYe);let l=v.add(v(),i.target,$q);return(o=r.plugin.canvas3d)===null||o===void 0||o.requestCameraReset({snapshot:{...i,position:l},durationMs:0}),a>=.99999?{kind:"finished"}:{kind:"next",state:e}}})});var qr,MYe,Wse=M(()=>{gYe();xYe();_Ye();dB();fB();jV();CYe();Hse();Da();Rz();TYe();PYe();kYe();(function(e){function t(n,o){return{action:n,customControl:o&&o.customControl,autoUpdate:o&&o.autoUpdate}}e.Action=t;function r(n,o={}){return{transformer:n,defaultParams:o}}e.Behavior=r})(qr||(qr={}));MYe=()=>({actions:[qr.Action(s_.Structure.DownloadStructure),qr.Action(s_.Volume.DownloadDensity),qr.Action(s_.DataFormat.DownloadFile),qr.Action(s_.DataFormat.OpenFiles),qr.Action(s_.Structure.LoadTrajectory),qr.Action(s_.Structure.EnableModelCustomProps),qr.Action(s_.Structure.EnableStructureCustomProps),qr.Action(LB),qr.Action(pqe),qr.Action(FB),qr.Action(Je.Data.Download),qr.Action(Je.Data.ParseCif),qr.Action(Je.Data.ParseCcp4),qr.Action(Je.Data.ParseDsn6),qr.Action(Je.Model.TrajectoryFromMmCif),qr.Action(Je.Model.TrajectoryFromCifCore),qr.Action(Je.Model.TrajectoryFromPDB),qr.Action(Je.Model.TransformStructureConformation),qr.Action(Je.Model.StructureInstances),qr.Action(Je.Model.StructureFromModel),qr.Action(Je.Model.StructureFromTrajectory),qr.Action(Je.Model.ModelFromTrajectory),qr.Action(Je.Model.StructureSelectionFromScript),qr.Action(Je.Representation.StructureRepresentation3D),qr.Action(Je.Representation.StructureSelectionsDistance3D),qr.Action(Je.Representation.StructureSelectionsAngle3D),qr.Action(Je.Representation.StructureSelectionsDihedral3D),qr.Action(Je.Representation.StructureSelectionsLabel3D),qr.Action(Je.Representation.StructureSelectionsOrientation3D),qr.Action(Je.Representation.ModelUnitcell3D),qr.Action(Je.Representation.StructureBoundingBox3D),qr.Action(Je.Representation.ExplodeStructureRepresentation3D),qr.Action(Je.Representation.SpinStructureRepresentation3D),qr.Action(Je.Representation.UnwindStructureAssemblyRepresentation3D),qr.Action(Je.Representation.OverpaintStructureRepresentation3DFromScript),qr.Action(Je.Representation.TransparencyStructureRepresentation3DFromScript),qr.Action(Je.Representation.ClippingStructureRepresentation3DFromScript),qr.Action(Je.Representation.SubstanceStructureRepresentation3DFromScript),qr.Action(Je.Representation.ThemeStrengthRepresentation3D),qr.Action(jse),qr.Action(Je.Volume.VolumeFromCcp4),qr.Action(Je.Volume.VolumeFromDsn6),qr.Action(Je.Volume.VolumeFromCube),qr.Action(Je.Volume.VolumeFromDx),qr.Action(Je.Representation.VolumeRepresentation3D),qr.Action(Je.Volume.VolumeTransform),qr.Action(Je.Volume.VolumeInstances)],behaviors:[qr.Behavior(Od.Representation.HighlightLoci),qr.Behavior(Od.Representation.SelectLoci),qr.Behavior(Od.Representation.DefaultLociLabelProvider),qr.Behavior(Od.Representation.FocusLoci),qr.Behavior(Od.Camera.FocusLoci),qr.Behavior(Od.Camera.CameraAxisHelper),qr.Behavior(Od.Camera.CameraControls),qr.Behavior(Od.State.SnapshotControls),qr.Behavior(GC),qr.Behavior(Od.CustomProps.StructureInfo),qr.Behavior(Od.CustomProps.AccessibleSurfaceArea),qr.Behavior(Od.CustomProps.BestDatabaseSequenceMapping),qr.Behavior(Od.CustomProps.Interactions),qr.Behavior(Od.CustomProps.SecondaryStructure),qr.Behavior(Od.CustomProps.ValenceModel),qr.Behavior(Od.CustomProps.CrossLinkRestraint)],animations:[SYe,bYe,DYe,SUe,kS,hYe,AYe,wYe]})});var Vd,Gzt,Hzt,M3,Qq,BYe=M(()=>{Vd=et(gn());Vi();IB();Ea();Ue();Fd();XV();gl();Ge();ya();rb();yn();mI();ha();Gzt={color:_.Color(mr.black,{description:"Display color of the volume."}),wireframe:_.Boolean(!1,{description:"Control display of the volume as a wireframe."}),opacity:_.Numeric(.3,{min:0,max:1,step:.01},{description:"Opacity of the volume."})},Hzt=new Map([["em",[-5,5]],["2fo-fc",[0,3]],["fo-fc(+ve)",[1,5]],["fo-fc(-ve)",[-5,-1]]]),M3=class extends Vr{constructor(){super(...arguments),this.ref=ir.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name),this.getVisible=()=>{let t=this.plugin.state.data,r=this.ref;return r?!t.cells.get(r).state.isHidden:!1},this.toggleVisible=()=>{let t=this.plugin.state.data,r=this.ref;r&&Zg(t,r,!t.cells.get(r).state.isHidden)}}componentDidUpdate(){this.ref=ir.findTagInSubtree(this.plugin.state.data.tree,this.props.bCell.transform.ref,this.props.name)}componentDidMount(){this.subscribe(this.plugin.state.data.events.cell.stateUpdated,t=>{this.ref===t.ref&&this.forceUpdate()})}render(){let t=this.props,{isRelative:r,stats:n}=t,o=t.channels[t.name],{min:i,max:a,mean:s,sigma:l}=n,c=Math.round(100*(o.isoValue.kind==="relative"?o.isoValue.relativeValue:o.isoValue.absoluteValue))/100,u=(i-s)/l,d=(a-s)/l;if(!this.props.isUnbounded){let y=Hzt.get(this.props.name);this.props.name==="em"?(u=Math.max(y[0],u),d=Math.min(y[1],d)):(u=y[0],d=y[1])}let f=s+l*u,m=s+l*d,p=hD(r?Math.round((m-f)/l)/100:l/100,2),h=r?u:f,g=r?d:m;return(0,Vd.jsx)(LF,{label:t.label+(t.isRelative?" \u03C3":""),colorStripe:o.color,pivot:(0,Vd.jsxs)("div",{className:"msp-volume-channel-inline-controls",children:[(0,Vd.jsx)(LS,{value:c,min:h,max:g,step:p,onChange:y=>t.changeIso(t.name,y,r),onChangeImmediate:y=>t.changeIso(t.name,y,r),disabled:t.params.isDisabled,onEnter:t.params.events.onEnter}),(0,Vd.jsx)(yr,{svg:this.getVisible()?Wf:Gm,onClick:this.toggleVisible,toggleState:!1,disabled:t.params.isDisabled})]}),controls:(0,Vd.jsx)(xo,{onChange:({name:y,value:b})=>t.changeParams(t.name,y,b),params:Gzt,values:o,onEnter:t.params.events.onEnter,isDisabled:t.params.isDisabled})})}},Qq=class extends Vr{constructor(){super(...arguments),this.changeIso=(t,r,n)=>{let o=this.props.params;this.newParams({...o,entry:{name:o.entry.name,params:{...o.entry.params,channels:{...o.entry.params.channels,[t]:{...o.entry.params.channels[t],isoValue:n?We.IsoValue.relative(r):We.IsoValue.absolute(r)}}}}})},this.changeParams=(t,r,n)=>{let o=this.props.params;this.newParams({...o,entry:{name:o.entry.name,params:{...o.entry.params,channels:{...o.entry.params.channels,[t]:{...o.entry.params.channels[t],[r]:n}}}}})},this.changeOption=({name:t,value:r})=>{let n=this.props.params;if(t==="entry")this.newParams({...n,entry:{name:r,params:n.entry.params}});else{let o=this.props.b.data,i=o.info.kind==="em",a=r.params.isRelative,s=o.info.header.sampling[0],l=n.entry.params.channels,u={...n.entry.params.view.name===r.name?n.entry.params.view.params:this.props.info.params.entry.map(n.entry.name).params.view.map(r.name).defaultValue};r.name==="selection-box"?u.radius=r.params.radius:r.name==="camera-target"?(u.radius=r.params.radius,u.dynamicDetailLevel=r.params.dynamicDetailLevel):r.name==="box"?(u.bottomLeft=r.params.bottomLeft,u.topRight=r.params.topRight):r.name==="auto"&&(u.radius=r.params.radius,u.selectionDetailLevel=r.params.selectionDetailLevel),u.isUnbounded=!!r.params.isUnbounded,this.newParams({...n,entry:{name:n.entry.name,params:{...n.entry.params,view:{name:r.name,params:u},detailLevel:r.params.detailLevel,channels:i?{em:this.convert(l.em,s.valuesInfo[0],a)}:{"2fo-fc":this.convert(l["2fo-fc"],s.valuesInfo[0],a),"fo-fc(+ve)":this.convert(l["fo-fc(+ve)"],s.valuesInfo[1],a),"fo-fc(-ve)":this.convert(l["fo-fc(-ve)"],s.valuesInfo[1],a)}}}})}}}areInitial(t){return _.areEqual(this.props.info.params,t,this.props.info.initialValues)}newParams(t){this.props.events.onChange(t,this.areInitial(t))}convert(t,r,n){return{...t,isoValue:n?We.IsoValue.toRelative(t.isoValue,r):We.IsoValue.toAbsolute(t.isoValue,r)}}render(){if(!this.props.b)return null;let t=this.props.b.data,r=t.info.kind==="em",n=r?"em":"2fo-fc",o=this.props.params,i=this.props.info.params.entry.map(o.entry.name),a=i.params.detailLevel,s={...a,label:"Dynamic Detail",defaultValue:i.params.view.map("camera-target").params.dynamicDetailLevel.defaultValue},l={...a,label:"Selection Detail",defaultValue:i.params.view.map("auto").params.selectionDetailLevel.defaultValue},c=t.info.header.sampling[0],u=o.entry.params.channels[n].isoValue.kind==="relative",d=_.Boolean(u,{description:"Use normalized or absolute isocontour scale.",label:"Normalized"}),f=!!o.entry.params.view.params.isUnbounded,m=_.Boolean(f,{description:"Show full/limited range of iso-values for more fine-grained control.",label:"Unbounded"}),p=o.entry.params.view.name==="off",h={entry:_.Select(o.entry.name,t.data.entries.map(y=>[y.dataId,y.dataId]),{isHidden:p,description:"Which entry with volume data to display."}),view:_.MappedStatic(o.entry.params.view.name,{off:_.Group({isRelative:_.Boolean(u,{isHidden:!0}),isUnbounded:_.Boolean(f,{isHidden:!0})},{description:"Display off."}),box:_.Group({bottomLeft:_.Vec3(v.zero()),topRight:_.Vec3(v.zero()),detailLevel:a,isRelative:d,isUnbounded:m},{description:"Static box defined by cartesian coords."}),"selection-box":_.Group({radius:_.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),detailLevel:a,isRelative:d,isUnbounded:m},{description:"Box around focused element."}),"camera-target":_.Group({radius:_.Numeric(.5,{min:0,max:1,step:.05},{description:"Radius within which the volume is shown (relative to the field of view)."}),detailLevel:{...a,isHidden:!0},dynamicDetailLevel:s,isRelative:d,isUnbounded:m},{description:"Box around camera target."}),cell:_.Group({detailLevel:a,isRelative:d,isUnbounded:m},{description:"Box around the structure's bounding box."}),auto:_.Group({radius:_.Numeric(5,{min:0,max:50,step:.5},{description:"Radius in \u212B within which the volume is shown."}),detailLevel:a,selectionDetailLevel:l,isRelative:d,isUnbounded:m},{description:"Box around focused element."})},{options:wl.ViewTypeOptions,description:'Controls what of the volume is displayed. "Off" hides the volume alltogether. "Bounded box" shows the volume inside the given box. "Around Focus" shows the volume around the element/atom last interacted with. "Around Camera" shows the volume around the point the camera is targeting. "Whole Structure" shows the volume for the whole structure.'})},g={entry:o.entry.name,view:{name:o.entry.params.view.name,params:{detailLevel:o.entry.params.detailLevel,radius:o.entry.params.view.params.radius,bottomLeft:o.entry.params.view.params.bottomLeft,topRight:o.entry.params.view.params.topRight,selectionDetailLevel:o.entry.params.view.params.selectionDetailLevel,dynamicDetailLevel:o.entry.params.view.params.dynamicDetailLevel,isRelative:u,isUnbounded:f}}};return p?(0,Vd.jsx)(xo,{onChange:this.changeOption,params:h,values:g,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled}):(0,Vd.jsxs)(Vd.Fragment,{children:[!r&&(0,Vd.jsx)(M3,{label:"2Fo-Fc",name:"2fo-fc",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[0],isUnbounded:f}),!r&&(0,Vd.jsx)(M3,{label:"Fo-Fc(+ve)",name:"fo-fc(+ve)",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[1],isUnbounded:f}),!r&&(0,Vd.jsx)(M3,{label:"Fo-Fc(-ve)",name:"fo-fc(-ve)",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[1],isUnbounded:f}),r&&(0,Vd.jsx)(M3,{label:"EM",name:"em",bCell:this.props.bCell,channels:o.entry.params.channels,changeIso:this.changeIso,changeParams:this.changeParams,isRelative:u,params:this.props,stats:c.valuesInfo[0],isUnbounded:f}),(0,Vd.jsx)(xo,{onChange:this.changeOption,params:h,values:g,onEnter:this.props.events.onEnter,isDisabled:this.props.isDisabled})]})}}});var yR,Kse=M(()=>{Rz();Wse();BYe();yR=()=>({...MYe(),customParamEditors:[[FB,Qq]]})});async function Jq(e){let{spec:t,target:r,onBeforeUIRender:n,render:o}=e,i=new Xq(t||yR());await i.init(),n&&await n(i),o((0,RYe.createElement)(xGe,{plugin:i}),r);try{await i.canvas3dInitialized}catch{}return i}var RYe,Yse=M(()=>{RYe=et(Wr());SGe();pYe();Kse()});var Xse=ve((aho,OYe)=>{OYe.exports=JBrowseExports["react-dom/client"]});function ej(e,t){(0,LYe.createRoot)(t).render(e)}var LYe,Zse=M(()=>{LYe=et(Xse())});var tle=ve((qho,zYe)=>{zYe.exports=JBrowseExports["@jbrowse/core/pluggableElementTypes"]});var jYe=ve((jho,qYe)=>{qYe.exports=JBrowseExports["@jbrowse/core/util/types/mst"]});var bR=ve((Gho,GYe)=>{GYe.exports=JBrowseExports.mobx});var f0=ve((Hho,HYe)=>{HYe.exports=JBrowseExports["mobx-state-tree"]});var QYe=ve(nle=>{"use strict";Object.defineProperty(nle,"__esModule",{value:!0});nle.genomeToTranscriptSeqMapping=n8t;function n8t(e){var t,r;let n=e.strand,o=e.refName,i=(r=(t=e.subfeatures)===null||t===void 0?void 0:t.filter(d=>d.type==="CDS"))!==null&&r!==void 0?r:[],a=new Map;for(let d of i){let f=`${d.start}-${d.end}`;a.has(f)||a.set(f,d)}let s=Array.from(a.values()).sort((d,f)=>n*(d.start-f.start)),l={},c={},u=0;if(n!==-1)for(let d of s)for(let f=d.start;f<d.end;f++){let m=Math.floor(u++/3);l[f]=m,c[m]||(c[m]=f)}else for(let d of s)for(let f=d.end;f>=d.start;f--){let m=Math.floor(u++/3);l[f]=m,c[m]||(c[m]=f)}return{g2p:l,p2g:c,refName:o,strand:n}}});function oXe({model:e,structureSeqPos:t}){let{genomeToTranscriptSeqMapping:r,pairwiseAlignment:n,structureSeqToTranscriptSeqPosition:o}=e;if(!r||!n)return;let{p2g:i,strand:a}=r,s=o?.[t+1];if(s===void 0)return;let l=i[s];if(l===void 0)return;let c=l,u=c+3*a;return[Math.min(c,u),Math.max(c,u)]}async function aj({model:e,structureSeqPos:t}){let r=(0,nXe.getSession)(e),n=oXe({structureSeqPos:t,model:e}),{connectedView:o,genomeToTranscriptSeqMapping:i,zoomToBaseLevel:a}=e,{assemblyManager:s}=r;if(!i||n===void 0)return;let[l,c]=n,{strand:u,refName:d}=i,f=o?.assemblyNames[0];if(f)if(e.setClickGenomeHighlights([{assemblyName:f,refName:d,start:l,end:c}]),a)await o.navToLocString(`${d}:${l}-${c}${u===-1?"[rev]":""}`);else{let m=s.get(o.assemblyNames[0]);o.centerAt(l,m?.getCanonicalRefName(d)??d)}}function sj({model:e,structureSeqPos:t}){if(t===void 0){e.setHoverGenomeHighlights([]);return}let r=oXe({structureSeqPos:t,model:e}),{genomeToTranscriptSeqMapping:n,connectedView:o}=e,i=o?.assemblyNames[0];if(n&&r&&i){let[a,s]=r;e.setHoverGenomeHighlights([{assemblyName:i,refName:n.refName,start:a,end:s}])}}var nXe,ale=M(()=>{"use strict";nXe=et(Du())});var Sm=ve((Mgo,CR)=>{function a8t(e){return e&&e.__esModule?e:{default:e}}CR.exports=a8t,CR.exports.__esModule=!0,CR.exports.default=CR.exports});var gw=ve(cle=>{"use strict";"use client";Object.defineProperty(cle,"__esModule",{value:!0});Object.defineProperty(cle,"default",{enumerable:!0,get:function(){return s8t.createSvgIcon}});var s8t=IY()});var uXe=ve(lj=>{"use strict";"use client";var l8t=Sm().default;Object.defineProperty(lj,"__esModule",{value:!0});lj.default=void 0;var c8t=l8t(gw()),u8t=gn(),Rgo=lj.default=(0,c8t.default)((0,u8t.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight")});var dXe=ve(u1=>{"use strict";var d8t=u1&&u1.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),f8t=u1&&u1.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),m8t=u1&&u1.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&d8t(r,t,n[o]);return f8t(r,t),r}})();Object.defineProperty(u1,"__esModule",{value:!0});var p8t=gn(),h8t=m8t(Wr()),g8t=Jl(),y8t=h8t.forwardRef(function(t,r){return(0,p8t.jsx)(g8t.Menu,{...t,ref:r,style:{pointerEvents:"none",...t.style},slotProps:{...t.slotProps,paper:{style:{pointerEvents:"auto"}}}})});u1.default=y8t});var fXe=ve(cj=>{"use strict";"use client";var v8t=Sm().default;Object.defineProperty(cj,"__esModule",{value:!0});cj.default=void 0;var b8t=v8t(gw()),x8t=gn(),Fgo=cj.default=(0,b8t.default)((0,x8t.jsx)("path",{d:"m10 17 5-5-5-5z"}),"ArrowRight")});var mXe=ve(uj=>{"use strict";"use client";var S8t=Sm().default;Object.defineProperty(uj,"__esModule",{value:!0});uj.default=void 0;var _8t=S8t(gw()),C8t=gn(),Ugo=uj.default=(0,_8t.default)((0,C8t.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckBox")});var pXe=ve(dj=>{"use strict";"use client";var w8t=Sm().default;Object.defineProperty(dj,"__esModule",{value:!0});dj.default=void 0;var T8t=w8t(gw()),A8t=gn(),zgo=dj.default=(0,T8t.default)((0,A8t.jsx)("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"CheckBoxOutlineBlank")});var hXe=ve(fj=>{"use strict";"use client";var P8t=Sm().default;Object.defineProperty(fj,"__esModule",{value:!0});fj.default=void 0;var I8t=P8t(gw()),E8t=gn(),jgo=fj.default=(0,I8t.default)((0,E8t.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonChecked")});var gXe=ve(mj=>{"use strict";"use client";var D8t=Sm().default;Object.defineProperty(mj,"__esModule",{value:!0});mj.default=void 0;var k8t=D8t(gw()),M8t=gn(),Hgo=mj.default=(0,k8t.default)((0,M8t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonUnchecked")});var yXe=ve(vv=>{"use strict";Object.defineProperty(vv,"__esModule",{value:!0});vv.TWO_PWR_32_DBL=vv.TWO_PWR_16_DBL=void 0;vv.longFromBytesToUnsigned=B8t;vv.TWO_PWR_16_DBL=65536;vv.TWO_PWR_32_DBL=vv.TWO_PWR_16_DBL*vv.TWO_PWR_16_DBL;function B8t(e,t=0){let r=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24;return((e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0)*vv.TWO_PWR_32_DBL+(r>>>0)}});var bXe=ve(fle=>{"use strict";Object.defineProperty(fle,"__esModule",{value:!0});var ule=yXe(),pj=1;function vXe(e,t,r){let n=t[pj],o=r?r[pj]:1/0;return n<=e&&o>e?0:n<e?-1:1}var dle=class{constructor({filehandle:t}){this.filehandle=t}_getIndex(){return this.index||(this.index=this._readIndex().catch(t=>{throw this.index=void 0,t})),this.index}async _readIndex(){let t=await this.filehandle.read(8,0),r=(0,ule.longFromBytesToUnsigned)(t);if(!r)return[[0,0]];let n=new Array(r+1);n[0]=[0,0];let o=16*r;if(o>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");let i=await this.filehandle.read(o,8);for(let a=0;a<r;a+=1){let s=(0,ule.longFromBytesToUnsigned)(i,a*16),l=(0,ule.longFromBytesToUnsigned)(i,a*16+8);n[a+1]=[s,l]}return n}async getLastBlock(){return(await this._getIndex()).at(-1)}async getRelevantBlocksForRead(t,r){let n=r+t;if(t===0)return[];let o=await this._getIndex(),i=[],a=0,s=o.length-1,l=Math.floor(o.length/2),c=vXe(r,o[l],o[l+1]);for(;c!==0;)c>0?s=l-1:c<0&&(a=l+1),l=Math.ceil((s-a)/2)+a,c=vXe(r,o[l],o[l+1]);i.push(o[l]);let u=l+1;for(;u<o.length&&(i.push(o[u]),!(o[u][pj]>=n));u+=1);return i[i.length-1][pj]<n&&i.push([]),i}};fle.default=dle});var d1=ve(Df=>{"use strict";var R8t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function O8t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Df.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)O8t(r,n)&&(e[n]=r[n])}}return e};Df.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var L8t={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),o);return}for(var i=0;i<n;i++)e[o+i]=t[r+i]},flattenChunks:function(e){var t,r,n,o,i,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),o=0,t=0,r=e.length;t<r;t++)i=e[t],a.set(i,o),o+=i.length;return a}},F8t={arraySet:function(e,t,r,n,o){for(var i=0;i<n;i++)e[o+i]=t[r+i]},flattenChunks:function(e){return[].concat.apply([],e)}};Df.setTyped=function(e){e?(Df.Buf8=Uint8Array,Df.Buf16=Uint16Array,Df.Buf32=Int32Array,Df.assign(Df,L8t)):(Df.Buf8=Array,Df.Buf16=Array,Df.Buf32=Array,Df.assign(Df,F8t))};Df.setTyped(R8t)});var qXe=ve(O3=>{"use strict";var N8t=d1(),U8t=4,xXe=0,SXe=1,V8t=2;function R3(e){for(var t=e.length;--t>=0;)e[t]=0}var z8t=0,PXe=1,q8t=2,j8t=3,G8t=258,ble=29,ER=256,TR=ER+1+ble,B3=30,xle=19,IXe=2*TR+1,yw=15,mle=16,H8t=7,Sle=256,EXe=16,DXe=17,kXe=18,yle=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],hj=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],W8t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],MXe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K8t=512,f1=new Array((TR+2)*2);R3(f1);var wR=new Array(B3*2);R3(wR);var AR=new Array(K8t);R3(AR);var PR=new Array(G8t-j8t+1);R3(PR);var _le=new Array(ble);R3(_le);var gj=new Array(B3);R3(gj);function ple(e,t,r,n,o){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=e&&e.length}var BXe,RXe,OXe;function hle(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function LXe(e){return e<256?AR[e]:AR[256+(e>>>7)]}function IR(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function _m(e,t,r){e.bi_valid>mle-r?(e.bi_buf|=t<<e.bi_valid&65535,IR(e,e.bi_buf),e.bi_buf=t>>mle-e.bi_valid,e.bi_valid+=r-mle):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function bv(e,t,r){_m(e,r[t*2],r[t*2+1])}function FXe(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Y8t(e){e.bi_valid===16?(IR(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function X8t(e,t){var r=t.dyn_tree,n=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,d,f,m,p,h=0;for(f=0;f<=yw;f++)e.bl_count[f]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<IXe;c++)u=e.heap[c],f=r[r[u*2+1]*2+1]+1,f>l&&(f=l,h++),r[u*2+1]=f,!(u>n)&&(e.bl_count[f]++,m=0,u>=s&&(m=a[u-s]),p=r[u*2],e.opt_len+=p*(f+m),i&&(e.static_len+=p*(o[u*2+1]+m)));if(h!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,h-=2}while(h>0);for(f=l;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(e.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),u--)}}function NXe(e,t,r){var n=new Array(yw+1),o=0,i,a;for(i=1;i<=yw;i++)n[i]=o=o+r[i-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=FXe(n[s]++,s))}}function Z8t(){var e,t,r,n,o,i=new Array(yw+1);for(r=0,n=0;n<ble-1;n++)for(_le[n]=r,e=0;e<1<<yle[n];e++)PR[r++]=n;for(PR[r-1]=n,o=0,n=0;n<16;n++)for(gj[n]=o,e=0;e<1<<hj[n];e++)AR[o++]=n;for(o>>=7;n<B3;n++)for(gj[n]=o<<7,e=0;e<1<<hj[n]-7;e++)AR[256+o++]=n;for(t=0;t<=yw;t++)i[t]=0;for(e=0;e<=143;)f1[e*2+1]=8,e++,i[8]++;for(;e<=255;)f1[e*2+1]=9,e++,i[9]++;for(;e<=279;)f1[e*2+1]=7,e++,i[7]++;for(;e<=287;)f1[e*2+1]=8,e++,i[8]++;for(NXe(f1,TR+1,i),e=0;e<B3;e++)wR[e*2+1]=5,wR[e*2]=FXe(e,5);BXe=new ple(f1,yle,ER+1,TR,yw),RXe=new ple(wR,hj,0,B3,yw),OXe=new ple(new Array(0),W8t,0,xle,H8t)}function UXe(e){var t;for(t=0;t<TR;t++)e.dyn_ltree[t*2]=0;for(t=0;t<B3;t++)e.dyn_dtree[t*2]=0;for(t=0;t<xle;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Sle*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function VXe(e){e.bi_valid>8?IR(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function $8t(e,t,r,n){VXe(e),n&&(IR(e,r),IR(e,~r)),N8t.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function _Xe(e,t,r,n){var o=t*2,i=r*2;return e[o]<e[i]||e[o]===e[i]&&n[t]<=n[r]}function gle(e,t,r){for(var n=e.heap[r],o=r<<1;o<=e.heap_len&&(o<e.heap_len&&_Xe(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!_Xe(t,n,e.heap[o],e.depth));)e.heap[r]=e.heap[o],r=o,o<<=1;e.heap[r]=n}function CXe(e,t,r){var n,o,i=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+i*2]<<8|e.pending_buf[e.d_buf+i*2+1],o=e.pending_buf[e.l_buf+i],i++,n===0?bv(e,o,t):(a=PR[o],bv(e,a+ER+1,t),s=yle[a],s!==0&&(o-=_le[a],_m(e,o,s)),n--,a=LXe(n),bv(e,a,r),s=hj[a],s!==0&&(n-=gj[a],_m(e,n,s)));while(i<e.last_lit);bv(e,Sle,t)}function vle(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems,a,s,l=-1,c;for(e.heap_len=0,e.heap_max=IXe,a=0;a<i;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=n[c*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)gle(e,r,a);c=i;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],gle(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[c*2]=r[a*2]+r[s*2],e.depth[c]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=c,e.heap[1]=c++,gle(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],X8t(e,t),NXe(r,l,e.bl_count)}function wXe(e,t,r){var n,o=-1,i,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)i=a,a=t[(n+1)*2+1],!(++s<l&&i===a)&&(s<c?e.bl_tree[i*2]+=s:i!==0?(i!==o&&e.bl_tree[i*2]++,e.bl_tree[EXe*2]++):s<=10?e.bl_tree[DXe*2]++:e.bl_tree[kXe*2]++,s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function TXe(e,t,r){var n,o=-1,i,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),n=0;n<=r;n++)if(i=a,a=t[(n+1)*2+1],!(++s<l&&i===a)){if(s<c)do bv(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==o&&(bv(e,i,e.bl_tree),s--),bv(e,EXe,e.bl_tree),_m(e,s-3,2)):s<=10?(bv(e,DXe,e.bl_tree),_m(e,s-3,3)):(bv(e,kXe,e.bl_tree),_m(e,s-11,7));s=0,o=i,a===0?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}function Q8t(e){var t;for(wXe(e,e.dyn_ltree,e.l_desc.max_code),wXe(e,e.dyn_dtree,e.d_desc.max_code),vle(e,e.bl_desc),t=xle-1;t>=3&&e.bl_tree[MXe[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function J8t(e,t,r,n){var o;for(_m(e,t-257,5),_m(e,r-1,5),_m(e,n-4,4),o=0;o<n;o++)_m(e,e.bl_tree[MXe[o]*2+1],3);TXe(e,e.dyn_ltree,t-1),TXe(e,e.dyn_dtree,r-1)}function eqt(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return xXe;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return SXe;for(r=32;r<ER;r++)if(e.dyn_ltree[r*2]!==0)return SXe;return xXe}var AXe=!1;function tqt(e){AXe||(Z8t(),AXe=!0),e.l_desc=new hle(e.dyn_ltree,BXe),e.d_desc=new hle(e.dyn_dtree,RXe),e.bl_desc=new hle(e.bl_tree,OXe),e.bi_buf=0,e.bi_valid=0,UXe(e)}function zXe(e,t,r,n){_m(e,(z8t<<1)+(n?1:0),3),$8t(e,t,r,!0)}function rqt(e){_m(e,PXe<<1,3),bv(e,Sle,f1),Y8t(e)}function nqt(e,t,r,n){var o,i,a=0;e.level>0?(e.strm.data_type===V8t&&(e.strm.data_type=eqt(e)),vle(e,e.l_desc),vle(e,e.d_desc),a=Q8t(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=r+5,r+4<=o&&t!==-1?zXe(e,t,r,n):e.strategy===U8t||i===o?(_m(e,(PXe<<1)+(n?1:0),3),CXe(e,f1,wR)):(_m(e,(q8t<<1)+(n?1:0),3),J8t(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),CXe(e,e.dyn_ltree,e.dyn_dtree)),UXe(e),n&&VXe(e)}function oqt(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(PR[r]+ER+1)*2]++,e.dyn_dtree[LXe(t)*2]++),e.last_lit===e.lit_bufsize-1}O3._tr_init=tqt;O3._tr_stored_block=zXe;O3._tr_flush_block=nqt;O3._tr_tally=oqt;O3._tr_align=rqt});var Cle=ve(($go,jXe)=>{"use strict";function iqt(e,t,r,n){for(var o=e&65535|0,i=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do o=o+t[n++]|0,i=i+o|0;while(--a);o%=65521,i%=65521}return o|i<<16|0}jXe.exports=iqt});var wle=ve((Qgo,GXe)=>{"use strict";function aqt(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var sqt=aqt();function lqt(e,t,r,n){var o=sqt,i=n+r;e^=-1;for(var a=n;a<i;a++)e=e>>>8^o[(e^t[a])&255];return e^-1}GXe.exports=lqt});var yj=ve((Jgo,HXe)=>{"use strict";HXe.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var eZe=ve(_v=>{"use strict";var kf=d1(),Hh=qXe(),XXe=Cle(),c_=wle(),cqt=yj(),Sw=0,uqt=1,dqt=3,p_=4,WXe=5,Sv=0,KXe=1,Wh=-2,fqt=-3,Tle=-5,mqt=-1,pqt=1,vj=2,hqt=3,gqt=4,yqt=0,vqt=2,_j=8,bqt=9,xqt=15,Sqt=8,_qt=29,Cqt=256,Ple=Cqt+1+_qt,wqt=30,Tqt=19,Aqt=2*Ple+1,Pqt=15,xi=3,f_=258,m0=f_+xi+1,Iqt=32,Cj=42,Ile=69,bj=73,xj=91,Sj=103,vw=113,kR=666,Lc=1,MR=2,bw=3,N3=4,Eqt=3;function m_(e,t){return e.msg=cqt[t],t}function YXe(e){return(e<<1)-(e>4?9:0)}function d_(e){for(var t=e.length;--t>=0;)e[t]=0}function u_(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(kf.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function Yu(e,t){Hh._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,u_(e.strm)}function Ki(e,t){e.pending_buf[e.pending++]=t}function DR(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Dqt(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),o===0?0:(e.avail_in-=o,kf.arraySet(t,e.input,e.next_in,o,r),e.state.wrap===1?e.adler=XXe(e.adler,t,o,r):e.state.wrap===2&&(e.adler=c_(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function ZXe(e,t){var r=e.max_chain_length,n=e.strstart,o,i,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-m0?e.strstart-(e.w_size-m0):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+f_,m=c[n+a-1],p=c[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+a]!==p||c[o+a-1]!==m||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<f);if(i=f_-(f-n),n=f-f_,i>a){if(e.match_start=t,a=i,i>=s)break;m=c[n+a-1],p=c[n+a]}}while((t=d[t&u])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function xw(e){var t=e.w_size,r,n,o,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-m0)){kf.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do o=e.head[--r],e.head[r]=o>=t?o-t:0;while(--n);n=t,r=n;do o=e.prev[--r],e.prev[r]=o>=t?o-t:0;while(--n);i+=t}if(e.strm.avail_in===0)break;if(n=Dqt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=n,e.lookahead+e.insert>=xi)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+xi-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<xi)););}while(e.lookahead<m0&&e.strm.avail_in!==0)}function kqt(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(xw(e),e.lookahead===0&&t===Sw)return Lc;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Yu(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-m0&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=0,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):(e.strstart>e.block_start&&(Yu(e,!1),e.strm.avail_out===0),Lc)}function Ale(e,t){for(var r,n;;){if(e.lookahead<m0){if(xw(e),e.lookahead<m0&&t===Sw)return Lc;if(e.lookahead===0)break}if(r=0,e.lookahead>=xi&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-m0&&(e.match_length=ZXe(e,r)),e.match_length>=xi)if(n=Hh._tr_tally(e,e.strstart-e.match_start,e.match_length-xi),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=xi){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Hh._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=e.strstart<xi-1?e.strstart:xi-1,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function L3(e,t){for(var r,n,o;;){if(e.lookahead<m0){if(xw(e),e.lookahead<m0&&t===Sw)return Lc;if(e.lookahead===0)break}if(r=0,e.lookahead>=xi&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=xi-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-m0&&(e.match_length=ZXe(e,r),e.match_length<=5&&(e.strategy===pqt||e.match_length===xi&&e.strstart-e.match_start>4096)&&(e.match_length=xi-1)),e.prev_length>=xi&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-xi,n=Hh._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-xi),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+xi-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=xi-1,e.strstart++,n&&(Yu(e,!1),e.strm.avail_out===0))return Lc}else if(e.match_available){if(n=Hh._tr_tally(e,0,e.window[e.strstart-1]),n&&Yu(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Lc}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Hh._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<xi-1?e.strstart:xi-1,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function Mqt(e,t){for(var r,n,o,i,a=e.window;;){if(e.lookahead<=f_){if(xw(e),e.lookahead<=f_&&t===Sw)return Lc;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=xi&&e.strstart>0&&(o=e.strstart-1,n=a[o],n===a[++o]&&n===a[++o]&&n===a[++o])){i=e.strstart+f_;do;while(n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&n===a[++o]&&o<i);e.match_length=f_-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=xi?(r=Hh._tr_tally(e,1,e.match_length-xi),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Hh._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=0,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function Bqt(e,t){for(var r;;){if(e.lookahead===0&&(xw(e),e.lookahead===0)){if(t===Sw)return Lc;break}if(e.match_length=0,r=Hh._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Yu(e,!1),e.strm.avail_out===0))return Lc}return e.insert=0,t===p_?(Yu(e,!0),e.strm.avail_out===0?bw:N3):e.last_lit&&(Yu(e,!1),e.strm.avail_out===0)?Lc:MR}function xv(e,t,r,n,o){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=o}var F3;F3=[new xv(0,0,0,0,kqt),new xv(4,4,8,4,Ale),new xv(4,5,16,8,Ale),new xv(4,6,32,32,Ale),new xv(4,4,16,16,L3),new xv(8,16,32,32,L3),new xv(8,16,128,128,L3),new xv(8,32,128,256,L3),new xv(32,128,258,1024,L3),new xv(32,258,258,4096,L3)];function Rqt(e){e.window_size=2*e.w_size,d_(e.head),e.max_lazy_match=F3[e.level].max_lazy,e.good_match=F3[e.level].good_length,e.nice_match=F3[e.level].nice_length,e.max_chain_length=F3[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=xi-1,e.match_available=0,e.ins_h=0}function Oqt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_j,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new kf.Buf16(Aqt*2),this.dyn_dtree=new kf.Buf16((2*wqt+1)*2),this.bl_tree=new kf.Buf16((2*Tqt+1)*2),d_(this.dyn_ltree),d_(this.dyn_dtree),d_(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new kf.Buf16(Pqt+1),this.heap=new kf.Buf16(2*Ple+1),d_(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new kf.Buf16(2*Ple+1),d_(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function $Xe(e){var t;return!e||!e.state?m_(e,Wh):(e.total_in=e.total_out=0,e.data_type=vqt,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Cj:vw,e.adler=t.wrap===2?0:1,t.last_flush=Sw,Hh._tr_init(t),Sv)}function QXe(e){var t=$Xe(e);return t===Sv&&Rqt(e.state),t}function Lqt(e,t){return!e||!e.state||e.state.wrap!==2?Wh:(e.state.gzhead=t,Sv)}function JXe(e,t,r,n,o,i){if(!e)return Wh;var a=1;if(t===mqt&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>bqt||r!==_j||n<8||n>15||t<0||t>9||i<0||i>gqt)return m_(e,Wh);n===8&&(n=9);var s=new Oqt;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+xi-1)/xi),s.window=new kf.Buf8(s.w_size*2),s.head=new kf.Buf16(s.hash_size),s.prev=new kf.Buf16(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new kf.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=i,s.method=r,QXe(e)}function Fqt(e,t){return JXe(e,t,_j,xqt,Sqt,yqt)}function Nqt(e,t){var r,n,o,i;if(!e||!e.state||t>WXe||t<0)return e?m_(e,Wh):Wh;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===kR&&t!==p_)return m_(e,e.avail_out===0?Tle:Wh);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Cj)if(n.wrap===2)e.adler=0,Ki(n,31),Ki(n,139),Ki(n,8),n.gzhead?(Ki(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ki(n,n.gzhead.time&255),Ki(n,n.gzhead.time>>8&255),Ki(n,n.gzhead.time>>16&255),Ki(n,n.gzhead.time>>24&255),Ki(n,n.level===9?2:n.strategy>=vj||n.level<2?4:0),Ki(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Ki(n,n.gzhead.extra.length&255),Ki(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=c_(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Ile):(Ki(n,0),Ki(n,0),Ki(n,0),Ki(n,0),Ki(n,0),Ki(n,n.level===9?2:n.strategy>=vj||n.level<2?4:0),Ki(n,Eqt),n.status=vw);else{var a=_j+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=vj||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=Iqt),a+=31-a%31,n.status=vw,DR(n,a),n.strstart!==0&&(DR(n,e.adler>>>16),DR(n,e.adler&65535)),e.adler=1}if(n.status===Ile)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),u_(e),o=n.pending,n.pending===n.pending_buf_size));)Ki(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=bj)}else n.status=bj;if(n.status===bj)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),u_(e),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.name.length?i=n.gzhead.name.charCodeAt(n.gzindex++)&255:i=0,Ki(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.gzindex=0,n.status=xj)}else n.status=xj;if(n.status===xj)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),u_(e),o=n.pending,n.pending===n.pending_buf_size)){i=1;break}n.gzindex<n.gzhead.comment.length?i=n.gzhead.comment.charCodeAt(n.gzindex++)&255:i=0,Ki(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=c_(e.adler,n.pending_buf,n.pending-o,o)),i===0&&(n.status=Sj)}else n.status=Sj;if(n.status===Sj&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&u_(e),n.pending+2<=n.pending_buf_size&&(Ki(n,e.adler&255),Ki(n,e.adler>>8&255),e.adler=0,n.status=vw)):n.status=vw),n.pending!==0){if(u_(e),e.avail_out===0)return n.last_flush=-1,Sv}else if(e.avail_in===0&&YXe(t)<=YXe(r)&&t!==p_)return m_(e,Tle);if(n.status===kR&&e.avail_in!==0)return m_(e,Tle);if(e.avail_in!==0||n.lookahead!==0||t!==Sw&&n.status!==kR){var l=n.strategy===vj?Bqt(n,t):n.strategy===hqt?Mqt(n,t):F3[n.level].func(n,t);if((l===bw||l===N3)&&(n.status=kR),l===Lc||l===bw)return e.avail_out===0&&(n.last_flush=-1),Sv;if(l===MR&&(t===uqt?Hh._tr_align(n):t!==WXe&&(Hh._tr_stored_block(n,0,0,!1),t===dqt&&(d_(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),u_(e),e.avail_out===0))return n.last_flush=-1,Sv}return t!==p_?Sv:n.wrap<=0?KXe:(n.wrap===2?(Ki(n,e.adler&255),Ki(n,e.adler>>8&255),Ki(n,e.adler>>16&255),Ki(n,e.adler>>24&255),Ki(n,e.total_in&255),Ki(n,e.total_in>>8&255),Ki(n,e.total_in>>16&255),Ki(n,e.total_in>>24&255)):(DR(n,e.adler>>>16),DR(n,e.adler&65535)),u_(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Sv:KXe)}function Uqt(e){var t;return!e||!e.state?Wh:(t=e.state.status,t!==Cj&&t!==Ile&&t!==bj&&t!==xj&&t!==Sj&&t!==vw&&t!==kR?m_(e,Wh):(e.state=null,t===vw?m_(e,fqt):Sv))}function Vqt(e,t){var r=t.length,n,o,i,a,s,l,c,u;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==Cj||n.lookahead))return Wh;for(a===1&&(e.adler=XXe(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(d_(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new kf.Buf8(n.w_size),kf.arraySet(u,t,r-n.w_size,n.w_size,0),t=u,r=n.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,xw(n);n.lookahead>=xi;){o=n.strstart,i=n.lookahead-(xi-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+xi-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--i);n.strstart=o,n.lookahead=xi-1,xw(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=xi-1,n.match_available=0,e.next_in=l,e.input=c,e.avail_in=s,n.wrap=a,Sv}_v.deflateInit=Fqt;_v.deflateInit2=JXe;_v.deflateReset=QXe;_v.deflateResetKeep=$Xe;_v.deflateSetHeader=Lqt;_v.deflate=Nqt;_v.deflateEnd=Uqt;_v.deflateSetDictionary=Vqt;_v.deflateInfo="pako deflate (from Nodeca project)"});var Ele=ve(U3=>{"use strict";var wj=d1(),tZe=!0,rZe=!0;try{String.fromCharCode.apply(null,[0])}catch{tZe=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{rZe=!1}var BR=new wj.Buf8(256);for(m1=0;m1<256;m1++)BR[m1]=m1>=252?6:m1>=248?5:m1>=240?4:m1>=224?3:m1>=192?2:1;var m1;BR[254]=BR[254]=1;U3.string2buf=function(e){var t,r,n,o,i,a=e.length,s=0;for(o=0;o<a;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<a&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new wj.Buf8(s),i=0,o=0;i<s;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<a&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|r&63):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|r&63):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|r&63);return t};function nZe(e,t){if(t<65534&&(e.subarray&&rZe||!e.subarray&&tZe))return String.fromCharCode.apply(null,wj.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}U3.buf2binstring=function(e){return nZe(e,e.length)};U3.binstring2buf=function(e){for(var t=new wj.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};U3.buf2string=function(e,t){var r,n,o,i,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(o=e[r++],o<128){s[n++]=o;continue}if(i=BR[o],i>4){s[n++]=65533,r+=i-1;continue}for(o&=i===2?31:i===3?15:7;i>1&&r<a;)o=o<<6|e[r++]&63,i--;if(i>1){s[n++]=65533;continue}o<65536?s[n++]=o:(o-=65536,s[n++]=55296|o>>10&1023,s[n++]=56320|o&1023)}return nZe(s,n)};U3.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+BR[e[r]]>t?r:t}});var Dle=ve((r0o,oZe)=>{"use strict";function zqt(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}oZe.exports=zqt});var lZe=ve(LR=>{"use strict";var RR=eZe(),OR=d1(),Mle=Ele(),Ble=yj(),qqt=Dle(),sZe=Object.prototype.toString,jqt=0,kle=4,V3=0,iZe=1,aZe=2,Gqt=-1,Hqt=0,Wqt=8;function _w(e){if(!(this instanceof _w))return new _w(e);this.options=OR.assign({level:Gqt,method:Wqt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Hqt,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qqt,this.strm.avail_out=0;var r=RR.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==V3)throw new Error(Ble[r]);if(t.header&&RR.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=Mle.string2buf(t.dictionary):sZe.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=RR.deflateSetDictionary(this.strm,n),r!==V3)throw new Error(Ble[r]);this._dict_set=!0}}_w.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o,i;if(this.ended)return!1;i=t===~~t?t:t===!0?kle:jqt,typeof e=="string"?r.input=Mle.string2buf(e):sZe.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new OR.Buf8(n),r.next_out=0,r.avail_out=n),o=RR.deflate(r,i),o!==iZe&&o!==V3)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(i===kle||i===aZe))&&(this.options.to==="string"?this.onData(Mle.buf2binstring(OR.shrinkBuf(r.output,r.next_out))):this.onData(OR.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==iZe);return i===kle?(o=RR.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===V3):(i===aZe&&(this.onEnd(V3),r.avail_out=0),!0)};_w.prototype.onData=function(e){this.chunks.push(e)};_w.prototype.onEnd=function(e){e===V3&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=OR.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Rle(e,t){var r=new _w(t);if(r.push(e,!0),r.err)throw r.msg||Ble[r.err];return r.result}function Kqt(e,t){return t=t||{},t.raw=!0,Rle(e,t)}function Yqt(e,t){return t=t||{},t.gzip=!0,Rle(e,t)}LR.Deflate=_w;LR.deflate=Rle;LR.deflateRaw=Kqt;LR.gzip=Yqt});var uZe=ve((o0o,cZe)=>{"use strict";var Tj=30,Xqt=12;cZe.exports=function(t,r){var n,o,i,a,s,l,c,u,d,f,m,p,h,g,y,b,x,C,S,w,A,T,D,E,I;n=t.state,o=t.next_in,E=t.input,i=o+(t.avail_in-5),a=t.next_out,I=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),c=n.dmax,u=n.wsize,d=n.whave,f=n.wnext,m=n.window,p=n.hold,h=n.bits,g=n.lencode,y=n.distcode,b=(1<<n.lenbits)-1,x=(1<<n.distbits)-1;e:do{h<15&&(p+=E[o++]<<h,h+=8,p+=E[o++]<<h,h+=8),C=g[p&b];t:for(;;){if(S=C>>>24,p>>>=S,h-=S,S=C>>>16&255,S===0)I[a++]=C&65535;else if(S&16){w=C&65535,S&=15,S&&(h<S&&(p+=E[o++]<<h,h+=8),w+=p&(1<<S)-1,p>>>=S,h-=S),h<15&&(p+=E[o++]<<h,h+=8,p+=E[o++]<<h,h+=8),C=y[p&x];r:for(;;){if(S=C>>>24,p>>>=S,h-=S,S=C>>>16&255,S&16){if(A=C&65535,S&=15,h<S&&(p+=E[o++]<<h,h+=8,h<S&&(p+=E[o++]<<h,h+=8)),A+=p&(1<<S)-1,A>c){t.msg="invalid distance too far back",n.mode=Tj;break e}if(p>>>=S,h-=S,S=a-s,A>S){if(S=A-S,S>d&&n.sane){t.msg="invalid distance too far back",n.mode=Tj;break e}if(T=0,D=m,f===0){if(T+=u-S,S<w){w-=S;do I[a++]=m[T++];while(--S);T=a-A,D=I}}else if(f<S){if(T+=u+f-S,S-=f,S<w){w-=S;do I[a++]=m[T++];while(--S);if(T=0,f<w){S=f,w-=S;do I[a++]=m[T++];while(--S);T=a-A,D=I}}}else if(T+=f-S,S<w){w-=S;do I[a++]=m[T++];while(--S);T=a-A,D=I}for(;w>2;)I[a++]=D[T++],I[a++]=D[T++],I[a++]=D[T++],w-=3;w&&(I[a++]=D[T++],w>1&&(I[a++]=D[T++]))}else{T=a-A;do I[a++]=I[T++],I[a++]=I[T++],I[a++]=I[T++],w-=3;while(w>2);w&&(I[a++]=I[T++],w>1&&(I[a++]=I[T++]))}}else if((S&64)===0){C=y[(C&65535)+(p&(1<<S)-1)];continue r}else{t.msg="invalid distance code",n.mode=Tj;break e}break}}else if((S&64)===0){C=g[(C&65535)+(p&(1<<S)-1)];continue t}else if(S&32){n.mode=Xqt;break e}else{t.msg="invalid literal/length code",n.mode=Tj;break e}break}}while(o<i&&a<l);w=h>>3,o-=w,h-=w<<3,p&=(1<<h)-1,t.next_in=o,t.next_out=a,t.avail_in=o<i?5+(i-o):5-(o-i),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=p,n.bits=h}});var yZe=ve((i0o,gZe)=>{"use strict";var dZe=d1(),z3=15,fZe=852,mZe=592,pZe=0,Ole=1,hZe=2,Zqt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],$qt=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Qqt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Jqt=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];gZe.exports=function(t,r,n,o,i,a,s,l){var c=l.bits,u=0,d=0,f=0,m=0,p=0,h=0,g=0,y=0,b=0,x=0,C,S,w,A,T,D=null,E=0,I,k=new dZe.Buf16(z3+1),R=new dZe.Buf16(z3+1),B=null,O=0,F,q,W;for(u=0;u<=z3;u++)k[u]=0;for(d=0;d<o;d++)k[r[n+d]]++;for(p=c,m=z3;m>=1&&k[m]===0;m--);if(p>m&&(p=m),m===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f<m&&k[f]===0;f++);for(p<f&&(p=f),y=1,u=1;u<=z3;u++)if(y<<=1,y-=k[u],y<0)return-1;if(y>0&&(t===pZe||m!==1))return-1;for(R[1]=0,u=1;u<z3;u++)R[u+1]=R[u]+k[u];for(d=0;d<o;d++)r[n+d]!==0&&(s[R[r[n+d]]++]=d);if(t===pZe?(D=B=s,I=19):t===Ole?(D=Zqt,E-=257,B=$qt,O-=257,I=256):(D=Qqt,B=Jqt,I=-1),x=0,d=0,u=f,T=a,h=p,g=0,w=-1,b=1<<p,A=b-1,t===Ole&&b>fZe||t===hZe&&b>mZe)return 1;for(;;){F=u-g,s[d]<I?(q=0,W=s[d]):s[d]>I?(q=B[O+s[d]],W=D[E+s[d]]):(q=96,W=0),C=1<<u-g,S=1<<h,f=S;do S-=C,i[T+(x>>g)+S]=F<<24|q<<16|W|0;while(S!==0);for(C=1<<u-1;x&C;)C>>=1;if(C!==0?(x&=C-1,x+=C):x=0,d++,--k[u]===0){if(u===m)break;u=r[n+s[d]]}if(u>p&&(x&A)!==w){for(g===0&&(g=p),T+=f,h=u-g,y=1<<h;h+g<m&&(y-=k[h+g],!(y<=0));)h++,y<<=1;if(b+=1<<h,t===Ole&&b>fZe||t===hZe&&b>mZe)return 1;w=x&A,i[w]=p<<24|h<<16|T-a|0}}return x!==0&&(i[T+x]=u-g<<24|64<<16|0),l.bits=p,0}});var QZe=ve(p0=>{"use strict";var xp=d1(),zle=Cle(),Cv=wle(),ejt=uZe(),FR=yZe(),tjt=0,jZe=1,GZe=2,vZe=4,rjt=5,Aj=6,Cw=0,njt=1,ojt=2,Kh=-2,HZe=-3,qle=-4,ijt=-5,bZe=8,WZe=1,xZe=2,SZe=3,_Ze=4,CZe=5,wZe=6,TZe=7,AZe=8,PZe=9,IZe=10,Ej=11,p1=12,Lle=13,EZe=14,Fle=15,DZe=16,kZe=17,MZe=18,BZe=19,Pj=20,Ij=21,RZe=22,OZe=23,LZe=24,FZe=25,NZe=26,Nle=27,UZe=28,VZe=29,ks=30,jle=31,ajt=32,sjt=852,ljt=592,cjt=15,ujt=cjt;function zZe(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function djt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new xp.Buf16(320),this.work=new xp.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function KZe(e){var t;return!e||!e.state?Kh:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=WZe,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new xp.Buf32(sjt),t.distcode=t.distdyn=new xp.Buf32(ljt),t.sane=1,t.back=-1,Cw)}function YZe(e){var t;return!e||!e.state?Kh:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,KZe(e))}function XZe(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Kh:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,YZe(e))}function ZZe(e,t){var r,n;return e?(n=new djt,e.state=n,n.window=null,r=XZe(e,t),r!==Cw&&(e.state=null),r):Kh}function fjt(e){return ZZe(e,ujt)}var qZe=!0,Ule,Vle;function mjt(e){if(qZe){var t;for(Ule=new xp.Buf32(512),Vle=new xp.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(FR(jZe,e.lens,0,288,Ule,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;FR(GZe,e.lens,0,32,Vle,0,e.work,{bits:5}),qZe=!1}e.lencode=Ule,e.lenbits=9,e.distcode=Vle,e.distbits=5}function $Ze(e,t,r,n){var o,i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new xp.Buf8(i.wsize)),n>=i.wsize?(xp.arraySet(i.window,t,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>n&&(o=n),xp.arraySet(i.window,t,r-n,o,i.wnext),n-=o,n?(xp.arraySet(i.window,t,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}function pjt(e,t){var r,n,o,i,a,s,l,c,u,d,f,m,p,h,g=0,y,b,x,C,S,w,A,T,D=new xp.Buf8(4),E,I,k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Kh;r=e.state,r.mode===p1&&(r.mode=Lle),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,d=s,f=l,T=Cw;e:for(;;)switch(r.mode){case WZe:if(r.wrap===0){r.mode=Lle;break}for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0),c=0,u=0,r.mode=xZe;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ks;break}if((c&15)!==bZe){e.msg="unknown compression method",r.mode=ks;break}if(c>>>=4,u-=4,A=(c&15)+8,r.wbits===0)r.wbits=A;else if(A>r.wbits){e.msg="invalid window size",r.mode=ks;break}r.dmax=1<<A,e.adler=r.check=1,r.mode=c&512?IZe:p1,c=0,u=0;break;case xZe:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==bZe){e.msg="unknown compression method",r.mode=ks;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=ks;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0)),c=0,u=0,r.mode=SZe;case SZe:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,D[2]=c>>>16&255,D[3]=c>>>24&255,r.check=Cv(r.check,D,4,0)),c=0,u=0,r.mode=_Ze;case _Ze:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0)),c=0,u=0,r.mode=CZe;case CZe:if(r.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(D[0]=c&255,D[1]=c>>>8&255,r.check=Cv(r.check,D,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=wZe;case wZe:if(r.flags&1024&&(m=r.length,m>s&&(m=s),m&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),xp.arraySet(r.head.extra,n,i,m,A)),r.flags&512&&(r.check=Cv(r.check,n,m,i)),s-=m,i+=m,r.length-=m),r.length))break e;r.length=0,r.mode=TZe;case TZe:if(r.flags&2048){if(s===0)break e;m=0;do A=n[i+m++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A));while(A&&m<s);if(r.flags&512&&(r.check=Cv(r.check,n,m,i)),s-=m,i+=m,A)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=AZe;case AZe:if(r.flags&4096){if(s===0)break e;m=0;do A=n[i+m++],r.head&&A&&r.length<65536&&(r.head.comment+=String.fromCharCode(A));while(A&&m<s);if(r.flags&512&&(r.check=Cv(r.check,n,m,i)),s-=m,i+=m,A)break e}else r.head&&(r.head.comment=null);r.mode=PZe;case PZe:if(r.flags&512){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=ks;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=p1;break;case IZe:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}e.adler=r.check=zZe(c),c=0,u=0,r.mode=Ej;case Ej:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,ojt;e.adler=r.check=1,r.mode=p1;case p1:if(t===rjt||t===Aj)break e;case Lle:if(r.last){c>>>=u&7,u-=u&7,r.mode=Nle;break}for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=EZe;break;case 1:if(mjt(r),r.mode=Pj,t===Aj){c>>>=2,u-=2;break e}break;case 2:r.mode=kZe;break;case 3:e.msg="invalid block type",r.mode=ks}c>>>=2,u-=2;break;case EZe:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=ks;break}if(r.length=c&65535,c=0,u=0,r.mode=Fle,t===Aj)break e;case Fle:r.mode=DZe;case DZe:if(m=r.length,m){if(m>s&&(m=s),m>l&&(m=l),m===0)break e;xp.arraySet(o,n,i,m,a),s-=m,i+=m,l-=m,a+=m,r.length-=m;break}r.mode=p1;break;case kZe:for(;u<14;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ks;break}r.have=0,r.mode=MZe;case MZe:for(;r.have<r.ncode;){for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.lens[k[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[k[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,E={bits:r.lenbits},T=FR(tjt,r.lens,0,19,r.lencode,0,r.work,E),r.lenbits=E.bits,T){e.msg="invalid code lengths set",r.mode=ks;break}r.have=0,r.mode=BZe;case BZe:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[c&(1<<r.lenbits)-1],y=g>>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(x<16)c>>>=y,u-=y,r.lens[r.have++]=x;else{if(x===16){for(I=y+2;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c>>>=y,u-=y,r.have===0){e.msg="invalid bit length repeat",r.mode=ks;break}A=r.lens[r.have-1],m=3+(c&3),c>>>=2,u-=2}else if(x===17){for(I=y+3;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=y,u-=y,A=0,m=3+(c&7),c>>>=3,u-=3}else{for(I=y+7;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=y,u-=y,A=0,m=11+(c&127),c>>>=7,u-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ks;break}for(;m--;)r.lens[r.have++]=A}}if(r.mode===ks)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=ks;break}if(r.lenbits=9,E={bits:r.lenbits},T=FR(jZe,r.lens,0,r.nlen,r.lencode,0,r.work,E),r.lenbits=E.bits,T){e.msg="invalid literal/lengths set",r.mode=ks;break}if(r.distbits=6,r.distcode=r.distdyn,E={bits:r.distbits},T=FR(GZe,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,E),r.distbits=E.bits,T){e.msg="invalid distances set",r.mode=ks;break}if(r.mode=Pj,t===Aj)break e;case Pj:r.mode=Ij;case Ij:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,ejt(e,f),a=e.next_out,o=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,r.mode===p1&&(r.back=-1);break}for(r.back=0;g=r.lencode[c&(1<<r.lenbits)-1],y=g>>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(b&&(b&240)===0){for(C=y,S=b,w=x;g=r.lencode[w+((c&(1<<C+S)-1)>>C)],y=g>>>24,b=g>>>16&255,x=g&65535,!(C+y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,r.length=x,b===0){r.mode=NZe;break}if(b&32){r.back=-1,r.mode=p1;break}if(b&64){e.msg="invalid literal/length code",r.mode=ks;break}r.extra=b&15,r.mode=RZe;case RZe:if(r.extra){for(I=r.extra;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=OZe;case OZe:for(;g=r.distcode[c&(1<<r.distbits)-1],y=g>>>24,b=g>>>16&255,x=g&65535,!(y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if((b&240)===0){for(C=y,S=b,w=x;g=r.distcode[w+((c&(1<<C+S)-1)>>C)],y=g>>>24,b=g>>>16&255,x=g&65535,!(C+y<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,b&64){e.msg="invalid distance code",r.mode=ks;break}r.offset=x,r.extra=b&15,r.mode=LZe;case LZe:if(r.extra){for(I=r.extra;u<I;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ks;break}r.mode=FZe;case FZe:if(l===0)break e;if(m=f-l,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ks;break}m>r.wnext?(m-=r.wnext,p=r.wsize-m):p=r.wnext-m,m>r.length&&(m=r.length),h=r.window}else h=o,p=a-r.offset,m=r.length;m>l&&(m=l),l-=m,r.length-=m;do o[a++]=h[p++];while(--m);r.length===0&&(r.mode=Ij);break;case NZe:if(l===0)break e;o[a++]=r.length,l--,r.mode=Ij;break;case Nle:if(r.wrap){for(;u<32;){if(s===0)break e;s--,c|=n[i++]<<u,u+=8}if(f-=l,e.total_out+=f,r.total+=f,f&&(e.adler=r.check=r.flags?Cv(r.check,o,f,a-f):zle(r.check,o,f,a-f)),f=l,(r.flags?c:zZe(c))!==r.check){e.msg="incorrect data check",r.mode=ks;break}c=0,u=0}r.mode=UZe;case UZe:if(r.wrap&&r.flags){for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=ks;break}c=0,u=0}r.mode=VZe;case VZe:T=njt;break e;case ks:T=HZe;break e;case jle:return qle;case ajt:default:return Kh}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||f!==e.avail_out&&r.mode<ks&&(r.mode<Nle||t!==vZe))&&$Ze(e,e.output,e.next_out,f-e.avail_out)?(r.mode=jle,qle):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,r.total+=f,r.wrap&&f&&(e.adler=r.check=r.flags?Cv(r.check,o,f,e.next_out-f):zle(r.check,o,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===p1?128:0)+(r.mode===Pj||r.mode===Fle?256:0),(d===0&&f===0||t===vZe)&&T===Cw&&(T=ijt),T)}function hjt(e){if(!e||!e.state)return Kh;var t=e.state;return t.window&&(t.window=null),e.state=null,Cw}function gjt(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)===0)?Kh:(r.head=t,t.done=!1,Cw)}function yjt(e,t){var r=t.length,n,o,i;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Ej)?Kh:n.mode===Ej&&(o=1,o=zle(o,t,r,0),o!==n.check)?HZe:(i=$Ze(e,t,r,r),i?(n.mode=jle,qle):(n.havedict=1,Cw))}p0.inflateReset=YZe;p0.inflateReset2=XZe;p0.inflateResetKeep=KZe;p0.inflateInit=fjt;p0.inflateInit2=ZZe;p0.inflate=pjt;p0.inflateEnd=hjt;p0.inflateGetHeader=gjt;p0.inflateSetDictionary=yjt;p0.inflateInfo="pako inflate (from Nodeca project)"});var Gle=ve((s0o,JZe)=>{"use strict";JZe.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var t$e=ve((l0o,e$e)=>{"use strict";function vjt(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e$e.exports=vjt});var n$e=ve(UR=>{"use strict";var q3=QZe(),NR=d1(),Dj=Ele(),Gl=Gle(),Hle=yj(),bjt=Dle(),xjt=t$e(),r$e=Object.prototype.toString;function ww(e){if(!(this instanceof ww))return new ww(e);this.options=NR.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bjt,this.strm.avail_out=0;var r=q3.inflateInit2(this.strm,t.windowBits);if(r!==Gl.Z_OK)throw new Error(Hle[r]);if(this.header=new xjt,q3.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Dj.string2buf(t.dictionary):r$e.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=q3.inflateSetDictionary(this.strm,t.dictionary),r!==Gl.Z_OK)))throw new Error(Hle[r])}ww.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,i,a,s,l,c,u=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?Gl.Z_FINISH:Gl.Z_NO_FLUSH,typeof e=="string"?r.input=Dj.binstring2buf(e):r$e.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new NR.Buf8(n),r.next_out=0,r.avail_out=n),i=q3.inflate(r,Gl.Z_NO_FLUSH),i===Gl.Z_NEED_DICT&&o&&(i=q3.inflateSetDictionary(this.strm,o)),i===Gl.Z_BUF_ERROR&&u===!0&&(i=Gl.Z_OK,u=!1),i!==Gl.Z_STREAM_END&&i!==Gl.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(r.avail_out===0||i===Gl.Z_STREAM_END||r.avail_in===0&&(a===Gl.Z_FINISH||a===Gl.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=Dj.utf8border(r.output,r.next_out),l=r.next_out-s,c=Dj.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&NR.arraySet(r.output,r.output,s,l,0),this.onData(c)):this.onData(NR.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&i!==Gl.Z_STREAM_END);return i===Gl.Z_STREAM_END&&(a=Gl.Z_FINISH),a===Gl.Z_FINISH?(i=q3.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Gl.Z_OK):(a===Gl.Z_SYNC_FLUSH&&(this.onEnd(Gl.Z_OK),r.avail_out=0),!0)};ww.prototype.onData=function(e){this.chunks.push(e)};ww.prototype.onEnd=function(e){e===Gl.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=NR.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Wle(e,t){var r=new ww(t);if(r.push(e,!0),r.err)throw r.msg||Hle[r.err];return r.result}function Sjt(e,t){return t=t||{},t.raw=!0,Wle(e,t)}UR.Inflate=ww;UR.inflate=Wle;UR.inflateRaw=Sjt;UR.ungzip=Wle});var a$e=ve((u0o,i$e)=>{"use strict";var _jt=d1().assign,Cjt=lZe(),wjt=n$e(),Tjt=Gle(),o$e={};_jt(o$e,Cjt,wjt,Tjt);i$e.exports=o$e});var Kle=ve(kj=>{"use strict";Object.defineProperty(kj,"__esModule",{value:!0});kj.sum=s$e;kj.concatUint8Array=Ajt;function s$e(e){let t=0;for(let r of e)t+=r.length;return t}function Ajt(e){let t=new Uint8Array(s$e(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}});var Yle=ve(j3=>{"use strict";var Pjt=j3&&j3.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j3,"__esModule",{value:!0});j3.unzip=Djt;j3.unzipChunkSlice=kjt;var Ijt=Pjt(a$e()),l$e=Kle(),{Z_SYNC_FLUSH:c$e,Inflate:u$e}=Ijt.default;function Ejt(e,t){let r=t.subarray(0,Math.min(32,t.length)),n=0,o=r.length;for(let i=0;i<o;i++)n=(n<<5)-n+r[i]&4294967295;return`${e}_${n}`}async function Djt(e){try{let t,r=0,n,o=[];do{let i=e.subarray(r);if(n=new u$e,{strm:t}=n,n.push(i,c$e),n.err)throw new Error(n.msg);r+=t.next_in,o.push(n.result)}while(t.avail_in);return(0,l$e.concatUint8Array)(o)}catch(t){throw/incorrect header check/.exec(`${t}`)?new Error("problem decompressing block: incorrect gzip header check"):t}}async function kjt(e,t,r){try{let n,{minv:o,maxv:i}=t,a=o.blockPosition,s=o.dataPosition,l=[],c=[],u=[],d=0,f=!1;do{let m=e.subarray(a-o.blockPosition),p=Ejt(a,m),h,g,y=r?.get(p);if(y)h=y.buffer,g=y.nextIn,f=!0;else{let C=new u$e;if({strm:n}=C,C.push(m,c$e),C.err)throw new Error(C.msg);h=C.result,g=n.next_in,f=!1,r?.set(p,{buffer:h,nextIn:g})}l.push(h);let b=h.length;c.push(a),u.push(s),l.length===1&&o.dataPosition&&(l[0]=l[0].subarray(o.dataPosition),b=l[0].length);let x=a;if(a+=g,s+=b,x>=i.blockPosition){l[d]=l[d].subarray(0,i.blockPosition===o.blockPosition?i.dataPosition-o.dataPosition+1:i.dataPosition+1),c.push(a),u.push(s);break}d++}while(f?a<e.length+o.blockPosition:n.avail_in);return{buffer:(0,l$e.concatUint8Array)(l),cpositions:c,dpositions:u}}catch(n){throw/incorrect header check/.exec(`${n}`)?new Error("problem decompressing block: incorrect gzip header check"):n}}});var d$e=ve(VR=>{"use strict";var Mjt=VR&&VR.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(VR,"__esModule",{value:!0});var Bjt=Mjt(bXe()),Rjt=Yle(),Ojt=Kle(),Xle=class{constructor({filehandle:t,gziFilehandle:r}){this.filehandle=t,this.gzi=new Bjt.default({filehandle:r})}async _readAndUncompressBlock(t,r){let n=r;n||(n=(await this.filehandle.stat()).size);let o=n-t,i=await this.filehandle.read(o,t);return(0,Rjt.unzip)(i)}async read(t,r){let n=await this.gzi.getRelevantBlocksForRead(t,r),o=[];for(let i=0;i<n.length-1;i+=1){let a=await this._readAndUncompressBlock(n[i][0],n[i+1][0]),[,s]=n[i],l=s>=r?0:r-s,c=Math.min(r+t,s+a.length)-s;l>=0&&l<a.length&&o.push(a.subarray(l,c))}return(0,Ojt.concatUint8Array)(o)}};VR.default=Xle});var m$e=ve(wv=>{"use strict";var Ljt=wv&&wv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wv,"__esModule",{value:!0});wv.unzipChunkSlice=wv.unzip=wv.BgzfFilehandle=void 0;var Fjt=d$e();Object.defineProperty(wv,"BgzfFilehandle",{enumerable:!0,get:function(){return Ljt(Fjt).default}});var f$e=Yle();Object.defineProperty(wv,"unzip",{enumerable:!0,get:function(){return f$e.unzip}});Object.defineProperty(wv,"unzipChunkSlice",{enumerable:!0,get:function(){return f$e.unzipChunkSlice}})});var p$e=ve($le=>{"use strict";Object.defineProperty($le,"__esModule",{value:!0});$le.default=Njt;var Zle=Wr();function Njt(){let e=(0,Zle.useRef)(null),[t,r]=(0,Zle.useState)({width:void 0,height:void 0});return(0,Zle.useEffect)(()=>{if(!e.current)return;let n=typeof window<"u"&&"ResizeObserver"in window?window.ResizeObserver:void 0;if(!n)return;let o=new n(i=>{r({width:i[0].contentRect.width,height:i[0].contentRect.height})});return o.observe(e.current),()=>{o.disconnect()}},[]),[e,t]}});var g$e=ve((g0o,h$e)=>{h$e.exports=JBrowseExports["react-dom"]});var rce=ve(Tw=>{Object.defineProperty(Tw,"__esModule",{value:!0});var Ujt={grad:.9,turn:360,rad:360/(2*Math.PI)},h1=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Iu=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},Yh=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},w$e=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},y$e=function(e){return{r:Yh(e.r,0,255),g:Yh(e.g,0,255),b:Yh(e.b,0,255),a:Yh(e.a)}},Qle=function(e){return{r:Iu(e.r),g:Iu(e.g),b:Iu(e.b),a:Iu(e.a,3)}},Vjt=/^#([0-9a-f]{3,8})$/i,Mj=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},T$e=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=Math.max(t,r,n),a=i-Math.min(t,r,n),s=a?i===t?(r-n)/a:i===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:o}},A$e=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var i=Math.floor(t),a=n*(1-r),s=n*(1-(t-i)*r),l=n*(1-(1-t+i)*r),c=i%6;return{r:255*[n,s,a,a,l,n][c],g:255*[l,n,n,s,a,a][c],b:255*[a,a,l,n,n,s][c],a:o}},v$e=function(e){return{h:w$e(e.h),s:Yh(e.s,0,100),l:Yh(e.l,0,100),a:Yh(e.a)}},b$e=function(e){return{h:Iu(e.h),s:Iu(e.s),l:Iu(e.l),a:Iu(e.a,3)}},x$e=function(e){return A$e((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},zR=function(e){return{h:(t=T$e(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},zjt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qjt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jjt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gjt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tce={string:[[function(e){var t=Vjt.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Iu(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Iu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=jjt.exec(e)||Gjt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:y$e({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=zjt.exec(e)||qjt.exec(e);if(!t)return null;var r,n,o=v$e({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(Ujt[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return x$e(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=o===void 0?1:o;return h1(t)&&h1(r)&&h1(n)?y$e({r:Number(t),g:Number(r),b:Number(n),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,i=o===void 0?1:o;if(!h1(t)||!h1(r)||!h1(n))return null;var a=v$e({h:Number(t),s:Number(r),l:Number(n),a:Number(i)});return x$e(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,i=o===void 0?1:o;if(!h1(t)||!h1(r)||!h1(n))return null;var a=(function(s){return{h:w$e(s.h),s:Yh(s.s,0,100),v:Yh(s.v,0,100),a:Yh(s.a)}})({h:Number(t),s:Number(r),v:Number(n),a:Number(i)});return A$e(a)},"hsv"]]},S$e=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},P$e=function(e){return typeof e=="string"?S$e(e.trim(),tce.string):typeof e=="object"&&e!==null?S$e(e,tce.object):[null,void 0]},Jle=function(e,t){var r=zR(e);return{h:r.h,s:Yh(r.s+100*t,0,100),l:r.l,a:r.a}},ece=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},_$e=function(e,t){var r=zR(e);return{h:r.h,s:r.s,l:Yh(r.l+100*t,0,100),a:r.a}},qR=(function(){function e(t){this.parsed=P$e(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Iu(ece(this.rgba),2)},e.prototype.isDark=function(){return ece(this.rgba)<.5},e.prototype.isLight=function(){return ece(this.rgba)>=.5},e.prototype.toHex=function(){return t=Qle(this.rgba),r=t.r,n=t.g,o=t.b,a=(i=t.a)<1?Mj(Iu(255*i)):"","#"+Mj(r)+Mj(n)+Mj(o)+a;var t,r,n,o,i,a},e.prototype.toRgb=function(){return Qle(this.rgba)},e.prototype.toRgbString=function(){return t=Qle(this.rgba),r=t.r,n=t.g,o=t.b,(i=t.a)<1?"rgba("+r+", "+n+", "+o+", "+i+")":"rgb("+r+", "+n+", "+o+")";var t,r,n,o,i},e.prototype.toHsl=function(){return b$e(zR(this.rgba))},e.prototype.toHslString=function(){return t=b$e(zR(this.rgba)),r=t.h,n=t.s,o=t.l,(i=t.a)<1?"hsla("+r+", "+n+"%, "+o+"%, "+i+")":"hsl("+r+", "+n+"%, "+o+"%)";var t,r,n,o,i},e.prototype.toHsv=function(){return t=T$e(this.rgba),{h:Iu(t.h),s:Iu(t.s),v:Iu(t.v),a:Iu(t.a,3)};var t},e.prototype.invert=function(){return Tv({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),Tv(Jle(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),Tv(Jle(this.rgba,-t))},e.prototype.grayscale=function(){return Tv(Jle(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),Tv(_$e(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),Tv(_$e(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?Tv({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):Iu(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=zR(this.rgba);return typeof t=="number"?Tv({h:t,s:r.s,l:r.l,a:r.a}):Iu(r.h)},e.prototype.isEqual=function(t){return this.toHex()===Tv(t).toHex()},e})(),Tv=function(e){return e instanceof qR?e:new qR(e)},C$e=[];Tw.Colord=qR,Tw.colord=Tv,Tw.extend=function(e){e.forEach(function(t){C$e.indexOf(t)<0&&(t(qR,tce),C$e.push(t))})},Tw.getFormat=function(e){return P$e(e)[1]},Tw.random=function(){return new qR({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}});var D$e=ve((v0o,E$e)=>{var Av=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},nce=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},oce=function(e){return 255*(e>.0031308?1.055*Math.pow(e,.4166666666666667)-.055:12.92*e)},ice=96.422,ace=100,sce=82.521,Hjt=function(e){var t,r,n={x:.9555766*(t=e).x+-.0230393*t.y+.0631636*t.z,y:-.0282895*t.x+1.0099416*t.y+.0210077*t.z,z:.0122982*t.x+-.020483*t.y+1.3299098*t.z};return r={r:oce(.032404542*n.x-.015371385*n.y-.004985314*n.z),g:oce(-.00969266*n.x+.018760108*n.y+41556e-8*n.z),b:oce(556434e-9*n.x-.002040259*n.y+.010572252*n.z),a:e.a},{r:Av(r.r,0,255),g:Av(r.g,0,255),b:Av(r.b,0,255),a:Av(r.a)}},Wjt=function(e){var t=nce(e.r),r=nce(e.g),n=nce(e.b);return(function(o){return{x:Av(o.x,0,ice),y:Av(o.y,0,ace),z:Av(o.z,0,sce),a:Av(o.a)}})((function(o){return{x:1.0478112*o.x+.0228866*o.y+-.050127*o.z,y:.0295424*o.x+.9904844*o.y+-.0170491*o.z,z:-.0092345*o.x+.0150436*o.y+.7521316*o.z,a:o.a}})({x:100*(.4124564*t+.3575761*r+.1804375*n),y:100*(.2126729*t+.7151522*r+.072175*n),z:100*(.0193339*t+.119192*r+.9503041*n),a:e.a}))},jR=216/24389,G3=24389/27,I$e=function(e){var t=Wjt(e),r=t.x/ice,n=t.y/ace,o=t.z/sce;return r=r>jR?Math.cbrt(r):(G3*r+16)/116,{l:116*(n=n>jR?Math.cbrt(n):(G3*n+16)/116)-16,a:500*(r-n),b:200*(n-(o=o>jR?Math.cbrt(o):(G3*o+16)/116)),alpha:t.a}},Kjt=function(e,t,r){var n,o=I$e(e),i=I$e(t);return(function(a){var s=(a.l+16)/116,l=a.a/500+s,c=s-a.b/200;return Hjt({x:(Math.pow(l,3)>jR?Math.pow(l,3):(116*l-16)/G3)*ice,y:(a.l>8?Math.pow((a.l+16)/116,3):a.l/G3)*ace,z:(Math.pow(c,3)>jR?Math.pow(c,3):(116*c-16)/G3)*sce,a:a.alpha})})({l:Av((n={l:o.l*(1-r)+i.l*r,a:o.a*(1-r)+i.a*r,b:o.b*(1-r)+i.b*r,alpha:o.alpha*(1-r)+i.alpha*r}).l,0,400),a:n.a,b:n.b,alpha:Av(n.alpha)})};E$e.exports=function(e){function t(r,n,o){o===void 0&&(o=5);for(var i=[],a=1/(o-1),s=0;s<=o-1;s++)i.push(r.mix(n,a*s));return i}e.prototype.mix=function(r,n){n===void 0&&(n=.5);var o=r instanceof e?r:new e(r),i=Kjt(this.toRgb(),o.toRgb(),n);return new e(i)},e.prototype.tints=function(r){return t(this,"#fff",r)},e.prototype.shades=function(r){return t(this,"#000",r)},e.prototype.tones=function(r){return t(this,"#808080",r)}}});var M$e=ve((b0o,k$e)=>{k$e.exports=function(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var o in r)n[r[o]]=o;var i={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,l,c=n[this.toHex()];if(c)return c;if(a?.closest){var u=this.toRgb(),d=1/0,f="black";if(!i.length)for(var m in r)i[m]=new e(r[m]).toRgb();for(var p in r){var h=(s=u,l=i[p],Math.pow(s.r-l.r,2)+Math.pow(s.g-l.g,2)+Math.pow(s.b-l.b,2));h<d&&(d=h,f=p)}return f}},t.string.push([function(a){var s=a.toLowerCase(),l=s==="transparent"?"#0000":r[s];return l?new e(l).toRgb():null},"name"])}});var O$e=ve(h_=>{"use strict";var B$e=h_&&h_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h_,"__esModule",{value:!0});h_.colord=h_.Colord=void 0;var Yjt=rce(),Xjt=B$e(D$e()),Zjt=B$e(M$e());(0,Yjt.extend)([Xjt.default,Zjt.default]);var R$e=rce();Object.defineProperty(h_,"Colord",{enumerable:!0,get:function(){return R$e.Colord}});Object.defineProperty(h_,"colord",{enumerable:!0,get:function(){return R$e.colord}})});var lce=ve(GR=>{"use strict";Object.defineProperty(GR,"__esModule",{value:!0});GR.createStopToken=Qjt;GR.stopStopToken=Jjt;GR.checkStopToken=e9t;function $jt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Qjt(){var e;return((e=URL.createObjectURL)===null||e===void 0?void 0:e.call(URL,new Blob))||`${Math.random()}`}function Jjt(e){var t;(t=URL.revokeObjectURL)===null||t===void 0||t.call(URL,e)}function e9t(e){if(typeof jest>"u"&&e!==void 0&&$jt()){let t=new XMLHttpRequest;t.open("GET",e,!1);try{t.send(null)}catch{throw new Error("aborted")}}}});var F$e=ve(L$e=>{"use strict";Object.defineProperty(L$e,"__esModule",{value:!0})});var G$e=ve((C0o,j$e)=>{"use strict";var z$e=(e,t)=>e>t?1:e<t?-1:0,cce=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),N$e="eexxaacctt",t9t=/\p{P}/gu,r9t=["en",{numeric:!0,sensitivity:"base"}],H3=(e,t,r)=>e.replace("A-Z",t).replace("a-z",r),U$e={unicode:!1,alpha:null,interSplit:"[^A-Za-z\\d']+",intraSplit:"[a-z][A-Z]",interBound:"[^A-Za-z\\d]",intraBound:"[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:1/0,intraChars:"[a-z\\d']",intraIns:null,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,1/0],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,r)=>!0,toUpper:e=>e.toLocaleUpperCase(),toLower:e=>e.toLocaleLowerCase(),compare:null,sort:(e,t,r,n=z$e)=>{let{idx:o,chars:i,terms:a,interLft2:s,interLft1:l,start:c,intraIns:u,interIns:d,cases:f}=e;return o.map((m,p)=>p).sort((m,p)=>i[p]-i[m]||u[m]-u[p]||a[p]+s[p]+.5*l[p]-(a[m]+s[m]+.5*l[m])||d[m]-d[p]||c[m]-c[p]||f[p]-f[m]||n(t[o[m]],t[o[p]]))}},uce=(e,t)=>t==0?"":t==1?e+"??":t==1/0?e+"*?":e+`{0,${t}}?`,V$e="(?:\\b|_)";function Bj(e){e=Object.assign({},U$e,e);let{unicode:t,interLft:r,interRgt:n,intraMode:o,intraSlice:i,intraIns:a,intraSub:s,intraTrn:l,intraDel:c,intraContr:u,intraSplit:d,interSplit:f,intraBound:m,interBound:p,intraChars:h,toUpper:g,toLower:y,compare:b}=e;a??=o,s??=o,l??=o,c??=o,b??=typeof Intl>"u"?z$e:new Intl.Collator(...r9t).compare;let x=e.letters??e.alpha;if(x!=null){let oe=g(x),X=y(x);f=H3(f,oe,X),d=H3(d,oe,X),p=H3(p,oe,X),m=H3(m,oe,X),h=H3(h,oe,X),u=H3(u,oe,X)}let C=t?"u":"",S='".+?"',w=new RegExp(S,"gi"+C),A=new RegExp(`(?:\\s+|^)-(?:${h}+|${S})`,"gi"+C),{intraRules:T}=e;T==null&&(T=oe=>{let X=U$e.intraSlice,Y=0,ne=0,K=0,$=0;if(/[^\d]/.test(oe)){let Z=oe.length;Z<=4?Z>=3&&(K=Math.min(l,1),Z==4&&(Y=Math.min(a,1))):(X=i,Y=a,ne=s,K=l,$=c)}return{intraSlice:X,intraIns:Y,intraSub:ne,intraTrn:K,intraDel:$}});let D=!!d,E=new RegExp(d,"g"+C),I=new RegExp(f,"g"+C),k=new RegExp("^"+f+"|"+f+"$","g"+C),R=new RegExp(u,"gi"+C),B=(oe,X=!1)=>{let Y=[];oe=oe.replace(w,K=>(Y.push(K),N$e)),oe=oe.replace(k,""),X||(oe=y(oe)),D&&(oe=oe.replace(E,K=>K[0]+" "+K[1]));let ne=0;return oe.split(I).filter(K=>K!="").map(K=>K===N$e?Y[ne++]:K)},O=/[^\d]+|\d+/g,F=(oe,X=0,Y=!1)=>{let ne=B(oe);if(ne.length==0)return[];let K=Array(ne.length).fill("");ne=ne.map((ae,ye)=>ae.replace(R,we=>(K[ye]=we,"")));let $;if(o==1)$=ne.map((ae,ye)=>{if(ae[0]==='"')return cce(ae.slice(1,-1));let we="";for(let re of ae.matchAll(O)){let ee=re[0],{intraSlice:le,intraIns:pe,intraSub:ke,intraTrn:Ve,intraDel:Xe}=T(ee);if(pe+ke+Ve+Xe==0)we+=ee+K[ye];else{let[pt,_e]=le,Ie=ee.slice(0,pt),Re=ee.slice(_e),ze=ee.slice(pt,_e);pe==1&&Ie.length==1&&Ie!=ze[0]&&(Ie+="(?!"+Ie+")");let N=ze.length,J=[ee];if(ke)for(let Ae=0;Ae<N;Ae++)J.push(Ie+ze.slice(0,Ae)+h+ze.slice(Ae+1)+Re);if(Ve)for(let Ae=0;Ae<N-1;Ae++)ze[Ae]!=ze[Ae+1]&&J.push(Ie+ze.slice(0,Ae)+ze[Ae+1]+ze[Ae]+ze.slice(Ae+2)+Re);if(Xe)for(let Ae=0;Ae<N;Ae++)J.push(Ie+ze.slice(0,Ae+1)+"?"+ze.slice(Ae+1)+Re);if(pe){let Ae=uce(h,1);for(let qe=0;qe<N;qe++)J.push(Ie+ze.slice(0,qe)+Ae+ze.slice(qe)+Re)}we+="(?:"+J.join("|")+")"+K[ye]}}return we});else{let ae=uce(h,a);X==2&&a>0&&(ae=")("+ae+")("),$=ne.map((ye,we)=>ye[0]==='"'?cce(ye.slice(1,-1)):ye.split("").map((re,ee,le)=>(a==1&&ee==0&&le.length>1&&re!=le[ee+1]&&(re+="(?!"+re+")"),re)).join(ae)+K[we])}let Z=r==2?V$e:"",de=n==2?V$e:"",Q=de+uce(e.interChars,e.interIns)+Z;return X>0?Y?$=Z+"("+$.join(")"+de+"|"+Z+"(")+")"+de:($="("+$.join(")("+Q+")(")+")",$="(.??"+Z+")"+$+"("+de+".*)"):($=$.join(Q),$=Z+$+de),[new RegExp($,"i"+C),ne,K]},q=(oe,X,Y)=>{let[ne]=F(X);if(ne==null)return null;let K=[];if(Y!=null)for(let $=0;$<Y.length;$++){let Z=Y[$];ne.test(oe[Z])&&K.push(Z)}else for(let $=0;$<oe.length;$++)ne.test(oe[$])&&K.push($);return K},W=!!m,j=new RegExp(p,C),L=new RegExp(m,C),V=(oe,X,Y)=>{let[ne,K,$]=F(Y,1),Z=B(Y,!0),[de]=F(Y,2),Q=K.length,ae=Array(Q),ye=Array(Q);for(let ke=0;ke<Q;ke++){let Ve=K[ke],Xe=Z[ke],pt=Ve[0]=='"'?Ve.slice(1,-1):Ve+$[ke],_e=Xe[0]=='"'?Xe.slice(1,-1):Xe+$[ke];ae[ke]=pt,ye[ke]=_e}let we=oe.length,re=Array(we).fill(0),ee={idx:Array(we),start:re.slice(),chars:re.slice(),cases:re.slice(),terms:re.slice(),interIns:re.slice(),intraIns:re.slice(),interLft2:re.slice(),interRgt2:re.slice(),interLft1:re.slice(),interRgt1:re.slice(),ranges:Array(we)},le=r==1||n==1,pe=0;for(let ke=0;ke<oe.length;ke++){let Ve=X[oe[ke]],Xe=Ve.match(ne),pt=Xe.index+Xe[1].length,_e=pt,Ie=!1,Re=0,ze=0,N=0,J=0,Ae=0,qe=0,Be=0,Qe=0,at=0,ft=[];for(let mt=0,dt=2;mt<Q;mt++,dt+=2){let Pt=y(Xe[dt]),Lt=ae[mt],Jt=ye[mt],Rt=Lt.length,tr=Pt.length,Kt=Pt==Lt;if(Xe[dt]==Jt&&Be++,!Kt&&Xe[dt+1].length>=Rt){let vr=y(Xe[dt+1]).indexOf(Lt);vr>-1&&(ft.push(_e,tr,vr,Rt),_e+=U(Xe,dt,vr,Rt),Pt=Lt,tr=Rt,Kt=!0,mt==0&&(pt=_e))}if(le||Kt){let vr=_e-1,mn=_e+tr,Zn=!1,jr=!1;if(vr==-1||j.test(Ve[vr]))Kt&&Re++,Zn=!0;else{if(r==2){Ie=!0;break}if(W&&L.test(Ve[vr]+Ve[vr+1]))Kt&&ze++,Zn=!0;else if(r==1){let me=Xe[dt+1],Te=_e+tr;if(me.length>=Rt){let Pe=0,it=!1,Mt=new RegExp(Lt,"ig"+C),Et;for(;Et=Mt.exec(me);){Pe=Et.index;let Nr=Te+Pe,pn=Nr-1;if(pn==-1||j.test(Ve[pn])){Re++,it=!0;break}else if(L.test(Ve[pn]+Ve[Nr])){ze++,it=!0;break}}it&&(Zn=!0,ft.push(_e,tr,Pe,Rt),_e+=U(Xe,dt,Pe,Rt),Pt=Lt,tr=Rt,Kt=!0,mt==0&&(pt=_e))}if(!Zn){Ie=!0;break}}}if(mn==Ve.length||j.test(Ve[mn]))Kt&&N++,jr=!0;else{if(n==2){Ie=!0;break}if(W&&L.test(Ve[mn-1]+Ve[mn]))Kt&&J++,jr=!0;else if(n==1){Ie=!0;break}}Kt&&(Ae+=Rt,Zn&&jr&&qe++)}if(tr>Rt&&(at+=tr-Rt),mt>0&&(Qe+=Xe[dt-1].length),!e.intraFilt(Lt,Pt,_e)){Ie=!0;break}mt<Q-1&&(_e+=tr+Xe[dt+1].length)}if(!Ie){ee.idx[pe]=oe[ke],ee.interLft2[pe]=Re,ee.interLft1[pe]=ze,ee.interRgt2[pe]=N,ee.interRgt1[pe]=J,ee.chars[pe]=Ae,ee.terms[pe]=qe,ee.cases[pe]=Be,ee.interIns[pe]=Qe,ee.intraIns[pe]=at,ee.start[pe]=pt;let mt=Ve.match(de),dt=mt.index+mt[1].length,Pt=ft.length,Lt=Pt>0?0:1/0,Jt=Pt-4;for(let vr=2;vr<mt.length;){let mn=mt[vr].length;if(Lt<=Jt&&ft[Lt]==dt){let Zn=ft[Lt+1],jr=ft[Lt+2],me=ft[Lt+3],Te=vr,Pe="";for(let it=0;it<Zn;Te++)Pe+=mt[Te],it+=mt[Te].length;mt.splice(vr,Te-vr,Pe),dt+=U(mt,vr,jr,me),Lt+=4}else dt+=mn,vr++}dt=mt.index+mt[1].length;let Rt=ee.ranges[pe]=[],tr=dt,Kt=dt;for(let vr=2;vr<mt.length;vr++){let mn=mt[vr].length;dt+=mn,vr%2==0?Kt=dt:mn>0&&(Rt.push(tr,Kt),tr=Kt=dt)}Kt>tr&&Rt.push(tr,Kt),pe++}}if(pe<oe.length)for(let ke in ee)ee[ke]=ee[ke].slice(0,pe);return ee},U=(oe,X,Y,ne)=>{let K=oe[X]+oe[X+1].slice(0,Y);return oe[X-1]+=K,oe[X]=oe[X+1].slice(Y,Y+ne),oe[X+1]=oe[X+1].slice(Y+ne),K.length},z=5,ie=(oe,X,Y,ne=1e3,K)=>{Y=Y?Y===!0?z:Y:0;let $=null,Z=null,de=[];X=X.replace(A,ee=>{let le=ee.trim().slice(1);return le=le[0]==='"'?cce(le.slice(1,-1)):le.replace(t9t,""),le!=""&&de.push(le),""});let Q=B(X),ae;if(de.length>0){if(ae=new RegExp(de.join("|"),"i"+C),Q.length==0){let ee=[];for(let le=0;le<oe.length;le++)ae.test(oe[le])||ee.push(le);return[ee,null,null]}}else if(Q.length==0)return[null,null,null];if(Y>0){let ee=B(X);if(ee.length>1){let le=ee.slice().sort((ke,Ve)=>Ve.length-ke.length);for(let ke=0;ke<le.length;ke++){if(K?.length==0)return[[],null,null];K=q(oe,le[ke],K)}if(ee.length>Y)return[K,null,null];$=q$e(ee).map(ke=>ke.join(" ")),Z=[];let pe=new Set;for(let ke=0;ke<$.length;ke++)if(pe.size<K.length){let Ve=K.filter(pt=>!pe.has(pt)),Xe=q(oe,$[ke],Ve);for(let pt=0;pt<Xe.length;pt++)pe.add(Xe[pt]);Z.push(Xe)}else Z.push([])}}$==null&&($=[X],Z=[K?.length>0?K:q(oe,X)]);let ye=null,we=null;if(de.length>0&&(Z=Z.map(ee=>ee.filter(le=>!ae.test(oe[le])))),Z.reduce((ee,le)=>ee+le.length,0)<=ne){ye={},we=[];for(let ee=0;ee<Z.length;ee++){let le=Z[ee];if(le==null||le.length==0)continue;let pe=$[ee],ke=V(le,oe,pe),Ve=e.sort(ke,oe,pe,b);if(ee>0)for(let Xe=0;Xe<Ve.length;Xe++)Ve[Xe]+=we.length;for(let Xe in ke)ye[Xe]=(ye[Xe]??[]).concat(ke[Xe]);we=we.concat(Ve)}}return[[].concat(...Z),ye,we]};return{search:(...oe)=>ie(...oe),split:B,filter:q,info:V,sort:e.sort}}var n9t=(()=>{let e={A:"\xC1\xC0\xC3\xC2\xC4\u0104\u0102\xC5",a:"\xE1\xE0\xE3\xE2\xE4\u0105\u0103\xE5",E:"\xC9\xC8\xCA\xCB\u0116\u011A",e:"\xE9\xE8\xEA\xEB\u0119\u011B",I:"\xCD\xCC\xCE\xCF\u012E\u0130",i:"\xED\xEC\xEE\xEF\u012F\u0131",O:"\xD3\xD2\xD4\xD5\xD6",o:"\xF3\xF2\xF4\xF5\xF6",U:"\xDA\xD9\xDB\xDC\u016A\u0172\u016E\u0170",u:"\xFA\xF9\xFB\xFC\u016B\u0173\u016F\u0171",C:"\xC7\u010C\u0106",c:"\xE7\u010D\u0107",D:"\u010E",d:"\u010F",G:"\u011E",g:"\u011F",L:"\u0141",l:"\u0142",N:"\xD1\u0143\u0147",n:"\xF1\u0144\u0148",S:"\u0160\u015A\u0218\u015E",s:"\u0161\u015B\u0219\u015F",T:"\u0162\u021A\u0164",t:"\u0163\u021B\u0165",Y:"\xDD",y:"\xFD",Z:"\u017B\u0179\u017D",z:"\u017C\u017A\u017E"},t={},r="";for(let i in e)e[i].split("").forEach(a=>{r+=a,t[a]=i});let n=new RegExp(`[${r}]`,"g"),o=i=>t[i];return i=>{if(typeof i=="string")return i.replace(n,o);let a=Array(i.length);for(let s=0;s<i.length;s++)a[s]=i[s].replace(n,o);return a}})();function q$e(e){e=e.slice();let t=e.length,r=[e.slice()],n=new Array(t).fill(0),o=1,i,a;for(;o<t;)n[o]<o?(i=o%2&&n[o],a=e[o],e[o]=e[i],e[i]=a,++n[o],o=1,r.push(e.slice())):(n[o]=0,++o);return r}var o9t=(e,t)=>t?`<mark>${e}</mark>`:e,i9t=(e,t)=>e+t;function a9t(e,t,r=o9t,n="",o=i9t){n=o(n,r(e.substring(0,t[0]),!1))??n;for(let i=0;i<t.length;i+=2){let a=t[i],s=t[i+1];n=o(n,r(e.substring(a,s),!0))??n,i<t.length-3&&(n=o(n,r(e.substring(t[i+1],t[i+2]),!1))??n)}return n=o(n,r(e.substring(t[t.length-1]),!1))??n,n}Bj.latinize=n9t;Bj.permute=e=>q$e([...Array(e.length).keys()]).sort((r,n)=>{for(let o=0;o<r.length;o++)if(r[o]!=n[o])return r[o]-n[o];return 0}).map(r=>r.map(n=>e[n]));Bj.highlight=a9t;j$e.exports=Bj});var fce=ve((w0o,g1)=>{function dce(e){"@babel/helpers - typeof";return g1.exports=dce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g1.exports.__esModule=!0,g1.exports.default=g1.exports,dce(e)}g1.exports=dce,g1.exports.__esModule=!0,g1.exports.default=g1.exports});var W$e=ve((T0o,HR)=>{var H$e=fce().default;function s9t(e,t){if(H$e(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(H$e(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}HR.exports=s9t,HR.exports.__esModule=!0,HR.exports.default=HR.exports});var mce=ve((A0o,WR)=>{var l9t=fce().default,c9t=W$e();function u9t(e){var t=c9t(e,"string");return l9t(t)=="symbol"?t:t+""}WR.exports=u9t,WR.exports.__esModule=!0,WR.exports.default=WR.exports});var K$e=ve((P0o,KR)=>{var d9t=mce();function f9t(e,t,r){return(t=d9t(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}KR.exports=f9t,KR.exports.__esModule=!0,KR.exports.default=KR.exports});var Aw=ve((I0o,YR)=>{function m9t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}YR.exports=m9t,YR.exports.__esModule=!0,YR.exports.default=YR.exports});var Pw=ve((E0o,XR)=>{var p9t=mce();function Y$e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p9t(n.key),n)}}function h9t(e,t,r){return t&&Y$e(e.prototype,t),r&&Y$e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}XR.exports=h9t,XR.exports.__esModule=!0,XR.exports.default=XR.exports});var pce=ve((D0o,ZR)=>{function g9t(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}ZR.exports=g9t,ZR.exports.__esModule=!0,ZR.exports.default=ZR.exports});var X$e=ve((k0o,$R)=>{var y9t=pce();function v9t(e){if(Array.isArray(e))return y9t(e)}$R.exports=v9t,$R.exports.__esModule=!0,$R.exports.default=$R.exports});var Z$e=ve((M0o,QR)=>{function b9t(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}QR.exports=b9t,QR.exports.__esModule=!0,QR.exports.default=QR.exports});var Q$e=ve((B0o,JR)=>{var $$e=pce();function x9t(e,t){if(e){if(typeof e=="string")return $$e(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$$e(e,t):void 0}}JR.exports=x9t,JR.exports.__esModule=!0,JR.exports.default=JR.exports});var J$e=ve((R0o,eO)=>{function S9t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
7347
7347
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}eO.exports=S9t,eO.exports.__esModule=!0,eO.exports.default=eO.exports});var eQe=ve((O0o,tO)=>{var _9t=X$e(),C9t=Z$e(),w9t=Q$e(),T9t=J$e();function A9t(e){return _9t(e)||C9t(e)||w9t(e)||T9t()}tO.exports=A9t,tO.exports.__esModule=!0,tO.exports.default=tO.exports});var tQe=ve(Pv=>{"use strict";var P9t=Sm(),I9t=P9t(eQe()),E9t={functions:"Jexl Function",transforms:"Transform"};Pv.ArrayLiteral=function(e){return this.evalArray(e.value)};Pv.BinaryExpression=function(e){var t=this,r=this._grammar.elements[e.operator];if(r.evalOnDemand){var n=function(i){return{eval:function(){return t.eval(i)}}};return r.evalOnDemand(n(e.left),n(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then(function(o){return r.eval(o[0],o[1])})};Pv.ConditionalExpression=function(e){var t=this;return this.eval(e.test).then(function(r){return r?e.consequent?t.eval(e.consequent):r:t.eval(e.alternate)})};Pv.FilterExpression=function(e){var t=this;return this.eval(e.subject).then(function(r){return e.relative?t._filterRelative(r,e.expr):t._filterStatic(r,e.expr)})};Pv.Identifier=function(e){return e.from?this.eval(e.from).then(function(t){if(t!=null)return Array.isArray(t)&&(t=t[0]),t[e.value]}):e.relative?this._relContext[e.value]:this._context[e.value]};Pv.Literal=function(e){return e.value};Pv.ObjectLiteral=function(e){return this.evalMap(e.value)};Pv.FunctionCall=function(e){var t=E9t[e.pool];if(!t)throw new Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var r=this._grammar[e.pool],n=r[e.name];if(!n)throw new Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then(function(o){return n.apply(void 0,(0,I9t.default)(o))})};Pv.UnaryExpression=function(e){var t=this;return this.eval(e.right).then(function(r){return t._grammar.elements[e.operator].eval(r)})}});var oQe=ve((F0o,nQe)=>{"use strict";var rQe=Sm(),D9t=rQe(Aw()),k9t=rQe(Pw()),M9t=tQe(),B9t=(function(){function e(t,r,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Promise;(0,D9t.default)(this,e),this._grammar=t,this._context=r||{},this._relContext=n||this._context,this.Promise=o}return(0,k9t.default)(e,[{key:"eval",value:function(r){var n=this;return this.Promise.resolve().then(function(){return M9t[r.type].call(n,r)})}},{key:"evalArray",value:function(r){var n=this;return this.Promise.all(r.map(function(o){return n.eval(o)}))}},{key:"evalMap",value:function(r){var n=this,o=Object.keys(r),i={},a=o.map(function(s){return n.eval(r[s])});return this.Promise.all(a).then(function(s){return s.forEach(function(l,c){i[o[c]]=l}),i})}},{key:"_filterRelative",value:function(r,n){var o=this,i=[];return Array.isArray(r)||(r=r===void 0?[]:[r]),r.forEach(function(a){var s=new e(o._grammar,o._context,a,o.Promise);i.push(s.eval(n))}),this.Promise.all(i).then(function(a){var s=[];return a.forEach(function(l,c){l&&s.push(r[c])}),s})}},{key:"_filterStatic",value:function(r,n){return this.eval(n).then(function(o){return typeof o=="boolean"?o?r:void 0:r[o]})}}]),e})();nQe.exports=B9t});var lQe=ve((N0o,sQe)=>{"use strict";var aQe=Sm(),R9t=aQe(Aw()),O9t=aQe(Pw()),L9t=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,iQe=/^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,F9t=/\\\\/,N9t=/^\s*$/,U9t=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],V9t=["[a-zA-Z\u0430-\u044F\u0410-\u042F_\xC0-\xD6\xD8-\xF6\xF8-\xFF\\$][a-zA-Z0-9\u0430-\u044F\u0410-\u042F_\xC0-\xD6\xD8-\xF6\xF8-\xFF\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],z9t=["binaryOp","unaryOp","openParen","openBracket","question","colon"],q9t=(function(){function e(t){(0,R9t.default)(this,e),this._grammar=t}return(0,O9t.default)(e,[{key:"getElements",value:function(r){var n=this._getSplitRegex();return r.split(n).filter(function(o){return o})}},{key:"getTokens",value:function(r){for(var n=[],o=!1,i=0;i<r.length;i++)this._isWhitespace(r[i])?n.length&&(n[n.length-1].raw+=r[i]):r[i]==="-"&&this._isNegative(n)?o=!0:(o&&(r[i]="-"+r[i],o=!1),n.push(this._createToken(r[i])));return o&&n.push(this._createToken("-")),n}},{key:"tokenize",value:function(r){var n=this.getElements(r);return this.getTokens(n)}},{key:"_createToken",value:function(r){var n={type:"literal",value:r,raw:r};if(r[0]==='"'||r[0]==="'")n.value=this._unquote(r);else if(r.match(L9t))n.value=parseFloat(r);else if(r==="true"||r==="false")n.value=r==="true";else if(this._grammar.elements[r])n.type=this._grammar.elements[r].type;else if(r.match(iQe))n.type="identifier";else throw new Error("Invalid expression token: ".concat(r));return n}},{key:"_escapeRegExp",value:function(r){return r=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r.match(iQe)&&(r="\\b"+r+"\\b"),r}},{key:"_getSplitRegex",value:function(){var r=this;if(!this._splitRegex){var n=Object.keys(this._grammar.elements).sort(function(o,i){return i.length-o.length}).map(function(o){return r._escapeRegExp(o)},this);this._splitRegex=new RegExp("("+[U9t.join("|"),n.join("|"),V9t.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(r){return r.length?z9t.some(function(n){return n===r[r.length-1].type}):!0}},{key:"_isWhitespace",value:function(r){return!!r.match(N9t)}},{key:"_unquote",value:function(r){var n=r[0],o=new RegExp("\\\\"+n,"g");return r.substr(1,r.length-2).replace(o,n).replace(F9t,"\\")}}]),e})();sQe.exports=q9t});var hce=ve(Fc=>{"use strict";Fc.argVal=function(e){e&&this._cursor.args.push(e)};Fc.arrayStart=function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})};Fc.arrayVal=function(e){e&&this._cursor.value.push(e)};Fc.binaryOp=function(e){for(var t=this._grammar.elements[e.value].precedence||0,r=this._cursor._parent;r&&r.operator&&this._grammar.elements[r.operator].precedence>=t;)this._cursor=r,r=r._parent;var n={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,n),this._cursor=r,this._placeAtCursor(n)};Fc.dot=function(){this._nextIdentEncapsulate=this._cursor&&this._cursor.type!=="UnaryExpression"&&(this._cursor.type!=="BinaryExpression"||this._cursor.type==="BinaryExpression"&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative&&(this._relative=!0)};Fc.filter=function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})};Fc.functionCall=function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})};Fc.identifier=function(e){var t={type:"Identifier",value:e.value};this._nextIdentEncapsulate?(t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1):(this._nextIdentRelative&&(t.relative=!0,this._nextIdentRelative=!1),this._placeAtCursor(t))};Fc.literal=function(e){this._placeAtCursor({type:"Literal",value:e.value})};Fc.objKey=function(e){this._curObjKey=e.value};Fc.objStart=function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})};Fc.objVal=function(e){this._cursor.value[this._curObjKey]=e};Fc.subExpression=function(e){this._placeAtCursor(e)};Fc.ternaryEnd=function(e){this._cursor.alternate=e};Fc.ternaryMid=function(e){this._cursor.consequent=e};Fc.ternaryStart=function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree};Fc.transform=function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})};Fc.unaryOp=function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}});var uQe=ve(cQe=>{"use strict";var Cm=hce();cQe.states={expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:Cm.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:Cm.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:Cm.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:Cm.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:Cm.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:Cm.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:Cm.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:Cm.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:Cm.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:Cm.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:Cm.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:Cm.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:Cm.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:Cm.ternaryEnd,completable:!0}}});var mQe=ve((z0o,fQe)=>{"use strict";var dQe=Sm(),j9t=dQe(Aw()),G9t=dQe(Pw()),H9t=hce(),Rj=uQe().states,W9t=(function(){function e(t,r,n){(0,j9t.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=r||"",this._relative=!1,this._stopMap=n||{}}return(0,G9t.default)(e,[{key:"addToken",value:function(r){if(this._state==="complete")throw new Error("Cannot add a new token to a completed Parser");var n=Rj[this._state],o=this._exprStr;if(this._exprStr+=r.raw,n.subHandler){this._subParser||this._startSubExpression(o);var i=this._subParser.addToken(r);if(i){if(this._endSubExpression(),this._parentStop)return i;this._state=i}}else if(n.tokenTypes[r.type]){var a=n.tokenTypes[r.type],s=H9t[r.type];a.handler&&(s=a.handler),s&&s.call(this,r),a.toState&&(this._state=a.toState)}else{if(this._stopMap[r.type])return this._stopMap[r.type];throw new Error("Token ".concat(r.raw," (").concat(r.type,") unexpected in expression: ").concat(this._exprStr))}return!1}},{key:"addTokens",value:function(r){r.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!Rj[this._state].completable)throw new Error("Unexpected end of expression: ".concat(this._exprStr));return this._subParser&&this._endSubExpression(),this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){Rj[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(r){this._cursor?(this._cursor.right=r,this._setParent(r,this._cursor)):this._tree=r,this._cursor=r}},{key:"_placeBeforeCursor",value:function(r){this._cursor=this._cursor._parent,this._placeAtCursor(r)}},{key:"_setParent",value:function(r,n){Object.defineProperty(r,"_parent",{value:n,writable:!0})}},{key:"_startSubExpression",value:function(r){var n=Rj[this._state].endStates;n||(this._parentStop=!0,n=this._stopMap),this._subParser=new e(this._grammar,r,n)}}]),e})();fQe.exports=W9t});var gQe=ve((q0o,hQe)=>{"use strict";var pQe=Sm(),K9t=pQe(Aw()),Y9t=pQe(Pw()),g_=(function(){function e(t){(0,K9t.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,Y9t.default)(e,[{key:"catch",value:function(r){if(this.error)try{this._resolve(r(this.error))}catch(n){this._reject(n)}return this}},{key:"then",value:function(r,n){if(!this.error)try{this._resolve(r(this.value))}catch(o){this._reject(o)}return n&&this.catch(n),this}},{key:"_reject",value:function(r){this.value=void 0,this.error=r}},{key:"_resolve",value:function(r){r instanceof e?r.error?this._reject(r.error):this._resolve(r.value):(this.value=r,this.error=void 0)}}]),e})();g_.all=function(e){return new g_(function(t){var r=e.map(function(n){for(;n instanceof g_;){if(n.error)throw Error(n.error);n=n.value}return n});t(r)})};g_.resolve=function(e){return new g_(function(t){return t(e)})};g_.reject=function(e){return new g_(function(t,r){return r(e)})};hQe.exports=g_});var bQe=ve((j0o,vQe)=>{"use strict";var yQe=Sm(),X9t=yQe(Aw()),Z9t=yQe(Pw()),$9t=oQe(),Q9t=lQe(),J9t=mQe(),eGt=gQe(),tGt=(function(){function e(t,r){(0,X9t.default)(this,e),this._grammar=t,this._exprStr=r,this._ast=null}return(0,Z9t.default)(e,[{key:"compile",value:function(){var r=new Q9t(this._grammar),n=new J9t(this._grammar),o=r.tokenize(this._exprStr);return n.addTokens(o),this._ast=n.complete(),this}},{key:"eval",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._eval(r,Promise)}},{key:"evalSync",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this._eval(r,eGt);if(n.error)throw n.error;return n.value}},{key:"_eval",value:function(r,n){var o=this;return n.resolve().then(function(){var i=o._getAst(),a=new $9t(o._grammar,r,void 0,n);return a.eval(i)})}},{key:"_getAst",value:function(){return this._ast||this.compile(),this._ast}}]),e})();vQe.exports=tGt});var SQe=ve(xQe=>{"use strict";xQe.getGrammar=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(t,r){return t+r}},"-":{type:"binaryOp",precedence:30,eval:function(t,r){return t-r}},"*":{type:"binaryOp",precedence:40,eval:function(t,r){return t*r}},"/":{type:"binaryOp",precedence:40,eval:function(t,r){return t/r}},"//":{type:"binaryOp",precedence:40,eval:function(t,r){return Math.floor(t/r)}},"%":{type:"binaryOp",precedence:50,eval:function(t,r){return t%r}},"^":{type:"binaryOp",precedence:50,eval:function(t,r){return Math.pow(t,r)}},"==":{type:"binaryOp",precedence:20,eval:function(t,r){return t==r}},"!=":{type:"binaryOp",precedence:20,eval:function(t,r){return t!=r}},">":{type:"binaryOp",precedence:20,eval:function(t,r){return t>r}},">=":{type:"binaryOp",precedence:20,eval:function(t,r){return t>=r}},"<":{type:"binaryOp",precedence:20,eval:function(t,r){return t<r}},"<=":{type:"binaryOp",precedence:20,eval:function(t,r){return t<=r}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(t,r){return t.eval().then(function(n){return n&&r.eval()})}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(t,r){return t.eval().then(function(n){return n||r.eval()})}},in:{type:"binaryOp",precedence:20,eval:function(t,r){return typeof r=="string"?r.indexOf(t)!==-1:Array.isArray(r)?r.some(function(n){return n===t}):!1}},"!":{type:"unaryOp",precedence:1/0,eval:function(t){return!t}}},functions:{},transforms:{}}}});var CQe=ve((H0o,yce)=>{"use strict";var gce=Sm(),rGt=gce(K$e()),nGt=gce(Aw()),oGt=gce(Pw()),iGt=bQe(),aGt=SQe(),sGt=aGt.getGrammar,_Qe=(function(){function e(){(0,nGt.default)(this,e),this.expr=this.expr.bind(this),this._grammar=sGt()}return(0,oGt.default)(e,[{key:"addBinaryOp",value:function(r,n,o,i){this._addGrammarElement(r,(0,rGt.default)({type:"binaryOp",precedence:n},i?"evalOnDemand":"eval",o))}},{key:"addFunction",value:function(r,n){this._grammar.functions[r]=n}},{key:"addFunctions",value:function(r){for(var n in r)this._grammar.functions[n]=r[n]}},{key:"addUnaryOp",value:function(r,n){this._addGrammarElement(r,{type:"unaryOp",weight:1/0,eval:n})}},{key:"addTransform",value:function(r,n){this._grammar.transforms[r]=n}},{key:"addTransforms",value:function(r){for(var n in r)this._grammar.transforms[n]=r[n]}},{key:"compile",value:function(r){var n=this.createExpression(r);return n.compile()}},{key:"createExpression",value:function(r){return new iGt(this._grammar,r)}},{key:"getFunction",value:function(r){return this._grammar.functions[r]}},{key:"getTransform",value:function(r){return this._grammar.transforms[r]}},{key:"eval",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createExpression(r);return o.eval(n)}},{key:"evalSync",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createExpression(r);return o.evalSync(n)}},{key:"expr",value:function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];var a=r.reduce(function(s,l,c){var u=c<o.length?o[c]:"";return s+=l+u,s},"");return this.createExpression(a)}},{key:"removeOp",value:function(r){this._grammar.elements[r]&&(this._grammar.elements[r].type==="binaryOp"||this._grammar.elements[r].type==="unaryOp")&&delete this._grammar.elements[r]}},{key:"_addGrammarElement",value:function(r,n){this._grammar.elements[r]=n}}]),e})();yce.exports=new _Qe;yce.exports.Jexl=_Qe});var wQe=ve(rO=>{"use strict";var lGt=rO&&rO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rO,"__esModule",{value:!0});rO.default=uGt;var cGt=lGt(CQe());function uGt(){let e=new cGt.default.Jexl;return e.addFunction("get",(t,r)=>t.get(r)),e.addFunction("parent",t=>t.parent()),e.addFunction("id",t=>t.id()),e.addFunction("cast",t=>t),e.addFunction("log",t=>(console.log(t),t)),e.addFunction("max",Math.max),e.addFunction("min",Math.min),e.addFunction("sqrt",Math.sqrt),e.addFunction("ceil",Math.ceil),e.addFunction("floor",Math.floor),e.addFunction("round",Math.round),e.addFunction("abs",Math.abs),e.addFunction("log10",Math.log10),e.addFunction("parseInt",Number.parseInt),e.addFunction("parseFloat",Number.parseFloat),e.addFunction("split",(t,r)=>t.split(r)),e.addFunction("charAt",(t,r)=>t.charAt(r)),e.addFunction("charCodeAt",(t,r)=>t.charCodeAt(r)),e.addFunction("codePointAt",(t,r)=>t.codePointAt(r)),e.addFunction("startsWith",(t,r,n)=>t.startsWith(r,n)),e.addFunction("endsWith",(t,r,n)=>t.endsWith(r,n)),e.addFunction("padEnd",(t,r,n)=>t.padEnd(r,n)),e.addFunction("padStart",(t,r,n)=>t.padStart(r,n)),e.addFunction("repeat",(t,r)=>t.repeat(r)),e.addFunction("replace",(t,r,n)=>t.replace(r,n)),e.addFunction("replaceAll",(t,r,n)=>t.replaceAll(r,n)),e.addFunction("slice",(t,r,n)=>t.slice(r,n)),e.addFunction("startsWith",(t,r,n)=>t.startsWith(r,n)),e.addFunction("substring",(t,r,n)=>t.substring(r,n)),e.addFunction("toLowerCase",t=>t.toLowerCase()),e.addFunction("toUpperCase",t=>t.toUpperCase()),e.addFunction("jsonParse",t=>JSON.parse(t)),e.addFunction("trim",t=>t.trim()),e.addFunction("trimEnd",t=>t.trimEnd()),e.addFunction("trimStart",t=>t.trimStart()),e.addFunction("getTag",(t,r)=>{let n=t.get("tags");return n?n[r]:t.get(r)}),e.addBinaryOp("&",15,(t,r)=>t&r),e}});var TQe=ve(nO=>{"use strict";var dGt=nO&&nO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nO,"__esModule",{value:!0});nO.stringToJexlExpression=mGt;var fGt=dGt(wQe()),vce={};function mGt(e,t){let r=`nosig|${e}`;if(!vce[r]){if(!e.startsWith("jexl:"))throw new Error("string does not appear to be in jexl format");let o=e.split("jexl:")[1],i=t?t.compile(o):(0,fGt.default)().compile(o);vce[r]=i}return vce[r]}});var AQe=ve(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.nanoid=wm.customAlphabet=wm.customRandom=wm.random=wm.urlAlphabet=void 0;wm.urlAlphabet="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var pGt=e=>crypto.getRandomValues(new Uint8Array(e));wm.random=pGt;var hGt=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return(i=t)=>{let a="";for(;;){let s=r(o),l=o;for(;l--;)if(a+=e[s[l]&n]||"",a.length===i)return a}}};wm.customRandom=hGt;var gGt=(e,t=21)=>(0,wm.customRandom)(e,t,wm.random);wm.customAlphabet=gGt;var yGt=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");wm.nanoid=yGt});var bce=ve(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.FileLocation=Js.UriLocation=Js.UriLocationRaw=Js.BlobLocation=Js.LocalPathLocation=Js.Region=Js.NoAssemblyRegion=Js.ElementId=void 0;var Yi=f0(),vGt=AQe();Js.ElementId=Yi.types.optional(Yi.types.identifier,()=>(0,vGt.nanoid)());Js.NoAssemblyRegion=Yi.types.model("NoAssemblyRegion",{refName:Yi.types.string,start:Yi.types.number,end:Yi.types.number,reversed:Yi.types.optional(Yi.types.boolean,!1)}).actions(e=>({setRefName(t){e.refName=t}}));Js.Region=Yi.types.compose("Region",Js.NoAssemblyRegion,Yi.types.model({assemblyName:Yi.types.string}));Js.LocalPathLocation=Yi.types.model("LocalPathLocation",{locationType:Yi.types.literal("LocalPathLocation"),localPath:Yi.types.string});Js.BlobLocation=Yi.types.model("BlobLocation",{locationType:Yi.types.literal("BlobLocation"),name:Yi.types.string,blobId:Yi.types.string});Js.UriLocationRaw=Yi.types.model("UriLocation",{locationType:Yi.types.literal("UriLocation"),uri:Yi.types.string,baseUri:Yi.types.maybe(Yi.types.string),internetAccountId:Yi.types.maybe(Yi.types.string),internetAccountPreAuthorization:Yi.types.maybe(Yi.types.model("InternetAccountPreAuthorization",{internetAccountType:Yi.types.string,authInfo:Yi.types.frozen()}))});Js.UriLocation=Yi.types.snapshotProcessor(Js.UriLocationRaw,{postProcessor:e=>{let{baseUri:t,...r}=e;return t?e:r}});Js.FileLocation=Yi.types.snapshotProcessor(Yi.types.union(Js.LocalPathLocation,Js.UriLocation,Js.BlobLocation),{preProcessor(e){if(!e)return;let{locationType:t,...r}=e;if(!t){let{uri:n,localPath:o,blob:i}=r,a="";return n!==void 0?a="UriLocation":o!==void 0?a="LocalPathLocation":i!==void 0&&(a="BlobLocation"),{...r,locationType:a}}return e}})});var DQe=ve(Sce=>{"use strict";Object.defineProperty(Sce,"__esModule",{value:!0});Sce.default=AGt;var Ms=f0(),bGt=_ce(),xGt=TQe(),SGt=bce();function _Gt(){return!0}var CGt={stringArray:Ms.types.array(Ms.types.string),stringArrayMap:Ms.types.map(Ms.types.array(Ms.types.string)),numberMap:Ms.types.map(Ms.types.number),boolean:Ms.types.boolean,color:Ms.types.refinement("Color",Ms.types.string,_Gt),integer:Ms.types.integer,number:Ms.types.number,string:Ms.types.string,text:Ms.types.string,fileLocation:SGt.FileLocation,frozen:Ms.types.frozen()},PQe={stringArray:[],stringArrayMap:{},numberMap:{},boolean:!0,color:"black",integer:1,number:1,string:"",text:"",fileLocation:{uri:"/path/to/resource.txt",locationType:"UriLocation"},frozen:{}},xce=e=>({views:{get valueJSON(){return e.value}}}),IQe=e=>({views:{get valueJSON(){return JSON.stringify(e.value)}}}),EQe={fileLocation:IQe,number:xce,integer:xce,boolean:xce,frozen:IQe,stringArray:e=>({views:{get valueJSON(){return JSON.stringify(e.value)}},actions:{add(t){e.value.push(t)},removeAtIndex(t){e.value.splice(t,1)},setAtIndex(t,r){e.value[t]=r}}}),stringArrayMap:e=>({views:{get valueJSON(){return JSON.stringify(e.value)}},actions:{add(t,r){e.value.set(t,r)},remove(t){e.value.delete(t)},addToKey(t,r){let n=e.value.get(t);if(!n)throw new Error(`${t} not found`);n.push(r)},removeAtKeyIndex(t,r){let n=e.value.get(t);if(!n)throw new Error(`${t} not found`);n.splice(r,1)},setAtKeyIndex(t,r,n){let o=e.value.get(t);if(!o)throw new Error(`${t} not found`);o[r]=n}}}),numberMap:e=>({views:{get valueJSON(){return JSON.stringify(e.value)}},actions:{add(t,r){e.value.set(t,r)},remove(t){e.value.delete(t)}}})},wGt=Ms.types.refinement("JexlString",Ms.types.string,e=>e.startsWith("jexl:"));function TGt(e){return e?.toJSON?e.toJSON():`"${e}"`}function AGt(e,{description:t="",model:r,type:n,defaultValue:o,contextVariable:i=[]}){if(!n)throw new Error("type name required");if(r||(r=CGt[n]),!r)throw new Error(`no builtin config slot type "${n}", and no 'model' param provided`);if(o===void 0)throw new Error("no 'defaultValue' provided");let a=`${e.charAt(0).toUpperCase()}${e.slice(1)}ConfigSlot`,s=Ms.types.model(a,{name:Ms.types.literal(e),description:Ms.types.literal(t),type:Ms.types.literal(n),value:Ms.types.optional(Ms.types.union(wGt,r),o)}).volatile(()=>({contextVariable:i})).views(u=>({get isCallback(){return String(u.value).startsWith("jexl:")}})).views(u=>({get expr(){if(u.isCallback){let{pluginManager:d}=(0,bGt.getEnv)(u);return!d&&typeof jest>"u"&&console.warn("no pluginManager detected on config env (if you dynamically instantiate a config, for example in renderProps for your display model, check that you add the env argument)"),(0,xGt.stringToJexlExpression)(String(u.value),d?.jexl)}return{evalSync:()=>u.value}},get valueJSON(){if(!u.isCallback)return TGt(u.value)}})).preProcessSnapshot(u=>typeof u=="object"&&u.name===e?u:{name:e,description:t,type:n,value:u}).postProcessSnapshot(u=>typeof u.value=="object"?JSON.stringify(u.value)!==JSON.stringify(o)?u.value:void 0:u.value!==o?u.value:void 0).actions(u=>({set(d){u.value=d},reset(){u.value=o},convertToCallback(){u.isCallback||(u.value=`jexl:${u.valueJSON||"''"}`)},convertToValue(){if(u.isCallback){try{let d=u.expr.evalSync();if(d!==void 0){u.value=d;return}}catch{}if(u.value=o,!(n in PQe))throw new Error(`no fallbackDefault defined for type ${n}`);u.value=PQe[n]}}}));EQe[n]&&(s=s.extend(EQe[n]));let c=Ms.types.optional(s,{name:e,type:n,description:t,value:o});return Object.defineProperty(c,"isJBrowseConfigurationSlot",{value:!0}),c}});var MQe=ve(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.getSubType=Cce;v_.getUnionSubTypes=kQe;v_.getPropertyType=PGt;v_.getDefaultValue=IGt;v_.getEnumerationValues=EGt;v_.resolveLateType=DGt;var y_=f0();function Cce(e){let t;if((0,y_.isOptionalType)(e))t=e._subtype||e.type;else if((0,y_.isArrayType)(e)||(0,y_.isMapType)(e))t=e._subtype||e._subType||e.subType;else{if(typeof e.getSubType=="function")return e.getSubType();throw new TypeError("unsupported mst type")}if(!t)throw new Error("failed to get subtype");return t}function kQe(e){if(!(0,y_.isUnionType)(e))throw new TypeError("not an MST union type");let t=e._types||e.types||Cce(e)._types||Cce(e).types;if(!t)throw new Error("failed to extract subtypes from mst union");return t}function PGt(e,t){return e.properties[t]}function IGt(e){if(!(0,y_.isOptionalType)(e))throw new TypeError("type must be an optional type");return e._defaultValue||e.defaultValue}function EGt(e){return kQe(e).map(r=>r.value)}function DGt(e){return!(0,y_.isUnionType)(e)&&!(0,y_.isArrayType)(e)&&(0,y_.isLateType)(e)?e.getSubType():e}});var wce=ve(y1=>{"use strict";Object.defineProperty(y1,"__esModule",{value:!0});y1.readConfObject=Oj;y1.getConf=kGt;y1.getTypeNamesFromExplicitlyTypedUnion=BQe;y1.isBareConfigurationSchemaType=RQe;y1.isConfigurationSchemaType=W3;y1.isConfigurationModel=OQe;y1.isConfigurationSlotType=MGt;var Hl=f0(),b_=MQe();function Oj(e,t,r={}){if(t){if(typeof t=="string"){let n=e[t];if(!n&&(0,Hl.isStateTreeNode)(e)&&(0,Hl.isMapType)((0,Hl.getType)(e))&&(n=e.get(t)),n){let o=n.expr?n.expr.evalSync(r):n;return(0,Hl.isStateTreeNode)(o)?JSON.parse(JSON.stringify((0,Hl.getSnapshot)(o))):o}else return}else if(Array.isArray(t)){let n=t[0];if(t.length>1){let o=t.slice(1),i=e[n];return!i&&(0,Hl.isStateTreeNode)(e)&&(0,Hl.isMapType)((0,Hl.getType)(e))&&(i=e.get(n)),i?Oj(i,o,r):void 0}return Oj(e,n,r)}}else return structuredClone((0,Hl.getSnapshot)(e));throw new TypeError("slotPath must be a string or array")}function kGt(e,t,r){let{configuration:n}=e;if(OQe(n))return Oj(n,t,r);throw new TypeError("cannot getConf on this model, it has no configuration")}function BQe(e){if((0,Hl.isType)(e)&&(e=(0,b_.resolveLateType)(e),(0,Hl.isUnionType)(e))){let t=[];for(let r of(0,b_.getUnionSubTypes)(e)){r=(0,b_.resolveLateType)(r);let n=BQe(r);if(n.length||(n=[(0,b_.getDefaultValue)(r).type]),!n[0])throw new Error(`invalid config schema type ${r}`);t.push(...n)}return t}return[]}function RQe(e){return!!((0,Hl.isType)(e)&&((0,Hl.isModelType)(e)&&("isJBrowseConfigurationSchema"in e||e.name.includes("ConfigurationSchema"))||(0,Hl.isLateType)(e)))}function W3(e){return(0,Hl.isType)(e)?RQe(e)?!0:(0,Hl.isUnionType)(e)?(0,b_.getUnionSubTypes)(e).every(t=>W3(t)||t.name==="undefined"):(0,Hl.isOptionalType)(e)&&W3((0,b_.getSubType)(e))||(0,Hl.isArrayType)(e)&&W3((0,b_.getSubType)(e))?!0:!!((0,Hl.isMapType)(e)&&W3((0,b_.getSubType)(e))):!1}function OQe(e){return(0,Hl.isStateTreeNode)(e)&&W3((0,Hl.getType)(e))}function MGt(e){return typeof e=="object"&&e!==null&&"isJBrowseConfigurationSlot"in e}});var NQe=ve(K3=>{"use strict";var BGt=K3&&K3.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(K3,"__esModule",{value:!0});K3.ConfigurationSchema=UGt;K3.ConfigurationReference=VGt;var Xh=f0(),RGt=BGt(DQe()),LQe=wce(),FQe=bce();function OGt(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function LGt(e){return Array.isArray(e)&&e.length===0}function FGt(e,t,r={}){var n;if(typeof e!="string")throw new Error("first arg must be string name of the model that this config schema goes with");let o=t,i=r;return!((n=r.baseConfiguration)===null||n===void 0)&&n.jbrowseSchemaDefinition&&(o={...r.baseConfiguration.jbrowseSchemaDefinition,...o},i={...r.baseConfiguration.jbrowseSchemaOptions,...r},i.baseConfiguration=void 0),{schemaDefinition:o,options:i}}function NGt(e,t,r){let n={},o;if(r.explicitlyTyped&&(n.type=Xh.types.optional(Xh.types.literal(e),e)),r.explicitIdentifier&&r.implicitIdentifier)throw new Error(`Cannot have both explicit and implicit identifiers in ${e}`);r.explicitIdentifier?typeof r.explicitIdentifier=="string"?(n[r.explicitIdentifier]=Xh.types.identifier,o=r.explicitIdentifier):(n.id=Xh.types.identifier,o="id"):r.implicitIdentifier&&(typeof r.implicitIdentifier=="string"?(n[r.implicitIdentifier]=FQe.ElementId,o=r.implicitIdentifier):(n.id=FQe.ElementId,o="id"));let i={isJBrowseConfigurationSchema:!0,jbrowseSchema:{modelName:e,definition:t,options:r}};for(let[u,d]of Object.entries(t))if((0,Xh.isType)(d)&&(0,Xh.isLateType)(d)||(0,LQe.isConfigurationSchemaType)(d))n[u]=d;else if(typeof d=="string"||typeof d=="number")i[u]=d;else if(typeof d=="object"){if(!d.type)throw new Error(`no type set for config slot ${e}.${u}`);try{n[u]=(0,RGt.default)(u,d)}catch(f){throw new Error(`invalid config slot definition for ${e}.${u}: ${f}`)}}else throw new Error(`invalid configuration schema definition, "${u}" must be either a valid configuration slot definition, a constant, or a nested configuration schema`);let a=Xh.types.model(`${e}ConfigurationSchema`,n).actions(u=>({setSubschema(d,f){if(!(0,LQe.isConfigurationSchemaType)(n[d]))throw new Error(`${d} is not a subschema, cannot replace`);let m=(0,Xh.isStateTreeNode)(f)?f:n[d].create(f);return u[d]=m,m}}));Object.keys(i).length&&(a=a.volatile(()=>i)),r.actions&&(a=a.actions(r.actions)),r.views&&(a=a.views(r.views)),r.extend&&(a=a.extend(r.extend));let s=o?{[o]:"placeholderId"}:{},l=r.explicitlyTyped?{type:e,...s}:s,c=(0,Xh.getSnapshot)(a.create(l));return a=a.postProcessSnapshot(u=>{let d={},f=!0;for(let[m,p]of Object.entries(u))f&&(typeof c[m]=="object"&&typeof p=="object"?JSON.stringify(c[m])!==JSON.stringify(p)&&(f=!1):c[m]!==p&&(f=!1)),p!==void 0&&i[m]===void 0&&!OGt(p)&&!LGt(p)&&(d[m]=p);return f?{}:d}),r.preProcessSnapshot&&(a=a.preProcessSnapshot(r.preProcessSnapshot)),Xh.types.optional(a,l)}function UGt(e,t,r){let{schemaDefinition:n,options:o}=FGt(e,t,r),i=NGt(e,n,o);return i.isJBrowseConfigurationSchema=!0,i.jbrowseSchemaDefinition=n,i.jbrowseSchemaOptions=o,i}function VGt(e){return Xh.types.union(Xh.types.reference(e),e)}});var VQe=ve(h0=>{"use strict";var zGt=h0&&h0.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),qGt=h0&&h0.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&zGt(t,e,r)};Object.defineProperty(h0,"__esModule",{value:!0});h0.ConfigurationSchema=h0.ConfigurationReference=void 0;var UQe=NQe();Object.defineProperty(h0,"ConfigurationReference",{enumerable:!0,get:function(){return UQe.ConfigurationReference}});Object.defineProperty(h0,"ConfigurationSchema",{enumerable:!0,get:function(){return UQe.ConfigurationSchema}});qGt(wce(),h0)});var zQe=ve(Ace=>{"use strict";Object.defineProperty(Ace,"__esModule",{value:!0});var Tce=class extends Map{constructor(t={}){if(super(),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof t.maxAge=="number"&&t.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if(typeof this.onEviction=="function")for(let[r,n]of t)this.onEviction(r,n.value)}_deleteIfExpired(t,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(t,r.value),this.delete(t)):!1}_getOrDeleteIfExpired(t,r){if(!this._deleteIfExpired(t,r))return r.value}_getItemValue(t,r){return r.expiry?this._getOrDeleteIfExpired(t,r):r.value}_peek(t,r){let n=r.get(t);return this._getItemValue(t,n)}_set(t,r){this.cache.set(t,r),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,r){this.oldCache.delete(t),this._set(t,r)}*_entriesAscending(){for(let t of this.oldCache){let[r,n]=t;this.cache.has(r)||this._deleteIfExpired(r,n)||(yield t)}for(let t of this.cache){let[r,n]=t;this._deleteIfExpired(r,n)||(yield t)}}get(t){if(this.cache.has(t)){let r=this.cache.get(t);return this._getItemValue(t,r)}if(this.oldCache.has(t)){let r=this.oldCache.get(t);if(!this._deleteIfExpired(t,r))return this._moveToRecent(t,r),r.value}}set(t,r,{maxAge:n=this.maxAge}={}){let o=typeof n=="number"&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;this.cache.has(t)?this.cache.set(t,{value:r,expiry:o}):this._set(t,{value:r,expiry:o})}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):this.oldCache.has(t)?!this._deleteIfExpired(t,this.oldCache.get(t)):!1}peek(t){if(this.cache.has(t))return this._peek(t,this.cache);if(this.oldCache.has(t))return this._peek(t,this.oldCache)}delete(t){let r=this.cache.delete(t);return r&&this._size--,this.oldCache.delete(t)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this._entriesAscending()],n=r.length-t;n<0?(this.cache=new Map(r),this.oldCache=new Map,this._size=r.length):(n>0&&this._emitEvictions(r.slice(0,n)),this.oldCache=new Map(r.slice(n)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(let[t]of this)yield t}*values(){for(let[,t]of this)yield t}*[Symbol.iterator](){for(let t of this.cache){let[r,n]=t;this._deleteIfExpired(r,n)||(yield[r,n.value])}for(let t of this.oldCache){let[r,n]=t;this.cache.has(r)||this._deleteIfExpired(r,n)||(yield[r,n.value])}}*entriesDescending(){let t=[...this.cache];for(let r=t.length-1;r>=0;--r){let n=t[r],[o,i]=n;this._deleteIfExpired(o,i)||(yield[o,i.value])}t=[...this.oldCache];for(let r=t.length-1;r>=0;--r){let n=t[r],[o,i]=n;this.cache.has(o)||this._deleteIfExpired(o,i)||(yield[o,i.value])}}*entriesAscending(){for(let[t,r]of this._entriesAscending())yield[t,r.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(let r of this.oldCache.keys())this.cache.has(r)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,r=this){for(let[n,o]of this.entriesAscending())t.call(r,o,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}};Ace.default=Tce});var jQe=ve(oO=>{"use strict";var qQe=oO&&oO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(oO,"__esModule",{value:!0});var jGt=qQe(G$e()),Pce=VQe(),GGt=qQe(zQe()),Ice=class{constructor(t){this.pluginManager=t,this.adapterCache=new GGt.default({maxSize:15})}loadTextSearchAdapters(t){return Promise.all(this.relevantAdapters(t).map(async r=>{let n=(0,Pce.readConfObject)(r,"textSearchAdapterId"),o=this.adapterCache.get(n);if(o)return o;{let a=await this.pluginManager.getTextSearchAdapterType(r.type).getAdapterClass(),s=new a(r,void 0,this.pluginManager);return this.adapterCache.set(n,s),s}}))}relevantAdapters(t){let r=this.pluginManager.rootModel,{aggregateTextSearchAdapters:n}=r?.jbrowse,{tracks:o}=r?.session,{assemblyName:i}=t;return[...this.getAdaptersWithAssembly(i,n),...this.getTrackAdaptersWithAssembly(i,o)]}getAdaptersWithAssembly(t,r){return r.filter(n=>{var o;return(o=(0,Pce.readConfObject)(n,"assemblyNames"))===null||o===void 0?void 0:o.includes(t)})}getTrackAdaptersWithAssembly(t,r){return r.filter(n=>{var o;return(o=(0,Pce.readConfObject)(n,["textSearching","textSearchAdapter","assemblyNames"]))===null||o===void 0?void 0:o.includes(t)}).map(n=>n.textSearching.textSearchAdapter)}async search(t,r,n){return this.search2({args:t,searchScope:r,rankFn:n})}async search2({args:t,searchScope:r,rankFn:n}){let o=await this.loadTextSearchAdapters(r),i=await Promise.all(o.map(a=>a.searchIndex(t)));return this.sortResults2({args:t,results:i.flat(),rankFn:n})}sortResults2({results:t,rankFn:r,args:n}){let o=new jGt.default({}),i=t.map(c=>c.getDisplayString()),a=n.queryString,s=o.filter(i,a),l=[];if(s!=null&&s.length>0){let c=o.info(s,i,a),u=o.sort(c,i,a);for(let d of u)l.push(t[c.idx[d]])}return r(l)}};oO.default=Ice});var kce=ve(ti=>{"use strict";var HGt=ti&&ti.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),WGt=ti&&ti.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&HGt(t,e,r)},KGt=ti&&ti.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ti,"__esModule",{value:!0});ti.TextSearchManager=ti.RetryError=ti.AuthNeededError=void 0;ti.isViewContainer=XGt;ti.isSessionModel=x_;ti.isSessionModelWithConfigEditing=ZGt;ti.isSessionWithAddTracks=$Gt;ti.isSessionWithShareURL=QGt;ti.isSessionModelWithWidgets=JGt;ti.isSessionModelWithConnections=e7t;ti.isSessionModelWithConnectionEditing=t7t;ti.isSessionWithSessionPlugins=r7t;ti.isSelectionContainer=n7t;ti.isViewModel=o7t;ti.isTrackModel=i7t;ti.isDisplayModel=a7t;ti.isTrackViewModel=s7t;ti.isAppRootModel=l7t;ti.isRootModelWithInternetAccounts=c7t;ti.isAbstractMenuManager=u7t;ti.isUriLocation=d7t;ti.isLocalPathLocation=f7t;ti.isBlobLocation=m7t;ti.isAuthNeededException=p7t;ti.isRetryException=h7t;var YGt=f0();WGt(F$e(),ti);function XGt(e){return(0,YGt.isStateTreeNode)(e)&&"removeView"in e&&"addView"in e&&"views"in e}function x_(e){return typeof e=="object"&&e!==null&&"rpcManager"in e&&"configuration"in e}function ZGt(e){return x_(e)&&"editConfiguration"in e}function $Gt(e){return x_(e)&&"addTrackConf"in e&&!e.disableAddTracks}function QGt(e){return x_(e)&&"shareURL"in e&&!!e.shareURL}function JGt(e){return x_(e)&&"widgets"in e}function e7t(e){return x_(e)&&"makeConnection"in e}function t7t(e){return x_(e)&&"addConnectionConf"in e}function r7t(e){return x_(e)&&"sessionPlugins"in e}function n7t(e){return typeof e=="object"&&e!==null&&"selection"in e&&"setSelection"in e}function o7t(e){return typeof e=="object"&&e!==null&&"width"in e&&"setWidth"in e}function i7t(e){return typeof e=="object"&&e!==null&&"configuration"in e&&e.configuration.trackId}function a7t(e){return typeof e=="object"&&e!==null&&"configuration"in e&&e.configuration.displayId}function s7t(e){return typeof e=="object"&&e!==null&&"showTrack"in e&&"hideTrack"in e}function l7t(e){return typeof e=="object"&&e!==null&&"findAppropriateInternetAccount"in e}function c7t(e){return typeof e=="object"&&e!==null&&"internetAccounts"in e&&"findAppropriateInternetAccount"in e}function u7t(e){return typeof e=="object"&&e!==null&&"appendMenu"in e&&"appendToSubMenu"in e}function d7t(e){return typeof e=="object"&&e!==null&&"uri"in e&&!!e.uri}function f7t(e){return typeof e=="object"&&e!==null&&"localPath"in e&&!!e.localPath}function m7t(e){return typeof e=="object"&&e!==null&&"blobId"in e&&!!e.blobId}var Ece=class e extends Error{constructor(t,r){super(t),this.message=t,this.url=r,this.name="AuthNeededError",Object.setPrototypeOf(this,e.prototype)}};ti.AuthNeededError=Ece;var Dce=class extends Error{constructor(t,r){super(t),this.message=t,this.internetAccountId=r,this.name="RetryError"}};ti.RetryError=Dce;function p7t(e){return e instanceof Error&&(e.name==="AuthNeededError"||e.url!==void 0)}function h7t(e){return e.name==="RetryError"||e.internetAccountId!==void 0}var g7t=jQe();Object.defineProperty(ti,"TextSearchManager",{enumerable:!0,get:function(){return KGt(g7t).default}})});var GQe=ve(Lj=>{"use strict";Object.defineProperty(Lj,"__esModule",{value:!0});Lj.when=void 0;var y7t=bR();Object.defineProperty(Lj,"when",{enumerable:!0,get:function(){return y7t.when}})});var HQe=ve(iO=>{"use strict";Object.defineProperty(iO,"__esModule",{value:!0});iO.intersection2=v7t;iO.doesIntersect2=b7t;iO.isContainedWithin=x7t;function v7t(e,t,r,n){return t>r&&e<n&&n-r&&t-e?e>r?t<n?[e,t]:[e,n]:t<n?[r,t]:[r,n]:[]}function b7t(e,t,r,n){return t>r&&e<n}function x7t(e,t,r,n){return r<=e&&n>=t}});var WQe=ve(Mce=>{"use strict";Object.defineProperty(Mce,"__esModule",{value:!0});Mce.dedupe=S7t;function S7t(e,t=JSON.stringify){let r=[],n=new Set;for(let o of e){let i=t(o);n.has(i)||(r.push(o),n.add(i))}return r}});var Lce=ve((syo,ZQe)=>{"use strict";var Fj={},Vj={},aO={METHOD:"method",PROPERTY:"property"},Nj=class{constructor(t,r){this.inst=t,this.args=r}},Bce=class extends Nj{constructor(t,r){super(t,r),this.type=aO.METHOD}execute(t){t[this.inst](...this.args)}},Rce=class extends Nj{constructor(t,r){super(t,r),this.type=aO.PROPERTY}execute(t){t[this.inst]=this.args[0]}},_7t={[aO.METHOD]:Bce,[aO.PROPERTY]:Rce},Uj=class{constructor(t,r,n){return new _7t[t](r,n)}};Object.entries(aO).forEach(([e,t])=>{Object.defineProperty(Uj,e,{value:t,configurable:!1,enumerable:!0,writable:!1})});Vj=Uj;var YQe=Object.freeze({METHODS:["addHitRegion","arc","arcTo","beginPath","bezierCurveTo","clearHitRegions","clearRect","clip","closePath","drawFocusIfNeeded","drawImage","ellipse","fill","fillRect","fillText","lineTo","moveTo","putImageData","quadraticCurveTo","rect","removeHitRegion","resetTransform","restore","rotate","save","scale","scrollPathIntoView","setLineDash","setTransform","stroke","strokeRect","strokeText","transform","translate"],PROPERTIES:["direction","fillStyle","filter","font","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","imageSmoothingQuality","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline"]}),Iv=Object.freeze({sequence:Symbol.for("sequence"),push:Symbol.for("push"),fromJSON:Symbol.for("fromJSON")}),sO=class{constructor(t=null){this[Iv.sequence]=[],t&&this[Iv.fromJSON](t)}[Iv.fromJSON](t={sequence:[]}){t.sequence.forEach(({type:r,inst:n,args:o})=>{this[Iv.push](r,n,o)})}[Iv.push](t,r,n){this[Iv.sequence].push(new Vj(t,r,n))}execute(t){t.save(),this[Iv.sequence].forEach(r=>r.execute(t)),t.restore()}toJSON(){return{sequence:this[Iv.sequence]}}};YQe.METHODS.forEach(e=>{Object.defineProperty(sO.prototype,e,{value:function(...r){this[Iv.push](Vj.METHOD,e,r)},writable:!1,enumerable:!0,configurable:!1})});YQe.PROPERTIES.forEach(e=>{Object.defineProperty(sO.prototype,e,{get(){throw`Invalid canvas sequencer interaction, cannot get ${e}.`},set(t){this[Iv.push](Vj.PROPERTY,e,[t])},enumerable:!0,configurable:!1})});Fj=sO;var XQe={},KQe=Object.freeze({sequence:Symbol.for("sequence"),push:Symbol.for("push")});function C7t(e,t){let r=e.replace(/^\{|\}$/gu,"");return r!==e?t.hasOwnProperty(r)?t[r]:r:e}var Oce=class extends Fj{build(t={}){let r=new Fj;return this[KQe.sequence].forEach(({type:n,inst:o,args:i})=>{let a=i.map(s=>typeof s=="string"?C7t(s,t):s);r[KQe.push](n,o,a)}),r}execute(){throw new TypeError("Cannot execute a blueprint.")}};XQe=Oce;ZQe.exports={CanvasSequence:Fj,CanvasBlueprint:XQe}});var QQe=ve((lyo,$Qe)=>{$Qe.exports=!1});var Fce=ve(zd=>{"use strict";var w7t=zd&&zd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zd,"__esModule",{value:!0});zd.ImageBitmapType=zd.createImageBitmap=zd.createCanvas=void 0;zd.drawImageOntoCanvasContext=A7t;var eJe=Lce(),T7t=w7t(QQe());function A7t(e,t){e.serializedCommands?new eJe.CanvasSequence(e.serializedCommands).execute(t):t.drawImage(e,0,0)}var JQe={realOffscreenCanvas:typeof OffscreenCanvas=="function",node:T7t.default};JQe.realOffscreenCanvas?(zd.createCanvas=(e,t)=>new OffscreenCanvas(e,t),zd.createImageBitmap=window.createImageBitmap||self.createImageBitmap,zd.ImageBitmapType=window.ImageBitmap||self.ImageBitmap):JQe.node?(zd.createCanvas=(...e)=>nodeCreateCanvas(...e),zd.createImageBitmap=async e=>{let t=e.toDataURL(),r=new nodeImage;return new Promise((n,o)=>{r.onload=()=>{n(r)},r.onerror=o,r.src=t})}):(zd.createCanvas=(e,t)=>{let r=new eJe.CanvasSequence;return{width:e,height:t,getContext(){return r}}},zd.createImageBitmap=async e=>{let t=e.getContext("2d");return{height:e.height,width:e.width,serializedCommands:t.toJSON(),containsNoTransferables:!0}},zd.ImageBitmapType=String)});var Uce=ve(Nce=>{"use strict";Object.defineProperty(Nce,"__esModule",{value:!0});Nce.blobToDataURL=P7t;function P7t(e){let t=new FileReader;return new Promise((r,n)=>{t.onload=o=>{o.target?r(o.target.result):n(new Error("unknown result reading blob from canvas"))},t.readAsDataURL(e)})}});var tJe=ve((dyo,zj)=>{(function(){"use strict";var e,t,r,n,o;function i(d,f){var m=Object.keys(f),p;for(p=0;p<m.length;p++)d=d.replace(new RegExp("\\{"+m[p]+"\\}","gi"),f[m[p]]);return d}function a(d){var f,m,p;if(!d)throw new Error("cannot create a random attribute name for an undefined object");f="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",m="";do for(m="",p=0;p<12;p++)m+=f[Math.floor(Math.random()*f.length)];while(d[m]);return m}function s(d,f){var m,p,h={},g,y;for(d=d.split(","),f=f||10,m=0;m<d.length;m+=2)p="&"+d[m+1]+";",g=parseInt(d[m],f),h[p]="&#"+g+";";return h["\\xa0"]=" ",h}function l(d){var f={left:"start",right:"end",center:"middle",start:"start",end:"end"};return f[d]||f.start}function c(d){var f={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return f[d]||f.alphabetic}o=s("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),e={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"}},r=function(d,f){this.__root=d,this.__ctx=f},r.prototype.addColorStop=function(d,f){var m=this.__ctx.__createElement("stop"),p,h;m.setAttribute("offset",d),f.indexOf("rgba")!==-1?(p=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,h=p.exec(f),m.setAttribute("stop-color",i("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]})),m.setAttribute("stop-opacity",h[4])):m.setAttribute("stop-color",f),this.__root.appendChild(m)},n=function(d,f){this.__root=d,this.__ctx=f},t=function(d){var f={width:500,height:500,enableMirroring:!1},m;if(arguments.length>1?(m=f,m.width=arguments[0],m.height=arguments[1]):d?m=d:m=f,!(this instanceof t))return new t(m);this.width=m.width||f.width,this.height=m.height||f.height,this.enableMirroring=m.enableMirroring!==void 0?m.enableMirroring:f.enableMirroring,this.canvas=this,this.__document=m.document||document,this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__root.setAttribute("version",1.1),this.__root.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__root.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__ids={},this.__defs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__root.appendChild(this.__currentElement)},t.prototype.__createElement=function(d,f,m){typeof f>"u"&&(f={});var p=this.__document.createElementNS("http://www.w3.org/2000/svg",d),h=Object.keys(f),g,y;for(m&&(p.setAttribute("fill","none"),p.setAttribute("stroke","none")),g=0;g<h.length;g++)y=h[g],p.setAttribute(y,f[y]);return p},t.prototype.__setDefaultStyles=function(){var d=Object.keys(e),f,m;for(f=0;f<d.length;f++)m=d[f],this[m]=e[m].canvas},t.prototype.__applyStyleState=function(d){var f=Object.keys(d),m,p;for(m=0;m<f.length;m++)p=f[m],this[p]=d[p]},t.prototype.__getStyleState=function(){var d,f={},m=Object.keys(e),p;for(d=0;d<m.length;d++)p=m[d],f[p]=this[p];return f},t.prototype.__applyStyleToCurrentElement=function(d){var f=Object.keys(e),m,p,h,g,y,b;for(m=0;m<f.length;m++)if(p=e[f[m]],h=this[f[m]],p.apply)if(p.apply.indexOf("fill")!==-1&&h instanceof n){if(h.__ctx)for(;h.__ctx.__defs.childNodes.length;)g=h.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[g]=g,this.__defs.appendChild(h.__ctx.__defs.childNodes[0]);this.__currentElement.setAttribute("fill",i("url(#{id})",{id:h.__root.getAttribute("id")}))}else p.apply.indexOf("fill")!==-1&&h instanceof r?this.__currentElement.setAttribute("fill",i("url(#{id})",{id:h.__root.getAttribute("id")})):p.apply.indexOf(d)!==-1&&p.svg!==h&&((p.svgAttr==="stroke"||p.svgAttr==="fill")&&h.indexOf("rgba")!==-1?(y=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,b=y.exec(h),this.__currentElement.setAttribute(p.svgAttr,i("rgb({r},{g},{b})",{r:b[1],g:b[2],b:b[3]})),this.__currentElement.setAttribute(p.svgAttr+"-opacity",b[4])):this.__currentElement.setAttribute(p.svgAttr,h))},t.prototype.__closestGroupOrSvg=function(d){return d=d||this.__currentElement,d.nodeName==="g"||d.nodeName==="svg"?d:this.__closestGroupOrSvg(d.parentNode)},t.prototype.getSerializedSvg=function(d){var f=new XMLSerializer().serializeToString(this.__root),m,p,h,g,y,b;if(b=/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi,b.test(f)&&(f=f.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),d)for(m=Object.keys(o),p=0;p<m.length;p++)h=m[p],g=o[h],y=new RegExp(h,"gi"),y.test(f)&&(f=f.replace(y,g));return f},t.prototype.getSvg=function(){return this.__root},t.prototype.save=function(){var d=this.__createElement("g"),f=this.__closestGroupOrSvg();this.__groupStack.push(f),f.appendChild(d),this.__currentElement=d,this.__stack.push(this.__getStyleState())},t.prototype.restore=function(){this.__currentElement=this.__groupStack.pop();var d=this.__stack.pop();this.__applyStyleState(d)},t.prototype.__addTransform=function(d){var f=this.__closestGroupOrSvg();if(f.childNodes.length>0){var m=this.__createElement("g");f.appendChild(m),this.__currentElement=m}var p=this.__currentElement.getAttribute("transform");p?p+=" ":p="",p+=d,this.__currentElement.setAttribute("transform",p)},t.prototype.scale=function(d,f){f===void 0&&(f=d),this.__addTransform(i("scale({x},{y})",{x:d,y:f}))},t.prototype.rotate=function(d){var f=d*180/Math.PI;this.__addTransform(i("rotate({angle},{cx},{cy})",{angle:f,cx:0,cy:0}))},t.prototype.translate=function(d,f){this.__addTransform(i("translate({x},{y})",{x:d,y:f}))},t.prototype.transform=function(d,f,m,p,h,g){this.__addTransform(i("matrix({a},{b},{c},{d},{e},{f})",{a:d,b:f,c:m,d:p,e:h,f:g}))},t.prototype.beginPath=function(){var d,f;this.__currentDefaultPath="",this.__currentPosition={},d=this.__createElement("path",{},!0),f=this.__closestGroupOrSvg(),f.appendChild(d),this.__currentElement=d},t.prototype.__applyCurrentDefaultPath=function(){if(this.__currentElement.nodeName==="path"){var d=this.__currentDefaultPath;this.__currentElement.setAttribute("d",d)}else throw new Error("Attempted to apply path command to node "+this.__currentElement.nodeName)},t.prototype.__addPathCommand=function(d){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=d},t.prototype.moveTo=function(d,f){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:d,y:f},this.__addPathCommand(i("M {x} {y}",{x:d,y:f}))},t.prototype.closePath=function(){this.__addPathCommand("Z")},t.prototype.lineTo=function(d,f){this.__currentPosition={x:d,y:f},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(i("L {x} {y}",{x:d,y:f})):this.__addPathCommand(i("M {x} {y}",{x:d,y:f}))},t.prototype.bezierCurveTo=function(d,f,m,p,h,g){this.__currentPosition={x:h,y:g},this.__addPathCommand(i("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:d,cp1y:f,cp2x:m,cp2y:p,x:h,y:g}))},t.prototype.quadraticCurveTo=function(d,f,m,p){this.__currentPosition={x:m,y:p},this.__addPathCommand(i("Q {cpx} {cpy} {x} {y}",{cpx:d,cpy:f,x:m,y:p}))};var u=function(d){var f=Math.sqrt(d[0]*d[0]+d[1]*d[1]);return[d[0]/f,d[1]/f]};t.prototype.arcTo=function(d,f,m,p,h){var g=this.__currentPosition&&this.__currentPosition.x,y=this.__currentPosition&&this.__currentPosition.y;if(!(typeof g>"u"||typeof y>"u")){if(h<0)throw new Error("IndexSizeError: The radius provided ("+h+") is negative.");if(g===d&&y===f||d===m&&f===p||h===0){this.lineTo(d,f);return}var b=u([g-d,y-f]),x=u([m-d,p-f]);if(b[0]*x[1]===b[1]*x[0]){this.lineTo(d,f);return}var C=b[0]*x[0]+b[1]*x[1],S=Math.acos(Math.abs(C)),w=u([b[0]+x[0],b[1]+x[1]]),A=h/Math.sin(S/2),T=d+A*w[0],D=f+A*w[1],E=[-b[1],b[0]],I=[x[1],-x[0]],k=function(O){var F=O[0],q=O[1];return q>=0?Math.acos(F):-Math.acos(F)},R=k(E),B=k(I);this.lineTo(T+E[0]*h,D+E[1]*h),this.arc(T,D,h,R,B)}},t.prototype.stroke=function(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")},t.prototype.fill=function(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")},t.prototype.rect=function(d,f,m,p){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(d,f),this.lineTo(d+m,f),this.lineTo(d+m,f+p),this.lineTo(d,f+p),this.lineTo(d,f),this.closePath()},t.prototype.fillRect=function(d,f,m,p){var h,g;h=this.__createElement("rect",{x:d,y:f,width:m,height:p},!0),g=this.__closestGroupOrSvg(),g.appendChild(h),this.__currentElement=h,this.__applyStyleToCurrentElement("fill")},t.prototype.strokeRect=function(d,f,m,p){var h,g;h=this.__createElement("rect",{x:d,y:f,width:m,height:p},!0),g=this.__closestGroupOrSvg(),g.appendChild(h),this.__currentElement=h,this.__applyStyleToCurrentElement("stroke")},t.prototype.clearRect=function(d,f,m,p){var h,g=this.__closestGroupOrSvg();h=this.__createElement("rect",{x:d,y:f,width:m,height:p,fill:"#FFFFFF"},!0),g.appendChild(h)},t.prototype.createLinearGradient=function(d,f,m,p){var h=this.__createElement("linearGradient",{id:a(this.__ids),x1:d+"px",x2:m+"px",y1:f+"px",y2:p+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(h),new r(h,this)},t.prototype.createRadialGradient=function(d,f,m,p,h,g){var y=this.__createElement("radialGradient",{id:a(this.__ids),cx:p+"px",cy:h+"px",r:g+"px",fx:d+"px",fy:f+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(y),new r(y,this)},t.prototype.__parseFont=function(){var d=/^\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[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\"\sa-z]+?)\s*$/i,f=d.exec(this.font),m={style:f[1]||"normal",size:f[4]||"10px",family:f[6]||"sans-serif",weight:f[3]||"normal",decoration:f[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(m.decoration="underline"),this.__fontHref&&(m.href=this.__fontHref),m},t.prototype.__wrapTextLink=function(d,f){if(d.href){var m=this.__createElement("a");return m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d.href),m.appendChild(f),m}return f},t.prototype.__applyText=function(d,f,m,p){var h=this.__parseFont(),g=this.__closestGroupOrSvg(),y=this.__createElement("text",{"font-family":h.family,"font-size":h.size,"font-style":h.style,"font-weight":h.weight,"text-decoration":h.decoration,x:f,y:m,"text-anchor":l(this.textAlign),"dominant-baseline":c(this.textBaseline)},!0);y.appendChild(this.__document.createTextNode(d)),this.__currentElement=y,this.__applyStyleToCurrentElement(p),g.appendChild(this.__wrapTextLink(h,y))},t.prototype.fillText=function(d,f,m){this.__applyText(d,f,m,"fill")},t.prototype.strokeText=function(d,f,m){this.__applyText(d,f,m,"stroke")},t.prototype.measureText=function(d){return this.__ctx.font=this.font,this.__ctx.measureText(d)},t.prototype.arc=function(d,f,m,p,h,g){if(p!==h){p=p%(2*Math.PI),h=h%(2*Math.PI),p===h&&(h=(h+2*Math.PI-.001*(g?-1:1))%(2*Math.PI));var y=d+m*Math.cos(h),b=f+m*Math.sin(h),x=d+m*Math.cos(p),C=f+m*Math.sin(p),S=g?0:1,w=0,A=h-p;A<0&&(A+=2*Math.PI),g?w=A>Math.PI?0:1:w=A>Math.PI?1:0,this.lineTo(x,C),this.__addPathCommand(i("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:m,ry:m,xAxisRotation:0,largeArcFlag:w,sweepFlag:S,endX:y,endY:b})),this.__currentPosition={x:y,y:b}}},t.prototype.clip=function(){var d=this.__closestGroupOrSvg(),f=this.__createElement("clipPath"),m=a(this.__ids),p=this.__createElement("g");d.removeChild(this.__currentElement),f.setAttribute("id",m),f.appendChild(this.__currentElement),this.__defs.appendChild(f),d.setAttribute("clip-path",i("url(#{id})",{id:m})),d.appendChild(p),this.__currentElement=p},t.prototype.drawImage=function(){var d=Array.prototype.slice.call(arguments),f=d[0],m,p,h,g,y=0,b=0,x,C,S,w,A,T,D,E,I,k,R;if(d.length===3)m=d[1],p=d[2],x=f.width,C=f.height,h=x,g=C;else if(d.length===5)m=d[1],p=d[2],h=d[3],g=d[4],x=f.width,C=f.height;else if(d.length===9)y=d[1],b=d[2],x=d[3],C=d[4],m=d[5],p=d[6],h=d[7],g=d[8];else throw new Error("Inavlid number of arguments passed to drawImage: "+arguments.length);if(S=this.__closestGroupOrSvg(),D=this.__currentElement,f instanceof t){for(w=f.getSvg(),A=w.childNodes[0];A.childNodes.length;)R=A.childNodes[0].getAttribute("id"),this.__ids[R]=R,this.__defs.appendChild(A.childNodes[0]);T=w.childNodes[1],S.appendChild(T),this.__currentElement=T,this.translate(m,p),this.__currentElement=D}else(f.nodeName==="CANVAS"||f.nodeName==="IMG")&&(E=this.__createElement("image"),E.setAttribute("width",h),E.setAttribute("height",g),E.setAttribute("preserveAspectRatio","none"),(y||b||x!==f.width||C!==f.height)&&(I=this.__document.createElement("canvas"),I.width=h,I.height=g,k=I.getContext("2d"),k.drawImage(f,y,b,x,C,0,0,h,g),f=I),E.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f.nodeName==="CANVAS"?f.toDataURL():f.getAttribute("src")),S.appendChild(E),this.__currentElement=E,this.translate(m,p),this.__currentElement=D)},t.prototype.createPattern=function(d,f){var m=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),p=a(this.__ids),h;return m.setAttribute("id",p),m.setAttribute("width",d.width),m.setAttribute("height",d.height),d.nodeName==="CANVAS"||d.nodeName==="IMG"?(h=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),h.setAttribute("width",d.width),h.setAttribute("height",d.height),h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d.nodeName==="CANVAS"?d.toDataURL():d.getAttribute("src")),m.appendChild(h),this.__defs.appendChild(m)):d instanceof t&&(m.appendChild(d.__root.childNodes[1]),this.__defs.appendChild(m)),new n(m,this)},t.prototype.drawFocusRing=function(){},t.prototype.createImageData=function(){},t.prototype.getImageData=function(){},t.prototype.putImageData=function(){},t.prototype.globalCompositeOperation=function(){},t.prototype.setTransform=function(){},typeof window=="object"&&(window.C2S=t),typeof zj=="object"&&typeof zj.exports=="object"&&(zj.exports=t)})()});var oJe=ve(g0=>{"use strict";var I7t=g0&&g0.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),E7t=g0&&g0.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),D7t=g0&&g0.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&I7t(r,t,n[o]);return E7t(r,t),r}})();Object.defineProperty(g0,"__esModule",{value:!0});g0.renderToAbstractCanvas=B7t;g0.getSerializedSvg=R7t;g0.ReactRendering=O7t;var rJe=gn(),k7t=Wr(),nJe=Lce(),M7t=Uce(),Vce=Fce();async function B7t(e,t,r,n){let{exportSVG:o,highResolutionScaling:i=1}=r;if(o)if(o.rasterizeLayers){let a=o.scale||i,s=(0,Vce.createCanvas)(Math.ceil(e*a),t*a),l=s.getContext("2d");if(!l)throw new Error("2d canvas rendering not supported on this platform");return l.scale(a,a),{...await n(l),reactElement:(0,rJe.jsx)("image",{width:e,height:t,xlinkHref:"convertToBlob"in s?await(0,M7t.blobToDataURL)(await s.convertToBlob({type:"image/png"})):s.toDataURL("image/png")})}}else{let a=new nJe.CanvasSequence;return{...await n(a),canvasRecordedData:a.toJSON()}}else{let a=i,s=(0,Vce.createCanvas)(Math.ceil(e*a),t*a),l=s.getContext("2d");if(!l)throw new Error("2d canvas rendering not supported on this platform");return l.scale(a,a),{...await n(l),imageData:await(0,Vce.createImageBitmap)(s)}}}async function R7t(e){let{width:t,height:r,canvasRecordedData:n}=e,o=await Promise.resolve().then(()=>D7t(tJe())),i=new o.default(t,r);return new nJe.CanvasSequence(n).execute(i),i.getSvg().innerHTML}function O7t({rendering:e}){return(0,k7t.isValidElement)(e.reactElement)?e.reactElement:(0,rJe.jsx)("g",{dangerouslySetInnerHTML:{__html:e.html||""}})}});var aJe=ve(qj=>{"use strict";Object.defineProperty(qj,"__esModule",{value:!0});qj.isFeature=L7t;function L7t(e){return typeof e=="object"&&e!==null&&typeof e.get=="function"&&typeof e.id=="function"}function iJe(e){return"uniqueId"in e&&typeof e.data!="object"}var zce=class e{constructor(t){var r;iJe(t)?this.data=t:(this.data=t.data,this.parentHandle=t.parent);let n=iJe(t)?t.uniqueId:t.id;if(n==null)throw new Error("SimpleFeature requires a unique `id` or `data.uniqueId` attribute");if(this.uniqueId=String(n),!(this.data.aliases||this.data.end-this.data.start>=0))throw new Error(`invalid feature data, end less than start. end: ${this.data.end} start: ${this.data.start}`);this.data.subfeatures&&(this.subfeatures=(r=this.data.subfeatures)===null||r===void 0?void 0:r.map((o,i)=>typeof o.get!="function"?new e({id:o.uniqueId||`${n}-${i}`,data:{strand:this.data.strand,...o},parent:this}):o))}get(t){return t==="subfeatures"?this.subfeatures:t==="parent"?this.parent():this.data[t]}set(t,r){this.data[t]=r}tags(){return Object.keys(this.data)}id(){return this.uniqueId}parent(){return this.parentHandle}children(){return this.get("subfeatures")}toJSON(){let t={...this.data,uniqueId:this.id()},r=this.parent();r&&(t.parentId=r.id());let n=this.children();return n&&(t.subfeatures=n.map(o=>o.toJSON())),t}static fromJSON(t){return new e({...t})}};qj.default=zce});var Ca=ve(jj=>{"use strict";Object.defineProperty(jj,"__esModule",{value:!0});jj.isFunction=void 0;function F7t(e){return typeof e=="function"}jj.isFunction=F7t});var S_=ve(Gj=>{"use strict";Object.defineProperty(Gj,"__esModule",{value:!0});Gj.createErrorClass=void 0;function N7t(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}Gj.createErrorClass=N7t});var qce=ve(Hj=>{"use strict";Object.defineProperty(Hj,"__esModule",{value:!0});Hj.UnsubscriptionError=void 0;var U7t=S_();Hj.UnsubscriptionError=U7t.createErrorClass(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
7348
7348
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
7349
7349
|
`):"",this.name="UnsubscriptionError",this.errors=r}})});var v1=ve(Wj=>{"use strict";Object.defineProperty(Wj,"__esModule",{value:!0});Wj.arrRemove=void 0;function V7t(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}Wj.arrRemove=V7t});var Sp=ve(Tm=>{"use strict";var sJe=Tm&&Tm.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},lJe=Tm&&Tm.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},cJe=Tm&&Tm.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(Tm,"__esModule",{value:!0});Tm.isSubscription=Tm.EMPTY_SUBSCRIPTION=Tm.Subscription=void 0;var lO=Ca(),jce=qce(),uJe=v1(),Gce=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=sJe(a),l=s.next();!l.done;l=s.next()){var c=l.value;c.remove(this)}}catch(h){t={error:h}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(lO.isFunction(u))try{u()}catch(h){i=h instanceof jce.UnsubscriptionError?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=sJe(d),m=f.next();!m.done;m=f.next()){var p=m.value;try{dJe(p)}catch(h){i=i??[],h instanceof jce.UnsubscriptionError?i=cJe(cJe([],lJe(i)),lJe(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{m&&!m.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}}if(i)throw new jce.UnsubscriptionError(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)dJe(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&uJe.arrRemove(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&uJe.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})();Tm.Subscription=Gce;Tm.EMPTY_SUBSCRIPTION=Gce.EMPTY;function z7t(e){return e instanceof Gce||e&&"closed"in e&&lO.isFunction(e.remove)&&lO.isFunction(e.add)&&lO.isFunction(e.unsubscribe)}Tm.isSubscription=z7t;function dJe(e){lO.isFunction(e)?e():e.unsubscribe()}});var Y3=ve(Kj=>{"use strict";Object.defineProperty(Kj,"__esModule",{value:!0});Kj.config=void 0;Kj.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var Hce=ve(Ev=>{"use strict";var fJe=Ev&&Ev.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},mJe=Ev&&Ev.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(Ev,"__esModule",{value:!0});Ev.timeoutProvider=void 0;Ev.timeoutProvider={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Ev.timeoutProvider.delegate;return o?.setTimeout?o.setTimeout.apply(o,mJe([e,t],fJe(r))):setTimeout.apply(void 0,mJe([e,t],fJe(r)))},clearTimeout:function(e){var t=Ev.timeoutProvider.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0}});var Wce=ve(Yj=>{"use strict";Object.defineProperty(Yj,"__esModule",{value:!0});Yj.reportUnhandledError=void 0;var q7t=Y3(),j7t=Hce();function G7t(e){j7t.timeoutProvider.setTimeout(function(){var t=q7t.config.onUnhandledError;if(t)t(e);else throw e})}Yj.reportUnhandledError=G7t});var Xu=ve(Xj=>{"use strict";Object.defineProperty(Xj,"__esModule",{value:!0});Xj.noop=void 0;function H7t(){}Xj.noop=H7t});var pJe=ve(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});Dv.createNotification=Dv.nextNotification=Dv.errorNotification=Dv.COMPLETE_NOTIFICATION=void 0;Dv.COMPLETE_NOTIFICATION=(function(){return Zj("C",void 0,void 0)})();function W7t(e){return Zj("E",void 0,e)}Dv.errorNotification=W7t;function K7t(e){return Zj("N",e,void 0)}Dv.nextNotification=K7t;function Zj(e,t,r){return{kind:e,value:t,error:r}}Dv.createNotification=Zj});var $j=ve(X3=>{"use strict";Object.defineProperty(X3,"__esModule",{value:!0});X3.captureError=X3.errorContext=void 0;var hJe=Y3(),Iw=null;function Y7t(e){if(hJe.config.useDeprecatedSynchronousErrorHandling){var t=!Iw;if(t&&(Iw={errorThrown:!1,error:null}),e(),t){var r=Iw,n=r.errorThrown,o=r.error;if(Iw=null,n)throw o}}else e()}X3.errorContext=Y7t;function X7t(e){hJe.config.useDeprecatedSynchronousErrorHandling&&Iw&&(Iw.errorThrown=!0,Iw.error=e)}X3.captureError=X7t});var Z3=ve(y0=>{"use strict";var vJe=y0&&y0.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(y0,"__esModule",{value:!0});y0.EMPTY_OBSERVER=y0.SafeSubscriber=y0.Subscriber=void 0;var Z7t=Ca(),gJe=Sp(),Zce=Y3(),$7t=Wce(),yJe=Xu(),Kce=pJe(),Q7t=Hce(),J7t=$j(),bJe=(function(e){vJe(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,gJe.isSubscription(r)&&r.add(n)):n.destination=y0.EMPTY_OBSERVER,n}return t.create=function(r,n,o){return new xJe(r,n,o)},t.prototype.next=function(r){this.isStopped?Xce(Kce.nextNotification(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Xce(Kce.errorNotification(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Xce(Kce.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(gJe.Subscription);y0.Subscriber=bJe;var eHt=Function.prototype.bind;function Yce(e,t){return eHt.call(e,t)}var tHt=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Qj(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Qj(n)}else Qj(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Qj(r)}},e})(),xJe=(function(e){vJe(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(Z7t.isFunction(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&Zce.config.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&Yce(r.next,s),error:r.error&&Yce(r.error,s),complete:r.complete&&Yce(r.complete,s)}):a=r}return i.destination=new tHt(a),i}return t})(bJe);y0.SafeSubscriber=xJe;function Qj(e){Zce.config.useDeprecatedSynchronousErrorHandling?J7t.captureError(e):$7t.reportUnhandledError(e)}function rHt(e){throw e}function Xce(e,t){var r=Zce.config.onStoppedNotification;r&&Q7t.timeoutProvider.setTimeout(function(){return r(e,t)})}y0.EMPTY_OBSERVER={closed:!0,next:yJe.noop,error:rHt,complete:yJe.noop}});var cO=ve(Jj=>{"use strict";Object.defineProperty(Jj,"__esModule",{value:!0});Jj.observable=void 0;Jj.observable=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})()});var Zu=ve(e9=>{"use strict";Object.defineProperty(e9,"__esModule",{value:!0});e9.identity=void 0;function nHt(e){return e}e9.identity=nHt});var uO=ve($3=>{"use strict";Object.defineProperty($3,"__esModule",{value:!0});$3.pipeFromArray=$3.pipe=void 0;var oHt=Zu();function iHt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return SJe(e)}$3.pipe=iHt;function SJe(e){return e.length===0?oHt.identity:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}$3.pipeFromArray=SJe});var Ba=ve(t9=>{"use strict";Object.defineProperty(t9,"__esModule",{value:!0});t9.Observable=void 0;var Qce=Z3(),aHt=Sp(),sHt=cO(),lHt=uO(),cHt=Y3(),$ce=Ca(),uHt=$j(),dHt=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=mHt(t)?t:new Qce.SafeSubscriber(t,r,n);return uHt.errorContext(function(){var a=o,s=a.operator,l=a.source;i.add(s?s.call(i,l):l?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=_Je(r),new r(function(o,i){var a=new Qce.SafeSubscriber({next:function(s){try{t(s)}catch(l){i(l),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[sHt.observable]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return lHt.pipeFromArray(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=_Je(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e})();t9.Observable=dHt;function _Je(e){var t;return(t=e??cHt.config.Promise)!==null&&t!==void 0?t:Promise}function fHt(e){return e&&$ce.isFunction(e.next)&&$ce.isFunction(e.error)&&$ce.isFunction(e.complete)}function mHt(e){return e&&e instanceof Qce.Subscriber||fHt(e)&&aHt.isSubscription(e)}});var Fr=ve(Q3=>{"use strict";Object.defineProperty(Q3,"__esModule",{value:!0});Q3.operate=Q3.hasLift=void 0;var pHt=Ca();function CJe(e){return pHt.isFunction(e?.lift)}Q3.hasLift=CJe;function hHt(e){return function(t){if(CJe(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}Q3.operate=hHt});var fn=ve(__=>{"use strict";var gHt=__&&__.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(__,"__esModule",{value:!0});__.OperatorSubscriber=__.createOperatorSubscriber=void 0;var yHt=Z3();function vHt(e,t,r,n,o){return new wJe(e,t,r,n,o)}__.createOperatorSubscriber=vHt;var wJe=(function(e){gHt(t,e);function t(r,n,o,i,a,s){var l=e.call(this,r)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=n?function(c){try{n(c)}catch(u){r.error(u)}}:e.prototype._next,l._error=i?function(c){try{i(c)}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=o?function(){try{o()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(yHt.Subscriber);__.OperatorSubscriber=wJe});var Jce=ve(r9=>{"use strict";Object.defineProperty(r9,"__esModule",{value:!0});r9.refCount=void 0;var bHt=Fr(),xHt=fn();function SHt(){return bHt.operate(function(e,t){var r=null;e._refCount++;var n=xHt.createOperatorSubscriber(t,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount){r=null;return}var o=e._connection,i=r;r=null,o&&(!i||o===i)&&o.unsubscribe(),t.unsubscribe()});e.subscribe(n),n.closed||(r=e.connect())})}r9.refCount=SHt});var dO=ve(J3=>{"use strict";var _Ht=J3&&J3.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(J3,"__esModule",{value:!0});J3.ConnectableObservable=void 0;var CHt=Ba(),TJe=Sp(),wHt=Jce(),THt=fn(),AHt=Fr(),PHt=(function(e){_Ht(t,e);function t(r,n){var o=e.call(this)||this;return o.source=r,o.subjectFactory=n,o._subject=null,o._refCount=0,o._connection=null,AHt.hasLift(r)&&(o.lift=r.lift),o}return t.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},t.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var r=this._connection;this._subject=this._connection=null,r?.unsubscribe()},t.prototype.connect=function(){var r=this,n=this._connection;if(!n){n=this._connection=new TJe.Subscription;var o=this.getSubject();n.add(this.source.subscribe(THt.createOperatorSubscriber(o,void 0,function(){r._teardown(),o.complete()},function(i){r._teardown(),o.error(i)},function(){return r._teardown()}))),n.closed&&(this._connection=null,n=TJe.Subscription.EMPTY)}return n},t.prototype.refCount=function(){return wHt.refCount()(this)},t})(CHt.Observable);J3.ConnectableObservable=PHt});var AJe=ve(fO=>{"use strict";Object.defineProperty(fO,"__esModule",{value:!0});fO.performanceTimestampProvider=void 0;fO.performanceTimestampProvider={now:function(){return(fO.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var eue=ve(v0=>{"use strict";var PJe=v0&&v0.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},IJe=v0&&v0.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(v0,"__esModule",{value:!0});v0.animationFrameProvider=void 0;var IHt=Sp();v0.animationFrameProvider={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=v0.animationFrameProvider.delegate;n&&(t=n.requestAnimationFrame,r=n.cancelAnimationFrame);var o=t(function(i){r=void 0,e(i)});return new IHt.Subscription(function(){return r?.(o)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=v0.animationFrameProvider.delegate;return(r?.requestAnimationFrame||requestAnimationFrame).apply(void 0,IJe([],PJe(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=v0.animationFrameProvider.delegate;return(r?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,IJe([],PJe(e)))},delegate:void 0}});var kJe=ve(n9=>{"use strict";Object.defineProperty(n9,"__esModule",{value:!0});n9.animationFrames=void 0;var EHt=Ba(),DHt=AJe(),EJe=eue();function kHt(e){return e?DJe(e):MHt}n9.animationFrames=kHt;function DJe(e){return new EHt.Observable(function(t){var r=e||DHt.performanceTimestampProvider,n=r.now(),o=0,i=function(){t.closed||(o=EJe.animationFrameProvider.requestAnimationFrame(function(a){o=0;var s=r.now();t.next({timestamp:e?s:a,elapsed:s-n}),i()}))};return i(),function(){o&&EJe.animationFrameProvider.cancelAnimationFrame(o)}})}var MHt=DJe()});var tue=ve(o9=>{"use strict";Object.defineProperty(o9,"__esModule",{value:!0});o9.ObjectUnsubscribedError=void 0;var BHt=S_();o9.ObjectUnsubscribedError=BHt.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var $u=ve(kv=>{"use strict";var BJe=kv&&kv.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),RHt=kv&&kv.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(kv,"__esModule",{value:!0});kv.AnonymousSubject=kv.Subject=void 0;var MJe=Ba(),nue=Sp(),OHt=tue(),LHt=v1(),rue=$j(),RJe=(function(e){BJe(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new oue(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new OHt.ObjectUnsubscribedError},t.prototype.next=function(r){var n=this;rue.errorContext(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=RHt(n.currentObservers),s=a.next();!s.done;s=a.next()){var l=s.value;l.next(r)}}catch(c){o={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;rue.errorContext(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;rue.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?nue.EMPTY_SUBSCRIPTION:(this.currentObservers=null,s.push(r),new nue.Subscription(function(){n.currentObservers=null,LHt.arrRemove(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new MJe.Observable;return r.source=this,r},t.create=function(r,n){return new oue(r,n)},t})(MJe.Observable);kv.Subject=RJe;var oue=(function(e){BJe(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:nue.EMPTY_SUBSCRIPTION},t})(RJe);kv.AnonymousSubject=oue});var iue=ve(eE=>{"use strict";var FHt=eE&&eE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(eE,"__esModule",{value:!0});eE.BehaviorSubject=void 0;var NHt=$u(),UHt=(function(e){FHt(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(NHt.Subject);eE.BehaviorSubject=UHt});var i9=ve(mO=>{"use strict";Object.defineProperty(mO,"__esModule",{value:!0});mO.dateTimestampProvider=void 0;mO.dateTimestampProvider={now:function(){return(mO.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var a9=ve(tE=>{"use strict";var VHt=tE&&tE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(tE,"__esModule",{value:!0});tE.ReplaySubject=void 0;var zHt=$u(),qHt=i9(),jHt=(function(e){VHt(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=qHt.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,l=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+l)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),l=0;l<s.length&&!r.closed;l+=i?1:2)r.next(s[l]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<i.length&&i.splice(0,i.length-s),!a){for(var l=o.now(),c=0,u=1;u<i.length&&i[u]<=l;u+=2)c=u;c&&i.splice(0,c+1)}},t})(zHt.Subject);tE.ReplaySubject=jHt});var s9=ve(rE=>{"use strict";var GHt=rE&&rE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(rE,"__esModule",{value:!0});rE.AsyncSubject=void 0;var HHt=$u(),WHt=(function(e){GHt(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._value=null,r._hasValue=!1,r._isComplete=!1,r}return t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n._hasValue,a=n._value,s=n.thrownError,l=n.isStopped,c=n._isComplete;o?r.error(s):(l||c)&&(i&&r.next(a),r.complete())},t.prototype.next=function(r){this.isStopped||(this._value=r,this._hasValue=!0)},t.prototype.complete=function(){var r=this,n=r._hasValue,o=r._value,i=r._isComplete;i||(this._isComplete=!0,n&&e.prototype.next.call(this,o),e.prototype.complete.call(this))},t})(HHt.Subject);rE.AsyncSubject=WHt});var OJe=ve(nE=>{"use strict";var KHt=nE&&nE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(nE,"__esModule",{value:!0});nE.Action=void 0;var YHt=Sp(),XHt=(function(e){KHt(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t})(YHt.Subscription);nE.Action=XHt});var NJe=ve(Mv=>{"use strict";var LJe=Mv&&Mv.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},FJe=Mv&&Mv.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(Mv,"__esModule",{value:!0});Mv.intervalProvider=void 0;Mv.intervalProvider={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Mv.intervalProvider.delegate;return o?.setInterval?o.setInterval.apply(o,FJe([e,t],LJe(r))):setInterval.apply(void 0,FJe([e,t],LJe(r)))},clearInterval:function(e){var t=Mv.intervalProvider.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0}});var iE=ve(oE=>{"use strict";var ZHt=oE&&oE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(oE,"__esModule",{value:!0});oE.AsyncAction=void 0;var $Ht=OJe(),UJe=NJe(),QHt=v1(),JHt=(function(e){ZHt(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.pending=!1,o}return t.prototype.schedule=function(r,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,a=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(a,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(a,this.id,n),this},t.prototype.requestAsyncId=function(r,n,o){return o===void 0&&(o=0),UJe.intervalProvider.setInterval(r.flush.bind(r,this),o)},t.prototype.recycleAsyncId=function(r,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&UJe.intervalProvider.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(r,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var o=!1,i;try{this.work(r)}catch(a){o=!0,i=a||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,o=r.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,QHt.arrRemove(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})($Ht.Action);oE.AsyncAction=JHt});var zJe=ve(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});aE.TestTools=aE.Immediate=void 0;var eWt=1,aue,l9={};function VJe(e){return e in l9?(delete l9[e],!0):!1}aE.Immediate={setImmediate:function(e){var t=eWt++;return l9[t]=!0,aue||(aue=Promise.resolve()),aue.then(function(){return VJe(t)&&e()}),t},clearImmediate:function(e){VJe(e)}};aE.TestTools={pending:function(){return Object.keys(l9).length}}});var jJe=ve(Bv=>{"use strict";var tWt=Bv&&Bv.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},rWt=Bv&&Bv.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(Bv,"__esModule",{value:!0});Bv.immediateProvider=void 0;var qJe=zJe(),nWt=qJe.Immediate.setImmediate,oWt=qJe.Immediate.clearImmediate;Bv.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Bv.immediateProvider.delegate;return(r?.setImmediate||nWt).apply(void 0,rWt([],tWt(e)))},clearImmediate:function(e){var t=Bv.immediateProvider.delegate;return(t?.clearImmediate||oWt)(e)},delegate:void 0}});var HJe=ve(sE=>{"use strict";var iWt=sE&&sE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(sE,"__esModule",{value:!0});sE.AsapAction=void 0;var aWt=iE(),GJe=jJe(),sWt=(function(e){iWt(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o}return t.prototype.requestAsyncId=function(r,n,o){return o===void 0&&(o=0),o!==null&&o>0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=GJe.immediateProvider.setImmediate(r.flush.bind(r,void 0))))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var a=r.actions;n!=null&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==n&&(GJe.immediateProvider.clearImmediate(n),r._scheduled===n&&(r._scheduled=void 0))},t})(aWt.AsyncAction);sE.AsapAction=sWt});var sue=ve(c9=>{"use strict";Object.defineProperty(c9,"__esModule",{value:!0});c9.Scheduler=void 0;var lWt=i9(),cWt=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=lWt.dateTimestampProvider.now,e})();c9.Scheduler=cWt});var cE=ve(lE=>{"use strict";var uWt=lE&&lE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(lE,"__esModule",{value:!0});lE.AsyncScheduler=void 0;var WJe=sue(),dWt=(function(e){uWt(t,e);function t(r,n){n===void 0&&(n=WJe.Scheduler.now);var o=e.call(this,r,n)||this;return o.actions=[],o._active=!1,o}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var o;this._active=!0;do if(o=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,o){for(;r=n.shift();)r.unsubscribe();throw o}},t})(WJe.Scheduler);lE.AsyncScheduler=dWt});var KJe=ve(uE=>{"use strict";var fWt=uE&&uE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(uE,"__esModule",{value:!0});uE.AsapScheduler=void 0;var mWt=cE(),pWt=(function(e){fWt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t})(mWt.AsyncScheduler);uE.AsapScheduler=pWt});var YJe=ve(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});Ew.asap=Ew.asapScheduler=void 0;var hWt=HJe(),gWt=KJe();Ew.asapScheduler=new gWt.AsapScheduler(hWt.AsapAction);Ew.asap=Ew.asapScheduler});var Am=ve(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});Dw.async=Dw.asyncScheduler=void 0;var yWt=iE(),vWt=cE();Dw.asyncScheduler=new vWt.AsyncScheduler(yWt.AsyncAction);Dw.async=Dw.asyncScheduler});var XJe=ve(dE=>{"use strict";var bWt=dE&&dE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(dE,"__esModule",{value:!0});dE.QueueAction=void 0;var xWt=iE(),SWt=(function(e){bWt(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,n){return n>0||this.closed?e.prototype.execute.call(this,r,n):this._execute(r,n)},t.prototype.requestAsyncId=function(r,n,o){return o===void 0&&(o=0),o!=null&&o>0||o==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,n,o):(r.flush(this),0)},t})(xWt.AsyncAction);dE.QueueAction=SWt});var ZJe=ve(fE=>{"use strict";var _Wt=fE&&fE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(fE,"__esModule",{value:!0});fE.QueueScheduler=void 0;var CWt=cE(),wWt=(function(e){_Wt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(CWt.AsyncScheduler);fE.QueueScheduler=wWt});var $Je=ve(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});kw.queue=kw.queueScheduler=void 0;var TWt=XJe(),AWt=ZJe();kw.queueScheduler=new AWt.QueueScheduler(TWt.QueueAction);kw.queue=kw.queueScheduler});var JJe=ve(mE=>{"use strict";var PWt=mE&&mE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(mE,"__esModule",{value:!0});mE.AnimationFrameAction=void 0;var IWt=iE(),QJe=eue(),EWt=(function(e){PWt(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o}return t.prototype.requestAsyncId=function(r,n,o){return o===void 0&&(o=0),o!==null&&o>0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=QJe.animationFrameProvider.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var a=r.actions;n!=null&&n===r._scheduled&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==n&&(QJe.animationFrameProvider.cancelAnimationFrame(n),r._scheduled=void 0)},t})(IWt.AsyncAction);mE.AnimationFrameAction=EWt});var eet=ve(pE=>{"use strict";var DWt=pE&&pE.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(pE,"__esModule",{value:!0});pE.AnimationFrameScheduler=void 0;var kWt=cE(),MWt=(function(e){DWt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n;r?n=r.id:(n=this._scheduled,this._scheduled=void 0);var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t})(kWt.AsyncScheduler);pE.AnimationFrameScheduler=MWt});var tet=ve(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});Mw.animationFrame=Mw.animationFrameScheduler=void 0;var BWt=JJe(),RWt=eet();Mw.animationFrameScheduler=new RWt.AnimationFrameScheduler(BWt.AnimationFrameAction);Mw.animationFrame=Mw.animationFrameScheduler});var oet=ve(C_=>{"use strict";var ret=C_&&C_.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(C_,"__esModule",{value:!0});C_.VirtualAction=C_.VirtualTimeScheduler=void 0;var OWt=iE(),LWt=Sp(),FWt=cE(),NWt=(function(e){ret(t,e);function t(r,n){r===void 0&&(r=net),n===void 0&&(n=1/0);var o=e.call(this,r,function(){return o.frame})||this;return o.maxFrames=n,o.frame=0,o.index=-1,o}return t.prototype.flush=function(){for(var r=this,n=r.actions,o=r.maxFrames,i,a;(a=n[0])&&a.delay<=o&&(n.shift(),this.frame=a.delay,!(i=a.execute(a.state,a.delay))););if(i){for(;a=n.shift();)a.unsubscribe();throw i}},t.frameTimeFactor=10,t})(FWt.AsyncScheduler);C_.VirtualTimeScheduler=NWt;var net=(function(e){ret(t,e);function t(r,n,o){o===void 0&&(o=r.index+=1);var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.index=o,i.active=!0,i.index=r.index=o,i}return t.prototype.schedule=function(r,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var o=new t(this.scheduler,this.work);return this.add(o),o.schedule(r,n)}else return LWt.Subscription.EMPTY},t.prototype.requestAsyncId=function(r,n,o){o===void 0&&(o=0),this.delay=r.frame+o;var i=r.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(r,n,o){o===void 0&&(o=0)},t.prototype._execute=function(r,n){if(this.active===!0)return e.prototype._execute.call(this,r,n)},t.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},t})(OWt.AsyncAction);C_.VirtualAction=net});var b0=ve(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});Bw.empty=Bw.EMPTY=void 0;var iet=Ba();Bw.EMPTY=new iet.Observable(function(e){return e.complete()});function UWt(e){return e?VWt(e):Bw.EMPTY}Bw.empty=UWt;function VWt(e){return new iet.Observable(function(t){return e.schedule(function(){return t.complete()})})}});var pO=ve(u9=>{"use strict";Object.defineProperty(u9,"__esModule",{value:!0});u9.isScheduler=void 0;var zWt=Ca();function qWt(e){return e&&zWt.isFunction(e.schedule)}u9.isScheduler=qWt});var Pm=ve(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.popNumber=w_.popScheduler=w_.popResultSelector=void 0;var jWt=Ca(),GWt=pO();function lue(e){return e[e.length-1]}function HWt(e){return jWt.isFunction(lue(e))?e.pop():void 0}w_.popResultSelector=HWt;function WWt(e){return GWt.isScheduler(lue(e))?e.pop():void 0}w_.popScheduler=WWt;function KWt(e,t){return typeof lue(e)=="number"?e.pop():t}w_.popNumber=KWt});var f9=ve(d9=>{"use strict";Object.defineProperty(d9,"__esModule",{value:!0});d9.isArrayLike=void 0;d9.isArrayLike=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"})});var cue=ve(m9=>{"use strict";Object.defineProperty(m9,"__esModule",{value:!0});m9.isPromise=void 0;var YWt=Ca();function XWt(e){return YWt.isFunction(e?.then)}m9.isPromise=XWt});var uue=ve(p9=>{"use strict";Object.defineProperty(p9,"__esModule",{value:!0});p9.isInteropObservable=void 0;var ZWt=cO(),$Wt=Ca();function QWt(e){return $Wt.isFunction(e[ZWt.observable])}p9.isInteropObservable=QWt});var due=ve(h9=>{"use strict";Object.defineProperty(h9,"__esModule",{value:!0});h9.isAsyncIterable=void 0;var JWt=Ca();function eKt(e){return Symbol.asyncIterator&&JWt.isFunction(e?.[Symbol.asyncIterator])}h9.isAsyncIterable=eKt});var fue=ve(g9=>{"use strict";Object.defineProperty(g9,"__esModule",{value:!0});g9.createInvalidObservableTypeError=void 0;function tKt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}g9.createInvalidObservableTypeError=tKt});var mue=ve(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.iterator=hE.getSymbolIterator=void 0;function aet(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}hE.getSymbolIterator=aet;hE.iterator=aet()});var pue=ve(y9=>{"use strict";Object.defineProperty(y9,"__esModule",{value:!0});y9.isIterable=void 0;var rKt=mue(),nKt=Ca();function oKt(e){return nKt.isFunction(e?.[rKt.iterator])}y9.isIterable=oKt});var v9=ve(Zh=>{"use strict";var iKt=Zh&&Zh.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},gE=Zh&&Zh.__await||function(e){return this instanceof gE?(this.v=e,this):new gE(e)},aKt=Zh&&Zh.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(f){n[f]&&(o[f]=function(m){return new Promise(function(p,h){i.push([f,m,p,h])>1||s(f,m)})})}function s(f,m){try{l(n[f](m))}catch(p){d(i[0][3],p)}}function l(f){f.value instanceof gE?Promise.resolve(f.value.v).then(c,u):d(i[0][2],f)}function c(f){s("next",f)}function u(f){s("throw",f)}function d(f,m){f(m),i.shift(),i.length&&s(i[0][0],i[0][1])}};Object.defineProperty(Zh,"__esModule",{value:!0});Zh.isReadableStreamLike=Zh.readableStreamLikeToAsyncGenerator=void 0;var sKt=Ca();function lKt(e){return aKt(this,arguments,function(){var r,n,o,i;return iKt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,gE(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,gE(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,gE(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}Zh.readableStreamLikeToAsyncGenerator=lKt;function cKt(e){return sKt.isFunction(e?.getReader)}Zh.isReadableStreamLike=cKt});var Po=ve(Bs=>{"use strict";var uKt=Bs&&Bs.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((n=n.apply(e,t||[])).next())})},dKt=Bs&&Bs.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},fKt=Bs&&Bs.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof hue=="function"?hue(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value)})}}function o(i,a,s,l){Promise.resolve(l).then(function(c){i({value:c,done:s})},a)}},hue=Bs&&Bs.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.fromReadableStreamLike=Bs.fromAsyncIterable=Bs.fromIterable=Bs.fromPromise=Bs.fromArrayLike=Bs.fromInteropObservable=Bs.innerFrom=void 0;var mKt=f9(),pKt=cue(),yE=Ba(),hKt=uue(),gKt=due(),yKt=fue(),vKt=pue(),set=v9(),bKt=Ca(),xKt=Wce(),SKt=cO();function _Kt(e){if(e instanceof yE.Observable)return e;if(e!=null){if(hKt.isInteropObservable(e))return cet(e);if(mKt.isArrayLike(e))return uet(e);if(pKt.isPromise(e))return det(e);if(gKt.isAsyncIterable(e))return gue(e);if(vKt.isIterable(e))return fet(e);if(set.isReadableStreamLike(e))return met(e)}throw yKt.createInvalidObservableTypeError(e)}Bs.innerFrom=_Kt;function cet(e){return new yE.Observable(function(t){var r=e[SKt.observable]();if(bKt.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}Bs.fromInteropObservable=cet;function uet(e){return new yE.Observable(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}Bs.fromArrayLike=uet;function det(e){return new yE.Observable(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,xKt.reportUnhandledError)})}Bs.fromPromise=det;function fet(e){return new yE.Observable(function(t){var r,n;try{for(var o=hue(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}Bs.fromIterable=fet;function gue(e){return new yE.Observable(function(t){CKt(e,t).catch(function(r){return t.error(r)})})}Bs.fromAsyncIterable=gue;function met(e){return gue(set.readableStreamLikeToAsyncGenerator(e))}Bs.fromReadableStreamLike=met;function CKt(e,t){var r,n,o,i;return uKt(this,void 0,void 0,function(){var a,s;return dKt(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),r=fKt(e),l.label=1;case 1:return[4,r.next()];case 2:if(n=l.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),o={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}});var b1=ve(b9=>{"use strict";Object.defineProperty(b9,"__esModule",{value:!0});b9.executeSchedule=void 0;function wKt(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}b9.executeSchedule=wKt});var hO=ve(x9=>{"use strict";Object.defineProperty(x9,"__esModule",{value:!0});x9.observeOn=void 0;var yue=b1(),TKt=Fr(),AKt=fn();function PKt(e,t){return t===void 0&&(t=0),TKt.operate(function(r,n){r.subscribe(AKt.createOperatorSubscriber(n,function(o){return yue.executeSchedule(n,e,function(){return n.next(o)},t)},function(){return yue.executeSchedule(n,e,function(){return n.complete()},t)},function(o){return yue.executeSchedule(n,e,function(){return n.error(o)},t)}))})}x9.observeOn=PKt});var gO=ve(S9=>{"use strict";Object.defineProperty(S9,"__esModule",{value:!0});S9.subscribeOn=void 0;var IKt=Fr();function EKt(e,t){return t===void 0&&(t=0),IKt.operate(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}S9.subscribeOn=EKt});var pet=ve(_9=>{"use strict";Object.defineProperty(_9,"__esModule",{value:!0});_9.scheduleObservable=void 0;var DKt=Po(),kKt=hO(),MKt=gO();function BKt(e,t){return DKt.innerFrom(e).pipe(MKt.subscribeOn(t),kKt.observeOn(t))}_9.scheduleObservable=BKt});var het=ve(C9=>{"use strict";Object.defineProperty(C9,"__esModule",{value:!0});C9.schedulePromise=void 0;var RKt=Po(),OKt=hO(),LKt=gO();function FKt(e,t){return RKt.innerFrom(e).pipe(LKt.subscribeOn(t),OKt.observeOn(t))}C9.schedulePromise=FKt});var get=ve(w9=>{"use strict";Object.defineProperty(w9,"__esModule",{value:!0});w9.scheduleArray=void 0;var NKt=Ba();function UKt(e,t){return new NKt.Observable(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}w9.scheduleArray=UKt});var vue=ve(T9=>{"use strict";Object.defineProperty(T9,"__esModule",{value:!0});T9.scheduleIterable=void 0;var VKt=Ba(),zKt=mue(),qKt=Ca(),yet=b1();function jKt(e,t){return new VKt.Observable(function(r){var n;return yet.executeSchedule(r,t,function(){n=e[zKt.iterator](),yet.executeSchedule(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return qKt.isFunction(n?.return)&&n.return()}})}T9.scheduleIterable=jKt});var bue=ve(A9=>{"use strict";Object.defineProperty(A9,"__esModule",{value:!0});A9.scheduleAsyncIterable=void 0;var GKt=Ba(),vet=b1();function HKt(e,t){if(!e)throw new Error("Iterable cannot be null");return new GKt.Observable(function(r){vet.executeSchedule(r,t,function(){var n=e[Symbol.asyncIterator]();vet.executeSchedule(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}A9.scheduleAsyncIterable=HKt});var bet=ve(P9=>{"use strict";Object.defineProperty(P9,"__esModule",{value:!0});P9.scheduleReadableStreamLike=void 0;var WKt=bue(),KKt=v9();function YKt(e,t){return WKt.scheduleAsyncIterable(KKt.readableStreamLikeToAsyncGenerator(e),t)}P9.scheduleReadableStreamLike=YKt});var xue=ve(I9=>{"use strict";Object.defineProperty(I9,"__esModule",{value:!0});I9.scheduled=void 0;var XKt=pet(),ZKt=het(),$Kt=get(),QKt=vue(),JKt=bue(),eYt=uue(),tYt=cue(),rYt=f9(),nYt=pue(),oYt=due(),iYt=fue(),aYt=v9(),sYt=bet();function lYt(e,t){if(e!=null){if(eYt.isInteropObservable(e))return XKt.scheduleObservable(e,t);if(rYt.isArrayLike(e))return $Kt.scheduleArray(e,t);if(tYt.isPromise(e))return ZKt.schedulePromise(e,t);if(oYt.isAsyncIterable(e))return JKt.scheduleAsyncIterable(e,t);if(nYt.isIterable(e))return QKt.scheduleIterable(e,t);if(aYt.isReadableStreamLike(e))return sYt.scheduleReadableStreamLike(e,t)}throw iYt.createInvalidObservableTypeError(e)}I9.scheduled=lYt});var x1=ve(E9=>{"use strict";Object.defineProperty(E9,"__esModule",{value:!0});E9.from=void 0;var cYt=xue(),uYt=Po();function dYt(e,t){return t?cYt.scheduled(e,t):uYt.innerFrom(e)}E9.from=dYt});var k9=ve(D9=>{"use strict";Object.defineProperty(D9,"__esModule",{value:!0});D9.of=void 0;var fYt=Pm(),mYt=x1();function pYt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=fYt.popScheduler(e);return mYt.from(e,r)}D9.of=pYt});var Sue=ve(M9=>{"use strict";Object.defineProperty(M9,"__esModule",{value:!0});M9.throwError=void 0;var hYt=Ba(),gYt=Ca();function yYt(e,t){var r=gYt.isFunction(e)?e:function(){return e},n=function(o){return o.error(r())};return new hYt.Observable(t?function(o){return t.schedule(n,0,o)}:n)}M9.throwError=yYt});var B9=ve(S1=>{"use strict";Object.defineProperty(S1,"__esModule",{value:!0});S1.observeNotification=S1.Notification=S1.NotificationKind=void 0;var vYt=b0(),bYt=k9(),xYt=Sue(),SYt=Ca(),_Yt;(function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"})(_Yt=S1.NotificationKind||(S1.NotificationKind={}));var CYt=(function(){function e(t,r,n){this.kind=t,this.value=r,this.error=n,this.hasValue=t==="N"}return e.prototype.observe=function(t){return xet(this,t)},e.prototype.do=function(t,r,n){var o=this,i=o.kind,a=o.value,s=o.error;return i==="N"?t?.(a):i==="E"?r?.(s):n?.()},e.prototype.accept=function(t,r,n){var o;return SYt.isFunction((o=t)===null||o===void 0?void 0:o.next)?this.observe(t):this.do(t,r,n)},e.prototype.toObservable=function(){var t=this,r=t.kind,n=t.value,o=t.error,i=r==="N"?bYt.of(n):r==="E"?xYt.throwError(function(){return o}):r==="C"?vYt.EMPTY:0;if(!i)throw new TypeError("Unexpected notification kind "+r);return i},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e})();S1.Notification=CYt;function xet(e,t){var r,n,o,i=e,a=i.kind,s=i.value,l=i.error;if(typeof a!="string")throw new TypeError('Invalid notification, missing "kind"');a==="N"?(r=t.next)===null||r===void 0||r.call(t,s):a==="E"?(n=t.error)===null||n===void 0||n.call(t,l):(o=t.complete)===null||o===void 0||o.call(t)}S1.observeNotification=xet});var Cet=ve(R9=>{"use strict";Object.defineProperty(R9,"__esModule",{value:!0});R9.isObservable=void 0;var wYt=Ba(),_et=Ca();function TYt(e){return!!e&&(e instanceof wYt.Observable||_et.isFunction(e.lift)&&_et.isFunction(e.subscribe))}R9.isObservable=TYt});var T_=ve(O9=>{"use strict";Object.defineProperty(O9,"__esModule",{value:!0});O9.EmptyError=void 0;var AYt=S_();O9.EmptyError=AYt.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}})});var wet=ve(L9=>{"use strict";Object.defineProperty(L9,"__esModule",{value:!0});L9.lastValueFrom=void 0;var PYt=T_();function IYt(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(s){a=s,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new PYt.EmptyError)}})})}L9.lastValueFrom=IYt});var Tet=ve(F9=>{"use strict";Object.defineProperty(F9,"__esModule",{value:!0});F9.firstValueFrom=void 0;var EYt=T_(),DYt=Z3();function kYt(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=new DYt.SafeSubscriber({next:function(a){n(a),i.unsubscribe()},error:o,complete:function(){r?n(t.defaultValue):o(new EYt.EmptyError)}});e.subscribe(i)})}F9.firstValueFrom=kYt});var _ue=ve(N9=>{"use strict";Object.defineProperty(N9,"__esModule",{value:!0});N9.ArgumentOutOfRangeError=void 0;var MYt=S_();N9.ArgumentOutOfRangeError=MYt.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var Cue=ve(U9=>{"use strict";Object.defineProperty(U9,"__esModule",{value:!0});U9.NotFoundError=void 0;var BYt=S_();U9.NotFoundError=BYt.createErrorClass(function(e){return function(r){e(this),this.name="NotFoundError",this.message=r}})});var wue=ve(V9=>{"use strict";Object.defineProperty(V9,"__esModule",{value:!0});V9.SequenceError=void 0;var RYt=S_();V9.SequenceError=RYt.createErrorClass(function(e){return function(r){e(this),this.name="SequenceError",this.message=r}})});var q9=ve(z9=>{"use strict";Object.defineProperty(z9,"__esModule",{value:!0});z9.isValidDate=void 0;function OYt(e){return e instanceof Date&&!isNaN(e)}z9.isValidDate=OYt});var j9=ve(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});Rw.timeout=Rw.TimeoutError=void 0;var LYt=Am(),FYt=q9(),NYt=Fr(),UYt=Po(),VYt=S_(),zYt=fn(),qYt=b1();Rw.TimeoutError=VYt.createErrorClass(function(e){return function(r){r===void 0&&(r=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function jYt(e,t){var r=FYt.isValidDate(e)?{first:e}:typeof e=="number"?{each:e}:e,n=r.first,o=r.each,i=r.with,a=i===void 0?GYt:i,s=r.scheduler,l=s===void 0?t??LYt.asyncScheduler:s,c=r.meta,u=c===void 0?null:c;if(n==null&&o==null)throw new TypeError("No timeout provided.");return NYt.operate(function(d,f){var m,p,h=null,g=0,y=function(b){p=qYt.executeSchedule(f,l,function(){try{m.unsubscribe(),UYt.innerFrom(a({meta:u,lastValue:h,seen:g})).subscribe(f)}catch(x){f.error(x)}},b)};m=d.subscribe(zYt.createOperatorSubscriber(f,function(b){p?.unsubscribe(),g++,f.next(h=b),o>0&&y(o)},void 0,void 0,function(){p?.closed||p?.unsubscribe(),h=null})),!g&&y(n!=null?typeof n=="number"?n:+n-l.now():o)})}Rw.timeout=jYt;function GYt(e){throw new Rw.TimeoutError(e)}});var A_=ve(G9=>{"use strict";Object.defineProperty(G9,"__esModule",{value:!0});G9.map=void 0;var HYt=Fr(),WYt=fn();function KYt(e,t){return HYt.operate(function(r,n){var o=0;r.subscribe(WYt.createOperatorSubscriber(n,function(i){n.next(e.call(t,i,o++))}))})}G9.map=KYt});var I_=ve(P_=>{"use strict";var YYt=P_&&P_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},XYt=P_&&P_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(P_,"__esModule",{value:!0});P_.mapOneOrManyArgs=void 0;var ZYt=A_(),$Yt=Array.isArray;function QYt(e,t){return $Yt(t)?e.apply(void 0,XYt([],YYt(t))):e(t)}function JYt(e){return ZYt.map(function(t){return QYt(e,t)})}P_.mapOneOrManyArgs=JYt});var Aue=ve(E_=>{"use strict";var eXt=E_&&E_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},Aet=E_&&E_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(E_,"__esModule",{value:!0});E_.bindCallbackInternals=void 0;var tXt=pO(),rXt=Ba(),nXt=gO(),oXt=I_(),iXt=hO(),aXt=s9();function Tue(e,t,r,n){if(r)if(tXt.isScheduler(r))n=r;else return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return Tue(e,t,n).apply(this,o).pipe(oXt.mapOneOrManyArgs(r))};return n?function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return Tue(e,t).apply(this,o).pipe(nXt.subscribeOn(n),iXt.observeOn(n))}:function(){for(var o=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=new aXt.AsyncSubject,l=!0;return new rXt.Observable(function(c){var u=s.subscribe(c);if(l){l=!1;var d=!1,f=!1;t.apply(o,Aet(Aet([],eXt(i)),[function(){for(var m=[],p=0;p<arguments.length;p++)m[p]=arguments[p];if(e){var h=m.shift();if(h!=null){s.error(h);return}}s.next(1<m.length?m:m[0]),f=!0,d&&s.complete()}])),f&&s.complete(),d=!0}return u})}}E_.bindCallbackInternals=Tue});var Pet=ve(H9=>{"use strict";Object.defineProperty(H9,"__esModule",{value:!0});H9.bindCallback=void 0;var sXt=Aue();function lXt(e,t,r){return sXt.bindCallbackInternals(!1,e,t,r)}H9.bindCallback=lXt});var Iet=ve(W9=>{"use strict";Object.defineProperty(W9,"__esModule",{value:!0});W9.bindNodeCallback=void 0;var cXt=Aue();function uXt(e,t,r){return cXt.bindCallbackInternals(!0,e,t,r)}W9.bindNodeCallback=uXt});var Pue=ve(K9=>{"use strict";Object.defineProperty(K9,"__esModule",{value:!0});K9.argsArgArrayOrObject=void 0;var dXt=Array.isArray,fXt=Object.getPrototypeOf,mXt=Object.prototype,pXt=Object.keys;function hXt(e){if(e.length===1){var t=e[0];if(dXt(t))return{args:t,keys:null};if(gXt(t)){var r=pXt(t);return{args:r.map(function(n){return t[n]}),keys:r}}}return{args:e,keys:null}}K9.argsArgArrayOrObject=hXt;function gXt(e){return e&&typeof e=="object"&&fXt(e)===mXt}});var Iue=ve(Y9=>{"use strict";Object.defineProperty(Y9,"__esModule",{value:!0});Y9.createObject=void 0;function yXt(e,t){return e.reduce(function(r,n,o){return r[n]=t[o],r},{})}Y9.createObject=yXt});var X9=ve(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});vE.combineLatestInit=vE.combineLatest=void 0;var vXt=Ba(),bXt=Pue(),ket=x1(),Met=Zu(),xXt=I_(),Eet=Pm(),SXt=Iue(),_Xt=fn(),CXt=b1();function wXt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Eet.popScheduler(e),n=Eet.popResultSelector(e),o=bXt.argsArgArrayOrObject(e),i=o.args,a=o.keys;if(i.length===0)return ket.from([],r);var s=new vXt.Observable(Bet(i,r,a?function(l){return SXt.createObject(a,l)}:Met.identity));return n?s.pipe(xXt.mapOneOrManyArgs(n)):s}vE.combineLatest=wXt;function Bet(e,t,r){return r===void 0&&(r=Met.identity),function(n){Det(t,function(){for(var o=e.length,i=new Array(o),a=o,s=o,l=function(u){Det(t,function(){var d=ket.from(e[u],t),f=!1;d.subscribe(_Xt.createOperatorSubscriber(n,function(m){i[u]=m,f||(f=!0,s--),s||n.next(r(i.slice()))},function(){--a||n.complete()}))},n)},c=0;c<o;c++)l(c)},n)}}vE.combineLatestInit=Bet;function Det(e,t,r){e?CXt.executeSchedule(r,e,t):t()}});var $9=ve(Z9=>{"use strict";Object.defineProperty(Z9,"__esModule",{value:!0});Z9.mergeInternals=void 0;var TXt=Po(),AXt=b1(),Ret=fn();function PXt(e,t,r,n,o,i,a,s){var l=[],c=0,u=0,d=!1,f=function(){d&&!l.length&&!c&&t.complete()},m=function(h){return c<n?p(h):l.push(h)},p=function(h){i&&t.next(h),c++;var g=!1;TXt.innerFrom(r(h,u++)).subscribe(Ret.createOperatorSubscriber(t,function(y){o?.(y),i?m(y):t.next(y)},function(){g=!0},void 0,function(){if(g)try{c--;for(var y=function(){var b=l.shift();a?AXt.executeSchedule(t,a,function(){return p(b)}):p(b)};l.length&&c<n;)y();f()}catch(b){t.error(b)}}))};return e.subscribe(Ret.createOperatorSubscriber(t,m,function(){d=!0,f()})),function(){s?.()}}Z9.mergeInternals=PXt});var _1=ve(Q9=>{"use strict";Object.defineProperty(Q9,"__esModule",{value:!0});Q9.mergeMap=void 0;var IXt=A_(),EXt=Po(),DXt=Fr(),kXt=$9(),MXt=Ca();function Oet(e,t,r){return r===void 0&&(r=1/0),MXt.isFunction(t)?Oet(function(n,o){return IXt.map(function(i,a){return t(n,i,o,a)})(EXt.innerFrom(e(n,o)))},r):(typeof t=="number"&&(r=t),DXt.operate(function(n,o){return kXt.mergeInternals(n,o,e,r)}))}Q9.mergeMap=Oet});var yO=ve(J9=>{"use strict";Object.defineProperty(J9,"__esModule",{value:!0});J9.mergeAll=void 0;var BXt=_1(),RXt=Zu();function OXt(e){return e===void 0&&(e=1/0),BXt.mergeMap(RXt.identity,e)}J9.mergeAll=OXt});var tG=ve(eG=>{"use strict";Object.defineProperty(eG,"__esModule",{value:!0});eG.concatAll=void 0;var LXt=yO();function FXt(){return LXt.mergeAll(1)}eG.concatAll=FXt});var vO=ve(rG=>{"use strict";Object.defineProperty(rG,"__esModule",{value:!0});rG.concat=void 0;var NXt=tG(),UXt=Pm(),VXt=x1();function zXt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return NXt.concatAll()(VXt.from(e,UXt.popScheduler(e)))}rG.concat=zXt});var bO=ve(nG=>{"use strict";Object.defineProperty(nG,"__esModule",{value:!0});nG.defer=void 0;var qXt=Ba(),jXt=Po();function GXt(e){return new qXt.Observable(function(t){jXt.innerFrom(e()).subscribe(t)})}nG.defer=GXt});var Let=ve(oG=>{"use strict";Object.defineProperty(oG,"__esModule",{value:!0});oG.connectable=void 0;var HXt=$u(),WXt=Ba(),KXt=bO(),YXt={connector:function(){return new HXt.Subject},resetOnDisconnect:!0};function XXt(e,t){t===void 0&&(t=YXt);var r=null,n=t.connector,o=t.resetOnDisconnect,i=o===void 0?!0:o,a=n(),s=new WXt.Observable(function(l){return a.subscribe(l)});return s.connect=function(){return(!r||r.closed)&&(r=KXt.defer(function(){return e}).subscribe(a),i&&r.add(function(){return a=n()})),r},s}oG.connectable=XXt});var Fet=ve(iG=>{"use strict";Object.defineProperty(iG,"__esModule",{value:!0});iG.forkJoin=void 0;var ZXt=Ba(),$Xt=Pue(),QXt=Po(),JXt=Pm(),eZt=fn(),tZt=I_(),rZt=Iue();function nZt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=JXt.popResultSelector(e),n=$Xt.argsArgArrayOrObject(e),o=n.args,i=n.keys,a=new ZXt.Observable(function(s){var l=o.length;if(!l){s.complete();return}for(var c=new Array(l),u=l,d=l,f=function(p){var h=!1;QXt.innerFrom(o[p]).subscribe(eZt.createOperatorSubscriber(s,function(g){h||(h=!0,d--),c[p]=g},function(){return u--},void 0,function(){(!u||!h)&&(d||s.next(i?rZt.createObject(i,c):c),s.complete())}))},m=0;m<l;m++)f(m)});return r?a.pipe(tZt.mapOneOrManyArgs(r)):a}iG.forkJoin=nZt});var Uet=ve(bE=>{"use strict";var oZt=bE&&bE.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i};Object.defineProperty(bE,"__esModule",{value:!0});bE.fromEvent=void 0;var iZt=Po(),aZt=Ba(),sZt=_1(),lZt=f9(),Ow=Ca(),cZt=I_(),uZt=["addListener","removeListener"],dZt=["addEventListener","removeEventListener"],fZt=["on","off"];function Eue(e,t,r,n){if(Ow.isFunction(r)&&(n=r,r=void 0),n)return Eue(e,t,r).pipe(cZt.mapOneOrManyArgs(n));var o=oZt(hZt(e)?dZt.map(function(s){return function(l){return e[s](t,l,r)}}):mZt(e)?uZt.map(Net(e,t)):pZt(e)?fZt.map(Net(e,t)):[],2),i=o[0],a=o[1];if(!i&&lZt.isArrayLike(e))return sZt.mergeMap(function(s){return Eue(s,t,r)})(iZt.innerFrom(e));if(!i)throw new TypeError("Invalid event target");return new aZt.Observable(function(s){var l=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return s.next(1<c.length?c:c[0])};return i(l),function(){return a(l)}})}bE.fromEvent=Eue;function Net(e,t){return function(r){return function(n){return e[r](t,n)}}}function mZt(e){return Ow.isFunction(e.addListener)&&Ow.isFunction(e.removeListener)}function pZt(e){return Ow.isFunction(e.on)&&Ow.isFunction(e.off)}function hZt(e){return Ow.isFunction(e.addEventListener)&&Ow.isFunction(e.removeEventListener)}});var zet=ve(aG=>{"use strict";Object.defineProperty(aG,"__esModule",{value:!0});aG.fromEventPattern=void 0;var gZt=Ba(),yZt=Ca(),vZt=I_();function Vet(e,t,r){return r?Vet(e,t).pipe(vZt.mapOneOrManyArgs(r)):new gZt.Observable(function(n){var o=function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return n.next(a.length===1?a[0]:a)},i=e(o);return yZt.isFunction(t)?function(){return t(o,i)}:void 0})}aG.fromEventPattern=Vet});var jet=ve(xE=>{"use strict";var bZt=xE&&xE.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(xE,"__esModule",{value:!0});xE.generate=void 0;var qet=Zu(),xZt=pO(),SZt=bO(),_Zt=vue();function CZt(e,t,r,n,o){var i,a,s,l;arguments.length===1?(i=e,l=i.initialState,t=i.condition,r=i.iterate,a=i.resultSelector,s=a===void 0?qet.identity:a,o=i.scheduler):(l=e,!n||xZt.isScheduler(n)?(s=qet.identity,o=n):s=n);function c(){var u;return bZt(this,function(d){switch(d.label){case 0:u=l,d.label=1;case 1:return!t||t(u)?[4,s(u)]:[3,4];case 2:d.sent(),d.label=3;case 3:return u=r(u),[3,1];case 4:return[2]}})}return SZt.defer(o?function(){return _Zt.scheduleIterable(c(),o)}:c)}xE.generate=CZt});var Get=ve(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});sG.iif=void 0;var wZt=bO();function TZt(e,t,r){return wZt.defer(function(){return e()?t:r})}sG.iif=TZt});var D_=ve(lG=>{"use strict";Object.defineProperty(lG,"__esModule",{value:!0});lG.timer=void 0;var AZt=Ba(),PZt=Am(),IZt=pO(),EZt=q9();function DZt(e,t,r){e===void 0&&(e=0),r===void 0&&(r=PZt.async);var n=-1;return t!=null&&(IZt.isScheduler(t)?r=t:n=t),new AZt.Observable(function(o){var i=EZt.isValidDate(e)?+e-r.now():e;i<0&&(i=0);var a=0;return r.schedule(function(){o.closed||(o.next(a++),0<=n?this.schedule(void 0,n):o.complete())},i)})}lG.timer=DZt});var Due=ve(cG=>{"use strict";Object.defineProperty(cG,"__esModule",{value:!0});cG.interval=void 0;var kZt=Am(),MZt=D_();function BZt(e,t){return e===void 0&&(e=0),t===void 0&&(t=kZt.asyncScheduler),e<0&&(e=0),MZt.timer(e,e,t)}cG.interval=BZt});var Wet=ve(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});uG.merge=void 0;var RZt=yO(),OZt=Po(),LZt=b0(),Het=Pm(),FZt=x1();function NZt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Het.popScheduler(e),n=Het.popNumber(e,1/0),o=e;return o.length?o.length===1?OZt.innerFrom(o[0]):RZt.mergeAll(n)(FZt.from(o,r)):LZt.EMPTY}uG.merge=NZt});var kue=ve(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});Lw.never=Lw.NEVER=void 0;var UZt=Ba(),VZt=Xu();Lw.NEVER=new UZt.Observable(VZt.noop);function zZt(){return Lw.NEVER}Lw.never=zZt});var SE=ve(dG=>{"use strict";Object.defineProperty(dG,"__esModule",{value:!0});dG.argsOrArgArray=void 0;var qZt=Array.isArray;function jZt(e){return e.length===1&&qZt(e[0])?e[0]:e}dG.argsOrArgArray=jZt});var Mue=ve(fG=>{"use strict";Object.defineProperty(fG,"__esModule",{value:!0});fG.onErrorResumeNext=void 0;var GZt=Ba(),HZt=SE(),WZt=fn(),Ket=Xu(),KZt=Po();function YZt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=HZt.argsOrArgArray(e);return new GZt.Observable(function(n){var o=0,i=function(){if(o<r.length){var a=void 0;try{a=KZt.innerFrom(r[o++])}catch{i();return}var s=new WZt.OperatorSubscriber(n,void 0,Ket.noop,Ket.noop);a.subscribe(s),s.add(i)}else n.complete()};i()})}fG.onErrorResumeNext=YZt});var Yet=ve(mG=>{"use strict";Object.defineProperty(mG,"__esModule",{value:!0});mG.pairs=void 0;var XZt=x1();function ZZt(e,t){return XZt.from(Object.entries(e),t)}mG.pairs=ZZt});var Xet=ve(pG=>{"use strict";Object.defineProperty(pG,"__esModule",{value:!0});pG.not=void 0;function $Zt(e,t){return function(r,n){return!e.call(t,r,n)}}pG.not=$Zt});var Fw=ve(hG=>{"use strict";Object.defineProperty(hG,"__esModule",{value:!0});hG.filter=void 0;var QZt=Fr(),JZt=fn();function e$t(e,t){return QZt.operate(function(r,n){var o=0;r.subscribe(JZt.createOperatorSubscriber(n,function(i){return e.call(t,i,o++)&&n.next(i)}))})}hG.filter=e$t});var Qet=ve(gG=>{"use strict";Object.defineProperty(gG,"__esModule",{value:!0});gG.partition=void 0;var t$t=Xet(),Zet=Fw(),$et=Po();function r$t(e,t,r){return[Zet.filter(t,r)($et.innerFrom(e)),Zet.filter(t$t.not(t,r))($et.innerFrom(e))]}gG.partition=r$t});var Bue=ve(_E=>{"use strict";Object.defineProperty(_E,"__esModule",{value:!0});_E.raceInit=_E.race=void 0;var n$t=Ba(),Jet=Po(),o$t=SE(),i$t=fn();function a$t(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=o$t.argsOrArgArray(e),e.length===1?Jet.innerFrom(e[0]):new n$t.Observable(ett(e))}_E.race=a$t;function ett(e){return function(t){for(var r=[],n=function(i){r.push(Jet.innerFrom(e[i]).subscribe(i$t.createOperatorSubscriber(t,function(a){if(r){for(var s=0;s<r.length;s++)s!==i&&r[s].unsubscribe();r=null}t.next(a)})))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}_E.raceInit=ett});var ttt=ve(yG=>{"use strict";Object.defineProperty(yG,"__esModule",{value:!0});yG.range=void 0;var s$t=Ba(),l$t=b0();function c$t(e,t,r){if(t==null&&(t=e,e=0),t<=0)return l$t.EMPTY;var n=t+e;return new s$t.Observable(r?function(o){var i=e;return r.schedule(function(){i<n?(o.next(i++),this.schedule()):o.complete()})}:function(o){for(var i=e;i<n&&!o.closed;)o.next(i++);o.complete()})}yG.range=c$t});var rtt=ve(vG=>{"use strict";Object.defineProperty(vG,"__esModule",{value:!0});vG.using=void 0;var u$t=Ba(),d$t=Po(),f$t=b0();function m$t(e,t){return new u$t.Observable(function(r){var n=e(),o=t(n),i=o?d$t.innerFrom(o):f$t.EMPTY;return i.subscribe(r),function(){n&&n.unsubscribe()}})}vG.using=m$t});var bG=ve(k_=>{"use strict";var p$t=k_&&k_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},h$t=k_&&k_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(k_,"__esModule",{value:!0});k_.zip=void 0;var g$t=Ba(),y$t=Po(),v$t=SE(),b$t=b0(),x$t=fn(),S$t=Pm();function _$t(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=S$t.popResultSelector(e),n=v$t.argsOrArgArray(e);return n.length?new g$t.Observable(function(o){var i=n.map(function(){return[]}),a=n.map(function(){return!1});o.add(function(){i=a=null});for(var s=function(c){y$t.innerFrom(n[c]).subscribe(x$t.createOperatorSubscriber(o,function(u){if(i[c].push(u),i.every(function(f){return f.length})){var d=i.map(function(f){return f.shift()});o.next(r?r.apply(void 0,h$t([],p$t(d))):d),i.some(function(f,m){return!f.length&&a[m]})&&o.complete()}},function(){a[c]=!0,!i[c].length&&o.complete()}))},l=0;!o.closed&&l<n.length;l++)s(l);return function(){i=a=null}}):b$t.EMPTY}k_.zip=_$t});var ott=ve(ntt=>{"use strict";Object.defineProperty(ntt,"__esModule",{value:!0})});var Rue=ve(xG=>{"use strict";Object.defineProperty(xG,"__esModule",{value:!0});xG.audit=void 0;var C$t=Fr(),w$t=Po(),itt=fn();function T$t(e){return C$t.operate(function(t,r){var n=!1,o=null,i=null,a=!1,s=function(){if(i?.unsubscribe(),i=null,n){n=!1;var c=o;o=null,r.next(c)}a&&r.complete()},l=function(){i=null,a&&r.complete()};t.subscribe(itt.createOperatorSubscriber(r,function(c){n=!0,o=c,i||w$t.innerFrom(e(c)).subscribe(i=itt.createOperatorSubscriber(r,s,l))},function(){a=!0,(!n||!i||i.closed)&&r.complete()}))})}xG.audit=T$t});var att=ve(SG=>{"use strict";Object.defineProperty(SG,"__esModule",{value:!0});SG.auditTime=void 0;var A$t=Am(),P$t=Rue(),I$t=D_();function E$t(e,t){return t===void 0&&(t=A$t.asyncScheduler),P$t.audit(function(){return I$t.timer(e,t)})}SG.auditTime=E$t});var ltt=ve(_G=>{"use strict";Object.defineProperty(_G,"__esModule",{value:!0});_G.buffer=void 0;var D$t=Fr(),k$t=Xu(),stt=fn(),M$t=Po();function B$t(e){return D$t.operate(function(t,r){var n=[];return t.subscribe(stt.createOperatorSubscriber(r,function(o){return n.push(o)},function(){r.next(n),r.complete()})),M$t.innerFrom(e).subscribe(stt.createOperatorSubscriber(r,function(){var o=n;n=[],r.next(o)},k$t.noop)),function(){n=null}})}_G.buffer=B$t});var ctt=ve(CE=>{"use strict";var Oue=CE&&CE.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(CE,"__esModule",{value:!0});CE.bufferCount=void 0;var R$t=Fr(),O$t=fn(),L$t=v1();function F$t(e,t){return t===void 0&&(t=null),t=t??e,R$t.operate(function(r,n){var o=[],i=0;r.subscribe(O$t.createOperatorSubscriber(n,function(a){var s,l,c,u,d=null;i++%t===0&&o.push([]);try{for(var f=Oue(o),m=f.next();!m.done;m=f.next()){var p=m.value;p.push(a),e<=p.length&&(d=d??[],d.push(p))}}catch(y){s={error:y}}finally{try{m&&!m.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}if(d)try{for(var h=Oue(d),g=h.next();!g.done;g=h.next()){var p=g.value;L$t.arrRemove(o,p),n.next(p)}}catch(y){c={error:y}}finally{try{g&&!g.done&&(u=h.return)&&u.call(h)}finally{if(c)throw c.error}}},function(){var a,s;try{for(var l=Oue(o),c=l.next();!c.done;c=l.next()){var u=c.value;n.next(u)}}catch(d){a={error:d}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}n.complete()},void 0,function(){o=null}))})}CE.bufferCount=F$t});var dtt=ve(wE=>{"use strict";var N$t=wE&&wE.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(wE,"__esModule",{value:!0});wE.bufferTime=void 0;var U$t=Sp(),V$t=Fr(),z$t=fn(),q$t=v1(),j$t=Am(),G$t=Pm(),utt=b1();function H$t(e){for(var t,r,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=(t=G$t.popScheduler(n))!==null&&t!==void 0?t:j$t.asyncScheduler,a=(r=n[0])!==null&&r!==void 0?r:null,s=n[1]||1/0;return V$t.operate(function(l,c){var u=[],d=!1,f=function(h){var g=h.buffer,y=h.subs;y.unsubscribe(),q$t.arrRemove(u,h),c.next(g),d&&m()},m=function(){if(u){var h=new U$t.Subscription;c.add(h);var g=[],y={buffer:g,subs:h};u.push(y),utt.executeSchedule(h,i,function(){return f(y)},e)}};a!==null&&a>=0?utt.executeSchedule(c,i,m,a,!0):d=!0,m();var p=z$t.createOperatorSubscriber(c,function(h){var g,y,b=u.slice();try{for(var x=N$t(b),C=x.next();!C.done;C=x.next()){var S=C.value,w=S.buffer;w.push(h),s<=w.length&&f(S)}}catch(A){g={error:A}}finally{try{C&&!C.done&&(y=x.return)&&y.call(x)}finally{if(g)throw g.error}}},function(){for(;u?.length;)c.next(u.shift().buffer);p?.unsubscribe(),c.complete(),c.unsubscribe()},void 0,function(){return u=null});l.subscribe(p)})}wE.bufferTime=H$t});var ptt=ve(TE=>{"use strict";var W$t=TE&&TE.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(TE,"__esModule",{value:!0});TE.bufferToggle=void 0;var K$t=Sp(),Y$t=Fr(),ftt=Po(),Lue=fn(),mtt=Xu(),X$t=v1();function Z$t(e,t){return Y$t.operate(function(r,n){var o=[];ftt.innerFrom(e).subscribe(Lue.createOperatorSubscriber(n,function(i){var a=[];o.push(a);var s=new K$t.Subscription,l=function(){X$t.arrRemove(o,a),n.next(a),s.unsubscribe()};s.add(ftt.innerFrom(t(i)).subscribe(Lue.createOperatorSubscriber(n,l,mtt.noop)))},mtt.noop)),r.subscribe(Lue.createOperatorSubscriber(n,function(i){var a,s;try{for(var l=W$t(o),c=l.next();!c.done;c=l.next()){var u=c.value;u.push(i)}}catch(d){a={error:d}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}},function(){for(;o.length>0;)n.next(o.shift());n.complete()}))})}TE.bufferToggle=Z$t});var gtt=ve(CG=>{"use strict";Object.defineProperty(CG,"__esModule",{value:!0});CG.bufferWhen=void 0;var $$t=Fr(),Q$t=Xu(),htt=fn(),J$t=Po();function eQt(e){return $$t.operate(function(t,r){var n=null,o=null,i=function(){o?.unsubscribe();var a=n;n=[],a&&r.next(a),J$t.innerFrom(e()).subscribe(o=htt.createOperatorSubscriber(r,i,Q$t.noop))};i(),t.subscribe(htt.createOperatorSubscriber(r,function(a){return n?.push(a)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=o=null}))})}CG.bufferWhen=eQt});var vtt=ve(wG=>{"use strict";Object.defineProperty(wG,"__esModule",{value:!0});wG.catchError=void 0;var tQt=Po(),rQt=fn(),nQt=Fr();function ytt(e){return nQt.operate(function(t,r){var n=null,o=!1,i;n=t.subscribe(rQt.createOperatorSubscriber(r,void 0,void 0,function(a){i=tQt.innerFrom(e(a,ytt(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}wG.catchError=ytt});var Fue=ve(TG=>{"use strict";Object.defineProperty(TG,"__esModule",{value:!0});TG.scanInternals=void 0;var oQt=fn();function iQt(e,t,r,n,o){return function(i,a){var s=r,l=t,c=0;i.subscribe(oQt.createOperatorSubscriber(a,function(u){var d=c++;l=s?e(l,u,d):(s=!0,u),n&&a.next(l)},o&&(function(){s&&a.next(l),a.complete()})))}}TG.scanInternals=iQt});var AE=ve(AG=>{"use strict";Object.defineProperty(AG,"__esModule",{value:!0});AG.reduce=void 0;var aQt=Fue(),sQt=Fr();function lQt(e,t){return sQt.operate(aQt.scanInternals(e,t,arguments.length>=2,!1,!0))}AG.reduce=lQt});var Nue=ve(PG=>{"use strict";Object.defineProperty(PG,"__esModule",{value:!0});PG.toArray=void 0;var cQt=AE(),uQt=Fr(),dQt=function(e,t){return e.push(t),e};function fQt(){return uQt.operate(function(e,t){cQt.reduce(dQt,[])(e).subscribe(t)})}PG.toArray=fQt});var Uue=ve(IG=>{"use strict";Object.defineProperty(IG,"__esModule",{value:!0});IG.joinAllInternals=void 0;var mQt=Zu(),pQt=I_(),hQt=uO(),gQt=_1(),yQt=Nue();function vQt(e,t){return hQt.pipe(yQt.toArray(),gQt.mergeMap(function(r){return e(r)}),t?pQt.mapOneOrManyArgs(t):mQt.identity)}IG.joinAllInternals=vQt});var Vue=ve(EG=>{"use strict";Object.defineProperty(EG,"__esModule",{value:!0});EG.combineLatestAll=void 0;var bQt=X9(),xQt=Uue();function SQt(e){return xQt.joinAllInternals(bQt.combineLatest,e)}EG.combineLatestAll=SQt});var btt=ve(DG=>{"use strict";Object.defineProperty(DG,"__esModule",{value:!0});DG.combineAll=void 0;var _Qt=Vue();DG.combineAll=_Qt.combineLatestAll});var Ctt=ve(M_=>{"use strict";var xtt=M_&&M_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},Stt=M_&&M_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(M_,"__esModule",{value:!0});M_.combineLatest=void 0;var CQt=X9(),wQt=Fr(),TQt=SE(),AQt=I_(),PQt=uO(),IQt=Pm();function _tt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=IQt.popResultSelector(e);return r?PQt.pipe(_tt.apply(void 0,Stt([],xtt(e))),AQt.mapOneOrManyArgs(r)):wQt.operate(function(n,o){CQt.combineLatestInit(Stt([n],xtt(TQt.argsOrArgArray(e))))(o)})}M_.combineLatest=_tt});var wtt=ve(B_=>{"use strict";var EQt=B_&&B_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},DQt=B_&&B_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(B_,"__esModule",{value:!0});B_.combineLatestWith=void 0;var kQt=Ctt();function MQt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return kQt.combineLatest.apply(void 0,DQt([],EQt(e)))}B_.combineLatestWith=MQt});var zue=ve(kG=>{"use strict";Object.defineProperty(kG,"__esModule",{value:!0});kG.concatMap=void 0;var Ttt=_1(),BQt=Ca();function RQt(e,t){return BQt.isFunction(t)?Ttt.mergeMap(e,t,1):Ttt.mergeMap(e,1)}kG.concatMap=RQt});var Ptt=ve(MG=>{"use strict";Object.defineProperty(MG,"__esModule",{value:!0});MG.concatMapTo=void 0;var Att=zue(),OQt=Ca();function LQt(e,t){return OQt.isFunction(t)?Att.concatMap(function(){return e},t):Att.concatMap(function(){return e})}MG.concatMapTo=LQt});var Itt=ve(R_=>{"use strict";var FQt=R_&&R_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},NQt=R_&&R_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(R_,"__esModule",{value:!0});R_.concat=void 0;var UQt=Fr(),VQt=tG(),zQt=Pm(),qQt=x1();function jQt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=zQt.popScheduler(e);return UQt.operate(function(n,o){VQt.concatAll()(qQt.from(NQt([n],FQt(e)),r)).subscribe(o)})}R_.concat=jQt});var Ett=ve(O_=>{"use strict";var GQt=O_&&O_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},HQt=O_&&O_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(O_,"__esModule",{value:!0});O_.concatWith=void 0;var WQt=Itt();function KQt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return WQt.concat.apply(void 0,HQt([],GQt(e)))}O_.concatWith=KQt});var Dtt=ve(BG=>{"use strict";Object.defineProperty(BG,"__esModule",{value:!0});BG.fromSubscribable=void 0;var YQt=Ba();function XQt(e){return new YQt.Observable(function(t){return e.subscribe(t)})}BG.fromSubscribable=XQt});var OG=ve(RG=>{"use strict";Object.defineProperty(RG,"__esModule",{value:!0});RG.connect=void 0;var ZQt=$u(),$Qt=Po(),QQt=Fr(),JQt=Dtt(),eJt={connector:function(){return new ZQt.Subject}};function tJt(e,t){t===void 0&&(t=eJt);var r=t.connector;return QQt.operate(function(n,o){var i=r();$Qt.innerFrom(e(JQt.fromSubscribable(i))).subscribe(o),o.add(n.subscribe(i))})}RG.connect=tJt});var ktt=ve(LG=>{"use strict";Object.defineProperty(LG,"__esModule",{value:!0});LG.count=void 0;var rJt=AE();function nJt(e){return rJt.reduce(function(t,r,n){return!e||e(r,n)?t+1:t},0)}LG.count=nJt});var Btt=ve(FG=>{"use strict";Object.defineProperty(FG,"__esModule",{value:!0});FG.debounce=void 0;var oJt=Fr(),iJt=Xu(),Mtt=fn(),aJt=Po();function sJt(e){return oJt.operate(function(t,r){var n=!1,o=null,i=null,a=function(){if(i?.unsubscribe(),i=null,n){n=!1;var s=o;o=null,r.next(s)}};t.subscribe(Mtt.createOperatorSubscriber(r,function(s){i?.unsubscribe(),n=!0,o=s,i=Mtt.createOperatorSubscriber(r,a,iJt.noop),aJt.innerFrom(e(s)).subscribe(i)},function(){a(),r.complete()},void 0,function(){o=i=null}))})}FG.debounce=sJt});var Rtt=ve(NG=>{"use strict";Object.defineProperty(NG,"__esModule",{value:!0});NG.debounceTime=void 0;var lJt=Am(),cJt=Fr(),uJt=fn();function dJt(e,t){return t===void 0&&(t=lJt.asyncScheduler),cJt.operate(function(r,n){var o=null,i=null,a=null,s=function(){if(o){o.unsubscribe(),o=null;var c=i;i=null,n.next(c)}};function l(){var c=a+e,u=t.now();if(u<c){o=this.schedule(void 0,c-u),n.add(o);return}s()}r.subscribe(uJt.createOperatorSubscriber(n,function(c){i=c,a=t.now(),o||(o=t.schedule(l,e),n.add(o))},function(){s(),n.complete()},void 0,function(){i=o=null}))})}NG.debounceTime=dJt});var xO=ve(UG=>{"use strict";Object.defineProperty(UG,"__esModule",{value:!0});UG.defaultIfEmpty=void 0;var fJt=Fr(),mJt=fn();function pJt(e){return fJt.operate(function(t,r){var n=!1;t.subscribe(mJt.createOperatorSubscriber(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}UG.defaultIfEmpty=pJt});var SO=ve(VG=>{"use strict";Object.defineProperty(VG,"__esModule",{value:!0});VG.take=void 0;var hJt=b0(),gJt=Fr(),yJt=fn();function vJt(e){return e<=0?function(){return hJt.EMPTY}:gJt.operate(function(t,r){var n=0;t.subscribe(yJt.createOperatorSubscriber(r,function(o){++n<=e&&(r.next(o),e<=n&&r.complete())}))})}VG.take=vJt});var que=ve(zG=>{"use strict";Object.defineProperty(zG,"__esModule",{value:!0});zG.ignoreElements=void 0;var bJt=Fr(),xJt=fn(),SJt=Xu();function _Jt(){return bJt.operate(function(e,t){e.subscribe(xJt.createOperatorSubscriber(t,SJt.noop))})}zG.ignoreElements=_Jt});var jue=ve(qG=>{"use strict";Object.defineProperty(qG,"__esModule",{value:!0});qG.mapTo=void 0;var CJt=A_();function wJt(e){return CJt.map(function(){return e})}qG.mapTo=wJt});var Gue=ve(jG=>{"use strict";Object.defineProperty(jG,"__esModule",{value:!0});jG.delayWhen=void 0;var TJt=vO(),Ott=SO(),AJt=que(),PJt=jue(),IJt=_1(),EJt=Po();function Ltt(e,t){return t?function(r){return TJt.concat(t.pipe(Ott.take(1),AJt.ignoreElements()),r.pipe(Ltt(e)))}:IJt.mergeMap(function(r,n){return EJt.innerFrom(e(r,n)).pipe(Ott.take(1),PJt.mapTo(r))})}jG.delayWhen=Ltt});var Ftt=ve(GG=>{"use strict";Object.defineProperty(GG,"__esModule",{value:!0});GG.delay=void 0;var DJt=Am(),kJt=Gue(),MJt=D_();function BJt(e,t){t===void 0&&(t=DJt.asyncScheduler);var r=MJt.timer(e,t);return kJt.delayWhen(function(){return r})}GG.delay=BJt});var Ntt=ve(HG=>{"use strict";Object.defineProperty(HG,"__esModule",{value:!0});HG.dematerialize=void 0;var RJt=B9(),OJt=Fr(),LJt=fn();function FJt(){return OJt.operate(function(e,t){e.subscribe(LJt.createOperatorSubscriber(t,function(r){return RJt.observeNotification(r,t)}))})}HG.dematerialize=FJt});var Vtt=ve(WG=>{"use strict";Object.defineProperty(WG,"__esModule",{value:!0});WG.distinct=void 0;var NJt=Fr(),Utt=fn(),UJt=Xu(),VJt=Po();function zJt(e,t){return NJt.operate(function(r,n){var o=new Set;r.subscribe(Utt.createOperatorSubscriber(n,function(i){var a=e?e(i):i;o.has(a)||(o.add(a),n.next(i))})),t&&VJt.innerFrom(t).subscribe(Utt.createOperatorSubscriber(n,function(){return o.clear()},UJt.noop))})}WG.distinct=zJt});var Hue=ve(KG=>{"use strict";Object.defineProperty(KG,"__esModule",{value:!0});KG.distinctUntilChanged=void 0;var qJt=Zu(),jJt=Fr(),GJt=fn();function HJt(e,t){return t===void 0&&(t=qJt.identity),e=e??WJt,jJt.operate(function(r,n){var o,i=!0;r.subscribe(GJt.createOperatorSubscriber(n,function(a){var s=t(a);(i||!e(o,s))&&(i=!1,o=s,n.next(a))}))})}KG.distinctUntilChanged=HJt;function WJt(e,t){return e===t}});var ztt=ve(YG=>{"use strict";Object.defineProperty(YG,"__esModule",{value:!0});YG.distinctUntilKeyChanged=void 0;var KJt=Hue();function YJt(e,t){return KJt.distinctUntilChanged(function(r,n){return t?t(r[e],n[e]):r[e]===n[e]})}YG.distinctUntilKeyChanged=YJt});var _O=ve(XG=>{"use strict";Object.defineProperty(XG,"__esModule",{value:!0});XG.throwIfEmpty=void 0;var XJt=T_(),ZJt=Fr(),$Jt=fn();function QJt(e){return e===void 0&&(e=JJt),ZJt.operate(function(t,r){var n=!1;t.subscribe($Jt.createOperatorSubscriber(r,function(o){n=!0,r.next(o)},function(){return n?r.complete():r.error(e())}))})}XG.throwIfEmpty=QJt;function JJt(){return new XJt.EmptyError}});var jtt=ve(ZG=>{"use strict";Object.defineProperty(ZG,"__esModule",{value:!0});ZG.elementAt=void 0;var qtt=_ue(),eer=Fw(),ter=_O(),rer=xO(),ner=SO();function oer(e,t){if(e<0)throw new qtt.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(n){return n.pipe(eer.filter(function(o,i){return i===e}),ner.take(1),r?rer.defaultIfEmpty(t):ter.throwIfEmpty(function(){return new qtt.ArgumentOutOfRangeError}))}}ZG.elementAt=oer});var Gtt=ve(L_=>{"use strict";var ier=L_&&L_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},aer=L_&&L_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(L_,"__esModule",{value:!0});L_.endWith=void 0;var ser=vO(),ler=k9();function cer(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){return ser.concat(r,ler.of.apply(void 0,aer([],ier(e))))}}L_.endWith=cer});var Htt=ve($G=>{"use strict";Object.defineProperty($G,"__esModule",{value:!0});$G.every=void 0;var uer=Fr(),der=fn();function fer(e,t){return uer.operate(function(r,n){var o=0;r.subscribe(der.createOperatorSubscriber(n,function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())},function(){n.next(!0),n.complete()}))})}$G.every=fer});var Wue=ve(QG=>{"use strict";Object.defineProperty(QG,"__esModule",{value:!0});QG.exhaustMap=void 0;var mer=A_(),Wtt=Po(),per=Fr(),Ktt=fn();function Ytt(e,t){return t?function(r){return r.pipe(Ytt(function(n,o){return Wtt.innerFrom(e(n,o)).pipe(mer.map(function(i,a){return t(n,i,o,a)}))}))}:per.operate(function(r,n){var o=0,i=null,a=!1;r.subscribe(Ktt.createOperatorSubscriber(n,function(s){i||(i=Ktt.createOperatorSubscriber(n,void 0,function(){i=null,a&&n.complete()}),Wtt.innerFrom(e(s,o++)).subscribe(i))},function(){a=!0,!i&&n.complete()}))})}QG.exhaustMap=Ytt});var Kue=ve(JG=>{"use strict";Object.defineProperty(JG,"__esModule",{value:!0});JG.exhaustAll=void 0;var her=Wue(),ger=Zu();function yer(){return her.exhaustMap(ger.identity)}JG.exhaustAll=yer});var Xtt=ve(e7=>{"use strict";Object.defineProperty(e7,"__esModule",{value:!0});e7.exhaust=void 0;var ver=Kue();e7.exhaust=ver.exhaustAll});var Ztt=ve(t7=>{"use strict";Object.defineProperty(t7,"__esModule",{value:!0});t7.expand=void 0;var ber=Fr(),xer=$9();function Ser(e,t,r){return t===void 0&&(t=1/0),t=(t||0)<1?1/0:t,ber.operate(function(n,o){return xer.mergeInternals(n,o,e,t,void 0,!0,r)})}t7.expand=Ser});var $tt=ve(r7=>{"use strict";Object.defineProperty(r7,"__esModule",{value:!0});r7.finalize=void 0;var _er=Fr();function Cer(e){return _er.operate(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}r7.finalize=Cer});var Yue=ve(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});PE.createFind=PE.find=void 0;var wer=Fr(),Ter=fn();function Aer(e,t){return wer.operate(Qtt(e,t,"value"))}PE.find=Aer;function Qtt(e,t,r){var n=r==="index";return function(o,i){var a=0;o.subscribe(Ter.createOperatorSubscriber(i,function(s){var l=a++;e.call(t,s,l,o)&&(i.next(n?l:s),i.complete())},function(){i.next(n?-1:void 0),i.complete()}))}}PE.createFind=Qtt});var Jtt=ve(n7=>{"use strict";Object.defineProperty(n7,"__esModule",{value:!0});n7.findIndex=void 0;var Per=Fr(),Ier=Yue();function Eer(e,t){return Per.operate(Ier.createFind(e,t,"index"))}n7.findIndex=Eer});var ert=ve(o7=>{"use strict";Object.defineProperty(o7,"__esModule",{value:!0});o7.first=void 0;var Der=T_(),ker=Fw(),Mer=SO(),Ber=xO(),Rer=_O(),Oer=Zu();function Ler(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?ker.filter(function(o,i){return e(o,i,n)}):Oer.identity,Mer.take(1),r?Ber.defaultIfEmpty(t):Rer.throwIfEmpty(function(){return new Der.EmptyError}))}}o7.first=Ler});var rrt=ve(i7=>{"use strict";Object.defineProperty(i7,"__esModule",{value:!0});i7.groupBy=void 0;var Fer=Ba(),Ner=Po(),Uer=$u(),Ver=Fr(),trt=fn();function zer(e,t,r,n){return Ver.operate(function(o,i){var a;!t||typeof t=="function"?a=t:(r=t.duration,a=t.element,n=t.connector);var s=new Map,l=function(p){s.forEach(p),p(i)},c=function(p){return l(function(h){return h.error(p)})},u=0,d=!1,f=new trt.OperatorSubscriber(i,function(p){try{var h=e(p),g=s.get(h);if(!g){s.set(h,g=n?n():new Uer.Subject);var y=m(h,g);if(i.next(y),r){var b=trt.createOperatorSubscriber(g,function(){g.complete(),b?.unsubscribe()},void 0,void 0,function(){return s.delete(h)});f.add(Ner.innerFrom(r(y)).subscribe(b))}}g.next(a?a(p):p)}catch(x){c(x)}},function(){return l(function(p){return p.complete()})},c,function(){return s.clear()},function(){return d=!0,u===0});o.subscribe(f);function m(p,h){var g=new Fer.Observable(function(y){u++;var b=h.subscribe(y);return function(){b.unsubscribe(),--u===0&&d&&f.unsubscribe()}});return g.key=p,g}})}i7.groupBy=zer});var nrt=ve(a7=>{"use strict";Object.defineProperty(a7,"__esModule",{value:!0});a7.isEmpty=void 0;var qer=Fr(),jer=fn();function Ger(){return qer.operate(function(e,t){e.subscribe(jer.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}a7.isEmpty=Ger});var Xue=ve(IE=>{"use strict";var Her=IE&&IE.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(IE,"__esModule",{value:!0});IE.takeLast=void 0;var Wer=b0(),Ker=Fr(),Yer=fn();function Xer(e){return e<=0?function(){return Wer.EMPTY}:Ker.operate(function(t,r){var n=[];t.subscribe(Yer.createOperatorSubscriber(r,function(o){n.push(o),e<n.length&&n.shift()},function(){var o,i;try{for(var a=Her(n),s=a.next();!s.done;s=a.next()){var l=s.value;r.next(l)}}catch(c){o={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}r.complete()},void 0,function(){n=null}))})}IE.takeLast=Xer});var ort=ve(s7=>{"use strict";Object.defineProperty(s7,"__esModule",{value:!0});s7.last=void 0;var Zer=T_(),$er=Fw(),Qer=Xue(),Jer=_O(),etr=xO(),ttr=Zu();function rtr(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?$er.filter(function(o,i){return e(o,i,n)}):ttr.identity,Qer.takeLast(1),r?etr.defaultIfEmpty(t):Jer.throwIfEmpty(function(){return new Zer.EmptyError}))}}s7.last=rtr});var irt=ve(l7=>{"use strict";Object.defineProperty(l7,"__esModule",{value:!0});l7.materialize=void 0;var Zue=B9(),ntr=Fr(),otr=fn();function itr(){return ntr.operate(function(e,t){e.subscribe(otr.createOperatorSubscriber(t,function(r){t.next(Zue.Notification.createNext(r))},function(){t.next(Zue.Notification.createComplete()),t.complete()},function(r){t.next(Zue.Notification.createError(r)),t.complete()}))})}l7.materialize=itr});var art=ve(c7=>{"use strict";Object.defineProperty(c7,"__esModule",{value:!0});c7.max=void 0;var atr=AE(),str=Ca();function ltr(e){return atr.reduce(str.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(t,r){return t>r?t:r})}c7.max=ltr});var srt=ve(u7=>{"use strict";Object.defineProperty(u7,"__esModule",{value:!0});u7.flatMap=void 0;var ctr=_1();u7.flatMap=ctr.mergeMap});var crt=ve(d7=>{"use strict";Object.defineProperty(d7,"__esModule",{value:!0});d7.mergeMapTo=void 0;var lrt=_1(),utr=Ca();function dtr(e,t,r){return r===void 0&&(r=1/0),utr.isFunction(t)?lrt.mergeMap(function(){return e},t,r):(typeof t=="number"&&(r=t),lrt.mergeMap(function(){return e},r))}d7.mergeMapTo=dtr});var urt=ve(f7=>{"use strict";Object.defineProperty(f7,"__esModule",{value:!0});f7.mergeScan=void 0;var ftr=Fr(),mtr=$9();function ptr(e,t,r){return r===void 0&&(r=1/0),ftr.operate(function(n,o){var i=t;return mtr.mergeInternals(n,o,function(a,s){return e(i,a,s)},r,function(a){i=a},!1,void 0,function(){return i=null})})}f7.mergeScan=ptr});var frt=ve(F_=>{"use strict";var htr=F_&&F_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},gtr=F_&&F_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(F_,"__esModule",{value:!0});F_.merge=void 0;var ytr=Fr(),vtr=yO(),drt=Pm(),btr=x1();function xtr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=drt.popScheduler(e),n=drt.popNumber(e,1/0);return ytr.operate(function(o,i){vtr.mergeAll(n)(btr.from(gtr([o],htr(e)),r)).subscribe(i)})}F_.merge=xtr});var mrt=ve(N_=>{"use strict";var Str=N_&&N_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},_tr=N_&&N_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(N_,"__esModule",{value:!0});N_.mergeWith=void 0;var Ctr=frt();function wtr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ctr.merge.apply(void 0,_tr([],Str(e)))}N_.mergeWith=wtr});var prt=ve(m7=>{"use strict";Object.defineProperty(m7,"__esModule",{value:!0});m7.min=void 0;var Ttr=AE(),Atr=Ca();function Ptr(e){return Ttr.reduce(Atr.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(t,r){return t<r?t:r})}m7.min=Ptr});var h7=ve(p7=>{"use strict";Object.defineProperty(p7,"__esModule",{value:!0});p7.multicast=void 0;var Itr=dO(),hrt=Ca(),Etr=OG();function Dtr(e,t){var r=hrt.isFunction(e)?e:function(){return e};return hrt.isFunction(t)?Etr.connect(t,{connector:r}):function(n){return new Itr.ConnectableObservable(n,r)}}p7.multicast=Dtr});var yrt=ve(Rv=>{"use strict";var ktr=Rv&&Rv.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},Mtr=Rv&&Rv.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(Rv,"__esModule",{value:!0});Rv.onErrorResumeNext=Rv.onErrorResumeNextWith=void 0;var Btr=SE(),Rtr=Mue();function grt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Btr.argsOrArgArray(e);return function(n){return Rtr.onErrorResumeNext.apply(void 0,Mtr([n],ktr(r)))}}Rv.onErrorResumeNextWith=grt;Rv.onErrorResumeNext=grt});var vrt=ve(g7=>{"use strict";Object.defineProperty(g7,"__esModule",{value:!0});g7.pairwise=void 0;var Otr=Fr(),Ltr=fn();function Ftr(){return Otr.operate(function(e,t){var r,n=!1;e.subscribe(Ltr.createOperatorSubscriber(t,function(o){var i=r;r=o,n&&t.next([i,o]),n=!0}))})}g7.pairwise=Ftr});var brt=ve(y7=>{"use strict";Object.defineProperty(y7,"__esModule",{value:!0});y7.pluck=void 0;var Ntr=A_();function Utr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(r===0)throw new Error("list of properties cannot be empty.");return Ntr.map(function(n){for(var o=n,i=0;i<r;i++){var a=o?.[e[i]];if(typeof a<"u")o=a;else return}return o})}y7.pluck=Utr});var xrt=ve(v7=>{"use strict";Object.defineProperty(v7,"__esModule",{value:!0});v7.publish=void 0;var Vtr=$u(),ztr=h7(),qtr=OG();function jtr(e){return e?function(t){return qtr.connect(e)(t)}:function(t){return ztr.multicast(new Vtr.Subject)(t)}}v7.publish=jtr});var Srt=ve(b7=>{"use strict";Object.defineProperty(b7,"__esModule",{value:!0});b7.publishBehavior=void 0;var Gtr=iue(),Htr=dO();function Wtr(e){return function(t){var r=new Gtr.BehaviorSubject(e);return new Htr.ConnectableObservable(t,function(){return r})}}b7.publishBehavior=Wtr});var _rt=ve(x7=>{"use strict";Object.defineProperty(x7,"__esModule",{value:!0});x7.publishLast=void 0;var Ktr=s9(),Ytr=dO();function Xtr(){return function(e){var t=new Ktr.AsyncSubject;return new Ytr.ConnectableObservable(e,function(){return t})}}x7.publishLast=Xtr});var wrt=ve(S7=>{"use strict";Object.defineProperty(S7,"__esModule",{value:!0});S7.publishReplay=void 0;var Ztr=a9(),$tr=h7(),Crt=Ca();function Qtr(e,t,r,n){r&&!Crt.isFunction(r)&&(n=r);var o=Crt.isFunction(r)?r:void 0;return function(i){return $tr.multicast(new Ztr.ReplaySubject(e,t,n),o)(i)}}S7.publishReplay=Qtr});var Trt=ve(U_=>{"use strict";var Jtr=U_&&U_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},err=U_&&U_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(U_,"__esModule",{value:!0});U_.raceWith=void 0;var trr=Bue(),rrr=Fr(),nrr=Zu();function orr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?rrr.operate(function(r,n){trr.raceInit(err([r],Jtr(e)))(n)}):nrr.identity}U_.raceWith=orr});var Prt=ve(_7=>{"use strict";Object.defineProperty(_7,"__esModule",{value:!0});_7.repeat=void 0;var irr=b0(),arr=Fr(),Art=fn(),srr=Po(),lrr=D_();function crr(e){var t,r=1/0,n;return e!=null&&(typeof e=="object"?(t=e.count,r=t===void 0?1/0:t,n=e.delay):r=e),r<=0?function(){return irr.EMPTY}:arr.operate(function(o,i){var a=0,s,l=function(){if(s?.unsubscribe(),s=null,n!=null){var u=typeof n=="number"?lrr.timer(n):srr.innerFrom(n(a)),d=Art.createOperatorSubscriber(i,function(){d.unsubscribe(),c()});u.subscribe(d)}else c()},c=function(){var u=!1;s=o.subscribe(Art.createOperatorSubscriber(i,void 0,function(){++a<r?s?l():u=!0:i.complete()})),u&&l()};c()})}_7.repeat=crr});var Ert=ve(C7=>{"use strict";Object.defineProperty(C7,"__esModule",{value:!0});C7.repeatWhen=void 0;var urr=Po(),drr=$u(),frr=Fr(),Irt=fn();function mrr(e){return frr.operate(function(t,r){var n,o=!1,i,a=!1,s=!1,l=function(){return s&&a&&(r.complete(),!0)},c=function(){return i||(i=new drr.Subject,urr.innerFrom(e(i)).subscribe(Irt.createOperatorSubscriber(r,function(){n?u():o=!0},function(){a=!0,l()}))),i},u=function(){s=!1,n=t.subscribe(Irt.createOperatorSubscriber(r,void 0,function(){s=!0,!l()&&c().next()})),o&&(n.unsubscribe(),n=null,o=!1,u())};u()})}C7.repeatWhen=mrr});var krt=ve(w7=>{"use strict";Object.defineProperty(w7,"__esModule",{value:!0});w7.retry=void 0;var prr=Fr(),Drt=fn(),hrr=Zu(),grr=D_(),yrr=Po();function vrr(e){e===void 0&&(e=1/0);var t;e&&typeof e=="object"?t=e:t={count:e};var r=t.count,n=r===void 0?1/0:r,o=t.delay,i=t.resetOnSuccess,a=i===void 0?!1:i;return n<=0?hrr.identity:prr.operate(function(s,l){var c=0,u,d=function(){var f=!1;u=s.subscribe(Drt.createOperatorSubscriber(l,function(m){a&&(c=0),l.next(m)},void 0,function(m){if(c++<n){var p=function(){u?(u.unsubscribe(),u=null,d()):f=!0};if(o!=null){var h=typeof o=="number"?grr.timer(o):yrr.innerFrom(o(m,c)),g=Drt.createOperatorSubscriber(l,function(){g.unsubscribe(),p()},function(){l.complete()});h.subscribe(g)}else p()}else l.error(m)})),f&&(u.unsubscribe(),u=null,d())};d()})}w7.retry=vrr});var Brt=ve(T7=>{"use strict";Object.defineProperty(T7,"__esModule",{value:!0});T7.retryWhen=void 0;var brr=Po(),xrr=$u(),Srr=Fr(),Mrt=fn();function _rr(e){return Srr.operate(function(t,r){var n,o=!1,i,a=function(){n=t.subscribe(Mrt.createOperatorSubscriber(r,void 0,void 0,function(s){i||(i=new xrr.Subject,brr.innerFrom(e(i)).subscribe(Mrt.createOperatorSubscriber(r,function(){return n?a():o=!0}))),i&&i.next(s)})),o&&(n.unsubscribe(),n=null,o=!1,a())};a()})}T7.retryWhen=_rr});var $ue=ve(A7=>{"use strict";Object.defineProperty(A7,"__esModule",{value:!0});A7.sample=void 0;var Crr=Po(),wrr=Fr(),Trr=Xu(),Rrt=fn();function Arr(e){return wrr.operate(function(t,r){var n=!1,o=null;t.subscribe(Rrt.createOperatorSubscriber(r,function(i){n=!0,o=i})),Crr.innerFrom(e).subscribe(Rrt.createOperatorSubscriber(r,function(){if(n){n=!1;var i=o;o=null,r.next(i)}},Trr.noop))})}A7.sample=Arr});var Ort=ve(P7=>{"use strict";Object.defineProperty(P7,"__esModule",{value:!0});P7.sampleTime=void 0;var Prr=Am(),Irr=$ue(),Err=Due();function Drr(e,t){return t===void 0&&(t=Prr.asyncScheduler),Irr.sample(Err.interval(e,t))}P7.sampleTime=Drr});var Lrt=ve(I7=>{"use strict";Object.defineProperty(I7,"__esModule",{value:!0});I7.scan=void 0;var krr=Fr(),Mrr=Fue();function Brr(e,t){return krr.operate(Mrr.scanInternals(e,t,arguments.length>=2,!0))}I7.scan=Brr});var Nrt=ve(E7=>{"use strict";Object.defineProperty(E7,"__esModule",{value:!0});E7.sequenceEqual=void 0;var Rrr=Fr(),Orr=fn(),Lrr=Po();function Frr(e,t){return t===void 0&&(t=function(r,n){return r===n}),Rrr.operate(function(r,n){var o=Frt(),i=Frt(),a=function(l){n.next(l),n.complete()},s=function(l,c){var u=Orr.createOperatorSubscriber(n,function(d){var f=c.buffer,m=c.complete;f.length===0?m?a(!1):l.buffer.push(d):!t(d,f.shift())&&a(!1)},function(){l.complete=!0;var d=c.complete,f=c.buffer;d&&a(f.length===0),u?.unsubscribe()});return u};r.subscribe(s(o,i)),Lrr.innerFrom(e).subscribe(s(i,o))})}E7.sequenceEqual=Frr;function Frt(){return{buffer:[],complete:!1}}});var Jue=ve(V_=>{"use strict";var Nrr=V_&&V_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},Urr=V_&&V_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(V_,"__esModule",{value:!0});V_.share=void 0;var Urt=Po(),Vrr=$u(),Vrt=Z3(),zrr=Fr();function qrr(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Vrr.Subject}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,l=s===void 0?!0:s;return function(c){var u,d,f,m=0,p=!1,h=!1,g=function(){d?.unsubscribe(),d=void 0},y=function(){g(),u=f=void 0,p=h=!1},b=function(){var x=u;y(),x?.unsubscribe()};return zrr.operate(function(x,C){m++,!h&&!p&&g();var S=f=f??r();C.add(function(){m--,m===0&&!h&&!p&&(d=Que(b,l))}),S.subscribe(C),!u&&m>0&&(u=new Vrt.SafeSubscriber({next:function(w){return S.next(w)},error:function(w){h=!0,g(),d=Que(y,o,w),S.error(w)},complete:function(){p=!0,g(),d=Que(y,a),S.complete()}}),Urt.innerFrom(x).subscribe(u))})(c)}}V_.share=qrr;function Que(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t===!0){e();return}if(t!==!1){var o=new Vrt.SafeSubscriber({next:function(){o.unsubscribe(),e()}});return Urt.innerFrom(t.apply(void 0,Urr([],Nrr(r)))).subscribe(o)}}});var zrt=ve(D7=>{"use strict";Object.defineProperty(D7,"__esModule",{value:!0});D7.shareReplay=void 0;var jrr=a9(),Grr=Jue();function Hrr(e,t,r){var n,o,i,a,s=!1;return e&&typeof e=="object"?(n=e.bufferSize,a=n===void 0?1/0:n,o=e.windowTime,t=o===void 0?1/0:o,i=e.refCount,s=i===void 0?!1:i,r=e.scheduler):a=e??1/0,Grr.share({connector:function(){return new jrr.ReplaySubject(a,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}D7.shareReplay=Hrr});var qrt=ve(k7=>{"use strict";Object.defineProperty(k7,"__esModule",{value:!0});k7.single=void 0;var Wrr=T_(),Krr=wue(),Yrr=Cue(),Xrr=Fr(),Zrr=fn();function $rr(e){return Xrr.operate(function(t,r){var n=!1,o,i=!1,a=0;t.subscribe(Zrr.createOperatorSubscriber(r,function(s){i=!0,(!e||e(s,a++,t))&&(n&&r.error(new Krr.SequenceError("Too many matching values")),n=!0,o=s)},function(){n?(r.next(o),r.complete()):r.error(i?new Yrr.NotFoundError("No matching values"):new Wrr.EmptyError)}))})}k7.single=$rr});var jrt=ve(M7=>{"use strict";Object.defineProperty(M7,"__esModule",{value:!0});M7.skip=void 0;var Qrr=Fw();function Jrr(e){return Qrr.filter(function(t,r){return e<=r})}M7.skip=Jrr});var Grt=ve(B7=>{"use strict";Object.defineProperty(B7,"__esModule",{value:!0});B7.skipLast=void 0;var enr=Zu(),tnr=Fr(),rnr=fn();function nnr(e){return e<=0?enr.identity:tnr.operate(function(t,r){var n=new Array(e),o=0;return t.subscribe(rnr.createOperatorSubscriber(r,function(i){var a=o++;if(a<e)n[a]=i;else{var s=a%e,l=n[s];n[s]=i,r.next(l)}})),function(){n=null}})}B7.skipLast=nnr});var Wrt=ve(R7=>{"use strict";Object.defineProperty(R7,"__esModule",{value:!0});R7.skipUntil=void 0;var onr=Fr(),Hrt=fn(),inr=Po(),anr=Xu();function snr(e){return onr.operate(function(t,r){var n=!1,o=Hrt.createOperatorSubscriber(r,function(){o?.unsubscribe(),n=!0},anr.noop);inr.innerFrom(e).subscribe(o),t.subscribe(Hrt.createOperatorSubscriber(r,function(i){return n&&r.next(i)}))})}R7.skipUntil=snr});var Krt=ve(O7=>{"use strict";Object.defineProperty(O7,"__esModule",{value:!0});O7.skipWhile=void 0;var lnr=Fr(),cnr=fn();function unr(e){return lnr.operate(function(t,r){var n=!1,o=0;t.subscribe(cnr.createOperatorSubscriber(r,function(i){return(n||(n=!e(i,o++)))&&r.next(i)}))})}O7.skipWhile=unr});var Xrt=ve(L7=>{"use strict";Object.defineProperty(L7,"__esModule",{value:!0});L7.startWith=void 0;var Yrt=vO(),dnr=Pm(),fnr=Fr();function mnr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=dnr.popScheduler(e);return fnr.operate(function(n,o){(r?Yrt.concat(e,n,r):Yrt.concat(e,n)).subscribe(o)})}L7.startWith=mnr});var CO=ve(F7=>{"use strict";Object.defineProperty(F7,"__esModule",{value:!0});F7.switchMap=void 0;var pnr=Po(),hnr=Fr(),Zrt=fn();function gnr(e,t){return hnr.operate(function(r,n){var o=null,i=0,a=!1,s=function(){return a&&!o&&n.complete()};r.subscribe(Zrt.createOperatorSubscriber(n,function(l){o?.unsubscribe();var c=0,u=i++;pnr.innerFrom(e(l,u)).subscribe(o=Zrt.createOperatorSubscriber(n,function(d){return n.next(t?t(l,d,u,c++):d)},function(){o=null,s()}))},function(){a=!0,s()}))})}F7.switchMap=gnr});var $rt=ve(N7=>{"use strict";Object.defineProperty(N7,"__esModule",{value:!0});N7.switchAll=void 0;var ynr=CO(),vnr=Zu();function bnr(){return ynr.switchMap(vnr.identity)}N7.switchAll=bnr});var Jrt=ve(U7=>{"use strict";Object.defineProperty(U7,"__esModule",{value:!0});U7.switchMapTo=void 0;var Qrt=CO(),xnr=Ca();function Snr(e,t){return xnr.isFunction(t)?Qrt.switchMap(function(){return e},t):Qrt.switchMap(function(){return e})}U7.switchMapTo=Snr});var ent=ve(V7=>{"use strict";Object.defineProperty(V7,"__esModule",{value:!0});V7.switchScan=void 0;var _nr=CO(),Cnr=Fr();function wnr(e,t){return Cnr.operate(function(r,n){var o=t;return _nr.switchMap(function(i,a){return e(o,i,a)},function(i,a){return o=a,a})(r).subscribe(n),function(){o=null}})}V7.switchScan=wnr});var tnt=ve(z7=>{"use strict";Object.defineProperty(z7,"__esModule",{value:!0});z7.takeUntil=void 0;var Tnr=Fr(),Anr=fn(),Pnr=Po(),Inr=Xu();function Enr(e){return Tnr.operate(function(t,r){Pnr.innerFrom(e).subscribe(Anr.createOperatorSubscriber(r,function(){return r.complete()},Inr.noop)),!r.closed&&t.subscribe(r)})}z7.takeUntil=Enr});var rnt=ve(q7=>{"use strict";Object.defineProperty(q7,"__esModule",{value:!0});q7.takeWhile=void 0;var Dnr=Fr(),knr=fn();function Mnr(e,t){return t===void 0&&(t=!1),Dnr.operate(function(r,n){var o=0;r.subscribe(knr.createOperatorSubscriber(n,function(i){var a=e(i,o++);(a||t)&&n.next(i),!a&&n.complete()}))})}q7.takeWhile=Mnr});var nnt=ve(j7=>{"use strict";Object.defineProperty(j7,"__esModule",{value:!0});j7.tap=void 0;var Bnr=Ca(),Rnr=Fr(),Onr=fn(),Lnr=Zu();function Fnr(e,t,r){var n=Bnr.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return n?Rnr.operate(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;o.subscribe(Onr.createOperatorSubscriber(i,function(l){var c;(c=n.next)===null||c===void 0||c.call(n,l),i.next(l)},function(){var l;s=!1,(l=n.complete)===null||l===void 0||l.call(n),i.complete()},function(l){var c;s=!1,(c=n.error)===null||c===void 0||c.call(n,l),i.error(l)},function(){var l,c;s&&((l=n.unsubscribe)===null||l===void 0||l.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Lnr.identity}j7.tap=Fnr});var ede=ve(G7=>{"use strict";Object.defineProperty(G7,"__esModule",{value:!0});G7.throttle=void 0;var Nnr=Fr(),ont=fn(),Unr=Po();function Vnr(e,t){return Nnr.operate(function(r,n){var o=t??{},i=o.leading,a=i===void 0?!0:i,s=o.trailing,l=s===void 0?!1:s,c=!1,u=null,d=null,f=!1,m=function(){d?.unsubscribe(),d=null,l&&(g(),f&&n.complete())},p=function(){d=null,f&&n.complete()},h=function(y){return d=Unr.innerFrom(e(y)).subscribe(ont.createOperatorSubscriber(n,m,p))},g=function(){if(c){c=!1;var y=u;u=null,n.next(y),!f&&h(y)}};r.subscribe(ont.createOperatorSubscriber(n,function(y){c=!0,u=y,!(d&&!d.closed)&&(a?g():h(y))},function(){f=!0,!(l&&c&&d&&!d.closed)&&n.complete()}))})}G7.throttle=Vnr});var int=ve(H7=>{"use strict";Object.defineProperty(H7,"__esModule",{value:!0});H7.throttleTime=void 0;var znr=Am(),qnr=ede(),jnr=D_();function Gnr(e,t,r){t===void 0&&(t=znr.asyncScheduler);var n=jnr.timer(e,t);return qnr.throttle(function(){return n},r)}H7.throttleTime=Gnr});var snt=ve(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});EE.TimeInterval=EE.timeInterval=void 0;var Hnr=Am(),Wnr=Fr(),Knr=fn();function Ynr(e){return e===void 0&&(e=Hnr.asyncScheduler),Wnr.operate(function(t,r){var n=e.now();t.subscribe(Knr.createOperatorSubscriber(r,function(o){var i=e.now(),a=i-n;n=i,r.next(new ant(o,a))}))})}EE.timeInterval=Ynr;var ant=(function(){function e(t,r){this.value=t,this.interval=r}return e})();EE.TimeInterval=ant});var lnt=ve(W7=>{"use strict";Object.defineProperty(W7,"__esModule",{value:!0});W7.timeoutWith=void 0;var Xnr=Am(),Znr=q9(),$nr=j9();function Qnr(e,t,r){var n,o,i;if(r=r??Xnr.async,Znr.isValidDate(e)?n=e:typeof e=="number"&&(o=e),t)i=function(){return t};else throw new TypeError("No observable provided to switch to");if(n==null&&o==null)throw new TypeError("No timeout provided.");return $nr.timeout({first:n,each:o,scheduler:r,with:i})}W7.timeoutWith=Qnr});var cnt=ve(K7=>{"use strict";Object.defineProperty(K7,"__esModule",{value:!0});K7.timestamp=void 0;var Jnr=i9(),eor=A_();function tor(e){return e===void 0&&(e=Jnr.dateTimestampProvider),eor.map(function(t){return{value:t,timestamp:e.now()}})}K7.timestamp=tor});var fnt=ve(Y7=>{"use strict";Object.defineProperty(Y7,"__esModule",{value:!0});Y7.window=void 0;var unt=$u(),ror=Fr(),dnt=fn(),nor=Xu(),oor=Po();function ior(e){return ror.operate(function(t,r){var n=new unt.Subject;r.next(n.asObservable());var o=function(i){n.error(i),r.error(i)};return t.subscribe(dnt.createOperatorSubscriber(r,function(i){return n?.next(i)},function(){n.complete(),r.complete()},o)),oor.innerFrom(e).subscribe(dnt.createOperatorSubscriber(r,function(){n.complete(),r.next(n=new unt.Subject)},nor.noop,o)),function(){n?.unsubscribe(),n=null}})}Y7.window=ior});var pnt=ve(DE=>{"use strict";var aor=DE&&DE.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(DE,"__esModule",{value:!0});DE.windowCount=void 0;var mnt=$u(),sor=Fr(),lor=fn();function cor(e,t){t===void 0&&(t=0);var r=t>0?t:e;return sor.operate(function(n,o){var i=[new mnt.Subject],a=[],s=0;o.next(i[0].asObservable()),n.subscribe(lor.createOperatorSubscriber(o,function(l){var c,u;try{for(var d=aor(i),f=d.next();!f.done;f=d.next()){var m=f.value;m.next(l)}}catch(g){c={error:g}}finally{try{f&&!f.done&&(u=d.return)&&u.call(d)}finally{if(c)throw c.error}}var p=s-e+1;if(p>=0&&p%r===0&&i.shift().complete(),++s%r===0){var h=new mnt.Subject;i.push(h),o.next(h.asObservable())}},function(){for(;i.length>0;)i.shift().complete();o.complete()},function(l){for(;i.length>0;)i.shift().error(l);o.error(l)},function(){a=null,i=null}))})}DE.windowCount=cor});var gnt=ve(X7=>{"use strict";Object.defineProperty(X7,"__esModule",{value:!0});X7.windowTime=void 0;var uor=$u(),dor=Am(),mor=Sp(),por=Fr(),hor=fn(),gor=v1(),yor=Pm(),hnt=b1();function vor(e){for(var t,r,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=(t=yor.popScheduler(n))!==null&&t!==void 0?t:dor.asyncScheduler,a=(r=n[0])!==null&&r!==void 0?r:null,s=n[1]||1/0;return por.operate(function(l,c){var u=[],d=!1,f=function(g){var y=g.window,b=g.subs;y.complete(),b.unsubscribe(),gor.arrRemove(u,g),d&&m()},m=function(){if(u){var g=new mor.Subscription;c.add(g);var y=new uor.Subject,b={window:y,subs:g,seen:0};u.push(b),c.next(y.asObservable()),hnt.executeSchedule(g,i,function(){return f(b)},e)}};a!==null&&a>=0?hnt.executeSchedule(c,i,m,a,!0):d=!0,m();var p=function(g){return u.slice().forEach(g)},h=function(g){p(function(y){var b=y.window;return g(b)}),g(c),c.unsubscribe()};return l.subscribe(hor.createOperatorSubscriber(c,function(g){p(function(y){y.window.next(g),s<=++y.seen&&f(y)})},function(){return h(function(g){return g.complete()})},function(g){return h(function(y){return y.error(g)})})),function(){u=null}})}X7.windowTime=vor});var bnt=ve(kE=>{"use strict";var bor=kE&&kE.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(kE,"__esModule",{value:!0});kE.windowToggle=void 0;var xor=$u(),Sor=Sp(),_or=Fr(),ynt=Po(),tde=fn(),vnt=Xu(),Cor=v1();function wor(e,t){return _or.operate(function(r,n){var o=[],i=function(a){for(;0<o.length;)o.shift().error(a);n.error(a)};ynt.innerFrom(e).subscribe(tde.createOperatorSubscriber(n,function(a){var s=new xor.Subject;o.push(s);var l=new Sor.Subscription,c=function(){Cor.arrRemove(o,s),s.complete(),l.unsubscribe()},u;try{u=ynt.innerFrom(t(a))}catch(d){i(d);return}n.next(s.asObservable()),l.add(u.subscribe(tde.createOperatorSubscriber(n,c,vnt.noop,i)))},vnt.noop)),r.subscribe(tde.createOperatorSubscriber(n,function(a){var s,l,c=o.slice();try{for(var u=bor(c),d=u.next();!d.done;d=u.next()){var f=d.value;f.next(a)}}catch(m){s={error:m}}finally{try{d&&!d.done&&(l=u.return)&&l.call(u)}finally{if(s)throw s.error}}},function(){for(;0<o.length;)o.shift().complete();n.complete()},i,function(){for(;0<o.length;)o.shift().unsubscribe()}))})}kE.windowToggle=wor});var Snt=ve(Z7=>{"use strict";Object.defineProperty(Z7,"__esModule",{value:!0});Z7.windowWhen=void 0;var Tor=$u(),Aor=Fr(),xnt=fn(),Por=Po();function Ior(e){return Aor.operate(function(t,r){var n,o,i=function(s){n.error(s),r.error(s)},a=function(){o?.unsubscribe(),n?.complete(),n=new Tor.Subject,r.next(n.asObservable());var s;try{s=Por.innerFrom(e())}catch(l){i(l);return}s.subscribe(o=xnt.createOperatorSubscriber(r,a,a,i))};a(),t.subscribe(xnt.createOperatorSubscriber(r,function(s){return n.next(s)},function(){n.complete(),r.complete()},i,function(){o?.unsubscribe(),n=null}))})}Z7.windowWhen=Ior});var Tnt=ve(z_=>{"use strict";var _nt=z_&&z_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},Cnt=z_&&z_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(z_,"__esModule",{value:!0});z_.withLatestFrom=void 0;var Eor=Fr(),wnt=fn(),Dor=Po(),kor=Zu(),Mor=Xu(),Bor=Pm();function Ror(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Bor.popResultSelector(e);return Eor.operate(function(n,o){for(var i=e.length,a=new Array(i),s=e.map(function(){return!1}),l=!1,c=function(d){Dor.innerFrom(e[d]).subscribe(wnt.createOperatorSubscriber(o,function(f){a[d]=f,!l&&!s[d]&&(s[d]=!0,(l=s.every(kor.identity))&&(s=null))},Mor.noop))},u=0;u<i;u++)c(u);n.subscribe(wnt.createOperatorSubscriber(o,function(d){if(l){var f=Cnt([d],_nt(a));o.next(r?r.apply(void 0,Cnt([],_nt(f))):f)}}))})}z_.withLatestFrom=Ror});var Ant=ve($7=>{"use strict";Object.defineProperty($7,"__esModule",{value:!0});$7.zipAll=void 0;var Oor=bG(),Lor=Uue();function For(e){return Lor.joinAllInternals(Oor.zip,e)}$7.zipAll=For});var Pnt=ve(q_=>{"use strict";var Nor=q_&&q_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},Uor=q_&&q_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(q_,"__esModule",{value:!0});q_.zip=void 0;var Vor=bG(),zor=Fr();function qor(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zor.operate(function(r,n){Vor.zip.apply(void 0,Uor([r],Nor(e))).subscribe(n)})}q_.zip=qor});var Int=ve(j_=>{"use strict";var jor=j_&&j_.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i},Gor=j_&&j_.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(j_,"__esModule",{value:!0});j_.zipWith=void 0;var Hor=Pnt();function Wor(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Hor.zip.apply(void 0,Gor([],jor(e)))}j_.zipWith=Wor});var Ont=ve(ge=>{"use strict";var Kor=ge&&ge.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Yor=ge&&ge.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Kor(t,e,r)};Object.defineProperty(ge,"__esModule",{value:!0});ge.interval=ge.iif=ge.generate=ge.fromEventPattern=ge.fromEvent=ge.from=ge.forkJoin=ge.empty=ge.defer=ge.connectable=ge.concat=ge.combineLatest=ge.bindNodeCallback=ge.bindCallback=ge.UnsubscriptionError=ge.TimeoutError=ge.SequenceError=ge.ObjectUnsubscribedError=ge.NotFoundError=ge.EmptyError=ge.ArgumentOutOfRangeError=ge.firstValueFrom=ge.lastValueFrom=ge.isObservable=ge.identity=ge.noop=ge.pipe=ge.NotificationKind=ge.Notification=ge.Subscriber=ge.Subscription=ge.Scheduler=ge.VirtualAction=ge.VirtualTimeScheduler=ge.animationFrameScheduler=ge.animationFrame=ge.queueScheduler=ge.queue=ge.asyncScheduler=ge.async=ge.asapScheduler=ge.asap=ge.AsyncSubject=ge.ReplaySubject=ge.BehaviorSubject=ge.Subject=ge.animationFrames=ge.observable=ge.ConnectableObservable=ge.Observable=void 0;ge.filter=ge.expand=ge.exhaustMap=ge.exhaustAll=ge.exhaust=ge.every=ge.endWith=ge.elementAt=ge.distinctUntilKeyChanged=ge.distinctUntilChanged=ge.distinct=ge.dematerialize=ge.delayWhen=ge.delay=ge.defaultIfEmpty=ge.debounceTime=ge.debounce=ge.count=ge.connect=ge.concatWith=ge.concatMapTo=ge.concatMap=ge.concatAll=ge.combineLatestWith=ge.combineLatestAll=ge.combineAll=ge.catchError=ge.bufferWhen=ge.bufferToggle=ge.bufferTime=ge.bufferCount=ge.buffer=ge.auditTime=ge.audit=ge.config=ge.NEVER=ge.EMPTY=ge.scheduled=ge.zip=ge.using=ge.timer=ge.throwError=ge.range=ge.race=ge.partition=ge.pairs=ge.onErrorResumeNext=ge.of=ge.never=ge.merge=void 0;ge.switchMap=ge.switchAll=ge.subscribeOn=ge.startWith=ge.skipWhile=ge.skipUntil=ge.skipLast=ge.skip=ge.single=ge.shareReplay=ge.share=ge.sequenceEqual=ge.scan=ge.sampleTime=ge.sample=ge.refCount=ge.retryWhen=ge.retry=ge.repeatWhen=ge.repeat=ge.reduce=ge.raceWith=ge.publishReplay=ge.publishLast=ge.publishBehavior=ge.publish=ge.pluck=ge.pairwise=ge.onErrorResumeNextWith=ge.observeOn=ge.multicast=ge.min=ge.mergeWith=ge.mergeScan=ge.mergeMapTo=ge.mergeMap=ge.flatMap=ge.mergeAll=ge.max=ge.materialize=ge.mapTo=ge.map=ge.last=ge.isEmpty=ge.ignoreElements=ge.groupBy=ge.first=ge.findIndex=ge.find=ge.finalize=void 0;ge.zipWith=ge.zipAll=ge.withLatestFrom=ge.windowWhen=ge.windowToggle=ge.windowTime=ge.windowCount=ge.window=ge.toArray=ge.timestamp=ge.timeoutWith=ge.timeout=ge.timeInterval=ge.throwIfEmpty=ge.throttleTime=ge.throttle=ge.tap=ge.takeWhile=ge.takeUntil=ge.takeLast=ge.take=ge.switchScan=ge.switchMapTo=void 0;var Xor=Ba();Object.defineProperty(ge,"Observable",{enumerable:!0,get:function(){return Xor.Observable}});var Zor=dO();Object.defineProperty(ge,"ConnectableObservable",{enumerable:!0,get:function(){return Zor.ConnectableObservable}});var $or=cO();Object.defineProperty(ge,"observable",{enumerable:!0,get:function(){return $or.observable}});var Qor=kJe();Object.defineProperty(ge,"animationFrames",{enumerable:!0,get:function(){return Qor.animationFrames}});var Jor=$u();Object.defineProperty(ge,"Subject",{enumerable:!0,get:function(){return Jor.Subject}});var eir=iue();Object.defineProperty(ge,"BehaviorSubject",{enumerable:!0,get:function(){return eir.BehaviorSubject}});var tir=a9();Object.defineProperty(ge,"ReplaySubject",{enumerable:!0,get:function(){return tir.ReplaySubject}});var rir=s9();Object.defineProperty(ge,"AsyncSubject",{enumerable:!0,get:function(){return rir.AsyncSubject}});var Ent=YJe();Object.defineProperty(ge,"asap",{enumerable:!0,get:function(){return Ent.asap}});Object.defineProperty(ge,"asapScheduler",{enumerable:!0,get:function(){return Ent.asapScheduler}});var Dnt=Am();Object.defineProperty(ge,"async",{enumerable:!0,get:function(){return Dnt.async}});Object.defineProperty(ge,"asyncScheduler",{enumerable:!0,get:function(){return Dnt.asyncScheduler}});var knt=$Je();Object.defineProperty(ge,"queue",{enumerable:!0,get:function(){return knt.queue}});Object.defineProperty(ge,"queueScheduler",{enumerable:!0,get:function(){return knt.queueScheduler}});var Mnt=tet();Object.defineProperty(ge,"animationFrame",{enumerable:!0,get:function(){return Mnt.animationFrame}});Object.defineProperty(ge,"animationFrameScheduler",{enumerable:!0,get:function(){return Mnt.animationFrameScheduler}});var Bnt=oet();Object.defineProperty(ge,"VirtualTimeScheduler",{enumerable:!0,get:function(){return Bnt.VirtualTimeScheduler}});Object.defineProperty(ge,"VirtualAction",{enumerable:!0,get:function(){return Bnt.VirtualAction}});var nir=sue();Object.defineProperty(ge,"Scheduler",{enumerable:!0,get:function(){return nir.Scheduler}});var oir=Sp();Object.defineProperty(ge,"Subscription",{enumerable:!0,get:function(){return oir.Subscription}});var iir=Z3();Object.defineProperty(ge,"Subscriber",{enumerable:!0,get:function(){return iir.Subscriber}});var Rnt=B9();Object.defineProperty(ge,"Notification",{enumerable:!0,get:function(){return Rnt.Notification}});Object.defineProperty(ge,"NotificationKind",{enumerable:!0,get:function(){return Rnt.NotificationKind}});var air=uO();Object.defineProperty(ge,"pipe",{enumerable:!0,get:function(){return air.pipe}});var sir=Xu();Object.defineProperty(ge,"noop",{enumerable:!0,get:function(){return sir.noop}});var lir=Zu();Object.defineProperty(ge,"identity",{enumerable:!0,get:function(){return lir.identity}});var cir=Cet();Object.defineProperty(ge,"isObservable",{enumerable:!0,get:function(){return cir.isObservable}});var uir=wet();Object.defineProperty(ge,"lastValueFrom",{enumerable:!0,get:function(){return uir.lastValueFrom}});var dir=Tet();Object.defineProperty(ge,"firstValueFrom",{enumerable:!0,get:function(){return dir.firstValueFrom}});var fir=_ue();Object.defineProperty(ge,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return fir.ArgumentOutOfRangeError}});var mir=T_();Object.defineProperty(ge,"EmptyError",{enumerable:!0,get:function(){return mir.EmptyError}});var pir=Cue();Object.defineProperty(ge,"NotFoundError",{enumerable:!0,get:function(){return pir.NotFoundError}});var hir=tue();Object.defineProperty(ge,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return hir.ObjectUnsubscribedError}});var gir=wue();Object.defineProperty(ge,"SequenceError",{enumerable:!0,get:function(){return gir.SequenceError}});var yir=j9();Object.defineProperty(ge,"TimeoutError",{enumerable:!0,get:function(){return yir.TimeoutError}});var vir=qce();Object.defineProperty(ge,"UnsubscriptionError",{enumerable:!0,get:function(){return vir.UnsubscriptionError}});var bir=Pet();Object.defineProperty(ge,"bindCallback",{enumerable:!0,get:function(){return bir.bindCallback}});var xir=Iet();Object.defineProperty(ge,"bindNodeCallback",{enumerable:!0,get:function(){return xir.bindNodeCallback}});var Sir=X9();Object.defineProperty(ge,"combineLatest",{enumerable:!0,get:function(){return Sir.combineLatest}});var _ir=vO();Object.defineProperty(ge,"concat",{enumerable:!0,get:function(){return _ir.concat}});var Cir=Let();Object.defineProperty(ge,"connectable",{enumerable:!0,get:function(){return Cir.connectable}});var wir=bO();Object.defineProperty(ge,"defer",{enumerable:!0,get:function(){return wir.defer}});var Tir=b0();Object.defineProperty(ge,"empty",{enumerable:!0,get:function(){return Tir.empty}});var Air=Fet();Object.defineProperty(ge,"forkJoin",{enumerable:!0,get:function(){return Air.forkJoin}});var Pir=x1();Object.defineProperty(ge,"from",{enumerable:!0,get:function(){return Pir.from}});var Iir=Uet();Object.defineProperty(ge,"fromEvent",{enumerable:!0,get:function(){return Iir.fromEvent}});var Eir=zet();Object.defineProperty(ge,"fromEventPattern",{enumerable:!0,get:function(){return Eir.fromEventPattern}});var Dir=jet();Object.defineProperty(ge,"generate",{enumerable:!0,get:function(){return Dir.generate}});var kir=Get();Object.defineProperty(ge,"iif",{enumerable:!0,get:function(){return kir.iif}});var Mir=Due();Object.defineProperty(ge,"interval",{enumerable:!0,get:function(){return Mir.interval}});var Bir=Wet();Object.defineProperty(ge,"merge",{enumerable:!0,get:function(){return Bir.merge}});var Rir=kue();Object.defineProperty(ge,"never",{enumerable:!0,get:function(){return Rir.never}});var Oir=k9();Object.defineProperty(ge,"of",{enumerable:!0,get:function(){return Oir.of}});var Lir=Mue();Object.defineProperty(ge,"onErrorResumeNext",{enumerable:!0,get:function(){return Lir.onErrorResumeNext}});var Fir=Yet();Object.defineProperty(ge,"pairs",{enumerable:!0,get:function(){return Fir.pairs}});var Nir=Qet();Object.defineProperty(ge,"partition",{enumerable:!0,get:function(){return Nir.partition}});var Uir=Bue();Object.defineProperty(ge,"race",{enumerable:!0,get:function(){return Uir.race}});var Vir=ttt();Object.defineProperty(ge,"range",{enumerable:!0,get:function(){return Vir.range}});var zir=Sue();Object.defineProperty(ge,"throwError",{enumerable:!0,get:function(){return zir.throwError}});var qir=D_();Object.defineProperty(ge,"timer",{enumerable:!0,get:function(){return qir.timer}});var jir=rtt();Object.defineProperty(ge,"using",{enumerable:!0,get:function(){return jir.using}});var Gir=bG();Object.defineProperty(ge,"zip",{enumerable:!0,get:function(){return Gir.zip}});var Hir=xue();Object.defineProperty(ge,"scheduled",{enumerable:!0,get:function(){return Hir.scheduled}});var Wir=b0();Object.defineProperty(ge,"EMPTY",{enumerable:!0,get:function(){return Wir.EMPTY}});var Kir=kue();Object.defineProperty(ge,"NEVER",{enumerable:!0,get:function(){return Kir.NEVER}});Yor(ott(),ge);var Yir=Y3();Object.defineProperty(ge,"config",{enumerable:!0,get:function(){return Yir.config}});var Xir=Rue();Object.defineProperty(ge,"audit",{enumerable:!0,get:function(){return Xir.audit}});var Zir=att();Object.defineProperty(ge,"auditTime",{enumerable:!0,get:function(){return Zir.auditTime}});var $ir=ltt();Object.defineProperty(ge,"buffer",{enumerable:!0,get:function(){return $ir.buffer}});var Qir=ctt();Object.defineProperty(ge,"bufferCount",{enumerable:!0,get:function(){return Qir.bufferCount}});var Jir=dtt();Object.defineProperty(ge,"bufferTime",{enumerable:!0,get:function(){return Jir.bufferTime}});var ear=ptt();Object.defineProperty(ge,"bufferToggle",{enumerable:!0,get:function(){return ear.bufferToggle}});var tar=gtt();Object.defineProperty(ge,"bufferWhen",{enumerable:!0,get:function(){return tar.bufferWhen}});var rar=vtt();Object.defineProperty(ge,"catchError",{enumerable:!0,get:function(){return rar.catchError}});var nar=btt();Object.defineProperty(ge,"combineAll",{enumerable:!0,get:function(){return nar.combineAll}});var oar=Vue();Object.defineProperty(ge,"combineLatestAll",{enumerable:!0,get:function(){return oar.combineLatestAll}});var iar=wtt();Object.defineProperty(ge,"combineLatestWith",{enumerable:!0,get:function(){return iar.combineLatestWith}});var aar=tG();Object.defineProperty(ge,"concatAll",{enumerable:!0,get:function(){return aar.concatAll}});var sar=zue();Object.defineProperty(ge,"concatMap",{enumerable:!0,get:function(){return sar.concatMap}});var lar=Ptt();Object.defineProperty(ge,"concatMapTo",{enumerable:!0,get:function(){return lar.concatMapTo}});var car=Ett();Object.defineProperty(ge,"concatWith",{enumerable:!0,get:function(){return car.concatWith}});var uar=OG();Object.defineProperty(ge,"connect",{enumerable:!0,get:function(){return uar.connect}});var dar=ktt();Object.defineProperty(ge,"count",{enumerable:!0,get:function(){return dar.count}});var far=Btt();Object.defineProperty(ge,"debounce",{enumerable:!0,get:function(){return far.debounce}});var mar=Rtt();Object.defineProperty(ge,"debounceTime",{enumerable:!0,get:function(){return mar.debounceTime}});var par=xO();Object.defineProperty(ge,"defaultIfEmpty",{enumerable:!0,get:function(){return par.defaultIfEmpty}});var har=Ftt();Object.defineProperty(ge,"delay",{enumerable:!0,get:function(){return har.delay}});var gar=Gue();Object.defineProperty(ge,"delayWhen",{enumerable:!0,get:function(){return gar.delayWhen}});var yar=Ntt();Object.defineProperty(ge,"dematerialize",{enumerable:!0,get:function(){return yar.dematerialize}});var bar=Vtt();Object.defineProperty(ge,"distinct",{enumerable:!0,get:function(){return bar.distinct}});var xar=Hue();Object.defineProperty(ge,"distinctUntilChanged",{enumerable:!0,get:function(){return xar.distinctUntilChanged}});var Sar=ztt();Object.defineProperty(ge,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Sar.distinctUntilKeyChanged}});var _ar=jtt();Object.defineProperty(ge,"elementAt",{enumerable:!0,get:function(){return _ar.elementAt}});var Car=Gtt();Object.defineProperty(ge,"endWith",{enumerable:!0,get:function(){return Car.endWith}});var war=Htt();Object.defineProperty(ge,"every",{enumerable:!0,get:function(){return war.every}});var Tar=Xtt();Object.defineProperty(ge,"exhaust",{enumerable:!0,get:function(){return Tar.exhaust}});var Aar=Kue();Object.defineProperty(ge,"exhaustAll",{enumerable:!0,get:function(){return Aar.exhaustAll}});var Par=Wue();Object.defineProperty(ge,"exhaustMap",{enumerable:!0,get:function(){return Par.exhaustMap}});var Iar=Ztt();Object.defineProperty(ge,"expand",{enumerable:!0,get:function(){return Iar.expand}});var Ear=Fw();Object.defineProperty(ge,"filter",{enumerable:!0,get:function(){return Ear.filter}});var Dar=$tt();Object.defineProperty(ge,"finalize",{enumerable:!0,get:function(){return Dar.finalize}});var kar=Yue();Object.defineProperty(ge,"find",{enumerable:!0,get:function(){return kar.find}});var Mar=Jtt();Object.defineProperty(ge,"findIndex",{enumerable:!0,get:function(){return Mar.findIndex}});var Bar=ert();Object.defineProperty(ge,"first",{enumerable:!0,get:function(){return Bar.first}});var Rar=rrt();Object.defineProperty(ge,"groupBy",{enumerable:!0,get:function(){return Rar.groupBy}});var Oar=que();Object.defineProperty(ge,"ignoreElements",{enumerable:!0,get:function(){return Oar.ignoreElements}});var Lar=nrt();Object.defineProperty(ge,"isEmpty",{enumerable:!0,get:function(){return Lar.isEmpty}});var Far=ort();Object.defineProperty(ge,"last",{enumerable:!0,get:function(){return Far.last}});var Nar=A_();Object.defineProperty(ge,"map",{enumerable:!0,get:function(){return Nar.map}});var Uar=jue();Object.defineProperty(ge,"mapTo",{enumerable:!0,get:function(){return Uar.mapTo}});var Var=irt();Object.defineProperty(ge,"materialize",{enumerable:!0,get:function(){return Var.materialize}});var zar=art();Object.defineProperty(ge,"max",{enumerable:!0,get:function(){return zar.max}});var qar=yO();Object.defineProperty(ge,"mergeAll",{enumerable:!0,get:function(){return qar.mergeAll}});var jar=srt();Object.defineProperty(ge,"flatMap",{enumerable:!0,get:function(){return jar.flatMap}});var Gar=_1();Object.defineProperty(ge,"mergeMap",{enumerable:!0,get:function(){return Gar.mergeMap}});var Har=crt();Object.defineProperty(ge,"mergeMapTo",{enumerable:!0,get:function(){return Har.mergeMapTo}});var War=urt();Object.defineProperty(ge,"mergeScan",{enumerable:!0,get:function(){return War.mergeScan}});var Kar=mrt();Object.defineProperty(ge,"mergeWith",{enumerable:!0,get:function(){return Kar.mergeWith}});var Yar=prt();Object.defineProperty(ge,"min",{enumerable:!0,get:function(){return Yar.min}});var Xar=h7();Object.defineProperty(ge,"multicast",{enumerable:!0,get:function(){return Xar.multicast}});var Zar=hO();Object.defineProperty(ge,"observeOn",{enumerable:!0,get:function(){return Zar.observeOn}});var $ar=yrt();Object.defineProperty(ge,"onErrorResumeNextWith",{enumerable:!0,get:function(){return $ar.onErrorResumeNextWith}});var Qar=vrt();Object.defineProperty(ge,"pairwise",{enumerable:!0,get:function(){return Qar.pairwise}});var Jar=brt();Object.defineProperty(ge,"pluck",{enumerable:!0,get:function(){return Jar.pluck}});var esr=xrt();Object.defineProperty(ge,"publish",{enumerable:!0,get:function(){return esr.publish}});var tsr=Srt();Object.defineProperty(ge,"publishBehavior",{enumerable:!0,get:function(){return tsr.publishBehavior}});var rsr=_rt();Object.defineProperty(ge,"publishLast",{enumerable:!0,get:function(){return rsr.publishLast}});var nsr=wrt();Object.defineProperty(ge,"publishReplay",{enumerable:!0,get:function(){return nsr.publishReplay}});var osr=Trt();Object.defineProperty(ge,"raceWith",{enumerable:!0,get:function(){return osr.raceWith}});var isr=AE();Object.defineProperty(ge,"reduce",{enumerable:!0,get:function(){return isr.reduce}});var asr=Prt();Object.defineProperty(ge,"repeat",{enumerable:!0,get:function(){return asr.repeat}});var ssr=Ert();Object.defineProperty(ge,"repeatWhen",{enumerable:!0,get:function(){return ssr.repeatWhen}});var lsr=krt();Object.defineProperty(ge,"retry",{enumerable:!0,get:function(){return lsr.retry}});var csr=Brt();Object.defineProperty(ge,"retryWhen",{enumerable:!0,get:function(){return csr.retryWhen}});var usr=Jce();Object.defineProperty(ge,"refCount",{enumerable:!0,get:function(){return usr.refCount}});var dsr=$ue();Object.defineProperty(ge,"sample",{enumerable:!0,get:function(){return dsr.sample}});var fsr=Ort();Object.defineProperty(ge,"sampleTime",{enumerable:!0,get:function(){return fsr.sampleTime}});var msr=Lrt();Object.defineProperty(ge,"scan",{enumerable:!0,get:function(){return msr.scan}});var psr=Nrt();Object.defineProperty(ge,"sequenceEqual",{enumerable:!0,get:function(){return psr.sequenceEqual}});var hsr=Jue();Object.defineProperty(ge,"share",{enumerable:!0,get:function(){return hsr.share}});var gsr=zrt();Object.defineProperty(ge,"shareReplay",{enumerable:!0,get:function(){return gsr.shareReplay}});var ysr=qrt();Object.defineProperty(ge,"single",{enumerable:!0,get:function(){return ysr.single}});var vsr=jrt();Object.defineProperty(ge,"skip",{enumerable:!0,get:function(){return vsr.skip}});var bsr=Grt();Object.defineProperty(ge,"skipLast",{enumerable:!0,get:function(){return bsr.skipLast}});var xsr=Wrt();Object.defineProperty(ge,"skipUntil",{enumerable:!0,get:function(){return xsr.skipUntil}});var Ssr=Krt();Object.defineProperty(ge,"skipWhile",{enumerable:!0,get:function(){return Ssr.skipWhile}});var _sr=Xrt();Object.defineProperty(ge,"startWith",{enumerable:!0,get:function(){return _sr.startWith}});var Csr=gO();Object.defineProperty(ge,"subscribeOn",{enumerable:!0,get:function(){return Csr.subscribeOn}});var wsr=$rt();Object.defineProperty(ge,"switchAll",{enumerable:!0,get:function(){return wsr.switchAll}});var Tsr=CO();Object.defineProperty(ge,"switchMap",{enumerable:!0,get:function(){return Tsr.switchMap}});var Asr=Jrt();Object.defineProperty(ge,"switchMapTo",{enumerable:!0,get:function(){return Asr.switchMapTo}});var Psr=ent();Object.defineProperty(ge,"switchScan",{enumerable:!0,get:function(){return Psr.switchScan}});var Isr=SO();Object.defineProperty(ge,"take",{enumerable:!0,get:function(){return Isr.take}});var Esr=Xue();Object.defineProperty(ge,"takeLast",{enumerable:!0,get:function(){return Esr.takeLast}});var Dsr=tnt();Object.defineProperty(ge,"takeUntil",{enumerable:!0,get:function(){return Dsr.takeUntil}});var ksr=rnt();Object.defineProperty(ge,"takeWhile",{enumerable:!0,get:function(){return ksr.takeWhile}});var Msr=nnt();Object.defineProperty(ge,"tap",{enumerable:!0,get:function(){return Msr.tap}});var Bsr=ede();Object.defineProperty(ge,"throttle",{enumerable:!0,get:function(){return Bsr.throttle}});var Rsr=int();Object.defineProperty(ge,"throttleTime",{enumerable:!0,get:function(){return Rsr.throttleTime}});var Osr=_O();Object.defineProperty(ge,"throwIfEmpty",{enumerable:!0,get:function(){return Osr.throwIfEmpty}});var Lsr=snt();Object.defineProperty(ge,"timeInterval",{enumerable:!0,get:function(){return Lsr.timeInterval}});var Fsr=j9();Object.defineProperty(ge,"timeout",{enumerable:!0,get:function(){return Fsr.timeout}});var Nsr=lnt();Object.defineProperty(ge,"timeoutWith",{enumerable:!0,get:function(){return Nsr.timeoutWith}});var Usr=cnt();Object.defineProperty(ge,"timestamp",{enumerable:!0,get:function(){return Usr.timestamp}});var Vsr=Nue();Object.defineProperty(ge,"toArray",{enumerable:!0,get:function(){return Vsr.toArray}});var zsr=fnt();Object.defineProperty(ge,"window",{enumerable:!0,get:function(){return zsr.window}});var qsr=pnt();Object.defineProperty(ge,"windowCount",{enumerable:!0,get:function(){return qsr.windowCount}});var jsr=gnt();Object.defineProperty(ge,"windowTime",{enumerable:!0,get:function(){return jsr.windowTime}});var Gsr=bnt();Object.defineProperty(ge,"windowToggle",{enumerable:!0,get:function(){return Gsr.windowToggle}});var Hsr=Snt();Object.defineProperty(ge,"windowWhen",{enumerable:!0,get:function(){return Hsr.windowWhen}});var Wsr=Tnt();Object.defineProperty(ge,"withLatestFrom",{enumerable:!0,get:function(){return Wsr.withLatestFrom}});var Ksr=Ant();Object.defineProperty(ge,"zipAll",{enumerable:!0,get:function(){return Ksr.zipAll}});var Ysr=Int();Object.defineProperty(ge,"zipWith",{enumerable:!0,get:function(){return Ysr.zipWith}})});var nde=ve(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});Nw.checkAbortSignal=Fnt;Nw.abortBreakPoint=Zsr;Nw.makeAbortError=Nnt;Nw.observeAbortSignal=$sr;Nw.isAbortException=Qsr;var Lnt=Ont(),rde=class extends Error{};function Fnt(e){if(e){if(!(e instanceof AbortSignal))throw new TypeError("must pass an AbortSignal");if(e.aborted)throw Nnt()}}function Xsr(e){return new Promise(t=>setTimeout(t,e))}async function Zsr(e){await Xsr(1),Fnt(e)}function Nnt(){if(typeof DOMException<"u")return new DOMException("aborted","AbortError");let e=new rde("aborted");return e.code="ERR_ABORTED",e}function $sr(e){return e?(0,Lnt.fromEvent)(e,"abort"):new Lnt.Observable}function Qsr(e){return e instanceof Error&&(e.name==="AbortError"||e.code==="ERR_ABORTED"||!!/\b(aborted|aborterror)\b/i.test(e.message))}});var Unt=ve(ide=>{"use strict";Object.defineProperty(ide,"__esModule",{value:!0});ide.makeAbortableReaction=tlr;var Jsr=bR(),wO=f0(),elr=nde(),ode=lce();function tlr(e,t,r,n,o,i,a){let s;function l(c){(0,elr.isAbortException)(c)||(console.error(c),(0,wO.isAlive)(e)&&a(c))}(0,wO.addDisposer)(e,(0,Jsr.reaction)(()=>{try{return t(e)}catch(c){l(c);return}},async(c,u)=>{if(s&&(0,ode.stopStopToken)(s),!!(0,wO.isAlive)(e)){s=(0,ode.createStopToken)(),o(s);try{let d=await r(c,s,e,u);(0,wO.isAlive)(e)&&i(d)}catch(d){l(d)}}},n)),(0,wO.addDisposer)(e,()=>{s&&(0,ode.stopStopToken)(s)})}});var _ce=ve(Ot=>{"use strict";var rlr=Ot&&Ot.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Vw=Ot&&Ot.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&rlr(t,e,r)},Vnt=Ot&&Ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.makeAbortableReaction=Ot.blobToDataURL=Ot.isFeature=Ot.SimpleFeature=Ot.defaultCodonTable=Ot.defaultStops=Ot.defaultStarts=Ot.rIC=Ot.complementTable=Ot.isElectron=void 0;Ot.useDebounce=slr;Ot.useWidthSetter=llr;Ot.useDebouncedCallback=clr;Ot.findParentThat=qnt;Ot.springAnimate=ulr;Ot.findParentThatIs=AO;Ot.getSession=dlr;Ot.getContainingView=jnt;Ot.getContainingTrack=flr;Ot.getContainingDisplay=mlr;Ot.assembleLocString=plr;Ot.assembleLocStringFast=Gnt;Ot.parseLocStringOneBased=Hnt;Ot.parseLocString=ade;Ot.compareLocs=Wnt;Ot.compareLocStrings=hlr;Ot.clamp=glr;Ot.bpToPx=sde;Ot.radToDeg=xlr;Ot.degToRad=Slr;Ot.polarToCartesian=_lr;Ot.cartesianToPolar=Clr;Ot.featureSpanPx=wlr;Ot.bpSpanPx=Knt;Ot.iterMap=Tlr;Ot.findLastIndex=Alr;Ot.findLast=Plr;Ot.renameRegionIfNeeded=Ynt;Ot.renameRegionsIfNeeded=Ilr;Ot.minmax=Elr;Ot.shorten=Xnt;Ot.shorten2=Dlr;Ot.stringify=klr;Ot.revcom=Mlr;Ot.reverse=Blr;Ot.complement=Rlr;Ot.measureText=Znt;Ot.getFrame=Llr;Ot.generateCodonTable=Flr;Ot.updateStatus=lde;Ot.updateStatus2=Nlr;Ot.hashCode=$nt;Ot.objectHash=Ulr;Ot.bytesForRegions=Vlr;Ot.isSupportedIndexingAdapter=zlr;Ot.getBpDisplayStr=qlr;Ot.getProgressDisplayStr=jlr;Ot.toLocale=ME;Ot.getTickDisplayStr=Glr;Ot.getViewParams=Hlr;Ot.getLayoutId=Wlr;Ot.useLocalStorage=Klr;Ot.getUriLink=Qnt;Ot.getStr=Jnt;Ot.coarseStripHTML=eot;Ot.linkify=Ylr;Ot.measureGridWidth=Xlr;Ot.getEnv=Zlr;Ot.localStorageGetItem=ude;Ot.localStorageSetItem=tot;Ot.max=rot;Ot.min=$lr;Ot.sum=not;Ot.avg=Qlr;Ot.groupBy=Jlr;Ot.notEmpty=ecr;Ot.mergeIntervals=oot;Ot.gatherOverlaps=tcr;Ot.stripAlpha=rcr;Ot.getStrokeProps=ncr;Ot.getFillProps=ocr;Ot.renderToStaticMarkup=icr;Ot.isGzip=iot;Ot.fetchAndMaybeUnzip=aot;Ot.fetchAndMaybeUnzipText=acr;Ot.isObject=sot;Ot.localStorageGetNumber=scr;Ot.localStorageGetBoolean=lcr;Ot.localStorageSetBoolean=ccr;Ot.forEachWithStopTokenCheck=ucr;Ot.testAdapter=dcr;var Uw=Wr(),nlr=m$e(),olr=Vnt(p$e()),x0=f0(),ilr=g$e(),alr=Xse(),cde=O$e(),znt=lce(),TO=kce();Vw(kce(),Ot);Vw(GQe(),Ot);Vw(HQe(),Ot);Vw(WQe(),Ot);Vw(Fce(),Ot);Vw(oJe(),Ot);function slr(e,t){let[r,n]=(0,Uw.useState)(e);return(0,Uw.useEffect)(()=>{let o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}function llr(e,t){let[r,{width:n}]=(0,olr.default)();return(0,Uw.useEffect)(()=>{let o;return n&&(0,x0.isAlive)(e)&&(o=requestAnimationFrame(()=>{e.setWidth(n)})),()=>{o&&cancelAnimationFrame(o)}},[t,e,n]),r}function clr(e,t=400){let r=(0,Uw.useRef)(null),n=(0,Uw.useRef)(null);return(0,Uw.useEffect)(()=>{n.current&&clearTimeout(n.current)},[]),function(...i){r.current=i,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current&&e(...r.current)},t)}}function qnt(e,t){if(!(0,x0.hasParent)(e))throw new Error("node does not have parent");let r=(0,x0.getParent)(e);for(;r&&(0,x0.isAlive)(r);){if(t(r))return r;if((0,x0.hasParent)(r))r=(0,x0.getParent)(r);else break}throw new Error("no matching node found")}function ulr(e,t,r,n=()=>{},o=0,i=400,a=20,s=!0){o||(o=Math.abs(t-e)/1e3);let c;function u(d){let f=Date.now(),m=d.lastPosition,p=d.lastTime||f,h=d.lastVelocity||0;f>p+64&&(p=f);let g=Math.floor(f-p);for(let S=0;S<g;++S){let w=-i*(m-t),A=-a*h,T=(w+A)/1;h+=T*1/1e3,m+=h*1/1e3}let y=Math.abs(h)<=o,b=i!==0?Math.abs(t-m)<=o:!0;(s&&i!==0?e<t?m>t:m<t:!1)||y&&b?(r(t),n()):(r(m),c=requestAnimationFrame(()=>{u({lastPosition:m,lastTime:f,lastVelocity:h})}))}return[()=>{u({lastPosition:e})},()=>{cancelAnimationFrame(c)}]}function AO(e,t){return qnt(e,t)}function dlr(e){try{return AO(e,TO.isSessionModel)}catch{throw new Error("no session model found!")}}function jnt(e){try{return AO(e,TO.isViewModel)}catch{throw new Error("no containing view found")}}function flr(e){try{return AO(e,TO.isTrackModel)}catch{throw new Error("no containing track found")}}function mlr(e){try{return AO(e,TO.isDisplayModel)}catch{throw new Error("no containing display found")}}function plr(e){return Gnt(e,ME)}function Gnt(e,t=r=>r){let{assemblyName:r,refName:n,start:o,end:i,reversed:a}=e,s=r?`{${r}}`:"",l;o!==void 0?l=`:${t(o+1)}`:i!==void 0?l=":1":l="";let c;i!==void 0?c=o!==void 0&&o+1===i?"":`..${t(i)}`:c=o!==void 0?"..":"";let u="";return a&&(u="[rev]"),`${s}${n}${l}${c}${u}`}function Hnt(e,t){if(!e)throw new Error("no location string provided, could not parse");let r=!1;e.endsWith("[rev]")&&(r=!0,e=e.replace(/\[rev]$/,"")),e=e.replace(/\s/,"");let n=/({(.+)})?(.+)/.exec(e);if(!n)throw new Error(`invalid location string: "${e}"`);let[,,o,i]=n,a=o,s=i;if(!a&&s.startsWith("{}"))throw new Error(`no assembly name was provided in location "${s}"`);let l=s.lastIndexOf(":");if(l===-1){if(t(s,a))return{assemblyName:a,refName:s,reversed:r};throw new Error(`Unknown reference sequence "${s}"`)}let c=s.slice(0,l),u=s.slice(l+1);if(t(c,a)&&t(s,a))throw new Error(`ambiguous location string: "${e}"`);if(t(c,a))if(u){let d=/^(-?(\d+|\d{1,3}(,\d{3})*))(\.\.|-)(-?(\d+|\d{1,3}(,\d{3})*))$/.exec(u),f=/^(-?(\d+|\d{1,3}(,\d{3})*))(\.\.|-)?$/.exec(u);if(d){let[,m,,,,p]=d;if(m!==void 0&&p!==void 0)return{assemblyName:a,refName:c,start:+m.replaceAll(",",""),end:+p.replaceAll(",",""),reversed:r}}else if(f){let[,m,,,p]=f;if(m!==void 0)return p?{assemblyName:a,refName:c,start:+m.replaceAll(",",""),reversed:r}:{assemblyName:a,refName:c,start:+m.replaceAll(",",""),end:+m.replaceAll(",",""),reversed:r}}else throw new Error(`could not parse range "${u}" on location "${e}"`)}else return{assemblyName:a,refName:c,reversed:r};else if(t(s,a))return{assemblyName:a,refName:s,reversed:r};throw new Error(`unknown reference sequence name in location "${e}"`)}function ade(e,t){let r=Hnt(e,t);return typeof r.start=="number"&&(r.start-=1),r}function Wnt(e,t){let r=e.assemblyName||t.assemblyName?(e.assemblyName||"").localeCompare(t.assemblyName||""):0;if(r)return r;let n=e.refName||t.refName?(e.refName||"").localeCompare(t.refName||""):0;if(n)return n;if(e.start!==void 0&&t.start!==void 0){let o=e.start-t.start;if(o)return o}if(e.end!==void 0&&t.end!==void 0){let o=e.end-t.end;if(o)return o}return 0}function hlr(e,t,r){let n=ade(e,r),o=ade(t,r);return Wnt(n,o)}function glr(e,t,r){return e<t?t:e>r?r:e}function ylr(e){return Math.round(e*10)/10}function sde(e,{reversed:t,end:r=0,start:n=0},o){return ylr((t?r-e:e-n)/o)}var vlr=180/Math.PI,blr=Math.PI/180;function xlr(e){return e*vlr%360}function Slr(e){return e*blr%(2*Math.PI)}function _lr(e,t){return[e*Math.cos(t),e*Math.sin(t)]}function Clr(e,t){let r=Math.sqrt(e*e+t*t),n=Math.atan(t/e);return[r,n]}function wlr(e,t,r){return Knt(e.get("start"),e.get("end"),t,r)}function Knt(e,t,r,n){let o=sde(e,r,n),i=sde(t,r,n);return r.reversed?[i,o]:[o,i]}function Tlr(e,t,r){let n=Array.from({length:r||0}),o=0;for(let i of e)n[o]=t(i),o+=1;return n}function Alr(e,t){let r=e.length;for(;r--;)if(t(e[r],r,e))return r;return-1}function Plr(e,t){let r=e.length;for(;r--;)if(t(e[r],r,e))return e[r]}function Ynt(e,t){if((0,x0.isStateTreeNode)(t)&&!(0,x0.isAlive)(t))return t;if(e?.[t.refName]){t=(0,x0.isStateTreeNode)(t)?{...(0,x0.getSnapshot)(t)}:{...t};let r=e[t.refName];if(r)return{...t,refName:r,originalRefName:t.refName}}return t}async function Ilr(e,t){let{regions:r=[],adapterConfig:n}=t;if(!t.sessionId)throw new Error("sessionId is required");let o=r.map(a=>a.assemblyName),i=Object.fromEntries(await Promise.all([...new Set(o)].map(async a=>[a,await e.getRefNameMapForAdapter(n,a,t)])));return{...t,regions:r.map((a,s)=>Ynt(i[o[s]],a))}}function Elr(e,t){return[Math.min(e,t),Math.max(e,t)]}function Xnt(e,t=70,r=30){return e.length>t?`${e.slice(0,r)}...${e.slice(-r)}`:e}function Dlr(e,t=70){return e.length>t?`${e.slice(0,t)}...`:e}function klr({refName:e,coord:t,assemblyName:r,oob:n},o){return[r&&o?`{${r}}`:"",e?`${Xnt(e)}:${ME(t)}${n?" (out of bounds)":""}`:""].join("")}Ot.isElectron=/electron/i.test(typeof navigator<"u"?navigator.userAgent:"");Ot.complementTable={S:"S",w:"w",T:"A",r:"y",a:"t",N:"N",K:"M",x:"x",d:"h",Y:"R",V:"B",y:"r",M:"K",h:"d",k:"m",C:"G",g:"c",t:"a",A:"T",n:"n",W:"W",X:"X",m:"k",v:"b",B:"V",s:"s",H:"D",c:"g",D:"H",b:"v",R:"Y",G:"C"};function Mlr(e){var t;let r="";for(let n=e.length-1;n>=0;n--)r+=(t=Ot.complementTable[e[n]])!==null&&t!==void 0?t:e[n];return r}function Blr(e){let t="";for(let r=e.length-1;r>=0;r--)t+=e[r];return t}function Rlr(e){var t;let r="";for(let n of e)r+=(t=Ot.complementTable[n])!==null&&t!==void 0?t:n;return r}Ot.rIC=typeof jest>"u"?typeof window<"u"&&window.requestIdleCallback?window.requestIdleCallback:e=>setTimeout(()=>{e()},1):e=>{e()};var Olr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2796875,.2765625,.3546875,.5546875,.5546875,.8890625,.665625,.190625,.3328125,.3328125,.3890625,.5828125,.2765625,.3328125,.2765625,.3015625,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.2765625,.2765625,.584375,.5828125,.584375,.5546875,1.0140625,.665625,.665625,.721875,.721875,.665625,.609375,.7765625,.721875,.2765625,.5,.665625,.5546875,.8328125,.721875,.7765625,.665625,.7765625,.721875,.665625,.609375,.721875,.665625,.94375,.665625,.665625,.609375,.2765625,.3546875,.2765625,.4765625,.5546875,.3328125,.5546875,.5546875,.5,.5546875,.5546875,.2765625,.5546875,.5546875,.221875,.240625,.5,.221875,.8328125,.5546875,.5546875,.5546875,.5546875,.3328125,.5,.2765625,.5546875,.5,.721875,.5,.5,.5,.3546875,.259375,.353125,.5890625];function Znt(e,t=10){var r;let n=.5279276315789471,o=String(e),i=0;for(let a=0;a<o.length;a++){let s=o.charCodeAt(a);i+=(r=Olr[s])!==null&&r!==void 0?r:n}return i*t}function Llr(e,t,r,n){return r===1?(e+n)%3+1:-1*((t-n)%3)-1}Ot.defaultStarts=["ATG"];Ot.defaultStops=["TAA","TAG","TGA"];Ot.defaultCodonTable={TCA:"S",TCC:"S",TCG:"S",TCT:"S",TTC:"F",TTT:"F",TTA:"L",TTG:"L",TAC:"Y",TAT:"Y",TAA:"*",TAG:"*",TGC:"C",TGT:"C",TGA:"*",TGG:"W",CTA:"L",CTC:"L",CTG:"L",CTT:"L",CCA:"P",CCC:"P",CCG:"P",CCT:"P",CAC:"H",CAT:"H",CAA:"Q",CAG:"Q",CGA:"R",CGC:"R",CGG:"R",CGT:"R",ATA:"I",ATC:"I",ATT:"I",ATG:"M",ACA:"T",ACC:"T",ACG:"T",ACT:"T",AAC:"N",AAT:"N",AAA:"K",AAG:"K",AGC:"S",AGT:"S",AGA:"R",AGG:"R",GTA:"V",GTC:"V",GTG:"V",GTT:"V",GCA:"A",GCC:"A",GCG:"A",GCT:"A",GAC:"D",GAT:"D",GAA:"E",GAG:"E",GGA:"G",GGC:"G",GGG:"G",GGT:"G"};function Flr(e){let t={};for(let r of Object.keys(e)){let n=e[r],o=[];for(let i=0;i<3;i++){let a=r.charAt(i);o[i]=[],o[i][0]=a.toUpperCase(),o[i][1]=a.toLowerCase()}for(let i=0;i<2;i++){let a=o[0][i];for(let s=0;s<2;s++){let l=o[1][s];for(let c=0;c<2;c++){let u=o[2][c],d=a+l+u;t[d]=n}}}}return t}async function lde(e,t,r){t(e);let n=await r();return t(""),n}async function Nlr(e,t,r,n){t(e);let o=await n();return(0,znt.checkStopToken)(r),t(""),o}function $nt(e){let t=0;if(e.length===0)return t;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t|=0}return t}function Ulr(e){return`${$nt(JSON.stringify(e))}`}async function Vlr(e,t){return(await Promise.all(e.map(n=>t.blocksForRange(n.refName,n.start,n.end)))).flat().map(n=>({start:n.minv.blockPosition,end:n.maxv.blockPosition+65535})).reduce((n,o)=>n+o.end-o.start,0)}function zlr(e=""){return["Gff3TabixAdapter","VcfTabixAdapter","Gff3Adapter","VcfAdapter"].includes(e)}function qlr(e){return Math.floor(e/1e6)>0?`${G_(e/1e6)}Mbp`:Math.floor(e/1e3)>0?`${G_(e/1e3)}Kbp`:`${Math.floor(e)}bp`}function G_(e){return ME(Number.parseFloat(e.toPrecision(3)))}function jlr(e,t){return Math.floor(t/1e6)>0?`${G_(e/1e6)}/${G_(t/1e6)}Mb`:Math.floor(t/1e3)>0?`${G_(e/1e3)}/${G_(t/1e3)}Kb`:`${G_(e)}/${G_(t)}}bytes`}function ME(e){return e.toLocaleString("en-US")}function Glr(e,t){return Math.floor(t/1e3)>0?`${ME(Number.parseFloat((e/1e6).toFixed(2)))}M`:ME(Math.floor(e))}function Hlr(e,t){let{dynamicBlocks:r,staticBlocks:n,offsetPx:o}=jnt(e),i=r?.contentBlocks[0]||{},a=n?.contentBlocks[0]||{},s=n?.contentBlocks[1]||{};return{offsetPx:t?0:o-a.offsetPx,offsetPx1:t?0:o-s.offsetPx,start:i.start,end:i.end}}function Wlr({sessionId:e,layoutId:t}){return`${e}-${t}`}function Klr(e,t){let[r,n]=(0,Uw.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.error(i),t}});return[r,i=>{try{let a=i instanceof Function?i(r):i;n(a),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(a))}catch(a){console.error(a)}}]}function Qnt(e){let{uri:t,baseUri:r=""}=e,n;try{n=new URL(t,r).href}catch{n=t}return n}function Jnt(e){return sot(e)?(0,TO.isUriLocation)(e)?Qnt(e):JSON.stringify(e):String(e)}function eot(e){return e.replaceAll(/(<([^>]+)>)/gi,"")}function Ylr(e){let t=/(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[-A-Z0-9+\u0026\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\u0026@#/%=~()_|])/gi;return e.replaceAll(t,`$1<a href='$2' target="_blank">$2</a>`)}function Xlr(e,t){let{padding:r=30,minWidth:n=80,fontSize:o=12,maxWidth:i=1e3,stripHTML:a=!1}=t||{};return rot(e.map(s=>Jnt(s)).map(s=>a?eot(s):s).map(s=>Znt(s,o)).map(s=>Math.min(Math.max(s+r,n),i)))}function Zlr(e){return(0,x0.getEnv)(e)}function ude(e){return typeof localStorage<"u"?localStorage.getItem(e):void 0}function tot(e,t){typeof localStorage<"u"&&localStorage.setItem(e,t)}function rot(e,t=Number.NEGATIVE_INFINITY){let r=t;for(let n of e)r=Math.max(n,r);return r}function $lr(e,t=Number.POSITIVE_INFINITY){let r=t;for(let n of e)r=Math.min(n,r);return r}function not(e){let t=0;for(let r of e)t+=r;return t}function Qlr(e){return not(e)/e.length}function Jlr(e,t){let r={};for(let n of e){let o=t(n);r[o]||(r[o]=[]),r[o].push(n)}return r}function ecr(e){return e!=null}function oot(e,t=5e3){if(e.length<=1)return e;let r=[],n=null;e=e.sort((o,i)=>o.start-i.start),r.push(e[0]);for(let o=1;o<e.length;o++)n=r.at(-1),n.end+t<e[o].start-t?r.push(e[o]):n.end<e[o].end&&(n.end=Math.max(n.end,e[o].end),r.pop(),r.push(n));return r}function tcr(e,t=5e3){let r={};for(let n of e)r[n.refName]||(r[n.refName]=[]),r[n.refName].push(n);return Object.values(r).flatMap(n=>oot(n.sort((o,i)=>o.start-i.start),t))}function rcr(e){return(0,cde.colord)(e).alpha(1).toHex()}function ncr(e){if(e){let t=(0,cde.colord)(e);return{strokeOpacity:t.alpha(),stroke:t.alpha(1).toHex()}}else return{}}function ocr(e){if(e){let t=(0,cde.colord)(e);return{fillOpacity:t.alpha(),fill:t.alpha(1).toHex()}}else return{}}function icr(e){let t=document.createElement("div");return(0,ilr.flushSync)(()=>{(0,alr.createRoot)(t).render(e)}),t.innerHTML.replaceAll(/\brgba\((.+?),[^,]+?\)/g,"rgb($1)")}function iot(e){return e[0]===31&&e[1]===139&&e[2]===8}async function aot(e,t={}){let{statusCallback:r=()=>{}}=t,n=await lde("Downloading file",r,()=>e.readFile(t));return iot(n)?await lde("Unzipping",r,()=>(0,nlr.unzip)(n)):n}async function acr(e,t){let r=await aot(e,t);if(r.length>536870888)throw new Error("Data exceeds maximum string length (512MB)");return new TextDecoder("utf8",{fatal:!0}).decode(r)}function sot(e){return typeof e=="object"&&e!==null}function scr(e,t){var r;return+((r=ude(e))!==null&&r!==void 0?r:t)}function lcr(e,t){return!!JSON.parse(ude(e)||JSON.stringify(t))}function ccr(e,t){tot(e,JSON.stringify(t))}function ucr(e,t,r,n=400){let o=performance.now(),i=0;for(let a of e)performance.now()-o>n&&((0,znt.checkStopToken)(t),o=performance.now()),r(a,i++)}function dcr(e,t,r,n){return t.test(e)&&!r||r===n}var lot=aJe();Object.defineProperty(Ot,"SimpleFeature",{enumerable:!0,get:function(){return Vnt(lot).default}});Object.defineProperty(Ot,"isFeature",{enumerable:!0,get:function(){return lot.isFeature}});var fcr=Uce();Object.defineProperty(Ot,"blobToDataURL",{enumerable:!0,get:function(){return fcr.blobToDataURL}});var mcr=Unt();Object.defineProperty(Ot,"makeAbortableReaction",{enumerable:!0,get:function(){return mcr.makeAbortableReaction}});Vw(nde(),Ot)});var fot=ve(BE=>{"use strict";var PO=BE&&BE.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(BE,"__esModule",{value:!0});BE.MenuItemEndDecoration=dde;var Dl=gn(),Ov=Wr(),pcr=PO(fXe()),hcr=PO(mXe()),gcr=PO(pXe()),ycr=PO(hXe()),vcr=PO(gXe()),C1=Jl(),bcr=Y_(),xcr=_ce(),cot=(0,bcr.makeStyles)()({paper:{position:"fixed",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",top:0,left:0,outline:0},menuItemEndDecoration:{padding:0,margin:0,height:16}});function dde(e){let{classes:t}=cot(),{type:r}=e,n,o;"checked"in e&&({checked:n,disabled:o}=e);let i;switch(r){case"subMenu":{i=(0,Dl.jsx)(pcr.default,{color:"action"});break}case"checkbox":{if(n){let a=o?"inherit":void 0;i=(0,Dl.jsx)(hcr.default,{color:a})}else i=(0,Dl.jsx)(gcr.default,{color:"action"});break}case"radio":{if(n){let a=o?"inherit":void 0;i=(0,Dl.jsx)(ycr.default,{color:a})}else i=(0,Dl.jsx)(vcr.default,{color:"action"});break}}return(0,Dl.jsx)("div",{className:t.menuItemEndDecoration,children:i})}function uot(e){return e.type!=="divider"&&e.type!=="subHeader"&&!e.disabled}function Scr(e,t){let r=e.slice(t+1).findIndex(uot);return r===-1?r:t+1+r}function _cr(e,t){return(0,xcr.findLastIndex)(e.slice(0,t),uot)}var dot=(0,Ov.forwardRef)(function(t,r){let[n,o]=(0,Ov.useState)(),[i,a]=(0,Ov.useState)(),[s,l]=(0,Ov.useState)(!1),[c,u]=(0,Ov.useState)(),[d,f]=(0,Ov.useState)(),m=(0,Ov.useRef)(null),{classes:p}=cot(),{menuItems:h,onMenuItemClick:g,open:y,onClose:b,anchorEl:x,top:C=!1}=t;(0,Ov.useEffect)(()=>{y||(o(void 0),a(void 0))},[y]),(0,Ov.useEffect)(()=>{let D=y&&!!n,E;return D&&!s?E=setTimeout(()=>{l(!0)},300):!D&&s&&(E=setTimeout(()=>{l(!1)},300)),()=>{clearTimeout(E)}},[s,y,n]),(0,Ov.useEffect)(()=>{if(x){let D=x.getBoundingClientRect();d?(D.top!==d.top||D.left+D.width!==d.left)&&f({top:D.top,left:D.left+D.width}):f({top:D.top,left:D.left+D.width})}else d||f({})},[d,x]);let S=h.some(D=>"icon"in D&&D.icon),w={};function A(D){return E=>{g(E,D)}}let T=(0,Dl.jsxs)(Dl.Fragment,{children:[(0,Dl.jsx)(C1.MenuList,{autoFocusItem:y&&!s,dense:!0,children:h.sort((D,E)=>(E.priority||0)-(D.priority||0)).map((D,E)=>{if(D.type==="divider")return(0,Dl.jsx)(C1.Divider,{component:"li"},`divider-${JSON.stringify(D)}-${E}`);if(D.type==="subHeader")return(0,Dl.jsx)(C1.ListSubheader,{children:D.label},`subHeader-${D.label}-${E}`);let I=null,k=null;if(D.icon){let B=D.icon;I=(0,Dl.jsx)(C1.ListItemIcon,{children:(0,Dl.jsx)(B,{})})}"subMenu"in D?k=(0,Dl.jsx)(dde,{type:"subMenu"}):(D.type==="checkbox"||D.type==="radio")&&(k=(0,Dl.jsx)(dde,{type:D.type,checked:D.checked,disabled:D.disabled}));let R="onClick"in D?A(D.onClick):void 0;return(0,Dl.jsxs)(C1.MenuItem,{style:w,selected:E===c,onClick:R,onMouseMove:B=>{B.currentTarget!==document.activeElement&&(B.currentTarget.focus(),u(E)),"subMenu"in D?i!==E&&(o(B.currentTarget),a(E)):(o(void 0),a(void 0))},onKeyDown:B=>{switch(B.key){case"ArrowLeft":case"Escape":{b?.(B,"escapeKeyDown");break}case"ArrowUp":{u(_cr(h,E));break}case"ArrowDown":{let O=Scr(h,E);u(O);break}default:"subMenu"in D&&(B.key==="ArrowRight"||B.key==="Enter")&&(o(B.currentTarget),a(E),l(!0))}},disabled:!!D.disabled,children:[I,(0,Dl.jsx)(C1.ListItemText,{primary:D.label,secondary:D.subLabel,inset:S&&!D.icon}),k]},D.id||String(D.label))})}),h.map((D,E)=>{let I=null;return"subMenu"in D&&(I=(0,Dl.jsx)(dot,{anchorEl:n,open:s&&i===E,onClose:()=>{l(!1),o(void 0)},onMenuItemClick:g,menuItems:D.subMenu},D.id||String(D.label))),I})]});return C?T:(0,Dl.jsx)(C1.Grow,{in:y,style:{transformOrigin:"0 0 0"},ref:r,children:(0,Dl.jsx)(C1.Paper,{elevation:8,ref:m,className:p.paper,style:{...d},children:T})})});function Ccr(e){let{open:t,onClose:r,menuItems:n,onMenuItemClick:o,...i}=e;return(0,Dl.jsx)(C1.Popover,{open:t,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"right",...i.anchorOrigin},transformOrigin:{vertical:"top",horizontal:"left",...i.transformOrigin},...i,children:(0,Dl.jsx)(dot,{open:t,onClose:r,menuItems:n,onMenuItemClick:o,top:!0})})}BE.default=Ccr});var fde=ve(qd=>{"use strict";var wcr=qd&&qd.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Tcr=qd&&qd.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Acr=qd&&qd.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),o=0;o<n.length;o++)n[o]!=="default"&&wcr(r,t,n[o]);return Tcr(r,t),r}})();Object.defineProperty(qd,"__esModule",{value:!0});qd.usePopupState=Icr;qd.bindTrigger=Ecr;qd.bindToggle=Dcr;qd.bindHover=kcr;qd.bindFocus=Mcr;qd.bindPopover=Bcr;qd.bindMenu=Rcr;qd.bindPopper=Ocr;var H_=Wr(),Pcr=Acr(Wr());function Icr(e){let{parentPopupState:t}=e||{},r=Pcr.useId(),[n,o]=(0,H_.useState)(!1),[i,a]=(0,H_.useState)(!1),[s,l]=(0,H_.useState)(),[c,u]=(0,H_.useState)(!1),[d,f]=(0,H_.useState)(!1),[m,p]=(0,H_.useState)(),[h,g]=(0,H_.useState)(),y=(0,H_.useCallback)(w=>{a(!0),l(w)},[]),b=w=>{n?C(w):x(w)},x=w=>{let A=w instanceof Element?void 0:w,T=w instanceof Element?w:w?.currentTarget instanceof Element?w.currentTarget:void 0;if(A?.type!=="touchstart"){if(t){if(!t.isOpen)return;t.childHandle&&t.childHandle.close(),t.setChildHandle({popupId:r,close:C})}o(!0),u(D=>A?.type==="mouseover"||D),f(D=>A?.type==="focus"||D),p(A?.type),i||(A?.currentTarget?l(A.currentTarget):T&&l(T))}},C=w=>{let A=w instanceof Element?void 0:w;A?.type!=="touchstart"&&(h?.close(),t?.setChildHandle(void 0),o(!1),u(!1),f(!1))};return{isOpen:n,anchorEl:s,setAnchorElUsed:i,setAnchorEl:y,popupId:r,open:x,close:C,toggle:b,setOpen:(w,A)=>{w?x(A):C(A)},hovered:c,focused:d,_openEventType:m,childHandle:h,setChildHandle:g}}function Ecr(e){return{onClick:e.open}}function Dcr(e){return{onClick:e.toggle}}function kcr(e){let{open:t}=e;return{onMouseOver:t}}function Mcr(e){let{open:t}=e;return{onFocus:t}}function Bcr({isOpen:e,anchorEl:t,close:r,popupId:n}){return{id:n,anchorEl:t,anchorReference:"anchorEl",open:e,onClose:r}}function Rcr({isOpen:e,anchorEl:t,close:r,popupId:n}){return{id:n,anchorEl:t,anchorReference:"anchorEl",open:e,onClose:r}}function Ocr({isOpen:e,anchorEl:t,popupId:r}){return{id:r,anchorEl:t,open:e}}});var got=ve(EO=>{"use strict";var pot=EO&&EO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EO,"__esModule",{value:!0});var ua=gn(),zw=Wr(),Lcr=pot(uXe()),w1=Jl(),Fcr=pot(dXe()),mot=fot(),IO=fde(),RE=(0,zw.createContext)({parentPopupState:void 0,rootPopupState:void 0});function Ncr({onClick:e,closeAfterItemClick:t,...r}){let{rootPopupState:n,parentPopupState:o}=(0,zw.useContext)(RE);if(!n)throw new Error("must be used inside a CascadingMenu");return(0,ua.jsx)(w1.MenuItem,{...r,onClick:i=>{t&&n.close(),e?.(i)},onMouseOver:()=>{o?.childHandle&&(o.childHandle.close(),o.setChildHandle(void 0))}})}function Ucr({title:e,Icon:t,inset:r,...n}){let{parentPopupState:o}=(0,zw.useContext)(RE),i=(0,IO.usePopupState)({parentPopupState:o}),{onMouseOver:a,...s}=(0,IO.bindHover)(i);return(0,ua.jsxs)(ua.Fragment,{children:[(0,ua.jsxs)(w1.MenuItem,{...(0,IO.bindFocus)(i),...s,onMouseOver:l=>{o?.childHandle&&(o.childHandle.close(),o.setChildHandle(void 0)),a(l)},children:[t?(0,ua.jsx)(w1.ListItemIcon,{children:(0,ua.jsx)(t,{})}):null,(0,ua.jsx)(w1.ListItemText,{primary:e,inset:r}),(0,ua.jsx)(Lcr.default,{})]}),(0,ua.jsx)(Vcr,{...n,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},popupState:i})]})}function Vcr({popupState:e,onMenuItemClick:t,menuItems:r,classes:n,...o}){let{rootPopupState:i}=(0,zw.useContext)(RE),a=(0,zw.useMemo)(()=>({rootPopupState:i||e,parentPopupState:e}),[i,e]);return(0,ua.jsx)(RE.Provider,{value:a,children:(0,ua.jsx)(Fcr.default,{...o,...(0,IO.bindMenu)(e)})})}function zcr({popupState:e,onMenuItemClick:t,menuItems:r,...n}){let{rootPopupState:o}=(0,zw.useContext)(RE),i=(0,zw.useMemo)(()=>({rootPopupState:o||e,parentPopupState:e}),[o,e]);return(0,ua.jsx)(RE.Provider,{value:i,children:(0,ua.jsx)(w1.Menu,{...n,...(0,IO.bindMenu)(e)})})}function qcr({item:e}){return"subMenu"in e?(0,ua.jsx)(mot.MenuItemEndDecoration,{type:"subMenu"}):e.type==="checkbox"||e.type==="radio"?(0,ua.jsx)(mot.MenuItemEndDecoration,{type:e.type,checked:e.checked,disabled:e.disabled}):null}function hot({onMenuItemClick:e,closeAfterItemClick:t,menuItems:r,...n}){let o=r.some(i=>"icon"in i&&i.icon);return(0,ua.jsx)(ua.Fragment,{children:r.toSorted((i,a)=>(a.priority||0)-(i.priority||0)).map((i,a)=>"subMenu"in i?(0,ua.jsx)(Ucr,{title:i.label,Icon:i.icon,inset:o&&!i.icon,onMenuItemClick:e,menuItems:i.subMenu,children:(0,ua.jsx)(hot,{...n,closeAfterItemClick:t,onMenuItemClick:e,menuItems:i.subMenu})},`subMenu-${i.label}-${a}`):i.type==="divider"?(0,ua.jsx)(w1.Divider,{component:"li"},`divider-${JSON.stringify(i)}-${a}`):i.type==="subHeader"?(0,ua.jsx)(w1.ListSubheader,{children:i.label},`subHeader-${i.label}-${a}`):(0,ua.jsxs)(Ncr,{closeAfterItemClick:t,onClick:"onClick"in i?s=>{e(s,i.onClick)}:void 0,disabled:!!i.disabled,children:[i.icon?(0,ua.jsx)(w1.ListItemIcon,{children:(0,ua.jsx)(i.icon,{})}):null," ",(0,ua.jsx)(w1.ListItemText,{primary:i.label,secondary:i.subLabel,inset:o&&!i.icon}),(0,ua.jsx)(jcr,{}),(0,ua.jsx)(qcr,{item:i})]},`${i.label}-${a}`))})}function jcr(){return(0,ua.jsx)("div",{style:{flexGrow:1,minWidth:10}})}function Gcr(e){let{closeAfterItemClick:t=!0,...r}=e;return(0,ua.jsx)(zcr,{...r,children:(0,ua.jsx)(hot,{...r,closeAfterItemClick:t})})}EO.default=Gcr});var yot=ve(DO=>{"use strict";var Hcr=DO&&DO.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(DO,"__esModule",{value:!0});var Q7=gn(),Wcr=Wr(),Kcr=Hcr(got()),Ycr=Jl(),Xcr=_p(),mde=fde(),Zcr=(0,Xcr.observer)(function({children:t,menuItems:r,closeAfterItemClick:n=!0,stopPropagation:o,setOpen:i,onClick:a,...s}){let l=(0,mde.usePopupState)(),{onClick:c,...u}=(0,mde.bindTrigger)(l),{isOpen:d}=l;return(0,Wcr.useEffect)(()=>{i?.(d)},[d,i]),(0,Q7.jsxs)(Q7.Fragment,{children:[(0,Q7.jsx)(Ycr.IconButton,{onClick:f=>{o&&f.stopPropagation(),c(f),a?.()},...u,...s,disabled:r.length===0,children:t}),(0,Q7.jsx)(Kcr.default,{...(0,mde.bindPopover)(l),onMenuItemClick:(f,m)=>{m()},menuItems:r,closeAfterItemClick:n,popupState:l})]})});DO.default=Zcr});var vot,bot,xot=M(()=>{"use client";GT();vot=et(gn(),1),bot=(0,yg.createSvgIcon)((0,vot.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu")});var Sot,J7,_ot=M(()=>{"use client";GT();Sot=et(gn(),1),J7=(0,yg.createSvgIcon)((0,Sot.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility")});var Tot={};ci(Tot,{default:()=>wot});function pde({children:e}){return T1.default.createElement(W_.Typography,{style:{margin:4,marginBottom:12}},e)}function wot({handleClose:e}){return T1.default.createElement(Cot.Dialog,{open:!0,maxWidth:"lg",onClose:e,title:"Protein alignment"},T1.default.createElement(W_.DialogContent,null,T1.default.createElement(pde,null,"This panel shows the computed pairwise alignment of the reference genome sequence to the structure sequence. The structure file (PDB file, mmCIF file, etc) has a stored representation of the e.g. amino acid sequence but the sequence in the structure file can differ from the sequence from the gene on the genome browser"),T1.default.createElement(pde,null,"In order to resolve this, we align the two sequences together (using EMBOSS needle) to get pairwise alignment of the genome's representation of the protein and the structure file's representation of the protein."),T1.default.createElement(pde,null,"If you need a 100% fidelity protein, you can do a folding with e.g. AlphaFold to make sure the structure you are using matches exactly the sequence of the transcript")),T1.default.createElement(W_.DialogActions,null,T1.default.createElement(W_.Button,{onClick:()=>{e()},variant:"contained",color:"primary"},"Close")))}var T1,Cot,W_,Aot=M(()=>{"use strict";T1=et(Wr()),Cot=et(xx()),W_=et(Jl())});function hde({model:e}){return kO.default.createElement(Iot.IconButton,{style:{float:"right"},onClick:()=>{(0,Pot.getSession)(e).queueDialog(t=>[$cr,{handleClose:t}])}},kO.default.createElement(TF,null))}var kO,Pot,Iot,$cr,Eot=M(()=>{"use strict";kO=et(Wr()),Pot=et(Du());JY();Iot=et(Jl()),$cr=(0,kO.lazy)(()=>Promise.resolve().then(()=>(Aot(),Tot)))});var Ra,Dot,kot,Mot,Qcr,Jcr,eur,tur,rur,Bot,Rot=M(()=>{"use strict";Ra=et(Wr()),Dot=et(Jl()),kot=et(_p()),Mot=et(Y_());Eot();ale();Qcr="#f698",Jcr="#33ff19",eur=(0,Mot.makeStyles)()({column:{display:"inline-block",cursor:"pointer"},letter:{display:"block",textAlign:"center"},columnHovered:{display:"inline-block",cursor:"pointer",background:Qcr},columnGapHighlight:{display:"inline-block",cursor:"pointer",background:Jcr},alignmentContainer:{fontSize:9,fontFamily:"monospace",margin:8,paddingBottom:8,overflow:"auto",whiteSpace:"nowrap"}}),tur=Ra.default.memo(Ra.default.forwardRef(function({item:t,index:r,classes:n,isGap:o,showHighlight:i,isHovered:a,onMouseOver:s,onClick:l},c){let u=()=>a?n.columnHovered:o&&i?n.columnGapHighlight:n.column,d=f=>f===" "?Ra.default.createElement(Ra.default.Fragment,null,"\xA0"):f;return Ra.default.createElement("div",{ref:c,className:u(),onMouseOver:()=>{s(r)},onClick:()=>{l(r)}},Ra.default.createElement("span",{className:n.letter},d(t.top)),Ra.default.createElement("span",{className:n.letter},d(t.middle)),Ra.default.createElement("span",{className:n.letter},d(t.bottom)))})),rur=(0,kot.observer)(function({model:e}){let{classes:t}=eur(),{alignmentData:r,pairwiseAlignmentHoverPos:n,pairwiseAlignmentToStructurePosition:o,showHighlight:i}=e,a=(0,Ra.useRef)([]),s=(0,Ra.useRef)(null),l=(0,Ra.useRef)(!1),c=(0,Ra.useMemo)(()=>{let p=new Set;for(let[h,g]of r.entries())g.middle==="|"&&p.add(h);return p},[r]);if((0,Ra.useEffect)(()=>{!l.current&&n!==void 0&&a.current[n]&&a.current[n]?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[n]),r.length===0)return Ra.default.createElement("div",null,"No pairwiseAlignment");let u=(0,Ra.useCallback)(p=>{if(e.setPairwiseAlignmentHoverPos(p),o){let h=o[p];e.setHoveredPosition({structureSeqPos:h}),sj({model:e,structureSeqPos:h})}},[e,o]),d=(0,Ra.useCallback)(p=>{if(o){let h=o[p];aj({model:e,structureSeqPos:h}).catch(g=>{console.error(g)})}},[e,o]),f=(0,Ra.useCallback)(()=>{l.current=!0},[]),m=(0,Ra.useCallback)(()=>{l.current=!1,e.setHoveredPosition(void 0),e.clearHoverGenomeHighlights()},[e]);return Ra.default.createElement("div",null,Ra.default.createElement(hde,{model:e}),Ra.default.createElement(Dot.Typography,null,"Alignment of the protein structure file's sequence with the selected transcript's sequence. Green is the aligned portion"),Ra.default.createElement("div",{ref:s,className:t.alignmentContainer,onMouseEnter:f,onMouseLeave:m},r.map((p,h)=>Ra.default.createElement(tur,{key:h,ref:g=>{a.current[h]=g},item:p,index:h,classes:t,isGap:c.has(h),showHighlight:i,isHovered:h===n,onMouseOver:u,onClick:d}))))}),Bot=rur});var $h,Oot,Lot,eH,nur,our,iur,Fot,Not=M(()=>{"use strict";$h=et(Wr()),Oot=et(xx()),Lot=et(yot());xot();_ot();eH=et(_p());Rot();nur=(0,eH.observer)(function({model:e}){let{structures:t,showAlignment:r}=e;return $h.default.createElement("div",null,$h.default.createElement(iur,{model:e}),r?t.map((n,o)=>{let{pairwiseAlignment:i}=n;return $h.default.createElement("div",{key:o},i?$h.default.createElement(Bot,{key:o,model:n}):$h.default.createElement(Oot.LoadingEllipses,{message:"Loading pairwise alignment"}))}):null)}),our=(0,eH.observer)(function({model:e}){return e.structures.map((t,r)=>{let{clickString:n,hoverString:o}=t;return $h.default.createElement("span",{key:r},[n?`Click: ${n}`:"",o?`Hover: ${o}`:""].join(" "))})}),iur=(0,eH.observer)(function({model:e}){let{showAlignment:t,showHighlight:r,zoomToBaseLevel:n}=e;return $h.default.createElement("div",{style:{display:"flex"}},$h.default.createElement(our,{model:e}),$h.default.createElement("span",{style:{flexGrow:1}}),$h.default.createElement(Lot.default,{menuItems:[{label:"Show pairwise alignment area",type:"checkbox",checked:t,icon:J7,onClick:()=>{e.setShowAlignment(!t)}},{label:"Show pairwise alignment as highlight",type:"checkbox",checked:r,icon:J7,onClick:()=>{e.setShowHighlight(!r)}},{label:"Zoom to base level on click",type:"checkbox",checked:n,icon:J7,onClick:()=>{e.setZoomToBaseLevel(!n)}}]},$h.default.createElement(bot,null)))}),Fot=nur});var Uot,Vot=M(()=>{"use strict";Uot=`
|
|
@@ -10528,7 +10528,7 @@ def Mesh "mesh${this.meshes.length}"
|
|
|
10528
10528
|
}
|
|
10529
10529
|
metersPerUnit = 1
|
|
10530
10530
|
)
|
|
10531
|
-
`,...this.materials,...this.meshes].join(""),o=new Uint8Array(n.length);return A1(o,n),{usdz:await BD(t,{"model.usda":o},!0)}}async getBlob(t){let{usdz:r}=await this.getData(t);return new Blob([r],{type:"model/vnd.usdz+zip"})}constructor(t,r){super(),this.fileExtension="usdz",this.meshes=[],this.materials=[],this.materialMap=new Map;let n=H();H.fromUniformScaling(n,Math.min(1/(r*2),1)),H.translate(n,n,v.create(-(t.min[0]+t.max[0])/2,-t.min[1],-(t.min[2]+t.max[2])/2)),this.centerTransform=n}}});var vde,aH,Zot=M(()=>{or();Cf();hr();_o();yn();Ue();Nf();Got();Wot();Kot();Xot();vde={format:_.Select("glb",[["glb","glTF 2.0 Binary (.glb)"],["stl","Stl (.stl)"],["obj","Wavefront (.obj)"],["usdz","Universal Scene Description (.usdz)"]])},aH=class extends dp{getFilename(){let t=this.plugin.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Model)).map(o=>o.obj.data),r=new Set;return t.forEach(o=>r.add(o.entryId.toUpperCase())),`${So.toArray(r).join("-")||"molstar-model"}`}exportGeometry(){let t=Me.create("Export Geometry",async r=>{var n,o,i;try{let a=(n=this.plugin.canvas3d)===null||n===void 0?void 0:n.getRenderObjects(),s=this.getFilename(),l=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.boundingSphereVisible,c=Ct.fromSphere3D(Ct(),l),u;switch(this.behaviors.params.value.format){case"glb":u=new tH(c);break;case"obj":u=new rH(s,c);break;case"stl":u=new oH(c);break;case"usdz":u=new iH(c,l.radius);break;default:throw new Error("Unsupported format.")}for(let f=0,m=a.length;f<m;++f)await r.update({message:`Exporting object ${f}/${m}`}),await u.add(a[f],(i=this.plugin.canvas3d)===null||i===void 0?void 0:i.webgl,r);return{blob:await u.getBlob(r),filename:s+"."+u.fileExtension}}catch(a){throw this.plugin.log.error("Error during geometry export"),a}});return this.plugin.runTask(t,{useOverlay:!0})}constructor(t){super(),this.plugin=t,this.behaviors={params:this.ev.behavior(_.getDefaultValues(vde))}}}});var K_,sH,$ot=M(()=>{K_=et(gn());es();Vi();Ea();ha();Fd();FV();Zot();sH=class extends Fu{constructor(){super(...arguments),this.save=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry();fI(t.blob,t.filename)}catch(t){console.error(t)}finally{this.setState({busy:!1})}},this.viewInAR=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry(),r=document.createElement("a");r.rel="ar",r.href=URL.createObjectURL(t.blob),r.appendChild(document.createElement("img")),setTimeout(()=>URL.revokeObjectURL(r.href),4e4),setTimeout(()=>r.dispatchEvent(new MouseEvent("click")))}catch(t){console.error(t)}finally{this.setState({busy:!1})}}}get controls(){return this._controls||(this._controls=new aH(this.plugin))}defaultState(){return{header:"Export Geometry",isCollapsed:!0,brand:{accent:"cyan",svg:vxe}}}renderControls(){var t,r,n,o;this.isARSupported===void 0&&(this.isARSupported=!!(!((r=(t=document.createElement("a").relList)===null||t===void 0?void 0:t.supports)===null||r===void 0)&&r.call(t,"ar")));let i=this.controls;return(0,K_.jsxs)(K_.Fragment,{children:[(0,K_.jsx)(xo,{params:vde,values:i.behaviors.params.value,onChangeValues:a=>i.behaviors.params.next(a),isDisabled:this.state.busy}),(0,K_.jsx)(Cr,{icon:z2,onClick:this.save,style:{marginTop:1},disabled:this.state.busy||!(!((n=this.plugin.canvas3d)===null||n===void 0)&&n.reprCount.value),children:"Save"}),this.isARSupported&&i.behaviors.params.value.format==="usdz"&&(0,K_.jsx)(Cr,{icon:yxe,onClick:this.viewInAR,style:{marginTop:1},disabled:this.state.busy||!(!((o=this.plugin.canvas3d)===null||o===void 0)&&o.reprCount.value),children:"View in AR"})]})}componentDidMount(){if(!this.plugin.canvas3d)return;let t=xd(this.controls.behaviors.params,this.plugin.canvas3d.reprCount);this.subscribe(t,()=>{this.state.isCollapsed||this.forceUpdate()})}componentWillUnmount(){var t;super.componentWillUnmount(),(t=this._controls)===null||t===void 0||t.dispose(),this._controls=void 0}}});var bde,Qot=M(()=>{_f();$ot();bde=cn.create({name:"extension-geo-export",category:"misc",display:{name:"Geometry Export"},ctor:class extends cn.Handler{register(){this.ctx.customStructureControls.set("geo-export",sH)}update(){return!1}unregister(){this.ctx.customStructureControls.delete("geo-export")}},params:()=>({})})});function xde({showControls:e}){let t=(0,qw.useRef)(null),[r,n]=(0,qw.useState)(),[o,i]=(0,qw.useState)();return(0,qw.useEffect)(()=>{let a;return(async()=>{try{if(!t.current)return;let s=document.createElement("div");t.current.append(s);let l=yR();a=await Jq({target:s,render:ej,spec:{...yR(),behaviors:[...l.behaviors,qr.Behavior(bde)],layout:{initial:{controlsDisplay:"reactive",showControls:e}}}}),await a.initialized,n(a)}catch(s){console.error(s),i(s)}})(),()=>{a?.unmount()}},[e]),{parentRef:t,error:o,plugin:r}}var qw,a_o,Jot=M(()=>{"use strict";qw=et(Wr());Qot();Wse();Yse();Zse();Kse();a_o={"geo-export":qr.Behavior(bde)}});var tit={};ci(tit,{default:()=>Dur});var Fv,RO,Sde,eit,Iur,Eur,Dur,rit=M(()=>{"use strict";Fv=et(Wr()),RO=et(xx()),Sde=et(_p());Not();Vot();Jot();eit=document.createElement("style");eit.append(Uot);document.head.append(eit);Iur=(0,Sde.observer)(function({model:e}){let{showControls:t}=e,{plugin:r,parentRef:n,error:o}=xde({showControls:t});return(0,Fv.useEffect)(()=>{e.setMolstarPluginContext(r)},[r,e]),o?Fv.default.createElement(RO.ErrorMessage,{error:o}):Fv.default.createElement(Eur,{model:e,parentRef:n})}),Eur=(0,Sde.observer)(function({model:e,parentRef:t}){let{width:r,height:n,error:o}=e;return Fv.default.createElement("div",{style:{background:"#ccc"}},o?Fv.default.createElement(RO.ErrorMessage,{error:o}):null,Fv.default.createElement(Fot,{model:e}),Fv.default.createElement("div",{ref:t,style:{position:"relative",width:r,height:n}}),Fv.default.createElement(RO.ResizeHandle,{style:{height:4,background:"grey"},onDrag:i=>e.setHeight(e.height+i)}))}),Dur=Iur});var uit={};ci(uit,{default:()=>lH});var sit,cH,lit,cit,lH,dit=M(()=>{"use strict";sit=et(JL()),cH=et(Du()),lit=et(eF()),cit=et(tF()),lH=class extends sit.BaseFeatureDataAdapter{static capabilities=["getFeatures","getRefNames"];feats;async loadDataP(){let{features:t}=JSON.parse(await(0,lit.openLocation)(this.getConf("location")).readFile("utf8")),r=this.getConf("scoreField");return t.map(({begin:n,end:o,...i},a)=>({...i,uniqueId:`feat-${a}`,start:+n,end:+o+1,score:r==="population_frequency"?i.populationFrequencies?.[0]?.frequency:r==="variant_impact_score"?i.predictions?.[0]?.score:void 0,description:i.descriptions?.map(s=>s.value).join(","),name:[i.mutatedType?`${i.wildType}->${i.mutatedType}`:`${i.wildType}->del`]}))}async loadData(t={}){return this.feats??=this.loadDataP().catch(r=>{throw this.feats=void 0,r}),this.feats}async getRefNames(t={}){return[]}getFeatures(t,r={}){return(0,cit.ObservableCreate)(async n=>{let{start:o,end:i,refName:a}=t,s=await this.loadData();for(let l of s)(0,cH.doesIntersect2)(l.start,l.end,o,i)&&n.next(new cH.SimpleFeature({...l,refName:a}));n.complete()})}freeResources(){}}});var Bur={};ci(Bur,{default:()=>uH});var mit=et(Ide());var Ede="0.0.10";var Xbe=et(Wr());var jT=et(Wr()),Kbe=et(_p());var Fbe=et(Wr()),Nbe=et(Du()),Ube=et(_p());var Lde=et(Wr()),Fde=et(Du()),Nde=et(_p());var Rde=et(Y_()),Ode=(0,Rde.makeStyles)()({highlight:{height:"100%",background:"rgba(255,255,0,0.2)",border:"1px solid rgba(50,50,0,0.2)",position:"absolute",zIndex:99,textAlign:"center",pointerEvents:"none",overflow:"hidden"},thinborder:{border:"1px solid black"}});var Sit=(0,Nde.observer)(function({assemblyName:t,start:r,end:n,refName:o,model:i}){let{cx:a,classes:s}=Ode(),{assemblyManager:l}=(0,Fde.getSession)(i),{offsetPx:c}=i,d=l.get(t)?.getCanonicalRefName(o)??o,f=i.bpToPx({refName:d,coord:r}),m=i.bpToPx({refName:d,coord:n});if(f&&m){let p=Math.max(Math.abs(m.offsetPx-f.offsetPx),3),h=Math.min(f.offsetPx,m.offsetPx)-c;return Lde.default.createElement("div",{className:a(s.highlight,p<=3?s.thinborder:void 0),style:{left:h,width:p}})}else return null}),jw=Sit;Vm();var Lbe=Object.fromEntries([{name:"alanine",abbreviation:"Ala",singleLetterCode:"A"},{name:"arginine",abbreviation:"Arg",singleLetterCode:"R"},{name:"asparagine",abbreviation:"Asn",singleLetterCode:"N"},{name:"aspartic acid",abbreviation:"Asp",singleLetterCode:"D"},{name:"cysteine",abbreviation:"Cys",singleLetterCode:"C"},{name:"glutamic acid",abbreviation:"Glu",singleLetterCode:"E"},{name:"glutamine",abbreviation:"Gln",singleLetterCode:"Q"},{name:"glycine",abbreviation:"Gly",singleLetterCode:"G"},{name:"histidine",abbreviation:"His",singleLetterCode:"H"},{name:"isoleucine",abbreviation:"Ile",singleLetterCode:"I"},{name:"leucine",abbreviation:"Leu",singleLetterCode:"L"},{name:"lysine",abbreviation:"Lys",singleLetterCode:"K"},{name:"methionine",abbreviation:"Met",singleLetterCode:"M"},{name:"phenylalanine",abbreviation:"Phe",singleLetterCode:"F"},{name:"proline",abbreviation:"Pro",singleLetterCode:"P"},{name:"serine",abbreviation:"Ser",singleLetterCode:"S"},{name:"threonine",abbreviation:"Thr",singleLetterCode:"T"},{name:"tryptophan",abbreviation:"Trp",singleLetterCode:"W"},{name:"tyrosine",abbreviation:"Tyr",singleLetterCode:"Y"},{name:"valine",abbreviation:"Val",singleLetterCode:"V"}].map(e=>[e.abbreviation.toUpperCase(),e]));function YL(e){return!!e&&typeof e=="object"&&"hoverFeature"in e&&"hoverPosition"in e}function XL({structure:e,selectedResidue:t}){return Vo.getStructureSelection(r=>r.struct.generator.atomGroups({"residue-test":r.core.rel.eq([r.struct.atomProperty.macromolecular.label_seq_id(),t]),"group-by":r.struct.atomProperty.macromolecular.residueKey()}),e)}function CY({chain:e,code:t,structureSeqPos:r}){return[r===void 0?"":`Position: ${r+1}`,t?`Letter: ${t} (${Lbe[t]?.singleLetterCode})`:"",e?`Chain: ${e}`:""].filter(n=>!!n).join(", ")}function wY(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[r,+t]).filter(t=>t[0]!==void 0))}var kpt=(0,Ube.observer)(function({model:e}){let t=(0,Nbe.getSession)(e),{views:r,hovered:n}=t;if(YL(n)&&r.some(o=>o.type==="ProteinView")){let{assemblyNames:o}=e,{coord:i,refName:a}=n.hoverPosition;return Fbe.default.createElement(jw,{model:e,start:i-1,end:i,refName:a,assemblyName:o[0]})}return null}),Vbe=kpt;var ZL=et(Wr()),zbe=et(Du()),qbe=et(_p());var Mpt=(0,qbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,zbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?ZL.default.createElement(ZL.default.Fragment,null,o?.structures.map(s=>s.clickGenomeHighlights.map((l,c)=>ZL.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),jbe=Mpt;var $L=et(Wr()),Gbe=et(Du()),Hbe=et(_p());var Bpt=(0,Hbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,Gbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?$L.default.createElement($L.default.Fragment,null,o?.structures.map(s=>s.hoverGenomeHighlights.map((l,c)=>$L.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),Wbe=Bpt;var Rpt=(0,Kbe.observer)(function({model:t}){return jT.default.createElement(jT.default.Fragment,null,jT.default.createElement(jbe,{model:t}),jT.default.createElement(Wbe,{model:t}),jT.default.createElement(Vbe,{model:t}))}),Ybe=Rpt;function TY(e){e.addToExtensionPoint("LinearGenomeView-TracksContainerComponent",(t=[],{model:r})=>[...t,Xbe.default.createElement(Ybe,{key:"highlight_protein_viewer_protein3d",model:r})])}var l1e=et(QL());var Qbe=et(ZD());var Opt=(0,Qbe.ConfigurationSchema)("AlphaFoldConfidenceAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),Jbe=Opt;function AY(e){e.addAdapterType(()=>new l1e.default({name:"AlphaFoldConfidenceAdapter",displayName:"AlphaFoldConfidence adapter",configSchema:Jbe,getAdapterClass:()=>Promise.resolve().then(()=>(s1e(),a1e)).then(t=>t.default)}))}var g1e=et(QL());var c1e=et(ZD());var Lpt=(0,c1e.ConfigurationSchema)("AlphaMissensePathogenicityAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),u1e=Lpt;function PY(e){e.addAdapterType(()=>new g1e.default({name:"AlphaMissensePathogenicityAdapter",displayName:"AlphaMissensePathogenicity adapter",configSchema:u1e,getAdapterClass:()=>Promise.resolve().then(()=>(h1e(),p1e)).then(t=>t.default)}))}var ij=et(Du());GT();var b1e=et(gn(),1),x1e=(0,yg.createSvgIcon)((0,b1e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var xm=et(Wr()),VYe=et(xx()),vR=et(Jl());var Ol=et(Wr()),_F=et(xx()),CF=et(Du()),wF=et(Jl()),axe=et(_p()),sxe=et(Y_());var Ou=et(Wr()),F2=et(Jl());var Sx=et(Wr()),w1e=et(Du()),WT=et(Jl()),T1e=et(Y_());function HT(e){let t=e.get("subfeatures")??[];return t.some(r=>r.get("type")==="CDS"||r.get("type")==="exon")?[e]:t}function C1e(e){return e?.replace(/\.[^./]+$/,"")}function $D(e){return e.get("name")??e.get("id")}function iF(e){return e===void 0?"":e.id()}function ef(e){return e===void 0?"":[e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}function H0(e){return e===void 0?"":[e.get("gene_name")??e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}var Fpt=(0,T1e.makeStyles)()({textAreaFont:{fontFamily:"Courier New",whiteSpace:"pre"},margin:{marginLeft:20}});function QD({structureName:e,structureSequence:t,isoformSequences:r}){let{classes:n}=Fpt(),[o,i]=(0,Sx.useState)(!1),a=Object.fromEntries(Object.entries(r).map(([u,d])=>[u,{...d,seq:d.seq.replaceAll("*","")}])),s=Object.entries(a).find(([u,d])=>t===d.seq),l=`${e||""} (structure residues)`,c=(0,w1e.max)([l.length,...Object.entries(a).map(([u,d])=>ef(d.feature).length)]);return Sx.default.createElement(Sx.default.Fragment,null,Sx.default.createElement(WT.FormControlLabel,{className:n.margin,control:Sx.default.createElement(WT.Checkbox,{onChange:u=>{i(u.target.checked)},checked:o}),label:"Show in FASTA format?"}),Sx.default.createElement(WT.TextField,{variant:"outlined",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,value:o?[`>${l}
|
|
10531
|
+
`,...this.materials,...this.meshes].join(""),o=new Uint8Array(n.length);return A1(o,n),{usdz:await BD(t,{"model.usda":o},!0)}}async getBlob(t){let{usdz:r}=await this.getData(t);return new Blob([r],{type:"model/vnd.usdz+zip"})}constructor(t,r){super(),this.fileExtension="usdz",this.meshes=[],this.materials=[],this.materialMap=new Map;let n=H();H.fromUniformScaling(n,Math.min(1/(r*2),1)),H.translate(n,n,v.create(-(t.min[0]+t.max[0])/2,-t.min[1],-(t.min[2]+t.max[2])/2)),this.centerTransform=n}}});var vde,aH,Zot=M(()=>{or();Cf();hr();_o();yn();Ue();Nf();Got();Wot();Kot();Xot();vde={format:_.Select("glb",[["glb","glTF 2.0 Binary (.glb)"],["stl","Stl (.stl)"],["obj","Wavefront (.obj)"],["usdz","Universal Scene Description (.usdz)"]])},aH=class extends dp{getFilename(){let t=this.plugin.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Model)).map(o=>o.obj.data),r=new Set;return t.forEach(o=>r.add(o.entryId.toUpperCase())),`${So.toArray(r).join("-")||"molstar-model"}`}exportGeometry(){let t=Me.create("Export Geometry",async r=>{var n,o,i;try{let a=(n=this.plugin.canvas3d)===null||n===void 0?void 0:n.getRenderObjects(),s=this.getFilename(),l=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.boundingSphereVisible,c=Ct.fromSphere3D(Ct(),l),u;switch(this.behaviors.params.value.format){case"glb":u=new tH(c);break;case"obj":u=new rH(s,c);break;case"stl":u=new oH(c);break;case"usdz":u=new iH(c,l.radius);break;default:throw new Error("Unsupported format.")}for(let f=0,m=a.length;f<m;++f)await r.update({message:`Exporting object ${f}/${m}`}),await u.add(a[f],(i=this.plugin.canvas3d)===null||i===void 0?void 0:i.webgl,r);return{blob:await u.getBlob(r),filename:s+"."+u.fileExtension}}catch(a){throw this.plugin.log.error("Error during geometry export"),a}});return this.plugin.runTask(t,{useOverlay:!0})}constructor(t){super(),this.plugin=t,this.behaviors={params:this.ev.behavior(_.getDefaultValues(vde))}}}});var K_,sH,$ot=M(()=>{K_=et(gn());es();Vi();Ea();ha();Fd();FV();Zot();sH=class extends Fu{constructor(){super(...arguments),this.save=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry();fI(t.blob,t.filename)}catch(t){console.error(t)}finally{this.setState({busy:!1})}},this.viewInAR=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry(),r=document.createElement("a");r.rel="ar",r.href=URL.createObjectURL(t.blob),r.appendChild(document.createElement("img")),setTimeout(()=>URL.revokeObjectURL(r.href),4e4),setTimeout(()=>r.dispatchEvent(new MouseEvent("click")))}catch(t){console.error(t)}finally{this.setState({busy:!1})}}}get controls(){return this._controls||(this._controls=new aH(this.plugin))}defaultState(){return{header:"Export Geometry",isCollapsed:!0,brand:{accent:"cyan",svg:vxe}}}renderControls(){var t,r,n,o;this.isARSupported===void 0&&(this.isARSupported=!!(!((r=(t=document.createElement("a").relList)===null||t===void 0?void 0:t.supports)===null||r===void 0)&&r.call(t,"ar")));let i=this.controls;return(0,K_.jsxs)(K_.Fragment,{children:[(0,K_.jsx)(xo,{params:vde,values:i.behaviors.params.value,onChangeValues:a=>i.behaviors.params.next(a),isDisabled:this.state.busy}),(0,K_.jsx)(Cr,{icon:z2,onClick:this.save,style:{marginTop:1},disabled:this.state.busy||!(!((n=this.plugin.canvas3d)===null||n===void 0)&&n.reprCount.value),children:"Save"}),this.isARSupported&&i.behaviors.params.value.format==="usdz"&&(0,K_.jsx)(Cr,{icon:yxe,onClick:this.viewInAR,style:{marginTop:1},disabled:this.state.busy||!(!((o=this.plugin.canvas3d)===null||o===void 0)&&o.reprCount.value),children:"View in AR"})]})}componentDidMount(){if(!this.plugin.canvas3d)return;let t=xd(this.controls.behaviors.params,this.plugin.canvas3d.reprCount);this.subscribe(t,()=>{this.state.isCollapsed||this.forceUpdate()})}componentWillUnmount(){var t;super.componentWillUnmount(),(t=this._controls)===null||t===void 0||t.dispose(),this._controls=void 0}}});var bde,Qot=M(()=>{_f();$ot();bde=cn.create({name:"extension-geo-export",category:"misc",display:{name:"Geometry Export"},ctor:class extends cn.Handler{register(){this.ctx.customStructureControls.set("geo-export",sH)}update(){return!1}unregister(){this.ctx.customStructureControls.delete("geo-export")}},params:()=>({})})});function xde({showControls:e}){let t=(0,qw.useRef)(null),[r,n]=(0,qw.useState)(),[o,i]=(0,qw.useState)();return(0,qw.useEffect)(()=>{let a;return(async()=>{try{if(!t.current)return;let s=document.createElement("div");t.current.append(s);let l=yR();a=await Jq({target:s,render:ej,spec:{...yR(),behaviors:[...l.behaviors,qr.Behavior(bde)],layout:{initial:{controlsDisplay:"reactive",showControls:e}}}}),await a.initialized,n(a)}catch(s){console.error(s),i(s)}})(),()=>{a?.unmount()}},[e]),{parentRef:t,error:o,plugin:r}}var qw,a_o,Jot=M(()=>{"use strict";qw=et(Wr());Qot();Wse();Yse();Zse();Kse();a_o={"geo-export":qr.Behavior(bde)}});var tit={};ci(tit,{default:()=>Dur});var Fv,RO,Sde,eit,Iur,Eur,Dur,rit=M(()=>{"use strict";Fv=et(Wr()),RO=et(xx()),Sde=et(_p());Not();Vot();Jot();eit=document.createElement("style");eit.append(Uot);document.head.append(eit);Iur=(0,Sde.observer)(function({model:e}){let{showControls:t}=e,{plugin:r,parentRef:n,error:o}=xde({showControls:t});return(0,Fv.useEffect)(()=>{e.setMolstarPluginContext(r)},[r,e]),o?Fv.default.createElement(RO.ErrorMessage,{error:o}):Fv.default.createElement(Eur,{model:e,parentRef:n})}),Eur=(0,Sde.observer)(function({model:e,parentRef:t}){let{width:r,height:n,error:o}=e;return Fv.default.createElement("div",{style:{background:"#ccc"}},o?Fv.default.createElement(RO.ErrorMessage,{error:o}):null,Fv.default.createElement(Fot,{model:e}),Fv.default.createElement("div",{ref:t,style:{position:"relative",width:r,height:n}}),Fv.default.createElement(RO.ResizeHandle,{style:{height:4,background:"grey"},onDrag:i=>e.setHeight(e.height+i)}))}),Dur=Iur});var uit={};ci(uit,{default:()=>lH});var sit,cH,lit,cit,lH,dit=M(()=>{"use strict";sit=et(JL()),cH=et(Du()),lit=et(eF()),cit=et(tF()),lH=class extends sit.BaseFeatureDataAdapter{static capabilities=["getFeatures","getRefNames"];feats;async loadDataP(){let{features:t}=JSON.parse(await(0,lit.openLocation)(this.getConf("location")).readFile("utf8")),r=this.getConf("scoreField");return t.map(({begin:n,end:o,...i},a)=>({...i,uniqueId:`feat-${a}`,start:+n,end:+o+1,score:r==="population_frequency"?i.populationFrequencies?.[0]?.frequency:r==="variant_impact_score"?i.predictions?.[0]?.score:void 0,description:i.descriptions?.map(s=>s.value).join(","),name:[i.mutatedType?`${i.wildType}->${i.mutatedType}`:`${i.wildType}->del`]}))}async loadData(t={}){return this.feats??=this.loadDataP().catch(r=>{throw this.feats=void 0,r}),this.feats}async getRefNames(t={}){return[]}getFeatures(t,r={}){return(0,cit.ObservableCreate)(async n=>{let{start:o,end:i,refName:a}=t,s=await this.loadData();for(let l of s)(0,cH.doesIntersect2)(l.start,l.end,o,i)&&n.next(new cH.SimpleFeature({...l,refName:a}));n.complete()})}freeResources(){}}});var Bur={};ci(Bur,{default:()=>uH});var mit=et(Ide());var Ede="0.0.11";var Xbe=et(Wr());var jT=et(Wr()),Kbe=et(_p());var Fbe=et(Wr()),Nbe=et(Du()),Ube=et(_p());var Lde=et(Wr()),Fde=et(Du()),Nde=et(_p());var Rde=et(Y_()),Ode=(0,Rde.makeStyles)()({highlight:{height:"100%",background:"rgba(255,255,0,0.2)",border:"1px solid rgba(50,50,0,0.2)",position:"absolute",zIndex:99,textAlign:"center",pointerEvents:"none",overflow:"hidden"},thinborder:{border:"1px solid black"}});var Sit=(0,Nde.observer)(function({assemblyName:t,start:r,end:n,refName:o,model:i}){let{cx:a,classes:s}=Ode(),{assemblyManager:l}=(0,Fde.getSession)(i),{offsetPx:c}=i,d=l.get(t)?.getCanonicalRefName(o)??o,f=i.bpToPx({refName:d,coord:r}),m=i.bpToPx({refName:d,coord:n});if(f&&m){let p=Math.max(Math.abs(m.offsetPx-f.offsetPx),3),h=Math.min(f.offsetPx,m.offsetPx)-c;return Lde.default.createElement("div",{className:a(s.highlight,p<=3?s.thinborder:void 0),style:{left:h,width:p}})}else return null}),jw=Sit;Vm();var Lbe=Object.fromEntries([{name:"alanine",abbreviation:"Ala",singleLetterCode:"A"},{name:"arginine",abbreviation:"Arg",singleLetterCode:"R"},{name:"asparagine",abbreviation:"Asn",singleLetterCode:"N"},{name:"aspartic acid",abbreviation:"Asp",singleLetterCode:"D"},{name:"cysteine",abbreviation:"Cys",singleLetterCode:"C"},{name:"glutamic acid",abbreviation:"Glu",singleLetterCode:"E"},{name:"glutamine",abbreviation:"Gln",singleLetterCode:"Q"},{name:"glycine",abbreviation:"Gly",singleLetterCode:"G"},{name:"histidine",abbreviation:"His",singleLetterCode:"H"},{name:"isoleucine",abbreviation:"Ile",singleLetterCode:"I"},{name:"leucine",abbreviation:"Leu",singleLetterCode:"L"},{name:"lysine",abbreviation:"Lys",singleLetterCode:"K"},{name:"methionine",abbreviation:"Met",singleLetterCode:"M"},{name:"phenylalanine",abbreviation:"Phe",singleLetterCode:"F"},{name:"proline",abbreviation:"Pro",singleLetterCode:"P"},{name:"serine",abbreviation:"Ser",singleLetterCode:"S"},{name:"threonine",abbreviation:"Thr",singleLetterCode:"T"},{name:"tryptophan",abbreviation:"Trp",singleLetterCode:"W"},{name:"tyrosine",abbreviation:"Tyr",singleLetterCode:"Y"},{name:"valine",abbreviation:"Val",singleLetterCode:"V"}].map(e=>[e.abbreviation.toUpperCase(),e]));function YL(e){return!!e&&typeof e=="object"&&"hoverFeature"in e&&"hoverPosition"in e}function XL({structure:e,selectedResidue:t}){return Vo.getStructureSelection(r=>r.struct.generator.atomGroups({"residue-test":r.core.rel.eq([r.struct.atomProperty.macromolecular.label_seq_id(),t]),"group-by":r.struct.atomProperty.macromolecular.residueKey()}),e)}function CY({chain:e,code:t,structureSeqPos:r}){return[r===void 0?"":`Position: ${r+1}`,t?`Letter: ${t} (${Lbe[t]?.singleLetterCode})`:"",e?`Chain: ${e}`:""].filter(n=>!!n).join(", ")}function wY(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[r,+t]).filter(t=>t[0]!==void 0))}var kpt=(0,Ube.observer)(function({model:e}){let t=(0,Nbe.getSession)(e),{views:r,hovered:n}=t;if(YL(n)&&r.some(o=>o.type==="ProteinView")){let{assemblyNames:o}=e,{coord:i,refName:a}=n.hoverPosition;return Fbe.default.createElement(jw,{model:e,start:i-1,end:i,refName:a,assemblyName:o[0]})}return null}),Vbe=kpt;var ZL=et(Wr()),zbe=et(Du()),qbe=et(_p());var Mpt=(0,qbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,zbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?ZL.default.createElement(ZL.default.Fragment,null,o?.structures.map(s=>s.clickGenomeHighlights.map((l,c)=>ZL.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),jbe=Mpt;var $L=et(Wr()),Gbe=et(Du()),Hbe=et(_p());var Bpt=(0,Hbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,Gbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?$L.default.createElement($L.default.Fragment,null,o?.structures.map(s=>s.hoverGenomeHighlights.map((l,c)=>$L.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),Wbe=Bpt;var Rpt=(0,Kbe.observer)(function({model:t}){return jT.default.createElement(jT.default.Fragment,null,jT.default.createElement(jbe,{model:t}),jT.default.createElement(Wbe,{model:t}),jT.default.createElement(Vbe,{model:t}))}),Ybe=Rpt;function TY(e){e.addToExtensionPoint("LinearGenomeView-TracksContainerComponent",(t=[],{model:r})=>[...t,Xbe.default.createElement(Ybe,{key:"highlight_protein_viewer_protein3d",model:r})])}var l1e=et(QL());var Qbe=et(ZD());var Opt=(0,Qbe.ConfigurationSchema)("AlphaFoldConfidenceAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),Jbe=Opt;function AY(e){e.addAdapterType(()=>new l1e.default({name:"AlphaFoldConfidenceAdapter",displayName:"AlphaFoldConfidence adapter",configSchema:Jbe,getAdapterClass:()=>Promise.resolve().then(()=>(s1e(),a1e)).then(t=>t.default)}))}var g1e=et(QL());var c1e=et(ZD());var Lpt=(0,c1e.ConfigurationSchema)("AlphaMissensePathogenicityAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),u1e=Lpt;function PY(e){e.addAdapterType(()=>new g1e.default({name:"AlphaMissensePathogenicityAdapter",displayName:"AlphaMissensePathogenicity adapter",configSchema:u1e,getAdapterClass:()=>Promise.resolve().then(()=>(h1e(),p1e)).then(t=>t.default)}))}var ij=et(Du());GT();var b1e=et(gn(),1),x1e=(0,yg.createSvgIcon)((0,b1e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var xm=et(Wr()),VYe=et(xx()),vR=et(Jl());var Ol=et(Wr()),_F=et(xx()),CF=et(Du()),wF=et(Jl()),axe=et(_p()),sxe=et(Y_());var Ou=et(Wr()),F2=et(Jl());var Sx=et(Wr()),w1e=et(Du()),WT=et(Jl()),T1e=et(Y_());function HT(e){let t=e.get("subfeatures")??[];return t.some(r=>r.get("type")==="CDS"||r.get("type")==="exon")?[e]:t}function C1e(e){return e?.replace(/\.[^./]+$/,"")}function $D(e){return e.get("name")??e.get("id")}function iF(e){return e===void 0?"":e.id()}function ef(e){return e===void 0?"":[e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}function H0(e){return e===void 0?"":[e.get("gene_name")??e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}var Fpt=(0,T1e.makeStyles)()({textAreaFont:{fontFamily:"Courier New",whiteSpace:"pre"},margin:{marginLeft:20}});function QD({structureName:e,structureSequence:t,isoformSequences:r}){let{classes:n}=Fpt(),[o,i]=(0,Sx.useState)(!1),a=Object.fromEntries(Object.entries(r).map(([u,d])=>[u,{...d,seq:d.seq.replaceAll("*","")}])),s=Object.entries(a).find(([u,d])=>t===d.seq),l=`${e||""} (structure residues)`,c=(0,w1e.max)([l.length,...Object.entries(a).map(([u,d])=>ef(d.feature).length)]);return Sx.default.createElement(Sx.default.Fragment,null,Sx.default.createElement(WT.FormControlLabel,{className:n.margin,control:Sx.default.createElement(WT.Checkbox,{onChange:u=>{i(u.target.checked)},checked:o}),label:"Show in FASTA format?"}),Sx.default.createElement(WT.TextField,{variant:"outlined",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,value:o?[`>${l}
|
|
10532
10532
|
${t}`,...Object.values(a).map(({feature:u,seq:d})=>`>${ef(u)}
|
|
10533
10533
|
${d}`)].join(`
|
|
10534
10534
|
`):[`${l.padEnd(c)}${s?"*":" "} ${t}`,s?`${ef(s[1].feature).padEnd(c)}* ${s[1].seq}`:void 0,...Object.entries(a).map(([u,d])=>`${ef(d.feature).padEnd(c)} ${d.seq}`).filter(([u])=>u!==s?.[0])].filter(u=>!!u).join(`
|