@deck.gl/jupyter-widget 9.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -550,7 +550,7 @@ ${n}${o}${t.type.toUpperCase()}: ${t.message}
550
550
  <code style="user-select:text;"><pre>
551
551
  ${n}
552
552
  </pre></code>`,s.style.top="10px",s.style.left="10px",s.style.position="absolute",s.style.zIndex="9999",s.style.width="100%",s.style.textAlign="left",document.body.appendChild(s);let l=document.getElementsByClassName("luma-compiler-log-error");l[0]?.scrollIntoView&&l[0].scrollIntoView(),s.onclick=()=>{let u=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(u)}}},Sp=o3;si(Sp,"defaultProps",{...hn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Gie(t){return n3(t.source).name||t.id||oa(`unnamed ${t.stage}-shader`)}var s3=class extends hn{get[Symbol.toStringTag](){return"Sampler"}constructor(e,r){super(e,r,s3.defaultProps)}},Cp=s3;si(Cp,"defaultProps",{...hn.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var a3=class extends hn{get[Symbol.toStringTag](){return"Framebuffer"}width;height;colorAttachments=[];depthStencilAttachment=null;constructor(e,r={}){super(e,r,a3.defaultProps),this.width=this.props.width,this.height=this.props.height}resize(e){let r=!e;if(e){let[i,n]=Array.isArray(e)?e:[e.width,e.height];r=r||n!==this.height||i!==this.width,this.width=i,this.height=n}r&&(Kt.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map(r=>{if(typeof r=="string"){let i=this.createColorTexture(r);return this.attachResource(i),i.view}return r instanceof bo?r.view:r});let e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){let r=this.createDepthStencilTexture(e);this.attachResource(r),this.depthStencilAttachment=r.view}else e instanceof bo?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e){return this.device.createTexture({id:"color-attachment",usage:bo.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}createDepthStencilTexture(e){return this.device.createTexture({id:"depth-stencil-attachment",usage:bo.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}resizeAttachments(e,r){for(let i=0;i<this.colorAttachments.length;++i)if(this.colorAttachments[i]){let n=this.device._createTexture({...this.colorAttachments[i].props,width:e,height:r});this.destroyAttachedResource(this.colorAttachments[i]),this.colorAttachments[i]=n.view,this.attachResource(n.view)}if(this.depthStencilAttachment){let i=this.device._createTexture({...this.depthStencilAttachment.props,width:e,height:r});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=i.view,this.attachResource(i)}}},yf=a3;si(yf,"defaultProps",{...hn.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var l3=class extends hn{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,r){super(e,r,l3.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(e){throw new Error("Use uniform blocks")}},mh=l3;si(mh,"defaultProps",{...hn.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});var c3=class extends hn{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,r){super(e,r,c3.defaultProps)}},L0=c3;si(L0,"defaultProps",{...hn.defaultProps,framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var u3=class extends hn{get[Symbol.toStringTag](){return"ComputePipeline"}hash="";constructor(e,r){super(e,r,u3.defaultProps)}},em=u3;si(em,"defaultProps",{...hn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});var h3=class extends hn{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,r){super(e,r,h3.defaultProps)}},F0=h3;si(F0,"defaultProps",{...hn.defaultProps,measureExecutionTime:void 0});var f3=class extends hn{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,r){super(e,r,f3.defaultProps)}},N0=f3;si(N0,"defaultProps",{...hn.defaultProps});function QU(t){let[e,r]=qie[t],i=e==="i32"||e==="u32",n=e!=="u32",o=Xie[e]*r,s=Wie(e,r);return{dataType:e,components:r,defaultVertexFormat:s,byteLength:o,integer:i,signed:n}}function Wie(t,e){let r;switch(t){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?r:`${r}x${e}`}var qie={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},Xie={f32:4,f16:2,i32:4,u32:4};function d3(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);let[r,i]=t.split("x"),n=r,o=i?parseInt(i):1,s=X2(n),l={type:n,components:o,byteLength:s.byteLength*o,integer:s.integer,signed:s.signed,normalized:s.normalized};return e&&(l.webglOnly=!0),l}function Z2(t,e){let r={};for(let i of t.attributes)r[i.name]=Yie(t,e,i.name);return r}function $U(t,e,r=16){let i=Z2(t,e),n=new Array(r).fill(null);for(let o of Object.values(i))n[o.location]=o;return n}function Yie(t,e,r){let i=Kie(t,r),n=Zie(e,r);if(!i)return null;let o=QU(i.type),s=n?.vertexFormat||o.defaultVertexFormat,l=d3(s);return{attributeName:n?.attributeName||i.name,bufferName:n?.bufferName||i.name,location:i.location,shaderType:i.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:s,bufferDataType:l.type,bufferComponents:l.components,normalized:l.normalized,integer:o.integer,stepMode:n?.stepMode||i.stepMode,byteOffset:n?.byteOffset||0,byteStride:n?.byteStride||0}}function Kie(t,e){let r=t.attributes.find(i=>i.name===e);return r||Kt.warn(`shader layout attribute "${e}" not present in shader`),r||null}function Zie(t,e){Jie(t);let r=Qie(t,e);return r||(r=$ie(t,e),r)?r:(Kt.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function Jie(t){for(let e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&Kt.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function Qie(t,e){for(let r of t)if(r.format&&r.name===e)return{attributeName:r.name,bufferName:e,stepMode:r.stepMode,vertexFormat:r.format,byteOffset:0,byteStride:r.byteStride||0};return null}function $ie(t,e){for(let r of t){let i=r.byteStride;if(typeof r.byteStride!="number")for(let o of r.attributes||[]){let s=d3(o.format);i+=s.byteLength}let n=r.attributes?.find(o=>o.attribute===e);if(n)return{attributeName:n.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:n.format,byteOffset:n.byteOffset,byteStride:i}}return null}function p3(t,e){let r={...t,attributes:t.attributes.map(i=>({...i}))};for(let i of e?.attributes||[]){let n=r.attributes.find(o=>o.name===i.name);n?(n.type=i.type||n.type,n.stepMode=i.stepMode||n.stepMode):Kt.warn(`shader layout attribute ${i.name} not present in shader`)}return r}var A3=class extends hn{get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,r){super(e,r,A3.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=$U(r.renderPipeline.shaderLayout,r.renderPipeline.bufferLayout,this.maxVertexAttributes)}setConstantWebGL(e,r){throw new Error("constant attributes not supported")}},k0=A3;si(k0,"defaultProps",{...hn.defaultProps,renderPipeline:null});var m3=class extends hn{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,r){super(e,r,m3.defaultProps)}},U0=m3;si(U0,"defaultProps",{...hn.defaultProps,layout:void 0,buffers:{}});var g3=class extends hn{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,r){super(e,r,g3.defaultProps)}},z0=g3;si(z0,"defaultProps",{...hn.defaultProps,type:void 0,count:void 0});var ene={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function ez(t){let e=ene[t];return Yi(t),e}function tz(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var J2;function Q2(t){return(!J2||J2.byteLength<t)&&(J2=new ArrayBuffer(t)),J2}function _3(t,e){let r=Q2(t.BYTES_PER_ELEMENT*e);return new t(r,0,e)}function y3(t){let{target:e,source:r,start:i=0,count:n=1}=t,o=r.length,s=n*o,l=0;for(let u=i;l<o;l++)e[u++]=r[l];for(;l<s;)l<s-l?(e.copyWithin(i+l,i,i+l),l*=2):(e.copyWithin(i+l,i,i+s-l),l=s);return t.target}var rz=1024,$2=class{layout={};byteLength;constructor(e){let r=0;for(let[n,o]of Object.entries(e)){let s=ez(o),{type:l,components:u}=s;r=tz(r,u);let f=r;r+=u,this.layout[n]={type:l,size:u,offset:f}}r+=(4-r%4)%4;let i=r*4;this.byteLength=Math.max(i,rz)}getData(e){let r=Math.max(this.byteLength,rz),i=Q2(r),n={i32:new Int32Array(i),u32:new Uint32Array(i),f32:new Float32Array(i),f16:new Uint16Array(i)};for(let[o,s]of Object.entries(e)){let l=this.layout[o];if(!l){Kt.warn(`Supplied uniform value ${o} not present in uniform block layout`)();continue}let{type:u,size:f,offset:v}=l,T=n[u];if(f===1){if(typeof s!="number"&&typeof s!="boolean"){Kt.warn(`Supplied value for single component uniform ${o} is not a number: ${s}`)();continue}T[v]=Number(s)}else{let E=bp(s);if(!E){Kt.warn(`Supplied value for multi component / array uniform ${o} is not a numeric array: ${s}`)();continue}T.set(E,v)}}return new Uint8Array(i)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function iz(t,e,r=16){if(t!==e)return!1;let i=bp(t);if(!i)return!1;let n=bp(e);if(n&&i.length===n.length){for(let o=0;o<i.length;++o)if(n[o]!==i[o])return!1}return!0}function nz(t){let e=bp(t);return e?e.slice():t}var eT=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(e){if(this.name=e?.name,e?.name&&e?.shaderLayout){let r=e?.shaderLayout.bindings?.find(n=>n.type==="uniform"&&n.name===e?.name);if(!r)throw new Error(e?.name);let i=r;for(let n of i.uniforms||[])this.bindingLayout[n.name]=n}}setUniforms(e){for(let[r,i]of Object.entries(e))this._setUniform(r,i),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${r}=${i}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,r){iz(this.uniforms[e],r)||(this.uniforms[e]=nz(r),this.modifiedUniforms[e]=!0,this.modified=!0)}};var lx=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(e){for(let[r,i]of Object.entries(e)){let n=r,o=new $2(i.uniformTypes||{});this.uniformBufferLayouts.set(n,o);let s=new eT({name:r});s.setUniforms(i.defaultUniforms||{}),this.uniformBlocks.set(n,s)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[r,i]of Object.entries(e))this.uniformBlocks.get(r).setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e).byteLength}getUniformBufferData(e){let r=this.uniformBlocks.get(e).getAllUniforms();return this.uniformBufferLayouts.get(e).getData(r)}createUniformBuffer(e,r,i){i&&this.setUniforms(i);let n=this.getUniformBufferByteLength(r),o=e.createBuffer({usage:Xi.UNIFORM|Xi.COPY_DST,byteLength:n}),s=this.getUniformBufferData(r);return o.write(s),o}getManagedUniformBuffer(e,r){if(!this.uniformBuffers.get(r)){let i=this.getUniformBufferByteLength(r),n=e.createBuffer({usage:Xi.UNIFORM|Xi.COPY_DST,byteLength:i});this.uniformBuffers.set(r,n)}return this.uniformBuffers.get(r)}updateUniformBuffers(){let e=!1;for(let r of this.uniformBlocks.keys()){let i=this.updateUniformBuffer(r);e||=i}return e&&Kt.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let r=this.uniformBlocks.get(e),i=this.uniformBuffers.get(e),n=!1;if(i&&r.needsRedraw){n||=r.needsRedraw;let o=this.getUniformBufferData(e);this.uniformBuffers.get(e).write(o);let l=this.uniformBlocks.get(e).getAllUniforms();Kt.log(4,`Writing to uniform buffer ${String(e)}`,o,l)()}return n}};function tT(t){let e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function cx(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function v3(t,e,r){if(!e||e>4)throw new Error(`size ${e}`);let i=e,n=tT(t);if(n==="uint8"||n==="sint8"){if(i===1||i===3)throw new Error(`size: ${e}`);return r&&(n=n.replace("int","norm")),`${n}x${i}`}if(n==="uint16"||n==="sint16"){if(i===1||i===3)throw new Error(`size: ${e}`);return r&&(n=n.replace("int","norm")),`${n}x${i}`}return i===1?n:`${n}x${i}`}function oz(t){return bp(t)!==null||typeof t=="number"||typeof t=="boolean"}function ux(t){let e={bindings:{},uniforms:{}};return Object.keys(t).forEach(r=>{let i=t[r];oz(i)?e.uniforms[r]=i:e.bindings[r]=i}),e}function x3(t,e,r){let{removedProps:i={},deprecatedProps:n={},replacedProps:o={}}=r;for(let l in i)if(l in e){let f=i[l]?`${t}.${i[l]}`:"N/A";Kt.removed(`${t}.${l}`,f)()}for(let l in n)if(l in e){let u=n[l];Kt.deprecated(`${t}.${l}`,`${t}.${u}`)()}let s=null;for(let[l,u]of Object.entries(o))l in e&&(Kt.deprecated(`${t}.${l}`,`${t}.${u}`)(),s=s||Object.assign({},e),s[u]=e[l],delete s[l]);return s||e}var tne="";async function b3(t,e){return await new Promise((r,i)=>{try{let n=new Image;n.onload=()=>r(n),n.onerror=()=>i(new Error(`Could not load image ${t}.`)),n.crossOrigin=e?.crossOrigin||"anonymous",n.src=t.startsWith("http")?t:tne+t}catch(n){i(n)}})}async function hx(t,e){let r=document.getElementsByTagName("head")[0];if(!r)throw new Error("loadScript");let i=document.createElement("script");return i.setAttribute("type","text/javascript"),i.setAttribute("src",t),e&&(i.id=e),new Promise((n,o)=>{i.onload=n,i.onerror=s=>o(new Error(`Unable to load script '${t}': ${s}`)),r.appendChild(i)})}function fx(t,e,r){if(t===e)return!0;if(!r||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!fx(t[i],e[i],r-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){let i=Object.keys(t),n=Object.keys(e);if(i.length!==n.length)return!1;for(let o of i)if(!e.hasOwnProperty(o)||!fx(t[o],e[o],r-1))return!1;return!0}return!1}function w3(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function T3(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var vf;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(vf||(vf={}));var px={[3042]:!1,[32773]:new Float32Array([0,0,0,0]),[32777]:32774,[34877]:32774,[32969]:1,[32968]:0,[32971]:1,[32970]:0,[3106]:new Float32Array([0,0,0,0]),[3107]:[!0,!0,!0,!0],[2884]:!1,[2885]:1029,[2929]:!1,[2931]:1,[2932]:513,[2928]:new Float32Array([0,1]),[2930]:!0,[3024]:!0,[35725]:null,[36006]:null,[36007]:null,[34229]:null,[34964]:null,[2886]:2305,[33170]:4352,[2849]:1,[32823]:!1,[32824]:0,[10752]:0,[32926]:!1,[32928]:!1,[32938]:1,[32939]:!1,[3089]:!1,[3088]:new Int32Array([0,0,1024,1024]),[2960]:!1,[2961]:0,[2968]:4294967295,[36005]:4294967295,[2962]:519,[2967]:0,[2963]:4294967295,[34816]:519,[36003]:0,[36004]:4294967295,[2964]:7680,[2965]:7680,[2966]:7680,[34817]:7680,[34818]:7680,[34819]:7680,[2978]:[0,0,1024,1024],[36389]:null,[36662]:null,[36663]:null,[35053]:null,[35055]:null,[35723]:4352,[36010]:null,[35977]:!1,[3333]:4,[3317]:4,[37440]:!1,[37441]:!1,[37443]:37444,[3330]:0,[3332]:0,[3331]:0,[3314]:0,[32878]:0,[3316]:0,[3315]:0,[32877]:0},ya=(t,e,r)=>e?t.enable(r):t.disable(r),sz=(t,e,r)=>t.hint(r,e),Qc=(t,e,r)=>t.pixelStorei(r,e),az=(t,e,r)=>{let i=r===36006?36009:36008;return t.bindFramebuffer(i,e)},dx=(t,e,r)=>{let n={[34964]:34962,[36662]:36662,[36663]:36663,[35053]:35051,[35055]:35052}[r];t.bindBuffer(n,e)};function E3(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}var lz={[3042]:ya,[32773]:(t,e)=>t.blendColor(...e),[32777]:"blendEquation",[34877]:"blendEquation",[32969]:"blendFunc",[32968]:"blendFunc",[32971]:"blendFunc",[32970]:"blendFunc",[3106]:(t,e)=>t.clearColor(...e),[3107]:(t,e)=>t.colorMask(...e),[2884]:ya,[2885]:(t,e)=>t.cullFace(e),[2929]:ya,[2931]:(t,e)=>t.clearDepth(e),[2932]:(t,e)=>t.depthFunc(e),[2928]:(t,e)=>t.depthRange(...e),[2930]:(t,e)=>t.depthMask(e),[3024]:ya,[35723]:sz,[35725]:(t,e)=>t.useProgram(e),[36007]:(t,e)=>t.bindRenderbuffer(36161,e),[36389]:(t,e)=>t.bindTransformFeedback?.(36386,e),[34229]:(t,e)=>t.bindVertexArray(e),[36006]:az,[36010]:az,[34964]:dx,[36662]:dx,[36663]:dx,[35053]:dx,[35055]:dx,[2886]:(t,e)=>t.frontFace(e),[33170]:sz,[2849]:(t,e)=>t.lineWidth(e),[32823]:ya,[32824]:"polygonOffset",[10752]:"polygonOffset",[35977]:ya,[32926]:ya,[32928]:ya,[32938]:"sampleCoverage",[32939]:"sampleCoverage",[3089]:ya,[3088]:(t,e)=>t.scissor(...e),[2960]:ya,[2961]:(t,e)=>t.clearStencil(e),[2968]:(t,e)=>t.stencilMaskSeparate(1028,e),[36005]:(t,e)=>t.stencilMaskSeparate(1029,e),[2962]:"stencilFuncFront",[2967]:"stencilFuncFront",[2963]:"stencilFuncFront",[34816]:"stencilFuncBack",[36003]:"stencilFuncBack",[36004]:"stencilFuncBack",[2964]:"stencilOpFront",[2965]:"stencilOpFront",[2966]:"stencilOpFront",[34817]:"stencilOpBack",[34818]:"stencilOpBack",[34819]:"stencilOpBack",[2978]:(t,e)=>t.viewport(...e),[34383]:ya,[10754]:ya,[12288]:ya,[12289]:ya,[12290]:ya,[12291]:ya,[12292]:ya,[12293]:ya,[12294]:ya,[12295]:ya,[3333]:Qc,[3317]:Qc,[37440]:Qc,[37441]:Qc,[37443]:Qc,[3330]:Qc,[3332]:Qc,[3331]:Qc,[3314]:Qc,[32878]:Qc,[3316]:Qc,[3315]:Qc,[32877]:Qc,framebuffer:(t,e)=>{let r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{let r=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...r)},blendFunc:(t,e)=>{let r=e?.length===2?[...e,...e]:e;t.blendFuncSeparate(...r)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=E3(e)?e:[e,e];let[r,i]=e;t.stencilMaskSeparate(1028,r),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=E3(e)&&e.length===3?[...e,...e]:e;let[r,i,n,o,s,l]=e;t.stencilFuncSeparate(1028,r,i,n),t.stencilFuncSeparate(1029,o,s,l)},stencilOp:(t,e)=>{e=E3(e)&&e.length===3?[...e,...e]:e;let[r,i,n,o,s,l]=e;t.stencilOpSeparate(1028,r,i,n),t.stencilOpSeparate(1029,o,s,l)},viewport:(t,e)=>t.viewport(...e)};function Ys(t,e,r){return e[t]!==void 0?e[t]:r[t]}var cz={blendEquation:(t,e,r)=>t.blendEquationSeparate(Ys(32777,e,r),Ys(34877,e,r)),blendFunc:(t,e,r)=>t.blendFuncSeparate(Ys(32969,e,r),Ys(32968,e,r),Ys(32971,e,r),Ys(32970,e,r)),polygonOffset:(t,e,r)=>t.polygonOffset(Ys(32824,e,r),Ys(10752,e,r)),sampleCoverage:(t,e,r)=>t.sampleCoverage(Ys(32938,e,r),Ys(32939,e,r)),stencilFuncFront:(t,e,r)=>t.stencilFuncSeparate(1028,Ys(2962,e,r),Ys(2967,e,r),Ys(2963,e,r)),stencilFuncBack:(t,e,r)=>t.stencilFuncSeparate(1029,Ys(34816,e,r),Ys(36003,e,r),Ys(36004,e,r)),stencilOpFront:(t,e,r)=>t.stencilOpSeparate(1028,Ys(2964,e,r),Ys(2965,e,r),Ys(2966,e,r)),stencilOpBack:(t,e,r)=>t.stencilOpSeparate(1029,Ys(34817,e,r),Ys(34818,e,r),Ys(34819,e,r))},S3={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,r)=>t({[e]:r}),hint:(t,e,r)=>t({[e]:r}),useProgram:(t,e)=>t({[35725]:e}),bindRenderbuffer:(t,e,r)=>t({[36007]:r}),bindTransformFeedback:(t,e,r)=>t({[36389]:r}),bindVertexArray:(t,e)=>t({[34229]:e}),bindFramebuffer:(t,e,r)=>{switch(e){case 36160:return t({[36006]:r,[36010]:r});case 36009:return t({[36006]:r});case 36008:return t({[36010]:r});default:return null}},bindBuffer:(t,e,r)=>{let i={[34962]:[34964],[36662]:[36662],[36663]:[36663],[35051]:[35053],[35052]:[35055]}[e];return i?t({[i]:r}):{valueChanged:!0}},blendColor:(t,e,r,i,n)=>t({[32773]:new Float32Array([e,r,i,n])}),blendEquation:(t,e)=>t({[32777]:e,[34877]:e}),blendEquationSeparate:(t,e,r)=>t({[32777]:e,[34877]:r}),blendFunc:(t,e,r)=>t({[32969]:e,[32968]:r,[32971]:e,[32970]:r}),blendFuncSeparate:(t,e,r,i,n)=>t({[32969]:e,[32968]:r,[32971]:i,[32970]:n}),clearColor:(t,e,r,i,n)=>t({[3106]:new Float32Array([e,r,i,n])}),clearDepth:(t,e)=>t({[2931]:e}),clearStencil:(t,e)=>t({[2961]:e}),colorMask:(t,e,r,i,n)=>t({[3107]:[e,r,i,n]}),cullFace:(t,e)=>t({[2885]:e}),depthFunc:(t,e)=>t({[2932]:e}),depthRange:(t,e,r)=>t({[2928]:new Float32Array([e,r])}),depthMask:(t,e)=>t({[2930]:e}),frontFace:(t,e)=>t({[2886]:e}),lineWidth:(t,e)=>t({[2849]:e}),polygonOffset:(t,e,r)=>t({[32824]:e,[10752]:r}),sampleCoverage:(t,e,r)=>t({[32938]:e,[32939]:r}),scissor:(t,e,r,i,n)=>t({[3088]:new Int32Array([e,r,i,n])}),stencilMask:(t,e)=>t({[2968]:e,[36005]:e}),stencilMaskSeparate:(t,e,r)=>t({[e===1028?2968:36005]:r}),stencilFunc:(t,e,r,i)=>t({[2962]:e,[2967]:r,[2963]:i,[34816]:e,[36003]:r,[36004]:i}),stencilFuncSeparate:(t,e,r,i,n)=>t({[e===1028?2962:34816]:r,[e===1028?2967:36003]:i,[e===1028?2963:36004]:n}),stencilOp:(t,e,r,i)=>t({[2964]:e,[2965]:r,[2966]:i,[34817]:e,[34818]:r,[34819]:i}),stencilOpSeparate:(t,e,r,i,n)=>t({[e===1028?2964:34817]:r,[e===1028?2965:34818]:i,[e===1028?2966:34819]:n}),viewport:(t,e,r,i,n)=>t({[2978]:[e,r,i,n]})},xf=(t,e)=>t.isEnabled(e),C3={[3042]:xf,[2884]:xf,[2929]:xf,[3024]:xf,[32823]:xf,[32926]:xf,[32928]:xf,[3089]:xf,[2960]:xf,[35977]:xf},uz=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function Bu(t,e){if(rne(e))return;let r={};for(let n in e){let o=Number(n),s=lz[n];s&&(typeof s=="string"?r[s]=!0:s(t,e[n],o))}let i=t.state&&t.state.cache;if(i)for(let n in r){let o=cz[n];o(t,e,i)}}function rT(t,e=px){if(typeof e=="number"){let n=e,o=C3[n];return o?o(t,n):t.getParameter(n)}let r=Array.isArray(e)?e:Object.keys(e),i={};for(let n of r){let o=C3[n];i[n]=o?o(t,Number(n)):t.getParameter(Number(n))}return i}function hz(t){Bu(t,px)}function rne(t){for(let e in t)return!1;return!0}function fz(t,e){if(t===e)return!0;let r=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&i&&t.length===e.length){for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}return!1}var M3=class{gl;program=null;stateStack=[];enable=!0;cache;log;constructor(e,{copyState:r=!1,log:i=()=>{}}={}){this.gl=e,this.cache=r?rT(e):Object.assign({},px),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Yi(this.stateStack.length>0);let e=this.stateStack[this.stateStack.length-1];Bu(this.gl,e),this.stateStack.pop()}_updateCache(e){let r=!1,i,n=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(let o in e){Yi(o!==void 0);let s=e[o],l=this.cache[o];fz(s,l)||(r=!0,i=l,n&&!(o in n)&&(n[o]=l),this.cache[o]=s)}return{valueChanged:r,oldValue:i}}};function tm(t){return t.state}function I3(t,e){let{enable:r=!0,copyState:i}=e;if(Yi(i!==void 0),!t.state){t.state=new M3(t,{copyState:i}),nne(t);for(let o in S3){let s=S3[o];ine(t,o,s)}dz(t,"getParameter"),dz(t,"isEnabled")}let n=tm(t);return n.enable=r,t}function Mp(t){let e=tm(t);e||(I3(t,{copyState:!1}),e=tm(t)),e.push()}function _d(t){let e=tm(t);Yi(e),e.pop()}function dz(t,e){let r=t[e].bind(t);t[e]=function(n){if(n===void 0||uz.has(n))return r(n);let o=tm(t);return n in o.cache||(o.cache[n]=r(n)),o.enable?o.cache[n]:r(n)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function ine(t,e,r){if(!t[e])return;let i=t[e].bind(t);t[e]=function(...o){let s=tm(t),{valueChanged:l,oldValue:u}=r(s._updateCache,...o);return l&&i(...o),u},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function nne(t){let e=t.useProgram.bind(t);t.useProgram=function(i){let n=tm(t);n.program!==i&&(e(i),n.program=i)}}var one={powerPreference:"high-performance",onContextLost:()=>console.error("WebGL context lost"),onContextRestored:()=>console.info("WebGL context restored")};function pz(t,e){e={...one,...e};let r=null,i=o=>r=o.statusMessage||r;t.addEventListener("webglcontextcreationerror",i,!1);let n=null;if(n||=t.getContext("webgl2",e),t.removeEventListener("webglcontextcreationerror",i,!1),!n)throw new Error(`Failed to create WebGL context: ${r||"Unknown error"}`);if(e.onContextLost){let{onContextLost:o}=e;t.addEventListener("webglcontextlost",s=>o(s),!1)}if(e.onContextRestored){let{onContextRestored:o}=e;t.addEventListener("webglcontextrestored",s=>o(s),!1)}return n}function Ou(t,e,r){return r[e]===void 0&&(r[e]=t.getExtension(e)||null),r[e]}function Az(t,e){let r=t.getParameter(7936),i=t.getParameter(7937);Ou(t,"WEBGL_debug_renderer_info",e);let n=e.WEBGL_debug_renderer_info,o=t.getParameter(n?n.UNMASKED_VENDOR_WEBGL:7936),s=t.getParameter(n?n.UNMASKED_RENDERER_WEBGL:7937),l=o||r,u=s||i,f=t.getParameter(7938),v=mz(l,u),T=sne(l,u),E=ane(l,u);return{type:"webgl",gpu:v,gpuType:E,gpuBackend:T,vendor:l,renderer:u,version:f,shadingLanguage:"glsl",shadingLanguageVersion:300}}function mz(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function sne(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function ane(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(mz(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function iT(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}var Dl="texture-compression-bc",Ho="texture-compression-astc",bf="texture-compression-etc2",lne="texture-compression-etc1-webgl",nT="texture-compression-pvrtc-webgl",P3="texture-compression-atc-webgl",Ax="float32-renderable-webgl",R3="float16-renderable-webgl",cne="rgb9e5ufloat_renderable-webgl",B3="snorm8-renderable-webgl",mx="norm16-renderable-webgl",O3="snorm16-renderable-webgl",oT="float32-filterable",gz="float16-filterable-webgl",gx="WEBGL_compressed_texture_s3tc",_x="WEBGL_compressed_texture_s3tc_srgb",V0="EXT_texture_compression_rgtc",j0="EXT_texture_compression_bptc",une="WEBGL_compressed_texture_etc",hne="WEBGL_compressed_texture_astc",fne="WEBGL_compressed_texture_etc1",dne="WEBGL_compressed_texture_pvrtc",pne="WEBGL_compressed_texture_atc",_z="EXT_texture_norm16",yz="EXT_render_snorm",Ane="EXT_color_buffer_float",sT={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat_renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[yz],"norm16-renderable-webgl":[_z],"snorm16-renderable-webgl":[_z,yz],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[gx,_x,V0,j0],"texture-compression-bc5-webgl":[V0],"texture-compression-bc7-webgl":[j0],"texture-compression-etc2":[une],"texture-compression-astc":[hne],"texture-compression-etc1-webgl":[fne],"texture-compression-pvrtc-webgl":[dne],"texture-compression-atc-webgl":[pne]};function vz(t){return t in sT}function xz(t,e,r){return(sT[e]||[]).every(n=>Ou(t,n,r))}var aT={"rgb8unorm-unsized":{gl:6407,b:4,c:2,bpp:4,dataFormat:6407,types:[5121,33635]},"rgba8unorm-unsized":{gl:6408,b:4,c:2,bpp:4,dataFormat:6408,types:[5121,32819,32820]},r8unorm:{gl:33321,b:1,c:1,rb:!0},r8snorm:{gl:36756,b:1,c:1,render:B3},r8uint:{gl:33330,b:1,c:1,rb:!0},r8sint:{gl:33329,b:1,c:1,rb:!0},rg8unorm:{gl:33323,b:2,c:2,rb:!0},rg8snorm:{gl:36757,b:2,c:2,render:B3},rg8uint:{gl:33336,b:2,c:2,rb:!0},rg8sint:{gl:33335,b:2,c:2,rb:!0},r16uint:{gl:33332,b:2,c:1,rb:!0},r16sint:{gl:33331,b:2,c:1,rb:!0},r16float:{gl:33325,b:2,c:1,render:R3,filter:"float16-filterable-webgl",rb:!0},"r16unorm-webgl":{gl:33322,b:2,c:1,f:mx,rb:!0},"r16snorm-webgl":{gl:36760,b:2,c:1,f:O3},"rgba4unorm-webgl":{gl:32854,b:2,c:4,wgpu:!1,rb:!0},"rgb565unorm-webgl":{gl:36194,b:2,c:4,wgpu:!1,rb:!0},"rgb5a1unorm-webgl":{gl:32855,b:2,c:4,wgpu:!1,rb:!0},"rgb8unorm-webgl":{gl:32849,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:36758,b:3,c:3,wgpu:!1},rgba8unorm:{gl:32856,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:35907,b:4,c:4,bpp:4},rgba8snorm:{gl:36759,b:4,c:4,render:B3},rgba8uint:{gl:36220,b:4,c:4,bpp:4},rgba8sint:{gl:36238,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:33338,b:4,c:1,bpp:4},rg16sint:{gl:33337,b:4,c:2,bpp:4},rg16float:{gl:33327,bpp:4,b:4,c:2,render:R3,filter:gz,rb:!0},"rg16unorm-webgl":{gl:33324,b:2,c:2,render:mx},"rg16snorm-webgl":{gl:36761,b:2,c:2,render:O3},r32uint:{gl:33334,b:4,c:1,bpp:4,rb:!0},r32sint:{gl:33333,b:4,c:1,bpp:4,rb:!0},r32float:{gl:33326,bpp:4,b:4,c:1,render:Ax,filter:oT},rgb9e5ufloat:{gl:35901,b:4,c:3,p:1,render:cne},rg11b10ufloat:{gl:35898,b:4,c:3,p:1,render:Ax,rb:!0},rgb10a2unorm:{gl:32857,b:4,c:4,p:1,rb:!0},"rgb10a2uint-webgl":{b:4,c:4,gl:36975,p:1,wgpu:!1,bpp:4,rb:!0},"rgb16unorm-webgl":{gl:32852,b:2,c:3,f:mx},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:mx},rg32uint:{gl:33340,b:8,c:2,rb:!0},rg32sint:{gl:33339,b:8,c:2,rb:!0},rg32float:{gl:33328,b:8,c:2,render:Ax,filter:oT,rb:!0},rgba16uint:{gl:36214,b:8,c:4,rb:!0},rgba16sint:{gl:36232,b:8,c:4,rb:!0},rgba16float:{gl:34842,b:8,c:4,render:R3,filter:gz},"rgba16unorm-webgl":{gl:32859,b:2,c:4,render:mx,rb:!0},"rgba16snorm-webgl":{gl:36763,b:2,c:4,render:O3},"rgb32float-webgl":{gl:34837,render:Ax,filter:oT,gl2ext:Ane,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,b:16,c:4,rb:!0},rgba32sint:{gl:36226,b:16,c:4,rb:!0},rgba32float:{gl:34836,b:16,c:4,render:Ax,filter:oT,rb:!0},stencil8:{gl:36168,b:1,c:1,attachment:36128,rb:!0},depth16unorm:{gl:33189,b:2,c:1,attachment:36096,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,b:3,c:1,attachment:36096,dataFormat:6402,types:[5125]},depth32float:{gl:36012,b:4,c:1,attachment:36096,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth24unorm-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,dataFormat:34041,types:[34042],rb:!0},"depth32float-stencil8":{gl:36013,b:5,c:2,p:1,attachment:33306,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:gx,f:Dl},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:_x,f:Dl},"bc1-rgba-unorm":{gl:33777,x:gx,f:Dl},"bc1-rgba-unorm-srgb":{gl:35916,x:_x,f:Dl},"bc2-rgba-unorm":{gl:33778,x:gx,f:Dl},"bc2-rgba-unorm-srgb":{gl:35918,x:_x,f:Dl},"bc3-rgba-unorm":{gl:33779,x:gx,f:Dl},"bc3-rgba-unorm-srgb":{gl:35919,x:_x,f:Dl},"bc4-r-unorm":{gl:36283,x:V0,f:Dl},"bc4-r-snorm":{gl:36284,x:V0,f:Dl},"bc5-rg-unorm":{gl:36285,x:V0,f:Dl},"bc5-rg-snorm":{gl:36286,x:V0,f:Dl},"bc6h-rgb-ufloat":{gl:36495,x:j0,f:Dl},"bc6h-rgb-float":{gl:36494,x:j0,f:Dl},"bc7-rgba-unorm":{gl:36492,x:j0,f:Dl},"bc7-rgba-unorm-srgb":{gl:36493,x:j0,f:Dl},"etc2-rgb8unorm":{gl:37492,f:bf},"etc2-rgb8unorm-srgb":{gl:37494,f:bf},"etc2-rgb8a1unorm":{gl:37496,f:bf},"etc2-rgb8a1unorm-srgb":{gl:37497,f:bf},"etc2-rgba8unorm":{gl:37493,f:bf},"etc2-rgba8unorm-srgb":{gl:37495,f:bf},"eac-r11unorm":{gl:37488,f:bf},"eac-r11snorm":{gl:37489,f:bf},"eac-rg11unorm":{gl:37490,f:bf},"eac-rg11snorm":{gl:37491,f:bf},"astc-4x4-unorm":{gl:37808,f:Ho},"astc-4x4-unorm-srgb":{gl:37840,f:Ho},"astc-5x4-unorm":{gl:37809,f:Ho},"astc-5x4-unorm-srgb":{gl:37841,f:Ho},"astc-5x5-unorm":{gl:37810,f:Ho},"astc-5x5-unorm-srgb":{gl:37842,f:Ho},"astc-6x5-unorm":{gl:37811,f:Ho},"astc-6x5-unorm-srgb":{gl:37843,f:Ho},"astc-6x6-unorm":{gl:37812,f:Ho},"astc-6x6-unorm-srgb":{gl:37844,f:Ho},"astc-8x5-unorm":{gl:37813,f:Ho},"astc-8x5-unorm-srgb":{gl:37845,f:Ho},"astc-8x6-unorm":{gl:37814,f:Ho},"astc-8x6-unorm-srgb":{gl:37846,f:Ho},"astc-8x8-unorm":{gl:37815,f:Ho},"astc-8x8-unorm-srgb":{gl:37847,f:Ho},"astc-10x5-unorm":{gl:37819,f:Ho},"astc-10x5-unorm-srgb":{gl:37851,f:Ho},"astc-10x6-unorm":{gl:37817,f:Ho},"astc-10x6-unorm-srgb":{gl:37849,f:Ho},"astc-10x8-unorm":{gl:37818,f:Ho},"astc-10x8-unorm-srgb":{gl:37850,f:Ho},"astc-10x10-unorm":{gl:37819,f:Ho},"astc-10x10-unorm-srgb":{gl:37851,f:Ho},"astc-12x10-unorm":{gl:37820,f:Ho},"astc-12x10-unorm-srgb":{gl:37852,f:Ho},"astc-12x12-unorm":{gl:37821,f:Ho},"astc-12x12-unorm-srgb":{gl:37853,f:Ho},"pvrtc-rgb4unorm-webgl":{gl:35840,f:nT},"pvrtc-rgba4unorm-webgl":{gl:35842,f:nT},"pvrtc-rbg2unorm-webgl":{gl:35841,f:nT},"pvrtc-rgba2unorm-webgl":{gl:35843,f:nT},"etc1-rbg-unorm-webgl":{gl:36196,f:lne},"atc-rgb-unorm-webgl":{gl:35986,f:P3},"atc-rgba-unorm-webgl":{gl:35986,f:P3},"atc-rgbai-unorm-webgl":{gl:34798,f:P3}},mne={[6403]:1,[36244]:1,[33319]:2,[33320]:2,[6407]:3,[36248]:3,[6408]:4,[36249]:4,[6402]:1,[34041]:1,[6406]:1,[6409]:1,[6410]:2},gne={[5126]:4,[5125]:4,[5124]:4,[5123]:2,[5122]:2,[5131]:2,[5120]:1,[5121]:1};function lT(t,e,r){let i=aT[e];if(!i||i.gl===void 0)return!1;let n=i.x||i.gl2ext;return n?Boolean(Ou(t,n,r)):!0}function D3(t){let r=aT[t]?.gl;if(r===void 0)throw new Error(`Unsupported texture format ${t}`);return r}function bz(t,e,r){if(!lT(t,e,r)||e.startsWith("depth")||e.startsWith("stencil"))return!1;try{if(Y2(e).signed)return!1}catch{return!1}return e.endsWith("32float")?Boolean(Ou(t,"OES_texture_float_linear, extensions",r)):e.endsWith("16float")?Boolean(Ou(t,"OES_texture_half_float_linear, extensions",r)):!0}function wz(t,e,r){return!(!lT(t,e,r)||typeof e=="number")}function H0(t){let e=aT[t],r=D3(t),i=Y2(t);return{format:r,dataFormat:e?.dataFormat||_ne(i.format,i.integer,i.normalized,r),type:i.dataType?iT(i.dataType):e?.types?.[0]||5121,compressed:i.compressed}}function Tz(t){let e=aT[t];if(!e?.attachment)throw new Error(`${t} is not a depth stencil format`);return e.attachment}function L3(t){let e=H0(t),r=mne[e.dataFormat]||4,i=gne[e.type]||1;return r*i}function _ne(t,e,r,i){if(i===6408||i===6407)return i;switch(t){case"r":return e&&!r?36244:6403;case"rg":return e&&!r?33320:33319;case"rgb":return e&&!r?36248:6407;case"rgba":return e&&!r?36249:6408;default:return 6408}}var Ez={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"},cT=class extends sx{gl;extensions;testedFeatures=new Set;constructor(e,r,i){super([],i),this.gl=e,this.extensions=r,Ou(e,"EXT_color_buffer_float",r)}*[Symbol.iterator](){let e=this.getFeatures();for(let r of e)this.has(r)&&(yield r);return[]}has(e){return this.disabledFeatures[e]?!1:(this.testedFeatures.has(e)||(this.testedFeatures.add(e),vz(e)&&xz(this.gl,e,this.extensions)&&this.features.add(e),this.getWebGLFeature(e)&&this.features.add(e)),this.features.has(e))}initializeFeatures(){let e=this.getFeatures().filter(r=>r!=="polygon-mode-webgl");for(let r of e)this.has(r)}getFeatures(){return[...Object.keys(Ez),...Object.keys(sT)]}getWebGLFeature(e){let r=Ez[e];return Boolean(typeof r=="string"?Ou(this.gl,r,this.extensions):r)}};var uT=class extends ox{get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}gl;limits={};constructor(e){super(),this.gl=e}getParameter(e){return this.limits[e]===void 0&&(this.limits[e]=this.gl.getParameter(e)),this.limits[e]}};function Du(t,e,r){if(yne(e))return r(t);let{nocatch:i=!0}=e;Mp(t),Bu(t,e);let n;if(i)n=r(t),_d(t);else try{n=r(t)}finally{_d(t)}return n}function yne(t){for(let e in t)return!1;return!0}function Cz(t,e,r,i){if(wp(e))return i(t);let n=t;Mp(n.gl);try{return vne(t,e),Bu(n.gl,r),i(t)}finally{_d(n.gl)}}function vne(t,e){let r=t,{gl:i}=r;if(e.cullMode)switch(e.cullMode){case"none":i.disable(2884);break;case"front":i.enable(2884),i.cullFace(1028);break;case"back":i.enable(2884),i.cullFace(1029);break}if(e.frontFace&&i.frontFace(rm("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&i.enable(34383),e.depthBias!==void 0&&i.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0),t.features.has("provoking-vertex-webgl")){let o=r.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex;if(e.provokingVertex){let s=rm("provokingVertex",e.provokingVertex,{first:36429,last:36430});o?.provokingVertexWEBGL(s)}}if(t.features.has("polygon-mode-webgl")){let o=r.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode;if(e.polygonMode){let s=rm("polygonMode",e.polygonMode,{fill:6914,line:6913});o?.polygonModeWEBGL(1028,s),o?.polygonModeWEBGL(1029,s)}e.polygonOffsetLine&&i.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&i.enable(12288),e.clipDistance1&&i.enable(12289),e.clipDistance2&&i.enable(12290),e.clipDistance3&&i.enable(12291),e.clipDistance4&&i.enable(12292),e.clipDistance5&&i.enable(12293),e.clipDistance6&&i.enable(12294),e.clipDistance7&&i.enable(12295)),e.depthWriteEnabled!==void 0&&i.depthMask(bne("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?i.enable(2929):i.disable(2929),i.depthFunc(fT("depthCompare",e.depthCompare))),e.stencilWriteMask){let n=e.stencilWriteMask;i.stencilMaskSeparate(1028,n),i.stencilMaskSeparate(1029,n)}if(e.stencilReadMask&&Kt.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){let n=e.stencilReadMask||4294967295,o=fT("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?i.enable(2960):i.disable(2960),i.stencilFuncSeparate(1028,o,0,n),i.stencilFuncSeparate(1029,o,0,n)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){let n=F3("stencilPassOperation",e.stencilPassOperation),o=F3("stencilFailOperation",e.stencilFailOperation),s=F3("stencilDepthFailOperation",e.stencilDepthFailOperation);i.stencilOpSeparate(1028,o,s,n),i.stencilOpSeparate(1029,o,s,n)}if(e.blendColorOperation||e.blendAlphaOperation){i.enable(3042);let n=Sz("blendColorOperation",e.blendColorOperation||"add"),o=Sz("blendAlphaOperation",e.blendAlphaOperation||"add");i.blendEquationSeparate(n,o);let s=hT("blendColorSrcFactor",e.blendColorSrcFactor||"one"),l=hT("blendColorDstFactor",e.blendColorDstFactor||"zero"),u=hT("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),f=hT("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");i.blendFuncSeparate(s,l,u,f)}}function fT(t,e){return rm(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function F3(t,e){return rm(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function Sz(t,e){return rm(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function hT(t,e){return rm(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function xne(t,e){return`Illegal parameter ${e} for ${t}`}function rm(t,e,r){if(!(e in r))throw new Error(xne(t,e));return r[e]}function bne(t,e){return e}function dT(t){let e={};return t.addressModeU&&(e[10242]=N3(t.addressModeU)),t.addressModeV&&(e[10243]=N3(t.addressModeV)),t.addressModeW&&(e[32882]=N3(t.addressModeW)),t.magFilter&&(e[10240]=Mz(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=wne(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=fT("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function N3(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Mz(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function wne(t,e){if(!e)return Mz(t);switch(t){case"nearest":return e==="nearest"?9984:9986;case"linear":return e==="nearest"?9985:9987}}var Jl=class extends Xi{device;gl;handle;glTarget;glUsage;glIndexType=5123;byteLength;bytesUsed;constructor(e,r={}){super(e,r),this.device=e,this.gl=this.device.gl;let i=typeof r=="object"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),e.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=Tne(this.props.usage),this.glUsage=Ene(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}_initWithData(e,r=0,i=e.byteLength+r){let n=this.glTarget;this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,this.glUsage),this.gl.bufferSubData(n,r,e),this.gl.bindBuffer(n,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(e,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(e){Yi(e>=0);let r=e;e===0&&(r=new Float32Array(0));let i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=e,this.byteLength=e,this._setDebugData(null,0,e),this.trackAllocatedMemory(e),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(e,r=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,r,e),this.gl.bindBuffer(36663,null),this._setDebugData(e,r,e.byteLength)}async readAsync(e=0,r){return this.readSyncWebGL(e,r)}readSyncWebGL(e=0,r){r=r??this.byteLength-e;let i=new Uint8Array(r),n=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,i,n,r),this.gl.bindBuffer(36662,null),this._setDebugData(i,e,r),i}};function Tne(t){return t&Xi.INDEX?34963:t&Xi.VERTEX?34962:t&Xi.UNIFORM?35345:34962}function Ene(t){return t&Xi.INDEX||t&Xi.VERTEX?35044:t&Xi.UNIFORM?35048:35044}var im=class extends Cp{device;handle;parameters;constructor(e,r){super(e,r),this.device=e,this.parameters=dT(r),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(e){for(let[r,i]of Object.entries(e)){let n=Number(r);switch(n){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,n,i);break;default:this.device.gl.samplerParameteri(this.handle,n,i);break}}}};var gh=class extends Ep{device;gl;handle;texture;constructor(e,r){super(e,{...bo.defaultProps,...r}),this.device=e,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}};var Sne={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},pT=class extends bo{MAX_ATTRIBUTES;device;gl;handle;sampler=void 0;view=void 0;glFormat=void 0;type=void 0;dataFormat=void 0;mipmaps=void 0;target;textureUnit=void 0;loaded=!1;_video;constructor(e,r){super(e,{...Sne,format:"rgba8unorm",...r}),this.device=e,this.gl=this.device.gl,this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glFormat=6408,this.target=Cne(this.props),this.loaded=!1,typeof this.props?.data=="string"&&Object.assign(this.props,{data:b3(this.props.data)}),this.initialize(this.props),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}toString(){return`Texture(${this.id},${this.width}x${this.height})`}createView(e){return new gh(this.device,{...e,texture:this})}initialize(e={}){if(this.props.dimension==="cube")return this.initializeCube(e);let r=e.data;if(r instanceof Promise)return r.then(U=>this.initialize(Object.assign({},e,{pixels:U,data:U}))),this;let i=typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement;if(i&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",()=>this.initialize(e)),this;let{parameters:n={}}=e,{pixels:o=null,pixelStore:s={},textureUnit:l=void 0,mipmaps:u=!0}=e;r||(r=o);let{width:f,height:v,dataFormat:T,type:E,compressed:M=!1}=e,{depth:O=0}=e,F=D3(e.format);return{width:f,height:v,compressed:M,dataFormat:T,type:E}=this._deduceParameters({format:e.format,type:E,dataFormat:T,compressed:M,data:r,width:f,height:v}),this.width=f,this.height=v,this.glFormat=F,this.type=E,this.dataFormat=T,this.textureUnit=l,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),this.mipmaps=u,this.setImageData({data:r,width:f,height:v,depth:O,format:F,type:E,dataFormat:T,parameters:s,compressed:M}),this.setSampler(e.sampler),this._setSamplerParameters(n),this.view=this.createView({...this.props,mipLevelCount:1,arrayLayerCount:1}),u&&this.device.isTextureFormatFilterable(e.format)&&this.generateMipmap(),i&&(this._video={video:r,parameters:n,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}initializeCube(e){let{mipmaps:r=!0,parameters:i={}}=e;return this.setCubeMapImageData(e).then(()=>{this.loaded=!0,r&&this.generateMipmap(e),this.setSampler(e.sampler),this._setSamplerParameters(i)}),this}setSampler(e={}){let r;e instanceof im?(this.sampler=e,r=e.props):(this.sampler=new im(this.device,e),r=e);let i=dT(r);return this._setSamplerParameters(i),this}resize(e){let{height:r,width:i,mipmaps:n=!1}=e;return i!==this.width||r!==this.height?this.initialize({width:i,height:r,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:n}):this}update(){if(this._video){let{video:e,parameters:r,lastTime:i}=this._video;if(i===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}generateMipmap(e={}){return this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Du(this.gl,e,()=>{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this}setImageData(e){if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(e);this.trackDeallocatedMemory("Texture");let{target:r=this.target,pixels:i=null,level:n=0,glFormat:o=this.glFormat,offset:s=0,parameters:l={}}=e,{data:u=null,type:f=this.type,width:v=this.width,height:T=this.height,dataFormat:E=this.dataFormat,compressed:M=!1}=e;u||(u=i),{type:f,dataFormat:E,compressed:M,width:v,height:T}=this._deduceParameters({format:this.props.format,type:f,dataFormat:E,compressed:M,data:u,width:v,height:T});let{gl:O}=this;O.bindTexture(this.target,this.handle);let F=null;if({data:u,dataType:F}=this._getDataType({data:u,compressed:M}),Du(this.gl,l,()=>{switch(F){case"null":O.texImage2D(r,n,o,v,T,0,E,f,u);break;case"typed-array":O.texImage2D(r,n,o,v,T,0,E,f,u,s);break;case"buffer":this.device.gl.bindBuffer(35052,u.handle||u),this.device.gl.texImage2D(r,n,o,v,T,0,E,f,s),this.device.gl.bindBuffer(35052,null);break;case"browser-object":O.texImage2D(r,n,o,v,T,0,E,f,u);break;case"compressed":for(let[U,G]of u.entries())O.compressedTexImage2D(r,U,G.format,G.width,G.height,0,G.data);break;default:Yi(!1,"Unknown image data type")}}),u&&u.byteLength)this.trackAllocatedMemory(u.byteLength,"Texture");else{let U=L3(this.props.format);this.trackAllocatedMemory(this.width*this.height*U,"Texture")}return this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:r=null,data:i=null,x:n=0,y:o=0,width:s=this.width,height:l=this.height,level:u=0,glFormat:f=this.glFormat,type:v=this.type,dataFormat:T=this.dataFormat,compressed:E=!1,offset:M=0,parameters:O={}}){if({type:v,dataFormat:T,compressed:E,width:s,height:l}=this._deduceParameters({format:this.props.format,type:v,dataFormat:T,compressed:E,data:i,width:s,height:l}),Yi(this.depth===1,"texSubImage not supported for 3D textures"),i||(i=r),i&&i.data){let F=i;i=F.data,s=F.shape[0],l=F.shape[1]}i instanceof Jl&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Du(this.gl,O,()=>{E?this.gl.compressedTexSubImage2D(e,u,n,o,s,l,f,i):i===null?this.gl.texSubImage2D(e,u,n,o,s,l,T,v,null):ArrayBuffer.isView(i)?this.gl.texSubImage2D(e,u,n,o,s,l,T,v,i,M):typeof WebGLBuffer<"u"&&i instanceof WebGLBuffer?(this.device.gl.bindBuffer(35052,i),this.device.gl.texSubImage2D(e,u,n,o,s,l,T,v,M),this.device.gl.bindBuffer(35052,null)):this.device.gl.texSubImage2D(e,u,n,o,s,l,T,v,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return Kt.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.target,null),e}_getDataType({data:e,compressed:r=!1}){return r?{data:e,dataType:"compressed"}:e===null?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof Jl?{data:e.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&e instanceof WebGLBuffer?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){let{format:r,data:i}=e,{width:n,height:o,dataFormat:s,type:l,compressed:u}=e,f=H0(r);return s=s||f.dataFormat,l=l||f.type,u=u||f.compressed,{width:n,height:o}=this._deduceImageSize(i,n,o),{dataFormat:s,type:l,compressed:u,width:n,height:o,format:r,data:i}}_deduceImageSize(e,r,i){let n;return typeof ImageData<"u"&&e instanceof ImageData?n={width:e.width,height:e.height}:typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement?n={width:e.naturalWidth,height:e.naturalHeight}:typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement?n={width:e.width,height:e.height}:typeof ImageBitmap<"u"&&e instanceof ImageBitmap?n={width:e.width,height:e.height}:typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?n={width:e.videoWidth,height:e.videoHeight}:e?n={width:r,height:i}:n={width:r>=0?r:1,height:i>=0?i:1},Yi(n,"Could not deduced texture size"),Yi(r===void 0||n.width===r,"Deduced texture width does not match supplied width"),Yi(i===void 0||n.height===i,"Deduced texture height does not match supplied height"),n}async setCubeMapImageData(e){let{gl:r}=this,{width:i,height:n,pixels:o,data:s,format:l=6408,type:u=5121}=e,f=o||s,v=await Promise.all(pT.FACES.map(T=>{let E=f[T];return Promise.all(Array.isArray(E)?E:[E])}));this.bind(),pT.FACES.forEach((T,E)=>{v[E].length>1&&this.props.mipmaps!==!1&&Kt.warn(`${this.id} has mipmap and multiple LODs.`)(),v[E].forEach((M,O)=>{i&&n?r.texImage2D(T,O,l,i,n,0,l,u,M):r.texImage2D(T,O,l,l,u,M)})}),this.unbind()}setImageDataForFace(e){let{face:r,width:i,height:n,pixels:o,data:s,format:l=6408,type:u=5121}=e,{gl:f}=this,v=o||s;return this.bind(),v instanceof Promise?v.then(T=>this.setImageDataForFace(Object.assign({},e,{face:r,data:T,pixels:T}))):this.width||this.height?f.texImage2D(r,0,l,i,n,0,l,u,v):f.texImage2D(r,0,l,l,u,v),this}setImageData3D(e){let{level:r=0,dataFormat:i,format:n,type:o,width:s,height:l,depth:u=1,offset:f=0,data:v,parameters:T={}}=e;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);let E=H0(n);if(Du(this.gl,T,()=>{ArrayBuffer.isView(v)&&this.gl.texImage3D(this.target,r,E.format,s,l,u,0,E.dataFormat,E.type,v),v instanceof Jl&&(this.gl.bindBuffer(35052,v.handle),this.gl.texImage3D(this.target,r,i,s,l,u,0,n,o,f))}),v&&v.byteLength)this.trackAllocatedMemory(v.byteLength,"Texture");else{let M=L3(this.props.format);this.trackAllocatedMemory(this.width*this.height*this.depth*M,"Texture")}return this.loaded=!0,this}_setSamplerParameters(e){if(!wp(e)){Mne(e),this.gl.bindTexture(this.target,this.handle);for(let[r,i]of Object.entries(e)){let n=Number(r),o=i;switch(n){case 33082:case 33083:this.gl.texParameterf(this.target,n,o);break;default:this.gl.texParameteri(this.target,n,o);break}}this.gl.bindTexture(this.target,null)}}},Ql=pT;si(Ql,"FACES",[34069,34070,34071,34072,34073,34074]);function Cne(t){switch(t.dimension){case"2d":return 3553;case"cube":return 34067;case"2d-array":return 35866;case"3d":return 32879;case"1d":case"cube-array":default:throw new Error(t.dimension)}}function Mne(t){Kt.log(1,"texture sampler parameters",t)()}var wf=class extends yf{device;gl;handle;get texture(){return this.colorAttachments[0]}constructor(e,r){super(e,r);let i=r.handle===null;if(this.device=e,this.gl=e.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),!i){e.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures();let n=this.gl.bindFramebuffer(36160,this.handle);for(let o=0;o<this.colorAttachments.length;++o){let s=this.colorAttachments[o],l=36064+o;s&&this._attachOne(l,s)}if(this.depthStencilAttachment&&this._attachOne(Tz(this.depthStencilAttachment.props.format),this.depthStencilAttachment),r.check!==!1){let o=this.gl.checkFramebufferStatus(36160);if(o!==36053)throw new Error(`Framebuffer ${Pne(o)}`)}this.gl.bindFramebuffer(36160,n)}}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}createDepthStencilTexture(e){return new Ql(this.device,{id:`${this.id}-depth-stencil`,format:e,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(e,r){if(this.handle===null)return this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;e===void 0&&(e=this.gl.drawingBufferWidth),r===void 0&&(r=this.gl.drawingBufferHeight);for(let i of this.colorAttachments)i.texture.resize({width:e,height:r});return this.depthStencilAttachment&&this.depthStencilAttachment.texture.resize({width:e,height:r}),this}_attachOne(e,r){if(Array.isArray(r)){let[i,n=0,o=0]=r;return this._attachTexture(e,i,n,o),i}if(r instanceof Ql)return this._attachTexture(e,r,0,0),r;if(r instanceof gh){let i=r;return this._attachTexture(e,i.texture,i.props.baseMipLevel,i.props.baseArrayLayer),r.texture}throw new Error("attach")}_attachTexture(e,r,i,n){let{gl:o}=this.device;switch(o.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:o.framebufferTextureLayer(36160,e,r.target,n,i);break;case 34067:let s=Ine(i);o.framebufferTexture2D(36160,e,s,r.handle,n);break;case 3553:o.framebufferTexture2D(36160,e,3553,r.handle,n);break;default:Yi(!1,"Illegal texture type")}o.bindTexture(r.target,null)}};function Ine(t){return t<34069?t+34069:t}function Pne(t){switch(t){case 36053:return"success";case 36054:return"Mismatched attachments";case 36055:return"No attachments";case 36057:return"Height/width mismatch";case 36061:return"Unsupported or split attachments";case 36182:return"Samples mismatch";default:return`${t}`}}var AT=class extends Tp{device;presentationSize;_framebuffer=null;constructor(e,r){super(r),this.device=e,this.presentationSize=[-1,-1],this._setAutoCreatedCanvasId(`${this.device.id}-canvas`),this.update()}getCurrentFramebuffer(){return this.update(),this._framebuffer=this._framebuffer||new wf(this.device,{handle:null}),this._framebuffer}update(){let e=this.getPixelSize();(e[0]!==this.presentationSize[0]||e[1]!==this.presentationSize[1])&&(this.presentationSize=e,this.resize())}resize(e){if(this.device.gl&&this.canvas){let r=this.getDevicePixelRatio(e?.useDevicePixels);this.setDevicePixelRatio(r,e);return}}commit(){}};var Rne={spector:Kt.get("spector")||Kt.get("inspect")},Bne="https://spectorcdn.babylonjs.com/spector.bundle.js",One=1,Ec=null,Iz=!1;async function Pz(t){if(!globalThis.SPECTOR)try{await hx(Bne)}catch(e){Kt.warn(String(e))}}function Rz(t){if(t={...Rne,...t},!t?.spector||(!Ec&&globalThis.SPECTOR&&(Kt.probe(One,"SPECTOR found and initialized")(),Ec=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=Ec)),!Ec))return null;if(Iz||(Iz=!0,Ec.spyCanvases(),Ec?.onCaptureStarted.add(e=>Kt.info("Spector capture started:",e)()),Ec?.onCapture.add(e=>{Kt.info("Spector capture complete:",e)(),Ec?.getResultUI(),Ec?.resultView.display(),Ec?.resultView.addCapture(e)})),t?.canvas){if(typeof t.spector=="string"&&t.spector!==t.canvas.id)return Ec;Ec?.startCapture(t?.canvas,500),new Promise(e=>setTimeout(e,2e3)).then(e=>{Kt.info("Spector capture stopped after 2 seconds")(),Ec?.stopCapture()})}return Ec}var Dne="https://unpkg.com/webgl-debug@2.0.1/index.js";function Bz(t){return t.luma=t.luma||{},t.luma}async function Oz(){Ol()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await hx(Dne))}function Dz(t,e={}){return t?e.debug?Fne(t,e):Lne(t):null}function Lne(t){let e=Bz(t);return e.realContext?e.realContext:t}function Fne(t,e){if(!globalThis.WebGLDebugUtils)return Kt.warn("webgl-debug not loaded")(),t;let r=Bz(t);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init({...vf,...t});let i=globalThis.WebGLDebugUtils.makeDebugContext(t,Nne.bind(null,e),kne.bind(null,e));for(let s in vf)!(s in i)&&typeof vf[s]=="number"&&(i[s]=vf[s]);class n{}Object.setPrototypeOf(i,Object.getPrototypeOf(t)),Object.setPrototypeOf(n,i);let o=Object.create(n);return r.realContext=t,r.debugContext=o,o.debug=!0,o}function k3(t,e){e=Array.from(e).map(i=>i===void 0?"undefined":i);let r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return r=`${r.slice(0,100)}${r.length>100?"...":""}`,`gl.${t}(${r})`}function Nne(t,e,r,i){i=Array.from(i).map(l=>l===void 0?"undefined":l);let n=globalThis.WebGLDebugUtils.glEnumToString(e),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,i),s=`${n} in gl.${r}(${o})`;Kt.error(s)();debugger;if(t.throwOnError)throw new Error(s)}function kne(t,e,r){let i="";if(Kt.level>=1&&(i=k3(e,r),Kt.log(1,i)()),t.break&&t.break.length>0&&(i=i||k3(e,r),t.break.every(o=>i.indexOf(o)!==-1)))debugger;for(let n of r)if(n===void 0){if(i=i||k3(e,r),t.throwOnError)throw new Error(`Undefined argument: ${i}`);Kt.error(`Undefined argument: ${i}`)();debugger}}function Fz(t){let e=t.split(/\r?\n/),r=[];for(let i of e){if(i.length<=1)continue;let n=i.split(":");if(n.length===2){let[T,E]=n;r.push({message:E.trim(),type:Lz(T),lineNum:0,linePos:0});continue}let[o,s,l,...u]=n,f=parseInt(l,10);isNaN(f)&&(f=0);let v=parseInt(s,10);isNaN(v)&&(v=0),r.push({message:u.join(":").trim(),type:Lz(o),lineNum:f,linePos:v})}return r}function Lz(t){let e=["warning","error","info"],r=t.toLowerCase();return e.includes(r)?r:"info"}var mT=class extends Sp{device;handle;constructor(e,r){switch(super(e,r),this.device=e,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){let e=this.device.gl.getShaderInfoLog(this.handle);return Fz(e)}getTranslatedSource(){return this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders?.getTranslatedShaderSource(this.handle)}async _compile(e){e=(n=>n.startsWith("#version ")?n:`#version 100
553
- ${n}`)(e);let{gl:i}=this.device;if(i.shaderSource(this.handle,e),i.compileShader(this.handle),Kt.level===0){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Kt.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Kt.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}};var Une=256,zne=1024,Vne=16384,U3=6144,jne=[1,2,4,8],gT=class extends L0{device;glParameters;constructor(e,r){super(e,r),this.device=e,Mp(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){_d(this.device.gl),this.props.framebuffer&&Bu(this.device.gl,{framebuffer:null})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){let r={};this.props.framebuffer&&(r.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(r.viewport=e.viewport.slice(0,4),r.depthRange=[e.viewport[4],e.viewport[5]]):r.viewport=e.viewport),e.scissorRect&&(r.scissorTest=!0,r.scissor=e.scissorRect),e.blendConstant&&(r.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),e[2967]=e.stencilReference),e.colorMask&&(r.colorMask=jne.map(i=>Boolean(i&e.colorMask))),this.glParameters=r,Bu(this.device.gl,r)}beginOcclusionQuery(e){this.props.occlusionQuerySet?.beginOcclusionQuery()}endOcclusionQuery(){this.props.occlusionQuerySet?.endOcclusionQuery()}clear(){let e={...this.glParameters},r=0;this.props.clearColor!==!1&&(r|=Vne,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=Une,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=zne,e.clearStencil=this.props.clearStencil),r!==0&&Du(this.device.gl,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(e=0,r=[0,0,0,0]){Du(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int32Array:this.device.gl.clearBufferiv(U3,e,r);break;case Uint32Array:this.device.gl.clearBufferuiv(U3,e,r);break;case Float32Array:default:this.device.gl.clearBufferfv(U3,e,r);break}})}};var Hne="Failed to deduce GL constant from typed array";function Nz(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(Hne)}}function yx(t,e){let{clamped:r=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return r?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var Gne={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Wne={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Ip=class{offset;stride;type;size;divisor;normalized;integer;buffer;index;static getBytesPerElement(e){return yx(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return Yi(e.size),yx(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new Ip(Gne,...e)}constructor(...e){e.forEach(r=>this._assign(r)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Ip.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Ip.getBytesPerVertex(this)}_assign(e={}){return e=x3("Accessor",e,Wne),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}};function kz(t){return qne.includes(t)}var qne=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],Uz={[5126]:[5126,1,"float","f32","float32"],[35664]:[5126,2,"vec2","vec2<f32>","float32x2"],[35665]:[5126,3,"vec3","vec3<f32>","float32x3"],[35666]:[5126,4,"vec4","vec4<f32>","float32x4"],[5124]:[5124,1,"int","i32","sint32"],[35667]:[5124,2,"ivec2","vec2<i32>","sint32x2"],[35668]:[5124,3,"ivec3","vec3<i32>","sint32x3"],[35669]:[5124,4,"ivec4","vec4<i32>","sint32x4"],[5125]:[5125,1,"uint","u32","uint32"],[36294]:[5125,2,"uvec2","vec2<u32>","uint32x2"],[36295]:[5125,3,"uvec3","vec3<u32>","uint32x3"],[36296]:[5125,4,"uvec4","vec4<u32>","uint32x4"],[35670]:[5126,1,"bool","f32","float32"],[35671]:[5126,2,"bvec2","vec2<f32>","float32x2"],[35672]:[5126,3,"bvec3","vec3<f32>","float32x3"],[35673]:[5126,4,"bvec4","vec4<f32>","float32x4"],[35674]:[5126,8,"mat2","mat2x2<f32>"],[35685]:[5126,8,"mat2x3","mat2x3<f32>"],[35686]:[5126,8,"mat2x4","mat2x4<f32>"],[35687]:[5126,12,"mat3x2","mat3x2<f32>"],[35675]:[5126,12,"mat3","mat3x3<f32>"],[35688]:[5126,12,"mat3x4","mat3x4<f32>"],[35689]:[5126,16,"mat4x2","mat4x2<f32>"],[35690]:[5126,16,"mat4x3","mat4x3<f32>"],[35676]:[5126,16,"mat4","mat4x4<f32>"]};function z3(t){let e=Uz[t];if(!e)throw new Error("uniform");let[r,i,,n]=e;return{format:n,components:i,glType:r}}function zz(t){let e=Uz[t];if(!e)throw new Error("attribute");let[,r,,i,n]=e;return{attributeType:i,vertexFormat:n,components:r}}function Vz(t,e){let r={attributes:[],bindings:[]};r.attributes=Xne(t,e);let i=Zne(t,e);for(let l of i){let u=l.uniforms.map(f=>({name:f.name,format:f.format,byteOffset:f.byteOffset,byteStride:f.byteStride,arrayLength:f.arrayLength}));r.bindings.push({type:"uniform",name:l.name,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:u})}let n=Kne(t,e),o=0;for(let l of n)if(kz(l.type)){let{viewDimension:u,sampleType:f}=Qne(l.type);r.bindings.push({type:"texture",name:l.name,location:o,viewDimension:u,sampleType:f}),l.textureUnit=o,o+=1}n.length&&(r.uniforms=n);let s=Yne(t,e);return s?.length&&(r.varyings=s),r}function Xne(t,e){let r=[],i=t.getProgramParameter(e,35721);for(let n=0;n<i;n++){let o=t.getActiveAttrib(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l}=o,u=t.getAttribLocation(e,s);if(u>=0){let{attributeType:f}=zz(l),v=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:u,stepMode:v,type:f})}}return r.sort((n,o)=>n.location-o.location),r}function Yne(t,e){let r=[],i=t.getProgramParameter(e,35971);for(let n=0;n<i;n++){let o=t.getTransformFeedbackVarying(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l,size:u}=o,{glType:f,components:v}=z3(l),T=new Ip({type:f,size:u*v}),E={location:n,name:s,accessor:T};r.push(E)}return r.sort((n,o)=>n.location-o.location),r}function Kne(t,e){let r=[],i=t.getProgramParameter(e,35718);for(let n=0;n<i;n++){let o=t.getActiveUniform(e,n);if(!o)throw new Error("activeInfo");let{name:s,size:l,type:u}=o,{name:f,isArray:v}=$ne(s),T=t.getUniformLocation(e,f),E={location:T,name:f,size:l,type:u,isArray:v};if(r.push(E),E.size>1)for(let M=0;M<E.size;M++){let O=`${f}[${M}]`;T=t.getUniformLocation(e,O);let F={...E,name:O,location:T};r.push(F)}}return r}function Zne(t,e){let r=(o,s)=>t.getActiveUniformBlockParameter(e,o,s),i=[],n=t.getProgramParameter(e,35382);for(let o=0;o<n;o++){let s={name:t.getActiveUniformBlockName(e,o)||"",location:r(o,35391),byteLength:r(o,35392),vertex:r(o,35396),fragment:r(o,35398),uniformCount:r(o,35394),uniforms:[]},l=r(o,35395)||[],u=t.getActiveUniforms(e,l,35383),f=t.getActiveUniforms(e,l,35384),v=t.getActiveUniforms(e,l,35387),T=t.getActiveUniforms(e,l,35388);for(let E=0;E<s.uniformCount;++E){let M=t.getActiveUniform(e,l[E]);if(!M)throw new Error("activeInfo");s.uniforms.push({name:M.name,format:z3(u[E]).format,type:u[E],arrayLength:f[E],byteOffset:v[E],byteStride:T[E]})}i.push(s)}return i.sort((o,s)=>o.location-s.location),i}var Jne={[35678]:["2d","float"],[35680]:["cube","float"],[35679]:["3d","float"],[35682]:["3d","depth"],[36289]:["2d-array","float"],[36292]:["2d-array","depth"],[36293]:["cube","float"],[36298]:["2d","sint"],[36299]:["3d","sint"],[36300]:["cube","sint"],[36303]:["2d-array","uint"],[36306]:["2d","uint"],[36307]:["3d","uint"],[36308]:["cube","uint"],[36311]:["2d-array","uint"]};function Qne(t){let e=Jne[t];if(!e)throw new Error("sampler");let[r,i]=e;return{viewDimension:r,sampleType:i}}function $ne(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};let r=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!r||r.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function jz(t,e,r,i){let n=t,o=i;o===!0&&(o=1),o===!1&&(o=0);let s=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof i!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,i);case 5126:return t.uniform1fv(e,s);case 35664:return t.uniform2fv(e,s);case 35665:return t.uniform3fv(e,s);case 35666:return t.uniform4fv(e,s);case 5124:return t.uniform1iv(e,s);case 35667:return t.uniform2iv(e,s);case 35668:return t.uniform3iv(e,s);case 35669:return t.uniform4iv(e,s);case 35670:return t.uniform1iv(e,s);case 35671:return t.uniform2iv(e,s);case 35672:return t.uniform3iv(e,s);case 35673:return t.uniform4iv(e,s);case 5125:return n.uniform1uiv(e,s,1);case 36294:return n.uniform2uiv(e,s,2);case 36295:return n.uniform3uiv(e,s,3);case 36296:return n.uniform4uiv(e,s,4);case 35674:return t.uniformMatrix2fv(e,!1,s);case 35675:return t.uniformMatrix3fv(e,!1,s);case 35676:return t.uniformMatrix4fv(e,!1,s);case 35685:return n.uniformMatrix2x3fv(e,!1,s);case 35686:return n.uniformMatrix2x4fv(e,!1,s);case 35687:return n.uniformMatrix3x2fv(e,!1,s);case 35688:return n.uniformMatrix3x4fv(e,!1,s);case 35689:return n.uniformMatrix4x2fv(e,!1,s);case 35690:return n.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function Hz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function Gz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}var Wz=4,_T=class extends mh{device;handle;vs;fs;introspectedLayout;uniforms={};bindings={};varyings=null;_uniformCount=0;_uniformSetters={};constructor(e,r){super(e,r),this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;let{varyings:i,bufferMode:n=35981}=r;switch(i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,n)),this._linkShaders(),Kt.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Vz(this.device.gl,this.handle),Kt.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=p3(this.introspectedLayout,r.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":Kt.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break;default:}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e,r){for(let[i,n]of Object.entries(e)){let o=this.shaderLayout.bindings.find(s=>s.name===i)||this.shaderLayout.bindings.find(s=>s.name===`${i}Uniforms`);if(!o){let s=this.shaderLayout.bindings.map(l=>`"${l.name}"`).join(", ");r?.disableWarnings&&Kt.warn(`Unknown binding "${i}" in render pipeline "${this.id}", expected one of ${s}`)();continue}switch(n||Kt.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),o.type){case"uniform":if(!(n instanceof Jl)&&!(n.buffer instanceof Jl))throw new Error("buffer value");break;case"texture":if(!(n instanceof gh||n instanceof Ql||n instanceof wf))throw new Error("texture value");break;case"sampler":Kt.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(o.type)}this.bindings[i]=n}}draw(e){let{renderPass:r,parameters:i=this.props.parameters,topology:n=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:l,firstVertex:u=0,transformFeedback:f}=e,v=Hz(n),T=Boolean(o.indexBuffer),E=o.indexBuffer?.glIndexType,M=Number(l)>0;if(this.linkStatus!=="success")return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable()||s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;if(s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)(),!0;this.device.gl.useProgram(this.handle),o.bindBeforeRender(r),f&&f.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let O=r;return Cz(this.device,i,O.glParameters,()=>{T&&M?this.device.gl.drawElementsInstanced(v,s||0,E,u,l||0):T?this.device.gl.drawElements(v,s||0,E,u):M?this.device.gl.drawArraysInstanced(v,u,s||0,l||0):this.device.gl.drawArrays(v,u,s||0),f&&f.end()}),o.unbindAfterRender(r),!0}setUniformsWebGL(e){let{bindings:r}=ux(e);Object.keys(r).forEach(i=>{Kt.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,e)}async _linkShaders(){let{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),Kt.time(Wz,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),Kt.timeEnd(Wz,`linkProgram for ${this.id}`)(),Kt.level,!this.device.features.has("compilation-status-async-webgl")){let i=this._getLinkStatus();this._reportLinkStatus(i);return}Kt.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Kt.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();let r=this._getLinkStatus();this._reportLinkStatus(r)}_reportLinkStatus(e){switch(e){case"success":return;default:throw this.vs.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`)):this.fs?.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`)):new Error(`Error during ${e}: ${this.device.gl.getProgramInfoLog(this.handle)}`)}}_getLinkStatus(){let{gl:e}=this.device;return e.getProgramParameter(this.handle,35714)?(e.validateProgram(this.handle),e.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(let[,r]of Object.entries(this.bindings))r instanceof Ql&&(r.update(),e=e&&r.loaded);return e}_applyBindings(){if(this.linkStatus!=="success")return;let{gl:e}=this.device;e.useProgram(this.handle);let r=0,i=0;for(let n of this.shaderLayout.bindings){let o=this.bindings[n.name]||this.bindings[n.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${n.name} in ${this.id}`);switch(n.type){case"uniform":let{name:s}=n,l=e.getUniformBlockIndex(this.handle,s);if(l===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,i,l),o instanceof Jl?e.bindBufferBase(35345,i,o.handle):e.bindBufferRange(35345,i,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),i+=1;break;case"texture":if(!(o instanceof gh||o instanceof Ql||o instanceof wf))throw new Error("texture");let u;if(o instanceof gh)u=o.texture;else if(o instanceof Ql)u=o;else if(o instanceof wf&&o.colorAttachments[0]instanceof gh)Kt.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),u=o.colorAttachments[0].texture;else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(u.target,u.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${n.type}' not supported in WebGL`)}}}_applyUniforms(){for(let e of this.shaderLayout.uniforms||[]){let{name:r,location:i,type:n,textureUnit:o}=e,s=this.uniforms[r]??o;s!==void 0&&jz(this.device.gl,i,n,s)}}};var yT=class extends N0{device;commands=[];constructor(e){super(e,{}),this.device=e}submitCommands(e=this.commands){for(let r of e)switch(r.name){case"copy-buffer-to-buffer":eoe(this.device,r.options);break;case"copy-buffer-to-texture":toe(this.device,r.options);break;case"copy-texture-to-buffer":roe(this.device,r.options);break;case"copy-texture-to-texture":ioe(this.device,r.options);break}}};function eoe(t,e){let r=e.source,i=e.destination;t.gl.bindBuffer(36662,r.handle),t.gl.bindBuffer(36663,i.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function toe(t,e){throw new Error("Not implemented")}function roe(t,e){let{source:r,mipLevel:i=0,aspect:n="all",width:o=e.source.width,height:s=e.source.height,depthOrArrayLayers:l=0,origin:u=[0,0],destination:f,byteOffset:v=0,bytesPerRow:T,rowsPerImage:E}=e;if(n!=="all")throw new Error("not supported");if(i!==0||l!==0||T||E)throw new Error("not implemented");let{framebuffer:M,destroyFramebuffer:O}=qz(r),F;try{let U=f,G=o||M.width,J=s||M.height,K=H0(M.texture.props.format),ne=K.dataFormat,ge=K.type;t.gl.bindBuffer(35051,U.handle),F=t.gl.bindFramebuffer(36160,M.handle),t.gl.readPixels(u[0],u[1],G,J,ne,ge,v)}finally{t.gl.bindBuffer(35051,null),F!==void 0&&t.gl.bindFramebuffer(36160,F),O&&M.destroy()}}function ioe(t,e){let{source:r,destinationMipLevel:i=0,origin:n=[0,0],destinationOrigin:o=[0,0],destination:s}=e,{width:l=e.destination.width,height:u=e.destination.height}=e,{framebuffer:f,destroyFramebuffer:v}=qz(r),[T,E]=n,[M,O,F]=o,U=t.gl.bindFramebuffer(36160,f.handle),G=null,J;if(s instanceof Ql)G=s,l=Number.isFinite(l)?l:G.width,u=Number.isFinite(u)?u:G.height,G.bind(0),J=G.target;else throw new Error("invalid destination");switch(J){case 3553:case 34067:t.gl.copyTexSubImage2D(J,i,M,O,T,E,l,u);break;case 35866:case 32879:t.gl.copyTexSubImage3D(J,i,M,O,F,T,E,l,u);break;default:}G&&G.unbind(),t.gl.bindFramebuffer(36160,U),v&&f.destroy()}function qz(t){if(t instanceof bo){let{width:e,height:r,id:i}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${i}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var vT=class extends F0{device;commandBuffer;constructor(e,r){super(e,r),this.device=e,this.commandBuffer=new yT(e)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}resolveQuerySet(e,r,i){}};var G0=class extends k0{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(e){return HP()==="Chrome"}constructor(e,r){super(e,r),this.device=e,this.handle=this.device.gl.createVertexArray()}destroy(){super.destroy(),this.buffer&&this.buffer?.destroy(),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(e){let r=e;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r,this.device.gl.bindVertexArray(null)}setBuffer(e,r){let i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:n,type:o,stride:s,offset:l,normalized:u,integer:f,divisor:v}=this._getAccessor(e);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),f?this.device.gl.vertexAttribIPointer(e,n,o,s,l):this.device.gl.vertexAttribPointer(e,n,o,u,s,l),this.device.gl.enableVertexAttribArray(e),this.device.gl.vertexAttribDivisor(e,v||0),this.attributes[e]=i,this.device.gl.bindVertexArray(null)}setConstantWebGL(e,r){this._enable(e,!1),this.attributes[e]=r}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let e=0;e<this.maxVertexAttributes;++e){let r=this.attributes[e];ArrayBuffer.isView(r)&&this.device.setConstantAttributeWebGL(e,r)}}_getAccessor(e){let r=this.attributeInfos[e];if(!r)throw new Error(`Unknown attribute location ${e}`);let i=iT(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e,r=!0){let n=G0.isConstantAttributeZeroSupported(this.device)||e!==0;(r||n)&&(e=Number(e),this.device.gl.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(e):this.device.gl.disableVertexAttribArray(e),this.device.gl.bindVertexArray(null))}getConstantBuffer(e,r){let i=noe(r),n=i.byteLength*e,o=i.length*e;if(this.buffer&&n!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${n} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:n}),s=s||!ooe(i,this.bufferValue),s){let l=_3(r.constructor,o);y3({target:l,source:i,start:0,count:o}),this.buffer.write(l),this.bufferValue=r}return this.buffer}};function noe(t){return Array.isArray(t)?new Float32Array(t):t}function ooe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var xT=class extends U0{device;gl;handle;layout;buffers={};unusedBuffers={};bindOnUse=!0;_bound=!1;constructor(e,r){super(e,r),this.device=e,this.gl=e.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(e="point-list"){this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(Gz(e))}end(){this.gl.endTransformFeedback(),this.bindOnUse||this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(e){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(let r in e)this.setBuffer(r,e[r])})}setBuffer(e,r){let i=this._getVaryingIndex(e),{buffer:n,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(i<0){this.unusedBuffers[e]=n,Kt.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[i]={buffer:n,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(i,n,s,o)}getBuffer(e){if(Xz(e))return this.buffers[e]||null;let r=this._getVaryingIndex(e);return r>=0?this.buffers[r]:null}bind(e=this.handle){if(typeof e!="function")return this.gl.bindTransformFeedback(36386,e),this;let r;return this._bound?r=e():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=e(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof Jl)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:i=0,byteLength:n=e.buffer.byteLength}=e;return{buffer:r,byteOffset:i,byteLength:n}}_getVaryingIndex(e){if(Xz(e))return Number(e);for(let r of this.layout.varyings)if(e===r.name)return r.location;return-1}_bindBuffers(){for(let e in this.buffers){let{buffer:r,byteLength:i,byteOffset:n}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,n,i)}}_unbindBuffers(){for(let e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r,i=0,n){let o=r&&r.handle;!o||n===void 0?this.gl.bindBufferBase(35982,e,o):this.gl.bindBufferRange(35982,e,o,i,n)}};function Xz(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}var bT=class extends z0{device;handle;target=null;_queryPending=!1;_pollingPromise=null;get[Symbol.toStringTag](){return"Query"}constructor(e,r){if(super(e,r),this.device=e,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(e){return this._begin(e?.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(e){this._queryPending||(this.target=e,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;let e=this.device.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,n)=>{let o=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>e?(n("Timed out"),this._pollingPromise=null):requestAnimationFrame(o)};requestAnimationFrame(o)}),this._pollingPromise}};function V3(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Yi(!1),0}}function Yz(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Yi(!1),0}}function Kz(t,e){let{sourceX:r=0,sourceY:i=0,sourceFormat:n=6408,sourceAttachment:o=36064}=e||{},{target:s=null,sourceWidth:l,sourceHeight:u,sourceType:f}=e||{},{framebuffer:v,deleteFramebuffer:T}=Jz(t);Yi(v);let{gl:E,handle:M}=v;l=l||v.width,u=u||v.height;let O=o-36064;f=f||v.colorAttachments[O]?.texture?.type||5121,s=aoe(s,f,n,l,u),f=f||Nz(s);let F=E.bindFramebuffer(36160,M);return E.readPixels(r,i,l,u,n,f,s),E.bindFramebuffer(36160,F||null),T&&v.destroy(),s}function Zz(t,e){let{target:r,sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:l,sourceHeight:u,sourceType:f}=e||{},{framebuffer:v,deleteFramebuffer:T}=Jz(t);Yi(v),l=l||v.width,u=u||v.height;let E=v;f=f||5121;let M=r;if(!M){let F=V3(o),U=Yz(f),G=s+l*u*F*U;M=E.device.createBuffer({byteLength:G})}let O=t.device.createCommandEncoder();return O.copyTextureToBuffer({source:t,width:l,height:u,origin:[i,n],destination:M,byteOffset:s}),O.destroy(),T&&v.destroy(),M}function Jz(t){return t instanceof yf?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:soe(t),deleteFramebuffer:!0}}function soe(t,e){let{device:r,width:i,height:n,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:i,height:n,colorAttachments:[t]})}function aoe(t,e,r,i,n){if(t)return t;e=e||5121;let o=yx(e,{clamped:!1}),s=V3(r);return new o(i*n*s)}var loe=256,coe=1024,uoe=16384;var hoe="clear: bad arguments";function Qz(t,e){let{framebuffer:r=null,color:i=null,depth:n=null,stencil:o=null}=e||{},s={};r&&(s.framebuffer=r);let l=0;i&&(l|=uoe,i!==!0&&(s.clearColor=i)),n&&(l|=loe,n!==!0&&(s.clearDepth=n)),o&&(l|=coe,n!==!0&&(s.clearStencil=n)),Yi(l!==0,hoe);let u=t.gl;Du(u,s,()=>{u.clear(l)})}var vx=1,W0=class extends wc{type="webgl";handle;features;limits;info;canvasContext;lost;_resolveContextLost;static isSupported(){return typeof WebGL2RenderingContext<"u"}static attach(e){if(e instanceof W0)return e;if(e?.device instanceof wc)return e.device;if(!foe(e))throw new Error("Invalid WebGL2RenderingContext");return new W0({gl:e})}static async create(e={}){Kt.groupCollapsed(vx,"WebGLDevice created")();let r=[];e.debug&&r.push(Oz()),e.spector&&r.push(Pz()),typeof e.canvas=="string"&&r.push(Tp.pageLoaded);let i=await Promise.allSettled(r);for(let s of i)s.status==="rejected"&&Kt.error(`Failed to initialize debug libraries ${s.reason}`)();if(Kt.probe(vx+1,"DOM is loaded")(),e.gl?.device)return Kt.warn("reattaching existing device")(),W0.attach(e.gl);let n=new W0(e),o=`Created ${n.type}${n.debug?" debug":""} context: ${n.info.vendor}, ${n.info.renderer} for canvas: ${n.canvasContext.id}`;return Kt.probe(vx,o)(),Kt.table(vx,n.info)(),Kt.groupEnd(vx)(),n}constructor(e){super({...e,id:e.id||oa("webgl-device")});let r=e.gl?.device;if(r)throw new Error(`WebGL context already attached to device ${r.id}`);let i=e.gl?.canvas||e.canvas;this.canvasContext=new AT(this,{...e,canvas:i}),this.lost=new Promise(l=>{this._resolveContextLost=l});let n=e.gl||null;if(n||=pz(this.canvasContext.canvas,{...e,onContextLost:l=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})}),!n)throw new Error("WebGL context creation failed");this.handle=n,this.gl=n,this.gl.device=this,this.gl._version=2,this.info=Az(this.gl,this._extensions),this.limits=new uT(this.gl),this.features=new cT(this.gl,this._extensions,this.props.disabledFeatures),this.props.initalizeFeatures&&this.features.initializeFeatures(),this.canvasContext.resize();let{enable:o=!0,copyState:s=!1}=e;I3(this.gl,{enable:o,copyState:s,log:(...l)=>Kt.log(1,...l)()}),e.debug&&(this.gl=Dz(this.gl,{...e,throwOnError:!0}),this.debug=!0,Kt.level=Math.max(Kt.level,1),Kt.warn("WebGL debug mode activated. Performance reduced.")()),e.spector&&(this.spectorJS=Rz({...this.props,canvas:this.handle.canvas}))}destroy(){}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(e){return lT(this.gl,e,this._extensions)}isTextureFormatFilterable(e){return bz(this.gl,e,this._extensions)}isTextureFormatRenderable(e){return wz(this.gl,e,this._extensions)}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._getBufferProps(e);return new Jl(this,r)}_createTexture(e){return new Ql(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new im(this,e)}createShader(e){return new mT(this,e)}createFramebuffer(e){return new wf(this,e)}createVertexArray(e){return new G0(this,e)}createTransformFeedback(e){return new xT(this,e)}createQuerySet(e){return new bT(this,e)}createRenderPipeline(e){return new _T(this,e)}beginRenderPass(e){return new gT(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}renderPass=null;createCommandEncoder(e){return new vT(this,e)}submit(){this.renderPass?.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return Kz(e,r)}readPixelsToBufferWebGL(e,r){return Zz(e,r)}setParametersWebGL(e){Bu(this.gl,e)}getParametersWebGL(e){return rT(this.gl,e)}withParametersWebGL(e,r){return Du(this.gl,e,r)}clearWebGL(e){Qz(this,e)}resetWebGL(){Kt.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),hz(this.gl)}gl;debug=!1;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};_extensions={};_polyfilled=!1;spectorJS;loseDevice(){let e=!1,i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(e=!0,i.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),e}pushState(){Mp(this.gl)}popState(){_d(this.gl)}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){r=r||this.gl2||this.gl;let i=Number(e);for(let n in r)if(r[n]===i)return`GL.${n}`;return String(e)}_constants;setConstantAttributeWebGL(e,r){let i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);let n=this._constants[e];switch(n&&moe(n,r)&&Kt.info(1,`setConstantAttributeWebGL(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:doe(this,e,r);break;case Int32Array:poe(this,e,r);break;case Uint32Array:Aoe(this,e,r);break;default:Yi(!1)}}getExtension(e){return Ou(this.gl,e,this._extensions),this._extensions}},Tf=W0;si(Tf,"type","webgl");function foe(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function doe(t,e,r){switch(r.length){case 1:t.gl.vertexAttrib1fv(e,r);break;case 2:t.gl.vertexAttrib2fv(e,r);break;case 3:t.gl.vertexAttrib3fv(e,r);break;case 4:t.gl.vertexAttrib4fv(e,r);break;default:Yi(!1)}}function poe(t,e,r){t.gl.vertexAttribI4iv(e,r)}function Aoe(t,e,r){t.gl.vertexAttribI4uiv(e,r)}function moe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var $z,e5,r5={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function wT(){return document.createElement("div")}function goe(t){if(!t.picked)return null;if(t.object===$z)return e5;let e={html:yoe(t.object),style:r5};return e5=e,$z=t.object,e}var _oe=new Set(["position","index"]);function yoe(t){let e=wT();for(let r in t){if(_oe.has(r))continue;let i=wT();i.className="header",i.textContent=r;let n=wT();n.className="value",n.textContent=xoe(t[r]);let o=wT();voe(o,i,n),o.appendChild(i),o.appendChild(n),e.appendChild(o)}return e.innerHTML}function voe(t,e,r){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(r.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function xoe(t){let e;if(Array.isArray(t)&&t.length>4)e=`Array<${t.length}>`;else if(typeof t=="string")e=t;else if(typeof t=="number")e=String(t);else try{e=JSON.stringify(t)}catch{e="<Non-Serializable Object>"}let r=50;return e.length>r&&(e=e.slice(0,r)),e}function t5(t,e){let r,i=t,n="properties",o=/{[^}]*}/g,s=u=>u.replace(/[{}]/g,""),l=[...new Set(t.match(o).map(s))];for(let u of l){if(u.includes(".")){r=e;let f=u.split(".");for(let v of f)if(r.hasOwnProperty(v))r=r[v];else{r=void 0;break}}else e.hasOwnProperty(u)?r=e[u]:e[n]&&e[n].hasOwnProperty(u)?r=e[n][u]:r=void 0;i=i.replaceAll(`{${u}}`,r)}return i}function j3(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||r5};return t.html?r.html=t5(t.html,e.object):r.text=t5(t.text,e.object),r}:goe:null}function i5(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function n5(t,e){let r=document.createElement("div");return r.style.width=Number.isFinite(t)?`${t}px`:t,r.style.height=`${e}px`,r.style.position="relative",r}var s5=ga(o5()),boe="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",W3=s5.default;function a5(t=boe){i5(t)}function l5(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var q3={};function c5(t){if(!q3[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),q3[t]=new Promise(i=>{e.onload=i})}return q3[t]}var u5="4.1.4";var X3,woe=(X3=globalThis.loaders)===null||X3===void 0?void 0:X3.parseImageNode,Y3=typeof Image<"u",K3=typeof ImageBitmap<"u",Toe=Boolean(woe),Z3=gd?!0:Toe;function h5(t){switch(t){case"auto":return K3||Y3||Z3;case"imagebitmap":return K3;case"image":return Y3;case"data":return Z3;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function f5(){if(K3)return"imagebitmap";if(Y3)return"image";if(Z3)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function d5(t){let e=Eoe(t);if(!e)throw new Error("Not an image");return e}function xx(t){switch(d5(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Eoe(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Soe=/^data:image\/svg\+xml/,Coe=/\.svg((\?|#).*)?$/;function TT(t){return t&&(Soe.test(t)||Coe.test(t))}function p5(t,e){if(TT(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return J3(t,e)}function J3(t,e){if(TT(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ET(t,e,r){let i=p5(t,r),n=self.URL||self.webkitURL,o=typeof i!="string"&&n.createObjectURL(i);try{return await Moe(o||i,e)}finally{o&&n.revokeObjectURL(o)}}async function Moe(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";n(new Error(s))}}catch(o){n(o)}})}var Ioe={},A5=!0;async function m5(t,e,r){let i;TT(r)?i=await ET(t,e,r):i=J3(t,r);let n=e&&e.imagebitmap;return await Poe(i,n)}async function Poe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((Roe(e)||!A5)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),A5=!1}return await createImageBitmap(t)}function Roe(t){for(let e in t||Ioe)return!1;return!0}function g5(t){return!Loe(t,"ftyp",4)||!(t[8]&96)?null:Boe(t)}function Boe(t){switch(Ooe(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Ooe(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Doe(t){return[...t].map(e=>e.charCodeAt(0))}function Loe(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=Doe(e);for(let n=0;n<i.length;++n)if(i[n]!==t[n+r])return!1;return!0}var Ef=!1,bx=!0;function nm(t){let e=wx(t);return Noe(e)||zoe(e)||koe(e)||Uoe(e)||Foe(e)}function Foe(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=g5(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Noe(t){let e=wx(t);return e.byteLength>=24&&e.getUint32(0,Ef)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Ef),height:e.getUint32(20,Ef)}:null}function koe(t){let e=wx(t);return e.byteLength>=10&&e.getUint32(0,Ef)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,bx),height:e.getUint16(8,bx)}:null}function Uoe(t){let e=wx(t);return e.byteLength>=14&&e.getUint16(0,Ef)===16973&&e.getUint32(2,bx)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,bx),height:e.getUint32(22,bx)}:null}function zoe(t){let e=wx(t);if(!(e.byteLength>=3&&e.getUint16(0,Ef)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=Voe(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Ef);if(n.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Ef),width:e.getUint16(o+7,Ef)};if(!i.has(s))return null;o+=2,o+=e.getUint16(o,Ef)}return null}function Voe(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function wx(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function _5(t,e){var r;let{mimeType:i}=nm(t)||{},n=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return On(n),await n(t,i)}async function y5(t,e,r){e=e||{};let n=(e.image||{}).type||"auto",{url:o}=r||{},s=joe(n),l;switch(s){case"imagebitmap":l=await m5(t,e,o);break;case"image":l=await ET(t,e,o);break;case"data":l=await _5(t,e);break;default:On(!1)}return n==="data"&&(l=xx(l)),l}function joe(t){switch(t){case"auto":case"data":return f5();default:return h5(t),t}}var Hoe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Goe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Woe={image:{type:"auto",decode:!0}},Sf={id:"image",module:"images",name:"Images",version:u5,mimeTypes:Goe,extensions:Hoe,parse:y5,tests:[t=>Boolean(nm(new DataView(t)))],options:Woe};var Q3={};function $3(t){if(Q3[t]===void 0){let e=gd?Xoe(t):qoe(t);Q3[t]=e}return Q3[t]}function qoe(t){var e,r;let i=["image/png","image/jpeg","image/gif"],n=((e=globalThis.loaders)===null||e===void 0?void 0:e.imageFormatsNode)||i,o=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Boolean(o)&&n.includes(t)}function Xoe(t){switch(t){case"image/avif":case"image/webp":return Yoe(t);default:return!0}}function Yoe(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var Koe=new bc({id:"deck"}),ur=Koe;var eR={};function v5(t){eR=t}function Ks(t,e,r,i){ur.level>0&&eR[t]&&eR[t].call(null,e,r,i)}function Zoe(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var x5={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:Zoe,parseTextSync:JSON.parse};function Joe(){let t="9.0.0-beta.10",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(ur.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:ur,_registerLoggers:v5},$A([x5,[Sf,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var ST=Joe();function Cf(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var tR={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function w5(t){let e={};for(let[r,i]of Object.entries(t))e[r]=Qoe(i);return e}function T5(t,e,r){let i={};for(let[n,o]of Object.entries(e))t&&n in t&&!o.private?(o.validate&&Cf(o.validate(t[n],o),`${r}: invalid ${n}`),i[n]=t[n]):i[n]=o.value;return i}function Qoe(t){let e=b5(t);if(e!=="object")return{value:t,...tR[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...tR[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=b5(t.value),{...t,...tR[e],type:e}):{type:"object",value:null};throw new Error("props")}function b5(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var E5=`#ifdef MODULE_LOGDEPTH
553
+ ${n}`)(e);let{gl:i}=this.device;if(i.shaderSource(this.handle,e),i.compileShader(this.handle),Kt.level===0){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Kt.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Kt.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}};var Une=256,zne=1024,Vne=16384,U3=6144,jne=[1,2,4,8],gT=class extends L0{device;glParameters;constructor(e,r){super(e,r),this.device=e,Mp(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){_d(this.device.gl),this.props.framebuffer&&Bu(this.device.gl,{framebuffer:null})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){let r={};this.props.framebuffer&&(r.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(r.viewport=e.viewport.slice(0,4),r.depthRange=[e.viewport[4],e.viewport[5]]):r.viewport=e.viewport),e.scissorRect&&(r.scissorTest=!0,r.scissor=e.scissorRect),e.blendConstant&&(r.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),e[2967]=e.stencilReference),e.colorMask&&(r.colorMask=jne.map(i=>Boolean(i&e.colorMask))),this.glParameters=r,Bu(this.device.gl,r)}beginOcclusionQuery(e){this.props.occlusionQuerySet?.beginOcclusionQuery()}endOcclusionQuery(){this.props.occlusionQuerySet?.endOcclusionQuery()}clear(){let e={...this.glParameters},r=0;this.props.clearColor!==!1&&(r|=Vne,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=Une,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=zne,e.clearStencil=this.props.clearStencil),r!==0&&Du(this.device.gl,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(e=0,r=[0,0,0,0]){Du(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int32Array:this.device.gl.clearBufferiv(U3,e,r);break;case Uint32Array:this.device.gl.clearBufferuiv(U3,e,r);break;case Float32Array:default:this.device.gl.clearBufferfv(U3,e,r);break}})}};var Hne="Failed to deduce GL constant from typed array";function Nz(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(Hne)}}function yx(t,e){let{clamped:r=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return r?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var Gne={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Wne={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Ip=class{offset;stride;type;size;divisor;normalized;integer;buffer;index;static getBytesPerElement(e){return yx(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return Yi(e.size),yx(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new Ip(Gne,...e)}constructor(...e){e.forEach(r=>this._assign(r)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Ip.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Ip.getBytesPerVertex(this)}_assign(e={}){return e=x3("Accessor",e,Wne),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}};function kz(t){return qne.includes(t)}var qne=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],Uz={[5126]:[5126,1,"float","f32","float32"],[35664]:[5126,2,"vec2","vec2<f32>","float32x2"],[35665]:[5126,3,"vec3","vec3<f32>","float32x3"],[35666]:[5126,4,"vec4","vec4<f32>","float32x4"],[5124]:[5124,1,"int","i32","sint32"],[35667]:[5124,2,"ivec2","vec2<i32>","sint32x2"],[35668]:[5124,3,"ivec3","vec3<i32>","sint32x3"],[35669]:[5124,4,"ivec4","vec4<i32>","sint32x4"],[5125]:[5125,1,"uint","u32","uint32"],[36294]:[5125,2,"uvec2","vec2<u32>","uint32x2"],[36295]:[5125,3,"uvec3","vec3<u32>","uint32x3"],[36296]:[5125,4,"uvec4","vec4<u32>","uint32x4"],[35670]:[5126,1,"bool","f32","float32"],[35671]:[5126,2,"bvec2","vec2<f32>","float32x2"],[35672]:[5126,3,"bvec3","vec3<f32>","float32x3"],[35673]:[5126,4,"bvec4","vec4<f32>","float32x4"],[35674]:[5126,8,"mat2","mat2x2<f32>"],[35685]:[5126,8,"mat2x3","mat2x3<f32>"],[35686]:[5126,8,"mat2x4","mat2x4<f32>"],[35687]:[5126,12,"mat3x2","mat3x2<f32>"],[35675]:[5126,12,"mat3","mat3x3<f32>"],[35688]:[5126,12,"mat3x4","mat3x4<f32>"],[35689]:[5126,16,"mat4x2","mat4x2<f32>"],[35690]:[5126,16,"mat4x3","mat4x3<f32>"],[35676]:[5126,16,"mat4","mat4x4<f32>"]};function z3(t){let e=Uz[t];if(!e)throw new Error("uniform");let[r,i,,n]=e;return{format:n,components:i,glType:r}}function zz(t){let e=Uz[t];if(!e)throw new Error("attribute");let[,r,,i,n]=e;return{attributeType:i,vertexFormat:n,components:r}}function Vz(t,e){let r={attributes:[],bindings:[]};r.attributes=Xne(t,e);let i=Zne(t,e);for(let l of i){let u=l.uniforms.map(f=>({name:f.name,format:f.format,byteOffset:f.byteOffset,byteStride:f.byteStride,arrayLength:f.arrayLength}));r.bindings.push({type:"uniform",name:l.name,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:u})}let n=Kne(t,e),o=0;for(let l of n)if(kz(l.type)){let{viewDimension:u,sampleType:f}=Qne(l.type);r.bindings.push({type:"texture",name:l.name,location:o,viewDimension:u,sampleType:f}),l.textureUnit=o,o+=1}n.length&&(r.uniforms=n);let s=Yne(t,e);return s?.length&&(r.varyings=s),r}function Xne(t,e){let r=[],i=t.getProgramParameter(e,35721);for(let n=0;n<i;n++){let o=t.getActiveAttrib(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l}=o,u=t.getAttribLocation(e,s);if(u>=0){let{attributeType:f}=zz(l),v=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:u,stepMode:v,type:f})}}return r.sort((n,o)=>n.location-o.location),r}function Yne(t,e){let r=[],i=t.getProgramParameter(e,35971);for(let n=0;n<i;n++){let o=t.getTransformFeedbackVarying(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l,size:u}=o,{glType:f,components:v}=z3(l),T=new Ip({type:f,size:u*v}),E={location:n,name:s,accessor:T};r.push(E)}return r.sort((n,o)=>n.location-o.location),r}function Kne(t,e){let r=[],i=t.getProgramParameter(e,35718);for(let n=0;n<i;n++){let o=t.getActiveUniform(e,n);if(!o)throw new Error("activeInfo");let{name:s,size:l,type:u}=o,{name:f,isArray:v}=$ne(s),T=t.getUniformLocation(e,f),E={location:T,name:f,size:l,type:u,isArray:v};if(r.push(E),E.size>1)for(let M=0;M<E.size;M++){let O=`${f}[${M}]`;T=t.getUniformLocation(e,O);let F={...E,name:O,location:T};r.push(F)}}return r}function Zne(t,e){let r=(o,s)=>t.getActiveUniformBlockParameter(e,o,s),i=[],n=t.getProgramParameter(e,35382);for(let o=0;o<n;o++){let s={name:t.getActiveUniformBlockName(e,o)||"",location:r(o,35391),byteLength:r(o,35392),vertex:r(o,35396),fragment:r(o,35398),uniformCount:r(o,35394),uniforms:[]},l=r(o,35395)||[],u=t.getActiveUniforms(e,l,35383),f=t.getActiveUniforms(e,l,35384),v=t.getActiveUniforms(e,l,35387),T=t.getActiveUniforms(e,l,35388);for(let E=0;E<s.uniformCount;++E){let M=t.getActiveUniform(e,l[E]);if(!M)throw new Error("activeInfo");s.uniforms.push({name:M.name,format:z3(u[E]).format,type:u[E],arrayLength:f[E],byteOffset:v[E],byteStride:T[E]})}i.push(s)}return i.sort((o,s)=>o.location-s.location),i}var Jne={[35678]:["2d","float"],[35680]:["cube","float"],[35679]:["3d","float"],[35682]:["3d","depth"],[36289]:["2d-array","float"],[36292]:["2d-array","depth"],[36293]:["cube","float"],[36298]:["2d","sint"],[36299]:["3d","sint"],[36300]:["cube","sint"],[36303]:["2d-array","uint"],[36306]:["2d","uint"],[36307]:["3d","uint"],[36308]:["cube","uint"],[36311]:["2d-array","uint"]};function Qne(t){let e=Jne[t];if(!e)throw new Error("sampler");let[r,i]=e;return{viewDimension:r,sampleType:i}}function $ne(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};let r=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!r||r.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function jz(t,e,r,i){let n=t,o=i;o===!0&&(o=1),o===!1&&(o=0);let s=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof i!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,i);case 5126:return t.uniform1fv(e,s);case 35664:return t.uniform2fv(e,s);case 35665:return t.uniform3fv(e,s);case 35666:return t.uniform4fv(e,s);case 5124:return t.uniform1iv(e,s);case 35667:return t.uniform2iv(e,s);case 35668:return t.uniform3iv(e,s);case 35669:return t.uniform4iv(e,s);case 35670:return t.uniform1iv(e,s);case 35671:return t.uniform2iv(e,s);case 35672:return t.uniform3iv(e,s);case 35673:return t.uniform4iv(e,s);case 5125:return n.uniform1uiv(e,s,1);case 36294:return n.uniform2uiv(e,s,2);case 36295:return n.uniform3uiv(e,s,3);case 36296:return n.uniform4uiv(e,s,4);case 35674:return t.uniformMatrix2fv(e,!1,s);case 35675:return t.uniformMatrix3fv(e,!1,s);case 35676:return t.uniformMatrix4fv(e,!1,s);case 35685:return n.uniformMatrix2x3fv(e,!1,s);case 35686:return n.uniformMatrix2x4fv(e,!1,s);case 35687:return n.uniformMatrix3x2fv(e,!1,s);case 35688:return n.uniformMatrix3x4fv(e,!1,s);case 35689:return n.uniformMatrix4x2fv(e,!1,s);case 35690:return n.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function Hz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function Gz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}var Wz=4,_T=class extends mh{device;handle;vs;fs;introspectedLayout;uniforms={};bindings={};varyings=null;_uniformCount=0;_uniformSetters={};constructor(e,r){super(e,r),this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;let{varyings:i,bufferMode:n=35981}=r;switch(i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,n)),this._linkShaders(),Kt.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Vz(this.device.gl,this.handle),Kt.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=p3(this.introspectedLayout,r.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":Kt.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break;default:}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e,r){for(let[i,n]of Object.entries(e)){let o=this.shaderLayout.bindings.find(s=>s.name===i)||this.shaderLayout.bindings.find(s=>s.name===`${i}Uniforms`);if(!o){let s=this.shaderLayout.bindings.map(l=>`"${l.name}"`).join(", ");r?.disableWarnings&&Kt.warn(`Unknown binding "${i}" in render pipeline "${this.id}", expected one of ${s}`)();continue}switch(n||Kt.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),o.type){case"uniform":if(!(n instanceof Jl)&&!(n.buffer instanceof Jl))throw new Error("buffer value");break;case"texture":if(!(n instanceof gh||n instanceof Ql||n instanceof wf))throw new Error("texture value");break;case"sampler":Kt.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(o.type)}this.bindings[i]=n}}draw(e){let{renderPass:r,parameters:i=this.props.parameters,topology:n=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:l,firstVertex:u=0,transformFeedback:f}=e,v=Hz(n),T=Boolean(o.indexBuffer),E=o.indexBuffer?.glIndexType,M=Number(l)>0;if(this.linkStatus!=="success")return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable()||s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;if(s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)(),!0;this.device.gl.useProgram(this.handle),o.bindBeforeRender(r),f&&f.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let O=r;return Cz(this.device,i,O.glParameters,()=>{T&&M?this.device.gl.drawElementsInstanced(v,s||0,E,u,l||0):T?this.device.gl.drawElements(v,s||0,E,u):M?this.device.gl.drawArraysInstanced(v,u,s||0,l||0):this.device.gl.drawArrays(v,u,s||0),f&&f.end()}),o.unbindAfterRender(r),!0}setUniformsWebGL(e){let{bindings:r}=ux(e);Object.keys(r).forEach(i=>{Kt.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,e)}async _linkShaders(){let{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),Kt.time(Wz,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),Kt.timeEnd(Wz,`linkProgram for ${this.id}`)(),Kt.level,!this.device.features.has("compilation-status-async-webgl")){let i=this._getLinkStatus();this._reportLinkStatus(i);return}Kt.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Kt.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();let r=this._getLinkStatus();this._reportLinkStatus(r)}_reportLinkStatus(e){switch(e){case"success":return;default:throw this.vs.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`)):this.fs?.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`)):new Error(`Error during ${e}: ${this.device.gl.getProgramInfoLog(this.handle)}`)}}_getLinkStatus(){let{gl:e}=this.device;return e.getProgramParameter(this.handle,35714)?(e.validateProgram(this.handle),e.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(let[,r]of Object.entries(this.bindings))r instanceof Ql&&(r.update(),e=e&&r.loaded);return e}_applyBindings(){if(this.linkStatus!=="success")return;let{gl:e}=this.device;e.useProgram(this.handle);let r=0,i=0;for(let n of this.shaderLayout.bindings){let o=this.bindings[n.name]||this.bindings[n.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${n.name} in ${this.id}`);switch(n.type){case"uniform":let{name:s}=n,l=e.getUniformBlockIndex(this.handle,s);if(l===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,i,l),o instanceof Jl?e.bindBufferBase(35345,i,o.handle):e.bindBufferRange(35345,i,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),i+=1;break;case"texture":if(!(o instanceof gh||o instanceof Ql||o instanceof wf))throw new Error("texture");let u;if(o instanceof gh)u=o.texture;else if(o instanceof Ql)u=o;else if(o instanceof wf&&o.colorAttachments[0]instanceof gh)Kt.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),u=o.colorAttachments[0].texture;else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(u.target,u.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${n.type}' not supported in WebGL`)}}}_applyUniforms(){for(let e of this.shaderLayout.uniforms||[]){let{name:r,location:i,type:n,textureUnit:o}=e,s=this.uniforms[r]??o;s!==void 0&&jz(this.device.gl,i,n,s)}}};var yT=class extends N0{device;commands=[];constructor(e){super(e,{}),this.device=e}submitCommands(e=this.commands){for(let r of e)switch(r.name){case"copy-buffer-to-buffer":eoe(this.device,r.options);break;case"copy-buffer-to-texture":toe(this.device,r.options);break;case"copy-texture-to-buffer":roe(this.device,r.options);break;case"copy-texture-to-texture":ioe(this.device,r.options);break}}};function eoe(t,e){let r=e.source,i=e.destination;t.gl.bindBuffer(36662,r.handle),t.gl.bindBuffer(36663,i.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function toe(t,e){throw new Error("Not implemented")}function roe(t,e){let{source:r,mipLevel:i=0,aspect:n="all",width:o=e.source.width,height:s=e.source.height,depthOrArrayLayers:l=0,origin:u=[0,0],destination:f,byteOffset:v=0,bytesPerRow:T,rowsPerImage:E}=e;if(n!=="all")throw new Error("not supported");if(i!==0||l!==0||T||E)throw new Error("not implemented");let{framebuffer:M,destroyFramebuffer:O}=qz(r),F;try{let U=f,G=o||M.width,J=s||M.height,K=H0(M.texture.props.format),ne=K.dataFormat,ge=K.type;t.gl.bindBuffer(35051,U.handle),F=t.gl.bindFramebuffer(36160,M.handle),t.gl.readPixels(u[0],u[1],G,J,ne,ge,v)}finally{t.gl.bindBuffer(35051,null),F!==void 0&&t.gl.bindFramebuffer(36160,F),O&&M.destroy()}}function ioe(t,e){let{source:r,destinationMipLevel:i=0,origin:n=[0,0],destinationOrigin:o=[0,0],destination:s}=e,{width:l=e.destination.width,height:u=e.destination.height}=e,{framebuffer:f,destroyFramebuffer:v}=qz(r),[T,E]=n,[M,O,F]=o,U=t.gl.bindFramebuffer(36160,f.handle),G=null,J;if(s instanceof Ql)G=s,l=Number.isFinite(l)?l:G.width,u=Number.isFinite(u)?u:G.height,G.bind(0),J=G.target;else throw new Error("invalid destination");switch(J){case 3553:case 34067:t.gl.copyTexSubImage2D(J,i,M,O,T,E,l,u);break;case 35866:case 32879:t.gl.copyTexSubImage3D(J,i,M,O,F,T,E,l,u);break;default:}G&&G.unbind(),t.gl.bindFramebuffer(36160,U),v&&f.destroy()}function qz(t){if(t instanceof bo){let{width:e,height:r,id:i}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${i}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var vT=class extends F0{device;commandBuffer;constructor(e,r){super(e,r),this.device=e,this.commandBuffer=new yT(e)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}resolveQuerySet(e,r,i){}};var G0=class extends k0{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(e){return HP()==="Chrome"}constructor(e,r){super(e,r),this.device=e,this.handle=this.device.gl.createVertexArray()}destroy(){super.destroy(),this.buffer&&this.buffer?.destroy(),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(e){let r=e;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r,this.device.gl.bindVertexArray(null)}setBuffer(e,r){let i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:n,type:o,stride:s,offset:l,normalized:u,integer:f,divisor:v}=this._getAccessor(e);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),f?this.device.gl.vertexAttribIPointer(e,n,o,s,l):this.device.gl.vertexAttribPointer(e,n,o,u,s,l),this.device.gl.enableVertexAttribArray(e),this.device.gl.vertexAttribDivisor(e,v||0),this.attributes[e]=i,this.device.gl.bindVertexArray(null)}setConstantWebGL(e,r){this._enable(e,!1),this.attributes[e]=r}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let e=0;e<this.maxVertexAttributes;++e){let r=this.attributes[e];ArrayBuffer.isView(r)&&this.device.setConstantAttributeWebGL(e,r)}}_getAccessor(e){let r=this.attributeInfos[e];if(!r)throw new Error(`Unknown attribute location ${e}`);let i=iT(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e,r=!0){let n=G0.isConstantAttributeZeroSupported(this.device)||e!==0;(r||n)&&(e=Number(e),this.device.gl.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(e):this.device.gl.disableVertexAttribArray(e),this.device.gl.bindVertexArray(null))}getConstantBuffer(e,r){let i=noe(r),n=i.byteLength*e,o=i.length*e;if(this.buffer&&n!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${n} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:n}),s=s||!ooe(i,this.bufferValue),s){let l=_3(r.constructor,o);y3({target:l,source:i,start:0,count:o}),this.buffer.write(l),this.bufferValue=r}return this.buffer}};function noe(t){return Array.isArray(t)?new Float32Array(t):t}function ooe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var xT=class extends U0{device;gl;handle;layout;buffers={};unusedBuffers={};bindOnUse=!0;_bound=!1;constructor(e,r){super(e,r),this.device=e,this.gl=e.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(e="point-list"){this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(Gz(e))}end(){this.gl.endTransformFeedback(),this.bindOnUse||this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(e){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(let r in e)this.setBuffer(r,e[r])})}setBuffer(e,r){let i=this._getVaryingIndex(e),{buffer:n,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(i<0){this.unusedBuffers[e]=n,Kt.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[i]={buffer:n,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(i,n,s,o)}getBuffer(e){if(Xz(e))return this.buffers[e]||null;let r=this._getVaryingIndex(e);return r>=0?this.buffers[r]:null}bind(e=this.handle){if(typeof e!="function")return this.gl.bindTransformFeedback(36386,e),this;let r;return this._bound?r=e():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=e(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof Jl)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:i=0,byteLength:n=e.buffer.byteLength}=e;return{buffer:r,byteOffset:i,byteLength:n}}_getVaryingIndex(e){if(Xz(e))return Number(e);for(let r of this.layout.varyings)if(e===r.name)return r.location;return-1}_bindBuffers(){for(let e in this.buffers){let{buffer:r,byteLength:i,byteOffset:n}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,n,i)}}_unbindBuffers(){for(let e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r,i=0,n){let o=r&&r.handle;!o||n===void 0?this.gl.bindBufferBase(35982,e,o):this.gl.bindBufferRange(35982,e,o,i,n)}};function Xz(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}var bT=class extends z0{device;handle;target=null;_queryPending=!1;_pollingPromise=null;get[Symbol.toStringTag](){return"Query"}constructor(e,r){if(super(e,r),this.device=e,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(e){return this._begin(e?.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(e){this._queryPending||(this.target=e,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;let e=this.device.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,n)=>{let o=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>e?(n("Timed out"),this._pollingPromise=null):requestAnimationFrame(o)};requestAnimationFrame(o)}),this._pollingPromise}};function V3(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Yi(!1),0}}function Yz(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Yi(!1),0}}function Kz(t,e){let{sourceX:r=0,sourceY:i=0,sourceFormat:n=6408,sourceAttachment:o=36064}=e||{},{target:s=null,sourceWidth:l,sourceHeight:u,sourceType:f}=e||{},{framebuffer:v,deleteFramebuffer:T}=Jz(t);Yi(v);let{gl:E,handle:M}=v;l=l||v.width,u=u||v.height;let O=o-36064;f=f||v.colorAttachments[O]?.texture?.type||5121,s=aoe(s,f,n,l,u),f=f||Nz(s);let F=E.bindFramebuffer(36160,M);return E.readPixels(r,i,l,u,n,f,s),E.bindFramebuffer(36160,F||null),T&&v.destroy(),s}function Zz(t,e){let{target:r,sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:l,sourceHeight:u,sourceType:f}=e||{},{framebuffer:v,deleteFramebuffer:T}=Jz(t);Yi(v),l=l||v.width,u=u||v.height;let E=v;f=f||5121;let M=r;if(!M){let F=V3(o),U=Yz(f),G=s+l*u*F*U;M=E.device.createBuffer({byteLength:G})}let O=t.device.createCommandEncoder();return O.copyTextureToBuffer({source:t,width:l,height:u,origin:[i,n],destination:M,byteOffset:s}),O.destroy(),T&&v.destroy(),M}function Jz(t){return t instanceof yf?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:soe(t),deleteFramebuffer:!0}}function soe(t,e){let{device:r,width:i,height:n,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:i,height:n,colorAttachments:[t]})}function aoe(t,e,r,i,n){if(t)return t;e=e||5121;let o=yx(e,{clamped:!1}),s=V3(r);return new o(i*n*s)}var loe=256,coe=1024,uoe=16384;var hoe="clear: bad arguments";function Qz(t,e){let{framebuffer:r=null,color:i=null,depth:n=null,stencil:o=null}=e||{},s={};r&&(s.framebuffer=r);let l=0;i&&(l|=uoe,i!==!0&&(s.clearColor=i)),n&&(l|=loe,n!==!0&&(s.clearDepth=n)),o&&(l|=coe,n!==!0&&(s.clearStencil=n)),Yi(l!==0,hoe);let u=t.gl;Du(u,s,()=>{u.clear(l)})}var vx=1,W0=class extends wc{type="webgl";handle;features;limits;info;canvasContext;lost;_resolveContextLost;static isSupported(){return typeof WebGL2RenderingContext<"u"}static attach(e){if(e instanceof W0)return e;if(e?.device instanceof wc)return e.device;if(!foe(e))throw new Error("Invalid WebGL2RenderingContext");return new W0({gl:e})}static async create(e={}){Kt.groupCollapsed(vx,"WebGLDevice created")();let r=[];e.debug&&r.push(Oz()),e.spector&&r.push(Pz()),typeof e.canvas=="string"&&r.push(Tp.pageLoaded);let i=await Promise.allSettled(r);for(let s of i)s.status==="rejected"&&Kt.error(`Failed to initialize debug libraries ${s.reason}`)();if(Kt.probe(vx+1,"DOM is loaded")(),e.gl?.device)return Kt.warn("reattaching existing device")(),W0.attach(e.gl);let n=new W0(e),o=`Created ${n.type}${n.debug?" debug":""} context: ${n.info.vendor}, ${n.info.renderer} for canvas: ${n.canvasContext.id}`;return Kt.probe(vx,o)(),Kt.table(vx,n.info)(),Kt.groupEnd(vx)(),n}constructor(e){super({...e,id:e.id||oa("webgl-device")});let r=e.gl?.device;if(r)throw new Error(`WebGL context already attached to device ${r.id}`);let i=e.gl?.canvas||e.canvas;this.canvasContext=new AT(this,{...e,canvas:i}),this.lost=new Promise(l=>{this._resolveContextLost=l});let n=e.gl||null;if(n||=pz(this.canvasContext.canvas,{...e,onContextLost:l=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})}),!n)throw new Error("WebGL context creation failed");this.handle=n,this.gl=n,this.gl.device=this,this.gl._version=2,this.info=Az(this.gl,this._extensions),this.limits=new uT(this.gl),this.features=new cT(this.gl,this._extensions,this.props.disabledFeatures),this.props.initalizeFeatures&&this.features.initializeFeatures(),this.canvasContext.resize();let{enable:o=!0,copyState:s=!1}=e;I3(this.gl,{enable:o,copyState:s,log:(...l)=>Kt.log(1,...l)()}),e.debug&&(this.gl=Dz(this.gl,{...e,throwOnError:!0}),this.debug=!0,Kt.level=Math.max(Kt.level,1),Kt.warn("WebGL debug mode activated. Performance reduced.")()),e.spector&&(this.spectorJS=Rz({...this.props,canvas:this.handle.canvas}))}destroy(){}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(e){return lT(this.gl,e,this._extensions)}isTextureFormatFilterable(e){return bz(this.gl,e,this._extensions)}isTextureFormatRenderable(e){return wz(this.gl,e,this._extensions)}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._getBufferProps(e);return new Jl(this,r)}_createTexture(e){return new Ql(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new im(this,e)}createShader(e){return new mT(this,e)}createFramebuffer(e){return new wf(this,e)}createVertexArray(e){return new G0(this,e)}createTransformFeedback(e){return new xT(this,e)}createQuerySet(e){return new bT(this,e)}createRenderPipeline(e){return new _T(this,e)}beginRenderPass(e){return new gT(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}renderPass=null;createCommandEncoder(e){return new vT(this,e)}submit(){this.renderPass?.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return Kz(e,r)}readPixelsToBufferWebGL(e,r){return Zz(e,r)}setParametersWebGL(e){Bu(this.gl,e)}getParametersWebGL(e){return rT(this.gl,e)}withParametersWebGL(e,r){return Du(this.gl,e,r)}clearWebGL(e){Qz(this,e)}resetWebGL(){Kt.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),hz(this.gl)}gl;debug=!1;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};_extensions={};_polyfilled=!1;spectorJS;loseDevice(){let e=!1,i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(e=!0,i.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),e}pushState(){Mp(this.gl)}popState(){_d(this.gl)}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){r=r||this.gl2||this.gl;let i=Number(e);for(let n in r)if(r[n]===i)return`GL.${n}`;return String(e)}_constants;setConstantAttributeWebGL(e,r){let i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);let n=this._constants[e];switch(n&&moe(n,r)&&Kt.info(1,`setConstantAttributeWebGL(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:doe(this,e,r);break;case Int32Array:poe(this,e,r);break;case Uint32Array:Aoe(this,e,r);break;default:Yi(!1)}}getExtension(e){return Ou(this.gl,e,this._extensions),this._extensions}},Tf=W0;si(Tf,"type","webgl");function foe(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function doe(t,e,r){switch(r.length){case 1:t.gl.vertexAttrib1fv(e,r);break;case 2:t.gl.vertexAttrib2fv(e,r);break;case 3:t.gl.vertexAttrib3fv(e,r);break;case 4:t.gl.vertexAttrib4fv(e,r);break;default:Yi(!1)}}function poe(t,e,r){t.gl.vertexAttribI4iv(e,r)}function Aoe(t,e,r){t.gl.vertexAttribI4uiv(e,r)}function moe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var $z,e5,r5={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function wT(){return document.createElement("div")}function goe(t){if(!t.picked)return null;if(t.object===$z)return e5;let e={html:yoe(t.object),style:r5};return e5=e,$z=t.object,e}var _oe=new Set(["position","index"]);function yoe(t){let e=wT();for(let r in t){if(_oe.has(r))continue;let i=wT();i.className="header",i.textContent=r;let n=wT();n.className="value",n.textContent=xoe(t[r]);let o=wT();voe(o,i,n),o.appendChild(i),o.appendChild(n),e.appendChild(o)}return e.innerHTML}function voe(t,e,r){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(r.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function xoe(t){let e;if(Array.isArray(t)&&t.length>4)e=`Array<${t.length}>`;else if(typeof t=="string")e=t;else if(typeof t=="number")e=String(t);else try{e=JSON.stringify(t)}catch{e="<Non-Serializable Object>"}let r=50;return e.length>r&&(e=e.slice(0,r)),e}function t5(t,e){let r,i=t,n="properties",o=/{[^}]*}/g,s=u=>u.replace(/[{}]/g,""),l=[...new Set(t.match(o).map(s))];for(let u of l){if(u.includes(".")){r=e;let f=u.split(".");for(let v of f)if(r.hasOwnProperty(v))r=r[v];else{r=void 0;break}}else e.hasOwnProperty(u)?r=e[u]:e[n]&&e[n].hasOwnProperty(u)?r=e[n][u]:r=void 0;i=i.replaceAll(`{${u}}`,r)}return i}function j3(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||r5};return t.html?r.html=t5(t.html,e.object):r.text=t5(t.text,e.object),r}:goe:null}function i5(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function n5(t,e){let r=document.createElement("div");return r.style.width=Number.isFinite(t)?`${t}px`:t,r.style.height=`${e}px`,r.style.position="relative",r}var s5=ga(o5()),boe="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",W3=s5.default;function a5(t=boe){i5(t)}function l5(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var q3={};function c5(t){if(!q3[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),q3[t]=new Promise(i=>{e.onload=i})}return q3[t]}var u5="4.1.4";var X3,woe=(X3=globalThis.loaders)===null||X3===void 0?void 0:X3.parseImageNode,Y3=typeof Image<"u",K3=typeof ImageBitmap<"u",Toe=Boolean(woe),Z3=gd?!0:Toe;function h5(t){switch(t){case"auto":return K3||Y3||Z3;case"imagebitmap":return K3;case"image":return Y3;case"data":return Z3;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function f5(){if(K3)return"imagebitmap";if(Y3)return"image";if(Z3)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function d5(t){let e=Eoe(t);if(!e)throw new Error("Not an image");return e}function xx(t){switch(d5(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Eoe(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Soe=/^data:image\/svg\+xml/,Coe=/\.svg((\?|#).*)?$/;function TT(t){return t&&(Soe.test(t)||Coe.test(t))}function p5(t,e){if(TT(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return J3(t,e)}function J3(t,e){if(TT(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ET(t,e,r){let i=p5(t,r),n=self.URL||self.webkitURL,o=typeof i!="string"&&n.createObjectURL(i);try{return await Moe(o||i,e)}finally{o&&n.revokeObjectURL(o)}}async function Moe(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";n(new Error(s))}}catch(o){n(o)}})}var Ioe={},A5=!0;async function m5(t,e,r){let i;TT(r)?i=await ET(t,e,r):i=J3(t,r);let n=e&&e.imagebitmap;return await Poe(i,n)}async function Poe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if((Roe(e)||!A5)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),A5=!1}return await createImageBitmap(t)}function Roe(t){for(let e in t||Ioe)return!1;return!0}function g5(t){return!Loe(t,"ftyp",4)||!(t[8]&96)?null:Boe(t)}function Boe(t){switch(Ooe(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Ooe(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Doe(t){return[...t].map(e=>e.charCodeAt(0))}function Loe(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=Doe(e);for(let n=0;n<i.length;++n)if(i[n]!==t[n+r])return!1;return!0}var Ef=!1,bx=!0;function nm(t){let e=wx(t);return Noe(e)||zoe(e)||koe(e)||Uoe(e)||Foe(e)}function Foe(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=g5(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Noe(t){let e=wx(t);return e.byteLength>=24&&e.getUint32(0,Ef)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Ef),height:e.getUint32(20,Ef)}:null}function koe(t){let e=wx(t);return e.byteLength>=10&&e.getUint32(0,Ef)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,bx),height:e.getUint16(8,bx)}:null}function Uoe(t){let e=wx(t);return e.byteLength>=14&&e.getUint16(0,Ef)===16973&&e.getUint32(2,bx)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,bx),height:e.getUint32(22,bx)}:null}function zoe(t){let e=wx(t);if(!(e.byteLength>=3&&e.getUint16(0,Ef)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=Voe(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Ef);if(n.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Ef),width:e.getUint16(o+7,Ef)};if(!i.has(s))return null;o+=2,o+=e.getUint16(o,Ef)}return null}function Voe(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function wx(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function _5(t,e){var r;let{mimeType:i}=nm(t)||{},n=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return On(n),await n(t,i)}async function y5(t,e,r){e=e||{};let n=(e.image||{}).type||"auto",{url:o}=r||{},s=joe(n),l;switch(s){case"imagebitmap":l=await m5(t,e,o);break;case"image":l=await ET(t,e,o);break;case"data":l=await _5(t,e);break;default:On(!1)}return n==="data"&&(l=xx(l)),l}function joe(t){switch(t){case"auto":case"data":return f5();default:return h5(t),t}}var Hoe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Goe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Woe={image:{type:"auto",decode:!0}},Sf={id:"image",module:"images",name:"Images",version:u5,mimeTypes:Goe,extensions:Hoe,parse:y5,tests:[t=>Boolean(nm(new DataView(t)))],options:Woe};var Q3={};function $3(t){if(Q3[t]===void 0){let e=gd?Xoe(t):qoe(t);Q3[t]=e}return Q3[t]}function qoe(t){var e,r;let i=["image/png","image/jpeg","image/gif"],n=((e=globalThis.loaders)===null||e===void 0?void 0:e.imageFormatsNode)||i,o=(r=globalThis.loaders)===null||r===void 0?void 0:r.parseImageNode;return Boolean(o)&&n.includes(t)}function Xoe(t){switch(t){case"image/avif":case"image/webp":return Yoe(t);default:return!0}}function Yoe(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var Koe=new bc({id:"deck"}),ur=Koe;var eR={};function v5(t){eR=t}function Ks(t,e,r,i){ur.level>0&&eR[t]&&eR[t].call(null,e,r,i)}function Zoe(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var x5={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:Zoe,parseTextSync:JSON.parse};function Joe(){let t="9.0.0",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(ur.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:ur,_registerLoggers:v5},$A([x5,[Sf,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var ST=Joe();function Cf(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var tR={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function w5(t){let e={};for(let[r,i]of Object.entries(t))e[r]=Qoe(i);return e}function T5(t,e,r){let i={};for(let[n,o]of Object.entries(e))t&&n in t&&!o.private?(o.validate&&Cf(o.validate(t[n],o),`${r}: invalid ${n}`),i[n]=t[n]):i[n]=o.value;return i}function Qoe(t){let e=b5(t);if(e!=="object")return{value:t,...tR[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...tR[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=b5(t.value),{...t,...tR[e],type:e}):{type:"object",value:null};throw new Error("props")}function b5(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var E5=`#ifdef MODULE_LOGDEPTH
554
554
  logdepth_adjustPosition(gl_Position);
555
555
  #endif
556
556
  `,S5=`#ifdef MODULE_MATERIAL
@@ -3674,7 +3674,7 @@ clip_commonPosition = geometry.position.xy;
3674
3674
  in vec2 clip_commonPosition;
3675
3675
  `,"fs:DECKGL_FILTER_COLOR":`
3676
3676
  if (!clip_isInBounds(clip_commonPosition)) discard;
3677
- `},uM=class extends Fm{getShaders(){let e="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(e=Boolean(this.props.clipByInstance)),this.state.clipByInstance=e,e?{modules:[L1e],inject:F1e}:{modules:[N1e],inject:k1e}}draw({uniforms:e}){let{clipBounds:r}=this.props;if(this.state.clipByInstance)e.clip_bounds=r;else{let i=this.projectPosition([r[0],r[1],0]),n=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],n[0]),Math.min(i[1],n[1]),Math.max(i[0],n[0]),Math.max(i[1],n[1])]}}},cy=uM;(()=>{uM.defaultProps=D1e})(),(()=>{uM.extensionName="ClipExtension"})();function lF(t,e,r){let i=U1e(t),n=Object.keys(i).filter(o=>i[o]!==Array);return z1e(t,{propArrayTypes:i,...e},{numericPropKeys:r&&r.numericPropKeys||n,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function U1e(t){let e={};for(let r of t)if(r.properties)for(let i in r.properties){let n=r.properties[i];e[i]=q1e(n,e[i])}return e}function z1e(t,e,r){let{pointPositionsCount:i,pointFeaturesCount:n,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:l,polygonPositionsCount:u,polygonObjectsCount:f,polygonRingsCount:v,polygonFeaturesCount:T,propArrayTypes:E,coordLength:M}=e,{numericPropKeys:O=[],PositionDataType:F=Float32Array,triangulate:U=!0}=r,G=t[0]&&"id"in t[0],J=t.length>65535?Uint32Array:Uint16Array,K={type:"Point",positions:new F(i*M),globalFeatureIds:new J(i),featureIds:n>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},ne={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new F(o*M),globalFeatureIds:new J(o),featureIds:l>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},ge={type:"Polygon",polygonIndices:u>65535?new Uint32Array(f+1):new Uint16Array(f+1),primitivePolygonIndices:u>65535?new Uint32Array(v+1):new Uint16Array(v+1),positions:new F(u*M),globalFeatureIds:new J(u),featureIds:T>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};U&&(ge.triangles=[]);for(let me of[K,ne,ge])for(let he of O){let $=E[he];me.numericProps[he]=new $(me.positions.length/M)}ne.pathIndices[s]=o,ge.polygonIndices[f]=u,ge.primitivePolygonIndices[v]=u;let H={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let me of t){let he=me.geometry,$=me.properties||{};switch(he.type){case"Point":V1e(he,K,H,M,$),K.properties.push(aF($,O)),G&&K.fields.push({id:me.id}),H.pointFeature++;break;case"LineString":j1e(he,ne,H,M,$),ne.properties.push(aF($,O)),G&&ne.fields.push({id:me.id}),H.lineFeature++;break;case"Polygon":H1e(he,ge,H,M,$),ge.properties.push(aF($,O)),G&&ge.fields.push({id:me.id}),H.polygonFeature++;break;default:throw new Error("Invalid geometry type")}H.feature++}return W1e(K,ne,ge,M)}function V1e(t,e,r,i,n){e.positions.set(t.data,r.pointPosition*i);let o=t.data.length/i;cF(e,n,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function j1e(t,e,r,i,n){e.positions.set(t.data,r.linePosition*i);let o=t.data.length/i;cF(e,n,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=t.indices[s],f=s===l-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(f-u)/i}}function H1e(t,e,r,i,n){e.positions.set(t.data,r.polygonPosition*i);let o=t.data.length/i;cF(e,n,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=r.polygonPosition;e.polygonIndices[r.polygonObject++]=u;let f=t.areas[s],v=t.indices[s],T=t.indices[s+1];for(let M=0,O=v.length;M<O;++M){let F=v[M],U=M===O-1?T===void 0?t.data.length:T[0]:v[M+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(U-F)/i}let E=r.polygonPosition;G1e(e,f,v,{startPosition:u,endPosition:E,coordLength:i})}}function G1e(t,e,r,i){let{startPosition:n,endPosition:o,coordLength:s}=i;if(!t.triangles)return;let l=n*s,u=o*s,f=t.positions.subarray(l,u),v=r[0],T=r.slice(1).map(M=>(M-v)/s),E=PO(f,T,s,e);for(let M=0,O=E.length;M<O;++M)t.triangles.push(n+E[M])}function sF(t,e){let r={};for(let i in t)r[i]={value:t[i],size:e};return r}function W1e(t,e,r,i){let n={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:sF(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:sF(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:i},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:sF(r.numericProps,1)}};return n.polygons&&r.triangles&&(n.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),n}function cF(t,e,r,i){for(let n in t.numericProps)if(n in e){let o=e[n];t.numericProps[n].fill(o,r,r+i)}}function aF(t,e){let r={};for(let i in t)e.includes(i)||(r[i]=t[i]);return r}function q1e(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function dM(t,e){let r=e?.globalFeatureId;return r!==void 0?X1e(t,r):Y1e(t,e?.type)}function X1e(t,e){let r=rY(t);for(let i of r){let n=0,o=i.featureIds.value[0];for(let s=0;s<i.featureIds.value.length;s++){let l=i.featureIds.value[s];if(l!==o){if(e===i.globalFeatureIds.value[n])return hM(i,n,s);n=s,o=l}}if(e===i.globalFeatureIds.value[n])return hM(i,n,i.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function Y1e(t,e){let r=rY(t,e);return K1e(r)}function tY(t,e,r){switch(t.type){case"Point":return $1e(t,e,r);case"LineString":return Q1e(t,e,r);case"Polygon":return iY(t,e,r);default:let i=t;throw new Error(`Unsupported geometry type: ${i?.type}`)}}function rY(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function K1e(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let i=0,n=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==n&&(e.push(hM(r,i,o)),i=o,n=s)}e.push(hM(r,i,r.featureIds.value.length))}return e}function hM(t,e,r){let i=tY(t,e,r),n=J1e(t,e,r),o=Z1e(t,e,r);return{type:"Feature",geometry:i,properties:n,...o}}function Z1e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[e]]}function J1e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=Object.assign({},t.properties[t.featureIds.value[e]]);for(let n in t.numericProps)i[n]=t.numericProps[n].value[e];return i}function iY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.polygonIndices.value.filter(u=>u>=e&&u<=r),o=t.primitivePolygonIndices.value.filter(u=>u>=e&&u<=r);if(!(n.length>2)){let u=[];for(let f=0;f<o.length-1;f++){let v=o[f],T=o[f+1],E=fM(i,v,T);u.push(E)}return{type:"Polygon",coordinates:u}}let l=[];for(let u=0;u<n.length-1;u++){let f=n[u],v=n[u+1],T=iY(t,f,v).coordinates;l.push(T)}return{type:"MultiPolygon",coordinates:l}}function Q1e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.pathIndices.value.filter(l=>l>=e&&l<=r);if(!(n.length>2))return{type:"LineString",coordinates:fM(i,n[0],n[1])};let s=[];for(let l=0;l<n.length-1;l++){let u=fM(i,n[l],n[l+1]);s.push(u)}return{type:"MultiLineString",coordinates:s}}function $1e(t,e,r){let{positions:i}=t,n=fM(i,e,r);return n.length>1?{type:"MultiPoint",coordinates:n}:{type:"Point",coordinates:n[0]}}function fM(t,e,r){e=e||0,r=r||t.value.length/t.size;let i=[];for(let n=e;n<r;n++){let o=Array();for(let s=n*t.size;s<(n+1)*t.size;s++)o.push(Number(t.value[s]));i.push(o)}return i}var mF=ga(uY(),1);function hY(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let o=0;o<e;o++){let s=gbe(t[o]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&r.push(i),r}function gbe(t){let e=0;for(let r=0,i=t.length-1,n,o;r<t.length;i=r++)n=t[r],o=t[i],e+=(o[0]-n[0])*(n[1]+o[1]);return e}function fY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?_be(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function _be(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var vg=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,i,n,o){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(fY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=[],u;for(;e.pos<r;){if(n<=0){let f=e.readVarint();i=f&7,n=f>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(u&&l.push(u),u=[]),u&&u.push([o,s]);else if(i===7)u&&u.push(u[0].slice());else throw new Error(`unknown command ${i}`)}return u&&l.push(u),l}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=1/0,u=-1/0,f=1/0,v=-1/0;for(;e.pos<r;){if(n<=0){let T=e.readVarint();i=T&7,n=T>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<l&&(l=o),o>u&&(u=o),s<f&&(f=s),s>v&&(v=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[l,f,u,v]}_toGeoJSON(e){let r=this.loadGeometry(),i=vg.types[this.type],n,o;switch(this.type){case 1:let l=[];for(n=0;n<r.length;n++)l[n]=r[n][0];r=l,e(r,this);break;case 2:for(n=0;n<r.length;n++)e(r[n],this);break;case 3:for(r=hY(r),n=0;n<r.length;n++)for(o=0;o<r[n].length;o++)e(r[n][o],this);break}r.length===1?r=r[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;function u(f){for(let v=0;v<f.length;v++){let T=f[v];T[0]=(T[0]+s)*360/o-180;let E=180-(T[1]+l)*360/o;T[1]=360/Math.PI*Math.atan(Math.exp(E*Math.PI/180))-90}}return this._toGeoJSON(u)}};var qb=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ybe,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new vg(this._pbf,r,this.extent,this._keys,this._values)}};function ybe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(vbe(r)))}function vbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Xb=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(xbe,{},r)}};function xbe(t,e,r){if(t===3&&r){let i=new qb(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function dY(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[qp(t.data)]],indices:[t.indices]};let i=[],n=[],o=[],s=[],l,u=0;for(let f,v=0,T;v<e;v++){T=t.indices[v]-u,f=t.indices[v+1]-u||t.data.length;let E=t.data.slice(T,f),M=qp(E);if(M===0){let O=t.data.slice(0,T),F=t.data.slice(f);t.data=O.concat(F),u+=f-T;continue}l===void 0&&(l=M<0),l===M<0?(s.length&&(i.push(o),n.push(s)),s=[T],o=[M]):(o.push(M),s.push(T))}return o&&i.push(o),s.length&&n.push(s),{type:r,areas:i,indices:n,data:t.data}}function pY(t,e,r,i){for(let n=0,o=t.length;n<o;n+=2){t[n]=(t[n]+e)*360/i-180;let s=180-(t[n+1]+r)*360/i;t[n+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function AY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?bbe(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function bbe(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var mY,xg,fF,mM,dF,pF,Yb;var Kb=class{constructor(e,r,i,n,o,s){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this._geometryInfo=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,this._geometryInfo=s,e.readFields(AY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,mY=e.readVarint()+e.pos,xg=1,mM=0,dF=0,pF=0,Yb=0;let r=[],i=[];for(;e.pos<mY;)if(mM<=0&&(fF=e.readVarint(),xg=fF&7,mM=fF>>3),mM--,xg===1||xg===2)dF+=e.readSVarint(),pF+=e.readSVarint(),xg===1&&r.push(Yb),i.push(dF,pF),Yb+=2;else if(xg===7){if(Yb>0){let n=r[r.length-1];i.push(i[n],i[n+1]),Yb+=2}}else throw new Error(`unknown command ${xg}`);return{data:i,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),i;e(r.data,this);let n=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,i={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/n,i={type:"LineString",...r};break;case 3:i=dY(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/n;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;return this._toBinaryCoordinates(u=>pY(u,s,l,o))}};var Zb=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(wbe,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new Kb(this._pbf,i,this.extent,this._keys,this._values,r)}};function wbe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(Tbe(r)))}function Tbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Jb=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(Ebe,{},r)}};function Ebe(t,e,r){if(t===3&&r){let i=new Zb(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function gM(t,e){var r,i;let n=Cbe(e),o=(e==null||(r=e.gis)===null||r===void 0?void 0:r.format)||(e==null||(i=e.mvt)===null||i===void 0?void 0:i.shape)||e?.shape;switch(o){case"columnar-table":return{shape:"columnar-table",data:AF(t,n)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:gY(t,n)};case"geojson":return gY(t,n);case"binary-geometry":return AF(t,n);case"binary":return AF(t,n);default:throw new Error(o||"undefined shape")}}function AF(t,e){let[r,i]=Sbe(t,e),n=lF(r,i);return n.byteLength=t.byteLength,n}function Sbe(t,e){let r=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,i];let n=new Jb(new mF.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(s=>{let l=n.layers[s];if(l)for(let u=0;u<l.length;u++){let f=l.feature(u,i),v=Ibe(f,e,s);r.push(v)}}),[r,i]}function gY(t,e){if(t.byteLength<=0)return[];let r=[],i=new Xb(new mF.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let l=0;l<s.length;l++){let u=s.feature(l),f=Mbe(u,e,o);r.push(f)}}),r}function Cbe(t){var e;if(!(t!=null&&t.mvt))throw new Error("mvt options required");let r=((e=t.mvt)===null||e===void 0?void 0:e.coordinates)==="wgs84",{tileIndex:i}=t.mvt,n=i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z);if(r&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function Mbe(t,e,r){let i=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:Pbe);return e.layerProperty&&(i.properties[e.layerProperty]=r),i}function Ibe(t,e,r){let i=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:Rbe);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=r),i}function Pbe(t,e){let{extent:r}=e;for(let i=0;i<t.length;i++){let n=t[i];n[0]/=r,n[1]/=r}}function Rbe(t,e){let{extent:r}=e;for(let i=0,n=t.length;i<n;++i)t[i]/=r}var Bbe="4.1.4",_M={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:Bbe,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},Obe={..._M,parse:async(t,e)=>gM(t,e),parseSync:gM,binary:!0};var Dbe={Point:_Y,MultiPoint:Lbe,LineString:yY,MultiLineString:Fbe,Polygon:vY,MultiPolygon:Nbe};function _Y([t,e],[r,i],n){let o=Oa(r[0],i[0],t),s=Oa(r[1],i[1],e);return n.unprojectFlat([o,s])}function gF(t,e,r){return t.map(i=>_Y(i,e,r))}function Lbe(t,e,r){return gF(t,e,r)}function yY(t,e,r){return gF(t,e,r)}function Fbe(t,e,r){return t.map(i=>yY(i,e,r))}function vY(t,e,r){return t.map(i=>gF(i,e,r))}function Nbe(t,e,r){return t.map(i=>vY(i,e,r))}function xY(t,e,r){let i=r.projectFlat([e.west,e.north]),n=r.projectFlat([e.east,e.south]),o=[i,n];return{...t,coordinates:Dbe[t.type](t.coordinates,o,r)}}var kbe=["points","lines","polygons"];function _F(t,e,r,i){for(let n of kbe){let o=t[n]&&Ube(t[n],e,r,i);if(o>=0)return o}return-1}function Ube(t,e,r,i){let n=t.featureIds.value;if(!n.length)return-1;let o=0,s=n[n.length-1]+1;if(i){let u=zbe(t,i);if(u)o=u[0],s=u[1]+1;else return-1}let l=-1;if(e in t.numericProps){let u=t.numericProps[e].value.findIndex((f,v)=>f===r&&n[v]>=o&&n[v]<s);return u>=0?t.globalFeatureIds.value[u]:-1}else e?l=bY(t.properties,u=>u[e]===r,o,s):t.fields&&(l=bY(t.fields,u=>u.id===r,o,s));return l>=0?Vbe(t,l):-1}function zbe(t,e){if(!t.__layers){let r={},{properties:i}=t;for(let n=0;n<i.length;n++){let{layerName:o}=i[n];o&&(r[o]?r[o][1]=n:r[o]=[n,n])}t.__layers=r}return t.__layers[e]}function Vbe(t,e){if(!t.__ids){let r=[],i=t.featureIds.value,n=t.globalFeatureIds.value;for(let o=0;o<i.length;o++)r[i[o]]=n[o];t.__ids=r}return t.__ids[e]}function bY(t,e,r,i){for(let n=r;n<i;n++)if(e(t[n],n))return n;return-1}var yF=512,jbe={...Of.defaultProps,data:iA,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[_M],binary:!0},yM=class extends Ff{initializeState(){super.initializeState();let e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return Boolean(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:r,context:i,changeFlags:n}){n.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:i,changeFlags:n}),this._setWGS84PropertyForTiles());let{highlightColor:o}=e;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,r=null;if(typeof e=="string"&&!PD(e)){let{onDataLoad:i,fetch:n}=this.props;this.setState({data:null,tileJSON:null});try{r=await n(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}i&&i(r,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(r=e);r&&(e=r.tiles),this.setState({data:e,tileJSON:r})}_getTilesetOptions(){let e=super._getTilesetOptions(),r=this.state.tileJSON,{minZoom:i,maxZoom:n}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>i&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(n)||r.maxzoom<n)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:i}=this.state,{index:n,signal:o}=e,s=Lf(r,e);if(!s)return Promise.reject("Invalid URL");let l=this.getLoadOptions(),{fetch:u}=this.props;return l={...l,mimeType:"application/x-protobuf",mvt:{...l?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:n},gis:i?{format:"binary"}:{}},u(s,{propName:"data",layer:this,loadOptions:l,signal:o})}renderSubLayers(e){let{x:r,y:i,z:n}=e.tile.index,o=Math.pow(2,n),s=yF/o,l=-s,u=yF*r/o,f=yF*(1-i/o),v=new Yr().scale([s,l,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=v,e.coordinateOrigin=[u,f,0],e.coordinateSystem=Kr.CARTESIAN,e.extensions=[...e.extensions||[],new cy]);let T=super.renderSubLayers(e);return this.state.binary&&!(T instanceof Of)&&ur.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),T}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:i,hoveredFeatureLayerName:n}=this.state,o=e.object,s=null,l=null;o&&(s=vF(o,r),l=wY(o));let{highlightColor:u}=this.props;typeof u=="function"&&(u=u(e)),(i!==s||n!==l)&&this.setState({highlightColor:u,hoveredFeatureId:s,hoveredFeatureLayerName:l})}getPickingInfo(e){let r=super.getPickingInfo(e),i=Boolean(this.context.viewport.resolution);if(this.state.binary&&r.index!==-1){let{data:n}=e.sourceLayer.props;r.object=dM(n,{globalFeatureId:r.index})}return r.object&&!i&&(r.object=EY(r.object,r.tile.bbox,this.context.viewport)),r}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){let{hoveredFeatureId:r,hoveredFeatureLayerName:i,binary:n}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,l=e.content,u=TY(s);if(!(TY(r)||u))return-1;let v=u?s:r;return Array.isArray(l)?l.findIndex(T=>{let E=vF(T,o)===v,M=u||wY(T)===i;return E&&M}):l&&n?_F(l,o,v,u?"":i):-1}_pickObjects(e){let{deck:r,viewport:i}=this.context,n=i.width,o=i.height,s=i.x,l=i.y,u=[this.id];return r.pickObjects({x:s,y:l,width:n,height:o,layerIds:u,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),i=new Set,n=[];for(let o of r){let s=vF(o.object,this.props.uniqueIdProperty);s===void 0?n.push(o.object):i.has(s)||(i.add(s),n.push(o.object))}return n}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(i=>{i.hasOwnProperty(e)||Object.defineProperty(i,e,{get:()=>{if(!i.content)return null;if(this.state.binary&&Array.isArray(i.content)&&!i.content.length)return[];let{bbox:n}=i;if(i._contentWGS84===void 0&&RD(n)){let o=this.state.binary?dM(i.content):i.content;i._contentWGS84=o.map(s=>EY(s,n,this.context.viewport))}return i._contentWGS84}})})}},Qb=yM;(()=>{yM.layerName="MVTLayer"})(),(()=>{yM.defaultProps=jbe})();function vF(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function wY(t){return t.properties?.layerName||null}function TY(t){return t!=null&&t!==""}function EY(t,e,r){let i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>xY(t.geometry,e,r).coordinates}),i}var SY="0123456789bcdefghjkmnpqrstuvwxyz",CY={};for(let t=0;t<SY.length;t++)CY[SY.charAt(t)]=t;var Hbe=-90,Gbe=90,Wbe=-180,qbe=180;function Xbe(t){let e=!0,r=Gbe,i=Hbe,n=qbe,o=Wbe,s,l=0;for(let u=0,f=t.length;u<f;u++){let v=t[u].toLowerCase();l=CY[v];for(let T=4;T>=0;T--){let E=l>>T&1;e?(s=(n+o)/2,E===1?o=s:n=s):(s=(r+i)/2,E===1?i=s:r=s),e=!e}}return[i,o,r,n]}function MY(t){let[e,r,i,n]=Xbe(t);return[n,i,n,e,r,e,r,i,n,i]}var Ybe={getGeohash:{type:"accessor",value:t=>t.geohash}},vM=class extends nu{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(i,n)=>MY(r(i,n))}}},$b=vM;(()=>{vM.layerName="GeohashLayer"})(),(()=>{vM.defaultProps=Ybe})();function fy(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function PY(t,e){let r=Zbe(e),i=t;for(let n of r)i=Kbe(i)?i[n]:void 0;return i}function Kbe(t){return t!==null&&typeof t=="object"}var IY={};function Zbe(t){if(typeof t=="string"){let e=IY[t];return e||(e=t.split("."),IY[t]=e),e}return Array.isArray(t)?t:[t]}var bF={};As(bF,{addBinaryOp:()=>twe,addUnaryOp:()=>ewe,compile:()=>Qbe,compileAsync:()=>$be,eval:()=>el,evalAsync:()=>tw,parse:()=>LY.default});var dy=ga(xF()),LY=ga(xF()),tw=function t(e,r){try{var i,n=e;switch(n.type){case"ArrayExpression":return Promise.resolve(BY(n.elements,r));case"BinaryExpression":return Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(M){return py[n.operator](M[0],M[1])});case"CallExpression":var o,s,l,u=function(){if(typeof s=="function"){var M=s,O=M.apply,F=o;return Promise.resolve(BY(n.arguments,r)).then(function(U){return Promise.resolve(O.call(M,F,U))})}},f=n.callee.type==="MemberExpression"?Promise.resolve(RY(n.callee,r)).then(function(M){o=(l=M)[0],s=l[1]}):Promise.resolve(t(n.callee,r)).then(function(M){s=M});return Promise.resolve(f&&f.then?f.then(u):u());case"ConditionalExpression":return Promise.resolve(t(n.test,r)).then(function(M){return Promise.resolve(t(M?n.consequent:n.alternate,r))});case"Identifier":return Promise.resolve(r[n.name]);case"Literal":return Promise.resolve(n.value);case"LogicalExpression":var v=function(M){return i?M:Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(O){return py[n.operator](O[0],O[1])})},T=n.operator==="||"?(i=1,Promise.resolve(t(n.left,r)).then(function(M){return M||Promise.resolve(t(n.right,r))})):function(){if(n.operator==="&&")return i=1,Promise.resolve(t(n.left,r)).then(function(M){return M&&Promise.resolve(t(n.right,r))})}();return Promise.resolve(T&&T.then?T.then(v):v(T));case"MemberExpression":return Promise.resolve(RY(n,r)).then(function(M){return M[1]});case"ThisExpression":return Promise.resolve(r);case"UnaryExpression":var E=bM[n.operator];return Promise.resolve(t(n.argument,r)).then(function(M){return E.call(bM,M)});default:return Promise.resolve(void 0)}}catch(M){return Promise.reject(M)}},RY=function(t,e){try{return Promise.resolve(tw(t.object,e)).then(function(r){function i(){if(/^__proto__|prototype|constructor$/.test(n))throw Error('Access to member "'+n+'" disallowed.');return[r,r[n]]}var n,o=function(){if(t.computed)return Promise.resolve(tw(t.property,e)).then(function(s){n=s});n=t.property.name}();return o&&o.then?o.then(i):i()})}catch(r){return Promise.reject(r)}},BY=function(t,e){try{return Promise.resolve(Promise.all(t.map(function(r){return tw(r,e)})))}catch(r){return Promise.reject(r)}},Jbe={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},py={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},bM={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function OY(t,e){return t.map(function(r){return el(r,e)})}function DY(t,e){var r,i=el(t.object,e);if(r=t.computed?el(t.property,e):t.property.name,/^__proto__|prototype|constructor$/.test(r))throw Error('Access to member "'+r+'" disallowed.');return[i,i[r]]}function el(t,e){var r=t;switch(r.type){case"ArrayExpression":return OY(r.elements,e);case"BinaryExpression":return py[r.operator](el(r.left,e),el(r.right,e));case"CallExpression":var i,n,o;return r.callee.type==="MemberExpression"?(i=(o=DY(r.callee,e))[0],n=o[1]):n=el(r.callee,e),typeof n!="function"?void 0:n.apply(i,OY(r.arguments,e));case"ConditionalExpression":return el(r.test,e)?el(r.consequent,e):el(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?el(r.left,e)||el(r.right,e):r.operator==="&&"?el(r.left,e)&&el(r.right,e):py[r.operator](el(r.left,e),el(r.right,e));case"MemberExpression":return DY(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return bM[r.operator](el(r.argument,e));default:return}}function Qbe(t){return el.bind(null,(0,dy.default)(t))}function $be(t){return tw.bind(null,(0,dy.default)(t))}function ewe(t,e){dy.default.addUnaryOp(t),bM[t]=e}function twe(t,e,r){r?(dy.default.addBinaryOp(t,e),py[t]=r):(dy.default.addBinaryOp(t,Jbe[t]||1),py[t]=e)}var{parse:rwe,eval:iwe}=bF,wF={"-":t=>t};function bg(t,e){if(t in wF)return wF[t];let r,i=rwe(t);return i.type==="Identifier"?r=n=>PY(n,t):(TF(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>iwe(i,n)),wF[t]=r,r}function TF(t,e){if(Array.isArray(t))t.forEach(r=>TF(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)TF(t[r],e)}}var Ay="@@=",EF="@@#",FY="@@type",wM="@@function";var NY=t=>t&&typeof t=="object",Yd=class{constructor(...e){this.typeKey=FY,this.functionKey=wM,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=bg,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(let r of e)this.merge(r)}merge(e){for(let r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){let i=e[r];this[r]=NY(this[r])?Object.assign(this[r],i):i}}}validate(e){return fy(!this.typeKey||typeof this.typeKey=="string"),fy(NY(this.classes)),!0}};function nwe(t){return typeof t=="string"&&t.startsWith(Ay)}function owe(t){return t.replace(Ay,"")}function my(t,e){let r={};for(let i in t){let n=t[i];nwe(n)&&(n=owe(n),n=bg(n,e)),r[i]=n}return r}function kY(t,e,r){let i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){let{log:o}=r;if(o){let s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?swe(i,e,r):awe(n,e,r)}function swe(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=my(e,r),new t(e)}function awe(t,e,r){let{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=my(e,r),i.createElement(t,e,n)}function UY(t,e,r){let i=r.functions[t];if(!i){let{log:n}=r;if(n){let o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function SF(t){return typeof t=="string"?JSON.parse(t):t}var CF=t=>t&&typeof t=="object",wg=class{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Yd?e.configuration:new Yd(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;let r=SF(e),i=lwe(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}};function lwe(t,e){return e=new Yd(e),MF(t,"",e)}function MF(t,e,r){return Array.isArray(t)?t.map((i,n)=>MF(i,String(n),r)):cwe(t,r)?uwe(t,r):CF(t)?wM in t?hwe(t,r):IF(t,r):typeof t=="string"?fwe(t,e,r):t}function cwe(t,e){let{typeKey:r}=e;return CF(t)&&Boolean(t[r])}function uwe(t,e){let{typeKey:r}=e,i=t[r],n={...t};return delete n[r],n=IF(n,e),kY(i,n,e)}function hwe(t,e){let{functionKey:r}=e,i=t[r],n={...t};return delete n[r],n=IF(n,e),UY(i,n,e)}function IF(t,e){fy(CF(t));let r={};for(let i in t){let n=t[i];r[i]=MF(n,i,e)}return r}function fwe(t,e,r){if(t.startsWith(Ay)&&r.convertFunction)return t=t.replace(Ay,""),r.convertFunction(t,r);if(t.startsWith(EF)){if(t=t.replace(EF,""),r.constants[t])return r.constants[t];let[i,n]=t.split(".");return r.enumerations[i][n]}return t}var gy={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},Vf=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:i}){e&&(gy.onInitialize=e),r&&(gy.onFinalize=r),i&&(gy.onMessage=i)}constructor(e="Transport"){this._messageQueue=[],this.userData={},this._destroyed=!1,this.name=e}getRootDOMElement(){return typeof document<"u"?document.body:null}sendJSONMessage(){console.error("Back-channel not implemented for this transport")}sendBinaryMessage(){console.error("Back-channel not implemented for this transport")}_initialize(e={}){let r={transport:this,...e};gy.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};gy.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),gy.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(i,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch{return}r.add(n)}return n})}};function zY(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!(r in e)||t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}var TM=class{constructor(e){this.map=null,this.width=0,this.height=0,this.props={...e},this._initialize(this.props)}finalize(){this.map?.remove(),this.map=null}setProps(e){let r=this.props,i={...this.props,...e};if(this.props=i,!this.map)return;this._update(r,i)&&this.redraw()}redraw(){let e=this.map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this.map}_initialize(e){let{mapLib:r}=e;r.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({maxZoom:24,...e.mapOptions,...VY(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1});let{container:i}=e;Object.defineProperty(i,"offsetWidth",{get:()=>this.width}),Object.defineProperty(i,"clientWidth",{get:()=>this.width}),Object.defineProperty(i,"offsetHeight",{get:()=>this.height}),Object.defineProperty(i,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,r){e.mapStyle!==r.mapStyle&&this.map.setStyle(r.mapStyle);let n=e.width!==r.width||e.height!==r.height;n&&(this.width=r.width,this.height=r.height,this.map.resize());let o=e.viewState,s=r.viewState,l=s.latitude!==o.latitude||s.longitude!==o.longitude||s.zoom!==o.zoom||s.pitch!==o.pitch||s.bearing!==o.bearing;return l&&this.map.jumpTo(VY(s)),n||l}};function VY(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing??0,pitch:t.pitch??0}}var jY={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function dwe(t){let{container:e=document.body}=t;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=document.createElement("div");e.appendChild(i),Object.assign(i.style,jY);let n=document.createElement("canvas");return e.appendChild(n),Object.assign(n.style,jY),{container:e,mapCanvas:i,deckCanvas:n}}var Tg=class extends Bd{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:i}=dwe(e),n=e.viewState||e.initialViewState,o=Number.isFinite(n&&n.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:i,...e}),s&&s.Map?this._map=o&&new TM({...e,width:0,height:0,viewState:n,container:r,mapLib:s}):this._map=s}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map.setProps({mapStyle:e.mapStyle}),super.setProps(e)}_drawLayers(e,r){if(this._map){let i=this.getViewports()[0];i&&this._map.setProps({width:i.width,height:i.height,viewState:i})}super._drawLayers(e,r)}};Tc.registerDevices([Tf]);var HY=t=>t.charAt(0)===t.charAt(0).toUpperCase(),pwe=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function PF(t={},e){let r={},i=Object.keys(t).filter(e);for(let n of i)r[n]=t[n];return r}var Awe={classes:PF(rw,HY),enumerations:{COORDINATE_SYSTEM:Kr,GL:vf}};$A([Gv]);var lA=new wg({configuration:Awe});function mwe(t,e){let r={classes:PF(t,HY),functions:PF(t,pwe)};e.mergeConfiguration(r)}function gwe(t,e){if(!t)return;let r={};function i(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function n(o,s){mwe(s,lA),r[o]=s,i()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){n(o,window[o]);return}Object.defineProperty(window,o,{set:l=>n(o,l),get:()=>r[o]}),c5(s)})}function GY(t,e){let r=lA.convert(t);e.setProps(r)}function _we(t,e){return t.filter(r=>r&&r.id&&!e.find(i=>i.id===r.id))}function ywe({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:i,handleEvent:n,getTooltip:o,container:s}){let u={...n?{onClick:f=>n("deck-click-event",f),onHover:f=>n("deck-hover-event",f),onResize:f=>n("deck-resize-event",f),onViewStateChange:({viewState:f,interactionState:v,oldViewState:T})=>{let E=new Sc(f);f.nw=E.unproject([0,0]),f.se=E.unproject([E.width,E.height]),n("deck-view-state-change-event",f)},onDragStart:f=>n("deck-drag-start-event",f),onDrag:f=>n("deck-drag-event",f),onDragEnd:f=>n("deck-drag-end-event",f)}:null,getTooltip:o,container:s};switch(t){case"mapbox":return ur.info("Using Mapbox base maps")(),new Tg({...u,...e,map:W3,mapboxApiAccessToken:r,onLoad:l5});case"carto":return ur.info("Using Carto base maps")(),new Tg({map:W3,...u,...e});case"google_maps":return ur.info("Using Google Maps base maps")(),F9({...u,...e,googleMapsKey:i});default:return ur.info("No recognized map provider specified")(),new Tg({...u,...e,map:null,mapboxApiAccessToken:null})}}function EM({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:i,tooltip:n,handleEvent:o,customLibraries:s,configuration:l}){let u;try{l&&lA.mergeConfiguration(l);let f=i.layers||[],v=lA.convert(i);CO(r,v);let T=(v.layers||[]).filter(U=>U),E=_we(f,T),M=j3(n),{mapProvider:O}=v;u=ywe({mapProvider:O,props:v,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:M,container:r}),gwe(s,()=>{if(E.length){let G=(lA.convert({layers:i.layers}).layers||[]).filter(J=>J);G.length>T.length&&u.setProps({layers:G})}})}catch(f){console.error(f)}return u}function SM(){Vf.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:i,mapboxApiKey:n,jsonInput:o,tooltip:s}=wwe(t);a5();let l=t.getRootDOMElement(),u=n5(e,r);l.appendChild(u);let f=JSON.parse(o),v=EM({mapboxApiKey:n,container:u,jsonInput:f,tooltip:s,handleEvent:(T,E)=>bwe(t,T,E),customLibraries:i});t.userData.deck=v},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:i}){let{deck:n}=t.userData,o;switch(e){case"json":o=lA.convert(r),n.setProps(o);break;case"json-with-binary":o=lA.convert(r);let s=t.jupyterModel.get("data_buffer"),l=vwe({binary:s,convertedJson:o});n.setProps(l);break;default:}}})}function vwe({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let i=e.layers[r].id,n=e.layers[r];e.layers[r]=n.clone({data:t[i]})}return e}function xwe(t,e){return e instanceof Dn?e.id:e}function bwe(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let i=JSON.parse(JSON.stringify(r,xwe));t.sendJSONMessage(e,i)}function wwe(t){let{jupyterModel:e}=t;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}var Eg=class extends Vf{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let i=Vf._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(i)}};var $w={};As($w,{CONTROL_COMM_PROTOCOL_VERSION:()=>BQ,CONTROL_COMM_TARGET:()=>RQ,CONTROL_COMM_TIMEOUT:()=>OQ,DOMWidgetModel:()=>lk,DOMWidgetView:()=>ck,IJupyterWidgetRegistry:()=>eIe,JUPYTER_WIDGETS_VERSION:()=>NM,JupyterPhosphorPanelWidget:()=>qMe,JupyterPhosphorWidget:()=>kee,LayoutModel:()=>XMe,LayoutView:()=>YMe,ManagerBase:()=>dMe,PROTOCOL_VERSION:()=>kM,StyleModel:()=>KMe,StyleView:()=>ZMe,ViewList:()=>$Me,WidgetModel:()=>IA,WidgetView:()=>fv,WrappedError:()=>uMe,assign:()=>Kd,base64ToBuffer:()=>eN,bufferToBase64:()=>$F,bufferToHex:()=>fMe,difference:()=>FM,hexToBuffer:()=>QF,isEqual:()=>My,pack_models:()=>ak,put_buffers:()=>cA,reject:()=>Gf,remove_buffers:()=>fw,resolvePromisesDict:()=>Iy,serialize_state:()=>DQ,shims:()=>uk,unpack_models:()=>Qw,uuid:()=>hw});var LM=ga(XY()),SQ=ga(_y()),CQ=ga(vQ()),MQ=ga(EQ()),cMe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),DM=function(){return DM=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},DM.apply(this,arguments)};function FM(t,e){return t.filter(function(r){return e.indexOf(r)===-1})}function My(t,e){return(0,CQ.default)(t,e)}var Kd=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};function hw(){return SQ.UUID.uuid4()}var uMe=function(t){cMe(e,t);function e(r,i){var n=t.call(this,r)||this;return console.warn("WrappedError has been deprecated!"),i instanceof e?n.error_stack=i.error_stack:n.error_stack=[i],n.error_stack.push(n),n}return e}(Error);function Iy(t){var e=Object.keys(t),r=[];return e.forEach(function(i){r.push(t[i])}),Promise.all(r).then(function(i){for(var n={},o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function Gf(t,e){return function(i){throw e&&console.error(new Error(t)),i}}function cA(t,e,r){for(var i=0;i<e.length;i++){for(var n=e[i],o=t,s=0;s<n.length-1;s++)o=o[n[s]];o[n[n.length-1]]=r[i]}}function fw(t){var e=[],r=[];function i(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o))for(var l=!1,u=0;u<o.length;u++){var f=o[u];if(f)if(f instanceof ArrayBuffer||ArrayBuffer.isView(f))l||(o=o.slice(),l=!0),e.push(ArrayBuffer.isView(f)?f.buffer:f),r.push(s.concat([u])),o[u]=null;else{var v=i(f,s.concat([u]));v!==f&&(l||(o=o.slice(),l=!0),o[u]=v)}}else if((0,MQ.default)(o))for(var T in o){var l=!1;if(o.hasOwnProperty(T)){var f=o[T];if(f)if(f instanceof ArrayBuffer||ArrayBuffer.isView(f))l||(o=DM({},o),l=!0),e.push(ArrayBuffer.isView(f)?f.buffer:f),r.push(s.concat([T])),delete o[T];else{var v=i(f,s.concat([T]));v!==f&&(l||(o=DM({},o),l=!0),o[T]=v)}}}return o}var n=i(t,[]);return{state:n,buffers:e,buffer_paths:r}}var hMe=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"];function fMe(t){for(var e=new Uint8Array(t),r=[],i=0;i<e.length;i++)r.push(hMe[e[i]]);return r.join("")}function QF(t){for(var e=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function $F(t){return(0,LM.fromByteArray)(new Uint8Array(t))}function eN(t){return(0,LM.toByteArray)(t).buffer}var PQ=ga(_y());var NM="1.2.0",kM="2.1.0";var dw=function(){return dw=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},dw.apply(this,arguments)},uA=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(v){try{f(i.next(v))}catch(T){s(T)}}function u(v){try{f(i.throw(v))}catch(T){s(T)}}function f(v){v.done?o(v.value):n(v.value).then(l,u)}f((i=i.apply(t,e||[])).next())})},hA=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(f){return function(v){return u([f,v])}}function u(f){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=f[0]&2?n.return:f[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,f[1])).done)return o;switch(n=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,n=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],n=0}finally{i=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},IQ=kM.split(".",1)[0],RQ="jupyter.widget.control",BQ="1.0.0",OQ=4e3,dMe=function(){function t(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}return t.prototype.display_model=function(e,r,i){var n=this;return i===void 0&&(i={}),this.create_view(r,i).then(function(o){return n.display_view(e,o,i)}).catch(Gf("Could not create view",!0))},t.prototype.setViewOptions=function(e){return e===void 0&&(e={}),e},t.prototype.create_view=function(e,r){var i=this;r===void 0&&(r={});var n=e.state_change=e.state_change.then(function(){return i.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(function(s){var l=new s({model:e,options:i.setViewOptions(r)});return l.listenTo(e,"destroy",l.remove),Promise.resolve(l.render()).then(function(){return l})}).catch(Gf("Could not create a view for model id "+e.model_id,!0))}),o=hw();return e.views[o]=n,n.then(function(s){s.once("remove",function(){delete s.model.views[o]},i)}),e.state_change},t.prototype.callbacks=function(e){return{}},t.prototype.get_model=function(e){return this._models[e]},t.prototype.has_model=function(e){return this._models[e]!==void 0},t.prototype.handle_comm_open=function(e,r){var i=(r.metadata||{}).version||"";if(i.split(".",1)[0]!==IQ){var n="Wrong widget protocol version: received protocol version '"+i+"', but was expecting major version '"+IQ+"'";return console.error(n),Promise.reject(n)}var o=r.content.data,s=o.buffer_paths||[],l=(r.buffers||[]).map(function(u){return u instanceof DataView?u:new DataView(u instanceof ArrayBuffer?u:u.buffer)});return cA(o.state,s,l),this.new_model({model_name:o.state._model_name,model_module:o.state._model_module,model_module_version:o.state._model_module_version,comm:e},o.state).catch(Gf("Could not create a model.",!0))},t.prototype.new_widget=function(e,r){var i=this;r===void 0&&(r={});var n;if(e.view_name===void 0||e.view_module===void 0||e.view_module_version===void 0)return Promise.reject("new_widget(...) must be given view information in the options.");e.comm?n=Promise.resolve(e.comm):n=this._create_comm(this.comm_target_name,e.model_id,{state:{_model_module:e.model_module,_model_module_version:e.model_module_version,_model_name:e.model_name,_view_module:e.view_module,_view_module_version:e.view_module_version,_view_name:e.view_name}},{version:kM});var o=dw({},e);return n.then(function(s){o.comm=s;var l=i.new_model(o,r);return l.then(function(u){return u.sync("create",u),u})},function(){return o.model_id||(o.model_id=hw()),i.new_model(o,r)})},t.prototype.register_model=function(e,r){var i=this;this._models[e]=r,r.then(function(n){n.once("comm:close",function(){delete i._models[e]})})},t.prototype.new_model=function(e,r){return r===void 0&&(r={}),uA(this,void 0,void 0,function(){var i,n;return hA(this,function(o){switch(o.label){case 0:if(e.model_id)i=e.model_id;else if(e.comm)i=e.model_id=e.comm.comm_id;else throw new Error("Neither comm nor model_id provided in options object. At least one must exist.");return n=this._make_model(e,r),this.register_model(i,n),[4,n];case 1:return[2,o.sent()]}})})},t.prototype._make_model=function(e,r){return r===void 0&&(r={}),uA(this,void 0,void 0,function(){var i,n,o,s,l,u,f;return hA(this,function(v){switch(v.label){case 0:i=e.model_id,n=this.loadClass(e.model_name,e.model_module,e.model_module_version),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,n];case 2:return o=v.sent(),[3,4];case 3:throw s=v.sent(),console.error("Could not instantiate widget"),s;case 4:if(!o)throw new Error("Cannot find model module "+e.model_module+"@"+e.model_module_version+", "+e.model_name);return[4,o._deserialize_state(r,this)];case 5:return l=v.sent(),u={widget_manager:this,model_id:i,comm:e.comm},f=new o(l,u),f.name=e.model_name,f.module=e.model_module,[2,f]}})})},t.prototype._loadFromKernel=function(){return uA(this,void 0,void 0,function(){var e,r,i,n,o,s,l,u,f,v,T,E,M,O=this;return hA(this,function(F){switch(F.label){case 0:return F.trys.push([0,3,,4]),[4,this._create_comm(RQ,hw(),{},{version:BQ})];case 1:return i=F.sent(),[4,new Promise(function(U,G){i.on_msg(function(J){if(e=J.content.data,e.method!=="update_states"){console.warn(`
3677
+ `},uM=class extends Fm{getShaders(){let e="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(e=Boolean(this.props.clipByInstance)),this.state.clipByInstance=e,e?{modules:[L1e],inject:F1e}:{modules:[N1e],inject:k1e}}draw({uniforms:e}){let{clipBounds:r}=this.props;if(this.state.clipByInstance)e.clip_bounds=r;else{let i=this.projectPosition([r[0],r[1],0]),n=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],n[0]),Math.min(i[1],n[1]),Math.max(i[0],n[0]),Math.max(i[1],n[1])]}}},cy=uM;(()=>{uM.defaultProps=D1e})(),(()=>{uM.extensionName="ClipExtension"})();function lF(t,e,r){let i=U1e(t),n=Object.keys(i).filter(o=>i[o]!==Array);return z1e(t,{propArrayTypes:i,...e},{numericPropKeys:r&&r.numericPropKeys||n,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function U1e(t){let e={};for(let r of t)if(r.properties)for(let i in r.properties){let n=r.properties[i];e[i]=q1e(n,e[i])}return e}function z1e(t,e,r){let{pointPositionsCount:i,pointFeaturesCount:n,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:l,polygonPositionsCount:u,polygonObjectsCount:f,polygonRingsCount:v,polygonFeaturesCount:T,propArrayTypes:E,coordLength:M}=e,{numericPropKeys:O=[],PositionDataType:F=Float32Array,triangulate:U=!0}=r,G=t[0]&&"id"in t[0],J=t.length>65535?Uint32Array:Uint16Array,K={type:"Point",positions:new F(i*M),globalFeatureIds:new J(i),featureIds:n>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},ne={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new F(o*M),globalFeatureIds:new J(o),featureIds:l>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},ge={type:"Polygon",polygonIndices:u>65535?new Uint32Array(f+1):new Uint16Array(f+1),primitivePolygonIndices:u>65535?new Uint32Array(v+1):new Uint16Array(v+1),positions:new F(u*M),globalFeatureIds:new J(u),featureIds:T>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};U&&(ge.triangles=[]);for(let me of[K,ne,ge])for(let he of O){let $=E[he];me.numericProps[he]=new $(me.positions.length/M)}ne.pathIndices[s]=o,ge.polygonIndices[f]=u,ge.primitivePolygonIndices[v]=u;let H={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let me of t){let he=me.geometry,$=me.properties||{};switch(he.type){case"Point":V1e(he,K,H,M,$),K.properties.push(aF($,O)),G&&K.fields.push({id:me.id}),H.pointFeature++;break;case"LineString":j1e(he,ne,H,M,$),ne.properties.push(aF($,O)),G&&ne.fields.push({id:me.id}),H.lineFeature++;break;case"Polygon":H1e(he,ge,H,M,$),ge.properties.push(aF($,O)),G&&ge.fields.push({id:me.id}),H.polygonFeature++;break;default:throw new Error("Invalid geometry type")}H.feature++}return W1e(K,ne,ge,M)}function V1e(t,e,r,i,n){e.positions.set(t.data,r.pointPosition*i);let o=t.data.length/i;cF(e,n,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function j1e(t,e,r,i,n){e.positions.set(t.data,r.linePosition*i);let o=t.data.length/i;cF(e,n,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=t.indices[s],f=s===l-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(f-u)/i}}function H1e(t,e,r,i,n){e.positions.set(t.data,r.polygonPosition*i);let o=t.data.length/i;cF(e,n,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=r.polygonPosition;e.polygonIndices[r.polygonObject++]=u;let f=t.areas[s],v=t.indices[s],T=t.indices[s+1];for(let M=0,O=v.length;M<O;++M){let F=v[M],U=M===O-1?T===void 0?t.data.length:T[0]:v[M+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(U-F)/i}let E=r.polygonPosition;G1e(e,f,v,{startPosition:u,endPosition:E,coordLength:i})}}function G1e(t,e,r,i){let{startPosition:n,endPosition:o,coordLength:s}=i;if(!t.triangles)return;let l=n*s,u=o*s,f=t.positions.subarray(l,u),v=r[0],T=r.slice(1).map(M=>(M-v)/s),E=PO(f,T,s,e);for(let M=0,O=E.length;M<O;++M)t.triangles.push(n+E[M])}function sF(t,e){let r={};for(let i in t)r[i]={value:t[i],size:e};return r}function W1e(t,e,r,i){let n={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:sF(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:sF(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:i},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:sF(r.numericProps,1)}};return n.polygons&&r.triangles&&(n.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),n}function cF(t,e,r,i){for(let n in t.numericProps)if(n in e){let o=e[n];t.numericProps[n].fill(o,r,r+i)}}function aF(t,e){let r={};for(let i in t)e.includes(i)||(r[i]=t[i]);return r}function q1e(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function dM(t,e){let r=e?.globalFeatureId;return r!==void 0?X1e(t,r):Y1e(t,e?.type)}function X1e(t,e){let r=rY(t);for(let i of r){let n=0,o=i.featureIds.value[0];for(let s=0;s<i.featureIds.value.length;s++){let l=i.featureIds.value[s];if(l!==o){if(e===i.globalFeatureIds.value[n])return hM(i,n,s);n=s,o=l}}if(e===i.globalFeatureIds.value[n])return hM(i,n,i.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function Y1e(t,e){let r=rY(t,e);return K1e(r)}function tY(t,e,r){switch(t.type){case"Point":return $1e(t,e,r);case"LineString":return Q1e(t,e,r);case"Polygon":return iY(t,e,r);default:let i=t;throw new Error(`Unsupported geometry type: ${i?.type}`)}}function rY(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function K1e(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let i=0,n=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==n&&(e.push(hM(r,i,o)),i=o,n=s)}e.push(hM(r,i,r.featureIds.value.length))}return e}function hM(t,e,r){let i=tY(t,e,r),n=J1e(t,e,r),o=Z1e(t,e,r);return{type:"Feature",geometry:i,properties:n,...o}}function Z1e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[e]]}function J1e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=Object.assign({},t.properties[t.featureIds.value[e]]);for(let n in t.numericProps)i[n]=t.numericProps[n].value[e];return i}function iY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.polygonIndices.value.filter(u=>u>=e&&u<=r),o=t.primitivePolygonIndices.value.filter(u=>u>=e&&u<=r);if(!(n.length>2)){let u=[];for(let f=0;f<o.length-1;f++){let v=o[f],T=o[f+1],E=fM(i,v,T);u.push(E)}return{type:"Polygon",coordinates:u}}let l=[];for(let u=0;u<n.length-1;u++){let f=n[u],v=n[u+1],T=iY(t,f,v).coordinates;l.push(T)}return{type:"MultiPolygon",coordinates:l}}function Q1e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,{positions:i}=t,n=t.pathIndices.value.filter(l=>l>=e&&l<=r);if(!(n.length>2))return{type:"LineString",coordinates:fM(i,n[0],n[1])};let s=[];for(let l=0;l<n.length-1;l++){let u=fM(i,n[l],n[l+1]);s.push(u)}return{type:"MultiLineString",coordinates:s}}function $1e(t,e,r){let{positions:i}=t,n=fM(i,e,r);return n.length>1?{type:"MultiPoint",coordinates:n}:{type:"Point",coordinates:n[0]}}function fM(t,e,r){e=e||0,r=r||t.value.length/t.size;let i=[];for(let n=e;n<r;n++){let o=Array();for(let s=n*t.size;s<(n+1)*t.size;s++)o.push(Number(t.value[s]));i.push(o)}return i}var mF=ga(uY(),1);function hY(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let o=0;o<e;o++){let s=gbe(t[o]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&r.push(i),r}function gbe(t){let e=0;for(let r=0,i=t.length-1,n,o;r<t.length;i=r++)n=t[r],o=t[i],e+=(o[0]-n[0])*(n[1]+o[1]);return e}function fY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?_be(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function _be(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var vg=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,i,n,o){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(fY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=[],u;for(;e.pos<r;){if(n<=0){let f=e.readVarint();i=f&7,n=f>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(u&&l.push(u),u=[]),u&&u.push([o,s]);else if(i===7)u&&u.push(u[0].slice());else throw new Error(`unknown command ${i}`)}return u&&l.push(u),l}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=1/0,u=-1/0,f=1/0,v=-1/0;for(;e.pos<r;){if(n<=0){let T=e.readVarint();i=T&7,n=T>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<l&&(l=o),o>u&&(u=o),s<f&&(f=s),s>v&&(v=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[l,f,u,v]}_toGeoJSON(e){let r=this.loadGeometry(),i=vg.types[this.type],n,o;switch(this.type){case 1:let l=[];for(n=0;n<r.length;n++)l[n]=r[n][0];r=l,e(r,this);break;case 2:for(n=0;n<r.length;n++)e(r[n],this);break;case 3:for(r=hY(r),n=0;n<r.length;n++)for(o=0;o<r[n].length;o++)e(r[n][o],this);break}r.length===1?r=r[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;function u(f){for(let v=0;v<f.length;v++){let T=f[v];T[0]=(T[0]+s)*360/o-180;let E=180-(T[1]+l)*360/o;T[1]=360/Math.PI*Math.atan(Math.exp(E*Math.PI/180))-90}}return this._toGeoJSON(u)}};var qb=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ybe,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new vg(this._pbf,r,this.extent,this._keys,this._values)}};function ybe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(vbe(r)))}function vbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Xb=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(xbe,{},r)}};function xbe(t,e,r){if(t===3&&r){let i=new qb(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function dY(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[qp(t.data)]],indices:[t.indices]};let i=[],n=[],o=[],s=[],l,u=0;for(let f,v=0,T;v<e;v++){T=t.indices[v]-u,f=t.indices[v+1]-u||t.data.length;let E=t.data.slice(T,f),M=qp(E);if(M===0){let O=t.data.slice(0,T),F=t.data.slice(f);t.data=O.concat(F),u+=f-T;continue}l===void 0&&(l=M<0),l===M<0?(s.length&&(i.push(o),n.push(s)),s=[T],o=[M]):(o.push(M),s.push(T))}return o&&i.push(o),s.length&&n.push(s),{type:r,areas:i,indices:n,data:t.data}}function pY(t,e,r,i){for(let n=0,o=t.length;n<o;n+=2){t[n]=(t[n]+e)*360/i-180;let s=180-(t[n+1]+r)*360/i;t[n+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function AY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?bbe(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function bbe(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var mY,xg,fF,mM,dF,pF,Yb;var Kb=class{constructor(e,r,i,n,o,s){this.properties=void 0,this.extent=void 0,this.type=void 0,this.id=void 0,this._pbf=void 0,this._geometry=void 0,this._keys=void 0,this._values=void 0,this._geometryInfo=void 0,this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,this._geometryInfo=s,e.readFields(AY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,mY=e.readVarint()+e.pos,xg=1,mM=0,dF=0,pF=0,Yb=0;let r=[],i=[];for(;e.pos<mY;)if(mM<=0&&(fF=e.readVarint(),xg=fF&7,mM=fF>>3),mM--,xg===1||xg===2)dF+=e.readSVarint(),pF+=e.readSVarint(),xg===1&&r.push(Yb),i.push(dF,pF),Yb+=2;else if(xg===7){if(Yb>0){let n=r[r.length-1];i.push(i[n],i[n+1]),Yb+=2}}else throw new Error(`unknown command ${xg}`);return{data:i,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),i;e(r.data,this);let n=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,i={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/n,i={type:"LineString",...r};break;case 3:i=dY(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/n;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;return this._toBinaryCoordinates(u=>pY(u,s,l,o))}};var Zb=class{constructor(e,r){this.version=void 0,this.name=void 0,this.extent=void 0,this.length=void 0,this._pbf=void 0,this._keys=void 0,this._values=void 0,this._features=void 0,this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(wbe,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new Kb(this._pbf,i,this.extent,this._keys,this._values,r)}};function wbe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(Tbe(r)))}function Tbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var Jb=class{constructor(e,r){this.layers=void 0,this.layers=e.readFields(Ebe,{},r)}};function Ebe(t,e,r){if(t===3&&r){let i=new Zb(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function gM(t,e){var r,i;let n=Cbe(e),o=(e==null||(r=e.gis)===null||r===void 0?void 0:r.format)||(e==null||(i=e.mvt)===null||i===void 0?void 0:i.shape)||e?.shape;switch(o){case"columnar-table":return{shape:"columnar-table",data:AF(t,n)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:gY(t,n)};case"geojson":return gY(t,n);case"binary-geometry":return AF(t,n);case"binary":return AF(t,n);default:throw new Error(o||"undefined shape")}}function AF(t,e){let[r,i]=Sbe(t,e),n=lF(r,i);return n.byteLength=t.byteLength,n}function Sbe(t,e){let r=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,i];let n=new Jb(new mF.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(s=>{let l=n.layers[s];if(l)for(let u=0;u<l.length;u++){let f=l.feature(u,i),v=Ibe(f,e,s);r.push(v)}}),[r,i]}function gY(t,e){if(t.byteLength<=0)return[];let r=[],i=new Xb(new mF.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let l=0;l<s.length;l++){let u=s.feature(l),f=Mbe(u,e,o);r.push(f)}}),r}function Cbe(t){var e;if(!(t!=null&&t.mvt))throw new Error("mvt options required");let r=((e=t.mvt)===null||e===void 0?void 0:e.coordinates)==="wgs84",{tileIndex:i}=t.mvt,n=i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z);if(r&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function Mbe(t,e,r){let i=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:Pbe);return e.layerProperty&&(i.properties[e.layerProperty]=r),i}function Ibe(t,e,r){let i=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:Rbe);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=r),i}function Pbe(t,e){let{extent:r}=e;for(let i=0;i<t.length;i++){let n=t[i];n[0]/=r,n[1]/=r}}function Rbe(t,e){let{extent:r}=e;for(let i=0,n=t.length;i<n;++i)t[i]/=r}var Bbe="4.1.4",_M={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:Bbe,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},Obe={..._M,parse:async(t,e)=>gM(t,e),parseSync:gM,binary:!0};var Dbe={Point:_Y,MultiPoint:Lbe,LineString:yY,MultiLineString:Fbe,Polygon:vY,MultiPolygon:Nbe};function _Y([t,e],[r,i],n){let o=Oa(r[0],i[0],t),s=Oa(r[1],i[1],e);return n.unprojectFlat([o,s])}function gF(t,e,r){return t.map(i=>_Y(i,e,r))}function Lbe(t,e,r){return gF(t,e,r)}function yY(t,e,r){return gF(t,e,r)}function Fbe(t,e,r){return t.map(i=>yY(i,e,r))}function vY(t,e,r){return t.map(i=>gF(i,e,r))}function Nbe(t,e,r){return t.map(i=>vY(i,e,r))}function xY(t,e,r){let i=r.projectFlat([e.west,e.north]),n=r.projectFlat([e.east,e.south]),o=[i,n];return{...t,coordinates:Dbe[t.type](t.coordinates,o,r)}}var kbe=["points","lines","polygons"];function _F(t,e,r,i){for(let n of kbe){let o=t[n]&&Ube(t[n],e,r,i);if(o>=0)return o}return-1}function Ube(t,e,r,i){let n=t.featureIds.value;if(!n.length)return-1;let o=0,s=n[n.length-1]+1;if(i){let u=zbe(t,i);if(u)o=u[0],s=u[1]+1;else return-1}let l=-1;if(e in t.numericProps){let u=t.numericProps[e].value.findIndex((f,v)=>f===r&&n[v]>=o&&n[v]<s);return u>=0?t.globalFeatureIds.value[u]:-1}else e?l=bY(t.properties,u=>u[e]===r,o,s):t.fields&&(l=bY(t.fields,u=>u.id===r,o,s));return l>=0?Vbe(t,l):-1}function zbe(t,e){if(!t.__layers){let r={},{properties:i}=t;for(let n=0;n<i.length;n++){let{layerName:o}=i[n];o&&(r[o]?r[o][1]=n:r[o]=[n,n])}t.__layers=r}return t.__layers[e]}function Vbe(t,e){if(!t.__ids){let r=[],i=t.featureIds.value,n=t.globalFeatureIds.value;for(let o=0;o<i.length;o++)r[i[o]]=n[o];t.__ids=r}return t.__ids[e]}function bY(t,e,r,i){for(let n=r;n<i;n++)if(e(t[n],n))return n;return-1}var yF=512,jbe={...Of.defaultProps,data:iA,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[_M],binary:!0},yM=class extends Ff{initializeState(){super.initializeState();let e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return Boolean(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:r,context:i,changeFlags:n}){n.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:i,changeFlags:n}),this._setWGS84PropertyForTiles());let{highlightColor:o}=e;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,r=null;if(typeof e=="string"&&!PD(e)){let{onDataLoad:i,fetch:n}=this.props;this.setState({data:null,tileJSON:null});try{r=await n(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}i&&i(r,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(r=e);r&&(e=r.tiles),this.setState({data:e,tileJSON:r})}_getTilesetOptions(){let e=super._getTilesetOptions(),r=this.state.tileJSON,{minZoom:i,maxZoom:n}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>i&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(n)||r.maxzoom<n)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:i}=this.state,{index:n,signal:o}=e,s=Lf(r,e);if(!s)return Promise.reject("Invalid URL");let l=this.getLoadOptions(),{fetch:u}=this.props;return l={...l,mimeType:"application/x-protobuf",mvt:{...l?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:n},gis:i?{format:"binary"}:{}},u(s,{propName:"data",layer:this,loadOptions:l,signal:o})}renderSubLayers(e){let{x:r,y:i,z:n}=e.tile.index,o=Math.pow(2,n),s=yF/o,l=-s,u=yF*r/o,f=yF*(1-i/o),v=new Yr().scale([s,l,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=v,e.coordinateOrigin=[u,f,0],e.coordinateSystem=Kr.CARTESIAN,e.extensions=[...e.extensions||[],new cy]);let T=super.renderSubLayers(e);return this.state.binary&&!(T instanceof Of)&&ur.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),T}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:i,hoveredFeatureLayerName:n}=this.state,o=e.object,s=null,l=null;o&&(s=vF(o,r),l=wY(o));let{highlightColor:u}=this.props;typeof u=="function"&&(u=u(e)),(i!==s||n!==l)&&this.setState({highlightColor:u,hoveredFeatureId:s,hoveredFeatureLayerName:l})}getPickingInfo(e){let r=super.getPickingInfo(e),i=Boolean(this.context.viewport.resolution);if(this.state.binary&&r.index!==-1){let{data:n}=e.sourceLayer.props;r.object=dM(n,{globalFeatureId:r.index})}return r.object&&!i&&(r.object=EY(r.object,r.tile.bbox,this.context.viewport)),r}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){let{hoveredFeatureId:r,hoveredFeatureLayerName:i,binary:n}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,l=e.content,u=TY(s);if(!(TY(r)||u))return-1;let v=u?s:r;return Array.isArray(l)?l.findIndex(T=>{let E=vF(T,o)===v,M=u||wY(T)===i;return E&&M}):l&&n?_F(l,o,v,u?"":i):-1}_pickObjects(e){let{deck:r,viewport:i}=this.context,n=i.width,o=i.height,s=i.x,l=i.y,u=[this.id];return r.pickObjects({x:s,y:l,width:n,height:o,layerIds:u,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),i=new Set,n=[];for(let o of r){let s=vF(o.object,this.props.uniqueIdProperty);s===void 0?n.push(o.object):i.has(s)||(i.add(s),n.push(o.object))}return n}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(i=>{i.hasOwnProperty(e)||Object.defineProperty(i,e,{get:()=>{if(!i.content)return null;if(this.state.binary&&Array.isArray(i.content)&&!i.content.length)return[];let{bbox:n}=i;if(i._contentWGS84===void 0&&RD(n)){let o=this.state.binary?dM(i.content):i.content;i._contentWGS84=o.map(s=>EY(s,n,this.context.viewport))}return i._contentWGS84}})})}},Qb=yM;(()=>{yM.layerName="MVTLayer"})(),(()=>{yM.defaultProps=jbe})();function vF(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function wY(t){return t.properties?.layerName||null}function TY(t){return t!=null&&t!==""}function EY(t,e,r){let i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>xY(t.geometry,e,r).coordinates}),i}var SY="0123456789bcdefghjkmnpqrstuvwxyz",CY={};for(let t=0;t<SY.length;t++)CY[SY.charAt(t)]=t;var Hbe=-90,Gbe=90,Wbe=-180,qbe=180;function Xbe(t){let e=!0,r=Gbe,i=Hbe,n=qbe,o=Wbe,s,l=0;for(let u=0,f=t.length;u<f;u++){let v=t[u].toLowerCase();l=CY[v];for(let T=4;T>=0;T--){let E=l>>T&1;e?(s=(n+o)/2,E===1?o=s:n=s):(s=(r+i)/2,E===1?i=s:r=s),e=!e}}return[i,o,r,n]}function MY(t){let[e,r,i,n]=Xbe(t);return[n,i,n,e,r,e,r,i,n,i]}var Ybe={getGeohash:{type:"accessor",value:t=>t.geohash}},vM=class extends nu{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(i,n)=>MY(r(i,n))}}},$b=vM;(()=>{vM.layerName="GeohashLayer"})(),(()=>{vM.defaultProps=Ybe})();function fy(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function PY(t,e){let r=Zbe(e),i=t;for(let n of r)i=Kbe(i)?i[n]:void 0;return i}function Kbe(t){return t!==null&&typeof t=="object"}var IY={};function Zbe(t){if(typeof t=="string"){let e=IY[t];return e||(e=t.split("."),IY[t]=e),e}return Array.isArray(t)?t:[t]}var bF={};As(bF,{addBinaryOp:()=>twe,addUnaryOp:()=>ewe,compile:()=>Qbe,compileAsync:()=>$be,eval:()=>el,evalAsync:()=>tw,parse:()=>LY.default});var dy=ga(xF()),LY=ga(xF()),tw=function t(e,r){try{var i,n=e;switch(n.type){case"ArrayExpression":return Promise.resolve(BY(n.elements,r));case"BinaryExpression":return Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(M){return py[n.operator](M[0],M[1])});case"CallExpression":var o,s,l,u=function(){if(typeof s=="function"){var M=s,O=M.apply,F=o;return Promise.resolve(BY(n.arguments,r)).then(function(U){return Promise.resolve(O.call(M,F,U))})}},f=n.callee.type==="MemberExpression"?Promise.resolve(RY(n.callee,r)).then(function(M){o=(l=M)[0],s=l[1]}):Promise.resolve(t(n.callee,r)).then(function(M){s=M});return Promise.resolve(f&&f.then?f.then(u):u());case"ConditionalExpression":return Promise.resolve(t(n.test,r)).then(function(M){return Promise.resolve(t(M?n.consequent:n.alternate,r))});case"Identifier":return Promise.resolve(r[n.name]);case"Literal":return Promise.resolve(n.value);case"LogicalExpression":var v=function(M){return i?M:Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(O){return py[n.operator](O[0],O[1])})},T=n.operator==="||"?(i=1,Promise.resolve(t(n.left,r)).then(function(M){return M||Promise.resolve(t(n.right,r))})):function(){if(n.operator==="&&")return i=1,Promise.resolve(t(n.left,r)).then(function(M){return M&&Promise.resolve(t(n.right,r))})}();return Promise.resolve(T&&T.then?T.then(v):v(T));case"MemberExpression":return Promise.resolve(RY(n,r)).then(function(M){return M[1]});case"ThisExpression":return Promise.resolve(r);case"UnaryExpression":var E=bM[n.operator];return Promise.resolve(t(n.argument,r)).then(function(M){return E.call(bM,M)});default:return Promise.resolve(void 0)}}catch(M){return Promise.reject(M)}},RY=function(t,e){try{return Promise.resolve(tw(t.object,e)).then(function(r){function i(){if(/^__proto__|prototype|constructor$/.test(n))throw Error('Access to member "'+n+'" disallowed.');return[r,r[n]]}var n,o=function(){if(t.computed)return Promise.resolve(tw(t.property,e)).then(function(s){n=s});n=t.property.name}();return o&&o.then?o.then(i):i()})}catch(r){return Promise.reject(r)}},BY=function(t,e){try{return Promise.resolve(Promise.all(t.map(function(r){return tw(r,e)})))}catch(r){return Promise.reject(r)}},Jbe={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},py={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},bM={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function OY(t,e){return t.map(function(r){return el(r,e)})}function DY(t,e){var r,i=el(t.object,e);if(r=t.computed?el(t.property,e):t.property.name,/^__proto__|prototype|constructor$/.test(r))throw Error('Access to member "'+r+'" disallowed.');return[i,i[r]]}function el(t,e){var r=t;switch(r.type){case"ArrayExpression":return OY(r.elements,e);case"BinaryExpression":return py[r.operator](el(r.left,e),el(r.right,e));case"CallExpression":var i,n,o;return r.callee.type==="MemberExpression"?(i=(o=DY(r.callee,e))[0],n=o[1]):n=el(r.callee,e),typeof n!="function"?void 0:n.apply(i,OY(r.arguments,e));case"ConditionalExpression":return el(r.test,e)?el(r.consequent,e):el(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?el(r.left,e)||el(r.right,e):r.operator==="&&"?el(r.left,e)&&el(r.right,e):py[r.operator](el(r.left,e),el(r.right,e));case"MemberExpression":return DY(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return bM[r.operator](el(r.argument,e));default:return}}function Qbe(t){return el.bind(null,(0,dy.default)(t))}function $be(t){return tw.bind(null,(0,dy.default)(t))}function ewe(t,e){dy.default.addUnaryOp(t),bM[t]=e}function twe(t,e,r){r?(dy.default.addBinaryOp(t,e),py[t]=r):(dy.default.addBinaryOp(t,Jbe[t]||1),py[t]=e)}var{parse:rwe,eval:iwe}=bF,wF={"-":t=>t};function bg(t,e){if(t in wF)return wF[t];let r,i=rwe(t);return i.type==="Identifier"?r=n=>PY(n,t):(TF(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>iwe(i,n)),wF[t]=r,r}function TF(t,e){if(Array.isArray(t))t.forEach(r=>TF(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)TF(t[r],e)}}var Ay="@@=",EF="@@#",FY="@@type",wM="@@function";var NY=t=>t&&typeof t=="object",Yd=class{constructor(...e){this.typeKey=FY,this.functionKey=wM,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=bg,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(let r of e)this.merge(r)}merge(e){for(let r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){let i=e[r];this[r]=NY(this[r])?Object.assign(this[r],i):i}}}validate(e){return fy(!this.typeKey||typeof this.typeKey=="string"),fy(NY(this.classes)),!0}};function nwe(t){return typeof t=="string"&&t.startsWith(Ay)}function owe(t){return t.replace(Ay,"")}function my(t,e){let r={};for(let i in t){let n=t[i];nwe(n)&&(n=owe(n),n=bg(n,e)),r[i]=n}return r}function kY(t,e,r){let i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){let{log:o}=r;if(o){let s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?swe(i,e,r):awe(n,e,r)}function swe(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=my(e,r),new t(e)}function awe(t,e,r){let{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=my(e,r),i.createElement(t,e,n)}function UY(t,e,r){let i=r.functions[t];if(!i){let{log:n}=r;if(n){let o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function SF(t){return typeof t=="string"?JSON.parse(t):t}var CF=t=>t&&typeof t=="object",wg=class{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Yd?e.configuration:new Yd(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;let r=SF(e),i=lwe(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}};function lwe(t,e){return e=new Yd(e),MF(t,"",e)}function MF(t,e,r){return Array.isArray(t)?t.map((i,n)=>MF(i,String(n),r)):cwe(t,r)?uwe(t,r):CF(t)?wM in t?hwe(t,r):IF(t,r):typeof t=="string"?fwe(t,e,r):t}function cwe(t,e){let{typeKey:r}=e;return CF(t)&&Boolean(t[r])}function uwe(t,e){let{typeKey:r}=e,i=t[r],n={...t};return delete n[r],n=IF(n,e),kY(i,n,e)}function hwe(t,e){let{functionKey:r}=e,i=t[r],n={...t};return delete n[r],n=IF(n,e),UY(i,n,e)}function IF(t,e){fy(CF(t));let r={};for(let i in t){let n=t[i];r[i]=MF(n,i,e)}return r}function fwe(t,e,r){if(t.startsWith(Ay)&&r.convertFunction)return t=t.replace(Ay,""),r.convertFunction(t,r);if(t.startsWith(EF)){if(t=t.replace(EF,""),r.constants[t])return r.constants[t];let[i,n]=t.split(".");return r.enumerations[i][n]}return t}var gy={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},Vf=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:i}){e&&(gy.onInitialize=e),r&&(gy.onFinalize=r),i&&(gy.onMessage=i)}constructor(e="Transport"){this._messageQueue=[],this.userData={},this._destroyed=!1,this.name=e}getRootDOMElement(){return typeof document<"u"?document.body:null}sendJSONMessage(){console.error("Back-channel not implemented for this transport")}sendBinaryMessage(){console.error("Back-channel not implemented for this transport")}_initialize(e={}){let r={transport:this,...e};gy.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};gy.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),gy.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(i,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch{return}r.add(n)}return n})}};function zY(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!(r in e)||t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}var TM=class{constructor(e){this.map=null,this.width=0,this.height=0,this.props={...e},this._initialize(this.props)}finalize(){this.map?.remove(),this.map=null}setProps(e){let r=this.props,i={...this.props,...e};if(this.props=i,!this.map)return;this._update(r,i)&&this.redraw()}redraw(){let e=this.map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this.map}_initialize(e){let{mapLib:r,container:i}=e;r.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({container:i,maxZoom:24,...e.mapOptions,...VY(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1}),Object.defineProperty(i,"offsetWidth",{get:()=>this.width}),Object.defineProperty(i,"clientWidth",{get:()=>this.width}),Object.defineProperty(i,"offsetHeight",{get:()=>this.height}),Object.defineProperty(i,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,r){e.mapStyle!==r.mapStyle&&this.map.setStyle(r.mapStyle);let n=e.width!==r.width||e.height!==r.height;n&&(this.width=r.width,this.height=r.height,this.map.resize());let o=e.viewState,s=r.viewState,l=s.latitude!==o.latitude||s.longitude!==o.longitude||s.zoom!==o.zoom||s.pitch!==o.pitch||s.bearing!==o.bearing;return l&&this.map.jumpTo(VY(s)),n||l}};function VY(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing??0,pitch:t.pitch??0}}var jY={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function dwe(t){let{container:e=document.body}=t;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=document.createElement("div");e.appendChild(i),Object.assign(i.style,jY);let n=document.createElement("canvas");return e.appendChild(n),Object.assign(n.style,jY),{container:e,mapCanvas:i,deckCanvas:n}}var Tg=class extends Bd{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:i}=dwe(e),n=e.viewState||e.initialViewState,o=Number.isFinite(n&&n.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:i,...e}),s&&s.Map?this._map=o&&new TM({...e,width:0,height:0,viewState:n,container:r,mapLib:s}):this._map=s}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map.setProps({mapStyle:e.mapStyle}),super.setProps(e)}_drawLayers(e,r){if(this._map){let i=this.getViewports()[0];i&&this._map.setProps({width:i.width,height:i.height,viewState:i})}super._drawLayers(e,r)}};Tc.registerDevices([Tf]);var HY=t=>t.charAt(0)===t.charAt(0).toUpperCase(),pwe=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function PF(t={},e){let r={},i=Object.keys(t).filter(e);for(let n of i)r[n]=t[n];return r}var Awe={classes:PF(rw,HY),enumerations:{COORDINATE_SYSTEM:Kr,GL:vf}};$A([Gv]);var lA=new wg({configuration:Awe});function mwe(t,e){let r={classes:PF(t,HY),functions:PF(t,pwe)};e.mergeConfiguration(r)}function gwe(t,e){if(!t)return;let r={};function i(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function n(o,s){mwe(s,lA),r[o]=s,i()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){n(o,window[o]);return}Object.defineProperty(window,o,{set:l=>n(o,l),get:()=>r[o]}),c5(s)})}function GY(t,e){let r=lA.convert(t);e.setProps(r)}function _we(t,e){return t.filter(r=>r&&r.id&&!e.find(i=>i.id===r.id))}function ywe({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:i,handleEvent:n,getTooltip:o,container:s}){let u={...n?{onClick:f=>n("deck-click-event",f),onHover:f=>n("deck-hover-event",f),onResize:f=>n("deck-resize-event",f),onViewStateChange:({viewState:f,interactionState:v,oldViewState:T})=>{let E=new Sc(f);f.nw=E.unproject([0,0]),f.se=E.unproject([E.width,E.height]),n("deck-view-state-change-event",f)},onDragStart:f=>n("deck-drag-start-event",f),onDrag:f=>n("deck-drag-event",f),onDragEnd:f=>n("deck-drag-end-event",f)}:null,getTooltip:o,container:s};switch(t){case"mapbox":return ur.info("Using Mapbox base maps")(),new Tg({...u,...e,map:W3,mapboxApiAccessToken:r,onLoad:l5});case"carto":return ur.info("Using Carto base maps")(),new Tg({map:W3,...u,...e});case"google_maps":return ur.info("Using Google Maps base maps")(),F9({...u,...e,googleMapsKey:i});default:return ur.info("No recognized map provider specified")(),new Tg({...u,...e,map:null,mapboxApiAccessToken:null})}}function EM({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:i,tooltip:n,handleEvent:o,customLibraries:s,configuration:l}){let u;try{l&&lA.mergeConfiguration(l);let f=i.layers||[],v=lA.convert(i);CO(r,v);let T=(v.layers||[]).filter(U=>U),E=_we(f,T),M=j3(n),{mapProvider:O}=v;u=ywe({mapProvider:O,props:v,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:M,container:r}),gwe(s,()=>{if(E.length){let G=(lA.convert({layers:i.layers}).layers||[]).filter(J=>J);G.length>T.length&&u.setProps({layers:G})}})}catch(f){console.error(f)}return u}function SM(){Vf.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:i,mapboxApiKey:n,jsonInput:o,tooltip:s}=wwe(t);a5();let l=t.getRootDOMElement(),u=n5(e,r);l.appendChild(u);let f=JSON.parse(o),v=EM({mapboxApiKey:n,container:u,jsonInput:f,tooltip:s,handleEvent:(T,E)=>bwe(t,T,E),customLibraries:i});t.userData.deck=v},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:i}){let{deck:n}=t.userData,o;switch(e){case"json":o=lA.convert(r),n.setProps(o);break;case"json-with-binary":o=lA.convert(r);let s=t.jupyterModel.get("data_buffer"),l=vwe({binary:s,convertedJson:o});n.setProps(l);break;default:}}})}function vwe({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let i=e.layers[r].id,n=e.layers[r];e.layers[r]=n.clone({data:t[i]})}return e}function xwe(t,e){return e instanceof Dn?e.id:e}function bwe(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let i=JSON.parse(JSON.stringify(r,xwe));t.sendJSONMessage(e,i)}function wwe(t){let{jupyterModel:e}=t;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}var Eg=class extends Vf{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let i=Vf._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(i)}};var $w={};As($w,{CONTROL_COMM_PROTOCOL_VERSION:()=>BQ,CONTROL_COMM_TARGET:()=>RQ,CONTROL_COMM_TIMEOUT:()=>OQ,DOMWidgetModel:()=>lk,DOMWidgetView:()=>ck,IJupyterWidgetRegistry:()=>eIe,JUPYTER_WIDGETS_VERSION:()=>NM,JupyterPhosphorPanelWidget:()=>qMe,JupyterPhosphorWidget:()=>kee,LayoutModel:()=>XMe,LayoutView:()=>YMe,ManagerBase:()=>dMe,PROTOCOL_VERSION:()=>kM,StyleModel:()=>KMe,StyleView:()=>ZMe,ViewList:()=>$Me,WidgetModel:()=>IA,WidgetView:()=>fv,WrappedError:()=>uMe,assign:()=>Kd,base64ToBuffer:()=>eN,bufferToBase64:()=>$F,bufferToHex:()=>fMe,difference:()=>FM,hexToBuffer:()=>QF,isEqual:()=>My,pack_models:()=>ak,put_buffers:()=>cA,reject:()=>Gf,remove_buffers:()=>fw,resolvePromisesDict:()=>Iy,serialize_state:()=>DQ,shims:()=>uk,unpack_models:()=>Qw,uuid:()=>hw});var LM=ga(XY()),SQ=ga(_y()),CQ=ga(vQ()),MQ=ga(EQ()),cMe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),DM=function(){return DM=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},DM.apply(this,arguments)};function FM(t,e){return t.filter(function(r){return e.indexOf(r)===-1})}function My(t,e){return(0,CQ.default)(t,e)}var Kd=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};function hw(){return SQ.UUID.uuid4()}var uMe=function(t){cMe(e,t);function e(r,i){var n=t.call(this,r)||this;return console.warn("WrappedError has been deprecated!"),i instanceof e?n.error_stack=i.error_stack:n.error_stack=[i],n.error_stack.push(n),n}return e}(Error);function Iy(t){var e=Object.keys(t),r=[];return e.forEach(function(i){r.push(t[i])}),Promise.all(r).then(function(i){for(var n={},o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function Gf(t,e){return function(i){throw e&&console.error(new Error(t)),i}}function cA(t,e,r){for(var i=0;i<e.length;i++){for(var n=e[i],o=t,s=0;s<n.length-1;s++)o=o[n[s]];o[n[n.length-1]]=r[i]}}function fw(t){var e=[],r=[];function i(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o))for(var l=!1,u=0;u<o.length;u++){var f=o[u];if(f)if(f instanceof ArrayBuffer||ArrayBuffer.isView(f))l||(o=o.slice(),l=!0),e.push(ArrayBuffer.isView(f)?f.buffer:f),r.push(s.concat([u])),o[u]=null;else{var v=i(f,s.concat([u]));v!==f&&(l||(o=o.slice(),l=!0),o[u]=v)}}else if((0,MQ.default)(o))for(var T in o){var l=!1;if(o.hasOwnProperty(T)){var f=o[T];if(f)if(f instanceof ArrayBuffer||ArrayBuffer.isView(f))l||(o=DM({},o),l=!0),e.push(ArrayBuffer.isView(f)?f.buffer:f),r.push(s.concat([T])),delete o[T];else{var v=i(f,s.concat([T]));v!==f&&(l||(o=DM({},o),l=!0),o[T]=v)}}}return o}var n=i(t,[]);return{state:n,buffers:e,buffer_paths:r}}var hMe=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"];function fMe(t){for(var e=new Uint8Array(t),r=[],i=0;i<e.length;i++)r.push(hMe[e[i]]);return r.join("")}function QF(t){for(var e=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function $F(t){return(0,LM.fromByteArray)(new Uint8Array(t))}function eN(t){return(0,LM.toByteArray)(t).buffer}var PQ=ga(_y());var NM="1.2.0",kM="2.1.0";var dw=function(){return dw=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},dw.apply(this,arguments)},uA=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(v){try{f(i.next(v))}catch(T){s(T)}}function u(v){try{f(i.throw(v))}catch(T){s(T)}}function f(v){v.done?o(v.value):n(v.value).then(l,u)}f((i=i.apply(t,e||[])).next())})},hA=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(f){return function(v){return u([f,v])}}function u(f){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=f[0]&2?n.return:f[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,f[1])).done)return o;switch(n=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,n=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],n=0}finally{i=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},IQ=kM.split(".",1)[0],RQ="jupyter.widget.control",BQ="1.0.0",OQ=4e3,dMe=function(){function t(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}return t.prototype.display_model=function(e,r,i){var n=this;return i===void 0&&(i={}),this.create_view(r,i).then(function(o){return n.display_view(e,o,i)}).catch(Gf("Could not create view",!0))},t.prototype.setViewOptions=function(e){return e===void 0&&(e={}),e},t.prototype.create_view=function(e,r){var i=this;r===void 0&&(r={});var n=e.state_change=e.state_change.then(function(){return i.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(function(s){var l=new s({model:e,options:i.setViewOptions(r)});return l.listenTo(e,"destroy",l.remove),Promise.resolve(l.render()).then(function(){return l})}).catch(Gf("Could not create a view for model id "+e.model_id,!0))}),o=hw();return e.views[o]=n,n.then(function(s){s.once("remove",function(){delete s.model.views[o]},i)}),e.state_change},t.prototype.callbacks=function(e){return{}},t.prototype.get_model=function(e){return this._models[e]},t.prototype.has_model=function(e){return this._models[e]!==void 0},t.prototype.handle_comm_open=function(e,r){var i=(r.metadata||{}).version||"";if(i.split(".",1)[0]!==IQ){var n="Wrong widget protocol version: received protocol version '"+i+"', but was expecting major version '"+IQ+"'";return console.error(n),Promise.reject(n)}var o=r.content.data,s=o.buffer_paths||[],l=(r.buffers||[]).map(function(u){return u instanceof DataView?u:new DataView(u instanceof ArrayBuffer?u:u.buffer)});return cA(o.state,s,l),this.new_model({model_name:o.state._model_name,model_module:o.state._model_module,model_module_version:o.state._model_module_version,comm:e},o.state).catch(Gf("Could not create a model.",!0))},t.prototype.new_widget=function(e,r){var i=this;r===void 0&&(r={});var n;if(e.view_name===void 0||e.view_module===void 0||e.view_module_version===void 0)return Promise.reject("new_widget(...) must be given view information in the options.");e.comm?n=Promise.resolve(e.comm):n=this._create_comm(this.comm_target_name,e.model_id,{state:{_model_module:e.model_module,_model_module_version:e.model_module_version,_model_name:e.model_name,_view_module:e.view_module,_view_module_version:e.view_module_version,_view_name:e.view_name}},{version:kM});var o=dw({},e);return n.then(function(s){o.comm=s;var l=i.new_model(o,r);return l.then(function(u){return u.sync("create",u),u})},function(){return o.model_id||(o.model_id=hw()),i.new_model(o,r)})},t.prototype.register_model=function(e,r){var i=this;this._models[e]=r,r.then(function(n){n.once("comm:close",function(){delete i._models[e]})})},t.prototype.new_model=function(e,r){return r===void 0&&(r={}),uA(this,void 0,void 0,function(){var i,n;return hA(this,function(o){switch(o.label){case 0:if(e.model_id)i=e.model_id;else if(e.comm)i=e.model_id=e.comm.comm_id;else throw new Error("Neither comm nor model_id provided in options object. At least one must exist.");return n=this._make_model(e,r),this.register_model(i,n),[4,n];case 1:return[2,o.sent()]}})})},t.prototype._make_model=function(e,r){return r===void 0&&(r={}),uA(this,void 0,void 0,function(){var i,n,o,s,l,u,f;return hA(this,function(v){switch(v.label){case 0:i=e.model_id,n=this.loadClass(e.model_name,e.model_module,e.model_module_version),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,n];case 2:return o=v.sent(),[3,4];case 3:throw s=v.sent(),console.error("Could not instantiate widget"),s;case 4:if(!o)throw new Error("Cannot find model module "+e.model_module+"@"+e.model_module_version+", "+e.model_name);return[4,o._deserialize_state(r,this)];case 5:return l=v.sent(),u={widget_manager:this,model_id:i,comm:e.comm},f=new o(l,u),f.name=e.model_name,f.module=e.model_module,[2,f]}})})},t.prototype._loadFromKernel=function(){return uA(this,void 0,void 0,function(){var e,r,i,n,o,s,l,u,f,v,T,E,M,O=this;return hA(this,function(F){switch(F.label){case 0:return F.trys.push([0,3,,4]),[4,this._create_comm(RQ,hw(),{},{version:BQ})];case 1:return i=F.sent(),[4,new Promise(function(U,G){i.on_msg(function(J){if(e=J.content.data,e.method!=="update_states"){console.warn(`
3678
3678
  Unknown `+e.method+` message on the Control channel
3679
3679
  `);return}r=(J.buffers||[]).map(function(K){return K instanceof DataView?K:new DataView(K instanceof ArrayBuffer?K:K.buffer)}),U(null)}),i.on_close(function(){return G("Control comm was closed too early")}),i.send({method:"request_states"},{}),setTimeout(function(){return G("Control comm did not respond in time")},OQ)})];case 2:return F.sent(),i.close(),[3,4];case 3:return n=F.sent(),console.warn('Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason:',n),[2,this._loadFromKernelModels()];case 4:for(o=e.states,s={},l={},u=0;u<e.buffer_paths.length;u++)f=e.buffer_paths[u],v=f[0],T=f.slice(1),E=r[u],s[v]||(s[v]=[],l[v]=[]),s[v].push(T),l[v].push(E);return[4,Promise.all(Object.keys(o).map(function(U){return uA(O,void 0,void 0,function(){var G,J;return hA(this,function(K){switch(K.label){case 0:return this.has_model(U)?(J=void 0,[3,3]):[3,1];case 1:return[4,this._create_comm("jupyter.widget",U)];case 2:J=K.sent(),K.label=3;case 3:return G=J,[2,{widget_id:U,comm:G}]}})})}))];case 5:return M=F.sent(),[4,Promise.all(M.map(function(U){var G=U.widget_id,J=U.comm;return uA(O,void 0,void 0,function(){var K,ne,ge,H;return hA(this,function(me){switch(me.label){case 0:K=o[G],G in s&&cA(K,s[G],l[G]),me.label=1;case 1:return me.trys.push([1,7,,8]),J?[4,this.new_model({model_name:K.model_name,model_module:K.model_module,model_module_version:K.model_module_version,model_id:G,comm:J},K.state)]:[3,3];case 2:return me.sent(),[3,6];case 3:return[4,this.get_model(G)];case 4:return ne=me.sent(),[4,ne.constructor._deserialize_state(K.state,this)];case 5:ge=me.sent(),ne.set_state(ge),me.label=6;case 6:return[3,8];case 7:return H=me.sent(),console.error(H),[3,8];case 8:return[2]}})})}))];case 6:return F.sent(),[2]}})})},t.prototype._loadFromKernelModels=function(){return uA(this,void 0,void 0,function(){var e,r,i=this;return hA(this,function(n){switch(n.label){case 0:return[4,this._get_comm_info()];case 1:return e=n.sent(),[4,Promise.all(Object.keys(e).map(function(o){return uA(i,void 0,void 0,function(){var s,l,u;return hA(this,function(f){switch(f.label){case 0:return this.has_model(o)?[2]:[4,this._create_comm(this.comm_target_name,o)];case 1:return s=f.sent(),l="",u=new PQ.PromiseDelegate,s.on_msg(function(v){if(v.parent_header.msg_id===l&&v.header.msg_type==="comm_msg"&&v.content.data.method==="update"){var T=v.content.data,E=T.buffer_paths||[],M=v.buffers||[];cA(T.state,E,M),u.resolve({comm:s,msg:v})}}),l=s.send({method:"request_state"},this.callbacks(void 0)),[2,u.promise]}})})}))];case 2:return r=n.sent(),[4,Promise.all(r.map(function(o){return uA(i,void 0,void 0,function(){var s;return hA(this,function(l){switch(l.label){case 0:return o?(s=o.msg.content,[4,this.new_model({model_name:s.data.state._model_name,model_module:s.data.state._model_module,model_module_version:s.data.state._model_module_version,comm:o.comm},s.data.state)]):[2];case 1:return l.sent(),[2]}})})}))];case 3:return n.sent(),[2]}})})},t.prototype.clear_state=function(){var e=this;return Iy(this._models).then(function(r){Object.keys(r).forEach(function(i){return r[i].close()}),e._models=Object.create(null)})},t.prototype.get_state=function(e){var r=this;e===void 0&&(e={});var i=Object.keys(this._models).map(function(n){return r._models[n]});return Promise.all(i).then(function(n){return DQ(n,e)})},t.prototype.set_state=function(e){var r=this;if(!(e.version_major&&e.version_major<=2))throw"Unsupported widget state format";var i=e.state,n=this._get_comm_info().then(function(o){return Promise.all(Object.keys(i).map(function(s){var l={base64:eN,hex:QF},u=i[s],f=u.state;if(u.buffers){var v=u.buffers.map(function(M){return M.path}),T=u.buffers.map(function(M){return new DataView(l[M.encoding](M.data))});cA(u.state,v,T)}if(r.has_model(s))return r.get_model(s).then(function(M){return M.constructor._deserialize_state(f||{},r).then(function(O){return M.set_state(O),M})});var E={model_id:s,model_name:u.model_name,model_module:u.model_module,model_module_version:u.model_module_version};return o.hasOwnProperty(s)?r._create_comm(r.comm_target_name,s).then(function(M){return E.comm=M,r.new_model(E)}):r.new_model(E,f)}))});return n},t.prototype.disconnect=function(){var e=this;Object.keys(this._models).forEach(function(r){e._models[r].then(function(i){i.comm_live=!1})})},t.prototype.resolveUrl=function(e){return Promise.resolve(e)},t.prototype.filterExistingModelState=function(e){var r=this,i=e.state;return i=Object.keys(i).filter(function(n){return!r.has_model(n)}).reduce(function(n,o){return n[o]=i[o],n},{}),dw(dw({},e),{state:i})},t}();function DQ(t,e){e===void 0&&(e={});var r={};return t.forEach(function(i){var n=i.model_id,o=fw(i.serialize(i.get_state(e.drop_defaults))),s=o.buffers.map(function(l,u){return{data:$F(l),path:o.buffer_paths[u],encoding:"base64"}});r[n]={model_name:i.name,model_module:i.module,model_module_version:i.get("_model_module_version"),state:o.state},s.length>0&&(r[n].buffers=s)}),{version_major:2,version_minor:0,state:r}}var rN=function(){return rN=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},rN.apply(this,arguments)};function LQ(t,e,r){if(t==null)return this;var i;if(typeof t=="object"?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var n=r.unset,o=r.silent,s=[],l=this._changing;this._changing=!0;try{l||(this._previousAttributes=rN({},this.attributes),this.changed={});var u=this.attributes,f=this.changed,v=this._previousAttributes;for(var T in i)e=i[T],My(u[T],e)||s.push(T),My(v[T],e)?delete f[T]:f[T]=e,n?delete u[T]:u[T]=e;if(this.id=this.get(this.idAttribute),!o){s.length&&(this._pending=r);for(var E=0;E<s.length;E++)this.trigger("change:"+s[E],this,u[s[E]],r)}if(l)return this;if(!o)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r)}finally{this._pending=!1,this._changing=!1}return this}var Nee=ga(z4()),sk=ga(k4());var xee=ga(z4()),MMe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ww=Element.prototype,IMe=Ww.matches||Ww.webkitMatchesSelector||Ww.mozMatchesSelector||Ww.msMatchesSelector||Ww.oMatchesSelector||function(e){for(var r=(this.document||this.ownerDocument).querySelectorAll(e),i=r.length;--i>=0&&r.item(i)!==this;);return i>-1},bee=function(t){MMe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._removeElement=function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype._setElement=function(r){this.el=r},e.prototype._setAttributes=function(r){for(var i in r)i in this.el?this.el[i]=r[i]:this.el.setAttribute(i,r[i])},e.prototype.delegate=function(r,i,n){typeof i!="string"&&(n=i,i=null),this._domEvents===void 0&&(this._domEvents=[]);var o=this.el,s=i?function(l){for(var u=l.target||l.srcElement;u&&u!==o;u=u.parentNode)if(IMe.call(u,i))return l.delegateTarget=u,n.handleEvent?n.handleEvent(l):n(l)}:n;return this.el.addEventListener(r,s,!1),this._domEvents.push({eventName:r,handler:s,listener:n,selector:i}),s},e.prototype.undelegate=function(r,i,n){if(typeof i=="function"&&(n=i,i=null),this.el&&this._domEvents)for(var o=this._domEvents.slice(),s=o.length;s--;){var l=o[s],u=l.eventName===r&&(n?l.listener===n:!0)&&(i?l.selector===i:!0);u&&(this.el.removeEventListener(l.eventName,l.handler,!1),this._domEvents.splice(s,1))}return this},e.prototype.undelegateEvents=function(){if(this.el&&this._domEvents){for(var r=this._domEvents.length,i=0;i<r;i++){var n=this._domEvents[i];this.el.removeEventListener(n.eventName,n.handler,!1)}this._domEvents.length=0}return this},e}(xee.View);var rr;(function(t){function e(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;Z<$?Oe=Z+1+(we-$):Oe=Z-$+1;for(var fe=0;fe<Oe;++fe){var Le=($+fe)%we;if(me[Le]===he)return Le}return-1}t.firstIndexOf=e;function r(me,he,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;$<Z?Oe=$+1+(we-Z):Oe=$-Z+1;for(var fe=0;fe<Oe;++fe){var Le=($-fe+we)%we;if(me[Le]===he)return Le}return-1}t.lastIndexOf=r;function i(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;Z<$?Oe=Z+1+(we-$):Oe=Z-$+1;for(var fe=0;fe<Oe;++fe){var Le=($+fe)%we;if(he(me[Le],Le))return Le}return-1}t.findFirstIndex=i;function n(me,he,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;$<Z?Oe=$+1+(we-Z):Oe=$-Z+1;for(var fe=0;fe<Oe;++fe){var Le=($-fe+we)%we;if(he(me[Le],Le))return Le}return-1}t.findLastIndex=n;function o(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=i(me,he,$,Z);return we!==-1?me[we]:void 0}t.findFirstValue=o;function s(me,he,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=n(me,he,$,Z);return we!==-1?me[we]:void 0}t.findLastValue=s;function l(me,he,$,Z,we){Z===void 0&&(Z=0),we===void 0&&(we=-1);var Oe=me.length;if(Oe===0)return 0;Z<0?Z=Math.max(0,Z+Oe):Z=Math.min(Z,Oe-1),we<0?we=Math.max(0,we+Oe):we=Math.min(we,Oe-1);for(var fe=Z,Le=we-Z+1;Le>0;){var ht=Le>>1,Vt=fe+ht;$(me[Vt],he)<0?(fe=Vt+1,Le-=ht+1):Le=ht}return fe}t.lowerBound=l;function u(me,he,$,Z,we){Z===void 0&&(Z=0),we===void 0&&(we=-1);var Oe=me.length;if(Oe===0)return 0;Z<0?Z=Math.max(0,Z+Oe):Z=Math.min(Z,Oe-1),we<0?we=Math.max(0,we+Oe):we=Math.min(we,Oe-1);for(var fe=Z,Le=we-Z+1;Le>0;){var ht=Le>>1,Vt=fe+ht;$(me[Vt],he)>0?Le=ht:(fe=Vt+1,Le-=ht+1)}return fe}t.upperBound=u;function f(me,he,$){if(me===he)return!0;if(me.length!==he.length)return!1;for(var Z=0,we=me.length;Z<we;++Z)if($?!$(me[Z],he[Z]):me[Z]!==he[Z])return!1;return!0}t.shallowEqual=f;function v(me,he){he===void 0&&(he={});var $=he.start,Z=he.stop,we=he.step;if(we===void 0&&(we=1),we===0)throw new Error("Slice `step` cannot be zero.");var Oe=me.length;$===void 0?$=we<0?Oe-1:0:$<0?$=Math.max($+Oe,we<0?-1:0):$>=Oe&&($=we<0?Oe-1:Oe),Z===void 0?Z=we<0?-1:Oe:Z<0?Z=Math.max(Z+Oe,we<0?-1:0):Z>=Oe&&(Z=we<0?Oe-1:Oe);var fe;we<0&&Z>=$||we>0&&$>=Z?fe=0:we<0?fe=Math.floor((Z-$+1)/we+1):fe=Math.floor((Z-$-1)/we+1);for(var Le=[],ht=0;ht<fe;++ht)Le[ht]=me[$+ht*we];return Le}t.slice=v;function T(me,he,$){var Z=me.length;if(!(Z<=1)&&(he<0?he=Math.max(0,he+Z):he=Math.min(he,Z-1),$<0?$=Math.max(0,$+Z):$=Math.min($,Z-1),he!==$)){for(var we=me[he],Oe=he<$?1:-1,fe=he;fe!==$;fe+=Oe)me[fe]=me[fe+Oe];me[$]=we}}t.move=T;function E(me,he,$){he===void 0&&(he=0),$===void 0&&($=-1);var Z=me.length;if(!(Z<=1))for(he<0?he=Math.max(0,he+Z):he=Math.min(he,Z-1),$<0?$=Math.max(0,$+Z):$=Math.min($,Z-1);he<$;){var we=me[he],Oe=me[$];me[he++]=Oe,me[$--]=we}}t.reverse=E;function M(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(!(we<=1)&&($<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1),!($>=Z))){var Oe=Z-$+1;if(he>0?he=he%Oe:he<0&&(he=(he%Oe+Oe)%Oe),he!==0){var fe=$+he;E(me,$,fe-1),E(me,fe,Z),E(me,$,Z)}}}t.rotate=M;function O(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we!==0){$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;Z<$?Oe=Z+1+(we-$):Oe=Z-$+1;for(var fe=0;fe<Oe;++fe)me[($+fe)%we]=he}}t.fill=O;function F(me,he,$){var Z=me.length;he<0?he=Math.max(0,he+Z):he=Math.min(he,Z);for(var we=Z;we>he;--we)me[we]=me[we-1];me[he]=$}t.insert=F;function U(me,he){var $=me.length;if(he<0&&(he+=$),!(he<0||he>=$)){for(var Z=me[he],we=he+1;we<$;++we)me[we-1]=me[we];return me.length=$-1,Z}}t.removeAt=U;function G(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=e(me,he,$,Z);return we!==-1&&U(me,we),we}t.removeFirstOf=G;function J(me,he,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=r(me,he,$,Z);return we!==-1&&U(me,we),we}t.removeLastOf=J;function K(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return 0;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);for(var Oe=0,fe=0;fe<we;++fe)$<=Z&&fe>=$&&fe<=Z&&me[fe]===he||Z<$&&(fe<=Z||fe>=$)&&me[fe]===he?Oe++:Oe>0&&(me[fe-Oe]=me[fe]);return Oe>0&&(me.length=we-Oe),Oe}t.removeAllOf=K;function ne(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we,Oe=i(me,he,$,Z);return Oe!==-1&&(we=U(me,Oe)),{index:Oe,value:we}}t.removeFirstWhere=ne;function ge(me,he,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we,Oe=n(me,he,$,Z);return Oe!==-1&&(we=U(me,Oe)),{index:Oe,value:we}}t.removeLastWhere=ge;function H(me,he,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return 0;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);for(var Oe=0,fe=0;fe<we;++fe)$<=Z&&fe>=$&&fe<=Z&&he(me[fe],fe)||Z<$&&(fe<=Z||fe>=$)&&he(me[fe],fe)?Oe++:Oe>0&&(me[fe-Oe]=me[fe]);return Oe>0&&(me.length=we-Oe),Oe}t.removeAllWhere=H})(rr||(rr={}));function cu(t){var e;return typeof t.iter=="function"?e=t.iter():e=new PMe(t),e}function Ei(t,e){for(var r=0,i=cu(t),n;(n=i.next())!==void 0;)if(e(n,r++)===!1)return}function wee(t,e){for(var r=0,i=cu(t),n;(n=i.next())!==void 0;)if(!e(n,r++))return!1;return!0}function Tee(t,e){for(var r=0,i=cu(t),n;(n=i.next())!==void 0;)if(e(n,r++))return!0;return!1}function Eee(t){for(var e=0,r=[],i=cu(t),n;(n=i.next())!==void 0;)r[e++]=n;return r}var PMe=function(){function t(e){this._index=0,this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),v2t=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}},t}(),x2t=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}},t}(),b2t=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}},t}(),w2t=function(){function t(e){this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();function j4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Gg(cu(t.map(cu)))}var Gg=function(){function t(e){this._cloned=!1,this._source=e,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(this._active===void 0){var e=this._source.next();if(e===void 0)return;this._active=this._cloned?e.clone():e}var r=this._active.next();return r!==void 0?r:(this._active=void 0,this.next())},t}();function uu(){return new RMe}var RMe=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var T2t=function(){function t(e,r){this._source=e,this._index=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return[this._index++,e]},t}();function See(t,e){return new BMe(cu(t),e)}var BMe=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var e=this._fn,r=this._source,i;(i=r.next())!==void 0;)if(e(i,this._index++))return i},t}();function iv(t,e){for(var r=0,i=cu(t),n;(n=i.next())!==void 0;)if(e(n,r++))return n}function Cee(t,e){var r=cu(t),i=r.next();if(i!==void 0){for(var n=i;(i=r.next())!==void 0;)e(i,n)>0&&(n=i);return n}}function bA(t,e){return new OMe(cu(t),e)}var OMe=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return this._fn.call(void 0,e,this._index++)},t}();var E2t=function(){function t(e,r,i){this._index=0,this._start=e,this._stop=r,this._step=i,this._length=V4.rangeLength(e,r,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}(),V4;(function(t){function e(r,i,n){return n===0?1/0:r>i&&n>0||r<i&&n<0?0:Math.ceil((i-r)/n)}t.rangeLength=e})(V4||(V4={}));function H4(t,e,r){var i=0,n=cu(t),o=n.next();if(o===void 0&&r===void 0)throw new TypeError("Reduce of empty iterable with no initial value.");if(o===void 0)return r;var s=n.next();if(s===void 0&&r===void 0)return o;if(s===void 0)return e(r,o,i++);var l;r===void 0?l=e(o,s,i++):l=e(e(r,o,i++),s,i++);for(var u;(u=n.next())!==void 0;)l=e(l,u,i++);return l}function qw(t){return new DMe(t,1)}var DMe=function(){function t(e,r){this._value=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();function Mee(t){var e;return typeof t.retro=="function"?e=t.retro():e=new LMe(t),e}var LMe=function(){function t(e){this._source=e,this._index=e.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var S2t=function(){function t(e,r){this._source=e,this._step=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var e=this._source.next(),r=this._step-1;r>0;--r)this._source.next();return e},t}(),rv;(function(t){function e(s,l,u){u===void 0&&(u=0);for(var f=new Array(l.length),v=0,T=u,E=l.length;v<E;++v,++T){if(T=s.indexOf(l[v],T),T===-1)return null;f[v]=T}return f}t.findIndices=e;function r(s,l,u){u===void 0&&(u=0);var f=e(s,l,u);if(!f)return null;for(var v=0,T=0,E=f.length;T<E;++T){var M=f[T]-u;v+=M*M}return{score:v,indices:f}}t.matchSumOfSquares=r;function i(s,l,u){u===void 0&&(u=0);var f=e(s,l,u);if(!f)return null;for(var v=0,T=u-1,E=0,M=f.length;E<M;++E){var O=f[E];v+=O-T-1,T=O}return{score:v,indices:f}}t.matchSumOfDeltas=i;function n(s,l,u){for(var f=[],v=0,T=0,E=l.length;v<E;){for(var M=l[v],O=l[v];++v<E&&l[v]===O+1;)O++;T<M&&f.push(s.slice(T,M)),M<O+1&&f.push(u(s.slice(M,O+1))),T=O+1}return T<s.length&&f.push(s.slice(T)),f}t.highlight=n;function o(s,l){return s<l?-1:s>l?1:0}t.cmp=o})(rv||(rv={}));var C2t=function(){function t(e,r){this._source=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(e!==void 0)return this._count--,e}},t}();var M2t=function(){function t(e){this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(e){return e.clone()}))},t.prototype.next=function(){for(var e=new Array(this._source.length),r=0,i=this._source.length;r<i;++r){var n=this._source[r].next();if(n===void 0)return;e[r]=n}return e},t}();var Iee;(function(t){function e(r){var i=document.body,n=function(o){o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",r),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}t.copyText=e})(Iee||(Iee={}));var fo;(function(t){function e(o){var s=window.getComputedStyle(o),l=parseFloat(s.borderTopWidth)||0,u=parseFloat(s.borderLeftWidth)||0,f=parseFloat(s.borderRightWidth)||0,v=parseFloat(s.borderBottomWidth)||0,T=parseFloat(s.paddingTop)||0,E=parseFloat(s.paddingLeft)||0,M=parseFloat(s.paddingRight)||0,O=parseFloat(s.paddingBottom)||0,F=u+E+M+f,U=l+T+O+v;return{borderTop:l,borderLeft:u,borderRight:f,borderBottom:v,paddingTop:T,paddingLeft:E,paddingRight:M,paddingBottom:O,horizontalSum:F,verticalSum:U}}t.boxSizing=e;function r(o){var s=window.getComputedStyle(o),l=parseFloat(s.minWidth)||0,u=parseFloat(s.minHeight)||0,f=parseFloat(s.maxWidth)||1/0,v=parseFloat(s.maxHeight)||1/0;return f=Math.max(l,f),v=Math.max(u,v),{minWidth:l,minHeight:u,maxWidth:f,maxHeight:v}}t.sizeLimits=r;function i(o,s,l){var u=o.getBoundingClientRect();return s>=u.left&&s<u.right&&l>=u.top&&l<u.bottom}t.hitTest=i;function n(o,s){var l=o.getBoundingClientRect(),u=s.getBoundingClientRect();if(!(u.top<=l.top&&u.bottom>=l.bottom)){if(u.top<l.top&&u.height<=l.height){o.scrollTop-=l.top-u.top;return}if(u.bottom>l.bottom&&u.height>=l.height){o.scrollTop-=l.top-u.top;return}if(u.top<l.top&&u.height>l.height){o.scrollTop-=l.bottom-u.bottom;return}if(u.bottom>l.bottom&&u.height<l.height){o.scrollTop-=l.bottom-u.bottom;return}}}t.scrollIntoViewIfNeeded=n})(fo||(fo={}));var il;(function(t){t.IS_MAC=!!navigator.platform.match(/Mac/i),t.IS_WIN=!!navigator.platform.match(/Win/i),t.IS_IE=/Trident/.test(navigator.userAgent),t.IS_EDGE=/Edge/.test(navigator.userAgent);function e(r){return t.IS_MAC?r.metaKey:r.ctrlKey}t.accelKey=e})(il||(il={}));var Hh;(function(t){function e(n){if(n in jh.specificityCache)return jh.specificityCache[n];var o=jh.calculateSingle(n);return jh.specificityCache[n]=o}t.calculateSpecificity=e;function r(n){if(n in jh.validityCache)return jh.validityCache[n];var o=!0;try{jh.testElem.querySelector(n)}catch{o=!1}return jh.validityCache[n]=o}t.isValid=r;function i(n,o){return jh.protoMatchFunc.call(n,o)}t.matches=i})(Hh||(Hh={}));var jh;(function(t){t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=function(){var v=Element.prototype;return v.matches||v.matchesSelector||v.mozMatchesSelector||v.msMatchesSelector||v.oMatchesSelector||v.webkitMatchesSelector||function(T){var E=this,M=E.ownerDocument?E.ownerDocument.querySelectorAll(T):[];return Array.prototype.indexOf.call(M,E)!==-1}}();function e(v){v=v.split(",",1)[0];var T=0,E=0,M=0;function O(F){var U=v.match(F);return U===null?!1:(v=v.slice(U[0].length),!0)}for(v=v.replace(f," $1 ");v.length>0;){if(O(r)){T++;continue}if(O(i)){E++;continue}if(O(n)){E++;continue}if(O(s)){M++;continue}if(O(l)){E++;continue}if(O(o)){M++;continue}if(!O(u))return 0}return T=Math.min(T,255),E=Math.min(E,255),M=Math.min(M,255),T<<16|E<<8|M}t.calculateSingle=e;var r=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,s=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,l=/^:[^\s\+>~#\.\[:]+/,u=/^[\s\+>~\*]+/,f=/:not\(([^\)]+)\)/g})(jh||(jh={}));var Pee=function(){function t(e){this._root=new la.LeafNode,this.cmp=e}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this._root.size===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){var e=la.firstLeaf(this._root);return e.size>0?e.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var e=la.lastLeaf(this._root);return e.size>0?e.items[e.size-1]:void 0},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return la.iterItems(this._root)},t.prototype.retro=function(){return la.retroItems(this._root)},t.prototype.slice=function(e,r){return la.sliceItems(this._root,e,r)},t.prototype.retroSlice=function(e,r){return la.retroSliceItems(this._root,e,r)},t.prototype.at=function(e){return la.itemAt(this._root,e)},t.prototype.has=function(e,r){return la.hasItem(this._root,e,r)},t.prototype.indexOf=function(e,r){return la.indexOf(this._root,e,r)},t.prototype.get=function(e,r){return la.getItem(this._root,e,r)},t.prototype.assign=function(e){this.clear(),this.update(e)},t.prototype.insert=function(e){var r=la.insertItem(this._root,e,this.cmp);return this._root=la.maybeSplitRoot(this._root),r},t.prototype.update=function(e){var r=this;Ei(e,function(i){r.insert(i)})},t.prototype.delete=function(e,r){var i=la.deleteItem(this._root,e,r);return this._root=la.maybeExtractRoot(this._root),i},t.prototype.remove=function(e){var r=la.removeItem(this._root,e);return this._root=la.maybeExtractRoot(this._root),r},t.prototype.clear=function(){la.clear(this._root),this._root=new la.LeafNode},t}();(function(t){function e(r,i){var n=new t(i);return n.assign(r),n}t.from=e})(Pee||(Pee={}));var la;(function(t){var e=function(){function fe(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(fe.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(fe.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(fe.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),fe}();t.BranchNode=e;var r=function(){function fe(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(fe.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(fe.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(fe.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),fe}();t.LeafNode=r;function i(fe){for(;fe.type===0;)fe=fe.children[0];return fe}t.firstLeaf=i;function n(fe){for(;fe.type===0;)fe=fe.children[fe.children.length-1];return fe}t.lastLeaf=n;function o(fe){var Le=i(fe);return new ge(Le,0,-1)}t.iterItems=o;function s(fe){var Le=n(fe);return new H(Le,Le.size-1,-1)}t.retroItems=s;function l(fe,Le,ht){Le===void 0?Le=0:Le<0?Le=Math.max(0,Le+fe.size):Le=Math.min(Le,fe.size),ht===void 0?ht=fe.size:ht<0?ht=Math.max(0,ht+fe.size):ht=Math.min(ht,fe.size);var Vt=Math.max(0,ht-Le);if(Vt===0)return uu();for(;fe.type===0;){var Yt=me(fe.sizes,Le);Yt>0&&(Le-=fe.sizes[Yt-1]),fe=fe.children[Yt]}return new ge(fe,Le,Vt)}t.sliceItems=l;function u(fe,Le,ht){Le===void 0?Le=fe.size-1:Le<0?Le=Math.max(-1,Le+fe.size):Le=Math.min(Le,fe.size-1),ht===void 0?ht=-1:ht<0?ht=Math.max(-1,ht+fe.size):ht=Math.min(ht,fe.size-1);var Vt=Math.max(0,Le-ht);if(Vt===0)return uu();for(;fe.type===0;){var Yt=me(fe.sizes,Le);Yt>0&&(Le-=fe.sizes[Yt-1]),fe=fe.children[Yt]}return new H(fe,Le,Vt)}t.retroSliceItems=u;function f(fe,Le){if(Le<0&&(Le+=fe.size),!(Le<0||Le>=fe.size)){for(;fe.type===0;){var ht=me(fe.sizes,Le);ht>0&&(Le-=fe.sizes[ht-1]),fe=fe.children[ht]}return fe.items[Le]}}t.itemAt=f;function v(fe,Le,ht){for(;fe.type===0;){var Vt=he(fe.items,Le,ht);fe=fe.children[Vt]}var Yt=$(fe.items,Le,ht);return Yt>=0}t.hasItem=v;function T(fe,Le,ht){for(var Vt=0;fe.type===0;){var Yt=he(fe.items,Le,ht);Yt>0&&(Vt+=fe.sizes[Yt-1]),fe=fe.children[Yt]}var mr=$(fe.items,Le,ht);return mr>=0?Vt+mr:-Vt+mr}t.indexOf=T;function E(fe,Le,ht){for(;fe.type===0;){var Vt=he(fe.items,Le,ht);fe=fe.children[Vt]}var Yt=$(fe.items,Le,ht);return Yt>=0?fe.items[Yt]:void 0}t.getItem=E;function M(fe,Le,ht){if(fe.type===1){var Vt=$(fe.items,Le,ht),Yt;return Vt>=0?(Yt=fe.items[Vt],fe.items[Vt]=Le):(Yt=void 0,rr.insert(fe.items,-Vt-1,Le)),Yt}var mr=he(fe.items,Le,ht),Er=fe.children[mr],Zr=Er.size,or=M(Er,Le,ht),ai=Er.size;if(fe.items[mr]=Er.items[0],Zr===ai)return or;if(Er.width>K){var Jt=we(Er);rr.insert(fe.children,mr+1,Jt),rr.insert(fe.items,mr+1,Jt.items[0])}return Z(fe,mr),or}t.insertItem=M;function O(fe,Le,ht){if(fe.type===1){var Vt=$(fe.items,Le,ht);return Vt<0?void 0:rr.removeAt(fe.items,Vt)}var Yt=he(fe.items,Le,ht),mr=fe.children[Yt],Er=mr.size,Zr=O(mr,Le,ht),or=mr.size;return Er===or||(fe.items[Yt]=mr.items[0],mr.width<ne&&(Yt=Oe(fe,Yt)),Z(fe,Yt)),Zr}t.deleteItem=O;function F(fe,Le){if(Le<0&&(Le+=fe.size),!(Le<0||Le>=fe.size)){if(fe.type===1)return rr.removeAt(fe.items,Le);var ht=me(fe.sizes,Le);ht>0&&(Le-=fe.sizes[ht]);var Vt=fe.children[ht],Yt=F(Vt,Le);return fe.items[ht]=Vt.items[0],Vt.width<ne&&(ht=Oe(fe,ht)),Z(fe,ht),Yt}}t.removeItem=F;function U(fe){fe.type===0?(Ei(fe.children,U),fe.children.length=0,fe.sizes.length=0,fe.items.length=0):(fe.items.length=0,fe.next=null,fe.prev=null)}t.clear=U;function G(fe){if(fe.width<=K)return fe;var Le=new e,ht=we(fe);return Le.sizes[0]=fe.size,Le.sizes[1]=fe.size+ht.size,Le.children[0]=fe,Le.children[1]=ht,Le.items[0]=fe.items[0],Le.items[1]=ht.items[0],Le}t.maybeSplitRoot=G;function J(fe){if(fe.type===1||fe.children.length>1)return fe;var Le=fe.children.pop();return U(fe),Le}t.maybeExtractRoot=J;var K=32,ne=K>>1,ge=function(){function fe(Le,ht,Vt){this._node=Le,this._index=ht,this._count=Vt}return fe.prototype.iter=function(){return this},fe.prototype.clone=function(){return new fe(this._node,this._index,this._count)},fe.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},fe}(),H=function(){function fe(Le,ht,Vt){this._node=Le,this._index=ht,this._count=Vt}return fe.prototype.iter=function(){return this},fe.prototype.clone=function(){return new fe(this._node,this._index,this._count)},fe.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},fe}();function me(fe,Le){for(var ht=fe.length,Vt=0;Vt<ht;++Vt)if(fe[Vt]>Le)return Vt;return ht-1}function he(fe,Le,ht){for(var Vt=fe.length,Yt=1;Yt<Vt;++Yt)if(ht(fe[Yt],Le)>0)return Yt-1;return Vt-1}function $(fe,Le,ht){for(var Vt=fe.length,Yt=0;Yt<Vt;++Yt){var mr=ht(fe[Yt],Le);if(mr===0)return Yt;if(mr>0)return-Yt-1}return-Vt-1}function Z(fe,Le){for(var ht=fe.sizes,Vt=fe.children,Yt=Le>0?ht[Le-1]:0,mr=Vt.length;Le<mr;++Le)Yt=ht[Le]=Yt+Vt[Le].size;ht.length=Vt.length}function we(fe){if(fe.type===1){for(var Le=new r,ht=fe.items,Vt=Le.items,Yt=ne,mr=ht.length;Yt<mr;++Yt)Vt.push(ht[Yt]);return ht.length=ne,fe.next&&(fe.next.prev=Le),Le.next=fe.next,Le.prev=fe,fe.next=Le,Le}for(var Er=new e,Zr=fe.children,or=Er.children,Yt=ne,mr=Zr.length;Yt<mr;++Yt)or.push(Zr[Yt]);Zr.length=ne;for(var ai=fe.items,Jt=Er.items,Yt=ne,mr=ai.length;Yt<mr;++Yt)Jt.push(ai[Yt]);return ai.length=ne,Z(fe,ne),Z(Er,0),Er}function Oe(fe,Le){var ht,Vt,Yt,mr,Er,Zr,or=fe.children[Le],ai=Le===0?fe.children[Le+1]:fe.children[Le-1],Jt=Le===0,qt=or.type===1,wi=ai.width>ne;if(qt&&wi&&Jt){var ae=or,be=ai;return ae.items.push(be.items.shift()),fe.items[Le+1]=be.items[0],Le}if(qt&&wi&&!Jt){var ae=or,be=ai;return ae.items.unshift(be.items.pop()),fe.items[Le]=ae.items[0],Le-1}if(qt&&!wi&&Jt){var ae=or,be=ai;return(ht=be.items).unshift.apply(ht,ae.items),rr.removeAt(fe.children,Le),rr.removeAt(fe.items,Le+1),ae.prev&&(ae.prev.next=be),be.prev=ae.prev,U(ae),Le}if(qt&&!wi&&!Jt){var ae=or,be=ai;return(Vt=be.items).push.apply(Vt,ae.items),rr.removeAt(fe.children,Le),rr.removeAt(fe.items,Le),ae.next&&(ae.next.prev=be),be.next=ae.next,U(ae),Le-1}if(!qt&&wi&&Jt){var ae=or,be=ai;return ae.children.push(be.children.shift()),ae.items.push(be.items.shift()),fe.items[Le+1]=be.items[0],Z(ae,ae.width-1),Z(be,0),Le}if(!qt&&wi&&!Jt){var ae=or,be=ai;return ae.children.unshift(be.children.pop()),ae.items.unshift(be.items.pop()),fe.items[Le]=ae.items[0],Z(ae,0),Z(be,be.width-1),Le-1}if(!qt&&!wi&&Jt){var ae=or,be=ai;return(Yt=be.children).unshift.apply(Yt,ae.children),(mr=be.items).unshift.apply(mr,ae.items),rr.removeAt(fe.children,Le),rr.removeAt(fe.items,Le+1),Z(be,0),ae.children.length=0,U(ae),Le}if(!qt&&!wi&&!Jt){var ae=or,be=ai;return(Er=be.children).push.apply(Er,ae.children),(Zr=be.items).push.apply(Zr,ae.items),rr.removeAt(fe.children,Le),rr.removeAt(fe.items,Le),Z(be,0),ae.children.length=0,U(ae),Le-1}throw"unreachable"}})(la||(la={}));var GI=function(){function t(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this._size===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.assign=function(e){var r=this;this.clear(),Ei(e,function(i){r.addLast(i)})},t.prototype.push=function(e){this.addLast(e)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(e){this.addFirst(e)},t.prototype.unshift=function(){return this.removeFirst()},t.prototype.addFirst=function(e){var r=new tp.LinkedListNode(this,e);return this._first?(r.next=this._first,this._first.prev=r,this._first=r):(this._first=r,this._last=r),this._size++,r},t.prototype.addLast=function(e){var r=new tp.LinkedListNode(this,e);return this._last?(r.prev=this._last,this._last.next=r,this._last=r):(this._first=r,this._last=r),this._size++,r},t.prototype.insertBefore=function(e,r){if(!r||r===this._first)return this.addFirst(e);if(!(r instanceof tp.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var i=new tp.LinkedListNode(this,e),n=r,o=n.prev;return i.next=n,i.prev=o,n.prev=i,o.next=i,this._size++,i},t.prototype.insertAfter=function(e,r){if(!r||r===this._last)return this.addLast(e);if(!(r instanceof tp.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var i=new tp.LinkedListNode(this,e),n=r,o=n.next;return i.next=o,i.prev=n,n.next=i,o.prev=i,this._size++,i},t.prototype.removeFirst=function(){var e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},t.prototype.removeLast=function(){var e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},t.prototype.removeNode=function(e){if(!(e instanceof tp.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");var r=e;r===this._first&&r===this._last?(this._first=null,this._last=null):r===this._first?(this._first=r.next,this._first.prev=null):r===this._last?(this._last=r.prev,this._last.next=null):(r.next.prev=r.prev,r.prev.next=r.next),r.list=null,r.next=null,r.prev=null,this._size--},t.prototype.clear=function(){for(var e=this._first;e;){var r=e.next;e.list=null,e.prev=null,e.next=null,e=r}this._first=null,this._last=null,this._size=0},t}();(function(t){function e(s){var l=new t;return l.assign(s),l}t.from=e;var r=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.next,l.value}},s}();t.ForwardValueIterator=r;var i=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.prev,l.value}},s}();t.RetroValueIterator=i;var n=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.next,l}},s}();t.ForwardNodeIterator=n;var o=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.prev,l}},s}();t.RetroNodeIterator=o})(GI||(GI={}));var tp;(function(t){var e=function(){function r(i,n){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=n}return r}();t.LinkedListNode=e})(tp||(tp={}));var G4=function(t,e){return G4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},G4(t,e)};function FMe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");G4(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var hu=function(){function t(e){this.type=e}return Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype.conflate=function(e){return!1},t}(),nv=function(t){FMe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.conflate=function(r){return!0},e}(hu),xr;(function(t){function e($,Z){var we=v.get($);if(!we||we.length===0){J($,Z);return}var Oe=wee(Mee(we),function(fe){return fe?G(fe,$,Z):!0});Oe&&J($,Z)}t.sendMessage=e;function r($,Z){if(!Z.isConflatable){K($,Z);return}var we=Tee(f,function(Oe){return Oe.handler!==$||!Oe.msg||Oe.msg.type!==Z.type||!Oe.msg.isConflatable?!1:Oe.msg.conflate(Z)});we||K($,Z)}t.postMessage=r;function i($,Z){var we=v.get($);we&&we.indexOf(Z)!==-1||(we?we.push(Z):v.set($,[Z]))}t.installMessageHook=i;function n($,Z){var we=v.get($);if(we){var Oe=we.indexOf(Z);Oe!==-1&&(we[Oe]=null,ge(we))}}t.removeMessageHook=n;function o($){var Z=v.get($);Z&&Z.length>0&&(rr.fill(Z,null),ge(Z)),Ei(f,function(we){we.handler===$&&(we.handler=null,we.msg=null)})}t.clearData=o;function s(){O||M===0||(U(M),O=!0,ne(),O=!1)}t.flush=s;function l(){return E}t.getExceptionHandler=l;function u($){var Z=E;return E=$,Z}t.setExceptionHandler=u;var f=new GI,v=new WeakMap,T=new Set,E=function($){console.error($)},M=0,O=!1,F=function(){var $=typeof requestAnimationFrame=="function";return $?requestAnimationFrame:setImmediate}(),U=function(){var $=typeof cancelAnimationFrame=="function";return $?cancelAnimationFrame:clearImmediate}();function G($,Z,we){var Oe=!0;try{typeof $=="function"?Oe=$(Z,we):Oe=$.messageHook(Z,we)}catch(fe){E(fe)}return Oe}function J($,Z){try{$.processMessage(Z)}catch(we){E(we)}}function K($,Z){f.addLast({handler:$,msg:Z}),M===0&&(M=F(ne))}function ne(){if(M=0,!f.isEmpty){var $={handler:null,msg:null};for(f.addLast($);;){var Z=f.removeFirst();if(Z===$)return;Z.handler&&Z.msg&&e(Z.handler,Z.msg)}}}function ge($){T.size===0&&F(H),T.add($)}function H(){T.forEach(me),T.clear()}function me($){rr.removeAllWhere($,he)}function he($){return $===null}})(xr||(xr={}));var ac=function(){function t(e){this._pid=Wg.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}return t.prototype.get=function(e){var r,i=Wg.ensureMap(e);return this._pid in i?r=i[this._pid]:r=i[this._pid]=this._createValue(e),r},t.prototype.set=function(e,r){var i,n=Wg.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);var o=this._coerceValue(e,r);this._maybeNotify(e,i,n[this._pid]=o)},t.prototype.coerce=function(e){var r,i=Wg.ensureMap(e);this._pid in i?r=i[this._pid]:r=i[this._pid]=this._createValue(e);var n=this._coerceValue(e,r);this._maybeNotify(e,r,i[this._pid]=n)},t.prototype._createValue=function(e){var r=this._create;return r(e)},t.prototype._coerceValue=function(e,r){var i=this._coerce;return i?i(e,r):r},t.prototype._compareValue=function(e,r){var i=this._compare;return i?i(e,r):e===r},t.prototype._maybeNotify=function(e,r,i){var n=this._changed;n&&!this._compareValue(r,i)&&n(e,r,i)},t}();(function(t){function e(r){Wg.ownerData.delete(r)}t.clearData=e})(ac||(ac={}));var Wg;(function(t){t.ownerData=new WeakMap,t.nextPID=function(){var r=0;return function(){var i=Math.random(),n=(""+i).slice(2);return"pid-"+n+"-"+r++}}();function e(r){var i=t.ownerData.get(r);return i||(i=Object.create(null),t.ownerData.set(r,i),i)}t.ensureMap=e})(Wg||(Wg={}));var Wn=function(){function t(e){this._blockedCount=0,this.sender=e}return t.prototype.block=function(e){this._blockedCount++;try{e()}finally{this._blockedCount--}},t.prototype.connect=function(e,r){return kc.connect(this,e,r)},t.prototype.disconnect=function(e,r){return kc.disconnect(this,e,r)},t.prototype.emit=function(e){this._blockedCount||kc.emit(this,e)},t}();(function(t){function e(f,v){var T=kc.blockedProperty;T.set(f,T.get(f)+1);try{v()}finally{T.set(f,T.get(f)-1)}}t.blockAll=e;function r(f,v){kc.disconnectBetween(f,v)}t.disconnectBetween=r;function i(f){kc.disconnectSender(f)}t.disconnectSender=i;function n(f){kc.disconnectReceiver(f)}t.disconnectReceiver=n;function o(f){kc.disconnectAll(f)}t.disconnectAll=o;function s(f){kc.disconnectAll(f)}t.clearData=s;function l(){return kc.exceptionHandler}t.getExceptionHandler=l;function u(f){var v=kc.exceptionHandler;return kc.exceptionHandler=f,v}t.setExceptionHandler=u})(Wn||(Wn={}));var kc;(function(t){t.exceptionHandler=function(J){console.error(J)};function e(J,K,ne){ne=ne||void 0;var ge=u.get(J.sender);if(ge||(ge=[],u.set(J.sender,ge)),E(ge,J,K,ne))return!1;var H=ne||K,me=f.get(H);me||(me=[],f.set(H,me));var he={signal:J,slot:K,thisArg:ne};return ge.push(he),me.push(he),!0}t.connect=e;function r(J,K,ne){ne=ne||void 0;var ge=u.get(J.sender);if(!ge||ge.length===0)return!1;var H=E(ge,J,K,ne);if(!H)return!1;var me=ne||K,he=f.get(me);return H.signal=null,O(ge),O(he),!0}t.disconnect=r;function i(J,K){var ne=u.get(J);if(!(!ne||ne.length===0)){var ge=f.get(K);!ge||ge.length===0||(Ei(ge,function(H){H.signal&&H.signal.sender===J&&(H.signal=null)}),O(ne),O(ge))}}t.disconnectBetween=i;function n(J){var K=u.get(J);!K||K.length===0||(Ei(K,function(ne){if(ne.signal){var ge=ne.thisArg||ne.slot;ne.signal=null,O(f.get(ge))}}),O(K))}t.disconnectSender=n;function o(J){var K=f.get(J);!K||K.length===0||(Ei(K,function(ne){if(ne.signal){var ge=ne.signal.sender;ne.signal=null,O(u.get(ge))}}),O(K))}t.disconnectReceiver=o;function s(J){n(J),o(J)}t.disconnectAll=s;function l(J,K){if(!(t.blockedProperty.get(J.sender)>0)){var ne=u.get(J.sender);if(!(!ne||ne.length===0))for(var ge=0,H=ne.length;ge<H;++ge){var me=ne[ge];me.signal===J&&M(me,K)}}}t.emit=l;var u=new WeakMap,f=new WeakMap,v=new Set,T=function(){var J=typeof requestAnimationFrame=="function";return J?requestAnimationFrame:setImmediate}();function E(J,K,ne,ge){return iv(J,function(H){return H.signal===K&&H.slot===ne&&H.thisArg===ge})}function M(J,K){var ne=J.signal,ge=J.slot,H=J.thisArg;try{ge.call(H,ne.sender,K)}catch(me){t.exceptionHandler(me)}}function O(J){v.size===0&&T(F),v.add(J)}function F(){v.forEach(U),v.clear()}function U(J){rr.removeAllWhere(J,G)}function G(J){return J.signal===null}t.blockedProperty=new ac({name:"blocked",create:function(){return 0}})})(kc||(kc={}));var W4=function(t,e){return W4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},W4(t,e)};function Bee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");W4(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var wA=function(){function t(e){this._fn=e}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this._fn){var e=this._fn;this._fn=null,e()}},t}(),j2t=function(t){Bee(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Wn(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),Wn.clearData(this))},e}(wA),q4=function(){function t(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(e){e.dispose()}),this._items.clear())},t.prototype.contains=function(e){return this._items.has(e)},t.prototype.add=function(e){this._items.add(e)},t.prototype.remove=function(e){this._items.delete(e)},t.prototype.clear=function(){this._items.clear()},t}();(function(t){function e(r){var i=new t;return Ei(r,function(n){i.add(n)}),i}t.from=e})(q4||(q4={}));var Ree=function(t){Bee(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Wn(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),Wn.clearData(this))},e}(q4);(function(t){function e(r){var i=new t;return Ei(r,function(n){i.add(n)}),i}t.from=e})(Ree||(Ree={}));var TA=function(){function t(e){var r=this;this._onScrollFrame=function(){if(r._scrollTarget){var i=r._scrollTarget,n=i.element,o=i.edge,s=i.distance,l=Hl.SCROLL_EDGE_SIZE-s,u=Math.pow(l/Hl.SCROLL_EDGE_SIZE,2),f=Math.max(1,Math.round(u*Hl.SCROLL_EDGE_SIZE));switch(o){case"top":n.scrollTop-=f;break;case"left":n.scrollLeft-=f;break;case"right":n.scrollLeft+=f;break;case"bottom":n.scrollTop+=f;break}requestAnimationFrame(r._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}return t.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var e=Hl.createMouseEvent("pointerup",-1,-1);Hl.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),t.prototype.start=function(e,r){var i=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,r),this._promise=new Promise(function(o,s){i._resolve=o});var n=Hl.createMouseEvent("pointermove",e,r);return document.dispatchEvent(n),this._promise},t.prototype.handleEvent=function(e){switch(e.type){case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"pointermove":this._evtMouseMove(e);break;case"pointerup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}},t.prototype.moveDragImage=function(e,r){if(this.dragImage){var i=this.dragImage.style;i.top=r+"px",i.left=e+"px"}},t.prototype._evtMouseMove=function(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)},t.prototype._evtMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),e.button===0){if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Hl.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}var r=Hl.dispatchDrop(this,this._currentTarget,e);this._finalize(r)}},t.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()},t.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},t.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},t.prototype._updateDragScroll=function(e){var r=Hl.findScrollTarget(e);!this._scrollTarget&&!r||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=r)},t.prototype._updateCurrentTarget=function(e){var r=this._currentTarget,i=this._currentTarget,n=this._currentElement,o=this.document.elementFromPoint(e.clientX,e.clientY);this._currentElement=o,o!==n&&o!==i&&Hl.dispatchDragExit(this,i,o,e),o!==n&&o!==i&&(i=Hl.dispatchDragEnter(this,o,i,e)),i!==r&&(this._currentTarget=i,Hl.dispatchDragLeave(this,r,i,e));var s=Hl.dispatchDragOver(this,i,e);this._setDropAction(s)},t.prototype._attachDragImage=function(e,r){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.top=r+"px",i.left=e+"px";var n=this.document instanceof Document?this.document.body:this.document.firstElementChild;n.appendChild(this.dragImage)}},t.prototype._detachDragImage=function(){if(this.dragImage){var e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}},t.prototype._setDropAction=function(e){if(e=Hl.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=t.overrideCursor("move",this.document);break}},t.prototype._finalize=function(e){var r=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,r&&r(e)},t}();(function(t){function e(i,n){n===void 0&&(n=document);var o=++r,s=n instanceof Document?n.body:n.firstElementChild;return s.style.cursor=i,s.classList.add("lm-mod-override-cursor"),s.classList.add("p-mod-override-cursor"),new wA(function(){o===r&&(s.style.cursor="",s.classList.remove("lm-mod-override-cursor"),s.classList.remove("p-mod-override-cursor"))})}t.overrideCursor=e;var r=0})(TA||(TA={}));var Hl;(function(t){t.SCROLL_EDGE_SIZE=20;function e(E,M){return f[E]&v[M]?E:"none"}t.validateAction=e;function r(E,M,O){var F=document.createEvent("MouseEvent");return F.initMouseEvent(E,!0,!0,window,0,0,0,M,O,!1,!1,!1,!1,0,null),F}t.createMouseEvent=r;function i(E){for(var M=E.clientX,O=E.clientY,F=document.elementFromPoint(M,O);F;F=F.parentElement){var U=F.hasAttribute("data-lm-dragscroll");if(U=U||F.hasAttribute("data-p-dragscroll"),!!U){var G=0,J=0;F===document.body&&(G=window.pageXOffset,J=window.pageYOffset);var K=F.getBoundingClientRect(),ne=K.top+J,ge=K.left+G,H=ge+K.width,me=ne+K.height;if(!(M<ge||M>=H||O<ne||O>=me)){var he=M-ge+1,$=O-ne+1,Z=H-M,we=me-O,Oe=Math.min(he,$,Z,we);if(!(Oe>t.SCROLL_EDGE_SIZE)){var fe=void 0;switch(Oe){case we:fe="bottom";break;case $:fe="top";break;case Z:fe="right";break;case he:fe="left";break;default:throw"unreachable"}var Le=F.scrollWidth-F.clientWidth,ht=F.scrollHeight-F.clientHeight,Vt=void 0;switch(fe){case"top":Vt=ht>0&&F.scrollTop>0;break;case"left":Vt=Le>0&&F.scrollLeft>0;break;case"right":Vt=Le>0&&F.scrollLeft<Le;break;case"bottom":Vt=ht>0&&F.scrollTop<ht;break;default:throw"unreachable"}if(Vt)return{element:F,edge:fe,distance:Oe}}}}}return null}t.findScrollTarget=i;function n(E,M,O,F){if(!M)return null;var U=T("lm-dragenter",E,F,O),G=!M.dispatchEvent(U);if(G||(U=T("p-dragenter",E,F,O),G=!M.dispatchEvent(U),G))return M;var J=E.document instanceof Document?E.document.body:E.document.firstElementChild;return M===J?O:(U=T("lm-dragenter",E,F,O),J.dispatchEvent(U),U=T("p-dragenter",E,F,O),J.dispatchEvent(U),J)}t.dispatchDragEnter=n;function o(E,M,O,F){if(M){var U=T("lm-dragexit",E,F,O);M.dispatchEvent(U),U=T("p-dragexit",E,F,O),M.dispatchEvent(U)}}t.dispatchDragExit=o;function s(E,M,O,F){if(M){var U=T("lm-dragleave",E,F,O);M.dispatchEvent(U),U=T("p-dragleave",E,F,O),M.dispatchEvent(U)}}t.dispatchDragLeave=s;function l(E,M,O){if(!M)return"none";var F=T("lm-dragover",E,O,null),U=!M.dispatchEvent(F);return U||(F=T("p-dragover",E,O,null),U=!M.dispatchEvent(F),U)?F.dropAction:"none"}t.dispatchDragOver=l;function u(E,M,O){if(!M)return"none";var F=T("lm-drop",E,O,null),U=!M.dispatchEvent(F);return U||(F=T("p-drop",E,O,null),U=!M.dispatchEvent(F),U)?F.dropAction:"none"}t.dispatchDrop=u;var f={none:0,copy:1,link:2,move:4},v={none:f.none,copy:f.copy,link:f.link,move:f.move,"copy-link":f.copy|f.link,"copy-move":f.copy|f.move,"link-move":f.link|f.move,all:f.copy|f.link|f.move};function T(E,M,O,F){var U=document.createEvent("MouseEvent");return U.initMouseEvent(E,!0,!0,window,0,O.screenX,O.screenY,O.clientX,O.clientY,O.ctrlKey,O.altKey,O.shiftKey,O.metaKey,O.button,F),U.dropAction="none",U.mimeData=M.mimeData,U.proposedAction=M.proposedAction,U.supportedActions=M.supportedActions,U.source=M.source,U}})(Hl||(Hl={}));var Yg=ga(_y());var lc=ga(_y());function ov(){return Y4.keyboardLayout}var X4=function(){function t(e,r,i){i===void 0&&(i=[]),this.name=e,this._codes=r,this._keys=t.extractKeys(r),this._modifierKeys=t.convertToKeySet(i)}return t.prototype.keys=function(){return Object.keys(this._keys)},t.prototype.isValidKey=function(e){return e in this._keys},t.prototype.isModifierKey=function(e){return e in this._modifierKeys},t.prototype.keyForKeydownEvent=function(e){return this._codes[e.keyCode]||""},t}();(function(t){function e(i){var n=Object.create(null);for(var o in i)n[i[o]]=!0;return n}t.extractKeys=e;function r(i){for(var n=Object(null),o=0,s=i.length;o<s;++o)n[i[o]]=!0;return n}t.convertToKeySet=r})(X4||(X4={}));var NMe=new X4("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]),Y4;(function(t){t.keyboardLayout=NMe})(Y4||(Y4={}));var K4=function(){return K4=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},K4.apply(this,arguments)},sv=function(){function t(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new Wn(this),this._commandExecuted=new Wn(this),this._keyBindingChanged=new Wn(this)}return Object.defineProperty(t.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),t.prototype.listCommands=function(){return Object.keys(this._commands)},t.prototype.hasCommand=function(e){return e in this._commands},t.prototype.addCommand=function(e,r){var i=this;if(e in this._commands)throw new Error("Command '"+e+"' already registered.");return this._commands[e]=EA.createCommand(r),this._commandChanged.emit({id:e,type:"added"}),new wA(function(){delete i._commands[e],i._commandChanged.emit({id:e,type:"removed"})})},t.prototype.notifyCommandChanged=function(e){if(e!==void 0&&!(e in this._commands))throw new Error("Command '"+e+"' is not registered.");this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})},t.prototype.describedBy=function(e){var r=this._commands[e];return r?r.describedBy||{args:null}:{args:null}},t.prototype.label=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.label.call(void 0,r):""},t.prototype.mnemonic=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.mnemonic.call(void 0,r):-1},t.prototype.icon=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.icon.call(void 0,r):""},t.prototype.iconClass=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.iconClass.call(void 0,r):""},t.prototype.iconLabel=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.iconLabel.call(void 0,r):""},t.prototype.caption=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.caption.call(void 0,r):""},t.prototype.usage=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.usage.call(void 0,r):""},t.prototype.className=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.className.call(void 0,r):""},t.prototype.dataset=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.dataset.call(void 0,r):{}},t.prototype.isEnabled=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.isEnabled.call(void 0,r):!1},t.prototype.isToggled=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.isToggled.call(void 0,r):!1},t.prototype.isToggleable=function(e,r){var i=this._commands[e];return i?i.isToggleable:!1},t.prototype.isVisible=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];return i?i.isVisible.call(void 0,r):!1},t.prototype.execute=function(e,r){r===void 0&&(r=lc.JSONExt.emptyObject);var i=this._commands[e];if(!i)return Promise.reject(new Error("Command '"+e+"' not registered."));var n;try{n=i.execute.call(void 0,r)}catch(s){n=Promise.reject(s)}var o=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:r,result:o}),o},t.prototype.addKeyBinding=function(e){var r=this,i=EA.createKeyBinding(e);return this._keyBindings.push(i),this._keyBindingChanged.emit({binding:i,type:"added"}),new wA(function(){rr.removeFirstOf(r._keyBindings,i),r._keyBindingChanged.emit({binding:i,type:"removed"})})},t.prototype.processKeydownEvent=function(e){if(!(this._replaying||t.isModifierKeyPressed(e))){var r=t.keystrokeForKeydownEvent(e);if(!r){this._replayKeydownEvents(),this._clearPendingState();return}this._keystrokes.push(r);var i=EA.matchKeyBinding(this._keyBindings,this._keystrokes,e),n=i.exact,o=i.partial;if(!n&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if(e.preventDefault(),e.stopPropagation(),n&&!o){this._executeKeyBinding(n),this._clearPendingState();return}n&&(this._exactKeyMatch=n),this._keydownEvents.push(e),this._startTimer()}},t.prototype._startTimer=function(){var e=this;this._clearTimer(),this._timerID=window.setTimeout(function(){e._onPendingTimeout()},EA.CHORD_TIMEOUT)},t.prototype._clearTimer=function(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)},t.prototype._replayKeydownEvents=function(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(EA.replayKeyEvent),this._replaying=!1)},t.prototype._executeKeyBinding=function(e){var r=e.command,i=e.args;if(!this.hasCommand(r)||!this.isEnabled(r,i)){var n=this.hasCommand(r)?"enabled":"registered",o=e.keys.join(", "),s="Cannot execute key binding '"+o+"':",l="command '"+r+"' is not "+n+".";console.warn(s+" "+l);return}this.execute(r,i)},t.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},t.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},t}();(function(t){function e(l){for(var u="",f=!1,v=!1,T=!1,E=!1,M=0,O=l.split(/\s+/);M<O.length;M++){var F=O[M];F==="Accel"?il.IS_MAC?v=!0:T=!0:F==="Alt"?f=!0:F==="Cmd"?v=!0:F==="Ctrl"?T=!0:F==="Shift"?E=!0:F.length>0&&(u=F)}return{cmd:v,ctrl:T,alt:f,shift:E,key:u}}t.parseKeystroke=e;function r(l){var u="",f=e(l);return f.ctrl&&(u+="Ctrl "),f.alt&&(u+="Alt "),f.shift&&(u+="Shift "),f.cmd&&il.IS_MAC&&(u+="Cmd "),u+f.key}t.normalizeKeystroke=r;function i(l){var u;return il.IS_WIN?u=l.winKeys||l.keys:il.IS_MAC?u=l.macKeys||l.keys:u=l.linuxKeys||l.keys,u.map(r)}t.normalizeKeys=i;function n(l){return typeof l=="string"?u(l):l.map(u).join(", ");function u(f){var v=[],T=il.IS_MAC?" ":"+",E=e(f);return E.ctrl&&v.push("Ctrl"),E.alt&&v.push("Alt"),E.shift&&v.push("Shift"),il.IS_MAC&&E.cmd&&v.push("Cmd"),v.push(E.key),v.map(EA.formatKey).join(T)}}t.formatKeystroke=n;function o(l){var u=ov(),f=u.keyForKeydownEvent(l);return u.isModifierKey(f)}t.isModifierKeyPressed=o;function s(l){var u=ov(),f=u.keyForKeydownEvent(l);if(!f||u.isModifierKey(f))return"";var v=[];return l.ctrlKey&&v.push("Ctrl"),l.altKey&&v.push("Alt"),l.shiftKey&&v.push("Shift"),l.metaKey&&il.IS_MAC&&v.push("Cmd"),v.push(f),v.join(" ")}t.keystrokeForKeydownEvent=s})(sv||(sv={}));var EA;(function(t){t.CHORD_TIMEOUT=1e3;function e(K){var ne,ge;return!K.icon||typeof K.icon=="string"?(ge=O(K.iconClass||K.icon,u),ne=ge):(ge=O(K.iconClass,u),ne=O(K.icon,M)),{execute:K.execute,describedBy:K4({args:null},K.describedBy),label:O(K.label,u),mnemonic:O(K.mnemonic,f),icon:ne,iconClass:ge,iconLabel:O(K.iconLabel,u),caption:O(K.caption,u),usage:O(K.usage,u),className:O(K.className,u),dataset:O(K.dataset,E),isEnabled:K.isEnabled||v,isToggled:K.isToggled||T,isToggleable:K.isToggleable||!!K.isToggled,isVisible:K.isVisible||v}}t.createCommand=e;function r(K){return{keys:sv.normalizeKeys(K),selector:F(K),command:K.command,args:K.args||lc.JSONExt.emptyObject}}t.createKeyBinding=r;function i(K,ne,ge){for(var H=null,me=!1,he=1/0,$=0,Z=0,we=K.length;Z<we;++Z){var Oe=K[Z],fe=U(Oe.keys,ne);if(fe!==0){if(fe===2){!me&&G(Oe.selector,ge)!==-1&&(me=!0);continue}var Le=G(Oe.selector,ge);if(!(Le===-1||Le>he)){var ht=Hh.calculateSpecificity(Oe.selector);(!H||Le<he||ht>=$)&&(H=Oe,he=Le,$=ht)}}}return{exact:H,partial:me}}t.matchKeyBinding=i;function n(K){K.target.dispatchEvent(J(K))}t.replayKeyEvent=n;function o(K){return il.IS_MAC?s.hasOwnProperty(K)?s[K]:K:l.hasOwnProperty(K)?l[K]:K}t.formatKey=o;var s={Backspace:"\u232B",Tab:"\u21E5",Enter:"\u21A9",Shift:"\u21E7",Ctrl:"\u2303",Alt:"\u2325",Escape:"\u238B",PageUp:"\u21DE",PageDown:"\u21DF",End:"\u2198",Home:"\u2196",ArrowLeft:"\u2190",ArrowUp:"\u2191",ArrowRight:"\u2192",ArrowDown:"\u2193",Delete:"\u2326",Cmd:"\u2318"},l={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},u=function(){return""},f=function(){return-1},v=function(){return!0},T=function(){return!1},E=function(){return{}},M=function(){};function O(K,ne){return K===void 0?ne:typeof K=="function"?K:function(){return K}}function F(K){if(K.selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+K.selector);if(!Hh.isValid(K.selector))throw new Error("Invalid selector: "+K.selector);return K.selector}function U(K,ne){if(K.length<ne.length)return 0;for(var ge=0,H=ne.length;ge<H;++ge)if(K[ge]!==ne[ge])return 0;return K.length>ne.length?2:1}function G(K,ne){for(var ge=ne.target,H=ne.currentTarget,me=0;ge!==null;ge=ge.parentElement,++me){if(ge.hasAttribute("data-lm-suppress-shortcuts")||ge.hasAttribute("data-p-suppress-shortcuts"))return-1;if(Hh.matches(ge,K))return me;if(ge===H)return-1}return-1}function J(K){var ne=document.createEvent("Event"),ge=K.bubbles||!0,H=K.cancelable||!0;return ne.initEvent(K.type||"keydown",ge,H),ne.key=K.key||"",ne.keyCode=K.keyCode||0,ne.which=K.keyCode||0,ne.ctrlKey=K.ctrlKey||!1,ne.altKey=K.altKey||!1,ne.shiftKey=K.shiftKey||!1,ne.metaKey=K.metaKey||!1,ne.view=K.view||window,ne}})(EA||(EA={}));var Z4=function(t,e){return Z4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Z4(t,e)};function kMe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Z4(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var WI=function(){function t(e){this.type="text",this.content=e}return t}(),qI=function(){function t(e,r,i,n){this.type="element",this.tag=e,this.attrs=r,this.children=i,this.renderer=n}return t}(),eTt=function(t){kMe(e,t);function e(r,i,n){return t.call(this,r,i,[],n||void 0)||this}return e}(qI);function so(t){for(var e={},r,i=[],n=1,o=arguments.length;n<o;++n){var s=arguments[n];typeof s=="string"?i.push(new WI(s)):s instanceof WI||s instanceof qI?i.push(s):s instanceof Array?l(i,s):(n===1||n===2)&&s&&typeof s=="object"&&("render"in s?r=s:e=s)}return new qI(t,e,i,r);function l(u,f){for(var v=0,T=f;v<T.length;v++){var E=T[v];typeof E=="string"?u.push(new WI(E)):(E instanceof WI||E instanceof qI)&&u.push(E)}}}(function(t){t.a=t.bind(void 0,"a"),t.abbr=t.bind(void 0,"abbr"),t.address=t.bind(void 0,"address"),t.area=t.bind(void 0,"area"),t.article=t.bind(void 0,"article"),t.aside=t.bind(void 0,"aside"),t.audio=t.bind(void 0,"audio"),t.b=t.bind(void 0,"b"),t.bdi=t.bind(void 0,"bdi"),t.bdo=t.bind(void 0,"bdo"),t.blockquote=t.bind(void 0,"blockquote"),t.br=t.bind(void 0,"br"),t.button=t.bind(void 0,"button"),t.canvas=t.bind(void 0,"canvas"),t.caption=t.bind(void 0,"caption"),t.cite=t.bind(void 0,"cite"),t.code=t.bind(void 0,"code"),t.col=t.bind(void 0,"col"),t.colgroup=t.bind(void 0,"colgroup"),t.data=t.bind(void 0,"data"),t.datalist=t.bind(void 0,"datalist"),t.dd=t.bind(void 0,"dd"),t.del=t.bind(void 0,"del"),t.dfn=t.bind(void 0,"dfn"),t.div=t.bind(void 0,"div"),t.dl=t.bind(void 0,"dl"),t.dt=t.bind(void 0,"dt"),t.em=t.bind(void 0,"em"),t.embed=t.bind(void 0,"embed"),t.fieldset=t.bind(void 0,"fieldset"),t.figcaption=t.bind(void 0,"figcaption"),t.figure=t.bind(void 0,"figure"),t.footer=t.bind(void 0,"footer"),t.form=t.bind(void 0,"form"),t.h1=t.bind(void 0,"h1"),t.h2=t.bind(void 0,"h2"),t.h3=t.bind(void 0,"h3"),t.h4=t.bind(void 0,"h4"),t.h5=t.bind(void 0,"h5"),t.h6=t.bind(void 0,"h6"),t.header=t.bind(void 0,"header"),t.hr=t.bind(void 0,"hr"),t.i=t.bind(void 0,"i"),t.iframe=t.bind(void 0,"iframe"),t.img=t.bind(void 0,"img"),t.input=t.bind(void 0,"input"),t.ins=t.bind(void 0,"ins"),t.kbd=t.bind(void 0,"kbd"),t.label=t.bind(void 0,"label"),t.legend=t.bind(void 0,"legend"),t.li=t.bind(void 0,"li"),t.main=t.bind(void 0,"main"),t.map=t.bind(void 0,"map"),t.mark=t.bind(void 0,"mark"),t.meter=t.bind(void 0,"meter"),t.nav=t.bind(void 0,"nav"),t.noscript=t.bind(void 0,"noscript"),t.object=t.bind(void 0,"object"),t.ol=t.bind(void 0,"ol"),t.optgroup=t.bind(void 0,"optgroup"),t.option=t.bind(void 0,"option"),t.output=t.bind(void 0,"output"),t.p=t.bind(void 0,"p"),t.param=t.bind(void 0,"param"),t.pre=t.bind(void 0,"pre"),t.progress=t.bind(void 0,"progress"),t.q=t.bind(void 0,"q"),t.rp=t.bind(void 0,"rp"),t.rt=t.bind(void 0,"rt"),t.ruby=t.bind(void 0,"ruby"),t.s=t.bind(void 0,"s"),t.samp=t.bind(void 0,"samp"),t.section=t.bind(void 0,"section"),t.select=t.bind(void 0,"select"),t.small=t.bind(void 0,"small"),t.source=t.bind(void 0,"source"),t.span=t.bind(void 0,"span"),t.strong=t.bind(void 0,"strong"),t.sub=t.bind(void 0,"sub"),t.summary=t.bind(void 0,"summary"),t.sup=t.bind(void 0,"sup"),t.table=t.bind(void 0,"table"),t.tbody=t.bind(void 0,"tbody"),t.td=t.bind(void 0,"td"),t.textarea=t.bind(void 0,"textarea"),t.tfoot=t.bind(void 0,"tfoot"),t.th=t.bind(void 0,"th"),t.thead=t.bind(void 0,"thead"),t.time=t.bind(void 0,"time"),t.title=t.bind(void 0,"title"),t.tr=t.bind(void 0,"tr"),t.track=t.bind(void 0,"track"),t.u=t.bind(void 0,"u"),t.ul=t.bind(void 0,"ul"),t.var_=t.bind(void 0,"var"),t.video=t.bind(void 0,"video"),t.wbr=t.bind(void 0,"wbr")})(so||(so={}));var rp;(function(t){function e(i){return qg.createDOMNode(i)}t.realize=e;function r(i,n){var o=qg.hostMap.get(n)||[],s=qg.asContentArray(i);qg.hostMap.set(n,s),qg.updateContent(n,o,s)}t.render=r})(rp||(rp={}));var qg;(function(t){t.hostMap=new WeakMap;function e(M){return M?M instanceof Array?M:[M]:[]}t.asContentArray=e;function r(M){var O=arguments[1]||null,F=arguments[2]||null;if(O)O.insertBefore(r(M),F);else{if(M.type==="text")return document.createTextNode(M.content);if(O=document.createElement(M.tag),s(O,M.attrs),M.renderer)return M.renderer.render(O,{attrs:M.attrs,children:M.children}),O;for(var U=0,G=M.children.length;U<G;++U)r(M.children[U],O)}return O}t.createDOMNode=r;function i(M,O,F){if(O!==F){for(var U=E(M,O),G=O.slice(),J=M.firstChild,K=F.length,ne=0;ne<K;++ne){if(ne>=G.length){r(F[ne],M);continue}var ge=G[ne],H=F[ne];if(ge===H){J=J.nextSibling;continue}if(ge.type==="text"&&H.type==="text"){J.textContent!==H.content&&(J.textContent=H.content),J=J.nextSibling;continue}if(ge.type==="text"||H.type==="text"){rr.insert(G,ne,H),r(H,M,J);continue}if(!ge.renderer!=!H.renderer){rr.insert(G,ne,H),r(H,M,J);continue}var me=H.attrs.key;if(me&&me in U){var he=U[me];he.vNode!==ge&&(rr.move(G,G.indexOf(he.vNode,ne+1),ne),M.insertBefore(he.element,J),ge=he.vNode,J=he.element)}if(ge===H){J=J.nextSibling;continue}var $=ge.attrs.key;if($&&$!==me){rr.insert(G,ne,H),r(H,M,J);continue}if(ge.tag!==H.tag){rr.insert(G,ne,H),r(H,M,J);continue}l(J,ge.attrs,H.attrs),H.renderer?H.renderer.render(J,{attrs:H.attrs,children:H.children}):i(J,ge.children,H.children),J=J.nextSibling}n(M,G,K,!0)}}t.updateContent=i;function n(M,O,F,U){for(var G=O.length-1;G>=F;--G){var J=O[G],K=U?M.lastChild:M.childNodes[G];J.type==="text"||(J.renderer&&J.renderer.unrender?J.renderer.unrender(K,{attrs:J.attrs,children:J.children}):n(K,J.children,0,!1)),U&&M.removeChild(K)}}var o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function s(M,O){for(var F in O)F in o||(F.substr(0,2)==="on"?M[F]=O[F]:M.setAttribute(F,O[F]));O.className!==void 0&&M.setAttribute("class",O.className),O.htmlFor!==void 0&&M.setAttribute("for",O.htmlFor),O.dataset&&u(M,O.dataset),O.style&&v(M,O.style)}function l(M,O,F){if(O!==F){var U;for(U in O)U in o||U in F||(U.substr(0,2)==="on"?M[U]=null:M.removeAttribute(U));for(U in F)U in o||O[U]===F[U]||(U.substr(0,2)==="on"?M[U]=F[U]:M.setAttribute(U,F[U]));O.className!==F.className&&(F.className!==void 0?M.setAttribute("class",F.className):M.removeAttribute("class")),O.htmlFor!==F.htmlFor&&(F.htmlFor!==void 0?M.setAttribute("for",F.htmlFor):M.removeAttribute("for")),O.dataset!==F.dataset&&f(M,O.dataset||{},F.dataset||{}),O.style!==F.style&&T(M,O.style||{},F.style||{})}}function u(M,O){for(var F in O)M.setAttribute("data-"+F,O[F])}function f(M,O,F){for(var U in O)U in F||M.removeAttribute("data-"+U);for(var G in F)O[G]!==F[G]&&M.setAttribute("data-"+G,F[G])}function v(M,O){var F=M.style,U;for(U in O)F[U]=O[U]}function T(M,O,F){var U=M.style,G;for(G in O)G in F||(U[G]="");for(G in F)O[G]!==F[G]&&(U[G]=F[G])}function E(M,O){for(var F=M.firstChild,U=Object.create(null),G=0,J=O;G<J.length;G++){var K=J[G];K.type==="element"&&K.attrs.key&&(U[K.attrs.key]={vNode:K,element:F}),F=F.nextSibling}return U}})(qg||(qg={}));var J4=function(t,e){return J4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},J4(t,e)};function ks(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");J4(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var nl=function(){return nl=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},nl.apply(this,arguments)};function UMe(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function zMe(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var o=arguments[e],s=0,l=o.length;s<l;s++,n++)i[n]=o[s];return i}var SA=function(){function t(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}return t}(),fu;(function(t){function e(o,s){var l=o.length;if(l===0)return s;for(var u=0,f=0,v=0,T=0,E=0,M=0;M<l;++M){var O=o[M],F=O.minSize,U=O.maxSize,G=O.sizeHint;O.done=!1,O.size=Math.max(F,Math.min(G,U)),v+=O.size,u+=F,f+=U,O.stretch>0&&(T+=O.stretch,E++)}if(s===v)return 0;if(s<=u){for(var M=0;M<l;++M){var O=o[M];O.size=O.minSize}return s-u}if(s>=f){for(var M=0;M<l;++M){var O=o[M];O.size=O.maxSize}return s-f}var J=.01,K=l;if(s<v){for(var ne=v-s;E>0&&ne>J;)for(var ge=ne,H=T,M=0;M<l;++M){var O=o[M];if(!(O.done||O.stretch===0)){var me=O.stretch*ge/H;O.size-me<=O.minSize?(ne-=O.size-O.minSize,T-=O.stretch,O.size=O.minSize,O.done=!0,K--,E--):(ne-=me,O.size-=me)}}for(;K>0&&ne>J;)for(var me=ne/K,M=0;M<l;++M){var O=o[M];O.done||(O.size-me<=O.minSize?(ne-=O.size-O.minSize,O.size=O.minSize,O.done=!0,K--):(ne-=me,O.size-=me))}}else{for(var ne=s-v;E>0&&ne>J;)for(var ge=ne,H=T,M=0;M<l;++M){var O=o[M];if(!(O.done||O.stretch===0)){var me=O.stretch*ge/H;O.size+me>=O.maxSize?(ne-=O.maxSize-O.size,T-=O.stretch,O.size=O.maxSize,O.done=!0,K--,E--):(ne-=me,O.size+=me)}}for(;K>0&&ne>J;)for(var me=ne/K,M=0;M<l;++M){var O=o[M];O.done||(O.size+me>=O.maxSize?(ne-=O.maxSize-O.size,O.size=O.maxSize,O.done=!0,K--):(ne-=me,O.size+=me))}}return 0}t.calc=e;function r(o,s,l){o.length===0||l===0||(l>0?i(o,s,l):n(o,s,-l))}t.adjust=r;function i(o,s,l){for(var u=0,f=0;f<=s;++f){var v=o[f];u+=v.maxSize-v.size}for(var T=0,f=s+1,E=o.length;f<E;++f){var v=o[f];T+=v.size-v.minSize}l=Math.min(l,u,T);for(var M=l,f=s;f>=0&&M>0;--f){var v=o[f],O=v.maxSize-v.size;O>=M?(v.sizeHint=v.size+M,M=0):(v.sizeHint=v.size+O,M-=O)}for(var F=l,f=s+1,E=o.length;f<E&&F>0;++f){var v=o[f],O=v.size-v.minSize;O>=F?(v.sizeHint=v.size-F,F=0):(v.sizeHint=v.size-O,F-=O)}}function n(o,s,l){for(var u=0,f=s+1,v=o.length;f<v;++f){var T=o[f];u+=T.maxSize-T.size}for(var E=0,f=0;f<=s;++f){var T=o[f];E+=T.size-T.minSize}l=Math.min(l,u,E);for(var M=l,f=s+1,v=o.length;f<v&&M>0;++f){var T=o[f],O=T.maxSize-T.size;O>=M?(T.sizeHint=T.size+M,M=0):(T.sizeHint=T.size+O,M-=O)}for(var F=l,f=s;f>=0&&F>0;--f){var T=o[f],O=T.size-T.minSize;O>=F?(T.sizeHint=T.size-F,F=0):(T.sizeHint=T.size-O,F-=O)}}})(fu||(fu={}));var Q4=function(){function t(e){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Wn(this),this._isDisposed=!1,this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0?typeof e.icon=="string"?(this._icon=null,this._iconClass=e.icon):this._icon=e.icon:this._icon=null,e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.iconRenderer!==void 0&&(this._icon=e.iconRenderer),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon===null?this.iconClass:this._icon},set:function(e){if(typeof e=="string")this._icon=null,this.iconClass=e;else{if(this._icon===e)return;this._icon=e,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(e){this.icon=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,Wn.clearData(this))},t}(),Br=function(){function t(e){e===void 0&&(e={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new Wn(this),this._hiddenMode=t.HiddenMode.Display,this.node=XI.createNode(e),this.addClass("lm-Widget"),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Wn.clearData(this),xr.clearData(this),ac.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return XI.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(e){this.node.id=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==t.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var r=new t.ChildMessage("child-removed",this);xr.sendMessage(this._parent,r)}if(this._parent=e,this._parent&&!this._parent.isDisposed){var r=new t.ChildMessage("child-added",this);xr.sendMessage(this._parent,r)}this.isDisposed||xr.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():uu()},t.prototype.contains=function(e){for(var r=e;r;r=r._parent)if(r===this)return!0;return!1},t.prototype.hasClass=function(e){return this.node.classList.contains(e)},t.prototype.addClass=function(e){this.node.classList.add(e)},t.prototype.removeClass=function(e){this.node.classList.remove(e)},t.prototype.toggleClass=function(e,r){return r===!0?(this.node.classList.add(e),!0):r===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)},t.prototype.update=function(){xr.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){xr.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){xr.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){xr.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);xr.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);xr.sendMessage(this.parent,e)}},t.prototype.setHidden=function(e){e?this.hide():this.show()},t.prototype.testFlag=function(e){return(this._flags&e)!==0},t.prototype.setFlag=function(e){this._flags|=e},t.prototype.clearFlag=function(e){this._flags&=~e},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}},t.prototype.notifyLayout=function(e){this._layout&&this._layout.processParentMessage(e)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(e){},t.prototype.onUpdateRequest=function(e){},t.prototype.onFitRequest=function(e){},t.prototype.onActivateRequest=function(e){},t.prototype.onBeforeShow=function(e){},t.prototype.onAfterShow=function(e){},t.prototype.onBeforeHide=function(e){},t.prototype.onAfterHide=function(e){},t.prototype.onBeforeAttach=function(e){},t.prototype.onAfterAttach=function(e){},t.prototype.onBeforeDetach=function(e){},t.prototype.onAfterDetach=function(e){},t.prototype.onChildAdded=function(e){},t.prototype.onChildRemoved=function(e){},t.prototype._toggleHidden=function(e){if(e)switch(this._hiddenMode){case t.HiddenMode.Display:this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="scale(0)";break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case t.HiddenMode.Display:this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="";break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}},t}();(function(t){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(t.HiddenMode||(t.HiddenMode={})),function(o){o[o.IsDisposed=1]="IsDisposed",o[o.IsAttached=2]="IsAttached",o[o.IsHidden=4]="IsHidden",o[o.IsVisible=8]="IsVisible",o[o.DisallowLayout=16]="DisallowLayout"}(t.Flag||(t.Flag={})),function(o){o.BeforeShow=new hu("before-show"),o.AfterShow=new hu("after-show"),o.BeforeHide=new hu("before-hide"),o.AfterHide=new hu("after-hide"),o.BeforeAttach=new hu("before-attach"),o.AfterAttach=new hu("after-attach"),o.BeforeDetach=new hu("before-detach"),o.AfterDetach=new hu("after-detach"),o.ParentChanged=new hu("parent-changed"),o.UpdateRequest=new nv("update-request"),o.FitRequest=new nv("fit-request"),o.ActivateRequest=new nv("activate-request"),o.CloseRequest=new nv("close-request")}(t.Msg||(t.Msg={}));var e=function(o){ks(s,o);function s(l,u){var f=o.call(this,l)||this;return f.child=u,f}return s}(hu);t.ChildMessage=e;var r=function(o){ks(s,o);function s(l,u){var f=o.call(this,"resize")||this;return f.width=l,f.height=u,f}return s}(hu);t.ResizeMessage=r,function(o){o.UnknownSize=new o(-1,-1)}(r=t.ResizeMessage||(t.ResizeMessage={}));function i(o,s,l){if(l===void 0&&(l=null),o.parent)throw new Error("Cannot attach a child widget.");if(o.isAttached||o.node.isConnected)throw new Error("Widget is already attached.");if(!s.isConnected)throw new Error("Host is not attached.");xr.sendMessage(o,t.Msg.BeforeAttach),s.insertBefore(o.node,l),xr.sendMessage(o,t.Msg.AfterAttach)}t.attach=i;function n(o){if(o.parent)throw new Error("Cannot detach a child widget.");if(!o.isAttached||!o.node.isConnected)throw new Error("Widget is not attached.");xr.sendMessage(o,t.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),xr.sendMessage(o,t.Msg.AfterDetach)}t.detach=n})(Br||(Br={}));var XI;(function(t){t.titleProperty=new ac({name:"title",create:function(r){return new Q4({owner:r})}});function e(r){return r.node||document.createElement(r.tag||"div")}t.createNode=e})(XI||(XI={}));var CA=function(){function t(e){e===void 0&&(e={}),this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,Wn.clearData(this),ac.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){var r=this._parent.node.style;r.minWidth="",r.minHeight="",r.maxWidth="",r.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}},t.prototype.init=function(){var e=this;Ei(this,function(r){r.parent=e.parent})},t.prototype.onResize=function(e){Ei(this,function(r){xr.sendMessage(r,Br.ResizeMessage.UnknownSize)})},t.prototype.onUpdateRequest=function(e){Ei(this,function(r){xr.sendMessage(r,Br.ResizeMessage.UnknownSize)})},t.prototype.onBeforeAttach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onAfterAttach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onBeforeDetach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onAfterDetach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onBeforeShow=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onAfterShow=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onBeforeHide=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onAfterHide=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onChildRemoved=function(e){this.removeWidget(e.child)},t.prototype.onFitRequest=function(e){},t.prototype.onChildShown=function(e){},t.prototype.onChildHidden=function(e){},t}();(function(t){function e(o){return av.horizontalAlignmentProperty.get(o)}t.getHorizontalAlignment=e;function r(o,s){av.horizontalAlignmentProperty.set(o,s)}t.setHorizontalAlignment=r;function i(o){return av.verticalAlignmentProperty.get(o)}t.getVerticalAlignment=i;function n(o,s){av.verticalAlignmentProperty.set(o,s)}t.setVerticalAlignment=n})(CA||(CA={}));var Zw=function(){function t(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var e=fo.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight},t.prototype.update=function(e,r,i,n){var o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),s=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o<i)switch(CA.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(i-o)/2;break;case"right":e+=i-o;break;default:throw"unreachable"}if(s<n)switch(CA.getVerticalAlignment(this.widget)){case"top":break;case"center":r+=(n-s)/2;break;case"bottom":r+=n-s;break;default:throw"unreachable"}var l=!1,u=this.widget.node.style;if(this._top!==r&&(this._top=r,u.top=r+"px"),this._left!==e&&(this._left=e,u.left=e+"px"),this._width!==o&&(l=!0,this._width=o,u.width=o+"px"),this._height!==s&&(l=!0,this._height=s,u.height=s+"px"),l){var f=new Br.ResizeMessage(o,s);xr.sendMessage(this.widget,f)}},t}(),av;(function(t){t.horizontalAlignmentProperty=new ac({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new ac({name:"verticalAlignment",create:function(){return"top"},changed:e});function e(r){r.parent&&r.parent.layout&&r.parent.update()}})(av||(av={}));var QI=function(t){ks(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._widgets=[],r}return e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return cu(this._widgets)},e.prototype.addWidget=function(r){this.insertWidget(this._widgets.length,r)},e.prototype.insertWidget=function(r,i){i.parent=this.parent;var n=this._widgets.indexOf(i),o=Math.max(0,Math.min(r,this._widgets.length));if(n===-1){rr.insert(this._widgets,o,i),this.parent&&this.attachWidget(o,i);return}o===this._widgets.length&&o--,n!==o&&(rr.move(this._widgets,n,o),this.parent&&this.moveWidget(n,o,i))},e.prototype.removeWidget=function(r){this.removeWidgetAt(this._widgets.indexOf(r))},e.prototype.removeWidgetAt=function(r){var i=rr.removeAt(this._widgets,r);i&&this.parent&&this.detachWidget(r,i)},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i,n){r.attachWidget(n,i)})},e.prototype.attachWidget=function(r,i){var n=this.parent.node.children[r];this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach)},e.prototype.moveWidget=function(r,i,n){this.parent.isAttached&&xr.sendMessage(n,Br.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&xr.sendMessage(n,Br.Msg.AfterDetach);var o=this.parent.node.children[i];this.parent.isAttached&&xr.sendMessage(n,Br.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,o),this.parent.isAttached&&xr.sendMessage(n,Br.Msg.AfterAttach)},e.prototype.detachWidget=function(r,i){this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach)},e}(CA),Xw;(function(t){function e(r){return Math.max(0,Math.floor(r))}t.clampDimension=e})(Xw||(Xw={}));var Yw=Xw,Kg=function(t){ks(e,t);function e(r){var i=t.call(this)||this;return i.widgetOffset=0,i._fixed=0,i._spacing=4,i._dirty=!1,i._hasNormedSizes=!1,i._sizers=[],i._items=[],i._handles=[],i._box=null,i._alignment="start",i._orientation="horizontal",i.renderer=r.renderer,r.orientation!==void 0&&(i._orientation=r.orientation),r.alignment!==void 0&&(i._alignment=r.alignment),r.spacing!==void 0&&(i._spacing=Xw.clampDimension(r.spacing)),i}return e.prototype.dispose=function(){Ei(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._orientation=r,this.parent&&(this.parent.dataset.orientation=r,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(r){this._alignment!==r&&(this._alignment=r,this.parent&&(this.parent.dataset.alignment=r,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=Xw.clampDimension(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.absoluteSizes=function(){return this._sizers.map(function(r){return r.size})},e.prototype.relativeSizes=function(){return np.normalize(this._sizers.map(function(r){return r.size}))},e.prototype.setRelativeSizes=function(r,i){i===void 0&&(i=!0);for(var n=this._sizers.length,o=r.slice(0,n);o.length<n;)o.push(0);for(var s=np.normalize(o),l=0;l<n;++l){var u=this._sizers[l];u.sizeHint=s[l],u.size=s[l]}this._hasNormedSizes=!0,i&&this.parent&&this.parent.update()},e.prototype.moveHandle=function(r,i){var n=this._handles[r];if(!(!n||n.classList.contains("lm-mod-hidden"))){var o;if(this._orientation==="horizontal"?o=i-n.offsetLeft:o=i-n.offsetTop,o!==0){for(var s=0,l=this._sizers;s<l.length;s++){var u=l[s];u.size>0&&(u.sizeHint=u.size)}fu.adjust(this._sizers,r,o),this.parent&&this.parent.update()}}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(r,i){var n=new Zw(i),o=np.createHandle(this.renderer),s=np.averageSize(this._sizers),l=np.createSizer(s);rr.insert(this._items,r,n),rr.insert(this._sizers,r,l),rr.insert(this._handles,r,o),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.node.appendChild(o),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){rr.move(this._items,r,i),rr.move(this._sizers,r,i),rr.move(this._handles,r,i),this.parent.fit()},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._items,r),o=rr.removeAt(this._handles,r);rr.removeAt(this._sizers,r),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.node.removeChild(o),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype.updateItemPosition=function(r,i,n,o,s,l,u){var f=this._items[r];if(!f.isHidden){var v=this._handles[r].style;i?(n+=this.widgetOffset,f.update(n,o,u,s),n+=u,v.top=o+"px",v.left=n+"px",v.width=this._spacing+"px",v.height=s+"px"):(o+=this.widgetOffset,f.update(n,o,l,u),o+=u,v.top=o+"px",v.left=n+"px",v.width=l+"px",v.height=this._spacing+"px")}},e.prototype._fit=function(){for(var r=0,i=-1,n=0,o=this._items.length;n<o;++n)this._items[n].isHidden?(this._handles[n].classList.add("lm-mod-hidden"),this._handles[n].classList.add("p-mod-hidden")):(this._handles[n].classList.remove("lm-mod-hidden"),this._handles[n].classList.remove("p-mod-hidden"),i=n,r++);i!==-1&&(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,r-1)+this.widgetOffset*this._items.length;for(var s=this._orientation==="horizontal",l=s?this._fixed:0,u=s?0:this._fixed,n=0,o=this._items.length;n<o;++n){var f=this._items[n],v=this._sizers[n];if(v.size>0&&(v.sizeHint=v.size),f.isHidden){v.minSize=0,v.maxSize=0;continue}f.fit(),v.stretch=e.getStretch(f.widget),s?(v.minSize=f.minWidth,v.maxSize=f.maxWidth,l+=f.minWidth,u=Math.max(u,f.minHeight)):(v.minSize=f.minHeight,v.maxSize=f.maxHeight,u+=f.minHeight,l=Math.max(l,f.minWidth))}var T=this._box=fo.boxSizing(this.parent.node);l+=T.horizontalSum,u+=T.verticalSum;var E=this.parent.node.style;E.minWidth=l+"px",E.minHeight=u+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(!(n===0&&this.widgetOffset===0)){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=fo.boxSizing(this.parent.node));var l=this._box.paddingTop,u=this._box.paddingLeft,f=r-this._box.horizontalSum,v=i-this._box.verticalSum,T=0,E=0,M=this._orientation==="horizontal";if(n>0){var O=void 0;if(M?O=Math.max(0,f-this._fixed):O=Math.max(0,v-this._fixed),this._hasNormedSizes){for(var F=0,U=this._sizers;F<U.length;F++){var G=U[F];G.sizeHint*=O}this._hasNormedSizes=!1}var J=fu.calc(this._sizers,O);if(J>0)switch(this._alignment){case"start":break;case"center":T=0,E=J/2;break;case"end":T=0,E=J;break;case"justify":T=J/n,E=0;break;default:throw"unreachable"}}for(var o=0,s=this._items.length;o<s;++o){var K=this._items[o],ne=K.isHidden?0:this._sizers[o].size+T;this.updateItemPosition(o,M,M?u+E:u,M?l:l+E,v,f,ne);var ge=this.widgetOffset+(this._handles[o].classList.contains("lm-mod-hidden")?0:this._spacing);M?u+=ne+ge:l+=ne+ge}}},e}(QI);(function(t){function e(i){return np.stretchProperty.get(i)}t.getStretch=e;function r(i,n){np.stretchProperty.set(i,n)}t.setStretch=r})(Kg||(Kg={}));var np;(function(t){t.stretchProperty=new ac({name:"stretch",create:function(){return 0},coerce:function(s,l){return Math.max(0,Math.floor(l))},changed:o});function e(s){var l=new SA;return l.sizeHint=Math.floor(s),l}t.createSizer=e;function r(s){var l=s.createHandle();return l.style.position="absolute",l}t.createHandle=r;function i(s){return s.reduce(function(l,u){return l+u.size},0)/s.length||0}t.averageSize=i;function n(s){var l=s.length;if(l===0)return[];var u=s.reduce(function(f,v){return f+Math.abs(v)},0);return u===0?s.map(function(f){return 1/l}):s.map(function(f){return f/u})}t.normalize=n;function o(s){s.parent&&s.parent.layout instanceof Kg&&s.parent.fit()}})(np||(np={}));var VMe=function(t){ks(e,t);function e(r){var i=t.call(this,nl(nl({},r),{orientation:r.orientation||"vertical"}))||this;return i._titles=[],i.titleSpace=r.titleSpace||22,i}return Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(r){r=Yw.clampDimension(r),this.widgetOffset!==r&&(this.widgetOffset=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,t.prototype.dispose.call(this))},e.prototype.updateTitle=function(r,i){var n=this._titles[r],o=n.classList.contains("lm-mod-expanded"),s=YI.createTitle(this.renderer,i.title,o);this._titles[r]=s,this.parent.node.replaceChild(s,n)},e.prototype.attachWidget=function(r,i){var n=YI.createTitle(this.renderer,i.title);rr.insert(this._titles,r,n),this.parent.node.appendChild(n),i.node.setAttribute("role","region"),i.node.setAttribute("aria-labelledby",n.id),t.prototype.attachWidget.call(this,r,i)},e.prototype.moveWidget=function(r,i,n){rr.move(this._titles,r,i),t.prototype.moveWidget.call(this,r,i,n)},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._titles,r);this.parent.node.removeChild(n),t.prototype.detachWidget.call(this,r,i)},e.prototype.updateItemPosition=function(r,i,n,o,s,l,u){var f=this._titles[r].style;f.top=o+"px",f.left=n+"px",f.height=this.widgetOffset+"px",i?f.width=s+"px":f.width=l+"px",t.prototype.updateItemPosition.call(this,r,i,n,o,s,l,u)},e}(Kg),YI;(function(t){function e(r,i,n){n===void 0&&(n=!0);var o=r.createSectionTitle(i);return o.style.position="absolute",o.setAttribute("aria-label",i.label+" Section"),o.setAttribute("aria-expanded",n?"true":"false"),o.setAttribute("aria-controls",i.owner.id),n&&o.classList.add("lm-mod-expanded"),o}t.createTitle=e})(YI||(YI={}));var Jw=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i.addClass("lm-Panel"),i.addClass("p-Panel"),i.layout=$4.createLayout(r),i}return Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){this.layout.addWidget(r)},e.prototype.insertWidget=function(r,i){this.layout.insertWidget(r,i)},e}(Br),$4;(function(t){function e(r){return r.layout||new QI}t.createLayout=e})($4||($4={}));var Kw=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:ek.createLayout(r)})||this;return i._handleMoved=new Wn(i),i._pressData=null,i.addClass("lm-SplitPanel"),i.addClass("p-SplitPanel"),i}return e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(r){this.layout.orientation=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(r){this.layout.alignment=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(r,i){i===void 0&&(i=!0),this.layout.setRelativeSizes(r,i)},e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"pointerdown":this._evtMouseDown(r);break;case"pointermove":this._evtMouseMove(r);break;case"pointerup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},e.prototype.onChildAdded=function(r){r.child.addClass("lm-SplitPanel-child"),r.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-SplitPanel-child"),r.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(r){this._pressData&&(r.preventDefault(),r.stopPropagation()),r.keyCode===27&&this._releaseMouse()},e.prototype._evtMouseDown=function(r){if(r.button===0){var i=this.layout,n=rr.findFirstIndex(i.handles,function(v){return v.contains(r.target)});if(n!==-1){r.preventDefault(),r.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var o,s=i.handles[n],l=s.getBoundingClientRect();i.orientation==="horizontal"?o=r.clientX-l.left:o=r.clientY-l.top;var u=window.getComputedStyle(s),f=TA.overrideCursor(u.cursor);this._pressData={index:n,delta:o,override:f}}}},e.prototype._evtMouseMove=function(r){r.preventDefault(),r.stopPropagation();var i,n=this.layout,o=this.node.getBoundingClientRect();n.orientation==="horizontal"?i=r.clientX-o.left-this._pressData.delta:i=r.clientY-o.top-this._pressData.delta,n.moveHandle(this._pressData.index,i)},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))},e}(Jw);(function(t){var e=function(){function n(){}return n.prototype.createHandle=function(){var o=document.createElement("div");return o.className="lm-SplitPanel-handle",o.classList.add("p-SplitPanel-handle"),o},n}();t.Renderer=e,t.defaultRenderer=new e;function r(n){return Kg.getStretch(n)}t.getStretch=r;function i(n,o){Kg.setStretch(n,o)}t.setStretch=i})(Kw||(Kw={}));var ek;(function(t){function e(r){return r.layout||new Kg({renderer:r.renderer||Kw.defaultRenderer,orientation:r.orientation,alignment:r.alignment,spacing:r.spacing})}t.createLayout=e})(ek||(ek={}));var tk=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,nl(nl({},r),{layout:rk.createLayout(r)}))||this;return i._widgetSizesCache=new WeakMap,i.addClass("lm-AccordionPanel"),i}return Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(r){this.layout.titleSpace=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){t.prototype.addWidget.call(this,r),r.title.changed.connect(this._onTitleChanged,this)},e.prototype.collapse=function(r){var i=this.layout.widgets[r];i&&!i.isHidden&&this._toggleExpansion(r)},e.prototype.expand=function(r){var i=this.layout.widgets[r];i&&i.isHidden&&this._toggleExpansion(r)},e.prototype.insertWidget=function(r,i){t.prototype.insertWidget.call(this,r,i),i.title.changed.connect(this._onTitleChanged,this)},e.prototype.handleEvent=function(r){switch(t.prototype.handleEvent.call(this,r),r.type){case"click":this._evtClick(r);break;case"keydown":this._eventKeyDown(r);break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),t.prototype.onBeforeAttach.call(this,r)},e.prototype.onAfterDetach=function(r){t.prototype.onAfterDetach.call(this,r),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},e.prototype._onTitleChanged=function(r){var i=rr.findFirstIndex(this.widgets,function(n){return n.contains(r.owner)});i>=0&&(this.layout.updateTitle(i,r.owner),this.update())},e.prototype._computeWidgetSize=function(r){var i=this.layout,n=i.widgets[r];if(n){var o=n.isHidden,s=i.absoluteSizes(),l=(o?-1:1)*this.spacing,u=s.reduce(function(M,O){return M+O}),f=zMe(s);if(o){var E=this._widgetSizesCache.get(n);if(!E)return;f[r]+=E;var T=f.map(function(O){return O-E>0}).lastIndexOf(!0);T===-1?f.forEach(function(O,F){F!==r&&(f[F]-=s[F]/u*(E-l))}):f[T]-=E-l}else{var v=s[r];this._widgetSizesCache.set(n,v),f[r]=0;var T=f.map(function(M){return M>0}).lastIndexOf(!0);if(T===-1)return;f[T]=s[T]+v+l}return f.map(function(M){return M/(u+l)})}},e.prototype._evtClick=function(r){var i=r.target;if(i){var n=rr.findFirstIndex(this.titles,function(o){return o.contains(i)});n>=0&&(r.preventDefault(),r.stopPropagation(),this._toggleExpansion(n))}},e.prototype._eventKeyDown=function(r){if(!r.defaultPrevented){var i=r.target,n=!1;if(i){var o=rr.findFirstIndex(this.titles,function(v){return v.contains(i)});if(o>=0){var s=r.keyCode.toString();if(r.key.match(/Space|Enter/)||s.match(/13|32/))i.click(),n=!0;else if(this.orientation==="horizontal"?r.key.match(/ArrowLeft|ArrowRight/)||s.match(/37|39/):r.key.match(/ArrowUp|ArrowDown/)||s.match(/38|40/)){var l=r.key.match(/ArrowLeft|ArrowUp/)||s.match(/37|38/)?-1:1,u=this.titles.length,f=(o+u+l)%u;this.titles[f].focus(),n=!0}else r.key==="End"||s==="35"?(this.titles[this.titles.length-1].focus(),n=!0):(r.key==="Home"||s==="36")&&(this.titles[0].focus(),n=!0)}n&&r.preventDefault()}}},e.prototype._toggleExpansion=function(r){var i=this.titles[r],n=this.layout.widgets[r],o=this._computeWidgetSize(r);o&&this.setRelativeSizes(o,!1),n.isHidden?(i.classList.add("lm-mod-expanded"),i.setAttribute("aria-expanded","true"),n.show()):(i.classList.remove("lm-mod-expanded"),i.setAttribute("aria-expanded","false"),n.hide())},e}(Kw);(function(t){var e=function(r){ks(i,r);function i(){var n=r.call(this)||this;return n.titleClassName="lm-AccordionPanel-title",n._titleID=0,n._titleKeys=new WeakMap,n._uuid=++i._nInstance,n}return i.prototype.createCollapseIcon=function(n){return document.createElement("span")},i.prototype.createSectionTitle=function(n){var o=document.createElement("h3");o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.id=this.createTitleKey(n),o.className=this.titleClassName;for(var s in n.dataset)o.dataset[s]=n.dataset[s];var l=o.appendChild(this.createCollapseIcon(n));l.className="lm-AccordionPanel-titleCollapser";var u=o.appendChild(document.createElement("span"));return u.className="lm-AccordionPanel-titleLabel",u.textContent=n.label,u.title=n.caption||n.label,o},i.prototype.createTitleKey=function(n){var o=this._titleKeys.get(n);return o===void 0&&(o="title-key-"+this._uuid+"-"+this._titleID++,this._titleKeys.set(n,o)),o},i._nInstance=0,i}(Kw.Renderer);t.Renderer=e,t.defaultRenderer=new e})(tk||(tk={}));var rk;(function(t){function e(r){return r.layout||new VMe({renderer:r.renderer||tk.defaultRenderer,orientation:r.orientation,alignment:r.alignment,spacing:r.spacing,titleSpace:r.titleSpace})}t.createLayout=e})(rk||(rk={}));var Gh=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i._fixed=0,i._spacing=4,i._dirty=!1,i._sizers=[],i._items=[],i._box=null,i._alignment="start",i._direction="top-to-bottom",r.direction!==void 0&&(i._direction=r.direction),r.alignment!==void 0&&(i._alignment=r.alignment),r.spacing!==void 0&&(i._spacing=Yw.clampDimension(r.spacing)),i}return e.prototype.dispose=function(){Ei(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(r){this._direction!==r&&(this._direction=r,this.parent&&(this.parent.dataset.direction=r,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(r){this._alignment!==r&&(this._alignment=r,this.parent&&(this.parent.dataset.alignment=r,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=Yw.clampDimension(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(r,i){rr.insert(this._items,r,new Zw(i)),rr.insert(this._sizers,r,new SA),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){rr.move(this._items,r,i),rr.move(this._sizers,r,i),this.parent.update()},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._items,r);rr.removeAt(this._sizers,r),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=0,n=this._items.length;i<n;++i)r+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,r-1);for(var o=Xg.isHorizontal(this._direction),s=o?this._fixed:0,l=o?0:this._fixed,i=0,n=this._items.length;i<n;++i){var u=this._items[i],f=this._sizers[i];if(u.isHidden){f.minSize=0,f.maxSize=0;continue}u.fit(),f.sizeHint=e.getSizeBasis(u.widget),f.stretch=e.getStretch(u.widget),o?(f.minSize=u.minWidth,f.maxSize=u.maxWidth,s+=u.minWidth,l=Math.max(l,u.minHeight)):(f.minSize=u.minHeight,f.maxSize=u.maxHeight,l+=u.minHeight,s=Math.max(s,u.minWidth))}var v=this._box=fo.boxSizing(this.parent.node);s+=v.horizontalSum,l+=v.verticalSum;var T=this.parent.node.style;T.minWidth=s+"px",T.minHeight=l+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(n!==0){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=fo.boxSizing(this.parent.node));var l=this._box.paddingTop,u=this._box.paddingLeft,f=r-this._box.horizontalSum,v=i-this._box.verticalSum,T;switch(this._direction){case"left-to-right":T=fu.calc(this._sizers,Math.max(0,f-this._fixed));break;case"top-to-bottom":T=fu.calc(this._sizers,Math.max(0,v-this._fixed));break;case"right-to-left":T=fu.calc(this._sizers,Math.max(0,f-this._fixed)),u+=f;break;case"bottom-to-top":T=fu.calc(this._sizers,Math.max(0,v-this._fixed)),l+=v;break;default:throw"unreachable"}var E=0,M=0;if(T>0)switch(this._alignment){case"start":break;case"center":E=0,M=T/2;break;case"end":E=0,M=T;break;case"justify":E=T/n,M=0;break;default:throw"unreachable"}for(var o=0,s=this._items.length;o<s;++o){var O=this._items[o];if(!O.isHidden){var F=this._sizers[o].size;switch(this._direction){case"left-to-right":O.update(u+M,l,F+E,v),u+=F+E+this._spacing;break;case"top-to-bottom":O.update(u,l+M,f,F+E),l+=F+E+this._spacing;break;case"right-to-left":O.update(u-M-F-E,l,F+E,v),u-=F+E+this._spacing;break;case"bottom-to-top":O.update(u,l-M-F-E,f,F+E),l-=F+E+this._spacing;break;default:throw"unreachable"}}}}},e}(QI);(function(t){function e(o){return Xg.stretchProperty.get(o)}t.getStretch=e;function r(o,s){Xg.stretchProperty.set(o,s)}t.setStretch=r;function i(o){return Xg.sizeBasisProperty.get(o)}t.getSizeBasis=i;function n(o,s){Xg.sizeBasisProperty.set(o,s)}t.setSizeBasis=n})(Gh||(Gh={}));var Xg;(function(t){t.stretchProperty=new ac({name:"stretch",create:function(){return 0},coerce:function(n,o){return Math.max(0,Math.floor(o))},changed:i}),t.sizeBasisProperty=new ac({name:"sizeBasis",create:function(){return 0},coerce:function(n,o){return Math.max(0,Math.floor(o))},changed:i});function e(n){return n==="left-to-right"||n==="right-to-left"}t.isHorizontal=e;function r(n){return Math.max(0,Math.floor(n))}t.clampSpacing=r;function i(n){n.parent&&n.parent.layout instanceof Gh&&n.parent.fit()}})(Xg||(Xg={}));var Oee=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:ik.createLayout(r)})||this;return i.addClass("lm-BoxPanel"),i.addClass("p-BoxPanel"),i}return Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(r){this.layout.direction=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(r){this.layout.alignment=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(r){r.child.addClass("lm-BoxPanel-child"),r.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-BoxPanel-child"),r.child.removeClass("p-BoxPanel-child")},e}(Jw);(function(t){function e(o){return Gh.getStretch(o)}t.getStretch=e;function r(o,s){Gh.setStretch(o,s)}t.setStretch=r;function i(o){return Gh.getSizeBasis(o)}t.getSizeBasis=i;function n(o,s){Gh.setSizeBasis(o,s)}t.setSizeBasis=n})(Oee||(Oee={}));var ik;(function(t){function e(r){return r.layout||new Gh(r)}t.createLayout=e})(ik||(ik={}));var Dee=function(t){ks(e,t);function e(r){var i=t.call(this,{node:ip.createNode()})||this;return i._activeIndex=-1,i._items=[],i._results=null,i.addClass("lm-CommandPalette"),i.addClass("p-CommandPalette"),i.setFlag(Br.Flag.DisallowLayout),i.commands=r.commands,i.renderer=r.renderer||e.defaultRenderer,i.commands.commandChanged.connect(i._onGenericChange,i),i.commands.keyBindingChanged.connect(i._onGenericChange,i),i}return e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(r){var i=ip.createItem(this.commands,r);return this._items.push(i),this.refresh(),i},e.prototype.addItems=function(r){var i=this,n=r.map(function(o){return ip.createItem(i.commands,o)});return n.forEach(function(o){return i._items.push(o)}),this.refresh(),n},e.prototype.removeItem=function(r){this.removeItemAt(this._items.indexOf(r))},e.prototype.removeItemAt=function(r){var i=rr.removeAt(this._items,r);i&&this.refresh()},e.prototype.clearItems=function(){this._items.length!==0&&(this._items.length=0,this.refresh())},e.prototype.refresh=function(){if(this._results=null,this.inputNode.value!==""){var r=this.node.getElementsByClassName("lm-close-icon")[0];r.style.display="inherit"}else{var r=this.node.getElementsByClassName("lm-close-icon")[0];r.style.display="none"}this.update()},e.prototype.handleEvent=function(r){switch(r.type){case"click":this._evtClick(r);break;case"keydown":this._evtKeyDown(r);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},e.prototype.onActivateRequest=function(r){if(this.isAttached){var i=this.inputNode;i.focus(),i.select()}},e.prototype.onUpdateRequest=function(r){var i=this.inputNode.value,n=this.contentNode,o=this._results;if(o||(o=this._results=ip.search(this._items,i),this._activeIndex=i?rr.findFirstIndex(o,ip.canActivate):-1),!i&&o.length===0){rp.render(null,n);return}if(i&&o.length===0){var s=this.renderer.renderEmptyMessage({query:i});rp.render(s,n);return}for(var l=this.renderer,u=this._activeIndex,f=new Array(o.length),v=0,T=o.length;v<T;++v){var E=o[v];if(E.type==="header"){var M=E.indices,O=E.category;f[v]=l.renderHeader({category:O,indices:M})}else{var F=E.item,M=E.indices,U=v===u;f[v]=l.renderItem({item:F,indices:M,active:U})}}if(rp.render(f,n),u<0||u>=o.length)n.scrollTop=0;else{var G=n.children[u];fo.scrollIntoViewIfNeeded(n,G)}},e.prototype._evtClick=function(r){if(r.button===0){if(r.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}var i=rr.findFirstIndex(this.contentNode.children,function(n){return n.contains(r.target)});i!==-1&&(r.preventDefault(),r.stopPropagation(),this._execute(i))}},e.prototype._evtKeyDown=function(r){if(!(r.altKey||r.ctrlKey||r.metaKey||r.shiftKey))switch(r.keyCode){case 13:r.preventDefault(),r.stopPropagation(),this._execute(this._activeIndex);break;case 38:r.preventDefault(),r.stopPropagation(),this._activatePreviousItem();break;case 40:r.preventDefault(),r.stopPropagation(),this._activateNextItem();break}},e.prototype._activateNextItem=function(){if(!(!this._results||this._results.length===0)){var r=this._activeIndex,i=this._results.length,n=r<i-1?r+1:0,o=n===0?i-1:n-1;this._activeIndex=rr.findFirstIndex(this._results,ip.canActivate,n,o),this.update()}},e.prototype._activatePreviousItem=function(){if(!(!this._results||this._results.length===0)){var r=this._activeIndex,i=this._results.length,n=r<=0?i-1:r-1,o=n===i-1?0:n+1;this._activeIndex=rr.findLastIndex(this._results,ip.canActivate,n,o),this.update()}},e.prototype._execute=function(r){if(this._results){var i=this._results[r];if(i){if(i.type==="header"){var n=this.inputNode;n.value=i.category.toLowerCase()+" ",n.focus(),this.refresh();return}i.item.isEnabled&&(this.commands.execute(i.item.command,i.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var r=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",r),this.toggleClass("p-mod-focused",r)},e.prototype._onGenericChange=function(){this.refresh()},e}(Br);(function(t){var e=function(){function r(){}return r.prototype.renderHeader=function(i){var n=this.formatHeader(i);return so.li({className:"lm-CommandPalette-header p-CommandPalette-header"},n)},r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i);return i.item.isToggleable?so.li({className:n,dataset:o,role:"checkbox","aria-checked":""+i.item.isToggled},this.renderItemIcon(i),this.renderItemContent(i),this.renderItemShortcut(i)):so.li({className:n,dataset:o},this.renderItemIcon(i),this.renderItemContent(i),this.renderItemShortcut(i))},r.prototype.renderEmptyMessage=function(i){var n=this.formatEmptyMessage(i);return so.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},n)},r.prototype.renderItemIcon=function(i){var n=this.createIconClass(i);return typeof i.item.icon=="string"?so.div({className:n},i.item.iconLabel):so.div({className:n},i.item.icon,i.item.iconLabel)},r.prototype.renderItemContent=function(i){return so.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(i),this.renderItemCaption(i))},r.prototype.renderItemLabel=function(i){var n=this.formatItemLabel(i);return so.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},n)},r.prototype.renderItemCaption=function(i){var n=this.formatItemCaption(i);return so.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},n)},r.prototype.renderItemShortcut=function(i){var n=this.formatItemShortcut(i);return so.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},n)},r.prototype.createItemClass=function(i){var n="lm-CommandPalette-item";n+=" p-CommandPalette-item",i.item.isEnabled||(n+=" lm-mod-disabled",n+=" p-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled",n+=" p-mod-toggled"),i.active&&(n+=" lm-mod-active",n+=" p-mod-active");var o=i.item.className;return o&&(n+=" "+o),n},r.prototype.createItemDataset=function(i){return nl(nl({},i.item.dataset),{command:i.item.command})},r.prototype.createIconClass=function(i){var n="lm-CommandPalette-itemIcon";n+=" p-CommandPalette-itemIcon";var o=i.item.iconClass;return o?n+" "+o:n},r.prototype.formatHeader=function(i){return!i.indices||i.indices.length===0?i.category:rv.highlight(i.category,i.indices,so.mark)},r.prototype.formatEmptyMessage=function(i){return"No commands found that match '"+i.query+"'"},r.prototype.formatItemShortcut=function(i){var n=i.item.keyBinding;return n?sv.formatKeystroke(n.keys):null},r.prototype.formatItemLabel=function(i){return!i.indices||i.indices.length===0?i.item.label:rv.highlight(i.item.label,i.indices,so.mark)},r.prototype.formatItemCaption=function(i){return i.item.caption},r}();t.Renderer=e,t.defaultRenderer=new e})(Dee||(Dee={}));var ip;(function(t){function e(){var E=document.createElement("div"),M=document.createElement("div"),O=document.createElement("div"),F=document.createElement("input"),U=document.createElement("ul"),G=document.createElement("button");return M.className="lm-CommandPalette-search",O.className="lm-CommandPalette-wrapper",F.className="lm-CommandPalette-input",G.className="lm-close-icon",U.className="lm-CommandPalette-content",M.classList.add("p-CommandPalette-search"),O.classList.add("p-CommandPalette-wrapper"),F.classList.add("p-CommandPalette-input"),U.classList.add("p-CommandPalette-content"),F.spellcheck=!1,O.appendChild(F),O.appendChild(G),M.appendChild(O),E.appendChild(M),E.appendChild(U),E}t.createNode=e;function r(E,M){return new T(E,M)}t.createItem=r;function i(E,M){var O=l(E,M);return O.sort(f),v(O)}t.search=i;function n(E){return E.type==="item"&&E.item.isEnabled}t.canActivate=n;function o(E){return E.trim().replace(/\s+/g," ")}function s(E){return E.replace(/\s+/g,"").toLowerCase()}function l(E,M){M=s(M);for(var O=[],F=0,U=E.length;F<U;++F){var G=E[F];if(G.isVisible){if(!M){O.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:G});continue}var J=u(G,M);J&&(G.isEnabled||(J.score+=1e3),O.push(J))}}return O}function u(E,M){for(var O=E.category.toLowerCase(),F=E.label.toLowerCase(),U=O+" "+F,G=1/0,J=null,K=/\b\w/g;;){var ne=K.exec(U);if(!ne)break;var ge=rv.matchSumOfDeltas(U,M,ne.index);if(!ge)break;ge&&ge.score<=G&&(G=ge.score,J=ge.indices)}if(!J||G===1/0)return null;for(var H=O.length+1,me=rr.lowerBound(J,H,function(Oe,fe){return Oe-fe}),he=J.slice(0,me),$=J.slice(me),Z=0,we=$.length;Z<we;++Z)$[Z]-=H;return he.length===0?{matchType:0,categoryIndices:null,labelIndices:$,score:G,item:E}:$.length===0?{matchType:1,categoryIndices:he,labelIndices:null,score:G,item:E}:{matchType:2,categoryIndices:he,labelIndices:$,score:G,item:E}}function f(E,M){var O=E.matchType-M.matchType;if(O!==0)return O;var F=E.score-M.score;if(F!==0)return F;var U=0,G=0;switch(E.matchType){case 0:U=E.labelIndices[0],G=M.labelIndices[0];break;case 1:case 2:U=E.categoryIndices[0],G=M.categoryIndices[0];break}if(U!==G)return U-G;var J=E.item.category.localeCompare(M.item.category);if(J!==0)return J;var K=E.item.rank,ne=M.item.rank;return K!==ne?K<ne?-1:1:E.item.label.localeCompare(M.item.label)}function v(E){var M=new Array(E.length);rr.fill(M,!1);for(var O=[],F=0,U=E.length;F<U;++F)if(!M[F]){var G=E[F],J=G.item,K=G.categoryIndices,ne=J.category;O.push({type:"header",category:ne,indices:K});for(var ge=F;ge<U;++ge)if(!M[ge]){var H=E[ge],me=H.item,he=H.labelIndices;me.category===ne&&(O.push({type:"item",item:me,indices:he}),M[ge]=!0)}}return O}var T=function(){function E(M,O){this._commands=M,this.category=o(O.category),this.command=O.command,this.args=O.args||Yg.JSONExt.emptyObject,this.rank=O.rank!==void 0?O.rank:1/0}return Object.defineProperty(E.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"keyBinding",{get:function(){var M=this,O=M.command,F=M.args;return rr.findLastValue(this._commands.keyBindings,function(U){return U.command===O&&Yg.JSONExt.deepEqual(U.args,F)})||null},enumerable:!0,configurable:!0}),E}()})(ip||(ip={}));var cv=function(t){ks(e,t);function e(r){var i=t.call(this,{node:cc.createNode()})||this;return i._childIndex=-1,i._activeIndex=-1,i._openTimerID=0,i._closeTimerID=0,i._items=[],i._childMenu=null,i._parentMenu=null,i._aboutToClose=new Wn(i),i._menuRequested=new Wn(i),i.addClass("lm-Menu"),i.addClass("p-Menu"),i.setFlag(Br.Flag.DisallowLayout),i.commands=r.commands,i.renderer=r.renderer||e.defaultRenderer,i}return e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var r=this;r._parentMenu;)r=r._parentMenu;return r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var r=this;r._childMenu;)r=r._childMenu;return r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(r){this.activeIndex=r?this._items.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(r){(r<0||r>=this._items.length)&&(r=-1),r!==-1&&!cc.canActivate(this._items[r])&&(r=-1),this._activeIndex!==r&&(this._activeIndex=r,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var r=this._items.length,i=this._activeIndex,n=i<r-1?i+1:0,o=n===0?r-1:n-1;this.activeIndex=rr.findFirstIndex(this._items,cc.canActivate,n,o)},e.prototype.activatePreviousItem=function(){var r=this._items.length,i=this._activeIndex,n=i<=0?r-1:i-1,o=n===r-1?0:n+1;this.activeIndex=rr.findLastIndex(this._items,cc.canActivate,n,o)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var r=this.activeItem;if(r){if(this._cancelOpenTimer(),this._cancelCloseTimer(),r.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();var i=r.command,n=r.args;this.commands.isEnabled(i,n)?this.commands.execute(i,n):console.log("Command '"+i+"' is disabled.")}}},e.prototype.addItem=function(r){return this.insertItem(this._items.length,r)},e.prototype.insertItem=function(r,i){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(r,this._items.length)),o=cc.createItem(this,i);return rr.insert(this._items,n,o),this.update(),o},e.prototype.removeItem=function(r){this.removeItemAt(this._items.indexOf(r))},e.prototype.removeItemAt=function(r){this.isAttached&&this.close(),this.activeIndex=-1;var i=rr.removeAt(this._items,r);i&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())},e.prototype.open=function(r,i,n){if(n===void 0&&(n={}),!this.isAttached){var o=n.forceX||!1,s=n.forceY||!1;cc.openRootMenu(this,r,i,o,s),this.activate()}},e.prototype.handleEvent=function(r){switch(r.type){case"keydown":this._evtKeyDown(r);break;case"mouseup":this._evtMouseUp(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseenter":this._evtMouseEnter(r);break;case"mouseleave":this._evtMouseLeave(r);break;case"mousedown":this._evtMouseDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},e.prototype.onActivateRequest=function(r){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(r){for(var i=this,n=this._items,o=this.renderer,s=this._activeIndex,l=cc.computeCollapsed(n),u=new Array(n.length),f=function(E,M){var O=n[E],F=E===s,U=l[E];u[E]=o.renderItem({item:O,active:F,collapsed:U,onfocus:function(){i.activeIndex=E}})},v=0,T=n.length;v<T;++v)f(v);rp.render(u,this.contentNode)},e.prototype.onCloseRequest=function(r){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var i=this._childMenu;i&&(this._childIndex=-1,this._childMenu=null,i._parentMenu=null,i.close());var n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,r)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation();var i=r.keyCode;if(i===13){this.triggerActiveItem();return}if(i===27){this.close();return}if(i===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(i===38){this.activatePreviousItem();return}if(i===39){var n=this.activeItem;n&&n.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(i===40){this.activateNextItem();return}var o=ov().keyForKeydownEvent(r);if(o){var s=this._activeIndex+1,l=cc.findMnemonic(this._items,o,s);l.index!==-1&&!l.multiple?(this.activeIndex=l.index,this.triggerActiveItem()):l.index!==-1?this.activeIndex=l.index:l.auto!==-1&&(this.activeIndex=l.auto)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(r){var i=rr.findFirstIndex(this.contentNode.children,function(o){return fo.hitTest(o,r.clientX,r.clientY)});if(i!==this._activeIndex){if(this.activeIndex=i,i=this.activeIndex,i===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;!n||n.type!=="submenu"||!n.submenu||this._startOpenTimer()}},e.prototype._evtMouseEnter=function(r){for(var i=this._parentMenu;i;i=i._parentMenu)i._cancelOpenTimer(),i._cancelCloseTimer(),i.activeIndex=i._childIndex},e.prototype._evtMouseLeave=function(r){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var i=r.clientX,n=r.clientY;if(fo.hitTest(this._childMenu.node,i,n)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()},e.prototype._evtMouseDown=function(r){this._parentMenu||(cc.hitTestMenus(this,r.clientX,r.clientY)?(r.preventDefault(),r.stopPropagation()):this.close())},e.prototype._openChildMenu=function(r){r===void 0&&(r=!1);var i=this.activeItem;if(!i||i.type!=="submenu"||!i.submenu){this._closeChildMenu();return}var n=i.submenu;if(n!==this._childMenu){e.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,xr.sendMessage(this,Br.Msg.UpdateRequest);var o=this.contentNode.children[this._activeIndex];cc.openSubmenu(n,o),r&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var r=this;this._openTimerID===0&&(this._openTimerID=window.setTimeout(function(){r._openTimerID=0,r._openChildMenu()},cc.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var r=this;this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(function(){r._closeTimerID=0,r._closeChildMenu()},cc.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e.saveWindowData=function(){cc.saveWindowData()},e}(Br);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i),s=this.createItemARIA(i);return so.li(nl({className:n,dataset:o,tabindex:"0",onfocus:i.onfocus},s),this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))},r.prototype.renderIcon=function(i){var n=this.createIconClass(i);return typeof i.item.icon=="string"?so.div({className:n},i.item.iconLabel):so.div({className:n},i.item.icon,i.item.iconLabel)},r.prototype.renderLabel=function(i){var n=this.formatLabel(i);return so.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},n)},r.prototype.renderShortcut=function(i){var n=this.formatShortcut(i);return so.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},n)},r.prototype.renderSubmenu=function(i){return so.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},r.prototype.createItemClass=function(i){var n="lm-Menu-item";n+=" p-Menu-item",i.item.isEnabled||(n+=" lm-mod-disabled",n+=" p-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled",n+=" p-mod-toggled"),i.item.isVisible||(n+=" lm-mod-hidden",n+=" p-mod-hidden"),i.active&&(n+=" lm-mod-active",n+=" p-mod-active"),i.collapsed&&(n+=" lm-mod-collapsed",n+=" p-mod-collapsed");var o=i.item.className;return o&&(n+=" "+o),n},r.prototype.createItemDataset=function(i){var n,o=i.item,s=o.type,l=o.command,u=o.dataset;return s==="command"?n=nl(nl({},u),{type:s,command:l}):n=nl(nl({},u),{type:s}),n},r.prototype.createIconClass=function(i){var n="lm-Menu-itemIcon";n+=" p-Menu-itemIcon";var o=i.item.iconClass;return o?n+" "+o:n},r.prototype.createItemARIA=function(i){var n={};switch(i.item.type){case"separator":n.role="presentation";break;case"submenu":n["aria-haspopup"]="true",i.item.isEnabled||(n["aria-disabled"]="true");break;default:i.item.isEnabled||(n["aria-disabled"]="true"),n.role="menuitem"}return n},r.prototype.formatLabel=function(i){var n=i.item,o=n.label,s=n.mnemonic;if(s<0||s>=o.length)return o;var l=o.slice(0,s),u=o.slice(s+1),f=o[s],v=so.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},f);return[l,v,u]},r.prototype.formatShortcut=function(i){var n=i.item.keyBinding;return n?sv.formatKeystroke(n.keys):null},r}();t.Renderer=e,t.defaultRenderer=new e})(cv||(cv={}));var cc;(function(t){t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3;var e=null,r=0;function i(){return r>0?(r--,e):v()}function n(){e=v(),r++}t.saveWindowData=n;function o(){var F=document.createElement("div"),U=document.createElement("ul");return U.className="lm-Menu-content",U.classList.add("p-Menu-content"),F.appendChild(U),U.setAttribute("role","menu"),F.tabIndex=0,F}t.createNode=o;function s(F){return F.type!=="separator"&&F.isEnabled&&F.isVisible}t.canActivate=s;function l(F,U){return new O(F.commands,U)}t.createItem=l;function u(F,U,G){for(var J=F;J;J=J.childMenu)if(fo.hitTest(J.node,U,G))return!0;return!1}t.hitTestMenus=u;function f(F){var U=new Array(F.length);rr.fill(U,!1);for(var G=0,J=F.length;G<J;++G){var K=F[G];if(K.isVisible){if(K.type!=="separator")break;U[G]=!0}}for(var ne=J-1;ne>=0;--ne){var K=F[ne];if(K.isVisible){if(K.type!=="separator")break;U[ne]=!0}}for(var ge=!1;++G<ne;){var K=F[G];K.isVisible&&(K.type!=="separator"?ge=!1:ge?U[G]=!0:ge=!0)}return U}t.computeCollapsed=f;function v(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function T(F,U,G,J,K){var ne=i(),ge=ne.pageXOffset,H=ne.pageYOffset,me=ne.clientWidth,he=ne.clientHeight;xr.sendMessage(F,Br.Msg.UpdateRequest);var $=he-(K?G:0),Z=F.node,we=Z.style;we.opacity="0",we.maxHeight=$+"px",Br.attach(F,document.body);var Oe=Z.getBoundingClientRect(),fe=Oe.width,Le=Oe.height;!J&&U+fe>ge+me&&(U=ge+me-fe),!K&&G+Le>H+he&&(G>H+he?G=H+he-Le:G=G-Le),we.transform="translate("+Math.max(0,U)+"px, "+Math.max(0,G)+"px",we.opacity="1"}t.openRootMenu=T;function E(F,U){var G=i(),J=G.pageXOffset,K=G.pageYOffset,ne=G.clientWidth,ge=G.clientHeight;xr.sendMessage(F,Br.Msg.UpdateRequest);var H=ge,me=F.node,he=me.style;he.opacity="0",he.maxHeight=H+"px",Br.attach(F,document.body);var $=me.getBoundingClientRect(),Z=$.width,we=$.height,Oe=fo.boxSizing(F.node),fe=U.getBoundingClientRect(),Le=fe.right-t.SUBMENU_OVERLAP;Le+Z>J+ne&&(Le=fe.left+t.SUBMENU_OVERLAP-Z);var ht=fe.top-Oe.borderTop-Oe.paddingTop;ht+we>K+ge&&(ht=fe.bottom+Oe.borderBottom+Oe.paddingBottom-we),he.transform="translate("+Math.max(0,Le)+"px, "+Math.max(0,ht)+"px",he.opacity="1"}t.openSubmenu=E;function M(F,U,G){for(var J=-1,K=-1,ne=!1,ge=U.toUpperCase(),H=0,me=F.length;H<me;++H){var he=(H+G)%me,$=F[he];if(s($)){var Z=$.label;if(Z.length!==0){var we=$.mnemonic;if(we>=0&&we<Z.length){Z[we].toUpperCase()===ge&&(J===-1?J=he:ne=!0);continue}K===-1&&Z[0].toUpperCase()===ge&&(K=he)}}}return{index:J,multiple:ne,auto:K}}t.findMnemonic=M;var O=function(){function F(U,G){this._commands=U,this.type=G.type||"command",this.command=G.command||"",this.args=G.args||Yg.JSONExt.emptyObject,this.submenu=G.submenu||null}return Object.defineProperty(F.prototype,"label",{get:function(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"mnemonic",{get:function(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"icon",{get:function(){return this.type==="command"?this._commands.icon(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.icon:this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"iconClass",{get:function(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"iconLabel",{get:function(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"caption",{get:function(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"className",{get:function(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"dataset",{get:function(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"isEnabled",{get:function(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"isToggled",{get:function(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"isVisible",{get:function(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"keyBinding",{get:function(){if(this.type==="command"){var U=this,G=U.command,J=U.args;return rr.findLastValue(this._commands.keyBindings,function(K){return K.command===G&&Yg.JSONExt.deepEqual(K.args,J)})||null}return null},enumerable:!0,configurable:!0}),F}()})(cc||(cc={}));var fTt=function(){function t(e){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var r=e.groupByTarget,i=e.sortBySelector,n=UMe(e,["groupByTarget","sortBySelector"]);this.menu=new cv(n),this._groupByTarget=r!==!1,this._sortBySelector=i!==!1}return t.prototype.addItem=function(e){var r=this,i=KI.createItem(e,this._idTick++);return this._items.push(i),new wA(function(){rr.removeFirstOf(r._items,i)})},t.prototype.open=function(e){var r=this;if(cv.saveWindowData(),this.menu.clearItems(),this._items.length===0)return!1;var i=KI.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);return!i||i.length===0?!1:(Ei(i,function(n){r.menu.addItem(n)}),this.menu.open(e.clientX,e.clientY),!0)},t}(),KI;(function(t){function e(s,l){var u=i(s.selector),f=s.rank!==void 0?s.rank:1/0;return nl(nl({},s),{selector:u,rank:f,id:l})}t.createItem=e;function r(s,l,u,f){var v=l.target;if(!v)return null;var T=l.currentTarget;if(!T||!T.contains(v)&&(v=document.elementFromPoint(l.clientX,l.clientY),!v||!T.contains(v)))return null;for(var E=[],M=s.slice();v!==null;){for(var O=[],F=0,U=M.length;F<U;++F){var G=M[F];G&&Hh.matches(v,G.selector)&&(O.push(G),M[F]=null)}if(O.length!==0&&(u&&O.sort(f?o:n),E.push.apply(E,O)),v===T)break;v=v.parentElement}return u||E.sort(f?o:n),E}t.matchItems=r;function i(s){if(s.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+s);if(!Hh.isValid(s))throw new Error("Invalid selector: "+s);return s}function n(s,l){var u=s.rank,f=l.rank;return u!==f?u<f?-1:1:s.id-l.id}function o(s,l){var u=Hh.calculateSpecificity(s.selector),f=Hh.calculateSpecificity(l.selector);return u!==f?f-u:n(s,l)}})(KI||(KI={}));var uv=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:$u.createNode()})||this;return i._currentIndex=-1,i._titles=[],i._titlesEditable=!1,i._previousTitle=null,i._dragData=null,i._addButtonEnabled=!1,i._tabMoved=new Wn(i),i._currentChanged=new Wn(i),i._addRequested=new Wn(i),i._tabCloseRequested=new Wn(i),i._tabDetachRequested=new Wn(i),i._tabActivateRequested=new Wn(i),i.addClass("lm-TabBar"),i.addClass("p-TabBar"),i.contentNode.setAttribute("role","tablist"),i.setFlag(Br.Flag.DisallowLayout),i._document=r.document||document,i.tabsMovable=r.tabsMovable||!1,i.titlesEditable=r.titlesEditable||!1,i.allowDeselect=r.allowDeselect||!1,i.addButtonEnabled=r.addButtonEnabled||!1,i.insertBehavior=r.insertBehavior||"select-tab-if-needed",i.name=r.name||"",i.orientation=r.orientation||"horizontal",i.removeBehavior=r.removeBehavior||"select-tab-after",i.renderer=r.renderer||e.defaultRenderer,i}return e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(r){this._titlesEditable=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(r){this.currentIndex=r?this._titles.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(r){if((r<0||r>=this._titles.length)&&(r=-1),this._currentIndex!==r){var i=this._currentIndex,n=this._titles[i]||null,o=r,s=this._titles[o]||null;this._currentIndex=o,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:o,currentTitle:s})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(r){this._name=r,r?this.contentNode.setAttribute("aria-label",r):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._releaseMouse(),this._orientation=r,this.dataset.orientation=r,this.contentNode.setAttribute("aria-orientation",r))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(r){this._addButtonEnabled!==r&&(this._addButtonEnabled=r,r?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(r){return this.insertTab(this._titles.length,r)},e.prototype.insertTab=function(r,i){this._releaseMouse();var n=$u.asTitle(i),o=this._titles.indexOf(n),s=Math.max(0,Math.min(r,this._titles.length));return o===-1?(rr.insert(this._titles,s,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,n),n):(s===this._titles.length&&s--,o===s||(rr.move(this._titles,o,s),this.update(),this._adjustCurrentForMove(o,s)),n)},e.prototype.removeTab=function(r){this.removeTabAt(this._titles.indexOf(r))},e.prototype.removeTabAt=function(r){this._releaseMouse();var i=rr.removeAt(this._titles,r);i&&(i.changed.disconnect(this._onTitleChanged,this),i===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(r,i))},e.prototype.clearTabs=function(){if(this._titles.length!==0){this._releaseMouse();for(var r=0,i=this._titles;r<i.length;r++){var n=i[r];n.changed.disconnect(this._onTitleChanged,this)}var o=this.currentIndex,s=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),o!==-1&&this._currentChanged.emit({previousIndex:o,previousTitle:s,currentIndex:-1,currentTitle:null})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"pointerdown":this._evtMouseDown(r);break;case"pointermove":this._evtMouseMove(r);break;case"pointerup":this._evtMouseUp(r);break;case"dblclick":this._evtDblClick(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(r){for(var i=this._titles,n=this.renderer,o=this.currentTitle,s=new Array(i.length),l=0,u=i.length;l<u;++l){var f=i[l],v=f===o,T=v?u:u-l-1;s[l]=n.renderTab({title:f,current:v,zIndex:T})}rp.render(s,this.contentNode)},e.prototype._evtDblClick=function(r){if(this.titlesEditable){var i=this.contentNode.children,n=rr.findFirstIndex(i,function(T){return fo.hitTest(T,r.clientX,r.clientY)});if(n!==-1){var o=this.titles[n],s=i[n].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(r.target)){var l=o.label||"",u=s.innerHTML;s.innerHTML="";var f=document.createElement("input");f.classList.add("lm-TabBar-tabInput"),f.value=l,s.appendChild(f);var v=function(){f.removeEventListener("blur",v),s.innerHTML=u};f.addEventListener("dblclick",function(T){return T.stopPropagation()}),f.addEventListener("blur",v),f.addEventListener("keydown",function(T){T.key==="Enter"?(f.value!==""&&(o.label=o.caption=f.value),v()):T.key==="Escape"&&v()}),f.select(),f.focus(),s.children.length>0&&s.children[0].focus()}}}},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&this._releaseMouse()},e.prototype._evtMouseDown=function(r){if(!(r.button!==0&&r.button!==1)&&!this._dragData){var i=this.addButtonEnabled&&this.addButtonNode.contains(r.target),n=this.contentNode.children,o=rr.findFirstIndex(n,function(l){return fo.hitTest(l,r.clientX,r.clientY)});if(!(o===-1&&!i)&&(r.preventDefault(),r.stopPropagation(),this._dragData={tab:n[o],index:o,pressX:r.clientX,pressY:r.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("mouseup",this,!0),this.document.addEventListener("pointerup",this,!0),!(r.button===1||i))){var s=n[o].querySelector(this.renderer.closeIconSelector);s&&s.contains(r.target)||(this.tabsMovable&&(this.document.addEventListener("mousemove",this,!0),this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===o?this.currentIndex=-1:this.currentIndex=o,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(r){var i=this._dragData;if(i){r.preventDefault(),r.stopPropagation();var n=this.contentNode.children;if(!(!i.dragActive&&!$u.dragExceeded(i,r))){if(!i.dragActive){var o=i.tab.getBoundingClientRect();this._orientation==="horizontal"?(i.tabPos=i.tab.offsetLeft,i.tabSize=o.width,i.tabPressPos=i.pressX-o.left):(i.tabPos=i.tab.offsetTop,i.tabSize=o.height,i.tabPressPos=i.pressY-o.top),i.tabLayout=$u.snapTabLayout(n,this._orientation),i.contentRect=this.contentNode.getBoundingClientRect(),i.override=TA.overrideCursor("default"),i.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),i.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),i.dragActive=!0}if(!i.detachRequested&&$u.detachExceeded(i,r)){i.detachRequested=!0;var s=i.index,l=r.clientX,u=r.clientY,f=n[s],v=this._titles[s];if(this._tabDetachRequested.emit({index:s,title:v,tab:f,clientX:l,clientY:u}),i.dragAborted)return}$u.layoutTabs(n,i,r,this._orientation)}}},e.prototype._evtMouseUp=function(r){var i=this;if(!(r.button!==0&&r.button!==1)){var n=this._dragData;if(n){if(r.preventDefault(),r.stopPropagation(),this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!n.dragActive){this._dragData=null;var o=this.addButtonEnabled&&this.addButtonNode.contains(r.target);if(o){this._addRequested.emit(void 0);return}var s=this.contentNode.children,l=rr.findFirstIndex(s,function(T){return fo.hitTest(T,r.clientX,r.clientY)});if(l!==n.index)return;var u=this._titles[l];if(!u.closable)return;if(r.button===1){this._tabCloseRequested.emit({index:l,title:u});return}var f=s[l].querySelector(this.renderer.closeIconSelector);if(f&&f.contains(r.target)){this._tabCloseRequested.emit({index:l,title:u});return}return}if(r.button===0){$u.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("lm-mod-dragging"),n.tab.classList.remove("p-mod-dragging");var v=$u.parseTransitionDuration(n.tab);setTimeout(function(){if(!n.dragAborted){i._dragData=null,$u.resetTabPositions(i.contentNode.children,i._orientation),n.override.dispose(),i.removeClass("lm-mod-dragging"),i.removeClass("p-mod-dragging");var T=n.index,E=n.targetIndex;E===-1||T===E||(rr.move(i._titles,T,E),i._adjustCurrentForMove(T,E),i._tabMoved.emit({fromIndex:T,toIndex:E,title:i._titles[E]}),xr.sendMessage(i,Br.Msg.UpdateRequest))}},v)}}}},e.prototype._releaseMouse=function(){var r=this._dragData;r&&(this._dragData=null,this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),r.dragAborted=!0,r.dragActive&&($u.resetTabPositions(this.contentNode.children,this._orientation),r.override.dispose(),r.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),r.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(r,i){var n=this.currentTitle,o=this._currentIndex,s=this.insertBehavior;if(s==="select-tab"||s==="select-tab-if-needed"&&o===-1){this._currentIndex=r,this._previousTitle=n,this._currentChanged.emit({previousIndex:o,previousTitle:n,currentIndex:r,currentTitle:i});return}o>=r&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(r,i){this._currentIndex===r?this._currentIndex=i:this._currentIndex<r&&this._currentIndex>=i?this._currentIndex++:this._currentIndex>r&&this._currentIndex<=i&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(r,i){var n=this._currentIndex,o=this.removeBehavior;if(n!==r){n>r&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:-1,currentTitle:null});return}if(o==="select-tab-after"){this._currentIndex=Math.min(r,this._titles.length-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(o==="select-tab-before"){this._currentIndex=Math.max(0,r-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(o==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(r,this._titles.length-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:-1,currentTitle:null})},e.prototype._onTitleChanged=function(r){this.update()},e}(Br);(function(t){var e=function(){function r(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++r._nInstance}return r.prototype.renderTab=function(i){var n=i.title.caption,o=this.createTabKey(i),s=o,l=this.createTabStyle(i),u=this.createTabClass(i),f=this.createTabDataset(i),v=this.createTabARIA(i);return i.title.closable?so.li(nl({id:s,key:o,className:u,title:n,style:l,dataset:f},v),this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):so.li(nl({id:s,key:o,className:u,title:n,style:l,dataset:f},v),this.renderIcon(i),this.renderLabel(i))},r.prototype.renderIcon=function(i){var n=i.title,o=this.createIconClass(i);return typeof n.icon=="string"?so.div({className:o},n.iconLabel):so.div({className:o},n.icon,n.iconLabel)},r.prototype.renderLabel=function(i){return so.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},i.title.label)},r.prototype.renderCloseIcon=function(i){return so.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},r.prototype.createTabKey=function(i){var n=this._tabKeys.get(i.title);return n===void 0&&(n="tab-key-"+this._uuid+"-"+this._tabID++,this._tabKeys.set(i.title,n)),n},r.prototype.createTabStyle=function(i){return{zIndex:""+i.zIndex}},r.prototype.createTabClass=function(i){var n="lm-TabBar-tab";return n+=" p-TabBar-tab",i.title.className&&(n+=" "+i.title.className),i.title.closable&&(n+=" lm-mod-closable",n+=" p-mod-closable"),i.current&&(n+=" lm-mod-current",n+=" p-mod-current"),n},r.prototype.createTabDataset=function(i){return i.title.dataset},r.prototype.createTabARIA=function(i){return{role:"tab","aria-selected":i.current.toString()}},r.prototype.createIconClass=function(i){var n="lm-TabBar-tabIcon";n+=" p-TabBar-tabIcon";var o=i.title.iconClass;return o?n+" "+o:n},r._nInstance=0,r}();t.Renderer=e,t.defaultRenderer=new e,t.addButtonSelector=".lm-TabBar-addButton"})(uv||(uv={}));var $u;(function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20;function e(){var v=document.createElement("div"),T=document.createElement("ul");T.setAttribute("role","tablist"),T.className="lm-TabBar-content",T.classList.add("p-TabBar-content"),v.appendChild(T);var E=document.createElement("div");return E.className="lm-TabBar-addButton lm-mod-hidden",v.appendChild(E),v}t.createNode=e;function r(v){return v instanceof Q4?v:new Q4(v)}t.asTitle=r;function i(v){var T=window.getComputedStyle(v);return 1e3*(parseFloat(T.transitionDuration)||0)}t.parseTransitionDuration=i;function n(v,T){for(var E=new Array(v.length),M=0,O=v.length;M<O;++M){var F=v[M],U=window.getComputedStyle(F);T==="horizontal"?E[M]={pos:F.offsetLeft,size:F.offsetWidth,margin:parseFloat(U.marginLeft)||0}:E[M]={pos:F.offsetTop,size:F.offsetHeight,margin:parseFloat(U.marginTop)||0}}return E}t.snapTabLayout=n;function o(v,T){var E=Math.abs(T.clientX-v.pressX),M=Math.abs(T.clientY-v.pressY);return E>=t.DRAG_THRESHOLD||M>=t.DRAG_THRESHOLD}t.dragExceeded=o;function s(v,T){var E=v.contentRect;return T.clientX<E.left-t.DETACH_THRESHOLD||T.clientX>=E.right+t.DETACH_THRESHOLD||T.clientY<E.top-t.DETACH_THRESHOLD||T.clientY>=E.bottom+t.DETACH_THRESHOLD}t.detachExceeded=s;function l(v,T,E,M){var O,F,U,G;M==="horizontal"?(O=T.pressX,F=E.clientX-T.contentRect.left,U=E.clientX,G=T.contentRect.width):(O=T.pressY,F=E.clientY-T.contentRect.top,U=E.clientY,G=T.contentRect.height);for(var J=T.index,K=F-T.tabPressPos,ne=K+T.tabSize,ge=0,H=v.length;ge<H;++ge){var me=void 0,he=T.tabLayout[ge],$=he.pos+(he.size>>1);if(ge<T.index&&K<$)me=T.tabSize+T.tabLayout[ge+1].margin+"px",J=Math.min(J,ge);else if(ge>T.index&&ne>$)me=-T.tabSize-he.margin+"px",J=Math.max(J,ge);else if(ge===T.index){var Z=U-O,we=G-(T.tabPos+T.tabSize);me=Math.max(-T.tabPos,Math.min(Z,we))+"px"}else me="";M==="horizontal"?v[ge].style.left=me:v[ge].style.top=me}T.targetIndex=J}t.layoutTabs=l;function u(v,T){var E;T==="horizontal"?E=v.contentRect.width:E=v.contentRect.height;var M;if(v.targetIndex===v.index)M=0;else if(v.targetIndex>v.index){var O=v.tabLayout[v.targetIndex];M=O.pos+O.size-v.tabSize-v.tabPos}else{var O=v.tabLayout[v.targetIndex];M=O.pos-v.tabPos}var F=E-(v.tabPos+v.tabSize),U=Math.max(-v.tabPos,Math.min(M,F));T==="horizontal"?v.tab.style.left=U+"px":v.tab.style.top=U+"px"}t.finalizeTabPosition=u;function f(v,T){Ei(v,function(E){T==="horizontal"?E.style.left="":E.style.top=""})}t.resetTabPositions=f})($u||($u={}));var jMe=function(t){ks(e,t);function e(r){var i=t.call(this)||this;return i._spacing=4,i._dirty=!1,i._root=null,i._box=null,i._items=new Map,i.renderer=r.renderer,r.spacing!==void 0&&(i._spacing=Yw.clampDimension(r.spacing)),i._document=r.document||document,i._hiddenMode=r.hiddenMode!==void 0?r.hiddenMode:Br.HiddenMode.Display,i}return e.prototype.dispose=function(){var r=this.iter();this._items.forEach(function(i){i.dispose()}),this._box=null,this._root=null,this._items.clear(),Ei(r,function(i){i.dispose()}),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(r){var i=this;this._hiddenMode!==r&&(this._hiddenMode=r,Ei(this.tabBars(),function(n){n.titles.length>1&&n.titles.forEach(function(o){o.owner.hiddenMode=i._hiddenMode})}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=Yw.clampDimension(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this._root===null},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():uu()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():uu()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():uu()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():uu()},e.prototype.handles=function(){return this._root?this._root.iterHandles():uu()},e.prototype.moveHandle=function(r,i,n){var o=r.classList.contains("lm-mod-hidden");if(o=o||r.classList.contains("p-mod-hidden"),!(!this._root||o)){var s=this._root.findSplitNode(r);if(s){var l;s.node.orientation==="horizontal"?l=i-r.offsetLeft:l=n-r.offsetTop,l!==0&&(s.node.holdSizes(),fu.adjust(s.node.sizers,s.index,l),this.parent&&this.parent.update())}}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(r){var i=this,n=new Set,o;r.main?o=Ea.normalizeAreaConfig(r.main,n):o=null;var s=this.widgets(),l=this.tabBars(),u=this.handles();this._root=null,Ei(s,function(f){n.has(f)||(f.parent=null)}),Ei(l,function(f){f.dispose()}),Ei(u,function(f){f.parentNode&&f.parentNode.removeChild(f)}),n.forEach(function(f){f.parent=i.parent}),o?this._root=Ea.realizeAreaConfig(o,{createTabBar:function(f){return i._createTabBar()},createHandle:function(){return i._createHandle()}},this._document):this._root=null,this.parent&&(n.forEach(function(f){i.attachWidget(f)}),this.parent.fit())},e.prototype.addWidget=function(r,i){i===void 0&&(i={});var n=i.ref||null,o=i.mode||"tab-after",s=null;if(this._root&&n&&(s=this._root.findTabNode(n)),n&&!s)throw new Error("Reference widget is not in the layout.");switch(r.parent=this.parent,o){case"tab-after":this._insertTab(r,n,s,!0);break;case"tab-before":this._insertTab(r,n,s,!1);break;case"split-top":this._insertSplit(r,n,s,"vertical",!1);break;case"split-left":this._insertSplit(r,n,s,"horizontal",!1);break;case"split-right":this._insertSplit(r,n,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(r,n,s,"vertical",!0);break}this.parent&&(this.attachWidget(r),this.parent.fit())},e.prototype.removeWidget=function(r){this._removeWidget(r),this.parent&&(this.detachWidget(r),this.parent.fit())},e.prototype.hitTestTabAreas=function(r,i){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=fo.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),o=r-n.left-this._box.borderLeft,s=i-n.top-this._box.borderTop,l=this._root.hitTestTabNodes(o,s);if(!l)return null;var u=l.tabBar,f=l.top,v=l.left,T=l.width,E=l.height,M=this._box.borderLeft+this._box.borderRight,O=this._box.borderTop+this._box.borderBottom,F=n.width-M-(v+T),U=n.height-O-(f+E);return{tabBar:u,x:o,y:s,top:f,left:v,right:F,bottom:U,width:T,height:E}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i){r.attachWidget(i)}),Ei(this.handles(),function(i){r.parent.node.appendChild(i)}),this.parent.fit()},e.prototype.attachWidget=function(r){this.parent.node!==r.node.parentNode&&(this._items.set(r,new Zw(r)),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterAttach))},e.prototype.detachWidget=function(r){if(this.parent.node===r.node.parentNode){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterDetach);var i=this._items.get(r);i&&(this._items.delete(r),i.dispose())}},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(r){if(this._root){var i=this._root.findTabNode(r);if(i){if(Ea.removeAria(r),i.tabBar.titles.length>1){if(i.tabBar.removeTab(r.title),this._hiddenMode===Br.HiddenMode.Scale&&i.tabBar.titles.length==1){var n=i.tabBar.titles[0].owner;n.hiddenMode=Br.HiddenMode.Display}return}if(i.tabBar.dispose(),this._root===i){this._root=null;return}this._root.holdAllSizes();var o=i.parent;i.parent=null;var s=rr.removeFirstOf(o.children,i),l=rr.removeAt(o.handles,s);if(rr.removeAt(o.sizers,s),l.parentNode&&l.parentNode.removeChild(l),o.children.length>1){o.syncHandles();return}var u=o.parent;o.parent=null;var f=o.children[0],v=o.handles[0];if(o.children.length=0,o.handles.length=0,o.sizers.length=0,v.parentNode&&v.parentNode.removeChild(v),this._root===o){f.parent=null,this._root=f;return}var T=u,E=T.children.indexOf(o);if(f instanceof Ea.TabLayoutNode){f.parent=T,T.children[E]=f;return}var M=rr.removeAt(T.handles,E);rr.removeAt(T.children,E),rr.removeAt(T.sizers,E),M.parentNode&&M.parentNode.removeChild(M);for(var O=0,F=f.children.length;O<F;++O){var U=f.children[O],G=f.handles[O],J=f.sizers[O];rr.insert(T.children,E+O,U),rr.insert(T.handles,E+O,G),rr.insert(T.sizers,E+O,J),U.parent=T}f.children.length=0,f.handles.length=0,f.sizers.length=0,f.parent=null,T.syncHandles()}}},e.prototype._insertTab=function(r,i,n,o){if(r!==i){if(!this._root){var s=new Ea.TabLayoutNode(this._createTabBar());s.tabBar.addTab(r.title),this._root=s,Ea.addAria(r,s.tabBar);return}n||(n=this._root.findFirstTabNode()),n.tabBar.titles.indexOf(r.title)===-1&&(this._removeWidget(r),r.hide());var l;if(i?l=n.tabBar.titles.indexOf(i.title):l=n.tabBar.currentIndex,this._hiddenMode===Br.HiddenMode.Scale)if(n.tabBar.titles.length===0)r.hiddenMode=Br.HiddenMode.Display;else if(n.tabBar.titles.length==1){var u=n.tabBar.titles[0].owner;u.hiddenMode=Br.HiddenMode.Scale}else r.hiddenMode=Br.HiddenMode.Scale;else r.hiddenMode=this._hiddenMode;n.tabBar.insertTab(l+(o?1:0),r.title),Ea.addAria(r,n.tabBar)}},e.prototype._insertSplit=function(r,i,n,o,s){if(!(r===i&&n&&n.tabBar.titles.length===1)){this._removeWidget(r);var l=new Ea.TabLayoutNode(this._createTabBar());if(l.tabBar.addTab(r.title),Ea.addAria(r,l.tabBar),!this._root){this._root=l;return}if(!n||!n.parent){var u=this._splitRoot(o),f=s?u.children.length:0;u.normalizeSizes();var v=Ea.createSizer(n?1:Ea.GOLDEN_RATIO);rr.insert(u.children,f,l),rr.insert(u.sizers,f,v),rr.insert(u.handles,f,this._createHandle()),l.parent=u,u.normalizeSizes(),u.syncHandles();return}var T=n.parent;if(T.orientation===o){var E=T.children.indexOf(n);T.normalizeSizes();var M=T.sizers[E].sizeHint/=2,O=E+(s?1:0);rr.insert(T.children,O,l),rr.insert(T.sizers,O,Ea.createSizer(M)),rr.insert(T.handles,O,this._createHandle()),l.parent=T,T.syncHandles();return}var F=rr.removeFirstOf(T.children,n),U=new Ea.SplitLayoutNode(o);U.normalized=!0,U.children.push(n),U.sizers.push(Ea.createSizer(.5)),U.handles.push(this._createHandle()),n.parent=U;var G=s?1:0;rr.insert(U.children,G,l),rr.insert(U.sizers,G,Ea.createSizer(.5)),rr.insert(U.handles,G,this._createHandle()),l.parent=U,U.syncHandles(),rr.insert(T.children,F,U),U.parent=T}},e.prototype._splitRoot=function(r){var i=this._root;if(i instanceof Ea.SplitLayoutNode&&i.orientation===r)return i;var n=this._root=new Ea.SplitLayoutNode(r);return i&&(n.children.push(i),n.sizers.push(Ea.createSizer(0)),n.handles.push(this._createHandle()),i.parent=n),n},e.prototype._fit=function(){var r=0,i=0;if(this._root){var n=this._root.fit(this._spacing,this._items);r=n.minWidth,i=n.minHeight}var o=this._box=fo.boxSizing(this.parent.node);r+=o.horizontalSum,i+=o.verticalSum;var s=this.parent.node.style;s.minWidth=r+"px",s.minHeight=i+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){if(this._dirty=!1,!!this._root){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=fo.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,l=i-this._box.verticalSum;this._root.update(n,o,s,l,this._spacing,this._items)}},e.prototype._createTabBar=function(){var r=this.renderer.createTabBar(this._document);return r.orientation="horizontal",this.parent&&(r.parent=this.parent,this.attachWidget(r)),r},e.prototype._createHandle=function(){var r=this.renderer.createHandle(),i=r.style;return i.position="absolute",i.top="0",i.left="0",i.width="0",i.height="0",this.parent&&this.parent.node.appendChild(r),r},e}(CA),Ea;(function(t){t.GOLDEN_RATIO=.618;function e(E){var M=new SA;return M.sizeHint=E,M.size=E,M}t.createSizer=e;function r(E,M){var O;return E.type==="tab-area"?O=u(E,M):O=f(E,M),O}t.normalizeAreaConfig=r;function i(E,M,O){var F;return E.type==="tab-area"?F=v(E,M,O):F=T(E,M,O),F}t.realizeAreaConfig=i;var n=function(){function E(M){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var O=new SA,F=new SA;O.stretch=0,F.stretch=1,this.tabBar=M,this.sizers=[O,F]}return Object.defineProperty(E.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),E.prototype.iterAllWidgets=function(){return j4(qw(this.tabBar),this.iterUserWidgets())},E.prototype.iterUserWidgets=function(){return bA(this.tabBar.titles,function(M){return M.owner})},E.prototype.iterSelectedWidgets=function(){var M=this.tabBar.currentTitle;return M?qw(M.owner):uu()},E.prototype.iterTabBars=function(){return qw(this.tabBar)},E.prototype.iterHandles=function(){return uu()},E.prototype.findTabNode=function(M){return this.tabBar.titles.indexOf(M.title)!==-1?this:null},E.prototype.findSplitNode=function(M){return null},E.prototype.findFirstTabNode=function(){return this},E.prototype.hitTestTabNodes=function(M,O){return M<this._left||M>=this._left+this._width||O<this._top||O>=this._top+this._height?null:this},E.prototype.createConfig=function(){var M=this.tabBar.titles.map(function(F){return F.owner}),O=this.tabBar.currentIndex;return{type:"tab-area",widgets:M,currentIndex:O}},E.prototype.holdAllSizes=function(){},E.prototype.fit=function(M,O){var F=0,U=0,G=1/0,J=1/0,K=O.get(this.tabBar),ne=this.tabBar.currentTitle,ge=ne?O.get(ne.owner):void 0,H=this.sizers,me=H[0],he=H[1];return K&&K.fit(),ge&&ge.fit(),K&&!K.isHidden?(F=Math.max(F,K.minWidth),U+=K.minHeight,me.minSize=K.minHeight,me.maxSize=K.maxHeight):(me.minSize=0,me.maxSize=0),ge&&!ge.isHidden?(F=Math.max(F,ge.minWidth),U+=ge.minHeight,he.minSize=ge.minHeight,he.maxSize=1/0):(he.minSize=0,he.maxSize=1/0),{minWidth:F,minHeight:U,maxWidth:G,maxHeight:J}},E.prototype.update=function(M,O,F,U,G,J){this._top=O,this._left=M,this._width=F,this._height=U;var K=J.get(this.tabBar),ne=this.tabBar.currentTitle,ge=ne?J.get(ne.owner):void 0;if(fu.calc(this.sizers,U),K&&!K.isHidden){var H=this.sizers[0].size;K.update(M,O,F,H),O+=H}if(ge&&!ge.isHidden){var H=this.sizers[1].size;ge.update(M,O,F,H)}},E}();t.TabLayoutNode=n;var o=function(){function E(M){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=M}return E.prototype.iterAllWidgets=function(){var M=bA(this.children,function(O){return O.iterAllWidgets()});return new Gg(M)},E.prototype.iterUserWidgets=function(){var M=bA(this.children,function(O){return O.iterUserWidgets()});return new Gg(M)},E.prototype.iterSelectedWidgets=function(){var M=bA(this.children,function(O){return O.iterSelectedWidgets()});return new Gg(M)},E.prototype.iterTabBars=function(){var M=bA(this.children,function(O){return O.iterTabBars()});return new Gg(M)},E.prototype.iterHandles=function(){var M=bA(this.children,function(O){return O.iterHandles()});return j4(this.handles,new Gg(M))},E.prototype.findTabNode=function(M){for(var O=0,F=this.children.length;O<F;++O){var U=this.children[O].findTabNode(M);if(U)return U}return null},E.prototype.findSplitNode=function(M){var O=this.handles.indexOf(M);if(O!==-1)return{index:O,node:this};for(var F=0,U=this.children.length;F<U;++F){var G=this.children[F].findSplitNode(M);if(G)return G}return null},E.prototype.findFirstTabNode=function(){return this.children.length===0?null:this.children[0].findFirstTabNode()},E.prototype.hitTestTabNodes=function(M,O){for(var F=0,U=this.children.length;F<U;++F){var G=this.children[F].hitTestTabNodes(M,O);if(G)return G}return null},E.prototype.createConfig=function(){var M=this.orientation,O=this.createNormalizedSizes(),F=this.children.map(function(U){return U.createConfig()});return{type:"split-area",orientation:M,children:F,sizes:O}},E.prototype.syncHandles=function(){var M=this;Ei(this.handles,function(O,F){O.setAttribute("data-orientation",M.orientation),F===M.handles.length-1?(O.classList.add("lm-mod-hidden"),O.classList.add("p-mod-hidden")):(O.classList.remove("lm-mod-hidden"),O.classList.remove("p-mod-hidden"))})},E.prototype.holdSizes=function(){Ei(this.sizers,function(M){M.sizeHint=M.size})},E.prototype.holdAllSizes=function(){Ei(this.children,function(M){return M.holdAllSizes()}),this.holdSizes()},E.prototype.normalizeSizes=function(){var M=this.sizers.length;if(M!==0){this.holdSizes();var O=H4(this.sizers,function(F,U){return F+U.sizeHint},0);O===0?Ei(this.sizers,function(F){F.size=F.sizeHint=1/M}):Ei(this.sizers,function(F){F.size=F.sizeHint/=O}),this.normalized=!0}},E.prototype.createNormalizedSizes=function(){var M=this.sizers.length;if(M===0)return[];var O=this.sizers.map(function(U){return U.size}),F=H4(O,function(U,G){return U+G},0);return F===0?Ei(O,function(U,G){O[G]=1/M}):Ei(O,function(U,G){O[G]=U/F}),O},E.prototype.fit=function(M,O){for(var F=this.orientation==="horizontal",U=Math.max(0,this.children.length-1)*M,G=F?U:0,J=F?0:U,K=1/0,ne=1/0,ge=0,H=this.children.length;ge<H;++ge){var me=this.children[ge].fit(M,O);F?(J=Math.max(J,me.minHeight),G+=me.minWidth,this.sizers[ge].minSize=me.minWidth):(G=Math.max(G,me.minWidth),J+=me.minHeight,this.sizers[ge].minSize=me.minHeight)}return{minWidth:G,minHeight:J,maxWidth:K,maxHeight:ne}},E.prototype.update=function(M,O,F,U,G,J){var K=this.orientation==="horizontal",ne=Math.max(0,this.children.length-1)*G,ge=Math.max(0,(K?F:U)-ne);this.normalized&&(Ei(this.sizers,function(we){we.sizeHint*=ge}),this.normalized=!1),fu.calc(this.sizers,ge);for(var H=0,me=this.children.length;H<me;++H){var he=this.children[H],$=this.sizers[H].size,Z=this.handles[H].style;K?(he.update(M,O,$,U,G,J),M+=$,Z.top=O+"px",Z.left=M+"px",Z.width=G+"px",Z.height=U+"px",M+=G):(he.update(M,O,F,$,G,J),O+=$,Z.top=O+"px",Z.left=M+"px",Z.width=F+"px",Z.height=G+"px",O+=G)}},E}();t.SplitLayoutNode=o;function s(E,M){E.node.setAttribute("role","tabpanel");var O=M.renderer;if(O instanceof uv.Renderer){var F=O.createTabKey({title:E.title,current:!1,zIndex:0});E.node.setAttribute("aria-labelledby",F)}}t.addAria=s;function l(E){E.node.removeAttribute("role"),E.node.removeAttribute("aria-labelledby")}t.removeAria=l;function u(E,M){if(E.widgets.length===0)return null;var O=[];if(Ei(E.widgets,function(U){M.has(U)||(M.add(U),O.push(U))}),O.length===0)return null;var F=E.currentIndex;return F!==-1&&(F<0||F>=O.length)&&(F=0),{type:"tab-area",widgets:O,currentIndex:F}}function f(E,M){for(var O=E.orientation,F=[],U=[],G=0,J=E.children.length;G<J;++G){var K=r(E.children[G],M);K&&(K.type==="tab-area"||K.orientation!==O?(F.push(K),U.push(Math.abs(E.sizes[G]||0))):(F.push.apply(F,K.children),U.push.apply(U,K.sizes)))}return F.length===0?null:F.length===1?F[0]:{type:"split-area",orientation:O,children:F,sizes:U}}function v(E,M,O){var F=M.createTabBar(O);return Ei(E.widgets,function(U){U.hide(),F.addTab(U.title),t.addAria(U,F)}),F.currentIndex=E.currentIndex,new n(F)}function T(E,M,O){var F=new o(E.orientation);return Ei(E.children,function(U,G){var J=i(U,M,O),K=e(E.sizes[G]),ne=M.createHandle();F.children.push(J),F.handles.push(ne),F.sizers.push(K),J.parent=F}),F.syncHandles(),F.normalizeSizes(),F}})(Ea||(Ea={}));var Lee=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;i._drag=null,i._tabsMovable=!0,i._tabsConstrained=!1,i._addButtonEnabled=!1,i._pressData=null,i._layoutModified=new Wn(i),i._addRequested=new Wn(i),i.addClass("lm-DockPanel"),i.addClass("p-DockPanel"),i._document=r.document||document,i._mode=r.mode||"multiple-document",i._renderer=r.renderer||e.defaultRenderer,i._edges=r.edges||Qs.DEFAULT_EDGES,r.tabsMovable!==void 0&&(i._tabsMovable=r.tabsMovable),r.tabsConstrained!==void 0&&(i._tabsConstrained=r.tabsConstrained),r.addButtonEnabled!==void 0&&(i._addButtonEnabled=r.addButtonEnabled),i.dataset.mode=i._mode;var n={createTabBar:function(){return i._createTabBar()},createHandle:function(){return i._createHandle()}};return i.layout=new jMe({document:i._document,renderer:n,spacing:r.spacing,hiddenMode:r.hiddenMode}),i.overlay=r.overlay||new e.Overlay,i.node.appendChild(i.overlay.node),i}return e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(r){this.layout.hiddenMode=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(r){if(this._mode!==r){this._mode=r,this.dataset.mode=r;var i=this.layout;switch(r){case"multiple-document":Ei(i.tabBars(),function(n){n.show()});break;case"single-document":i.restoreLayout(Qs.createSingleDocumentConfig(this));break;default:throw"unreachable"}xr.postMessage(this,Qs.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(r){this._tabsMovable=r,Ei(this.tabBars(),function(i){i.tabsMovable=r})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(r){this._tabsConstrained=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(r){this._addButtonEnabled=r,Ei(this.tabBars(),function(i){i.addButtonEnabled=r})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(r){var i=iv(this.tabBars(),function(n){return n.titles.indexOf(r.title)!==-1});if(!i)throw new Error("Widget is not contained in the dock panel.");i.currentTitle=r.title},e.prototype.activateWidget=function(r){this.selectWidget(r),r.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(r){this._mode="multiple-document",this.layout.restoreLayout(r),(il.IS_EDGE||il.IS_IE)&&xr.flush(),xr.postMessage(this,Qs.LayoutModified)},e.prototype.addWidget=function(r,i){i===void 0&&(i={}),this._mode==="single-document"?this.layout.addWidget(r):this.layout.addWidget(r,i),xr.postMessage(this,Qs.LayoutModified)},e.prototype.processMessage=function(r){r.type==="layout-modified"?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,r)},e.prototype.handleEvent=function(r){switch(r.type){case"lm-dragenter":this._evtDragEnter(r);break;case"lm-dragleave":this._evtDragLeave(r);break;case"lm-dragover":this._evtDragOver(r);break;case"lm-drop":this._evtDrop(r);break;case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"pointerdown":this._evtMouseDown(r);break;case"pointermove":this._evtMouseMove(r);break;case"pointerup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},e.prototype.onChildAdded=function(r){Qs.isGeneratedTabBarProperty.get(r.child)||(r.child.addClass("lm-DockPanel-widget"),r.child.addClass("p-DockPanel-widget"))},e.prototype.onChildRemoved=function(r){Qs.isGeneratedTabBarProperty.get(r.child)||(r.child.removeClass("lm-DockPanel-widget"),r.child.removeClass("p-DockPanel-widget"),xr.postMessage(this,Qs.LayoutModified))},e.prototype._evtDragEnter=function(r){r.mimeData.hasData("application/vnd.lumino.widget-factory")&&(r.preventDefault(),r.stopPropagation())},e.prototype._evtDragLeave=function(r){r.preventDefault(),!(this._tabsConstrained&&r.source!==this)&&(r.stopPropagation(),this.overlay.hide(1))},e.prototype._evtDragOver=function(r){r.preventDefault(),this._tabsConstrained&&r.source!==this||this._showOverlay(r.clientX,r.clientY)==="invalid"?r.dropAction="none":(r.stopPropagation(),r.dropAction=r.proposedAction)},e.prototype._evtDrop=function(r){if(r.preventDefault(),this.overlay.hide(0),r.proposedAction==="none"){r.dropAction="none";return}var i=r.clientX,n=r.clientY,o=Qs.findDropTarget(this,i,n,this._edges),s=o.zone,l=o.target;if(this._tabsConstrained&&r.source!==this||s==="invalid"){r.dropAction="none";return}var u=r.mimeData,f=u.getData("application/vnd.lumino.widget-factory");if(typeof f!="function"){r.dropAction="none";return}var v=f();if(!(v instanceof Br)){r.dropAction="none";return}if(v.contains(this)){r.dropAction="none";return}var T=l?Qs.getDropRef(l.tabBar):null;switch(s){case"root-all":this.addWidget(v);break;case"root-top":this.addWidget(v,{mode:"split-top"});break;case"root-left":this.addWidget(v,{mode:"split-left"});break;case"root-right":this.addWidget(v,{mode:"split-right"});break;case"root-bottom":this.addWidget(v,{mode:"split-bottom"});break;case"widget-all":this.addWidget(v,{mode:"tab-after",ref:T});break;case"widget-top":this.addWidget(v,{mode:"split-top",ref:T});break;case"widget-left":this.addWidget(v,{mode:"split-left",ref:T});break;case"widget-right":this.addWidget(v,{mode:"split-right",ref:T});break;case"widget-bottom":this.addWidget(v,{mode:"split-bottom",ref:T});break;case"widget-tab":this.addWidget(v,{mode:"tab-after",ref:T});break;default:throw"unreachable"}r.dropAction=r.proposedAction,r.stopPropagation(),this.activateWidget(v)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&(this._releaseMouse(),xr.postMessage(this,Qs.LayoutModified))},e.prototype._evtMouseDown=function(r){if(r.button===0){var i=this.layout,n=r.target,o=iv(i.handles(),function(T){return T.contains(n)});if(o){r.preventDefault(),r.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("mouseup",this,!0),this._document.addEventListener("mousemove",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var s=o.getBoundingClientRect(),l=r.clientX-s.left,u=r.clientY-s.top,f=window.getComputedStyle(o),v=TA.overrideCursor(f.cursor,this._document);this._pressData={handle:o,deltaX:l,deltaY:u,override:v}}}},e.prototype._evtMouseMove=function(r){if(this._pressData){r.preventDefault(),r.stopPropagation();var i=this.node.getBoundingClientRect(),n=r.clientX-i.left-this._pressData.deltaX,o=r.clientY-i.top-this._pressData.deltaY,s=this.layout;s.moveHandle(this._pressData.handle,n,o)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse(),xr.postMessage(this,Qs.LayoutModified))},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("mouseup",this,!0),this._document.removeEventListener("mousemove",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))},e.prototype._showOverlay=function(r,i){var n=Qs.findDropTarget(this,r,i,this._edges),o=n.zone,s=n.target;if(o==="invalid")return this.overlay.hide(100),o;var l,u,f,v,T=fo.boxSizing(this.node),E=this.node.getBoundingClientRect();switch(o){case"root-all":l=T.paddingTop,u=T.paddingLeft,f=T.paddingRight,v=T.paddingBottom;break;case"root-top":l=T.paddingTop,u=T.paddingLeft,f=T.paddingRight,v=E.height*Qs.GOLDEN_RATIO;break;case"root-left":l=T.paddingTop,u=T.paddingLeft,f=E.width*Qs.GOLDEN_RATIO,v=T.paddingBottom;break;case"root-right":l=T.paddingTop,u=E.width*Qs.GOLDEN_RATIO,f=T.paddingRight,v=T.paddingBottom;break;case"root-bottom":l=E.height*Qs.GOLDEN_RATIO,u=T.paddingLeft,f=T.paddingRight,v=T.paddingBottom;break;case"widget-all":l=s.top,u=s.left,f=s.right,v=s.bottom;break;case"widget-top":l=s.top,u=s.left,f=s.right,v=s.bottom+s.height/2;break;case"widget-left":l=s.top,u=s.left,f=s.right+s.width/2,v=s.bottom;break;case"widget-right":l=s.top,u=s.left+s.width/2,f=s.right,v=s.bottom;break;case"widget-bottom":l=s.top+s.height/2,u=s.left,f=s.right,v=s.bottom;break;case"widget-tab":var M=s.tabBar.node.getBoundingClientRect().height;l=s.top,u=s.left,f=s.right,v=s.bottom+s.height-M;break;default:throw"unreachable"}return this.overlay.show({top:l,left:u,right:f,bottom:v}),o},e.prototype._createTabBar=function(){var r=this._renderer.createTabBar(this._document);return Qs.isGeneratedTabBarProperty.set(r,!0),this._mode==="single-document"&&r.hide(),r.tabsMovable=this._tabsMovable,r.allowDeselect=!1,r.addButtonEnabled=this._addButtonEnabled,r.removeBehavior="select-previous-tab",r.insertBehavior="select-tab-if-needed",r.tabMoved.connect(this._onTabMoved,this),r.currentChanged.connect(this._onCurrentChanged,this),r.tabCloseRequested.connect(this._onTabCloseRequested,this),r.tabDetachRequested.connect(this._onTabDetachRequested,this),r.tabActivateRequested.connect(this._onTabActivateRequested,this),r.addRequested.connect(this._onTabAddRequested,this),r},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){xr.postMessage(this,Qs.LayoutModified)},e.prototype._onCurrentChanged=function(r,i){var n=i.previousTitle,o=i.currentTitle;n&&n.owner.hide(),o&&o.owner.show(),(il.IS_EDGE||il.IS_IE)&&xr.flush(),xr.postMessage(this,Qs.LayoutModified)},e.prototype._onTabAddRequested=function(r){this._addRequested.emit(r)},e.prototype._onTabActivateRequested=function(r,i){i.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,i){i.title.owner.close()},e.prototype._onTabDetachRequested=function(r,i){var n=this;if(!this._drag){r.releaseMouse();var o=i.title,s=i.tab,l=i.clientX,u=i.clientY,f=new Yg.MimeData,v=function(){return o.owner};f.setData("application/vnd.lumino.widget-factory",v);var T=s.cloneNode(!0);this._drag=new TA({document:this._document,mimeData:f,dragImage:T,proposedAction:"move",supportedActions:"move",source:this}),s.classList.add("lm-mod-hidden"),s.classList.add("p-mod-hidden");var E=function(){n._drag=null,s.classList.remove("lm-mod-hidden"),s.classList.remove("p-mod-hidden")};this._drag.start(l,u).then(E)}},e}(Br);(function(t){var e=function(){function i(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return i.prototype.show=function(n){var o=this.node.style;o.top=n.top+"px",o.left=n.left+"px",o.right=n.right+"px",o.bottom=n.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"),this.node.classList.remove("p-mod-hidden"))},i.prototype.hide=function(n){var o=this;if(!this._hidden){if(n<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(function(){o._timer=-1,o._hidden=!0,o.node.classList.add("lm-mod-hidden"),o.node.classList.add("p-mod-hidden")},n))}},i}();t.Overlay=e;var r=function(){function i(){}return i.prototype.createTabBar=function(n){var o=new uv({document:n});return o.addClass("lm-DockPanel-tabBar"),o.addClass("p-DockPanel-tabBar"),o},i.prototype.createHandle=function(){var n=document.createElement("div");return n.className="lm-DockPanel-handle",n.classList.add("p-DockPanel-handle"),n},i}();t.Renderer=r,t.defaultRenderer=new r})(Lee||(Lee={}));var Qs;(function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new nv("layout-modified"),t.isGeneratedTabBarProperty=new ac({name:"isGeneratedTabBar",create:function(){return!1}});function e(n){if(n.isEmpty)return{main:null};var o=Eee(n.widgets()),s=n.selectedWidgets().next(),l=s?o.indexOf(s):-1;return{main:{type:"tab-area",widgets:o,currentIndex:l}}}t.createSingleDocumentConfig=e;function r(n,o,s,l){if(!fo.hitTest(n.node,o,s))return{zone:"invalid",target:null};var u=n.layout;if(u.isEmpty)return{zone:"root-all",target:null};if(n.mode==="multiple-document"){var f=n.node.getBoundingClientRect(),v=o-f.left+1,T=s-f.top+1,E=f.right-o,M=f.bottom-s,O=Math.min(T,E,M,v);switch(O){case T:if(T<l.top)return{zone:"root-top",target:null};break;case E:if(E<l.right)return{zone:"root-right",target:null};break;case M:if(M<l.bottom)return{zone:"root-bottom",target:null};break;case v:if(v<l.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var F=u.hitTestTabAreas(o,s);if(!F)return{zone:"invalid",target:null};if(n.mode==="single-document")return{zone:"widget-all",target:F};var U=F.x-F.left+1,G=F.y-F.top+1,J=F.left+F.width-F.x,K=F.top+F.height-F.y,ne=F.tabBar.node.getBoundingClientRect().height;if(G<ne)return{zone:"widget-tab",target:F};var ge=Math.round(F.width/3),H=Math.round(F.height/3);if(U>ge&&J>ge&&G>H&&K>H)return{zone:"widget-all",target:F};U/=ge,G/=H,J/=ge,K/=H;var me=Math.min(U,G,J,K),he;switch(me){case U:he="widget-left";break;case G:he="widget-top";break;case J:he="widget-right";break;case K:he="widget-bottom";break;default:throw"unreachable"}return{zone:he,target:F}}t.findDropTarget=r;function i(n){return n.titles.length===0?null:n.currentTitle?n.currentTitle.owner:n.titles[n.titles.length-1].owner}t.getDropRef=i})(Qs||(Qs={}));var dTt=function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new Wn(this),this._currentChanged=new Wn(this)}return t.prototype.dispose=function(){var e=this;this._counter<0||(this._counter=-1,Wn.clearData(this),Ei(this._widgets,function(r){r.node.removeEventListener("focus",e,!0),r.node.removeEventListener("blur",e,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(e){var r=this._numbers.get(e);return r===void 0?-1:r},t.prototype.has=function(e){return this._numbers.has(e)},t.prototype.add=function(e){if(!this._numbers.has(e)){var r=e.node.contains(document.activeElement),i=r?this._counter++:-1;this._widgets.push(e),this._numbers.set(e,i),this._nodes.set(e.node,e),e.node.addEventListener("focus",this,!0),e.node.addEventListener("blur",this,!0),e.disposed.connect(this._onWidgetDisposed,this),r&&this._setWidgets(e,e)}},t.prototype.remove=function(e){var r=this;if(this._numbers.has(e)&&(e.disposed.disconnect(this._onWidgetDisposed,this),e.node.removeEventListener("focus",this,!0),e.node.removeEventListener("blur",this,!0),rr.removeFirstOf(this._widgets,e),this._nodes.delete(e.node),this._numbers.delete(e),this._currentWidget===e)){var i=See(this._widgets,function(o){return r._numbers.get(o)!==-1}),n=Cee(i,function(o,s){var l=r._numbers.get(o),u=r._numbers.get(s);return l-u})||null;this._setWidgets(n,null)}},t.prototype.handleEvent=function(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e);break}},t.prototype._setWidgets=function(e,r){var i=this._currentWidget;this._currentWidget=e;var n=this._activeWidget;this._activeWidget=r,i!==e&&this._currentChanged.emit({oldValue:i,newValue:e}),n!==r&&this._activeChanged.emit({oldValue:n,newValue:r})},t.prototype._evtFocus=function(e){var r=this._nodes.get(e.currentTarget);r!==this._currentWidget&&this._numbers.set(r,this._counter++),this._setWidgets(r,r)},t.prototype._evtBlur=function(e){var r=this._nodes.get(e.currentTarget),i=e.relatedTarget;if(!i){this._setWidgets(this._currentWidget,null);return}if(!r.node.contains(i)&&!iv(this._widgets,function(n){return n.node.contains(i)})){this._setWidgets(this._currentWidget,null);return}},t.prototype._onWidgetDisposed=function(e){this.remove(e)},t}(),nk=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,r)||this;return i._dirty=!1,i._rowSpacing=4,i._columnSpacing=4,i._items=[],i._rowStarts=[],i._columnStarts=[],i._rowSizers=[new SA],i._columnSizers=[new SA],i._box=null,r.rowCount!==void 0&&ka.reallocSizers(i._rowSizers,r.rowCount),r.columnCount!==void 0&&ka.reallocSizers(i._columnSizers,r.columnCount),r.rowSpacing!==void 0&&(i._rowSpacing=ka.clampValue(r.rowSpacing)),r.columnSpacing!==void 0&&(i._columnSpacing=ka.clampValue(r.columnSpacing)),i}return e.prototype.dispose=function(){Ei(this._items,function(r){var i=r.widget;r.dispose(),i.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(r){r!==this.rowCount&&(ka.reallocSizers(this._rowSizers,r),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(r){r!==this.columnCount&&(ka.reallocSizers(this._columnSizers,r),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(r){r=ka.clampValue(r),this._rowSpacing!==r&&(this._rowSpacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(r){r=ka.clampValue(r),this._columnSpacing!==r&&(this._columnSpacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(r){var i=this._rowSizers[r];return i?i.stretch:-1},e.prototype.setRowStretch=function(r,i){var n=this._rowSizers[r];n&&(i=ka.clampValue(i),n.stretch!==i&&(n.stretch=i,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(r){var i=this._columnSizers[r];return i?i.stretch:-1},e.prototype.setColumnStretch=function(r,i){var n=this._columnSizers[r];n&&(i=ka.clampValue(i),n.stretch!==i&&(n.stretch=i,this.parent&&this.parent.update()))},e.prototype.iter=function(){return bA(this._items,function(r){return r.widget})},e.prototype.addWidget=function(r){var i=rr.findFirstIndex(this._items,function(n){return n.widget===r});i===-1&&(this._items.push(new Zw(r)),this.parent&&this.attachWidget(r))},e.prototype.removeWidget=function(r){var i=rr.findFirstIndex(this._items,function(o){return o.widget===r});if(i!==-1){var n=rr.removeAt(this._items,i);this.parent&&this.detachWidget(r),n.dispose()}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i){r.attachWidget(i)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=this.rowCount;r<i;++r)this._rowSizers[r].minSize=0;for(var r=0,i=this.columnCount;r<i;++r)this._columnSizers[r].minSize=0;for(var n=this._items.filter(function(G){return!G.isHidden}),r=0,i=n.length;r<i;++r)n[r].fit();var o=this.rowCount-1,s=this.columnCount-1;n.sort(ka.rowSpanCmp);for(var r=0,i=n.length;r<i;++r){var l=n[r],u=e.getCellConfig(l.widget),f=Math.min(u.row,o),v=Math.min(u.row+u.rowSpan-1,o);ka.distributeMin(this._rowSizers,f,v,l.minHeight)}n.sort(ka.columnSpanCmp);for(var r=0,i=n.length;r<i;++r){var l=n[r],u=e.getCellConfig(l.widget),T=Math.min(u.column,s),E=Math.min(u.column+u.columnSpan-1,s);ka.distributeMin(this._columnSizers,T,E,l.minWidth)}if(this.fitPolicy==="set-no-constraint"){xr.sendMessage(this.parent,Br.Msg.UpdateRequest);return}for(var M=o*this._rowSpacing,O=s*this._columnSpacing,r=0,i=this.rowCount;r<i;++r)M+=this._rowSizers[r].minSize;for(var r=0,i=this.columnCount;r<i;++r)O+=this._columnSizers[r].minSize;var F=this._box=fo.boxSizing(this.parent.node);O+=F.horizontalSum,M+=F.verticalSum;var U=this.parent.node.style;U.minWidth=O+"px",U.minHeight=M+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1,r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=fo.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,l=i-this._box.verticalSum,u=this.rowCount-1,f=this.columnCount-1,v=u*this._rowSpacing,T=f*this._columnSpacing;fu.calc(this._rowSizers,Math.max(0,l-v)),fu.calc(this._columnSizers,Math.max(0,s-T));for(var E=0,M=n,O=this.rowCount;E<O;++E)this._rowStarts[E]=M,M+=this._rowSizers[E].size+this._rowSpacing;for(var E=0,M=o,O=this.columnCount;E<O;++E)this._columnStarts[E]=M,M+=this._columnSizers[E].size+this._columnSpacing;for(var E=0,O=this._items.length;E<O;++E){var F=this._items[E];if(!F.isHidden){var U=e.getCellConfig(F.widget),G=Math.min(U.row,u),J=Math.min(U.column,f),K=Math.min(U.row+U.rowSpan-1,u),ne=Math.min(U.column+U.columnSpan-1,f),ge=this._columnStarts[J],H=this._rowStarts[G],me=this._columnStarts[ne]+this._columnSizers[ne].size-ge,he=this._rowStarts[K]+this._rowSizers[K].size-H;F.update(ge,H,me,he)}}},e}(CA);(function(t){function e(i){return ka.cellConfigProperty.get(i)}t.getCellConfig=e;function r(i,n){ka.cellConfigProperty.set(i,ka.normalizeConfig(n))}t.setCellConfig=r})(nk||(nk={}));var ka;(function(t){t.cellConfigProperty=new ac({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:l});function e(u){var f=Math.max(0,Math.floor(u.row||0)),v=Math.max(0,Math.floor(u.column||0)),T=Math.max(1,Math.floor(u.rowSpan||0)),E=Math.max(1,Math.floor(u.columnSpan||0));return{row:f,column:v,rowSpan:T,columnSpan:E}}t.normalizeConfig=e;function r(u){return Math.max(0,Math.floor(u))}t.clampValue=r;function i(u,f){var v=t.cellConfigProperty.get(u.widget),T=t.cellConfigProperty.get(f.widget);return v.rowSpan-T.rowSpan}t.rowSpanCmp=i;function n(u,f){var v=t.cellConfigProperty.get(u.widget),T=t.cellConfigProperty.get(f.widget);return v.columnSpan-T.columnSpan}t.columnSpanCmp=n;function o(u,f){for(f=Math.max(1,Math.floor(f));u.length<f;)u.push(new SA);u.length>f&&(u.length=f)}t.reallocSizers=o;function s(u,f,v,T){if(!(v<f)){if(f===v){var E=u[f];E.minSize=Math.max(E.minSize,T);return}for(var M=0,O=f;O<=v;++O)M+=u[O].minSize;if(!(M>=T))for(var F=(T-M)/(v-f+1),O=f;O<=v;++O)u[O].minSize+=F}}t.distributeMin=s;function l(u){u.parent&&u.parent.layout instanceof nk&&u.parent.fit()}})(ka||(ka={}));var Fee=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:ZI.createNode()})||this;return i._activeIndex=-1,i._tabFocusIndex=0,i._menus=[],i._childMenu=null,i.addClass("lm-MenuBar"),i.addClass("p-MenuBar"),i.setFlag(Br.Flag.DisallowLayout),i.renderer=r.renderer||e.defaultRenderer,i._forceItemsPosition=r.forceItemsPosition||{forceX:!0,forceY:!0},i}return e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(r){this.activeIndex=r?this._menus.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(r){(r<0||r>=this._menus.length)&&(r=-1),this._activeIndex!==r&&(this._activeIndex=r,r!==-1&&(this._tabFocusIndex=r),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(r){this.insertMenu(this._menus.length,r)},e.prototype.insertMenu=function(r,i){this._closeChildMenu();var n=this._menus.indexOf(i),o=Math.max(0,Math.min(r,this._menus.length));if(n===-1){rr.insert(this._menus,o,i),i.addClass("lm-MenuBar-menu"),i.addClass("p-MenuBar-menu"),i.aboutToClose.connect(this._onMenuAboutToClose,this),i.menuRequested.connect(this._onMenuMenuRequested,this),i.title.changed.connect(this._onTitleChanged,this),this.update();return}o===this._menus.length&&o--,n!==o&&(rr.move(this._menus,n,o),this.update())},e.prototype.removeMenu=function(r){this.removeMenuAt(this._menus.indexOf(r))},e.prototype.removeMenuAt=function(r){this._closeChildMenu();var i=rr.removeAt(this._menus,r);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),i.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(this._menus.length!==0){this._closeChildMenu();for(var r=0,i=this._menus;r<i.length;r++){var n=i[r];n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("lm-MenuBar-menu"),n.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},e.prototype.handleEvent=function(r){switch(r.type){case"keydown":this._evtKeyDown(r);break;case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseleave":this._evtMouseLeave(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},e.prototype.onActivateRequest=function(r){this.isAttached&&(this.activeIndex=0)},e.prototype.onUpdateRequest=function(r){for(var i=this,n=this._menus,o=this.renderer,s=this._activeIndex,l=this._tabFocusIndex>=0&&this._tabFocusIndex<n.length?this._tabFocusIndex:0,u=new Array(n.length),f=function(E,M){var O=n[E].title,F=E===s;F&&n[E].items.length==0&&(F=!1),u[E]=o.renderItem({title:O,active:F,tabbable:E===l,onfocus:function(){i.activeIndex=E}})},v=0,T=n.length;v<T;++v)f(v);rp.render(u,this.contentNode)},e.prototype._evtKeyDown=function(r){var i=r.keyCode;if(i===9){this.activeIndex=-1;return}if(r.preventDefault(),r.stopPropagation(),i===13||i===32||i===38||i===40){this.openActiveMenu();return}if(i===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(i===37){var n=this._activeIndex,o=this._menus.length;this.activeIndex=n===0?o-1:n-1;return}if(i===39){var n=this._activeIndex,o=this._menus.length;this.activeIndex=n===o-1?0:n+1;return}var s=ov().keyForKeydownEvent(r);if(s){var l=this._activeIndex+1,u=ZI.findMnemonic(this._menus,s,l);u.index!==-1&&!u.multiple?(this.activeIndex=u.index,this.openActiveMenu()):u.index!==-1?this.activeIndex=u.index:u.auto!==-1&&(this.activeIndex=u.auto)}},e.prototype._evtMouseDown=function(r){if(fo.hitTest(this.node,r.clientX,r.clientY)){r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation();var i=rr.findFirstIndex(this.contentNode.children,function(o){return fo.hitTest(o,r.clientX,r.clientY)});if(i===-1){this._closeChildMenu();return}if(r.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=i;else{var n=this._positionForMenu(i);cv.saveWindowData(),this.activeIndex=i,this._openChildMenu(n)}}},e.prototype._evtMouseMove=function(r){var i=rr.findFirstIndex(this.contentNode.children,function(o){return fo.hitTest(o,r.clientX,r.clientY)});if(i!==this._activeIndex&&!(i===-1&&this._childMenu)){var n=this._positionForMenu(i);cv.saveWindowData(),this.activeIndex=i,this._childMenu&&this._openChildMenu(n)}},e.prototype._positionForMenu=function(r){var i=this.contentNode.children[r],n=i.getBoundingClientRect(),o=n.left,s=n.bottom;return{top:s,left:o}},e.prototype._evtMouseLeave=function(r){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(r){var i;r===void 0&&(r={});var n=this.activeMenu;if(!n){this._closeChildMenu();return}var o=this._childMenu;if(o!==n){this._childMenu=n,o?o.close():document.addEventListener("mousedown",this,!0),xr.sendMessage(this,Br.Msg.UpdateRequest);var s=r.left,l=r.top;(typeof s>"u"||typeof l>"u")&&(i=this._positionForMenu(this._activeIndex),s=i.left,l=i.top),o||(this.addClass("lm-mod-active"),this.addClass("p-mod-active")),n.items.length>0&&n.open(s,l,this._forceItemsPosition)}},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var r=this._childMenu;this._childMenu=null,r.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(r){r===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(r,i){if(r===this._childMenu){var n=this._activeIndex,o=this._menus.length;switch(i){case"next":this.activeIndex=n===o-1?0:n+1;break;case"previous":this.activeIndex=n===0?o-1:n-1;break}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(Br);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i),s=this.createItemARIA(i);return so.li(nl({className:n,dataset:o,tabindex:i.tabbable?"0":"-1",onfocus:i.onfocus},s),this.renderIcon(i),this.renderLabel(i))},r.prototype.renderIcon=function(i){var n=this.createIconClass(i);return typeof i.title.icon=="string"?so.div({className:n},i.title.iconLabel):so.div({className:n},i.title.icon,i.title.iconLabel)},r.prototype.renderLabel=function(i){var n=this.formatLabel(i);return so.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},n)},r.prototype.createItemClass=function(i){var n="lm-MenuBar-item";return n+=" p-MenuBar-item",i.title.className&&(n+=" "+i.title.className),i.active&&(n+=" lm-mod-active",n+=" p-mod-active"),n},r.prototype.createItemDataset=function(i){return i.title.dataset},r.prototype.createItemARIA=function(i){return{role:"menuitem","aria-haspopup":"true"}},r.prototype.createIconClass=function(i){var n="lm-MenuBar-itemIcon";n+=" p-MenuBar-itemIcon";var o=i.title.iconClass;return o?n+" "+o:n},r.prototype.formatLabel=function(i){var n=i.title,o=n.label,s=n.mnemonic;if(s<0||s>=o.length)return o;var l=o.slice(0,s),u=o.slice(s+1),f=o[s],v=so.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},f);return[l,v,u]},r}();t.Renderer=e,t.defaultRenderer=new e})(Fee||(Fee={}));var ZI;(function(t){function e(){var i=document.createElement("div"),n=document.createElement("ul");return n.className="lm-MenuBar-content",n.classList.add("p-MenuBar-content"),i.appendChild(n),n.setAttribute("role","menubar"),i}t.createNode=e;function r(i,n,o){for(var s=-1,l=-1,u=!1,f=n.toUpperCase(),v=0,T=i.length;v<T;++v){var E=(v+o)%T,M=i[E].title;if(M.label.length!==0){var O=M.mnemonic;if(O>=0&&O<M.label.length){M.label[O].toUpperCase()===f&&(s===-1?s=E:u=!0);continue}l===-1&&M.label[0].toUpperCase()===f&&(l=E)}}return{index:s,multiple:u,auto:l}}t.findMnemonic=r})(ZI||(ZI={}));var pTt=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:JI.createNode()})||this;return i._onRepeat=function(){if(i._repeatTimer=-1,!!i._pressData){var n=i._pressData.part;if(n!=="thumb"){i._repeatTimer=window.setTimeout(i._onRepeat,20);var o=i._pressData.mouseX,s=i._pressData.mouseY;if(n==="decrement"){if(!fo.hitTest(i.decrementNode,o,s))return;i._stepRequested.emit("decrement");return}if(n==="increment"){if(!fo.hitTest(i.incrementNode,o,s))return;i._stepRequested.emit("increment");return}if(n==="track"){if(!fo.hitTest(i.trackNode,o,s))return;var l=i.thumbNode;if(fo.hitTest(l,o,s))return;var u=l.getBoundingClientRect(),f=void 0;i._orientation==="horizontal"?f=o<u.left?"decrement":"increment":f=s<u.top?"decrement":"increment",i._pageRequested.emit(f);return}}}},i._value=0,i._page=10,i._maximum=100,i._repeatTimer=-1,i._pressData=null,i._thumbMoved=new Wn(i),i._stepRequested=new Wn(i),i._pageRequested=new Wn(i),i.addClass("lm-ScrollBar"),i.addClass("p-ScrollBar"),i.setFlag(Br.Flag.DisallowLayout),i._orientation=r.orientation||"vertical",i.dataset.orientation=i._orientation,r.maximum!==void 0&&(i._maximum=Math.max(0,r.maximum)),r.page!==void 0&&(i._page=Math.max(0,r.page)),r.value!==void 0&&(i._value=Math.max(0,Math.min(r.value,i._maximum))),i}return Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._releaseMouse(),this._orientation=r,this.dataset.orientation=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(r){r=Math.max(0,Math.min(r,this._maximum)),this._value!==r&&(this._value=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(r){r=Math.max(0,r),this._page!==r&&(this._page=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(r){r=Math.max(0,r),this._maximum!==r&&(this._maximum=r,this._value=Math.min(this._value,r),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(r){var i=this._value*100/this._maximum,n=this._page*100/(this._page+this._maximum);i=Math.max(0,Math.min(i,100)),n=Math.max(0,Math.min(n,100));var o=this.thumbNode.style;this._orientation==="horizontal"?(o.top="",o.height="",o.left=i+"%",o.width=n+"%",o.transform="translate("+-i+"%, 0%)"):(o.left="",o.width="",o.top=i+"%",o.height=n+"%",o.transform="translate(0%, "+-i+"%)")},e.prototype._evtKeyDown=function(r){if(r.preventDefault(),r.stopPropagation(),r.keyCode===27){var i=this._pressData?this._pressData.value:-1;this._releaseMouse(),i!==-1&&this._moveThumb(i)}},e.prototype._evtMouseDown=function(r){if(r.button===0&&(this.activate(),!this._pressData)){var i=JI.findPart(this,r.target);if(i){r.preventDefault(),r.stopPropagation();var n=TA.overrideCursor("default");if(this._pressData={part:i,override:n,delta:-1,value:-1,mouseX:r.clientX,mouseY:r.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),i==="thumb"){var o=this.thumbNode,s=o.getBoundingClientRect();this._orientation==="horizontal"?this._pressData.delta=r.clientX-s.left:this._pressData.delta=r.clientY-s.top,o.classList.add("lm-mod-active"),o.classList.add("p-mod-active"),this._pressData.value=this._value;return}if(i==="track"){var s=this.thumbNode.getBoundingClientRect(),l=void 0;this._orientation==="horizontal"?l=r.clientX<s.left?"decrement":"increment":l=r.clientY<s.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),this._pageRequested.emit(l);return}if(i==="decrement"){this.decrementNode.classList.add("lm-mod-active"),this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("decrement");return}if(i==="increment"){this.incrementNode.classList.add("lm-mod-active"),this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("increment");return}}}},e.prototype._evtMouseMove=function(r){if(this._pressData&&(r.preventDefault(),r.stopPropagation(),this._pressData.mouseX=r.clientX,this._pressData.mouseY=r.clientY,this._pressData.part==="thumb")){var i=this.thumbNode.getBoundingClientRect(),n=this.trackNode.getBoundingClientRect(),o,s;this._orientation==="horizontal"?(o=r.clientX-n.left-this._pressData.delta,s=n.width-i.width):(o=r.clientY-n.top-this._pressData.delta,s=n.height-i.height);var l=s===0?0:o*this._maximum/s;this._moveThumb(l)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("lm-mod-active"),this.decrementNode.classList.remove("lm-mod-active"),this.incrementNode.classList.remove("lm-mod-active"),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},e.prototype._moveThumb=function(r){r=Math.max(0,Math.min(r,this._maximum)),this._value!==r&&(this._value=r,this.update(),this._thumbMoved.emit(r))},e}(Br),JI;(function(t){function e(){var i=document.createElement("div"),n=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div");return n.className="lm-ScrollBar-button",o.className="lm-ScrollBar-button",n.dataset.action="decrement",o.dataset.action="increment",s.className="lm-ScrollBar-track",l.className="lm-ScrollBar-thumb",n.classList.add("p-ScrollBar-button"),o.classList.add("p-ScrollBar-button"),s.classList.add("p-ScrollBar-track"),l.classList.add("p-ScrollBar-thumb"),s.appendChild(l),i.appendChild(n),i.appendChild(s),i.appendChild(o),i}t.createNode=e;function r(i,n){return i.thumbNode.contains(n)?"thumb":i.trackNode.contains(n)?"track":i.decrementNode.contains(n)?"decrement":i.incrementNode.contains(n)?"increment":null}t.findPart=r})(JI||(JI={}));var ATt=function(t){ks(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._widget=null,r}return e.prototype.dispose=function(){if(this._widget){var r=this._widget;this._widget=null,r.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(r){r&&(r.parent=this.parent),this._widget!==r&&(this._widget&&this._widget.dispose(),this._widget=r,this.parent&&r&&this.attachWidget(r))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?qw(this._widget):uu()},e.prototype.removeWidget=function(r){this._widget===r&&(this._widget=null,this.parent&&this.detachWidget(r))},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i){r.attachWidget(i)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterAttach)},e.prototype.detachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterDetach)},e}(CA),HMe=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,r)||this;return i._dirty=!1,i._items=[],i._box=null,i._hiddenMode=r.hiddenMode!==void 0?r.hiddenMode:Br.HiddenMode.Display,i}return Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(r){var i=this;this._hiddenMode!==r&&(this._hiddenMode=r,this.widgets.length>1&&this.widgets.forEach(function(n){n.hiddenMode=i._hiddenMode}))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){Ei(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(r,i){this._hiddenMode===Br.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Br.HiddenMode.Scale),i.hiddenMode=Br.HiddenMode.Scale):i.hiddenMode=Br.HiddenMode.Display,rr.insert(this._items,r,new Zw(i)),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){rr.move(this._items,r,i),this.parent.update()},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._items,r);this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===Br.HiddenMode.Scale&&(i.hiddenMode=Br.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Br.HiddenMode.Display)),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=0,n=0,o=this._items.length;n<o;++n){var s=this._items[n];s.isHidden||(s.fit(),r=Math.max(r,s.minWidth),i=Math.max(i,s.minHeight))}var l=this._box=fo.boxSizing(this.parent.node);r+=l.horizontalSum,i+=l.verticalSum;var u=this.parent.node.style;u.minWidth=r+"px",u.minHeight=i+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(n!==0){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=fo.boxSizing(this.parent.node));for(var l=this._box.paddingTop,u=this._box.paddingLeft,f=r-this._box.horizontalSum,v=i-this._box.verticalSum,o=0,s=this._items.length;o<s;++o){var T=this._items[o];T.isHidden||(T.widget.node.style.zIndex=""+o,T.update(u,l,f,v))}}},e}(QI),GMe=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:ok.createLayout(r)})||this;return i._widgetRemoved=new Wn(i),i.addClass("lm-StackedPanel"),i.addClass("p-StackedPanel"),i}return Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(r){this.layout.hiddenMode=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(r){r.child.addClass("lm-StackedPanel-child"),r.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-StackedPanel-child"),r.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(r.child)},e}(Jw),ok;(function(t){function e(r){return r.layout||new HMe}t.createLayout=e})(ok||(ok={}));var mTt=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;i._currentChanged=new Wn(i),i._addRequested=new Wn(i),i.addClass("lm-TabPanel"),i.addClass("p-TabPanel"),i.tabBar=new uv(r),i.tabBar.addClass("lm-TabPanel-tabBar"),i.stackedPanel=new GMe,i.stackedPanel.addClass("lm-TabPanel-stackedPanel"),i.tabBar.addClass("p-TabPanel-tabBar"),i.stackedPanel.addClass("p-TabPanel-stackedPanel"),i.tabBar.tabMoved.connect(i._onTabMoved,i),i.tabBar.currentChanged.connect(i._onCurrentChanged,i),i.tabBar.tabCloseRequested.connect(i._onTabCloseRequested,i),i.tabBar.tabActivateRequested.connect(i._onTabActivateRequested,i),i.tabBar.addRequested.connect(i._onTabAddRequested,i),i.stackedPanel.widgetRemoved.connect(i._onWidgetRemoved,i),i._tabPlacement=r.tabPlacement||"top";var n=lv.directionFromPlacement(i._tabPlacement),o=lv.orientationFromPlacement(i._tabPlacement);i.tabBar.orientation=o,i.tabBar.dataset.placement=i._tabPlacement;var s=new Gh({direction:n,spacing:0});return Gh.setStretch(i.tabBar,0),Gh.setStretch(i.stackedPanel,1),s.addWidget(i.tabBar),s.addWidget(i.stackedPanel),i.layout=s,i}return Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(r){this.tabBar.currentIndex=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var r=this.tabBar.currentTitle;return r?r.owner:null},set:function(r){this.tabBar.currentTitle=r?r.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(r){this.tabBar.tabsMovable=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(r){this.tabBar.addButtonEnabled=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(r){if(this._tabPlacement!==r){this._tabPlacement=r;var i=lv.directionFromPlacement(r),n=lv.orientationFromPlacement(r);this.tabBar.orientation=n,this.tabBar.dataset.placement=r,this.layout.direction=i}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){this.insertWidget(this.widgets.length,r)},e.prototype.insertWidget=function(r,i){i!==this.currentWidget&&i.hide(),this.stackedPanel.insertWidget(r,i),this.tabBar.insertTab(r,i.title),i.node.setAttribute("role","tabpanel");var n=this.tabBar.renderer;if(n instanceof uv.Renderer){var o=n.createTabKey({title:i.title,current:!1,zIndex:0});i.node.setAttribute("aria-labelledby",o)}},e.prototype._onCurrentChanged=function(r,i){var n=i.previousIndex,o=i.previousTitle,s=i.currentIndex,l=i.currentTitle,u=o?o.owner:null,f=l?l.owner:null;u&&u.hide(),f&&f.show(),this._currentChanged.emit({previousIndex:n,previousWidget:u,currentIndex:s,currentWidget:f}),(il.IS_EDGE||il.IS_IE)&&xr.flush()},e.prototype._onTabAddRequested=function(r,i){this._addRequested.emit(r)},e.prototype._onTabActivateRequested=function(r,i){i.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,i){i.title.owner.close()},e.prototype._onTabMoved=function(r,i){this.stackedPanel.insertWidget(i.toIndex,i.title.owner)},e.prototype._onWidgetRemoved=function(r,i){i.node.removeAttribute("role"),i.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(i.title)},e}(Br),lv;(function(t){function e(o){return i[o]}t.orientationFromPlacement=e;function r(o){return n[o]}t.directionFromPlacement=r;var i={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},n={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(lv||(lv={}));var hv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),MA=function(){return MA=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},MA.apply(this,arguments)},WMe="IPY_MODEL_";function Qw(t,e){if(Array.isArray(t)){var r=[];return t.forEach(function(n,o){r.push(Qw(n,e))}),Promise.all(r)}else if(t instanceof Object){var i={};return Object.keys(t).forEach(function(n){i[n]=Qw(t[n],e)}),Iy(i)}else return typeof t=="string"&&t.slice(0,10)==="IPY_MODEL_"?e.get_model(t.slice(10,t.length)):Promise.resolve(t)}function ak(t,e){if(Array.isArray(t)){for(var r=[],i=0,n=t;i<n.length;i++){var o=n[i];r.push(ak(o,e))}return r}else{if(t instanceof IA)return""+WMe+t.model_id;if(t instanceof Object&&typeof t!="string"){var s={};Object.keys(t).forEach(function(l){s[l]=ak(t[l],e)})}else return t}}var IA=function(t){hv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return{_model_module:"@jupyter-widgets/base",_model_name:"WidgetModel",_model_module_version:NM,_view_module:"@jupyter-widgets/base",_view_name:null,_view_module_version:NM,_view_count:null}},e.prototype.isNew=function(){return!1},e.prototype.initialize=function(r,i){this._expectedEchoMsgIds={},this._attrsToUpdate={},t.prototype.initialize.call(this,r,i),this.widget_manager=i.widget_manager,this.model_id=i.model_id;var n=i.comm;this.views=Object.create(null),this.state_change=Promise.resolve(),this._closed=!1,this._state_lock=null,this._msg_buffer=null,this._msg_buffer_callbacks=null,this._pending_msgs=0,this._buffered_state_diff={},n?(this.comm=n,n.on_close(this._handle_comm_closed.bind(this)),n.on_msg(this._handle_comm_msg.bind(this)),this.comm_live=!0):this.comm_live=!1},Object.defineProperty(e.prototype,"comm_live",{get:function(){return this._comm_live},set:function(r){this._comm_live=r,this.trigger("comm_live_update")},enumerable:!0,configurable:!0}),e.prototype.send=function(r,i,n){if(this.comm!==void 0){var o={method:"custom",content:r};this.comm.send(o,i,{},n)}},e.prototype.close=function(r){var i=this;if(r===void 0&&(r=!1),!this._closed){this._closed=!0,this.comm&&!r&&this.comm.close(),this.stopListening(),this.trigger("destroy",this),this.comm&&delete this.comm;var n=Object.keys(this.views).map(function(o){return i.views[o].then(function(s){return s.remove()})});return delete this.views,Promise.all(n).then(function(){})}},e.prototype._handle_comm_closed=function(r){this.trigger("comm:close"),this.close(!0)},e.prototype._handle_comm_msg=function(r){var i=this,n=r.content.data,o=n.method;switch(o){case"update":case"echo_update":return this.state_change=this.state_change.then(function(){var s,l,u,f=n.state,v=(s=n.buffer_paths,s??[]),T=(u=(l=r.buffers)===null||l===void 0?void 0:l.slice(0,v.length),u??[]).map(function(O){return O instanceof DataView?O:new DataView(O instanceof ArrayBuffer?O:O.buffer)});if(cA(f,v,T),r.parent_header&&o==="echo_update"){var E=r.parent_header.msg_id,M=Object.keys(f).filter(function(O){return i._expectedEchoMsgIds.hasOwnProperty(O)});M.forEach(function(O){var F=i._expectedEchoMsgIds[O]!==E;F?delete f[O]:(delete i._expectedEchoMsgIds[O],i._msg_buffer!==null&&Object.prototype.hasOwnProperty.call(i._msg_buffer,O)&&delete f[O])})}return i.constructor._deserialize_state(f,i.widget_manager)}).then(function(s){i.set_state(s)}).catch(Gf("Could not process update msg for model id: "+this.model_id,!0)),this.state_change;case"custom":return this.trigger("msg:custom",n.content,r.buffers),Promise.resolve()}},e.prototype.set_state=function(r){this._state_lock=r;try{this.set(r)}catch(i){console.error("Error setting state: "+i.message)}finally{this._state_lock=null}},e.prototype.get_state=function(r){var i=this.attributes;if(r){var n=this.defaults,o=typeof n=="function"?n.call(this):n,s={};return Object.keys(i).forEach(function(l){My(i[l],o[l])||(s[l]=i[l])}),s}else return MA({},i)},e.prototype._handle_status=function(r){if(this.comm!==void 0&&r.content.execution_state==="idle"&&(this._pending_msgs--,this._pending_msgs<0&&(console.error("Jupyter Widgets message throttle: Pending messages < 0 (="+this._pending_msgs+"), which is unexpected. Resetting to 0 to continue."),this._pending_msgs=0),this._msg_buffer!==null&&this._pending_msgs<1)){var i=this.send_sync_message(this._msg_buffer,this._msg_buffer_callbacks);this.rememberLastUpdateFor(i),this._msg_buffer=null,this._msg_buffer_callbacks=null}},e.prototype.callbacks=function(r){return this.widget_manager.callbacks(r)},e.prototype.set=function(r,i,n){var o=LQ.call(this,r,i,n);if(this._buffered_state_diff!==void 0){var s=this.changedAttributes()||{};if(this._state_lock)for(var l=0,u=Object.keys(this._state_lock);l<u.length;l++){var f=u[l];s[f]===this._state_lock[f]&&delete s[f]}this._buffered_state_diff=Kd(this._buffered_state_diff,s)}return o},e.prototype.sync=function(r,i,n){var o=this;if(n===void 0&&(n={}),this.comm===void 0)throw"Syncing error: no comm channel defined";var s=r==="patch"?n.attrs:i.get_state(n.drop_defaults);if(this._state_lock)for(var l=0,u=Object.keys(this._state_lock);l<u.length;l++){var f=u[l];s[f]===this._state_lock[f]&&delete s[f]}Object.keys(s).forEach(function(M){o._attrsToUpdate[M]=!0});var v=this.serialize(s);if(Object.keys(v).length>0){var T=n.callbacks||this.callbacks();if(this._pending_msgs>=1){switch(r){case"patch":this._msg_buffer=Kd(this._msg_buffer||{},v);break;case"update":case"create":this._msg_buffer=v;break;default:throw"unrecognized syncing method"}this._msg_buffer_callbacks=T}else{var E=this.send_sync_message(s,T);this.rememberLastUpdateFor(E)}}},e.prototype.rememberLastUpdateFor=function(r){var i=this;Object.keys(this._attrsToUpdate).forEach(function(n){i._expectedEchoMsgIds[n]=r}),this._attrsToUpdate={}},e.prototype.serialize=function(r){for(var i=this.constructor.serializers||{},n=0,o=Object.keys(r);n<o.length;n++){var s=o[n];try{i[s]&&i[s].serialize?r[s]=i[s].serialize(r[s],this):r[s]=JSON.parse(JSON.stringify(r[s])),r[s]&&r[s].toJSON&&(r[s]=r[s].toJSON())}catch(l){throw console.error("Error serializing widget state attribute: ",s),l}}return r},e.prototype.send_sync_message=function(r,i){var n=this;if(i===void 0&&(i={}),!this.comm)return"";try{i={shell:MA({},i.shell),iopub:MA({},i.iopub),input:i.input};var o=i.iopub.status;i.iopub.status=function(u){n._handle_status(u),o&&o(u)};var s=fw(r),l=this.comm.send({method:"update",state:s.state,buffer_paths:s.buffer_paths},i,{},s.buffers);return this._pending_msgs++,l}catch(u){console.error("Could not send widget sync message",u)}return""},e.prototype.save_changes=function(r){if(this.comm_live){var i={patch:!0};r&&(i.callbacks=r),this.save(this._buffered_state_diff,i),this._buffered_state_diff={}}},e.prototype.on_some_change=function(r,i,n){var o=this;this.on("change",function(){r.some(o.hasChanged,o)&&i.apply(n,arguments)},this)},e.prototype.toJSON=function(r){return"IPY_MODEL_"+this.model_id},e._deserialize_state=function(r,i){var n=this.serializers,o;if(n){o={};for(var s in r)n[s]&&n[s].deserialize?o[s]=n[s].deserialize(r[s],i):o[s]=r[s]}else o=r;return Iy(o)},e}(Nee.Model);var lk=function(t){hv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return Kd(t.prototype.defaults.call(this),{_dom_classes:[]})},e.serializers=MA(MA({},IA.serializers),{layout:{deserialize:Qw},style:{deserialize:Qw}}),e}(IA);var fv=function(t){hv(e,t);function e(r){return t.call(this,r)||this}return e.prototype.initialize=function(r){var i=this;this.listenTo(this.model,"change",function(){var n=Object.keys(i.model.changedAttributes()||{});n[0]==="_view_count"&&n.length===1||i.update()}),this.options=r.options,this.once("remove",function(){typeof i.model.get("_view_count")=="number"&&(i.model.set("_view_count",i.model.get("_view_count")-1),i.model.save_changes())}),this.once("displayed",function(){typeof i.model.get("_view_count")=="number"&&(i.model.set("_view_count",i.model.get("_view_count")+1),i.model.save_changes())}),this.displayed=new Promise(function(n,o){i.once("displayed",n)})},e.prototype.update=function(r){},e.prototype.render=function(){},e.prototype.create_child_view=function(r,i){return i===void 0&&(i={}),i=MA({parent:this},i),this.model.widget_manager.create_view(r,i).catch(Gf("Could not create child view",!0))},e.prototype.callbacks=function(){return this.model.callbacks(this)},e.prototype.send=function(r,i){this.model.send(r,this.callbacks(),i)},e.prototype.touch=function(){this.model.save_changes(this.callbacks())},e.prototype.remove=function(){return t.prototype.remove.call(this),this.trigger("remove"),this},e}(bee);var kee=function(t){hv(e,t);function e(r){var i=this,n=r.view;return delete r.view,i=t.call(this,r)||this,i._view=n,i}return e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e.prototype.processMessage=function(r){t.prototype.processMessage.call(this,r),this._view.processPhosphorMessage(r)},e}(Br);var qMe=function(t){hv(e,t);function e(r){var i=this,n=r.view;return delete r.view,i=t.call(this,r)||this,i._view=n,i}return e.prototype.processMessage=function(r){t.prototype.processMessage.call(this,r),this._view.processPhosphorMessage(r)},e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e}(Jw);var ck=function(t){hv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){var i=this;t.prototype.initialize.call(this,r),this.listenTo(this.model,"change:_dom_classes",function(n,o){var s=n.previous("_dom_classes");i.update_classes(s,o)}),this.layoutPromise=Promise.resolve(),this.listenTo(this.model,"change:layout",function(n,o){i.setLayout(o,n.previous("layout"))}),this.stylePromise=Promise.resolve(),this.listenTo(this.model,"change:style",function(n,o){i.setStyle(o,n.previous("style"))}),this.displayed.then(function(){i.update_classes([],i.model.get("_dom_classes")),i.setLayout(i.model.get("layout")),i.setStyle(i.model.get("style"))}),this._comm_live_update(),this.listenTo(this.model,"comm_live_update",function(){i._comm_live_update()})},e.prototype.setLayout=function(r,i){var n=this;r&&(this.layoutPromise=this.layoutPromise.then(function(o){return o&&(o.unlayout(),n.stopListening(o.model),o.remove()),n.create_child_view(r).then(function(s){return n.displayed.then(function(){return s.trigger("displayed"),n.listenTo(s.model,"change",function(){xr.postMessage(n.pWidget,Br.ResizeMessage.UnknownSize)}),xr.postMessage(n.pWidget,Br.ResizeMessage.UnknownSize),s})}).catch(Gf("Could not add LayoutView to DOMWidgetView",!0))}))},e.prototype.setStyle=function(r,i){var n=this;r&&(this.stylePromise=this.stylePromise.then(function(o){return o&&(o.unstyle(),n.stopListening(o.model),o.remove()),n.create_child_view(r).then(function(s){return n.displayed.then(function(){return s.trigger("displayed"),s})}).catch(Gf("Could not add styleView to DOMWidgetView",!0))}))},e.prototype.update_classes=function(r,i,n){n===void 0&&(n=this.el),FM(r,i).map(function(o){n.classList?n.classList.remove(o):n.setAttribute("class",n.getAttribute("class").replace(o,""))}),FM(i,r).map(function(o){n.classList?n.classList.add(o):n.setAttribute("class",n.getAttribute("class").concat(" ",o))})},e.prototype.update_mapped_classes=function(r,i,n){var o=this.model.previous(i),s=r[o]?r[o]:[];o=this.model.get(i);var l=r[o]?r[o]:[];this.update_classes(s,l,n||this.el)},e.prototype.set_mapped_classes=function(r,i,n){var o=this.model.get(i),s=r[o]?r[o]:[];this.update_classes([],s,n||this.el)},e.prototype._setElement=function(r){this.pWidget&&this.pWidget.dispose(),this.$el=r instanceof sk.default?r:(0,sk.default)(r),this.el=this.$el[0],this.pWidget=new kee({node:r,view:this})},e.prototype.remove=function(){return this.pWidget&&this.pWidget.dispose(),t.prototype.remove.call(this)},e.prototype.processPhosphorMessage=function(r){switch(r.type){case"after-attach":this.trigger("displayed");break}},e.prototype._comm_live_update=function(){this.model.comm_live?this.pWidget.removeClass("jupyter-widgets-disconnected"):this.pWidget.addClass("jupyter-widgets-disconnected")},e}(fv);var Uee=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),zee={align_content:null,align_items:null,align_self:null,border:null,bottom:null,display:null,flex:null,flex_flow:null,height:null,justify_content:null,justify_items:null,left:null,margin:null,max_height:null,max_width:null,min_height:null,min_width:null,overflow:null,overflow_x:null,overflow_y:null,order:null,padding:null,right:null,top:null,visibility:null,width:null,object_fit:null,object_position:null,grid_auto_columns:null,grid_auto_flow:null,grid_auto_rows:null,grid_gap:null,grid_template_rows:null,grid_template_columns:null,grid_template_areas:null,grid_row:null,grid_column:null,grid_area:null},XMe=function(t){Uee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return Kd(t.prototype.defaults.call(this),{_model_name:"LayoutModel",_view_name:"LayoutView"},zee)},e}(IA);var YMe=function(t){Uee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){this._traitNames=[],t.prototype.initialize.call(this,r);for(var i=0,n=Object.keys(zee);i<n.length;i++){var o=n[i];this.registerTrait(o)}},e.prototype.registerTrait=function(r){var i=this;if(this._traitNames.push(r),r==="overflow_x"||r==="overflow_y"){this.listenTo(this.model,"change:"+r,function(n,o){i.handleOverflowChange(r,o)}),this.handleOverflowChange(r,this.model.get(r));return}this.listenTo(this.model,"change:"+r,function(n,o){i.handleChange(r,o)}),this.handleChange(r,this.model.get(r))},e.prototype.css_name=function(r){return r.replace(/_/g,"-")},e.prototype.handleChange=function(r,i){var n=this.options.parent;n?i===null?n.el.style.removeProperty(this.css_name(r)):n.el.style[this.css_name(r)]=i:console.warn("Style not applied because a parent view does not exist")},e.prototype.handleOverflowChange=function(r,i){var n=this.options.parent;n?i===null?this.model.get("overflow")===null&&n.el.style.removeProperty(this.css_name(r)):n.el.style[this.css_name(r)]=i:console.warn("Style not applied because a parent view does not exist")},e.prototype.unlayout=function(){var r=this,i=this.options.parent;this._traitNames.forEach(function(n){i?i.el.style.removeProperty(r.css_name(n)):console.warn("Style not removed because a parent view does not exist")},this)},e}(fv);var Vee=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),KMe=function(t){Vee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){var r=this.constructor;return Kd(t.prototype.defaults.call(this),{_model_name:"StyleModel",_view_name:"StyleView"},Object.keys(r.styleProperties).reduce(function(i,n){return i[n]=r.styleProperties[n].default,i},{}))},e.styleProperties={},e}(IA);var ZMe=function(t){Vee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){this._traitNames=[],t.prototype.initialize.call(this,r);for(var i=this.model.constructor,n=0,o=Object.keys(i.styleProperties);n<o.length;n++){var s=o[n];this.registerTrait(s)}this.style()},e.prototype.registerTrait=function(r){var i=this;this._traitNames.push(r),this.listenTo(this.model,"change:"+r,function(n,o){i.handleChange(r,o)})},e.prototype.handleChange=function(r,i){var n=this.options.parent;if(n){var o=this.model.constructor,s=o.styleProperties,l=s[r].attribute,u=s[r].selector,f=u?n.el.querySelectorAll(u):[n.el];if(i===null)for(var v=0;v!==f.length;++v)f[v].style.removeProperty(l);else for(var v=0;v!==f.length;++v)f[v].style[l]=i}else console.warn("Style not applied because a parent view does not exist")},e.prototype.style=function(){for(var r=0,i=this._traitNames;r<i.length;r++){var n=i[r];this.handleChange(n,this.model.get(n))}},e.prototype.unstyle=function(){var r=this.options.parent,i=this.model.constructor,n=i.styleProperties;this._traitNames.forEach(function(o){if(r)for(var s=n[o].attribute,l=n[o].selector,u=l?r.el.querySelectorAll(l):[r.el],f=0;f!==u.length;++f)u[f].style.removeProperty(s);else console.warn("Style not removed because a parent view does not exist")},this)},e}(fv);var JMe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(v){try{f(i.next(v))}catch(T){s(T)}}function u(v){try{f(i.throw(v))}catch(T){s(T)}}function f(v){v.done?o(v.value):n(v.value).then(l,u)}f((i=i.apply(t,e||[])).next())})},QMe=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(f){return function(v){return u([f,v])}}function u(f){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=f[0]&2?n.return:f[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,f[1])).done)return o;switch(n=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,n=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){r.label=f[1];break}if(f[0]===6&&r.label<o[1]){r.label=o[1],o=f;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(f);break}o[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(v){f=[6,v],n=0}finally{i=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},uk;(function(t){var e;(function(r){var i=function(){function o(s){this.targets=Object.create(null),this.comms=Object.create(null),this.kernel=null,this.jsServicesKernel=null,this.init_kernel(s)}return o.prototype.init_kernel=function(s){this.kernel=s,this.jsServicesKernel=s},o.prototype.new_comm=function(s,l,u,f,v,T){return JMe(this,void 0,void 0,function(){var E,M;return QMe(this,function(O){return E=this.jsServicesKernel.createComm(s,v),M=new n(E),this.register_comm(M),M.open(l,u,f,T),[2,M]})})},o.prototype.register_target=function(s,l){var u=this,f=this.jsServicesKernel.registerCommTarget(s,function(v,T){var E=new n(v);u.register_comm(E);try{return l(E,T)}catch(M){E.close(),console.error(M),console.error(new Error("Exception opening new comm"))}});this.targets[s]=f},o.prototype.unregister_target=function(s,l){var u=this.targets[s];u.dispose(),delete this.targets[s]},o.prototype.register_comm=function(s){return this.comms[s.comm_id]=Promise.resolve(s),s.kernel=this.kernel,s.comm_id},o}();r.CommManager=i;var n=function(){function o(s){this.jsServicesComm=null,this.kernel=null,this.jsServicesComm=s}return Object.defineProperty(o.prototype,"comm_id",{get:function(){return this.jsServicesComm.commId},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"target_name",{get:function(){return this.jsServicesComm.targetName},enumerable:!0,configurable:!0}),o.prototype.open=function(s,l,u,f){var v=this.jsServicesComm.open(s,u,f);return this._hookupCallbacks(v,l),v.msg.header.msg_id},o.prototype.send=function(s,l,u,f){var v=this.jsServicesComm.send(s,u,f);return this._hookupCallbacks(v,l),v.msg.header.msg_id},o.prototype.close=function(s,l,u,f){var v=this.jsServicesComm.close(s,u,f);return this._hookupCallbacks(v,l),v.msg.header.msg_id},o.prototype.on_msg=function(s){this.jsServicesComm.onMsg=s.bind(this)},o.prototype.on_close=function(s){this.jsServicesComm.onClose=s.bind(this)},o.prototype._hookupCallbacks=function(s,l){l&&(s.onReply=function(u){l.shell&&l.shell.reply&&l.shell.reply(u)},s.onStdin=function(u){l.input&&l.input(u)},s.onIOPub=function(u){if(l.iopub){if(l.iopub.status&&u.header.msg_type==="status")l.iopub.status(u);else if(l.iopub.clear_output&&u.header.msg_type==="clear_output")l.iopub.clear_output(u);else if(l.iopub.output)switch(u.header.msg_type){case"display_data":case"execute_result":case"stream":case"error":l.iopub.output(u);break;default:break}}})},o}();r.Comm=n})(e=t.services||(t.services={}))})(uk||(uk={}));var $Me=function(){function t(e,r,i){this.initialize(e,r,i)}return t.prototype.initialize=function(e,r,i){this._handler_context=i||this,this._models=[],this.views=[],this._create_view=e,this._remove_view=r||function(n){n.remove()}},t.prototype.update=function(e,r,i,n){var o=i||this._remove_view,s=r||this._create_view;n=n||this._handler_context;for(var l=0;l<e.length&&!(l>=this._models.length||e[l]!==this._models[l]);l++);for(var u=l,f=this.views.splice(u,this.views.length-u),v=0;v<f.length;v++)f[v].then(function(T){o.call(n,T)});for(;l<e.length;l++)this.views.push(Promise.resolve(s.call(n,e[l],l)));return this._models=e.slice(),Promise.all(this.views)},t.prototype.remove=function(){var e=this;return Promise.all(this.views).then(function(r){r.forEach(function(i){return e._remove_view.call(e._handler_context,i)}),e.views=[],e._models=[]})},t.prototype.dispose=function(){this.views=null,this._models=null},t}();var jee=ga(_y()),eIe=new jee.Token("jupyter.extensions.jupyterWidgetRegistry");function tIe(t){switch(t){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"float32":return Float32Array;case"float64":return Float64Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`Unrecognized dtype ${t}`)}}function Hee(t,e){if(!t)return null;for(let r in t){let i=t[r].attributes;for(let n in i){let{dtype:o,value:s}=i[n],l=tIe(o);i[n].value=new l(s.buffer)}}return t}var PA=null,hk=$w&&lk;if(hk){class t extends hk{defaults(){return{...super.defaults(),_model_name:PA.model_name,_model_module:PA.model_module,_model_module_version:PA.model_module_version,_view_name:PA.view_name,_view_module:PA.view_module,_view_module_version:PA.view_module_version,custom_libraries:[],json_input:null,mapbox_key:null,selected_data:[],data_buffer:null,tooltip:null,width:"100%",height:500,js_warning:!1}}static get serializers(){return{...hk.serializers,data_buffer:{deserialize:Hee}}}static get model_name(){return"JupyterTransportModel"}static get model_module(){return zv}static get model_module_version(){return Uv}static get view_name(){return"JupyterTransportView"}static get view_module(){return zv}static get view_module_version(){return Uv}}PA=t}var Gee=PA;var qee=null,Wee=$w&&ck;if(Wee){class t extends Wee{initialize(){this.listenTo(this.model,"destroy",this.remove),this.transport=new Eg,this.transport.jupyterModel=this.model,this.transport.jupyterView=this,this.transport._initialize(),super.initialize.apply(this,arguments)}remove(){this.transport&&(this.transport._finalize(),this.transport.jupyterModel=null,this.transport.jupyterView=null,this.transport=null)}render(){super.render(),this.model.on("change:json_input",this.onJsonChanged.bind(this)),this.model.on("change:data_buffer",this.onDataBufferChanged.bind(this)),this.onDataBufferChanged()}onJsonChanged(){let r=JSON.parse(this.model.get("json_input"));this.transport._messageReceived({type:"json",json:r})}onDataBufferChanged(){let r=this.model.get("json_input"),i=this.model.get("data_buffer");r&&i?this.transport._messageReceived({type:"json-with-binary",json:r,binary:i}):this.transport._messageReceived({type:"json",json:r})}}qee=t}var Xee=qee;var fk={};As(fk,{Buffer:()=>Xi,CubeGeometry:()=>Td,Device:()=>wc,Framebuffer:()=>yf,Geometry:()=>Mn,GroupNode:()=>ru,Model:()=>Ni,ModelNode:()=>Th,ScenegraphNode:()=>tu,SphereGeometry:()=>$x,Texture:()=>bo,TextureTransform:()=>If});var dk={};As(dk,{fetchFile:()=>R0,load:()=>_a,parse:()=>xp,registerLoaders:()=>$A});var Yee=document.body&&document.body.getAttribute("data-base-url");Yee&&(window.__webpack_public_path__=`${Yee}nbextensions/pydeck/nb_extension`);SM();globalThis.deck=globalThis.deck||{};Object.assign(globalThis.deck,rw);globalThis.luma=globalThis.luma||{};Object.assign(globalThis.luma,fk);globalThis.loaders=globalThis.loaders||{};Object.assign(globalThis.loaders,dk);return M6(rIe);})();
3680
3680
  return __exports__;