@deck.gl/jupyter-widget 9.1.1 → 9.1.3

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
@@ -548,7 +548,7 @@ ${o}${s}${t.type.toUpperCase()}: ${t.message}
548
548
  <code style="user-select:text;"><pre>
549
549
  ${i}
550
550
  </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),document.getElementsByClassName("luma-compiler-log-error")[0]?.scrollIntoView(),s.onclick=()=>{let l=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(l)}}},tm=pO;Vr(tm,"defaultProps",{...ei.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});function mde(t){return M9(t.source)||t.id||Jd(`unnamed ${t.stage}-shader`)}function M9(t,e="unnamed"){let n=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return n?n[1]:e}var VE=class extends ei{get[Symbol.toStringTag](){return"Sampler"}constructor(e,r){r=VE.normalizeProps(e,r),super(e,r,VE.defaultProps)}static normalizeProps(e,r){let n=e?.props?._resourceDefaults?.sampler||{};return{...r,...n}}},rm=VE;Vr(rm,"defaultProps",{...ei.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var dO=class extends ei{get[Symbol.toStringTag](){return"Framebuffer"}width;height;constructor(e,r={}){super(e,r,dO.defaultProps),this.width=this.props.width,this.height=this.props.height}clone(e){let r=this.colorAttachments.map(i=>i.texture.clone(e)),n=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(e);return this.device.createFramebuffer({...this.props,colorAttachments:r,depthStencilAttachment:n})}resize(e){let r=!e;if(e){let[n,i]=Array.isArray(e)?e:[e.width,e.height];r=r||i!==this.height||n!==this.width,this.width=n,this.height=i}r&&(qt.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,n)=>{if(typeof r=="string"){let i=this.createColorTexture(r,n);return this.attachResource(i),i.view}return r instanceof fi?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 fi?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e,r){return this.device.createTexture({id:`${this.id}-color-attachment-${r}`,usage:fi.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(e){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:fi.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(e,r){for(let n=0;n<this.colorAttachments.length;++n)if(this.colorAttachments[n]){let i=this.colorAttachments[n].texture.clone({width:e,height:r});this.destroyAttachedResource(this.colorAttachments[n]),this.colorAttachments[n]=i.view,this.attachResource(i.view)}if(this.depthStencilAttachment){let n=this.depthStencilAttachment.texture.clone({width:e,height:r});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=n.view,this.attachResource(n)}this.updateAttachments()}},Lf=dO;Vr(Lf,"defaultProps",{...ei.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var mO=class extends ei{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,r){super(e,r,mO.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(e){throw new Error("Use uniform blocks")}},Eh=mO;Vr(Eh,"defaultProps",{...ei.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});var WA=class extends ei{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,r){r=WA.normalizeProps(e,r),super(e,r,WA.defaultProps)}static normalizeProps(e,r){return{...e.props._resourceDefaults?.renderPass,...r}}},kp=WA;Vr(kp,"defaultClearColor",[0,0,0,1]),Vr(kp,"defaultClearDepth",1),Vr(kp,"defaultClearStencil",0),Vr(kp,"defaultProps",{...ei.defaultProps,framebuffer:null,parameters:void 0,clearColor:WA.defaultClearColor,clearColors:void 0,clearDepth:WA.defaultClearDepth,clearStencil:WA.defaultClearStencil,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var AO=class extends ei{get[Symbol.toStringTag](){return"ComputePipeline"}hash="";shaderLayout;constructor(e,r){super(e,r,AO.defaultProps),this.shaderLayout=r.shaderLayout}},qA=AO;Vr(qA,"defaultProps",{...ei.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});var gO=class extends ei{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,r){super(e,r,gO.defaultProps)}},w_=gO;Vr(w_,"defaultProps",{...ei.defaultProps,measureExecutionTime:void 0});var _O=class extends ei{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,r){super(e,r,_O.defaultProps)}},T_=_O;Vr(T_,"defaultProps",{...ei.defaultProps});function S9(t){let[e,r]=gde[t],n=e==="i32"||e==="u32",i=e!=="u32",o=_de[e]*r,s=Ade(e,r);return{dataType:e,components:r,defaultVertexFormat:s,byteLength:o,integer:n,signed:i}}function Ade(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 gde={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]},_de={f32:4,f16:2,i32:4,u32:4};function yO(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);let[r,n]=t.split("x"),i=r,o=n?parseInt(n):1,s=NE(i),c={type:i,components:o,byteLength:s.byteLength*o,integer:s.integer,signed:s.signed,normalized:s.normalized};return e&&(c.webglOnly=!0),c}function jE(t,e){let r={};for(let n of t.attributes){let i=yde(t,e,n.name);i&&(r[n.name]=i)}return r}function C9(t,e,r=16){let n=jE(t,e),i=new Array(r).fill(null);for(let o of Object.values(n))i[o.location]=o;return i}function yde(t,e,r){let n=xde(t,r),i=vde(e,r);if(!n)return null;let o=S9(n.type),s=i?.vertexFormat||o.defaultVertexFormat,c=yO(s);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:s,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode||"vertex",byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function xde(t,e){let r=t.attributes.find(n=>n.name===e);return r||qt.warn(`shader layout attribute "${e}" not present in shader`),r||null}function vde(t,e){bde(t);let r=wde(t,e);return r||(r=Tde(t,e),r)?r:(qt.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function bde(t){for(let e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&qt.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function wde(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 Tde(t,e){for(let r of t){let n=r.byteStride;if(typeof r.byteStride!="number")for(let o of r.attributes||[]){let s=yO(o.format);n+=s.byteLength}let i=r.attributes?.find(o=>o.attribute===e);if(i)return{attributeName:i.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:i.format,byteOffset:i.byteOffset,byteStride:n}}return null}var xO=class extends ei{get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,r){super(e,r,xO.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);let{shaderLayout:n,bufferLayout:i}=r.renderPipeline||{};if(!n||!i)throw new Error("VertexArray");this.attributeInfos=C9(n,i,this.maxVertexAttributes)}setConstantWebGL(e,r){throw new Error("constant attributes not supported")}},E_=xO;Vr(E_,"defaultProps",{...ei.defaultProps,renderPipeline:null});var vO=class extends ei{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,r){super(e,r,vO.defaultProps)}},M_=vO;Vr(M_,"defaultProps",{...ei.defaultProps,layout:void 0,buffers:{}});var bO=class extends ei{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,r){super(e,r,bO.defaultProps)}},S_=bO;Vr(S_,"defaultProps",{...ei.defaultProps,type:void 0,count:void 0});var Ede={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 P9(t){return Ede[t]}function I9(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var HE;function wO(t){return(!HE||HE.byteLength<t)&&(HE=new ArrayBuffer(t)),HE}function TO(t,e){let r=wO(t.BYTES_PER_ELEMENT*e);return new t(r,0,e)}function Mde(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function C_(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":Mde(t)}var R9=1024,WE=class{layout={};byteLength;constructor(e){let r=0;for(let[i,o]of Object.entries(e)){let s=P9(o),{type:c,components:l}=s;r=I9(r,l);let h=r;r+=l,this.layout[i]={type:c,size:l,offset:h}}r+=(4-r%4)%4;let n=r*4;this.byteLength=Math.max(n,R9)}getData(e){let r=Math.max(this.byteLength,R9),n=wO(r),i={i32:new Int32Array(n),u32:new Uint32Array(n),f32:new Float32Array(n),f16:new Uint16Array(n)};for(let[o,s]of Object.entries(e)){let c=this.layout[o];if(!c){qt.warn(`Supplied uniform value ${o} not present in uniform block layout`)();continue}let{type:l,size:h,offset:p}=c,x=i[l];if(h===1){if(typeof s!="number"&&typeof s!="boolean"){qt.warn(`Supplied value for single component uniform ${o} is not a number: ${s}`)();continue}x[p]=Number(s)}else{if(!C_(s)){qt.warn(`Supplied value for multi component / array uniform ${o} is not a numeric array: ${s}`)();continue}x.set(s,p)}}return new Uint8Array(n)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function L9(t,e,r=16){if(t!==e)return!1;let n=t,i=e;if(!C_(n))return!1;if(C_(i)&&n.length===i.length){for(let o=0;o<n.length;++o)if(i[o]!==n[o])return!1}return!0}function O9(t){return C_(t)?t.slice():t}var qE=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(e){if(this.name=e?.name||"unnamed",e?.name&&e?.shaderLayout){let r=e?.shaderLayout.bindings?.find(i=>i.type==="uniform"&&i.name===e?.name);if(!r)throw new Error(e?.name);let n=r;for(let i of n.uniforms||[])this.bindingLayout[i.name]=i}}setUniforms(e){for(let[r,n]of Object.entries(e))this._setUniform(r,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${r}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,r){L9(this.uniforms[e],r)||(this.uniforms[e]=O9(r),this.modifiedUniforms[e]=!0,this.modified=!0)}};var Ev=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(e){for(let[r,n]of Object.entries(e)){let i=r,o=new WE(n.uniformTypes||{});this.uniformBufferLayouts.set(i,o);let s=new qE({name:r});s.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(i,s)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[r,n]of Object.entries(e))this.uniformBlocks.get(r)?.setUniforms(n);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e)?.byteLength||0}getUniformBufferData(e){let r=this.uniformBlocks.get(e)?.getAllUniforms()||{};return this.uniformBufferLayouts.get(e)?.getData(r)}createUniformBuffer(e,r,n){n&&this.setUniforms(n);let i=this.getUniformBufferByteLength(r),o=e.createBuffer({usage:Vn.UNIFORM|Vn.COPY_DST,byteLength:i}),s=this.getUniformBufferData(r);return o.write(s),o}getManagedUniformBuffer(e,r){if(!this.uniformBuffers.get(r)){let n=this.getUniformBufferByteLength(r),i=e.createBuffer({usage:Vn.UNIFORM|Vn.COPY_DST,byteLength:n});this.uniformBuffers.set(r,i)}return this.uniformBuffers.get(r)}updateUniformBuffers(){let e=!1;for(let r of this.uniformBlocks.keys()){let n=this.updateUniformBuffer(r);e||=n}return e&&qt.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let r=this.uniformBlocks.get(e),n=this.uniformBuffers.get(e),i=!1;if(n&&r?.needsRedraw){i||=r.needsRedraw;let o=this.getUniformBufferData(e);n=this.uniformBuffers.get(e),n?.write(o);let s=this.uniformBlocks.get(e)?.getAllUniforms();qt.log(4,`Writing to uniform buffer ${String(e)}`,o,s)()}return i}};function GE(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 Mv(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 EO(t,e,r){if(!e||e>4)throw new Error(`size ${e}`);let n=e,i=GE(t);if(i==="uint8"&&r&&n===1)return"unorm8-webgl";if(i==="uint8"&&r&&n===3)return"unorm8x3-webgl";if(i==="uint8"||i==="sint8"){if(n===1||n===3)throw new Error(`size: ${e}`);return r&&(i=i.replace("int","norm")),`${i}x${n}`}if(i==="uint16"||i==="sint16"){if(n===1||n===3)throw new Error(`size: ${e}`);return r&&(i=i.replace("int","norm")),`${i}x${n}`}return n===1?i:`${i}x${n}`}var GA=class{bufferLayouts;constructor(e){this.bufferLayouts=e}getBufferLayout(e){return this.bufferLayouts.find(r=>r.name===e)||null}getAttributeNamesForBuffer(e){return e.attributes?e.attributes?.map(r=>r.attribute):[e.name]}mergeBufferLayouts(e,r){let n=[...e];for(let i of r){let o=n.findIndex(s=>s.name===i.name);o<0?n.push(i):n[o]=i}return n}};var Of;(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"})(Of||(Of={}));var Cv={[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},va=(t,e,r)=>e?t.enable(r):t.disable(r),B9=(t,e,r)=>t.hint(r,e),su=(t,e,r)=>t.pixelStorei(r,e),D9=(t,e,r)=>{let n=r===36006?36009:36008;return t.bindFramebuffer(n,e)},Sv=(t,e,r)=>{let i={[34964]:34962,[36662]:36662,[36663]:36663,[35053]:35051,[35055]:35052}[r];t.bindBuffer(i,e)};function MO(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}var N9={[3042]:va,[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]:va,[2885]:(t,e)=>t.cullFace(e),[2929]:va,[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]:va,[35723]:B9,[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]:D9,[36010]:D9,[34964]:Sv,[36662]:Sv,[36663]:Sv,[35053]:Sv,[35055]:Sv,[2886]:(t,e)=>t.frontFace(e),[33170]:B9,[2849]:(t,e)=>t.lineWidth(e),[32823]:va,[32824]:"polygonOffset",[10752]:"polygonOffset",[35977]:va,[32926]:va,[32928]:va,[32938]:"sampleCoverage",[32939]:"sampleCoverage",[3089]:va,[3088]:(t,e)=>t.scissor(...e),[2960]:va,[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]:va,[10754]:va,[12288]:va,[12289]:va,[12290]:va,[12291]:va,[12292]:va,[12293]:va,[12294]:va,[12295]:va,[3333]:su,[3317]:su,[37440]:su,[37441]:su,[37443]:su,[3330]:su,[3332]:su,[3331]:su,[3314]:su,[32878]:su,[3316]:su,[3315]:su,[32877]:su,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[0],e[1]||!1),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=MO(e)?e:[e,e];let[r,n]=e;t.stencilMaskSeparate(1028,r),t.stencilMaskSeparate(1029,n)},stencilFunc:(t,e)=>{e=MO(e)&&e.length===3?[...e,...e]:e;let[r,n,i,o,s,c]=e;t.stencilFuncSeparate(1028,r,n,i),t.stencilFuncSeparate(1029,o,s,c)},stencilOp:(t,e)=>{e=MO(e)&&e.length===3?[...e,...e]:e;let[r,n,i,o,s,c]=e;t.stencilOpSeparate(1028,r,n,i),t.stencilOpSeparate(1029,o,s,c)},viewport:(t,e)=>t.viewport(...e)};function Ws(t,e,r){return e[t]!==void 0?e[t]:r[t]}var k9={blendEquation:(t,e,r)=>t.blendEquationSeparate(Ws(32777,e,r),Ws(34877,e,r)),blendFunc:(t,e,r)=>t.blendFuncSeparate(Ws(32969,e,r),Ws(32968,e,r),Ws(32971,e,r),Ws(32970,e,r)),polygonOffset:(t,e,r)=>t.polygonOffset(Ws(32824,e,r),Ws(10752,e,r)),sampleCoverage:(t,e,r)=>t.sampleCoverage(Ws(32938,e,r),Ws(32939,e,r)),stencilFuncFront:(t,e,r)=>t.stencilFuncSeparate(1028,Ws(2962,e,r),Ws(2967,e,r),Ws(2963,e,r)),stencilFuncBack:(t,e,r)=>t.stencilFuncSeparate(1029,Ws(34816,e,r),Ws(36003,e,r),Ws(36004,e,r)),stencilOpFront:(t,e,r)=>t.stencilOpSeparate(1028,Ws(2964,e,r),Ws(2965,e,r),Ws(2966,e,r)),stencilOpBack:(t,e,r)=>t.stencilOpSeparate(1029,Ws(34817,e,r),Ws(34818,e,r),Ws(34819,e,r))},SO={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 n={[34962]:[34964],[36662]:[36662],[36663]:[36663],[35051]:[35053],[35052]:[35055]}[e];return n?t({[n]:r}):{valueChanged:!0}},blendColor:(t,e,r,n,i)=>t({[32773]:new Float32Array([e,r,n,i])}),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,n,i)=>t({[32969]:e,[32968]:r,[32971]:n,[32970]:i}),clearColor:(t,e,r,n,i)=>t({[3106]:new Float32Array([e,r,n,i])}),clearDepth:(t,e)=>t({[2931]:e}),clearStencil:(t,e)=>t({[2961]:e}),colorMask:(t,e,r,n,i)=>t({[3107]:[e,r,n,i]}),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,n,i)=>t({[3088]:new Int32Array([e,r,n,i])}),stencilMask:(t,e)=>t({[2968]:e,[36005]:e}),stencilMaskSeparate:(t,e,r)=>t({[e===1028?2968:36005]:r}),stencilFunc:(t,e,r,n)=>t({[2962]:e,[2967]:r,[2963]:n,[34816]:e,[36003]:r,[36004]:n}),stencilFuncSeparate:(t,e,r,n,i)=>t({[e===1028?2962:34816]:r,[e===1028?2967:36003]:n,[e===1028?2963:36004]:i}),stencilOp:(t,e,r,n)=>t({[2964]:e,[2965]:r,[2966]:n,[34817]:e,[34818]:r,[34819]:n}),stencilOpSeparate:(t,e,r,n,i)=>t({[e===1028?2964:34817]:r,[e===1028?2965:34818]:n,[e===1028?2966:34819]:i}),viewport:(t,e,r,n,i)=>t({[2978]:[e,r,n,i]})},Bf=(t,e)=>t.isEnabled(e),CO={[3042]:Bf,[2884]:Bf,[2929]:Bf,[3024]:Bf,[32823]:Bf,[32926]:Bf,[32928]:Bf,[3089]:Bf,[2960]:Bf,[35977]:Bf},F9=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 Mh(t,e){if(Sde(e))return;let r={};for(let i in e){let o=Number(i),s=N9[i];s&&(typeof s=="string"?r[s]=!0:s(t,e[i],o))}let n=t.state&&t.state.cache;if(n)for(let i in r){let o=k9[i];o(t,e,n)}}function XE(t,e=Cv){if(typeof e=="number"){let i=e,o=CO[i];return o?o(t,i):t.getParameter(i)}let r=Array.isArray(e)?e:Object.keys(e),n={};for(let i of r){let o=CO[i];n[i]=o?o(t,Number(i)):t.getParameter(Number(i))}return n}function z9(t){Mh(t,Cv)}function Sde(t){for(let e in t)return!1;return!0}function U9(t,e){if(t===e)return!0;let r=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&n&&t.length===e.length){for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}var Sh=class{static get(e){return e.state}gl;program=null;stateStack=[];enable=!0;cache=null;log;initialized=!1;constructor(e,r){this.gl=e,this.log=r?.log||(()=>{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){let e=this.stateStack[this.stateStack.length-1];Mh(this.gl,e),this.stateStack.pop()}trackState(e,r){if(this.cache=r.copyState?XE(e):Object.assign({},Cv),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0,this.gl.state=this,Pde(e);for(let n in SO){let i=SO[n];Cde(e,n,i)}V9(e,"getParameter"),V9(e,"isEnabled")}_updateCache(e){let r=!1,n,i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(let o in e){let s=e[o],c=this.cache[o];U9(s,c)||(r=!0,n=c,i&&!(o in i)&&(i[o]=c),this.cache[o]=s)}return{valueChanged:r,oldValue:n}}};function V9(t,e){let r=t[e].bind(t);t[e]=function(i){if(i===void 0||F9.has(i))return r(i);let o=Sh.get(t);return i in o.cache||(o.cache[i]=r(i)),o.enable?o.cache[i]:r(i)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function Cde(t,e,r){if(!t[e])return;let n=t[e].bind(t);t[e]=function(...o){let s=Sh.get(t),{valueChanged:c,oldValue:l}=r(s._updateCache,...o);return c&&n(...o),l},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function Pde(t){let e=t.useProgram.bind(t);t.useProgram=function(n){let i=Sh.get(t);i.program!==n&&(e(n),i.program=n)}}function j9(t,e,r){let n="",i={preserveDrawingBuffer:!0,...r},o=null;if(o||=t.getContext("webgl2",i),i.failIfMajorPerformanceCaveat&&(n||="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow."),!o&&!r.failIfMajorPerformanceCaveat&&(i.failIfMajorPerformanceCaveat=!1,o=t.getContext("webgl2",i),o.luma||={},o.luma.softwareRenderer=!0),o||(o=t.getContext("webgl",{}),o&&(o=null,n||="Your browser only supports WebGL1")),!o)throw n||="Your browser does not support WebGL",new Error(`Failed to create WebGL context: ${n}`);let{onContextLost:s,onContextRestored:c}=e;return t.addEventListener("webglcontextlost",l=>s(l),!1),t.addEventListener("webglcontextrestored",l=>c(l),!1),o.luma||={},o}function Df(t,e,r){return r[e]===void 0&&(r[e]=t.getExtension(e)||null),r[e]}function H9(t,e){let r=t.getParameter(7936),n=t.getParameter(7937);Df(t,"WEBGL_debug_renderer_info",e);let i=e.WEBGL_debug_renderer_info,o=t.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),s=t.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),c=o||r,l=s||n,h=t.getParameter(7938),p=W9(c,l),x=Ide(c,l),w=Rde(c,l);return{type:"webgl",gpu:p,gpuType:w,gpuBackend:x,vendor:c,renderer:l,version:h,shadingLanguage:"glsl",shadingLanguageVersion:300}}function W9(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 Ide(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function Rde(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(W9(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function YE(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 Pv="WEBGL_compressed_texture_s3tc",Iv="WEBGL_compressed_texture_s3tc_srgb",P_="EXT_texture_compression_rgtc",I_="EXT_texture_compression_bptc",Lde="WEBGL_compressed_texture_etc",Ode="WEBGL_compressed_texture_astc",Bde="WEBGL_compressed_texture_etc1",Dde="WEBGL_compressed_texture_pvrtc",Nde="WEBGL_compressed_texture_atc",q9="EXT_texture_norm16",G9="EXT_render_snorm",kde="EXT_color_buffer_float",KE={"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":[G9],"norm16-renderable-webgl":[q9],"snorm16-renderable-webgl":[q9,G9],"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":[Pv,Iv,P_,I_],"texture-compression-bc5-webgl":[P_],"texture-compression-bc7-webgl":[I_],"texture-compression-etc2":[Lde],"texture-compression-astc":[Ode],"texture-compression-etc1-webgl":[Bde],"texture-compression-pvrtc-webgl":[Dde],"texture-compression-atc-webgl":[Nde]};function X9(t){return t in KE}function Y9(t,e,r){return(KE[e]||[]).every(i=>Df(t,i,r))}var PO={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},"r16unorm-webgl":{gl:33322,rb:!0},"r16snorm-webgl":{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},"rg16unorm-webgl":{gl:33324},"rg16snorm-webgl":{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},"rgb10a2uint-webgl":{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},"rgba16unorm-webgl":{gl:32859,rb:!0},"rgba16snorm-webgl":{gl:36763},"rgb32float-webgl":{gl:34837,x:kde,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:Pv},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:Iv},"bc1-rgba-unorm":{gl:33777,x:Pv},"bc1-rgba-unorm-srgb":{gl:35916,x:Iv},"bc2-rgba-unorm":{gl:33778,x:Pv},"bc2-rgba-unorm-srgb":{gl:35918,x:Iv},"bc3-rgba-unorm":{gl:33779,x:Pv},"bc3-rgba-unorm-srgb":{gl:35919,x:Iv},"bc4-r-unorm":{gl:36283,x:P_},"bc4-r-snorm":{gl:36284,x:P_},"bc5-rg-unorm":{gl:36285,x:P_},"bc5-rg-snorm":{gl:36286,x:P_},"bc6h-rgb-ufloat":{gl:36495,x:I_},"bc6h-rgb-float":{gl:36494,x:I_},"bc7-rgba-unorm":{gl:36492,x:I_},"bc7-rgba-unorm-srgb":{gl:36493,x:I_},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function K9(t,e,r){let n=e.create,i=PO[e.format];return i?.gl===void 0&&(n=!1),i?.x&&(n=n&&Boolean(Df(t,i.x,r))),{format:e.format,create:n&&e.create,render:n&&e.render,filter:n&&e.filter,blend:n&&e.blend,store:n&&e.store}}function ZE(t){let e=PO[t],r=zde(t),n=x_(t);return{internalFormat:r,format:e?.dataFormat||Fde(n.channels,n.integer,n.normalized,r),type:n.dataType?YE(n.dataType):e?.types?.[0]||5121,compressed:n.compressed||!1}}function Z9(t){switch(x_(t).attachment){case"depth":return 36096;case"stencil":return 36128;case"depth-stencil":return 33306;default:throw new Error(`Not a depth stencil format: ${t}`)}}function Fde(t,e,r,n){if(n===6408||n===6407)return n;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;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}function zde(t){let r=PO[t]?.gl;if(r===void 0)throw new Error(`Unsupported texture format ${t}`);return r}var $9={"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"},$E=class extends bv{gl;extensions;testedFeatures=new Set;constructor(e,r,n){super([],n),this.gl=e,this.extensions=r,Df(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),X9(e)&&Y9(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($9),...Object.keys(KE)]}getWebGLFeature(e){let r=$9[e];return Boolean(typeof r=="string"?Df(this.gl,r,this.extensions):r)}};var QE=class extends vv{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]||0}};var Nf=class extends Lf{device;gl;handle;colorAttachments=[];depthStencilAttachment=null;constructor(e,r){super(e,r);let n=r.handle===null;this.device=e,this.gl=e.gl,this.handle=this.props.handle||n?this.props.handle:this.gl.createFramebuffer(),n||(e.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){let e=this.gl.bindFramebuffer(36160,this.handle);for(let r=0;r<this.colorAttachments.length;++r){let n=this.colorAttachments[r];if(n){let i=36064+r;this._attachTextureView(i,n)}}if(this.depthStencilAttachment){let r=Z9(this.depthStencilAttachment.props.format);this._attachTextureView(r,this.depthStencilAttachment)}if(this.device.props.debug){let r=this.gl.checkFramebufferStatus(36160);if(r!==36053)throw new Error(`Framebuffer ${Vde(r)}`)}this.gl.bindFramebuffer(36160,e)}_attachTextureView(e,r){let{gl:n}=this.device,{texture:i}=r,o=r.props.baseMipLevel,s=r.props.baseArrayLayer;switch(n.bindTexture(i.glTarget,i.handle),i.glTarget){case 35866:case 32879:n.framebufferTextureLayer(36160,e,i.handle,o,s);break;case 34067:let c=Ude(s);n.framebufferTexture2D(36160,e,c,i.handle,o);break;case 3553:n.framebufferTexture2D(36160,e,3553,i.handle,o);break;default:throw new Error("Illegal texture type")}n.bindTexture(i.glTarget,null)}};function Ude(t){return t<34069?t+34069:t}function Vde(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 JE=class extends b_{device;format="rgba8unorm";depthStencilFormat="depth24plus";presentationSize;_framebuffer=null;get[Symbol.toStringTag](){return"WebGLCanvasContext"}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 Nf(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(){}};async function eM(t,e){let r=document.getElementsByTagName("head")[0];if(!r)throw new Error("loadScript");let n=document.createElement("script");return n.setAttribute("type","text/javascript"),n.setAttribute("src",t),e&&(n.id=e),new Promise((i,o)=>{n.onload=i,n.onerror=s=>o(new Error(`Unable to load script '${t}': ${s}`)),r.appendChild(n)})}var jde=1,au=null,Q9=!1,tM={debugSpectorJS:qt.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function J9(t){if(!globalThis.SPECTOR)try{await eM(t.debugSpectorJSUrl||tM.debugSpectorJSUrl)}catch(e){qt.warn(String(e))}}function e7(t){if(t={...tM,...t},!t.debugSpectorJS)return null;if(!au&&globalThis.SPECTOR&&!globalThis.luma?.spector){qt.probe(jde,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();let{Spector:e}=globalThis.SPECTOR;au=new e,globalThis.luma&&(globalThis.luma.spector=au)}if(!au)return null;if(Q9||(Q9=!0,au.spyCanvases(),au?.onCaptureStarted.add(e=>qt.info("Spector capture started:",e)()),au?.onCapture.add(e=>{qt.info("Spector capture complete:",e)(),au?.getResultUI(),au?.resultView.display(),au?.resultView.addCapture(e)})),t.gl){let e=t.gl,r=e.device;au?.startCapture(t.gl,500),e.device=r,new Promise(n=>setTimeout(n,2e3)).then(n=>{qt.info("Spector capture stopped after 2 seconds")(),au?.stopCapture()})}return au}var Hde="https://unpkg.com/webgl-debug@2.0.1/index.js";function r7(t){return t.luma=t.luma||{},t.luma}async function n7(){ul()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await eM(Hde))}function i7(t,e={}){return e.debugWebGL||e.traceWebGL?qde(t,e):Wde(t)}function Wde(t){let e=r7(t);return e.realContext?e.realContext:t}function qde(t,e){if(!globalThis.WebGLDebugUtils)return qt.warn("webgl-debug not loaded")(),t;let r=r7(t);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init({...Of,...t});let n=globalThis.WebGLDebugUtils.makeDebugContext(t,Gde.bind(null,e),Xde.bind(null,e));for(let s in Of)!(s in n)&&typeof Of[s]=="number"&&(n[s]=Of[s]);class i{}Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.setPrototypeOf(i,n);let o=Object.create(i);return r.realContext=t,r.debugContext=o,o.debug=!0,o}function t7(t,e){e=Array.from(e).map(n=>n===void 0?"undefined":n);let r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return r=`${r.slice(0,100)}${r.length>100?"...":""}`,`gl.${t}(${r})`}function Gde(t,e,r,n){n=Array.from(n).map(c=>c===void 0?"undefined":c);let i=globalThis.WebGLDebugUtils.glEnumToString(e),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,n),s=`${i} in gl.${r}(${o})`;qt.error(s)();debugger}function Xde(t,e,r){let n="";qt.level>=1&&(n=t7(e,r),t.traceWebGL&&qt.log(1,n)());for(let i of r)if(i===void 0){n=n||t7(e,r);debugger}}var IO={};function o7(t="id"){IO[t]=IO[t]||1;let e=IO[t]++;return`${t}-${e}`}var Ch=class extends Vn{device;gl;handle;glTarget;glUsage;glIndexType=5123;byteLength;bytesUsed;constructor(e,r={}){super(e,r),this.device=e,this.gl=this.device.gl;let n=typeof r=="object"?r.handle:void 0;this.handle=n||this.gl.createBuffer(),e.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=Yde(this.props.usage),this.glUsage=Kde(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,n=e.byteLength+r){let i=this.glTarget;this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,n,this.glUsage),this.gl.bufferSubData(i,r,e),this.gl.bindBuffer(i,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(e,r,n),this.trackAllocatedMemory(n)}_initWithByteLength(e){let r=e;e===0&&(r=new Float32Array(0));let n=this.glTarget;return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,r,this.glUsage),this.gl.bindBuffer(n,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 n=new Uint8Array(r),i=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,n,i,r),this.gl.bindBuffer(36662,null),this._setDebugData(n,e,r),n}};function Yde(t){return t&Vn.INDEX?34963:t&Vn.VERTEX?34962:t&Vn.UNIFORM?35345:34962}function Kde(t){return t&Vn.INDEX||t&Vn.VERTEX?35044:t&Vn.UNIFORM?35048:35044}function a7(t){let e=t.split(/\r?\n/),r=[];for(let n of e){if(n.length<=1)continue;let i=n.split(":");if(i.length===2){let[x,w]=i;r.push({message:w.trim(),type:s7(x),lineNum:0,linePos:0});continue}let[o,s,c,...l]=i,h=parseInt(c,10);isNaN(h)&&(h=0);let p=parseInt(s,10);isNaN(p)&&(p=0),r.push({message:l.join(":").trim(),type:s7(o),lineNum:h,linePos:p})}return r}function s7(t){let e=["warning","error","info"],r=t.toLowerCase();return e.includes(r)?r:"info"}var rM=class extends tm{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)}get asyncCompilationStatus(){return this._waitForCompilationComplete().then(()=>this.compilationStatus)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){let e=this.device.gl.getShaderInfoLog(this.handle);return e?a7(e):[]}getTranslatedSource(){return this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders?.getTranslatedShaderSource(this.handle)||null}async _compile(e){e=e.startsWith("#version ")?e:`#version 300 es
551
- ${e}`;let{gl:r}=this.device;if(r.shaderSource(this.handle,e),r.compileShader(this.handle),!this.device.props.debug){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}qt.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),qt.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){let e=async i=>await new Promise(o=>setTimeout(o,i));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:n}=this.device;for(;;){if(n.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}};function l7(t,e,r,n){if(Jde(e))return n(t);let i=t;i.pushState();try{return Zde(t,e),Mh(i.gl,r),n(t)}finally{i.popState()}}function Zde(t,e){let r=t,{gl:n}=r;if(e.cullMode)switch(e.cullMode){case"none":n.disable(2884);break;case"front":n.enable(2884),n.cullFace(1028);break;case"back":n.enable(2884),n.cullFace(1029);break}if(e.frontFace&&n.frontFace(XA("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&n.enable(34383),e.depthBias!==void 0&&(n.enable(32823),n.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){let o=r.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,s=XA("provokingVertex",e.provokingVertex,{first:36429,last:36430});o?.provokingVertexWEBGL(s)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){let o=r.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,s=XA("polygonMode",e.polygonMode,{fill:6914,line:6913});o?.polygonModeWEBGL(1028,s),o?.polygonModeWEBGL(1029,s)}e.polygonOffsetLine&&n.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&n.enable(12288),e.clipDistance1&&n.enable(12289),e.clipDistance2&&n.enable(12290),e.clipDistance3&&n.enable(12291),e.clipDistance4&&n.enable(12292),e.clipDistance5&&n.enable(12293),e.clipDistance6&&n.enable(12294),e.clipDistance7&&n.enable(12295)),e.depthWriteEnabled!==void 0&&n.depthMask(Qde("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?n.enable(2929):n.disable(2929),n.depthFunc(iM("depthCompare",e.depthCompare))),e.stencilWriteMask){let i=e.stencilWriteMask;n.stencilMaskSeparate(1028,i),n.stencilMaskSeparate(1029,i)}if(e.stencilReadMask&&qt.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){let i=e.stencilReadMask||4294967295,o=iM("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?n.enable(2960):n.disable(2960),n.stencilFuncSeparate(1028,o,0,i),n.stencilFuncSeparate(1029,o,0,i)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){let i=RO("stencilPassOperation",e.stencilPassOperation),o=RO("stencilFailOperation",e.stencilFailOperation),s=RO("stencilDepthFailOperation",e.stencilDepthFailOperation);n.stencilOpSeparate(1028,o,s,i),n.stencilOpSeparate(1029,o,s,i)}switch(e.blend){case!0:n.enable(3042);break;case!1:n.disable(3042);break;default:}if(e.blendColorOperation||e.blendAlphaOperation){let i=c7("blendColorOperation",e.blendColorOperation||"add"),o=c7("blendAlphaOperation",e.blendAlphaOperation||"add");n.blendEquationSeparate(i,o);let s=nM("blendColorSrcFactor",e.blendColorSrcFactor||"one"),c=nM("blendColorDstFactor",e.blendColorDstFactor||"zero"),l=nM("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),h=nM("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");n.blendFuncSeparate(s,c,l,h)}}function iM(t,e){return XA(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function RO(t,e){return XA(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function c7(t,e){return XA(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function nM(t,e){return XA(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 $de(t,e){return`Illegal parameter ${e} for ${t}`}function XA(t,e,r){if(!(e in r))throw new Error($de(t,e));return r[e]}function Qde(t,e){return e}function Jde(t){let e=!0;for(let r in t){e=!1;break}return e}function oM(t){let e={};return t.addressModeU&&(e[10242]=LO(t.addressModeU)),t.addressModeV&&(e[10243]=LO(t.addressModeV)),t.addressModeW&&(e[32882]=LO(t.addressModeW)),t.magFilter&&(e[10240]=OO(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=eme(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]=iM("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function LO(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function OO(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function eme(t,e="none"){if(!e)return OO(t);switch(e){case"none":return OO(t);case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}var YA=class extends rm{device;handle;parameters;constructor(e,r){super(e,r),this.device=e,this.parameters=oM(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,n]of Object.entries(e)){let i=Number(r);switch(i){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,i,n);break;default:this.device.gl.samplerParameteri(this.handle,i,n);break}}}};var kf=class extends em{device;gl;handle;texture;constructor(e,r){super(e,{...fi.defaultProps,...r}),this.device=e,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}};var tme="Failed to deduce GL constant from typed array";function u7(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(tme)}}function h7(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")}}function BO(t){switch(t){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function f7(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}function KA(t,e,r){if(rme(e))return r(t);let{nocatch:n=!0}=e,i=Sh.get(t);i.push(),Mh(t,e);let o;if(n)o=r(t),i.pop();else try{o=r(t)}finally{i.pop()}return o}function rme(t){for(let e in t)return!1;return!0}function p7(t,e,r){let{dimension:n,width:i,height:o,depth:s=0}=r,{glInternalFormat:c}=r,l=r.glTarget;switch(n){case"2d-array":case"3d":t.texStorage3D(l,e,c,i,o,s);break;default:t.texStorage2D(l,e,c,i,o)}}function DO(t,e,r,n){let{width:i,height:o}=n,{dimension:s,depth:c=0,mipLevel:l=0}=n,{x:h=0,y:p=0,z:x=0}=n,{glFormat:w,glType:E}=n,P=m7(n.glTarget,s,c),B=n.flipY?{[37440]:!0}:{};KA(t,B,()=>{switch(s){case"2d-array":case"3d":t.bindTexture(P,e),t.texSubImage3D(P,l,h,p,x,i,o,c,w,E,r),t.bindTexture(P,null);break;case"2d":case"cube":t.bindTexture(P,e),t.texSubImage2D(P,l,h,p,i,o,w,E,r),t.bindTexture(P,null);break;default:throw new Error(s)}})}function NO(t,e,r){let{dimension:n,width:i,height:o,depth:s=0,mipLevel:c=0,byteOffset:l=0}=r,{x:h=0,y:p=0,z:x=0}=r,{glFormat:w,glType:E,compressed:P}=r,B=m7(r.glTarget,n,s);switch(n){case"2d-array":case"3d":P?t.compressedTexSubImage3D(B,c,h,p,x,i,o,s,w,e,l):t.texSubImage3D(B,c,h,p,x,i,o,s,w,E,e,l);break;case"2d":case"cube":P?t.compressedTexSubImage2D(B,c,h,p,i,o,w,e,l):t.texSubImage2D(B,c,h,p,i,o,w,E,e,l);break;default:throw new Error(n)}}function d7(t){switch(t){case"1d":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866;case"cube-array":break}throw new Error(t)}function m7(t,e,r){return e==="cube"?34069+r:t}function A7(t,e){let{sourceX:r=0,sourceY:n=0,sourceAttachment:i=0}=e||{},{target:o=null,sourceWidth:s,sourceHeight:c,sourceDepth:l,sourceFormat:h,sourceType:p}=e||{},{framebuffer:x,deleteFramebuffer:w}=_7(t),{gl:E,handle:P}=x;s||=x.width,c||=x.height;let B=x.colorAttachments[i]?.texture;if(!B)throw new Error(`Invalid framebuffer attachment ${i}`);l=B?.depth||1,h||=B?.glFormat||6408,p||=B?.glType||5121,o=ime(o,p,h,s,c,l),p=p||u7(o);let D=E.bindFramebuffer(36160,P);return E.readBuffer(36064+i),E.readPixels(r,n,s,c,h,p,o),E.readBuffer(36064),E.bindFramebuffer(36160,D||null),w&&x.destroy(),o}function g7(t,e){let{target:r,sourceX:n=0,sourceY:i=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:c,sourceHeight:l,sourceType:h}=e||{},{framebuffer:p,deleteFramebuffer:x}=_7(t);c=c||p.width,l=l||p.height;let w=p;h=h||5121;let E=r;if(!E){let B=BO(o),D=f7(h),W=s+c*l*B*D;E=w.device.createBuffer({byteLength:W})}let P=t.device.createCommandEncoder();return P.copyTextureToBuffer({sourceTexture:t,width:c,height:l,origin:[n,i],destinationBuffer:E,byteOffset:s}),P.destroy(),x&&p.destroy(),E}function _7(t){return t instanceof Lf?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:nme(t),deleteFramebuffer:!0}}function nme(t,e){let{device:r,width:n,height:i,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:n,height:i,colorAttachments:[t]})}function ime(t,e,r,n,i,o){if(t)return t;e||=5121;let s=h7(e,{clamped:!1}),c=BO(r);return new s(n*i*c)}var Ff=class extends fi{device;gl;handle;sampler=void 0;view=void 0;mipmaps;compressed;glTarget;glFormat;glType;glInternalFormat;textureUnit=0;constructor(e,r){super(e,r);let n={...this.props};n.data=r.data,this.device=e,this.gl=this.device.gl,this.glTarget=d7(this.props.dimension);let i=ZE(this.props.format);this.glInternalFormat=i.internalFormat,this.glFormat=i.format,this.glType=i.type,this.compressed=i.compressed,this.mipmaps=Boolean(this.props.mipmaps),this._initialize(n),Object.seal(this)}_initialize(e){this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:e.data});let{width:r,height:n}=e;if(!r||!n){let i=fi.getTextureDataSize(e.data);r=i?.width||1,n=i?.height||1}if(this.width=r,this.height=n,this.depth=e.depth,this.setSampler(e.sampler),this.view=new kf(this.device,{...this.props,texture:this}),this.bind(),p7(this.gl,this.mipLevels,this),e.data)switch(e.dimension){case"1d":this.setTexture1DData(e.data);break;case"2d":this.setTexture2DData(e.data);break;case"3d":this.setTexture3DData(e.data);break;case"cube":this.setTextureCubeData(e.data);break;case"2d-array":this.setTextureArrayData(e.data);break;case"cube-array":this.setTextureCubeArrayData(e.data);break;default:throw new Error(e.dimension)}this.mipmaps&&this.generateMipmap()}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(e){return new kf(this.device,{...e,texture:this})}setSampler(e={}){let r;e instanceof YA?(this.sampler=e,r=e.props):(this.sampler=new YA(this.device,e),r=e);let n=oM(r);this._setSamplerParameters(n)}generateMipmap(e){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(qt.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!e?.force)))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(n){qt.warn(`Error generating mipmap for ${this}: ${n.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}copyExternalImage(e){let r=fi.getExternalImageSize(e.image),n={...fi.defaultCopyExternalImageOptions,...r,...e},{image:i,depth:o,mipLevel:s,x:c,y:l,z:h,flipY:p}=n,{width:x,height:w}=n,{dimension:E,glTarget:P,glFormat:B,glInternalFormat:D,glType:W}=this;if(x=Math.min(x,this.width-c),w=Math.min(w,this.height-l),e.sourceX||e.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");return DO(this.device.gl,this.handle,i,{dimension:E,mipLevel:s,x:c,y:l,z:h,width:x,height:w,depth:o,glFormat:B,glInternalFormat:D,glType:W,glTarget:P,flipY:p}),{width:n.width,height:n.height}}setTexture1DData(e){throw new Error("setTexture1DData not supported in WebGL.")}setTexture2DData(e,r=0){this.bind();let n=fi.normalizeTextureData(e,this);n.length>1&&this.props.mipmaps!==!1&&qt.warn(`Texture ${this.id} mipmap and multiple LODs.`)();for(let i=0;i<n.length;i++){let o=n[i];this._setMipLevel(r,i,o)}this.unbind()}setTexture3DData(e){if(this.props.dimension!=="3d")throw new Error(this.id);ArrayBuffer.isView(e)&&(this.bind(),NO(this.device.gl,e,this),this.unbind())}setTextureCubeData(e,r=0){if(this.props.dimension!=="cube")throw new Error(this.id);for(let n of fi.CubeFaces)this.setTextureCubeFaceData(e[n],n)}setTextureArrayData(e){throw this.props.dimension!=="2d-array"?new Error(this.id):new Error("setTextureArrayData not implemented.")}setTextureCubeArrayData(e){throw new Error("setTextureCubeArrayData not supported in WebGL2.")}setTextureCubeFaceData(e,r,n=0){Array.isArray(e)&&e.length>1&&this.props.mipmaps!==!1&&qt.warn(`${this.id} has mipmap and multiple LODs.`)();let i=fi.CubeFaces.indexOf(r);this.setTexture2DData(e,i)}update(){throw new Error("Texture.update() not implemented. Use ExternalTexture")}setImageDataForFace(e){let{face:r,width:n,height:i,pixels:o,data:s,format:c=6408,type:l=5121}=e,{gl:h}=this,p=o||s;this.bind(),p instanceof Promise?p.then(x=>this.setImageDataForFace(Object.assign({},e,{face:r,data:x,pixels:x}))):this.width||this.height?h.texImage2D(r,0,c,n,i,0,c,l,p):h.texImage2D(r,0,c,c,l,p)}_getImageDataMap(e){for(let r=0;r<fi.CubeFaces.length;++r){let n=fi.CubeFaces[r];e[n]&&(e[34069+r]=e[n],delete e[n])}return e}_setSamplerParameters(e){qt.log(1,`${this.id} sampler parameters`,this.device.getGLKeys(e))(),this.gl.bindTexture(this.glTarget,this.handle);for(let[r,n]of Object.entries(e)){let i=Number(r),o=n;switch(i){case 33082:case 33083:this.gl.texParameterf(this.glTarget,i,o);break;case 10241:this.gl.texParameteri(this.glTarget,i,o);break;case 10242:case 10243:this.gl.texParameteri(this.glTarget,i,o);break;case 34046:this.device.features.has("texture-filterable-anisotropic-webgl")&&this.gl.texParameteri(this.glTarget,i,o);break;default:this.gl.texParameteri(this.glTarget,i,o);break}}this.gl.bindTexture(this.glTarget,null)}_setMipLevel(e,r,n,i=this.glTarget){if(fi.isExternalImage(n)){DO(this.device.gl,this.handle,n,{...this,depth:e,mipLevel:r,glTarget:i,flipY:this.props.flipY});return}if(fi.isTextureLevelData(n)){NO(this.device.gl,n.data,{...this,depth:e,mipLevel:r,glTarget:i});return}throw new Error("Texture: invalid image data")}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.glTarget,this.handle),e}unbind(e){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.glTarget,null),e}};var ome=[1,2,4,8],sM=class extends kp{device;glParameters;constructor(e,r){super(e,r),this.device=e;let n;if(!r?.parameters?.viewport)if(r?.framebuffer){let{width:i,height:o}=r.framebuffer;n=[0,0,i,o]}else{let[i,o]=e.getCanvasContext().getDrawingBufferSize();n=[0,0,i,o]}if(this.device.pushState(),this.setParameters({viewport:n,...this.props.parameters}),this.props.framebuffer){let i=this.props.framebuffer.colorAttachments.map((o,s)=>36064+s);this.device.gl.drawBuffers(i)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){let r={...this.glParameters};r.framebuffer=this.props.framebuffer||null,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=ome.map(n=>Boolean(n&e.colorMask))),this.glParameters=r,Mh(this.device.gl,r)}beginOcclusionQuery(e){this.props.occlusionQuerySet?.beginOcclusionQuery()}endOcclusionQuery(){this.props.occlusionQuerySet?.endOcclusionQuery()}clear(){let e={...this.glParameters},r=0;this.props.clearColors&&this.props.clearColors.forEach((n,i)=>{n&&this.clearColorBuffer(i,n)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(r|=16384,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=256,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=1024,e.clearStencil=this.props.clearStencil),r!==0&&KA(this.device.gl,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(e=0,r=[0,0,0,0]){KA(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,e,r);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,e,r);break;case Float32Array:this.device.gl.clearBufferfv(6144,e,r);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}};function y7(t){return sme.includes(t)}var sme=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],x7={[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 kO(t){let e=x7[t];if(!e)throw new Error("uniform");let[r,n,,i]=e;return{format:i,components:n,glType:r}}function v7(t){let e=x7[t];if(!e)throw new Error("attribute");let[,r,,n,i]=e;return{attributeType:n,vertexFormat:i,components:r}}function b7(t,e){let r={attributes:[],bindings:[]};r.attributes=ame(t,e);let n=ume(t,e);for(let c of n){let l=c.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));r.bindings.push({type:"uniform",name:c.name,group:0,location:c.location,visibility:(c.vertex?1:0)&(c.fragment?2:0),minBindingSize:c.byteLength,uniforms:l})}let i=lme(t,e),o=0;for(let c of i)if(y7(c.type)){let{viewDimension:l,sampleType:h}=fme(c.type);r.bindings.push({type:"texture",name:c.name,group:0,location:o,viewDimension:l,sampleType:h}),c.textureUnit=o,o+=1}i.length&&(r.uniforms=i);let s=cme(t,e);return s?.length&&(r.varyings=s),r}function ame(t,e){let r=[],n=t.getProgramParameter(e,35721);for(let i=0;i<n;i++){let o=t.getActiveAttrib(e,i);if(!o)throw new Error("activeInfo");let{name:s,type:c}=o,l=t.getAttribLocation(e,s);if(l>=0){let{attributeType:h}=v7(c),p=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:l,stepMode:p,type:h})}}return r.sort((i,o)=>i.location-o.location),r}function cme(t,e){let r=[],n=t.getProgramParameter(e,35971);for(let i=0;i<n;i++){let o=t.getTransformFeedbackVarying(e,i);if(!o)throw new Error("activeInfo");let{name:s,type:c,size:l}=o,{glType:h,components:p}=kO(c),x={location:i,name:s,type:h,size:l*p};r.push(x)}return r.sort((i,o)=>i.location-o.location),r}function lme(t,e){let r=[],n=t.getProgramParameter(e,35718);for(let i=0;i<n;i++){let o=t.getActiveUniform(e,i);if(!o)throw new Error("activeInfo");let{name:s,size:c,type:l}=o,{name:h,isArray:p}=pme(s),x=t.getUniformLocation(e,h),w={location:x,name:h,size:c,type:l,isArray:p};if(r.push(w),w.size>1)for(let E=0;E<w.size;E++){let P=`${h}[${E}]`;x=t.getUniformLocation(e,P);let B={...w,name:P,location:x};r.push(B)}}return r}function ume(t,e){let r=(o,s)=>t.getActiveUniformBlockParameter(e,o,s),n=[],i=t.getProgramParameter(e,35382);for(let o=0;o<i;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:[]},c=r(o,35395)||[],l=t.getActiveUniforms(e,c,35383),h=t.getActiveUniforms(e,c,35384),p=t.getActiveUniforms(e,c,35387),x=t.getActiveUniforms(e,c,35388);for(let w=0;w<s.uniformCount;++w){let E=t.getActiveUniform(e,c[w]);if(!E)throw new Error("activeInfo");s.uniforms.push({name:E.name,format:kO(l[w]).format,type:l[w],arrayLength:h[w],byteOffset:p[w],byteStride:x[w]})}n.push(s)}return n.sort((o,s)=>o.location-s.location),n}var hme={[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 fme(t){let e=hme[t];if(!e)throw new Error("sampler");let[r,n]=e;return{viewDimension:r,sampleType:n}}function pme(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 w7(t,e,r,n){let i=t,o=n;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 n!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,n);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 i.uniform1uiv(e,s,1);case 36294:return i.uniform2uiv(e,s,2);case 36295:return i.uniform3uiv(e,s,3);case 36296:return i.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 i.uniformMatrix2x3fv(e,!1,s);case 35686:return i.uniformMatrix2x4fv(e,!1,s);case 35687:return i.uniformMatrix3x2fv(e,!1,s);case 35688:return i.uniformMatrix3x4fv(e,!1,s);case 35689:return i.uniformMatrix4x2fv(e,!1,s);case 35690:return i.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function T7(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function E7(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":!1}function Rv(t){return T7(t)||E7(t)}function dme(t){return Rv(t)!==null||typeof t=="number"||typeof t=="boolean"}function M7(t){let e={bindings:{},uniforms:{}};return Object.keys(t).forEach(r=>{let n=t[r];dme(n)?e.uniforms[r]=n:e.bindings[r]=n}),e}function S7(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(t)}}function C7(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;default:throw new Error(t)}}var P7=4,aM=class extends Eh{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:n,bufferMode:i=35981}=r;n&&n.length>0&&(this.varyings=n,this.device.gl.transformFeedbackVaryings(this.handle,n,i)),this._linkShaders(),qt.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=b7(this.device.gl,this.handle),qt.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=mme(this.introspectedLayout,r.shaderLayout)}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e,r){for(let[n,i]of Object.entries(e)){let o=this.shaderLayout.bindings.find(s=>s.name===n)||this.shaderLayout.bindings.find(s=>s.name===`${n}Uniforms`);if(!o){let s=this.shaderLayout.bindings.map(c=>`"${c.name}"`).join(", ");r?.disableWarnings||qt.warn(`No binding "${n}" in render pipeline "${this.id}", expected one of ${s}`,i)();continue}switch(i||qt.warn(`Unsetting binding "${n}" in render pipeline "${this.id}"`)(),o.type){case"uniform":if(!(i instanceof Ch)&&!(i.buffer instanceof Ch))throw new Error("buffer value");break;case"texture":if(!(i instanceof kf||i instanceof Ff||i instanceof Nf))throw new Error("texture value");break;case"sampler":qt.warn(`Ignoring sampler ${n}`)();break;default:throw new Error(o.type)}this.bindings[n]=i}}draw(e){let{renderPass:r,parameters:n=this.props.parameters,topology:i=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:c,isInstanced:l=!1,firstVertex:h=0,transformFeedback:p}=e,x=S7(i),w=Boolean(o.indexBuffer),E=o.indexBuffer?.glIndexType;if(this.linkStatus!=="success")return qt.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return qt.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),o.bindBeforeRender(r),p&&p.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let P=r;return l7(this.device,n,P.glParameters,()=>{w&&l?this.device.gl.drawElementsInstanced(x,s||0,E,h,c||0):w?this.device.gl.drawElements(x,s||0,E,h):l?this.device.gl.drawArraysInstanced(x,h,s||0,c||0):this.device.gl.drawArrays(x,h,s||0),p&&p.end()}),o.unbindAfterRender(r),!0}setUniformsWebGL(e){let{bindings:r}=M7(e);Object.keys(r).forEach(n=>{qt.warn(`Unsupported value "${JSON.stringify(r[n])}" used in setUniforms() for key ${n}. 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),qt.time(P7,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),qt.timeEnd(P7,`linkProgram for ${this.id}`)(),qt.level,!this.device.features.has("compilation-status-async-webgl")){let n=this._getLinkStatus();this._reportLinkStatus(n);return}qt.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),qt.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();let r=this._getLinkStatus();this._reportLinkStatus(r)}async _reportLinkStatus(e){switch(e){case"success":return;default:switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`);case"pending":this.vs.asyncCompilationStatus.then(()=>this.vs.debugShader());break;case"success":break}switch(this.fs?.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`);case"pending":this.fs.asyncCompilationStatus.then(()=>this.fs.debugShader());break;case"success":break}let r=this.device.gl.getProgramInfoLog(this.handle);throw new Error(`Error during ${e}: ${r}`)}}_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 i=>await new Promise(o=>setTimeout(o,i));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:n}=this.device;for(;;){if(n.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(let r of this.shaderLayout.bindings)!this.bindings[r.name]&&!this.bindings[r.name.replace(/Uniforms$/,"")]&&(qt.warn(`Binding ${r.name} not found in ${this.id}`)(),e=!1);return e}_applyBindings(){if(this.linkStatus!=="success")return;let{gl:e}=this.device;e.useProgram(this.handle);let r=0,n=0;for(let i of this.shaderLayout.bindings){let o=this.bindings[i.name]||this.bindings[i.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${i.name} in ${this.id}`);switch(i.type){case"uniform":let{name:s}=i,c=e.getUniformBlockIndex(this.handle,s);if(c===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,n,c),o instanceof Ch?e.bindBufferBase(35345,n,o.handle):e.bindBufferRange(35345,n,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),n+=1;break;case"texture":if(!(o instanceof kf||o instanceof Ff||o instanceof Nf))throw new Error("texture");let l;if(o instanceof kf)l=o.texture;else if(o instanceof Ff)l=o;else if(o instanceof Nf&&o.colorAttachments[0]instanceof kf)qt.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),l=o.colorAttachments[0].texture;else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(l.glTarget,l.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${i.type}' not supported in WebGL`)}}}_applyUniforms(){for(let e of this.shaderLayout.uniforms||[]){let{name:r,location:n,type:i,textureUnit:o}=e,s=this.uniforms[r]??o;s!==void 0&&w7(this.device.gl,n,i,s)}}};function mme(t,e){let r={...t,attributes:t.attributes.map(n=>({...n}))};for(let n of e?.attributes||[]){let i=r.attributes.find(o=>o.name===n.name);i?(i.type=n.type||i.type,i.stepMode=n.stepMode||i.stepMode):qt.warn(`shader layout attribute ${n.name} not present in shader`)}return r}var cM=class extends T_{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":Ame(this.device,r.options);break;case"copy-buffer-to-texture":gme(this.device,r.options);break;case"copy-texture-to-buffer":_me(this.device,r.options);break;case"copy-texture-to-texture":yme(this.device,r.options);break;default:throw new Error(r.name)}}};function Ame(t,e){let r=e.sourceBuffer,n=e.destinationBuffer;t.gl.bindBuffer(36662,r.handle),t.gl.bindBuffer(36663,n.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 gme(t,e){throw new Error("Not implemented")}function _me(t,e){let{sourceTexture:r,mipLevel:n=0,aspect:i="all",width:o=e.sourceTexture.width,height:s=e.sourceTexture.height,depthOrArrayLayers:c=0,origin:l=[0,0],destinationBuffer:h,byteOffset:p=0,bytesPerRow:x,rowsPerImage:w}=e;if(i!=="all")throw new Error("aspect not supported in WebGL");if(n!==0||c!==0||x||w)throw new Error("not implemented");let{framebuffer:E,destroyFramebuffer:P}=I7(r),B;try{let D=h,W=o||E.width,X=s||E.height,q=ZE(E.colorAttachments[0].texture.props.format),$=q.format,te=q.type;t.gl.bindBuffer(35051,D.handle),B=t.gl.bindFramebuffer(36160,E.handle),t.gl.readPixels(l[0],l[1],W,X,$,te,p)}finally{t.gl.bindBuffer(35051,null),B!==void 0&&t.gl.bindFramebuffer(36160,B),P&&E.destroy()}}function yme(t,e){let{sourceTexture:r,destinationMipLevel:n=0,origin:i=[0,0],destinationOrigin:o=[0,0],destinationTexture:s}=e,{width:c=e.destinationTexture.width,height:l=e.destinationTexture.height}=e,{framebuffer:h,destroyFramebuffer:p}=I7(r),[x,w]=i,[E,P,B]=o,D=t.gl.bindFramebuffer(36160,h.handle),W=null,X;if(s instanceof Ff)W=s,c=Number.isFinite(c)?c:W.width,l=Number.isFinite(l)?l:W.height,W.bind(0),X=W.glTarget;else throw new Error("invalid destination");switch(X){case 3553:case 34067:t.gl.copyTexSubImage2D(X,n,E,P,x,w,c,l);break;case 35866:case 32879:t.gl.copyTexSubImage3D(X,n,E,P,B,x,w,c,l);break;default:}W&&W.unbind(),t.gl.bindFramebuffer(36160,D),p&&h.destroy()}function I7(t){if(t instanceof fi){let{width:e,height:r,id:n}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${n}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var lM=class extends w_{device;commandBuffer;constructor(e,r){super(e,r),this.device=e,this.commandBuffer=new cM(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,n){}};function R7(t){let{target:e,source:r,start:n=0,count:i=1}=t,o=r.length,s=i*o,c=0;for(let l=n;c<o;c++)e[l++]=r[c];for(;c<s;)c<s-c?(e.copyWithin(n+c,n,n+c),c*=2):(e.copyWithin(n+c,n,n+s-c),c=s);return t.target}var R_=class extends E_{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(e){return ML()==="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 n=r;if(n.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:i,type:o,stride:s,offset:c,normalized:l,integer:h,divisor:p}=this._getAccessor(e);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,n.handle),h?this.device.gl.vertexAttribIPointer(e,i,o,s,c):this.device.gl.vertexAttribPointer(e,i,o,l,s,c),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(e),this.device.gl.vertexAttribDivisor(e,p||0),this.attributes[e]=n,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 n=YE(r.bufferDataType);return{size:r.bufferComponents,type:n,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e,r=!0){let i=R_.isConstantAttributeZeroSupported(this.device)||e!==0;(r||i)&&(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 n=xme(r),i=n.byteLength*e,o=n.length*e;if(this.buffer&&i!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${i} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:i}),s=s||!vme(n,this.bufferValue),s){let c=TO(r.constructor,o);R7({target:c,source:n,start:0,count:o}),this.buffer.write(c),this.bufferValue=r}return this.buffer}};function xme(t){return Array.isArray(t)?new Float32Array(t):t}function vme(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 uM=class extends M_{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(C7(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 n=this._getVaryingIndex(e),{buffer:i,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(n<0){this.unusedBuffers[e]=i,qt.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[n]={buffer:i,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(n,i,s,o)}getBuffer(e){if(L7(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 Ch)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:n=0,byteLength:i=e.buffer.byteLength}=e;return{buffer:r,byteOffset:n,byteLength:i}}_getVaryingIndex(e){if(L7(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:n,byteOffset:i}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,i,n)}}_unbindBuffers(){for(let e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r,n=0,i){let o=r&&r.handle;!o||i===void 0?this.gl.bindBufferBase(35982,e,o):this.gl.bindBufferRange(35982,e,o,n,i)}};function L7(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}var hM=class extends S_{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((n,i)=>{let o=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):r++>e?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(o)};requestAnimationFrame(o)}),this._pollingPromise}};var Na=class extends hl{type="webgl";handle;features;limits;info;canvasContext;lost;_resolveContextLost;gl;debug=!1;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};_extensions={};_polyfilled=!1;spectorJS;constructor(e){super({...e,id:e.id||o7("webgl-device")});let r=hl._getCanvasContextProps(e);if(!r)throw new Error("WebGLDevice requires props.createCanvasContext to be set");let n=r.canvas?.gl?.device;if(n)throw new Error(`WebGL context already attached to device ${n.id}`);this.canvasContext=new JE(this,r),this.lost=new Promise(p=>{this._resolveContextLost=p});let i={...e.webgl};r.alphaMode==="premultiplied"&&(i.premultipliedAlpha=!0),e.powerPreference!==void 0&&(i.powerPreference=e.powerPreference);let s=this.props._handle||j9(this.canvasContext.canvas,{onContextLost:p=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."}),onContextRestored:p=>console.log("WebGL context restored")},i);if(!s)throw new Error("WebGL context creation failed");if(n=s.device,n){if(e._reuseDevices)return qt.log(1,`Not creating a new Device, instead returning a reference to Device ${n.id} already attached to WebGL context`,n)(),n._reused=!0,n;throw new Error(`WebGL context already attached to device ${n.id}`)}this.handle=s,this.gl=s,this.spectorJS=e7({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=H9(this.gl,this._extensions),this.limits=new QE(this.gl),this.features=new $E(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),r.autoResize!==!1&&this.canvasContext.resize(),new Sh(this.gl,{log:(...p)=>qt.log(1,...p)()}).trackState(this.gl,{copyState:!1});let l=e.debugWebGL||e.debug,h=e.debugWebGL;l&&(this.gl=i7(this.gl,{debugWebGL:l,traceWebGL:h}),qt.warn("WebGL debug mode activated. Performance reduced.")(),e.debugWebGL&&(qt.level=Math.max(qt.level,1)))}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._normalizeBufferProps(e);return new Ch(this,r)}createTexture(e){return new Ff(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new YA(this,e)}createShader(e){return new rM(this,e)}createFramebuffer(e){return new Nf(this,e)}createVertexArray(e){return new R_(this,e)}createTransformFeedback(e){return new uM(this,e)}createQuerySet(e){return new hM(this,e)}createRenderPipeline(e){return new aM(this,e)}beginRenderPass(e){return new sM(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 lM(this,e)}submit(){this.renderPass?.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return A7(e,r)}readPixelsToBufferWebGL(e,r){return g7(e,r)}setParametersWebGL(e){Mh(this.gl,e)}getParametersWebGL(e){return XE(this.gl,e)}withParametersWebGL(e,r){return KA(this.gl,e,r)}resetWebGL(){qt.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),z9(this.gl)}_getDeviceSpecificTextureFormatCapabilities(e){return K9(this.gl,e,this._extensions)}loseDevice(){let e=!1,n=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return n&&(e=!0,n.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),e}pushState(){Sh.get(this.gl).push()}popState(){Sh.get(this.gl).pop()}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){let n=Number(e);for(let i in this.gl)if(this.gl[i]===n)return`GL.${i}`;return r?.emptyIfUnknown?"":String(e)}getGLKeys(e){let r={emptyIfUnknown:!0};return Object.entries(e).reduce((n,[i,o])=>(n[`${i}:${this.getGLKey(i,r)}`]=`${o}:${this.getGLKey(o,r)}`,n),{})}_constants;setConstantAttributeWebGL(e,r){let n=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(n).fill(null);let i=this._constants[e];switch(i&&Eme(i,r)&&qt.info(1,`setConstantAttributeWebGL(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:bme(this,e,r);break;case Int32Array:wme(this,e,r);break;case Uint32Array:Tme(this,e,r);break;default:throw new Error("constant")}}getExtension(e){return Df(this.gl,e,this._extensions),this._extensions}};function bme(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:}}function wme(t,e,r){t.gl.vertexAttribI4iv(e,r)}function Tme(t,e,r){t.gl.vertexAttribI4uiv(e,r)}function Eme(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 Mme={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},Sme=t=>({drawBuffersWEBGL(e){return t.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),Cme=t=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return t.createVertexArray()},deleteVertexArrayOES(e){return t.deleteVertexArray(e)},isVertexArrayOES(e){return t.isVertexArray(e)},bindVertexArrayOES(e){return t.bindVertexArray(e)}}),Pme=t=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return t.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return t.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return t.vertexAttribDivisor(...e)}});function O7(t=!0){let e=HTMLCanvasElement.prototype;if(!t&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(r,n){if(r==="webgl"||r==="experimental-webgl"){let i=this.originalGetContext("webgl2",n);return i instanceof HTMLElement&&Ime(i),i}return this.originalGetContext(r,n)}}function Ime(t){t.getExtension("EXT_color_buffer_float");let e={...Mme,WEBGL_disjoint_timer_query:t.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:Sme(t),OES_vertex_array_object:Cme(t),ANGLE_instanced_arrays:Pme(t)},r=t.getExtension;t.getExtension=function(i){let o=r.call(t,i);return o||(i in e?e[i]:null)};let n=t.getSupportedExtensions;t.getSupportedExtensions=function(){return(n.apply(t)||[])?.concat(Object.keys(e))}}var fM=1,FO=class extends Tv{type="webgl";constructor(){super(),hl.defaultProps={...hl.defaultProps,...tM},Na.adapter=this}isSupported(){return typeof WebGL2RenderingContext<"u"}enforceWebGL2(e){O7(e)}async attach(e){if(e instanceof Na)return e;if(e?.device instanceof hl)return e.device;if(!Rme(e))throw new Error("Invalid WebGL2RenderingContext");return new Na({_handle:e,createCanvasContext:{canvas:e.canvas,autoResize:!1}})}async create(e={}){qt.groupCollapsed(fM,"WebGLDevice created")();let r=[];(e.debugWebGL||e.debug)&&r.push(n7()),e.debugSpectorJS&&r.push(J9(e));let n=await Promise.allSettled(r);for(let s of n)s.status==="rejected"&&qt.error(`Failed to initialize debug libraries ${s.reason}`)();let i=new Na(e),o=`${i._reused?"Reusing":"Created"} device with WebGL2 ${i.debug?"debug ":""}context: ${i.info.vendor}, ${i.info.renderer} for canvas: ${i.canvasContext.id}`;return qt.probe(fM,o)(),qt.table(fM,i.info)(),qt.groupEnd(fM)(),i}};function Rme(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}var pM=new FO;var B7,D7,k7={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function dM(){return document.createElement("div")}function Lme(t){if(!t.picked)return null;if(t.object===B7)return D7;let e={html:Bme(t.object),style:k7};return D7=e,B7=t.object,e}var Ome=new Set(["position","index"]);function Bme(t){let e=dM();for(let r in t){if(Ome.has(r))continue;let n=dM();n.className="header",n.textContent=r;let i=dM();i.className="value",i.textContent=Nme(t[r]);let o=dM();Dme(o,n,i),o.appendChild(n),o.appendChild(i),e.appendChild(o)}return e.innerHTML}function Dme(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 Nme(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 N7(t,e){let r,n=t,i="properties",o=/{[^}]*}/g,s=l=>l.replace(/[{}]/g,""),c=[...new Set(t.match(o).map(s))];for(let l of c){if(l.includes(".")){r=e;let h=l.split(".");for(let p of h)if(r.hasOwnProperty(p))r=r[p];else{r=void 0;break}}else e.hasOwnProperty(l)?r=e[l]:e[i]&&e[i].hasOwnProperty(l)?r=e[i][l]:r=void 0;n=n.replaceAll(`{${l}}`,r)}return n}function zO(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||k7};return t.html?r.html=N7(t.html,e.object):r.text=N7(t.text,e.object),r}:Lme:null}function F7(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function z7(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 V7=ec(U7()),kme="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",jO=V7.default;function j7(t=kme){F7(t)}function H7(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var HO={};function W7(t){if(!HO[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),HO[t]=new Promise(n=>{e.onload=n})}return HO[t]}var q7="4.2.1";var Fme=globalThis.loaders?.parseImageNode,WO=typeof Image<"u",qO=typeof ImageBitmap<"u",zme=Boolean(Fme),GO=Dp?!0:zme;function G7(t){switch(t){case"auto":return qO||WO||GO;case"imagebitmap":return qO;case"image":return WO;case"data":return GO;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function X7(){if(qO)return"imagebitmap";if(WO)return"image";if(GO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Y7(t){let e=Ume(t);if(!e)throw new Error("Not an image");return e}function Lv(t){switch(Y7(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 Ume(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 Vme=/^data:image\/svg\+xml/,jme=/\.svg((\?|#).*)?$/;function mM(t){return t&&(Vme.test(t)||jme.test(t))}function K7(t,e){if(mM(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return XO(t,e)}function XO(t,e){if(mM(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function AM(t,e,r){let n=K7(t,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Hme(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function Hme(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}var Wme={},Z7=!0;async function $7(t,e,r){let n;mM(r)?n=await AM(t,e,r):n=XO(t,r);let i=e&&e.imagebitmap;return await qme(n,i)}async function qme(t,e=null){if((Gme(e)||!Z7)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Z7=!1}return await createImageBitmap(t)}function Gme(t){for(let e in t||Wme)return!1;return!0}function Q7(t){return!Zme(t,"ftyp",4)||!(t[8]&96)?null:Xme(t)}function Xme(t){switch(Yme(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Yme(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Kme(t){return[...t].map(e=>e.charCodeAt(0))}function Zme(t,e,r=0){let n=Kme(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var zf=!1,Ov=!0;function ZA(t){let e=Bv(t);return Qme(e)||tAe(e)||Jme(e)||eAe(e)||$me(e)}function $me(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Q7(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Qme(t){let e=Bv(t);return e.byteLength>=24&&e.getUint32(0,zf)===2303741511?{mimeType:"image/png",width:e.getUint32(16,zf),height:e.getUint32(20,zf)}:null}function Jme(t){let e=Bv(t);return e.byteLength>=10&&e.getUint32(0,zf)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Ov),height:e.getUint16(8,Ov)}:null}function eAe(t){let e=Bv(t);return e.byteLength>=14&&e.getUint16(0,zf)===16973&&e.getUint32(2,Ov)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Ov),height:e.getUint32(22,Ov)}:null}function tAe(t){let e=Bv(t);if(!(e.byteLength>=3&&e.getUint16(0,zf)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=rAe(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,zf);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,zf),width:e.getUint16(o+7,zf)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,zf)}return null}function rAe(){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 Bv(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 J7(t,e){let{mimeType:r}=ZA(t)||{},n=globalThis.loaders?.parseImageNode;return Ti(n),await n(t,r)}async function ej(t,e,r){e=e||{};let i=(e.image||{}).type||"auto",{url:o}=r||{},s=nAe(i),c;switch(s){case"imagebitmap":c=await $7(t,e,o);break;case"image":c=await AM(t,e,o);break;case"data":c=await J7(t,e);break;default:Ti(!1)}return i==="data"&&(c=Lv(c)),c}function nAe(t){switch(t){case"auto":case"data":return X7();default:return G7(t),t}}var iAe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],oAe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],sAe={image:{type:"auto",decode:!0}},Uf={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:q7,mimeTypes:oAe,extensions:iAe,parse:ej,tests:[t=>Boolean(ZA(new DataView(t)))],options:sAe};var YO={};function KO(t){if(YO[t]===void 0){let e=Dp?cAe(t):aAe(t);YO[t]=e}return YO[t]}function aAe(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(t)}function cAe(t){switch(t){case"image/avif":case"image/webp":return lAe(t);default:return!0}}function lAe(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var uAe=new Dl({id:"deck"}),br=uAe;var ZO={};function tj(t){ZO=t}function qs(t,e,r,n){br.level>0&&ZO[t]&&ZO[t].call(null,e,r,n)}function hAe(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var rj={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:hAe,parseTextSync:JSON.parse};function fAe(){let t="9.1.1",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(br.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:br,_registerLoggers:tj},HA([rj,[Uf,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var gM=fAe();function _M(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var $O={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 ij(t){let e={};for(let[r,n]of Object.entries(t))e[r]=pAe(n);return e}function pAe(t){let e=nj(t);if(e!=="object")return{value:t,...$O[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...$O[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=nj(t.value),{...t,...$O[e],type:e}):{type:"object",value:null};throw new Error("props")}function nj(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var oj=`#ifdef MODULE_LOGDEPTH
551
+ ${e}`;let{gl:r}=this.device;if(r.shaderSource(this.handle,e),r.compileShader(this.handle),!this.device.props.debug){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}qt.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),qt.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){let e=async i=>await new Promise(o=>setTimeout(o,i));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:n}=this.device;for(;;){if(n.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}};function l7(t,e,r,n){if(Jde(e))return n(t);let i=t;i.pushState();try{return Zde(t,e),Mh(i.gl,r),n(t)}finally{i.popState()}}function Zde(t,e){let r=t,{gl:n}=r;if(e.cullMode)switch(e.cullMode){case"none":n.disable(2884);break;case"front":n.enable(2884),n.cullFace(1028);break;case"back":n.enable(2884),n.cullFace(1029);break}if(e.frontFace&&n.frontFace(XA("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&n.enable(34383),e.depthBias!==void 0&&(n.enable(32823),n.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){let o=r.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,s=XA("provokingVertex",e.provokingVertex,{first:36429,last:36430});o?.provokingVertexWEBGL(s)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){let o=r.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,s=XA("polygonMode",e.polygonMode,{fill:6914,line:6913});o?.polygonModeWEBGL(1028,s),o?.polygonModeWEBGL(1029,s)}e.polygonOffsetLine&&n.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&n.enable(12288),e.clipDistance1&&n.enable(12289),e.clipDistance2&&n.enable(12290),e.clipDistance3&&n.enable(12291),e.clipDistance4&&n.enable(12292),e.clipDistance5&&n.enable(12293),e.clipDistance6&&n.enable(12294),e.clipDistance7&&n.enable(12295)),e.depthWriteEnabled!==void 0&&n.depthMask(Qde("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?n.enable(2929):n.disable(2929),n.depthFunc(iM("depthCompare",e.depthCompare))),e.stencilWriteMask){let i=e.stencilWriteMask;n.stencilMaskSeparate(1028,i),n.stencilMaskSeparate(1029,i)}if(e.stencilReadMask&&qt.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){let i=e.stencilReadMask||4294967295,o=iM("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?n.enable(2960):n.disable(2960),n.stencilFuncSeparate(1028,o,0,i),n.stencilFuncSeparate(1029,o,0,i)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){let i=RO("stencilPassOperation",e.stencilPassOperation),o=RO("stencilFailOperation",e.stencilFailOperation),s=RO("stencilDepthFailOperation",e.stencilDepthFailOperation);n.stencilOpSeparate(1028,o,s,i),n.stencilOpSeparate(1029,o,s,i)}switch(e.blend){case!0:n.enable(3042);break;case!1:n.disable(3042);break;default:}if(e.blendColorOperation||e.blendAlphaOperation){let i=c7("blendColorOperation",e.blendColorOperation||"add"),o=c7("blendAlphaOperation",e.blendAlphaOperation||"add");n.blendEquationSeparate(i,o);let s=nM("blendColorSrcFactor",e.blendColorSrcFactor||"one"),c=nM("blendColorDstFactor",e.blendColorDstFactor||"zero"),l=nM("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),h=nM("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");n.blendFuncSeparate(s,c,l,h)}}function iM(t,e){return XA(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function RO(t,e){return XA(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function c7(t,e){return XA(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function nM(t,e){return XA(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 $de(t,e){return`Illegal parameter ${e} for ${t}`}function XA(t,e,r){if(!(e in r))throw new Error($de(t,e));return r[e]}function Qde(t,e){return e}function Jde(t){let e=!0;for(let r in t){e=!1;break}return e}function oM(t){let e={};return t.addressModeU&&(e[10242]=LO(t.addressModeU)),t.addressModeV&&(e[10243]=LO(t.addressModeV)),t.addressModeW&&(e[32882]=LO(t.addressModeW)),t.magFilter&&(e[10240]=OO(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=eme(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]=iM("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function LO(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function OO(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function eme(t,e="none"){if(!e)return OO(t);switch(e){case"none":return OO(t);case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}var YA=class extends rm{device;handle;parameters;constructor(e,r){super(e,r),this.device=e,this.parameters=oM(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,n]of Object.entries(e)){let i=Number(r);switch(i){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,i,n);break;default:this.device.gl.samplerParameteri(this.handle,i,n);break}}}};var kf=class extends em{device;gl;handle;texture;constructor(e,r){super(e,{...fi.defaultProps,...r}),this.device=e,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}};var tme="Failed to deduce GL constant from typed array";function u7(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(tme)}}function h7(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")}}function BO(t){switch(t){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function f7(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}function KA(t,e,r){if(rme(e))return r(t);let{nocatch:n=!0}=e,i=Sh.get(t);i.push(),Mh(t,e);let o;if(n)o=r(t),i.pop();else try{o=r(t)}finally{i.pop()}return o}function rme(t){for(let e in t)return!1;return!0}function p7(t,e,r){let{dimension:n,width:i,height:o,depth:s=0}=r,{glInternalFormat:c}=r,l=r.glTarget;switch(n){case"2d-array":case"3d":t.texStorage3D(l,e,c,i,o,s);break;default:t.texStorage2D(l,e,c,i,o)}}function DO(t,e,r,n){let{width:i,height:o}=n,{dimension:s,depth:c=0,mipLevel:l=0}=n,{x:h=0,y:p=0,z:x=0}=n,{glFormat:w,glType:E}=n,P=m7(n.glTarget,s,c),B=n.flipY?{[37440]:!0}:{};KA(t,B,()=>{switch(s){case"2d-array":case"3d":t.bindTexture(P,e),t.texSubImage3D(P,l,h,p,x,i,o,c,w,E,r),t.bindTexture(P,null);break;case"2d":case"cube":t.bindTexture(P,e),t.texSubImage2D(P,l,h,p,i,o,w,E,r),t.bindTexture(P,null);break;default:throw new Error(s)}})}function NO(t,e,r){let{dimension:n,width:i,height:o,depth:s=0,mipLevel:c=0,byteOffset:l=0}=r,{x:h=0,y:p=0,z:x=0}=r,{glFormat:w,glType:E,compressed:P}=r,B=m7(r.glTarget,n,s);switch(n){case"2d-array":case"3d":P?t.compressedTexSubImage3D(B,c,h,p,x,i,o,s,w,e,l):t.texSubImage3D(B,c,h,p,x,i,o,s,w,E,e,l);break;case"2d":case"cube":P?t.compressedTexSubImage2D(B,c,h,p,i,o,w,e,l):t.texSubImage2D(B,c,h,p,i,o,w,E,e,l);break;default:throw new Error(n)}}function d7(t){switch(t){case"1d":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866;case"cube-array":break}throw new Error(t)}function m7(t,e,r){return e==="cube"?34069+r:t}function A7(t,e){let{sourceX:r=0,sourceY:n=0,sourceAttachment:i=0}=e||{},{target:o=null,sourceWidth:s,sourceHeight:c,sourceDepth:l,sourceFormat:h,sourceType:p}=e||{},{framebuffer:x,deleteFramebuffer:w}=_7(t),{gl:E,handle:P}=x;s||=x.width,c||=x.height;let B=x.colorAttachments[i]?.texture;if(!B)throw new Error(`Invalid framebuffer attachment ${i}`);l=B?.depth||1,h||=B?.glFormat||6408,p||=B?.glType||5121,o=ime(o,p,h,s,c,l),p=p||u7(o);let D=E.bindFramebuffer(36160,P);return E.readBuffer(36064+i),E.readPixels(r,n,s,c,h,p,o),E.readBuffer(36064),E.bindFramebuffer(36160,D||null),w&&x.destroy(),o}function g7(t,e){let{target:r,sourceX:n=0,sourceY:i=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:c,sourceHeight:l,sourceType:h}=e||{},{framebuffer:p,deleteFramebuffer:x}=_7(t);c=c||p.width,l=l||p.height;let w=p;h=h||5121;let E=r;if(!E){let B=BO(o),D=f7(h),W=s+c*l*B*D;E=w.device.createBuffer({byteLength:W})}let P=t.device.createCommandEncoder();return P.copyTextureToBuffer({sourceTexture:t,width:c,height:l,origin:[n,i],destinationBuffer:E,byteOffset:s}),P.destroy(),x&&p.destroy(),E}function _7(t){return t instanceof Lf?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:nme(t),deleteFramebuffer:!0}}function nme(t,e){let{device:r,width:n,height:i,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:n,height:i,colorAttachments:[t]})}function ime(t,e,r,n,i,o){if(t)return t;e||=5121;let s=h7(e,{clamped:!1}),c=BO(r);return new s(n*i*c)}var Ff=class extends fi{device;gl;handle;sampler=void 0;view=void 0;mipmaps;compressed;glTarget;glFormat;glType;glInternalFormat;textureUnit=0;constructor(e,r){super(e,r);let n={...this.props};n.data=r.data,this.device=e,this.gl=this.device.gl,this.glTarget=d7(this.props.dimension);let i=ZE(this.props.format);this.glInternalFormat=i.internalFormat,this.glFormat=i.format,this.glType=i.type,this.compressed=i.compressed,this.mipmaps=Boolean(this.props.mipmaps),this._initialize(n),Object.seal(this)}_initialize(e){this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:e.data});let{width:r,height:n}=e;if(!r||!n){let i=fi.getTextureDataSize(e.data);r=i?.width||1,n=i?.height||1}if(this.width=r,this.height=n,this.depth=e.depth,this.setSampler(e.sampler),this.view=new kf(this.device,{...this.props,texture:this}),this.bind(),p7(this.gl,this.mipLevels,this),e.data)switch(e.dimension){case"1d":this.setTexture1DData(e.data);break;case"2d":this.setTexture2DData(e.data);break;case"3d":this.setTexture3DData(e.data);break;case"cube":this.setTextureCubeData(e.data);break;case"2d-array":this.setTextureArrayData(e.data);break;case"cube-array":this.setTextureCubeArrayData(e.data);break;default:throw new Error(e.dimension)}this.mipmaps&&this.generateMipmap()}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(e){return new kf(this.device,{...e,texture:this})}setSampler(e={}){let r;e instanceof YA?(this.sampler=e,r=e.props):(this.sampler=new YA(this.device,e),r=e);let n=oM(r);this._setSamplerParameters(n)}generateMipmap(e){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(qt.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!e?.force)))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(n){qt.warn(`Error generating mipmap for ${this}: ${n.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}copyExternalImage(e){let r=fi.getExternalImageSize(e.image),n={...fi.defaultCopyExternalImageOptions,...r,...e},{image:i,depth:o,mipLevel:s,x:c,y:l,z:h,flipY:p}=n,{width:x,height:w}=n,{dimension:E,glTarget:P,glFormat:B,glInternalFormat:D,glType:W}=this;if(x=Math.min(x,this.width-c),w=Math.min(w,this.height-l),e.sourceX||e.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");return DO(this.device.gl,this.handle,i,{dimension:E,mipLevel:s,x:c,y:l,z:h,width:x,height:w,depth:o,glFormat:B,glInternalFormat:D,glType:W,glTarget:P,flipY:p}),{width:n.width,height:n.height}}setTexture1DData(e){throw new Error("setTexture1DData not supported in WebGL.")}setTexture2DData(e,r=0){this.bind();let n=fi.normalizeTextureData(e,this);n.length>1&&this.props.mipmaps!==!1&&qt.warn(`Texture ${this.id} mipmap and multiple LODs.`)();for(let i=0;i<n.length;i++){let o=n[i];this._setMipLevel(r,i,o)}this.unbind()}setTexture3DData(e){if(this.props.dimension!=="3d")throw new Error(this.id);ArrayBuffer.isView(e)&&(this.bind(),NO(this.device.gl,e,this),this.unbind())}setTextureCubeData(e,r=0){if(this.props.dimension!=="cube")throw new Error(this.id);for(let n of fi.CubeFaces)this.setTextureCubeFaceData(e[n],n)}setTextureArrayData(e){throw this.props.dimension!=="2d-array"?new Error(this.id):new Error("setTextureArrayData not implemented.")}setTextureCubeArrayData(e){throw new Error("setTextureCubeArrayData not supported in WebGL2.")}setTextureCubeFaceData(e,r,n=0){Array.isArray(e)&&e.length>1&&this.props.mipmaps!==!1&&qt.warn(`${this.id} has mipmap and multiple LODs.`)();let i=fi.CubeFaces.indexOf(r);this.setTexture2DData(e,i)}update(){throw new Error("Texture.update() not implemented. Use ExternalTexture")}setImageDataForFace(e){let{face:r,width:n,height:i,pixels:o,data:s,format:c=6408,type:l=5121}=e,{gl:h}=this,p=o||s;this.bind(),p instanceof Promise?p.then(x=>this.setImageDataForFace(Object.assign({},e,{face:r,data:x,pixels:x}))):this.width||this.height?h.texImage2D(r,0,c,n,i,0,c,l,p):h.texImage2D(r,0,c,c,l,p)}_getImageDataMap(e){for(let r=0;r<fi.CubeFaces.length;++r){let n=fi.CubeFaces[r];e[n]&&(e[34069+r]=e[n],delete e[n])}return e}_setSamplerParameters(e){qt.log(1,`${this.id} sampler parameters`,this.device.getGLKeys(e))(),this.gl.bindTexture(this.glTarget,this.handle);for(let[r,n]of Object.entries(e)){let i=Number(r),o=n;switch(i){case 33082:case 33083:this.gl.texParameterf(this.glTarget,i,o);break;case 10241:this.gl.texParameteri(this.glTarget,i,o);break;case 10242:case 10243:this.gl.texParameteri(this.glTarget,i,o);break;case 34046:this.device.features.has("texture-filterable-anisotropic-webgl")&&this.gl.texParameteri(this.glTarget,i,o);break;default:this.gl.texParameteri(this.glTarget,i,o);break}}this.gl.bindTexture(this.glTarget,null)}_setMipLevel(e,r,n,i=this.glTarget){if(fi.isExternalImage(n)){DO(this.device.gl,this.handle,n,{...this,depth:e,mipLevel:r,glTarget:i,flipY:this.props.flipY});return}if(fi.isTextureLevelData(n)){NO(this.device.gl,n.data,{...this,depth:e,mipLevel:r,glTarget:i});return}throw new Error("Texture: invalid image data")}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.glTarget,this.handle),e}unbind(e){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.glTarget,null),e}};var ome=[1,2,4,8],sM=class extends kp{device;glParameters;constructor(e,r){super(e,r),this.device=e;let n;if(!r?.parameters?.viewport)if(r?.framebuffer){let{width:i,height:o}=r.framebuffer;n=[0,0,i,o]}else{let[i,o]=e.getCanvasContext().getDrawingBufferSize();n=[0,0,i,o]}if(this.device.pushState(),this.setParameters({viewport:n,...this.props.parameters}),this.props.framebuffer){let i=this.props.framebuffer.colorAttachments.map((o,s)=>36064+s);this.device.gl.drawBuffers(i)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){let r={...this.glParameters};r.framebuffer=this.props.framebuffer||null,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=ome.map(n=>Boolean(n&e.colorMask))),this.glParameters=r,Mh(this.device.gl,r)}beginOcclusionQuery(e){this.props.occlusionQuerySet?.beginOcclusionQuery()}endOcclusionQuery(){this.props.occlusionQuerySet?.endOcclusionQuery()}clear(){let e={...this.glParameters},r=0;this.props.clearColors&&this.props.clearColors.forEach((n,i)=>{n&&this.clearColorBuffer(i,n)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(r|=16384,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=256,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=1024,e.clearStencil=this.props.clearStencil),r!==0&&KA(this.device.gl,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(e=0,r=[0,0,0,0]){KA(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,e,r);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,e,r);break;case Float32Array:this.device.gl.clearBufferfv(6144,e,r);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}};function y7(t){return sme.includes(t)}var sme=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],x7={[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 kO(t){let e=x7[t];if(!e)throw new Error("uniform");let[r,n,,i]=e;return{format:i,components:n,glType:r}}function v7(t){let e=x7[t];if(!e)throw new Error("attribute");let[,r,,n,i]=e;return{attributeType:n,vertexFormat:i,components:r}}function b7(t,e){let r={attributes:[],bindings:[]};r.attributes=ame(t,e);let n=ume(t,e);for(let c of n){let l=c.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));r.bindings.push({type:"uniform",name:c.name,group:0,location:c.location,visibility:(c.vertex?1:0)&(c.fragment?2:0),minBindingSize:c.byteLength,uniforms:l})}let i=lme(t,e),o=0;for(let c of i)if(y7(c.type)){let{viewDimension:l,sampleType:h}=fme(c.type);r.bindings.push({type:"texture",name:c.name,group:0,location:o,viewDimension:l,sampleType:h}),c.textureUnit=o,o+=1}i.length&&(r.uniforms=i);let s=cme(t,e);return s?.length&&(r.varyings=s),r}function ame(t,e){let r=[],n=t.getProgramParameter(e,35721);for(let i=0;i<n;i++){let o=t.getActiveAttrib(e,i);if(!o)throw new Error("activeInfo");let{name:s,type:c}=o,l=t.getAttribLocation(e,s);if(l>=0){let{attributeType:h}=v7(c),p=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:l,stepMode:p,type:h})}}return r.sort((i,o)=>i.location-o.location),r}function cme(t,e){let r=[],n=t.getProgramParameter(e,35971);for(let i=0;i<n;i++){let o=t.getTransformFeedbackVarying(e,i);if(!o)throw new Error("activeInfo");let{name:s,type:c,size:l}=o,{glType:h,components:p}=kO(c),x={location:i,name:s,type:h,size:l*p};r.push(x)}return r.sort((i,o)=>i.location-o.location),r}function lme(t,e){let r=[],n=t.getProgramParameter(e,35718);for(let i=0;i<n;i++){let o=t.getActiveUniform(e,i);if(!o)throw new Error("activeInfo");let{name:s,size:c,type:l}=o,{name:h,isArray:p}=pme(s),x=t.getUniformLocation(e,h),w={location:x,name:h,size:c,type:l,isArray:p};if(r.push(w),w.size>1)for(let E=0;E<w.size;E++){let P=`${h}[${E}]`;x=t.getUniformLocation(e,P);let B={...w,name:P,location:x};r.push(B)}}return r}function ume(t,e){let r=(o,s)=>t.getActiveUniformBlockParameter(e,o,s),n=[],i=t.getProgramParameter(e,35382);for(let o=0;o<i;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:[]},c=r(o,35395)||[],l=t.getActiveUniforms(e,c,35383),h=t.getActiveUniforms(e,c,35384),p=t.getActiveUniforms(e,c,35387),x=t.getActiveUniforms(e,c,35388);for(let w=0;w<s.uniformCount;++w){let E=t.getActiveUniform(e,c[w]);if(!E)throw new Error("activeInfo");s.uniforms.push({name:E.name,format:kO(l[w]).format,type:l[w],arrayLength:h[w],byteOffset:p[w],byteStride:x[w]})}n.push(s)}return n.sort((o,s)=>o.location-s.location),n}var hme={[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 fme(t){let e=hme[t];if(!e)throw new Error("sampler");let[r,n]=e;return{viewDimension:r,sampleType:n}}function pme(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 w7(t,e,r,n){let i=t,o=n;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 n!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,n);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 i.uniform1uiv(e,s,1);case 36294:return i.uniform2uiv(e,s,2);case 36295:return i.uniform3uiv(e,s,3);case 36296:return i.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 i.uniformMatrix2x3fv(e,!1,s);case 35686:return i.uniformMatrix2x4fv(e,!1,s);case 35687:return i.uniformMatrix3x2fv(e,!1,s);case 35688:return i.uniformMatrix3x4fv(e,!1,s);case 35689:return i.uniformMatrix4x2fv(e,!1,s);case 35690:return i.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function T7(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function E7(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number":!1}function Rv(t){return T7(t)||E7(t)}function dme(t){return Rv(t)!==null||typeof t=="number"||typeof t=="boolean"}function M7(t){let e={bindings:{},uniforms:{}};return Object.keys(t).forEach(r=>{let n=t[r];dme(n)?e.uniforms[r]=n:e.bindings[r]=n}),e}function S7(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(t)}}function C7(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;default:throw new Error(t)}}var P7=4,aM=class extends Eh{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:n,bufferMode:i=35981}=r;n&&n.length>0&&(this.varyings=n,this.device.gl.transformFeedbackVaryings(this.handle,n,i)),this._linkShaders(),qt.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=b7(this.device.gl,this.handle),qt.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=mme(this.introspectedLayout,r.shaderLayout)}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e,r){for(let[n,i]of Object.entries(e)){let o=this.shaderLayout.bindings.find(s=>s.name===n)||this.shaderLayout.bindings.find(s=>s.name===`${n}Uniforms`);if(!o){let s=this.shaderLayout.bindings.map(c=>`"${c.name}"`).join(", ");r?.disableWarnings||qt.warn(`No binding "${n}" in render pipeline "${this.id}", expected one of ${s}`,i)();continue}switch(i||qt.warn(`Unsetting binding "${n}" in render pipeline "${this.id}"`)(),o.type){case"uniform":if(!(i instanceof Ch)&&!(i.buffer instanceof Ch))throw new Error("buffer value");break;case"texture":if(!(i instanceof kf||i instanceof Ff||i instanceof Nf))throw new Error("texture value");break;case"sampler":qt.warn(`Ignoring sampler ${n}`)();break;default:throw new Error(o.type)}this.bindings[n]=i}}draw(e){let{renderPass:r,parameters:n=this.props.parameters,topology:i=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:c,isInstanced:l=!1,firstVertex:h=0,transformFeedback:p}=e,x=S7(i),w=Boolean(o.indexBuffer),E=o.indexBuffer?.glIndexType;if(this.linkStatus!=="success")return qt.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return qt.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),o.bindBeforeRender(r),p&&p.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let P=r;return l7(this.device,n,P.glParameters,()=>{w&&l?this.device.gl.drawElementsInstanced(x,s||0,E,h,c||0):w?this.device.gl.drawElements(x,s||0,E,h):l?this.device.gl.drawArraysInstanced(x,h,s||0,c||0):this.device.gl.drawArrays(x,h,s||0),p&&p.end()}),o.unbindAfterRender(r),!0}setUniformsWebGL(e){let{bindings:r}=M7(e);Object.keys(r).forEach(n=>{qt.warn(`Unsupported value "${JSON.stringify(r[n])}" used in setUniforms() for key ${n}. 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),qt.time(P7,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),qt.timeEnd(P7,`linkProgram for ${this.id}`)(),qt.level,!this.device.features.has("compilation-status-async-webgl")){let n=this._getLinkStatus();this._reportLinkStatus(n);return}qt.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),qt.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();let r=this._getLinkStatus();this._reportLinkStatus(r)}async _reportLinkStatus(e){switch(e){case"success":return;default:switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`);case"pending":this.vs.asyncCompilationStatus.then(()=>this.vs.debugShader());break;case"success":break}switch(this.fs?.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`);case"pending":this.fs.asyncCompilationStatus.then(()=>this.fs.debugShader());break;case"success":break}let r=this.device.gl.getProgramInfoLog(this.handle);throw new Error(`Error during ${e}: ${r}`)}}_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 i=>await new Promise(o=>setTimeout(o,i));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:n}=this.device;for(;;){if(n.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(let r of this.shaderLayout.bindings)!this.bindings[r.name]&&!this.bindings[r.name.replace(/Uniforms$/,"")]&&(qt.warn(`Binding ${r.name} not found in ${this.id}`)(),e=!1);return e}_applyBindings(){if(this.linkStatus!=="success")return;let{gl:e}=this.device;e.useProgram(this.handle);let r=0,n=0;for(let i of this.shaderLayout.bindings){let o=this.bindings[i.name]||this.bindings[i.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${i.name} in ${this.id}`);switch(i.type){case"uniform":let{name:s}=i,c=e.getUniformBlockIndex(this.handle,s);if(c===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,n,c),o instanceof Ch?e.bindBufferBase(35345,n,o.handle):e.bindBufferRange(35345,n,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),n+=1;break;case"texture":if(!(o instanceof kf||o instanceof Ff||o instanceof Nf))throw new Error("texture");let l;if(o instanceof kf)l=o.texture;else if(o instanceof Ff)l=o;else if(o instanceof Nf&&o.colorAttachments[0]instanceof kf)qt.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),l=o.colorAttachments[0].texture;else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(l.glTarget,l.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${i.type}' not supported in WebGL`)}}}_applyUniforms(){for(let e of this.shaderLayout.uniforms||[]){let{name:r,location:n,type:i,textureUnit:o}=e,s=this.uniforms[r]??o;s!==void 0&&w7(this.device.gl,n,i,s)}}};function mme(t,e){let r={...t,attributes:t.attributes.map(n=>({...n}))};for(let n of e?.attributes||[]){let i=r.attributes.find(o=>o.name===n.name);i?(i.type=n.type||i.type,i.stepMode=n.stepMode||i.stepMode):qt.warn(`shader layout attribute ${n.name} not present in shader`)}return r}var cM=class extends T_{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":Ame(this.device,r.options);break;case"copy-buffer-to-texture":gme(this.device,r.options);break;case"copy-texture-to-buffer":_me(this.device,r.options);break;case"copy-texture-to-texture":yme(this.device,r.options);break;default:throw new Error(r.name)}}};function Ame(t,e){let r=e.sourceBuffer,n=e.destinationBuffer;t.gl.bindBuffer(36662,r.handle),t.gl.bindBuffer(36663,n.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 gme(t,e){throw new Error("Not implemented")}function _me(t,e){let{sourceTexture:r,mipLevel:n=0,aspect:i="all",width:o=e.sourceTexture.width,height:s=e.sourceTexture.height,depthOrArrayLayers:c=0,origin:l=[0,0],destinationBuffer:h,byteOffset:p=0,bytesPerRow:x,rowsPerImage:w}=e;if(i!=="all")throw new Error("aspect not supported in WebGL");if(n!==0||c!==0||x||w)throw new Error("not implemented");let{framebuffer:E,destroyFramebuffer:P}=I7(r),B;try{let D=h,W=o||E.width,X=s||E.height,q=ZE(E.colorAttachments[0].texture.props.format),$=q.format,te=q.type;t.gl.bindBuffer(35051,D.handle),B=t.gl.bindFramebuffer(36160,E.handle),t.gl.readPixels(l[0],l[1],W,X,$,te,p)}finally{t.gl.bindBuffer(35051,null),B!==void 0&&t.gl.bindFramebuffer(36160,B),P&&E.destroy()}}function yme(t,e){let{sourceTexture:r,destinationMipLevel:n=0,origin:i=[0,0],destinationOrigin:o=[0,0],destinationTexture:s}=e,{width:c=e.destinationTexture.width,height:l=e.destinationTexture.height}=e,{framebuffer:h,destroyFramebuffer:p}=I7(r),[x,w]=i,[E,P,B]=o,D=t.gl.bindFramebuffer(36160,h.handle),W=null,X;if(s instanceof Ff)W=s,c=Number.isFinite(c)?c:W.width,l=Number.isFinite(l)?l:W.height,W.bind(0),X=W.glTarget;else throw new Error("invalid destination");switch(X){case 3553:case 34067:t.gl.copyTexSubImage2D(X,n,E,P,x,w,c,l);break;case 35866:case 32879:t.gl.copyTexSubImage3D(X,n,E,P,B,x,w,c,l);break;default:}W&&W.unbind(),t.gl.bindFramebuffer(36160,D),p&&h.destroy()}function I7(t){if(t instanceof fi){let{width:e,height:r,id:n}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${n}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var lM=class extends w_{device;commandBuffer;constructor(e,r){super(e,r),this.device=e,this.commandBuffer=new cM(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,n){}};function R7(t){let{target:e,source:r,start:n=0,count:i=1}=t,o=r.length,s=i*o,c=0;for(let l=n;c<o;c++)e[l++]=r[c];for(;c<s;)c<s-c?(e.copyWithin(n+c,n,n+c),c*=2):(e.copyWithin(n+c,n,n+s-c),c=s);return t.target}var R_=class extends E_{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(e){return ML()==="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 n=r;if(n.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:i,type:o,stride:s,offset:c,normalized:l,integer:h,divisor:p}=this._getAccessor(e);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,n.handle),h?this.device.gl.vertexAttribIPointer(e,i,o,s,c):this.device.gl.vertexAttribPointer(e,i,o,l,s,c),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(e),this.device.gl.vertexAttribDivisor(e,p||0),this.attributes[e]=n,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 n=YE(r.bufferDataType);return{size:r.bufferComponents,type:n,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e,r=!0){let i=R_.isConstantAttributeZeroSupported(this.device)||e!==0;(r||i)&&(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 n=xme(r),i=n.byteLength*e,o=n.length*e;if(this.buffer&&i!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${i} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:i}),s=s||!vme(n,this.bufferValue),s){let c=TO(r.constructor,o);R7({target:c,source:n,start:0,count:o}),this.buffer.write(c),this.bufferValue=r}return this.buffer}};function xme(t){return Array.isArray(t)?new Float32Array(t):t}function vme(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 uM=class extends M_{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(C7(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 n=this._getVaryingIndex(e),{buffer:i,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(n<0){this.unusedBuffers[e]=i,qt.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[n]={buffer:i,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(n,i,s,o)}getBuffer(e){if(L7(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 Ch)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:n=0,byteLength:i=e.buffer.byteLength}=e;return{buffer:r,byteOffset:n,byteLength:i}}_getVaryingIndex(e){if(L7(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:n,byteOffset:i}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,i,n)}}_unbindBuffers(){for(let e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r,n=0,i){let o=r&&r.handle;!o||i===void 0?this.gl.bindBufferBase(35982,e,o):this.gl.bindBufferRange(35982,e,o,n,i)}};function L7(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}var hM=class extends S_{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((n,i)=>{let o=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):r++>e?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(o)};requestAnimationFrame(o)}),this._pollingPromise}};var Na=class extends hl{type="webgl";handle;features;limits;info;canvasContext;lost;_resolveContextLost;gl;debug=!1;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};_extensions={};_polyfilled=!1;spectorJS;constructor(e){super({...e,id:e.id||o7("webgl-device")});let r=hl._getCanvasContextProps(e);if(!r)throw new Error("WebGLDevice requires props.createCanvasContext to be set");let n=r.canvas?.gl?.device;if(n)throw new Error(`WebGL context already attached to device ${n.id}`);this.canvasContext=new JE(this,r),this.lost=new Promise(p=>{this._resolveContextLost=p});let i={...e.webgl};r.alphaMode==="premultiplied"&&(i.premultipliedAlpha=!0),e.powerPreference!==void 0&&(i.powerPreference=e.powerPreference);let s=this.props._handle||j9(this.canvasContext.canvas,{onContextLost:p=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."}),onContextRestored:p=>console.log("WebGL context restored")},i);if(!s)throw new Error("WebGL context creation failed");if(n=s.device,n){if(e._reuseDevices)return qt.log(1,`Not creating a new Device, instead returning a reference to Device ${n.id} already attached to WebGL context`,n)(),n._reused=!0,n;throw new Error(`WebGL context already attached to device ${n.id}`)}this.handle=s,this.gl=s,this.spectorJS=e7({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=H9(this.gl,this._extensions),this.limits=new QE(this.gl),this.features=new $E(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),r.autoResize!==!1&&this.canvasContext.resize(),new Sh(this.gl,{log:(...p)=>qt.log(1,...p)()}).trackState(this.gl,{copyState:!1});let l=e.debugWebGL||e.debug,h=e.debugWebGL;l&&(this.gl=i7(this.gl,{debugWebGL:l,traceWebGL:h}),qt.warn("WebGL debug mode activated. Performance reduced.")(),e.debugWebGL&&(qt.level=Math.max(qt.level,1)))}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._normalizeBufferProps(e);return new Ch(this,r)}createTexture(e){return new Ff(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new YA(this,e)}createShader(e){return new rM(this,e)}createFramebuffer(e){return new Nf(this,e)}createVertexArray(e){return new R_(this,e)}createTransformFeedback(e){return new uM(this,e)}createQuerySet(e){return new hM(this,e)}createRenderPipeline(e){return new aM(this,e)}beginRenderPass(e){return new sM(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 lM(this,e)}submit(){this.renderPass?.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return A7(e,r)}readPixelsToBufferWebGL(e,r){return g7(e,r)}setParametersWebGL(e){Mh(this.gl,e)}getParametersWebGL(e){return XE(this.gl,e)}withParametersWebGL(e,r){return KA(this.gl,e,r)}resetWebGL(){qt.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),z9(this.gl)}_getDeviceSpecificTextureFormatCapabilities(e){return K9(this.gl,e,this._extensions)}loseDevice(){let e=!1,n=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return n&&(e=!0,n.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),e}pushState(){Sh.get(this.gl).push()}popState(){Sh.get(this.gl).pop()}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){let n=Number(e);for(let i in this.gl)if(this.gl[i]===n)return`GL.${i}`;return r?.emptyIfUnknown?"":String(e)}getGLKeys(e){let r={emptyIfUnknown:!0};return Object.entries(e).reduce((n,[i,o])=>(n[`${i}:${this.getGLKey(i,r)}`]=`${o}:${this.getGLKey(o,r)}`,n),{})}_constants;setConstantAttributeWebGL(e,r){let n=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(n).fill(null);let i=this._constants[e];switch(i&&Eme(i,r)&&qt.info(1,`setConstantAttributeWebGL(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:bme(this,e,r);break;case Int32Array:wme(this,e,r);break;case Uint32Array:Tme(this,e,r);break;default:throw new Error("constant")}}getExtension(e){return Df(this.gl,e,this._extensions),this._extensions}};function bme(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:}}function wme(t,e,r){t.gl.vertexAttribI4iv(e,r)}function Tme(t,e,r){t.gl.vertexAttribI4uiv(e,r)}function Eme(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 Mme={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},Sme=t=>({drawBuffersWEBGL(e){return t.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),Cme=t=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return t.createVertexArray()},deleteVertexArrayOES(e){return t.deleteVertexArray(e)},isVertexArrayOES(e){return t.isVertexArray(e)},bindVertexArrayOES(e){return t.bindVertexArray(e)}}),Pme=t=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return t.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return t.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return t.vertexAttribDivisor(...e)}});function O7(t=!0){let e=HTMLCanvasElement.prototype;if(!t&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(r,n){if(r==="webgl"||r==="experimental-webgl"){let i=this.originalGetContext("webgl2",n);return i instanceof HTMLElement&&Ime(i),i}return this.originalGetContext(r,n)}}function Ime(t){t.getExtension("EXT_color_buffer_float");let e={...Mme,WEBGL_disjoint_timer_query:t.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:Sme(t),OES_vertex_array_object:Cme(t),ANGLE_instanced_arrays:Pme(t)},r=t.getExtension;t.getExtension=function(i){let o=r.call(t,i);return o||(i in e?e[i]:null)};let n=t.getSupportedExtensions;t.getSupportedExtensions=function(){return(n.apply(t)||[])?.concat(Object.keys(e))}}var fM=1,FO=class extends Tv{type="webgl";constructor(){super(),hl.defaultProps={...hl.defaultProps,...tM},Na.adapter=this}isSupported(){return typeof WebGL2RenderingContext<"u"}enforceWebGL2(e){O7(e)}async attach(e){if(e instanceof Na)return e;if(e?.device instanceof hl)return e.device;if(!Rme(e))throw new Error("Invalid WebGL2RenderingContext");return new Na({_handle:e,createCanvasContext:{canvas:e.canvas,autoResize:!1}})}async create(e={}){qt.groupCollapsed(fM,"WebGLDevice created")();let r=[];(e.debugWebGL||e.debug)&&r.push(n7()),e.debugSpectorJS&&r.push(J9(e));let n=await Promise.allSettled(r);for(let s of n)s.status==="rejected"&&qt.error(`Failed to initialize debug libraries ${s.reason}`)();let i=new Na(e),o=`${i._reused?"Reusing":"Created"} device with WebGL2 ${i.debug?"debug ":""}context: ${i.info.vendor}, ${i.info.renderer} for canvas: ${i.canvasContext.id}`;return qt.probe(fM,o)(),qt.table(fM,i.info)(),qt.groupEnd(fM)(),i}};function Rme(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}var pM=new FO;var B7,D7,k7={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function dM(){return document.createElement("div")}function Lme(t){if(!t.picked)return null;if(t.object===B7)return D7;let e={html:Bme(t.object),style:k7};return D7=e,B7=t.object,e}var Ome=new Set(["position","index"]);function Bme(t){let e=dM();for(let r in t){if(Ome.has(r))continue;let n=dM();n.className="header",n.textContent=r;let i=dM();i.className="value",i.textContent=Nme(t[r]);let o=dM();Dme(o,n,i),o.appendChild(n),o.appendChild(i),e.appendChild(o)}return e.innerHTML}function Dme(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 Nme(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 N7(t,e){let r,n=t,i="properties",o=/{[^}]*}/g,s=l=>l.replace(/[{}]/g,""),c=[...new Set(t.match(o).map(s))];for(let l of c){if(l.includes(".")){r=e;let h=l.split(".");for(let p of h)if(r.hasOwnProperty(p))r=r[p];else{r=void 0;break}}else e.hasOwnProperty(l)?r=e[l]:e[i]&&e[i].hasOwnProperty(l)?r=e[i][l]:r=void 0;n=n.replaceAll(`{${l}}`,r)}return n}function zO(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||k7};return t.html?r.html=N7(t.html,e.object):r.text=N7(t.text,e.object),r}:Lme:null}function F7(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function z7(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 V7=ec(U7()),kme="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",jO=V7.default;function j7(t=kme){F7(t)}function H7(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var HO={};function W7(t){if(!HO[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),HO[t]=new Promise(n=>{e.onload=n})}return HO[t]}var q7="4.2.1";var Fme=globalThis.loaders?.parseImageNode,WO=typeof Image<"u",qO=typeof ImageBitmap<"u",zme=Boolean(Fme),GO=Dp?!0:zme;function G7(t){switch(t){case"auto":return qO||WO||GO;case"imagebitmap":return qO;case"image":return WO;case"data":return GO;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function X7(){if(qO)return"imagebitmap";if(WO)return"image";if(GO)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Y7(t){let e=Ume(t);if(!e)throw new Error("Not an image");return e}function Lv(t){switch(Y7(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 Ume(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 Vme=/^data:image\/svg\+xml/,jme=/\.svg((\?|#).*)?$/;function mM(t){return t&&(Vme.test(t)||jme.test(t))}function K7(t,e){if(mM(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return XO(t,e)}function XO(t,e){if(mM(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function AM(t,e,r){let n=K7(t,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Hme(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function Hme(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}var Wme={},Z7=!0;async function $7(t,e,r){let n;mM(r)?n=await AM(t,e,r):n=XO(t,r);let i=e&&e.imagebitmap;return await qme(n,i)}async function qme(t,e=null){if((Gme(e)||!Z7)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Z7=!1}return await createImageBitmap(t)}function Gme(t){for(let e in t||Wme)return!1;return!0}function Q7(t){return!Zme(t,"ftyp",4)||!(t[8]&96)?null:Xme(t)}function Xme(t){switch(Yme(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Yme(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Kme(t){return[...t].map(e=>e.charCodeAt(0))}function Zme(t,e,r=0){let n=Kme(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var zf=!1,Ov=!0;function ZA(t){let e=Bv(t);return Qme(e)||tAe(e)||Jme(e)||eAe(e)||$me(e)}function $me(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Q7(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Qme(t){let e=Bv(t);return e.byteLength>=24&&e.getUint32(0,zf)===2303741511?{mimeType:"image/png",width:e.getUint32(16,zf),height:e.getUint32(20,zf)}:null}function Jme(t){let e=Bv(t);return e.byteLength>=10&&e.getUint32(0,zf)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Ov),height:e.getUint16(8,Ov)}:null}function eAe(t){let e=Bv(t);return e.byteLength>=14&&e.getUint16(0,zf)===16973&&e.getUint32(2,Ov)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Ov),height:e.getUint32(22,Ov)}:null}function tAe(t){let e=Bv(t);if(!(e.byteLength>=3&&e.getUint16(0,zf)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=rAe(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,zf);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,zf),width:e.getUint16(o+7,zf)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,zf)}return null}function rAe(){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 Bv(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 J7(t,e){let{mimeType:r}=ZA(t)||{},n=globalThis.loaders?.parseImageNode;return Ti(n),await n(t,r)}async function ej(t,e,r){e=e||{};let i=(e.image||{}).type||"auto",{url:o}=r||{},s=nAe(i),c;switch(s){case"imagebitmap":c=await $7(t,e,o);break;case"image":c=await AM(t,e,o);break;case"data":c=await J7(t,e);break;default:Ti(!1)}return i==="data"&&(c=Lv(c)),c}function nAe(t){switch(t){case"auto":case"data":return X7();default:return G7(t),t}}var iAe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],oAe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],sAe={image:{type:"auto",decode:!0}},Uf={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:q7,mimeTypes:oAe,extensions:iAe,parse:ej,tests:[t=>Boolean(ZA(new DataView(t)))],options:sAe};var YO={};function KO(t){if(YO[t]===void 0){let e=Dp?cAe(t):aAe(t);YO[t]=e}return YO[t]}function aAe(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(t)}function cAe(t){switch(t){case"image/avif":case"image/webp":return lAe(t);default:return!0}}function lAe(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var uAe=new Dl({id:"deck"}),br=uAe;var ZO={};function tj(t){ZO=t}function qs(t,e,r,n){br.level>0&&ZO[t]&&ZO[t].call(null,e,r,n)}function hAe(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var rj={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:hAe,parseTextSync:JSON.parse};function fAe(){let t="9.1.3",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(br.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:br,_registerLoggers:tj},HA([rj,[Uf,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var gM=fAe();function _M(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var $O={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 ij(t){let e={};for(let[r,n]of Object.entries(t))e[r]=pAe(n);return e}function pAe(t){let e=nj(t);if(e!=="object")return{value:t,...$O[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...$O[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=nj(t.value),{...t,...$O[e],type:e}):{type:"object",value:null};throw new Error("props")}function nj(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var oj=`#ifdef MODULE_LOGDEPTH
552
552
  logdepth_adjustPosition(gl_Position);
553
553
  #endif
554
554
  `,sj=`#ifdef MODULE_MATERIAL
@@ -4462,7 +4462,10 @@ out vec2 clip_commonPosition;
4462
4462
  in vec2 clip_commonPosition;
4463
4463
  `,"fs:DECKGL_FILTER_COLOR":`
4464
4464
  if (!clip_isInBounds(clip_commonPosition)) discard;
4465
- `},Iw=class extends QS{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:[iBe],inject:oBe}:{modules:[sBe],inject:aBe}}draw(){let{clipBounds:e}=this.props,r={};if(this.state.clipByInstance)r.bounds=e;else{let n=this.projectPosition([e[0],e[1],0]),i=this.projectPosition([e[2],e[3],0]);r.bounds=[Math.min(n[0],i[0]),Math.min(n[1],i[1]),Math.max(n[0],i[0]),Math.max(n[1],i[1])]}this.setShaderModuleProps({clip:r})}};Iw.defaultProps=nBe;Iw.extensionName="ClipExtension";var y5=Iw;var Rw={x:0,y:1,z:2};function rg(t,e={}){let{start:r=0,end:n=t.length,plane:i="xy"}=e,o=e.size||2,s=0,c=Rw[i[0]],l=Rw[i[1]];for(let h=r,p=n-o;h<n;h+=o)s+=(t[h+c]-t[p+c])*(t[h+l]+t[p+l]),p=h;return s/2}function v5(t,e,r=2,n,i="xy"){let o=e&&e.length,s=o?e[0]*r:t.length,c=uie(t,0,s,r,!0,n&&n[0],i),l=[];if(!c||c.next===c.prev)return l;let h,p,x,w,E,P,B;if(o&&(c=dBe(t,e,c,r,n,i)),t.length>80*r){w=p=t[0],E=x=t[1];for(let D=r;D<s;D+=r)P=t[D],B=t[D+1],P<w&&(w=P),B<E&&(E=B),P>p&&(p=P),B>x&&(x=B);h=Math.max(p-w,x-E),h=h!==0?32767/h:0}return Lw(c,l,r,w,E,h,0),l}function uie(t,e,r,n,i,o,s){let c,l;o===void 0&&(o=rg(t,{start:e,end:r,size:n,plane:s}));let h=Rw[s[0]],p=Rw[s[1]];if(i===o<0)for(c=e;c<r;c+=n)l=lie(c,t[c+h],t[c+p],l);else for(c=r-n;c>=e;c-=n)l=lie(c,t[c+h],t[c+p],l);return l&&JP(l,l.next)&&(Bw(l),l=l.next),l}function ng(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(JP(r,r.next)||Bs(r.prev,r,r.next)===0)){if(Bw(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function Lw(t,e,r,n,i,o,s){if(!t)return;!s&&o&&yBe(t,n,i,o);let c=t,l,h;for(;t.prev!==t.next;){if(l=t.prev,h=t.next,o?hBe(t,n,i,o):uBe(t)){e.push(l.i/r|0),e.push(t.i/r|0),e.push(h.i/r|0),Bw(t),t=h.next,c=h.next;continue}if(t=h,t===c){s?s===1?(t=fBe(ng(t),e,r),Lw(t,e,r,n,i,o,2)):s===2&&pBe(t,e,r,n,i,o):Lw(ng(t),e,r,n,i,o,1);break}}}function uBe(t){let e=t.prev,r=t,n=t.next;if(Bs(e,r,n)>=0)return!1;let i=e.x,o=r.x,s=n.x,c=e.y,l=r.y,h=n.y,p=i<o?i<s?i:s:o<s?o:s,x=c<l?c<h?c:h:l<h?l:h,w=i>o?i>s?i:s:o>s?o:s,E=c>l?c>h?c:h:l>h?l:h,P=n.next;for(;P!==e;){if(P.x>=p&&P.x<=w&&P.y>=x&&P.y<=E&&T1(i,c,o,l,s,h,P.x,P.y)&&Bs(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function hBe(t,e,r,n){let i=t.prev,o=t,s=t.next;if(Bs(i,o,s)>=0)return!1;let c=i.x,l=o.x,h=s.x,p=i.y,x=o.y,w=s.y,E=c<l?c<h?c:h:l<h?l:h,P=p<x?p<w?p:w:x<w?x:w,B=c>l?c>h?c:h:l>h?l:h,D=p>x?p>w?p:w:x>w?x:w,W=x5(E,P,e,r,n),X=x5(B,D,e,r,n),q=t.prevZ,$=t.nextZ;for(;q&&q.z>=W&&$&&$.z<=X;){if(q.x>=E&&q.x<=B&&q.y>=P&&q.y<=D&&q!==i&&q!==s&&T1(c,p,l,x,h,w,q.x,q.y)&&Bs(q.prev,q,q.next)>=0||(q=q.prevZ,$.x>=E&&$.x<=B&&$.y>=P&&$.y<=D&&$!==i&&$!==s&&T1(c,p,l,x,h,w,$.x,$.y)&&Bs($.prev,$,$.next)>=0))return!1;$=$.nextZ}for(;q&&q.z>=W;){if(q.x>=E&&q.x<=B&&q.y>=P&&q.y<=D&&q!==i&&q!==s&&T1(c,p,l,x,h,w,q.x,q.y)&&Bs(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;$&&$.z<=X;){if($.x>=E&&$.x<=B&&$.y>=P&&$.y<=D&&$!==i&&$!==s&&T1(c,p,l,x,h,w,$.x,$.y)&&Bs($.prev,$,$.next)>=0)return!1;$=$.nextZ}return!0}function fBe(t,e,r){let n=t;do{let i=n.prev,o=n.next.next;!JP(i,o)&&hie(i,n,n.next,o)&&Ow(i,o)&&Ow(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),Bw(n),Bw(n.next),n=t=o),n=n.next}while(n!==t);return ng(n)}function pBe(t,e,r,n,i,o){let s=t;do{let c=s.next.next;for(;c!==s.prev;){if(s.i!==c.i&&bBe(s,c)){let l=fie(s,c);s=ng(s,s.next),l=ng(l,l.next),Lw(s,e,r,n,i,o,0),Lw(l,e,r,n,i,o,0);return}c=c.next}s=s.next}while(s!==t)}function dBe(t,e,r,n,i,o){let s=[],c,l,h,p,x;for(c=0,l=e.length;c<l;c++)h=e[c]*n,p=c<l-1?e[c+1]*n:t.length,x=uie(t,h,p,n,!1,i&&i[c+1],o),x===x.next&&(x.steiner=!0),s.push(vBe(x));for(s.sort(mBe),c=0;c<s.length;c++)r=ABe(s[c],r);return r}function mBe(t,e){return t.x-e.x}function ABe(t,e){let r=gBe(t,e);if(!r)return e;let n=fie(r,t);return ng(n,n.next),ng(r,r.next)}function gBe(t,e){let r=e,n=t.x,i=t.y,o=-1/0,s;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let w=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(w<=n&&w>o&&(o=w,s=r.x<r.next.x?r:r.next,w===n))return s}r=r.next}while(r!==e);if(!s)return null;let c=s,l=s.x,h=s.y,p=1/0,x;r=s;do n>=r.x&&r.x>=l&&n!==r.x&&T1(i<h?n:o,i,l,h,i<h?o:n,i,r.x,r.y)&&(x=Math.abs(i-r.y)/(n-r.x),Ow(r,t)&&(x<p||x===p&&(r.x>s.x||r.x===s.x&&_Be(s,r)))&&(s=r,p=x)),r=r.next;while(r!==c);return s}function _Be(t,e){return Bs(t.prev,t,e.prev)<0&&Bs(e.next,t,t.next)<0}function yBe(t,e,r,n){let i=t;do i.z===0&&(i.z=x5(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,xBe(i)}function xBe(t){let e,r,n=1,i,o,s,c,l,h;do{for(o=t,t=null,h=null,i=0;o;){for(i++,c=o,s=0,r=0;r<n&&(s++,c=c.nextZ,!!c);r++);for(l=n;s>0||l>0&&c;)s!==0&&(l===0||!c||o.z<=c.z)?(e=o,o=o.nextZ,s--):(e=c,c=c.nextZ,l--),h?h.nextZ=e:t=e,e.prevZ=h,h=e;o=c}h.nextZ=null,n*=2}while(i>1);return t}function x5(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function vBe(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function T1(t,e,r,n,i,o,s,c){return(i-s)*(e-c)>=(t-s)*(o-c)&&(t-s)*(n-c)>=(r-s)*(e-c)&&(r-s)*(o-c)>=(i-s)*(n-c)}function bBe(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!wBe(t,e)&&(Ow(t,e)&&Ow(e,t)&&TBe(t,e)&&(Bs(t.prev,t,e.prev)||Bs(t,e.prev,e))||JP(t,e)&&Bs(t.prev,t,t.next)>0&&Bs(e.prev,e,e.next)>0)}function Bs(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function JP(t,e){return t.x===e.x&&t.y===e.y}function hie(t,e,r,n){let i=QP(Bs(t,e,r)),o=QP(Bs(t,e,n)),s=QP(Bs(r,n,t)),c=QP(Bs(r,n,e));return!!(i!==o&&s!==c||i===0&&$P(t,r,e)||o===0&&$P(t,n,e)||s===0&&$P(r,t,n)||c===0&&$P(r,e,n))}function $P(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function QP(t){return t>0?1:t<0?-1:0}function wBe(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&hie(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Ow(t,e){return Bs(t.prev,t,t.next)<0?Bs(t,e,t.next)>=0&&Bs(t,t.prev,e)>=0:Bs(t,e,t.prev)<0||Bs(t,t.next,e)<0}function TBe(t,e){let r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function fie(t,e){let r=new Dw(t.i,t.x,t.y),n=new Dw(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function lie(t,e,r,n){let i=new Dw(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Bw(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}var Dw=class{constructor(e,r,n){this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1,this.i=e,this.x=r,this.y=n}};function T5(t,e,r){let n=PBe(t),i=Object.keys(n).filter(o=>n[o]!==Array);return IBe(t,{propArrayTypes:n,...e},{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function PBe(t){let e={};for(let r of t)if(r.properties)for(let n in r.properties){let i=r.properties[n];e[n]=NBe(i,e[n])}return e}function IBe(t,e,r){let{pointPositionsCount:n,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:c,polygonPositionsCount:l,polygonObjectsCount:h,polygonRingsCount:p,polygonFeaturesCount:x,propArrayTypes:w,coordLength:E}=e,{numericPropKeys:P=[],PositionDataType:B=Float32Array,triangulate:D=!0}=r,W=t[0]&&"id"in t[0],X=t.length>65535?Uint32Array:Uint16Array,q={type:"Point",positions:new B(n*E),globalFeatureIds:new X(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},$={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new B(o*E),globalFeatureIds:new X(o),featureIds:c>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},te={type:"Polygon",polygonIndices:l>65535?new Uint32Array(h+1):new Uint16Array(h+1),primitivePolygonIndices:l>65535?new Uint32Array(p+1):new Uint16Array(p+1),positions:new B(l*E),globalFeatureIds:new X(l),featureIds:x>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};D&&(te.triangles=[]);for(let ue of[q,$,te])for(let oe of P){let J=w[oe];ue.numericProps[oe]=new J(ue.positions.length/E)}$.pathIndices[s]=o,te.polygonIndices[h]=l,te.primitivePolygonIndices[p]=l;let F={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let ue of t){let oe=ue.geometry,J=ue.properties||{};switch(oe.type){case"Point":RBe(oe,q,F,E,J),q.properties.push(w5(J,P)),W&&q.fields.push({id:ue.id}),F.pointFeature++;break;case"LineString":LBe(oe,$,F,E,J),$.properties.push(w5(J,P)),W&&$.fields.push({id:ue.id}),F.lineFeature++;break;case"Polygon":OBe(oe,te,F,E,J),te.properties.push(w5(J,P)),W&&te.fields.push({id:ue.id}),F.polygonFeature++;break;default:throw new Error("Invalid geometry type")}F.feature++}return DBe(q,$,te,E)}function RBe(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);let o=t.data.length/n;E5(e,i,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 LBe(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);let o=t.data.length/n;E5(e,i,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,c=t.indices.length;s<c;++s){let l=t.indices[s],h=s===c-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(h-l)/n}}function OBe(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);let o=t.data.length/n;E5(e,i,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,c=t.indices.length;s<c;++s){let l=r.polygonPosition;e.polygonIndices[r.polygonObject++]=l;let h=t.areas[s],p=t.indices[s],x=t.indices[s+1];for(let E=0,P=p.length;E<P;++E){let B=p[E],D=E===P-1?x===void 0?t.data.length:x[0]:p[E+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(D-B)/n}let w=r.polygonPosition;BBe(e,h,p,{startPosition:l,endPosition:w,coordLength:n})}}function BBe(t,e,r,{startPosition:n,endPosition:i,coordLength:o}){if(!t.triangles)return;let s=n*o,c=i*o,l=t.positions.subarray(s,c),h=r[0],p=r.slice(1).map(w=>(w-h)/o),x=v5(l,p,o,e);for(let w=0,E=x.length;w<E;++w)t.triangles.push(n+x[w])}function b5(t,e){let r={};for(let n in t)r[n]={value:t[n],size:e};return r}function DBe(t,e,r,n){let i={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:b5(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:b5(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:n},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:b5(r.numericProps,1)}};return i.polygons&&r.triangles&&(i.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),i}function E5(t,e,r,n){for(let i in t.numericProps)if(i in e){let o=e[i];t.numericProps[i].fill(o,r,r+n)}}function w5(t,e){let r={};for(let n in t)e.includes(n)||(r[n]=t[n]);return r}function NBe(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function rI(t,e){let r=e?.globalFeatureId;return r!==void 0?kBe(t,r):FBe(t,e?.type)}function kBe(t,e){let r=Aie(t);for(let n of r){let i=0,o=n.featureIds.value[0];for(let s=0;s<n.featureIds.value.length;s++){let c=n.featureIds.value[s];if(c!==o){if(e===n.globalFeatureIds.value[i])return eI(n,i,s);i=s,o=c}}if(e===n.globalFeatureIds.value[i])return eI(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function FBe(t,e){let r=Aie(t,e);return zBe(r)}function mie(t,e,r){switch(t.type){case"Point":return HBe(t,e,r);case"LineString":return jBe(t,e,r);case"Polygon":return gie(t,e,r);default:let n=t;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Aie(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 zBe(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==i&&(e.push(eI(r,n,o)),n=o,i=s)}e.push(eI(r,n,r.featureIds.value.length))}return e}function eI(t,e,r){let n=mie(t,e,r),i=VBe(t,e,r),o=UBe(t,e,r);return{type:"Feature",geometry:n,properties:i,...o}}function UBe(t,e=0,r){return t.fields&&t.fields[t.featureIds.value[e]]}function VBe(t,e=0,r){let n=Object.assign({},t.properties[t.featureIds.value[e]]);for(let i in t.numericProps)n[i]=t.numericProps[i].value[e];return n}function gie(t,e=-1/0,r=1/0){let{positions:n}=t,i=t.polygonIndices.value.filter(l=>l>=e&&l<=r),o=t.primitivePolygonIndices.value.filter(l=>l>=e&&l<=r);if(!(i.length>2)){let l=[];for(let h=0;h<o.length-1;h++){let p=o[h],x=o[h+1],w=tI(n,p,x);l.push(w)}return{type:"Polygon",coordinates:l}}let c=[];for(let l=0;l<i.length-1;l++){let h=i[l],p=i[l+1],x=gie(t,h,p).coordinates;c.push(x)}return{type:"MultiPolygon",coordinates:c}}function jBe(t,e=-1/0,r=1/0){let{positions:n}=t,i=t.pathIndices.value.filter(c=>c>=e&&c<=r);if(!(i.length>2))return{type:"LineString",coordinates:tI(n,i[0],i[1])};let s=[];for(let c=0;c<i.length-1;c++){let l=tI(n,i[c],i[c+1]);s.push(l)}return{type:"MultiLineString",coordinates:s}}function HBe(t,e,r){let{positions:n}=t,i=tI(n,e,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function tI(t,e,r){e=e||0,r=r||t.value.length/t.size;let n=[];for(let i=e;i<r;i++){let o=Array();for(let s=i*t.size;s<(i+1)*t.size;s++)o.push(Number(t.value[s]));n.push(o)}return n}var L5=ec(Tie(),1);function Eie(t){let e=t.length;if(e<=1)return[t];let r=[],n,i;for(let o=0;o<e;o++){let s=a4e(t[o]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&r.push(n),r}function a4e(t){let e=0;for(let r=0,n=t.length-1,i,o;r<t.length;n=r++)i=t[r],o=t[n],e+=(o[0]-i[0])*(i[1]+o[1]);return e}function Mie(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?c4e(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function c4e(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var S1=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,n,i,o){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(Mie,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,c=[],l;for(;e.pos<r;){if(i<=0){let h=e.readVarint();n=h&7,i=h>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),n===1&&(l&&c.push(l),l=[]),l&&l.push([o,s]);else if(n===7)l&&l.push(l[0].slice());else throw new Error(`unknown command ${n}`)}return l&&c.push(l),c}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,c=1/0,l=-1/0,h=1/0,p=-1/0;for(;e.pos<r;){if(i<=0){let x=e.readVarint();n=x&7,i=x>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),o<c&&(c=o),o>l&&(l=o),s<h&&(h=s),s>p&&(p=s);else if(n!==7)throw new Error(`unknown command ${n}`)}return[c,h,l,p]}_toGeoJSON(e){let r=this.loadGeometry(),n=S1.types[this.type],i,o;switch(this.type){case 1:let c=[];for(i=0;i<r.length;i++)c[i]=r[i][0];r=c,e(r,this);break;case 2:for(i=0;i<r.length;i++)e(r[i],this);break;case 3:for(r=Eie(r),i=0;i<r.length;i++)for(o=0;o<r[i].length;o++)e(r[i][o],this);break}r.length===1?r=r[0]:n=`Multi${n}`;let s={type:"Feature",geometry:{type:n,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:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,c=this.extent*n;function l(h){for(let p=0;p<h.length;p++){let x=h[p];x[0]=(x[0]+s)*360/o-180;let w=180-(x[1]+c)*360/o;x[1]=360/Math.PI*Math.atan(Math.exp(w*Math.PI/180))-90}}return this._toGeoJSON(l)}};var oI=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(l4e,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 S1(this._pbf,r,this.extent,this._keys,this._values)}};function l4e(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(u4e(r)))}function u4e(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var sI=class{layers;constructor(e,r){this.layers=e.readFields(h4e,{},r)}};function h4e(t,e,r){if(t===3&&r){let n=new oI(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Sie(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[rg(t.data)]],indices:[t.indices]};let n=[],i=[],o=[],s=[],c,l=0;for(let h,p=0,x;p<e;p++){x=t.indices[p]-l,h=t.indices[p+1]-l||t.data.length;let w=t.data.slice(x,h),E=rg(w);if(E===0){let P=t.data.slice(0,x),B=t.data.slice(h);t.data=P.concat(B),l+=h-x;continue}c===void 0&&(c=E<0),c===E<0?(s.length&&(n.push(o),i.push(s)),s=[x],o=[E]):(o.push(E),s.push(x))}return o&&n.push(o),s.length&&i.push(s),{type:r,areas:n,indices:i,data:t.data}}function Cie(t,e,r,n){for(let i=0,o=t.length;i<o;i+=2){t[i]=(t[i]+e)*360/n-180;let s=180-(t[i+1]+r)*360/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function Pie(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?f4e(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function f4e(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var Iie,ig,C5,aI,P5,I5,Nw;var cI=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(e,r,n,i,o,s){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=s,e.readFields(Pie,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,Iie=e.readVarint()+e.pos,ig=1,aI=0,P5=0,I5=0,Nw=0;let r=[],n=[];for(;e.pos<Iie;)if(aI<=0&&(C5=e.readVarint(),ig=C5&7,aI=C5>>3),aI--,ig===1||ig===2)P5+=e.readSVarint(),I5+=e.readSVarint(),ig===1&&r.push(Nw),n.push(P5,I5),Nw+=2;else if(ig===7){if(Nw>0){let i=r[r.length-1];n.push(n[i],n[i+1]),Nw+=2}}else throw new Error(`unknown command ${ig}`);return{data:n,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),n;e(r.data,this);let i=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,n={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/i,n={type:"LineString",...r};break;case 3:n=Sie(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let s of n.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=n.data.length/i;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:n,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:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,c=this.extent*n;return this._toBinaryCoordinates(l=>Cie(l,s,c,o))}};var lI=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(p4e,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 n=this._pbf.readVarint()+this._pbf.pos;return new cI(this._pbf,n,this.extent,this._keys,this._values,r)}};function p4e(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(d4e(r)))}function d4e(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var uI=class{layers;constructor(e,r){this.layers=e.readFields(m4e,{},r)}};function m4e(t,e,r){if(t===3&&r){let n=new lI(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function O5(t,e){let r=g4e(e),n=e?.gis?.format||e?.mvt?.shape||e?.shape;switch(n){case"columnar-table":return{shape:"columnar-table",data:R5(t,r)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:Rie(t,r)};case"geojson":return Rie(t,r);case"binary-geometry":return R5(t,r);case"binary":return R5(t,r);default:throw new Error(n||"undefined shape")}}function R5(t,e){let[r,n]=A4e(t,e),i=T5(r,n);return i.byteLength=t.byteLength,i}function A4e(t,e){let r=[],n={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,n];let i=new uI(new L5.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(s=>{let c=i.layers[s];if(c)for(let l=0;l<c.length;l++){let h=c.feature(l,n),p=y4e(h,e,s);r.push(p)}}),[r,n]}function Rie(t,e){if(t.byteLength<=0)return[];let r=[],n=new sI(new L5.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(o=>{let s=n.layers[o];if(s)for(let c=0;c<s.length;c++){let l=s.feature(c),h=_4e(l,e,o);r.push(h)}}),r}function g4e(t){if(!t?.mvt)throw new Error("mvt options required");let e=t.mvt?.coordinates==="wgs84",{tileIndex:r}=t.mvt,n=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(e&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function _4e(t,e,r){let n=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:x4e);return e.layerProperty&&(n.properties[e.layerProperty]=r),n}function y4e(t,e,r){let n=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:v4e);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=r),n}function x4e(t,e){let{extent:r}=e;for(let n=0;n<t.length;n++){let i=t[n];i[0]/=r,i[1]/=r}}function v4e(t,e){let{extent:r}=e;for(let n=0,i=t.length;n<i;++n)t[n]/=r}var b4e="4.2.1",hI={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:b4e,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}}},w4e={...hI,parse:async(t,e)=>O5(t,e),parseSync:O5,binary:!0};var T4e={Point:Lie,MultiPoint:E4e,LineString:Oie,MultiLineString:M4e,Polygon:Bie,MultiPolygon:S4e};function Lie([t,e],[r,n],i){let o=ka(r[0],n[0],t),s=ka(r[1],n[1],e);return i.unprojectFlat([o,s])}function B5(t,e,r){return t.map(n=>Lie(n,e,r))}function E4e(t,e,r){return B5(t,e,r)}function Oie(t,e,r){return B5(t,e,r)}function M4e(t,e,r){return t.map(n=>Oie(n,e,r))}function Bie(t,e,r){return t.map(n=>B5(n,e,r))}function S4e(t,e,r){return t.map(n=>Bie(n,e,r))}function Die(t,e,r){let n=r.projectFlat([e.west,e.north]),i=r.projectFlat([e.east,e.south]),o=[n,i];return{...t,coordinates:T4e[t.type](t.coordinates,o,r)}}var C4e=["points","lines","polygons"];function D5(t,e,r,n){for(let i of C4e){let o=t[i]&&P4e(t[i],e,r,n);if(o>=0)return o}return-1}function P4e(t,e,r,n){let i=t.featureIds.value;if(!i.length)return-1;let o=0,s=i[i.length-1]+1;if(n){let l=I4e(t,n);if(l)o=l[0],s=l[1]+1;else return-1}let c=-1;if(e in t.numericProps){let l=t.numericProps[e].value.findIndex((h,p)=>h===r&&i[p]>=o&&i[p]<s);return l>=0?t.globalFeatureIds.value[l]:-1}else e?c=Nie(t.properties,l=>l[e]===r,o,s):t.fields&&(c=Nie(t.fields,l=>l.id===r,o,s));return c>=0?R4e(t,c):-1}function I4e(t,e){if(!t.__layers){let r={},{properties:n}=t;for(let i=0;i<n.length;i++){let{layerName:o}=n[i];o&&(r[o]?r[o][1]=i:r[o]=[i,i])}t.__layers=r}return t.__layers[e]}function R4e(t,e){if(!t.__ids){let r=[],n=t.featureIds.value,i=t.globalFeatureIds.value;for(let o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}function Nie(t,e,r,n){for(let i=r;i<n;i++)if(e(t[i],i))return i;return-1}var N5=512,L4e={...C0.defaultProps,data:Bm,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[hI],binary:!0},kw=class extends D0{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:n,changeFlags:i}){i.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:n,changeFlags:i}),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"&&!TN(e)){let{onDataLoad:n,fetch:i}=this.props;this.setState({data:null,tileJSON:null});try{r=await i(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}n&&n(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:n,maxZoom:i}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>n&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(i)||r.maxzoom<i)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:n}=this.state,{index:i,signal:o}=e,s=Qf(r,e);if(!s)return Promise.reject("Invalid URL");let c=this.getLoadOptions(),{fetch:l}=this.props;return c={...c,mimeType:"application/x-protobuf",mvt:{...c?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:i},gis:n?{format:"binary"}:{}},l(s,{propName:"data",layer:this,loadOptions:c,signal:o})}renderSubLayers(e){let{x:r,y:n,z:i}=e.tile.index,o=Math.pow(2,i),s=N5/o,c=-s,l=N5*r/o,h=N5*(1-n/o),p=new Fn().scale([s,c,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=p,e.coordinateOrigin=[l,h,0],e.coordinateSystem=Yr.CARTESIAN,e.extensions=[...e.extensions||[],new y5]);let x=super.renderSubLayers(e);return this.state.binary&&!(x instanceof C0)&&br.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),x}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,o=e.object,s=null,c=null;o&&(s=k5(o,r),c=kie(o));let{highlightColor:l}=this.props;typeof l=="function"&&(l=l(e)),(n!==s||i!==c)&&this.setState({highlightColor:l,hoveredFeatureId:s,hoveredFeatureLayerName:c})}_isWGS84(){return Boolean(this.context.viewport.resolution)}getPickingInfo(e){let r=super.getPickingInfo(e);if(this.state.binary&&r.index!==-1){let{data:n}=e.sourceLayer.props;r.object=rI(n,{globalFeatureId:r.index})}return r.object&&!this._isWGS84()&&(r.object=zie(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:n,binary:i}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,c=e.content,l=Fie(s);if(!(Fie(r)||l))return-1;let p=l?s:r;return Array.isArray(c)?c.findIndex(x=>{let w=k5(x,o)===p,E=l||kie(x)===n;return w&&E}):c&&i?D5(c,o,p,l?"":n):-1}_pickObjects(e){let{deck:r,viewport:n}=this.context,i=n.width,o=n.height,s=n.x,c=n.y,l=[this.id];return r.pickObjects({x:s,y:c,width:i,height:o,layerIds:l,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),n=new Set,i=[];for(let o of r){let s=k5(o.object,this.props.uniqueIdProperty);s===void 0?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}return i}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(n=>{n.hasOwnProperty(e)||Object.defineProperty(n,e,{get:()=>{if(!n.content)return null;if(this.state.binary&&Array.isArray(n.content)&&!n.content.length)return[];let{bbox:i}=n;if(n._contentWGS84===void 0&&EN(i)){let o=this.state.binary?rI(n.content):n.content;n._contentWGS84=o.map(s=>zie(s,i,this.context.viewport))}return n._contentWGS84}})})}};kw.layerName="MVTLayer";kw.defaultProps=L4e;var Uie=kw;function k5(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function kie(t){return t.properties?.layerName||null}function Fie(t){return t!=null&&t!==""}function zie(t,e,r){let n={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(n.geometry,"coordinates",{get:()=>Die(t.geometry,e,r).coordinates}),n}var Vie="0123456789bcdefghjkmnpqrstuvwxyz",jie={};for(let t=0;t<Vie.length;t++)jie[Vie.charAt(t)]=t;var O4e=-90,B4e=90,D4e=-180,N4e=180;function k4e(t){let e=!0,r=B4e,n=O4e,i=N4e,o=D4e,s,c=0;for(let l=0,h=t.length;l<h;l++){let p=t[l].toLowerCase();c=jie[p];for(let x=4;x>=0;x--){let w=c>>x&1;e?(s=(i+o)/2,w===1?o=s:i=s):(s=(r+n)/2,w===1?n=s:r=s),e=!e}}return[n,o,r,i]}function Hie(t){let[e,r,n,i]=k4e(t);return[i,n,i,e,r,e,r,n,i,n]}var F4e={getGeohash:{type:"accessor",value:t=>t.geohash}},Fw=class extends Zf{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>Hie(r(n,i))}}};Fw.layerName="GeohashLayer";Fw.defaultProps=F4e;var Wie=Fw;function C1(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function Gie(t,e){let r=U4e(e),n=t;for(let i of r)n=z4e(n)?n[i]:void 0;return n}function z4e(t){return t!==null&&typeof t=="object"}var qie={};function U4e(t){if(typeof t=="string"){let e=qie[t];return e||(e=t.split("."),qie[t]=e),e}return Array.isArray(t)?t:[t]}var F5=ec(Xie(),1);var Yie={"||":(t,e)=>t||e,"&&":(t,e)=>t&&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e},V4e={"-":t=>-t,"+":t=>+t,"~":t=>~t,"!":t=>!t};function Kie(t,e){return t.map(function(r){return sc(r,e)})}function Zie(t,e){let r=sc(t.object,e),n;if(t.computed?n=sc(t.property,e):n=t.property.name,/^__proto__|prototype|constructor$/.test(n))throw Error(`Access to member "${n}" disallowed.`);return[r,r[n]]}function sc(t,e){let r=t;switch(r.type){case"ArrayExpression":return Kie(r.elements,e);case"BinaryExpression":return Yie[r.operator](sc(r.left,e),sc(r.right,e));case"CallExpression":let n,i,o;return r.callee.type==="MemberExpression"?(o=Zie(r.callee,e),n=o[0],i=o[1]):i=sc(r.callee,e),typeof i!="function"?void 0:i.apply(n,Kie(r.arguments,e));case"ConditionalExpression":return sc(r.test,e)?sc(r.consequent,e):sc(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?sc(r.left,e)||sc(r.right,e):r.operator==="&&"?sc(r.left,e)&&sc(r.right,e):Yie[r.operator](sc(r.left,e),sc(r.right,e));case"MemberExpression":return Zie(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return V4e[r.operator](sc(r.argument,e));default:return}}var z5={"-":t=>t};function og(t,e){if(t in z5)return z5[t];let r,n=(0,F5.default)(t);return n.type==="Identifier"?r=i=>Gie(i,t):(U5(n,i=>{if(i.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=i=>sc(n,i)),z5[t]=r,r}function U5(t,e){if(Array.isArray(t))t.forEach(r=>U5(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)U5(t[r],e)}}var P1="@@=",V5="@@#",$ie="@@type",pI="@@function";var Qie=t=>t&&typeof t=="object",yd=class{constructor(...e){this.typeKey=$ie,this.functionKey=pI,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=og,this.preProcessClassProps=(r,n)=>n,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 n=e[r];this[r]=Qie(this[r])?Object.assign(this[r],n):n}}}validate(e){return C1(!this.typeKey||typeof this.typeKey=="string"),C1(Qie(this.classes)),!0}};function j4e(t){return typeof t=="string"&&t.startsWith(P1)}function H4e(t){return t.replace(P1,"")}function I1(t,e){let r={};for(let n in t){let i=t[n];j4e(i)&&(i=H4e(i),i=og(i,e)),r[n]=i}return r}function Jie(t,e,r){let n=r.classes[t],i=r.reactComponents[t];if(!n&&!i){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 n?W4e(n,e,r):q4e(i,e,r)}function W4e(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=I1(e,r),new t(e)}function q4e(t,e,r){let{React:n}=r,{children:i=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=I1(e,r),n.createElement(t,e,i)}function eoe(t,e,r){let n=r.functions[t];if(!n){let{log:i}=r;if(i){let o=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return n(e)}function j5(t){return typeof t=="string"?JSON.parse(t):t}var H5=t=>t&&typeof t=="object",sg=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=j5(e),n=G4e(r,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(e){return this.convert(e)}};function G4e(t,e){return e=new yd(e),W5(t,"",e)}function W5(t,e,r){return Array.isArray(t)?t.map((n,i)=>W5(n,String(i),r)):X4e(t,r)?Y4e(t,r):H5(t)?pI in t?K4e(t,r):q5(t,r):typeof t=="string"?Z4e(t,e,r):t}function X4e(t,e){let{typeKey:r}=e;return H5(t)&&Boolean(t[r])}function Y4e(t,e){let{typeKey:r}=e,n=t[r],i={...t};return delete i[r],i=q5(i,e),Jie(n,i,e)}function K4e(t,e){let{functionKey:r}=e,n=t[r],i={...t};return delete i[r],i=q5(i,e),eoe(n,i,e)}function q5(t,e){C1(H5(t));let r={};for(let n in t){let i=t[n];r[n]=W5(i,n,e)}return r}function Z4e(t,e,r){if(t.startsWith(P1)&&r.convertFunction)return t=t.replace(P1,""),r.convertFunction(t,r);if(t.startsWith(V5)){if(t=t.replace(V5,""),r.constants[t])return r.constants[t];let[n,i]=t.split(".");return r.enumerations[n][i]}return t}var R1={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},op=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:n}){e&&(R1.onInitialize=e),r&&(R1.onFinalize=r),n&&(R1.onMessage=n)}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};R1.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};R1.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),R1.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))try{return JSON.parse(JSON.stringify(i))}catch{return}r.add(i)}return i})}};function toe(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 _I,hs,soe,$4e,ag,roe,aoe,G5,Z5,X5,Y5,Q4e,Uw={},coe=[],J4e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$5=Array.isArray;function Qm(t,e){for(var r in e)t[r]=e[r];return t}function loe(t){var e=t.parentNode;e&&e.removeChild(t)}function eDe(t,e,r){var n,i,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?_I.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return mI(t,s,n,i,null)}function mI(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++soe,__i:-1,__u:0};return i==null&&hs.vnode!=null&&hs.vnode(o),o}function L1(t){return t.children}function AI(t,e){this.props=t,this.context=e}function cg(t,e){if(e==null)return t.__?cg(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?cg(t):null}function uoe(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return uoe(t)}}function noe(t){(!t.__d&&(t.__d=!0)&&ag.push(t)&&!gI.__r++||roe!==hs.debounceRendering)&&((roe=hs.debounceRendering)||aoe)(gI)}function gI(){var t,e,r,n,i,o,s,c;for(ag.sort(G5);t=ag.shift();)t.__d&&(e=ag.length,n=void 0,o=(i=(r=t).__v).__e,s=[],c=[],r.__P&&((n=Qm({},i)).__v=i.__v+1,hs.vnode&&hs.vnode(n),Q5(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[o]:null,s,o??cg(i),!!(32&i.__u),c),n.__v=i.__v,n.__.__k[n.__i]=n,poe(s,n,c),n.__e!=o&&uoe(n)),ag.length>e&&ag.sort(G5));gI.__r=0}function hoe(t,e,r,n,i,o,s,c,l,h,p){var x,w,E,P,B,D=n&&n.__k||coe,W=e.length;for(r.__d=l,tDe(r,e,D),l=r.__d,x=0;x<W;x++)(E=r.__k[x])!=null&&typeof E!="boolean"&&typeof E!="function"&&(w=E.__i===-1?Uw:D[E.__i]||Uw,E.__i=x,Q5(t,E,w,i,o,s,c,l,h,p),P=E.__e,E.ref&&w.ref!=E.ref&&(w.ref&&J5(w.ref,null,E),p.push(E.ref,E.__c||P,E)),B==null&&P!=null&&(B=P),65536&E.__u||w.__k===E.__k?l=foe(E,l,t):typeof E.type=="function"&&E.__d!==void 0?l=E.__d:P&&(l=P.nextSibling),E.__d=void 0,E.__u&=-196609);r.__d=l,r.__e=B}function tDe(t,e,r){var n,i,o,s,c,l=e.length,h=r.length,p=h,x=0;for(t.__k=[],n=0;n<l;n++)s=n+x,(i=t.__k[n]=(i=e[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?mI(null,i,null,null,null):$5(i)?mI(L1,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?mI(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,c=rDe(i,r,s,p),i.__i=c,o=null,c!==-1&&(p--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&x--,typeof i.type!="function"&&(i.__u|=65536)):c!==s&&(c==s-1?x--:c==s+1?x++:c>s?p>l-s?x+=c-s:x--:c<s&&(c==s-x?x-=c-s:x++),c!==n+x&&(i.__u|=65536))):(o=r[s])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=cg(o)),K5(o,o,!1),r[s]=null,p--);if(p)for(n=0;n<h;n++)(o=r[n])!=null&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=cg(o)),K5(o,o))}function foe(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=foe(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=cg(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function rDe(t,e,r,n){var i=t.key,o=t.type,s=r-1,c=r+1,l=e[r];if(l===null||l&&i==l.key&&o===l.type&&!(131072&l.__u))return r;if(n>(l!=null&&!(131072&l.__u)?1:0))for(;s>=0||c<e.length;){if(s>=0){if((l=e[s])&&!(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(c<e.length){if((l=e[c])&&!(131072&l.__u)&&i==l.key&&o===l.type)return c;c++}}return-1}function ioe(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||J4e.test(e)?r:r+"px"}function dI(t,e,r,n,i){var o;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||ioe(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||ioe(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n?r.u=n.u:(r.u=Z5,t.addEventListener(e,o?Y5:X5,o)):t.removeEventListener(e,o?Y5:X5,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function ooe(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Z5++;else if(e.t<r.u)return;return r(hs.event?hs.event(e):e)}}}function Q5(t,e,r,n,i,o,s,c,l,h){var p,x,w,E,P,B,D,W,X,q,$,te,F,ue,oe,J,G=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=e.__e=r.__e]),(p=hs.__b)&&p(e);e:if(typeof G=="function")try{if(W=e.props,X="prototype"in G&&G.prototype.render,q=(p=G.contextType)&&n[p.__c],$=p?q?q.props.value:p.__:n,r.__c?D=(x=e.__c=r.__c).__=x.__E:(X?e.__c=x=new G(W,$):(e.__c=x=new AI(W,$),x.constructor=G,x.render=iDe),q&&q.sub(x),x.props=W,x.state||(x.state={}),x.context=$,x.__n=n,w=x.__d=!0,x.__h=[],x._sb=[]),X&&x.__s==null&&(x.__s=x.state),X&&G.getDerivedStateFromProps!=null&&(x.__s==x.state&&(x.__s=Qm({},x.__s)),Qm(x.__s,G.getDerivedStateFromProps(W,x.__s))),E=x.props,P=x.state,x.__v=e,w)X&&G.getDerivedStateFromProps==null&&x.componentWillMount!=null&&x.componentWillMount(),X&&x.componentDidMount!=null&&x.__h.push(x.componentDidMount);else{if(X&&G.getDerivedStateFromProps==null&&W!==E&&x.componentWillReceiveProps!=null&&x.componentWillReceiveProps(W,$),!x.__e&&(x.shouldComponentUpdate!=null&&x.shouldComponentUpdate(W,x.__s,$)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(x.props=W,x.state=x.__s,x.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(me){me&&(me.__=e)}),te=0;te<x._sb.length;te++)x.__h.push(x._sb[te]);x._sb=[],x.__h.length&&s.push(x);break e}x.componentWillUpdate!=null&&x.componentWillUpdate(W,x.__s,$),X&&x.componentDidUpdate!=null&&x.__h.push(function(){x.componentDidUpdate(E,P,B)})}if(x.context=$,x.props=W,x.__P=t,x.__e=!1,F=hs.__r,ue=0,X){for(x.state=x.__s,x.__d=!1,F&&F(e),p=x.render(x.props,x.state,x.context),oe=0;oe<x._sb.length;oe++)x.__h.push(x._sb[oe]);x._sb=[]}else do x.__d=!1,F&&F(e),p=x.render(x.props,x.state,x.context),x.state=x.__s;while(x.__d&&++ue<25);x.state=x.__s,x.getChildContext!=null&&(n=Qm(Qm({},n),x.getChildContext())),X&&!w&&x.getSnapshotBeforeUpdate!=null&&(B=x.getSnapshotBeforeUpdate(E,P)),hoe(t,$5(J=p!=null&&p.type===L1&&p.key==null?p.props.children:p)?J:[J],e,r,n,i,o,s,c,l,h),x.base=e.__e,e.__u&=-161,x.__h.length&&s.push(x),D&&(x.__E=x.__=null)}catch(me){if(e.__v=null,l||o!=null){for(e.__u|=l?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,e.__e=c}else e.__e=r.__e,e.__k=r.__k;hs.__e(me,e,r)}else o==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=nDe(r.__e,e,r,n,i,o,s,l,h);(p=hs.diffed)&&p(e)}function poe(t,e,r){e.__d=void 0;for(var n=0;n<r.length;n++)J5(r[n],r[++n],r[++n]);hs.__c&&hs.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){hs.__e(o,i.__v)}})}function nDe(t,e,r,n,i,o,s,c,l){var h,p,x,w,E,P,B,D=r.props,W=e.props,X=e.type;if(X==="svg"?i="http://www.w3.org/2000/svg":X==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(h=0;h<o.length;h++)if((E=o[h])&&"setAttribute"in E==!!X&&(X?E.localName===X:E.nodeType===3)){t=E,o[h]=null;break}}if(t==null){if(X===null)return document.createTextNode(W);t=document.createElementNS(i,X,W.is&&W),o=null,c=!1}if(X===null)D===W||c&&t.data===W||(t.data=W);else{if(o=o&&_I.call(t.childNodes),D=r.props||Uw,!c&&o!=null)for(D={},h=0;h<t.attributes.length;h++)D[(E=t.attributes[h]).name]=E.value;for(h in D)if(E=D[h],h!="children"){if(h=="dangerouslySetInnerHTML")x=E;else if(h!=="key"&&!(h in W)){if(h=="value"&&"defaultValue"in W||h=="checked"&&"defaultChecked"in W)continue;dI(t,h,null,E,i)}}for(h in W)E=W[h],h=="children"?w=E:h=="dangerouslySetInnerHTML"?p=E:h=="value"?P=E:h=="checked"?B=E:h==="key"||c&&typeof E!="function"||D[h]===E||dI(t,h,E,D[h],i);if(p)c||x&&(p.__html===x.__html||p.__html===t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(x&&(t.innerHTML=""),hoe(t,$5(w)?w:[w],e,r,n,X==="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:r.__k&&cg(r,0),c,l),o!=null)for(h=o.length;h--;)o[h]!=null&&loe(o[h]);c||(h="value",P!==void 0&&(P!==t[h]||X==="progress"&&!P||X==="option"&&P!==D[h])&&dI(t,h,P,D[h],i),h="checked",B!==void 0&&B!==t[h]&&dI(t,h,B,D[h],i))}return t}function J5(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){hs.__e(i,r)}}function K5(t,e,r){var n,i;if(hs.unmount&&hs.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||J5(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){hs.__e(o,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&K5(n[i],e,r||typeof t.type!="function");r||t.__e==null||loe(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function iDe(t,e,r){return this.constructor(t,r)}function O1(t,e,r){var n,i,o,s;hs.__&&hs.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,o=[],s=[],Q5(e,t=(!n&&r||e).__k=eDe(L1,null,[t]),i||Uw,Uw,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?_I.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n,s),poe(o,t,s)}_I=coe.slice,hs={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(c){t=c}throw t}},soe=0,$4e=function(t){return t!=null&&t.constructor==null},AI.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Qm({},this.state),typeof t=="function"&&(t=t(Qm({},r),this.props)),t&&Qm(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),noe(this))},AI.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),noe(this))},AI.prototype.render=L1,ag=[],aoe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,G5=function(t,e){return t.__v.__b-e.__v.__b},gI.__r=0,Z5=0,X5=ooe(!1),Y5=ooe(!0),Q4e=0;var oDe=0,iDt=Array.isArray;function Ys(t,e,r,n,i,o){e||(e={});var s,c,l=e;if("ref"in l)for(c in l={},e)c=="ref"?s=e[c]:l[c]=e[c];var h={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--oDe,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(s=t.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return hs.vnode&&hs.vnode(h),h}var doe=t=>{let{className:e,label:r,onClick:n}=t;return Ys("div",{className:"deck-widget-button",children:Ys("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:n,title:r,children:Ys("div",{className:"deck-widget-icon"})})})},moe=t=>{let{children:e,orientation:r}=t;return Ys("div",{className:`deck-widget-button-group ${r}`,children:e})},e6=t=>{let{className:e,label:r,onClick:n}=t;return Ys("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:n,title:r,children:Ys("div",{className:"deck-widget-icon"})})};var yI=class{constructor(e){this.id="fullscreen",this.placement="top-left",this.fullscreen=!1,this.id=e.id??this.id,this.placement=e.placement??this.placement,this.props={...e,enterLabel:e.enterLabel??"Enter Fullscreen",exitLabel:e.exitLabel??"Exit Fullscreen",style:e.style??{}}}onAdd({deck:e}){let{style:r,className:n}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-fullscreen"),n&&i.classList.add(n),zh(i,r),this.deck=e,this.element=i,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),i}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:e,exitLabel:r}=this.props,n=this.element;if(!n)return;let i=Ys(doe,{onClick:this.handleClick.bind(this),label:this.fullscreen?r:e,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});O1(i,n)}setProps(e){this.placement=e.placement??this.placement;let r=this.props,n=this.element;n&&(r.className!==e.className&&(r.className&&n.classList.remove(r.className),e.className&&n.classList.add(e.className)),Oi(r.style,e.style,1)||(bm(n,r.style),zh(n,e.style))),Object.assign(this.props,e),this.update()}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,r=document.fullscreenElement===this.getContainer();e!==r&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var xI=class{constructor(e){this.id="compass",this.placement="top-left",this.viewId=null,this.viewports={},this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...e,transitionDuration:e.transitionDuration??200,label:e.label??"Reset Compass",style:e.style??{}}}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==e.className&&(r.className&&n.classList.remove(r.className),e.className&&n.classList.add(e.className)),Oi(r.style,e.style,1)||(bm(n,r.style),zh(n,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.update())}onAdd({deck:e}){let{style:r,className:n}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-compass"),n&&i.classList.add(n),zh(i,r),this.deck=e,this.element=i,this.update(),i}getRotation(e){return e instanceof Uc?[-e.bearing,e.pitch]:e instanceof Fh?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}update(){let e=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",r=this.viewports[e],[n,i]=this.getRotation(r),o=this.element;if(!o)return;let s=Ys("div",{className:"deck-widget-button",style:{perspective:100},children:Ys("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.handleCompassReset(c)},title:this.props.label,style:{transform:`rotateX(${i}deg)`},children:Ys("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:Ys("g",{transform:`rotate(${n},13,13)`,children:[Ys("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),Ys("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});O1(s,o)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(e){let r=this.viewId||e.id||"default-view";if(e instanceof Uc){let n={...e,bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new td};this.deck._onViewStateChange({viewId:r,viewState:n,interactionState:{}})}}};var vI=class{constructor(e){this.id="zoom",this.placement="top-left",this.viewId=null,this.viewports={},this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...e,orientation:e.orientation??"vertical",transitionDuration:e.transitionDuration??200,zoomInLabel:e.zoomInLabel??"Zoom In",zoomOutLabel:e.zoomOutLabel??"Zoom Out",style:e.style??{}}}onAdd({deck:e}){let{style:r,className:n}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-zoom"),n&&i.classList.add(n),zh(i,r),this.deck=e,this.element=i,this.update(),i}onRemove(){this.deck=void 0,this.element=void 0}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==e.className&&(r.className&&n.classList.remove(r.className),e.className&&n.classList.add(e.className)),Oi(r.style,e.style,1)||(bm(n,r.style),zh(n,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){this.viewports[e.id]=e}handleZoom(e,r){let n=this.viewId||e?.id||"default-view",i={...e,zoom:r,transitionDuration:this.props.transitionDuration,transitionInterpolator:new td};this.deck._onViewStateChange({viewId:n,viewState:i,interactionState:{}})}handleZoomIn(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom+1)}handleZoomOut(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom-1)}update(){let e=this.element;if(!e)return;let r=Ys(moe,{orientation:this.props.orientation,children:[Ys(e6,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),Ys(e6,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});O1(r,e)}};var sDe={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},aDe={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},cDe={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},lDe={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};var bI=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,n={...this.props,...e};if(this.props=n,!this.map)return;this._update(r,n)&&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:n}=e;r.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({container:n,maxZoom:24,...e.mapOptions,...Aoe(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1}),Object.defineProperty(n,"offsetWidth",{get:()=>this.width}),Object.defineProperty(n,"clientWidth",{get:()=>this.width}),Object.defineProperty(n,"offsetHeight",{get:()=>this.height}),Object.defineProperty(n,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,r){e.mapStyle!==r.mapStyle&&this.map.setStyle(r.mapStyle);let i=e.width!==r.width||e.height!==r.height;i&&(this.width=r.width,this.height=r.height,this.map.resize());let o=e.viewState,s=r.viewState,c=s.latitude!==o.latitude||s.longitude!==o.longitude||s.zoom!==o.zoom||s.pitch!==o.pitch||s.bearing!==o.bearing;return c&&this.map.jumpTo(Aoe(s)),i||c}};function Aoe(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing??0,pitch:t.pitch??0}}var goe={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function uDe(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 n=document.createElement("div");e.appendChild(n),Object.assign(n.style,goe);let i=document.createElement("canvas");return e.appendChild(i),Object.assign(i.style,goe),{container:e,mapCanvas:n,deckCanvas:i}}var lg=class extends cy{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:n}=uDe(e),i=e.viewState||e.initialViewState,o=Number.isFinite(i&&i.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:n,...e}),s&&s.Map?this._map=o&&new bI({...e,width:0,height:0,viewState:i,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 n=this.getViewports()[0];n&&this._map.setProps({width:n.width,height:n.height,viewState:n})}super._drawLayers(e,r)}};Rf.registerDevices([Na]);var _oe=t=>t.charAt(0)===t.charAt(0).toUpperCase(),hDe=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function t6(t={},e){let r={},n=Object.keys(t).filter(e);for(let i of n)r[i]=t[i];return r}var fDe={classes:t6(Vw,_oe),enumerations:{COORDINATE_SYSTEM:Yr,GL:Of}};HA([ov]);var Jm=new sg({configuration:fDe});function pDe(t,e){let r={classes:t6(t,_oe),functions:t6(t,hDe)};e.mergeConfiguration(r)}function dDe(t,e){if(!t)return;let r={};function n(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function i(o,s){pDe(s,Jm),r[o]=s,n()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){i(o,window[o]);return}Object.defineProperty(window,o,{set:c=>i(o,c),get:()=>r[o]}),W7(s)})}function yoe(t,e){let r=Jm.convert(t);e.setProps(r)}function mDe(t,e){return t.filter(r=>r&&r.id&&!e.find(n=>n.id===r.id))}function ADe({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:n,handleEvent:i,getTooltip:o,container:s}){let l={...i?{onClick:h=>i("deck-click-event",h),onHover:h=>i("deck-hover-event",h),onResize:h=>i("deck-resize-event",h),onViewStateChange:({viewState:h,interactionState:p,oldViewState:x})=>{let w=new Uc(h);h.nw=w.unproject([0,0]),h.se=w.unproject([w.width,w.height]),i("deck-view-state-change-event",h)},onDragStart:h=>i("deck-drag-start-event",h),onDrag:h=>i("deck-drag-event",h),onDragEnd:h=>i("deck-drag-end-event",h)}:null,getTooltip:o,container:s};switch(t){case"mapbox":return br.info("Using Mapbox base maps")(),new lg({...l,...e,map:jO,mapboxApiAccessToken:r,onLoad:H7});case"carto":return br.info("Using Carto base maps")(),new lg({map:jO,...l,...e});case"google_maps":return br.info("Using Google Maps base maps")(),Iq({...l,...e,googleMapsKey:n});default:return br.info("No recognized map provider specified")(),new lg({...l,...e,map:null,mapboxApiAccessToken:null})}}function wI({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:n,tooltip:i,handleEvent:o,customLibraries:s,configuration:c}){let l;try{c&&Jm.mergeConfiguration(c);let h=n.layers||[],p=Jm.convert(n);CD(r,p);let x=(p.layers||[]).filter(D=>D),w=mDe(h,x),E=zO(i),{mapProvider:P}=p;l=ADe({mapProvider:P,props:p,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:E,container:r}),dDe(s,()=>{if(w.length){let W=(Jm.convert({layers:n.layers}).layers||[]).filter(X=>X);W.length>x.length&&l.setProps({layers:W})}})}catch(h){console.error(h)}return l}function TI(){op.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:n,mapboxApiKey:i,jsonInput:o,tooltip:s}=xDe(t);j7();let c=t.getRootDOMElement(),l=z7(e,r);c.appendChild(l);let h=JSON.parse(o),p=wI({mapboxApiKey:i,container:l,jsonInput:h,tooltip:s,handleEvent:(x,w)=>yDe(t,x,w),customLibraries:n});t.userData.deck=p},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:n}){let{deck:i}=t.userData,o;switch(e){case"json":o=Jm.convert(r),i.setProps(o);break;case"json-with-binary":o=Jm.convert(r);let s=t.jupyterModel.get("data_buffer"),c=gDe({binary:s,convertedJson:o});i.setProps(c);break;default:}}})}function gDe({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let n=e.layers[r].id,i=e.layers[r];e.layers[r]=i.clone({data:t[n]})}return e}function _De(t,e){return e instanceof qi?e.id:e}function yDe(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let n=JSON.parse(JSON.stringify(r,_De));t.sendJSONMessage(e,n)}function xDe(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 ug=class extends op{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let n=op._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(n)}};var zT={};Lo(zT,{CONTROL_COMM_PROTOCOL_VERSION:()=>ale,CONTROL_COMM_TARGET:()=>sle,CONTROL_COMM_TIMEOUT:()=>cle,DOMWidgetModel:()=>Sx,DOMWidgetView:()=>FT,IJupyterWidgetRegistry:()=>zze,JUPYTER_WIDGETS_VERSION:()=>BI,JupyterPhosphorPanelWidget:()=>O8,JupyterPhosphorWidget:()=>$R,LayoutModel:()=>B8,LayoutView:()=>D8,ManagerBase:()=>S6,PROTOCOL_VERSION:()=>DI,StyleModel:()=>QR,StyleView:()=>N8,ViewList:()=>F8,WidgetModel:()=>up,WidgetView:()=>gA,WrappedError:()=>Zw,assign:()=>xd,base64ToBuffer:()=>E6,bufferToBase64:()=>T6,bufferToHex:()=>aze,difference:()=>OI,hexToBuffer:()=>w6,isEqual:()=>W1,pack_models:()=>L8,put_buffers:()=>eA,reject:()=>cp,remove_buffers:()=>Qw,resolvePromisesDict:()=>q1,serialize_state:()=>lle,shims:()=>k8,unpack_models:()=>kT,uuid:()=>$w});var LI=ec(boe()),tle=ec(B1()),rle=ec(Kce()),nle=ec(ele());function OI(t,e){return t.filter(r=>e.indexOf(r)===-1)}function W1(t,e){return(0,rle.default)(t,e)}var xd=Object.assign||function(t){for(let e=1;e<arguments.length;e++){let r=arguments[e];for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function $w(){return tle.UUID.uuid4()}var Zw=class extends Error{constructor(e,r){super(e),console.warn("WrappedError has been deprecated!"),r instanceof Zw?this.error_stack=r.error_stack:this.error_stack=[r],this.error_stack.push(this)}};function q1(t){let e=Object.keys(t),r=[];return e.forEach(function(n){r.push(t[n])}),Promise.all(r).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function cp(t,e){return function(n){throw e&&console.error(new Error(t)),n}}function eA(t,e,r){for(let n=0;n<e.length;n++){let i=e[n],o=t;for(let s=0;s<i.length-1;s++)o=o[i[s]];o[i[i.length-1]]=r[n]}}function Qw(t){let e=[],r=[];function n(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o)){let c=!1;for(let l=0;l<o.length;l++){let h=o[l];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))c||(o=o.slice(),c=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([l])),o[l]=null;else{let p=n(h,s.concat([l]));p!==h&&(c||(o=o.slice(),c=!0),o[l]=p)}}}else if((0,nle.default)(o))for(let c in o){let l=!1;if(o.hasOwnProperty(c)){let h=o[c];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=Object.assign({},o),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([c])),delete o[c];else{let p=n(h,s.concat([c]));p!==h&&(l||(o=Object.assign({},o),l=!0),o[c]=p)}}}return o}return{state:n(t,[]),buffers:e,buffer_paths:r}}var sze=["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 aze(t){let e=new Uint8Array(t),r=[];for(let n=0;n<e.length;n++)r.push(sze[e[n]]);return r.join("")}function w6(t){let e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function T6(t){return(0,LI.fromByteArray)(new Uint8Array(t))}function E6(t){return(0,LI.toByteArray)(t).buffer}var ole=ec(B1());var BI="1.2.0",DI="2.1.0";var ile=DI.split(".",1)[0],sle="jupyter.widget.control",ale="1.0.0",cle=4e3,S6=class{constructor(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}display_model(e,r,n={}){return this.create_view(r,n).then(i=>this.display_view(e,i,n)).catch(cp("Could not create view",!0))}setViewOptions(e={}){return e}create_view(e,r={}){let n=e.state_change=e.state_change.then(()=>this.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(o=>{let s=new o({model:e,options:this.setViewOptions(r)});return s.listenTo(e,"destroy",s.remove),Promise.resolve(s.render()).then(()=>s)}).catch(cp("Could not create a view for model id "+e.model_id,!0))),i=$w();return e.views[i]=n,n.then(o=>{o.once("remove",()=>{delete o.model.views[i]},this)}),e.state_change}callbacks(e){return{}}get_model(e){return this._models[e]}has_model(e){return this._models[e]!==void 0}handle_comm_open(e,r){let n=(r.metadata||{}).version||"";if(n.split(".",1)[0]!==ile){let c=`Wrong widget protocol version: received protocol version '${n}', but was expecting major version '${ile}'`;return console.error(c),Promise.reject(c)}let i=r.content.data,o=i.buffer_paths||[],s=(r.buffers||[]).map(c=>c instanceof DataView?c:new DataView(c instanceof ArrayBuffer?c:c.buffer));return eA(i.state,o,s),this.new_model({model_name:i.state._model_name,model_module:i.state._model_module,model_module_version:i.state._model_module_version,comm:e},i.state).catch(cp("Could not create a model.",!0))}new_widget(e,r={}){let 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:DI});let i=Object.assign({},e);return n.then(o=>(i.comm=o,this.new_model(i,r).then(c=>(c.sync("create",c),c))),()=>(i.model_id||(i.model_id=$w()),this.new_model(i,r)))}register_model(e,r){this._models[e]=r,r.then(n=>{n.once("comm:close",()=>{delete this._models[e]})})}async new_model(e,r={}){let n;if(e.model_id)n=e.model_id;else if(e.comm)n=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.");let i=this._make_model(e,r);return this.register_model(n,i),await i}async _make_model(e,r={}){let n=e.model_id,i=this.loadClass(e.model_name,e.model_module,e.model_module_version),o;try{o=await i}catch(h){throw console.error("Could not instantiate widget"),h}if(!o)throw new Error(`Cannot find model module ${e.model_module}@${e.model_module_version}, ${e.model_name}`);let s=await o._deserialize_state(r,this),c={widget_manager:this,model_id:n,comm:e.comm},l=new o(s,c);return l.name=e.model_name,l.module=e.model_module,l}async _loadFromKernel(){let e,r;try{let c=await this._create_comm(sle,$w(),{},{version:ale});await new Promise((l,h)=>{c.on_msg(p=>{if(e=p.content.data,e.method!=="update_states"){console.warn(`
4465
+ `},Iw=class extends QS{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:[iBe],inject:oBe}:{modules:[sBe],inject:aBe}}draw(){let{clipBounds:e}=this.props,r={};if(this.state.clipByInstance)r.bounds=e;else{let n=this.projectPosition([e[0],e[1],0]),i=this.projectPosition([e[2],e[3],0]);r.bounds=[Math.min(n[0],i[0]),Math.min(n[1],i[1]),Math.max(n[0],i[0]),Math.max(n[1],i[1])]}this.setShaderModuleProps({clip:r})}};Iw.defaultProps=nBe;Iw.extensionName="ClipExtension";var y5=Iw;var Rw={x:0,y:1,z:2};function rg(t,e={}){let{start:r=0,end:n=t.length,plane:i="xy"}=e,o=e.size||2,s=0,c=Rw[i[0]],l=Rw[i[1]];for(let h=r,p=n-o;h<n;h+=o)s+=(t[h+c]-t[p+c])*(t[h+l]+t[p+l]),p=h;return s/2}function v5(t,e,r=2,n,i="xy"){let o=e&&e.length,s=o?e[0]*r:t.length,c=uie(t,0,s,r,!0,n&&n[0],i),l=[];if(!c||c.next===c.prev)return l;let h,p,x,w,E,P,B;if(o&&(c=dBe(t,e,c,r,n,i)),t.length>80*r){w=p=t[0],E=x=t[1];for(let D=r;D<s;D+=r)P=t[D],B=t[D+1],P<w&&(w=P),B<E&&(E=B),P>p&&(p=P),B>x&&(x=B);h=Math.max(p-w,x-E),h=h!==0?32767/h:0}return Lw(c,l,r,w,E,h,0),l}function uie(t,e,r,n,i,o,s){let c,l;o===void 0&&(o=rg(t,{start:e,end:r,size:n,plane:s}));let h=Rw[s[0]],p=Rw[s[1]];if(i===o<0)for(c=e;c<r;c+=n)l=lie(c,t[c+h],t[c+p],l);else for(c=r-n;c>=e;c-=n)l=lie(c,t[c+h],t[c+p],l);return l&&JP(l,l.next)&&(Bw(l),l=l.next),l}function ng(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(JP(r,r.next)||Bs(r.prev,r,r.next)===0)){if(Bw(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function Lw(t,e,r,n,i,o,s){if(!t)return;!s&&o&&yBe(t,n,i,o);let c=t,l,h;for(;t.prev!==t.next;){if(l=t.prev,h=t.next,o?hBe(t,n,i,o):uBe(t)){e.push(l.i/r|0),e.push(t.i/r|0),e.push(h.i/r|0),Bw(t),t=h.next,c=h.next;continue}if(t=h,t===c){s?s===1?(t=fBe(ng(t),e,r),Lw(t,e,r,n,i,o,2)):s===2&&pBe(t,e,r,n,i,o):Lw(ng(t),e,r,n,i,o,1);break}}}function uBe(t){let e=t.prev,r=t,n=t.next;if(Bs(e,r,n)>=0)return!1;let i=e.x,o=r.x,s=n.x,c=e.y,l=r.y,h=n.y,p=i<o?i<s?i:s:o<s?o:s,x=c<l?c<h?c:h:l<h?l:h,w=i>o?i>s?i:s:o>s?o:s,E=c>l?c>h?c:h:l>h?l:h,P=n.next;for(;P!==e;){if(P.x>=p&&P.x<=w&&P.y>=x&&P.y<=E&&T1(i,c,o,l,s,h,P.x,P.y)&&Bs(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function hBe(t,e,r,n){let i=t.prev,o=t,s=t.next;if(Bs(i,o,s)>=0)return!1;let c=i.x,l=o.x,h=s.x,p=i.y,x=o.y,w=s.y,E=c<l?c<h?c:h:l<h?l:h,P=p<x?p<w?p:w:x<w?x:w,B=c>l?c>h?c:h:l>h?l:h,D=p>x?p>w?p:w:x>w?x:w,W=x5(E,P,e,r,n),X=x5(B,D,e,r,n),q=t.prevZ,$=t.nextZ;for(;q&&q.z>=W&&$&&$.z<=X;){if(q.x>=E&&q.x<=B&&q.y>=P&&q.y<=D&&q!==i&&q!==s&&T1(c,p,l,x,h,w,q.x,q.y)&&Bs(q.prev,q,q.next)>=0||(q=q.prevZ,$.x>=E&&$.x<=B&&$.y>=P&&$.y<=D&&$!==i&&$!==s&&T1(c,p,l,x,h,w,$.x,$.y)&&Bs($.prev,$,$.next)>=0))return!1;$=$.nextZ}for(;q&&q.z>=W;){if(q.x>=E&&q.x<=B&&q.y>=P&&q.y<=D&&q!==i&&q!==s&&T1(c,p,l,x,h,w,q.x,q.y)&&Bs(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;$&&$.z<=X;){if($.x>=E&&$.x<=B&&$.y>=P&&$.y<=D&&$!==i&&$!==s&&T1(c,p,l,x,h,w,$.x,$.y)&&Bs($.prev,$,$.next)>=0)return!1;$=$.nextZ}return!0}function fBe(t,e,r){let n=t;do{let i=n.prev,o=n.next.next;!JP(i,o)&&hie(i,n,n.next,o)&&Ow(i,o)&&Ow(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),Bw(n),Bw(n.next),n=t=o),n=n.next}while(n!==t);return ng(n)}function pBe(t,e,r,n,i,o){let s=t;do{let c=s.next.next;for(;c!==s.prev;){if(s.i!==c.i&&bBe(s,c)){let l=fie(s,c);s=ng(s,s.next),l=ng(l,l.next),Lw(s,e,r,n,i,o,0),Lw(l,e,r,n,i,o,0);return}c=c.next}s=s.next}while(s!==t)}function dBe(t,e,r,n,i,o){let s=[],c,l,h,p,x;for(c=0,l=e.length;c<l;c++)h=e[c]*n,p=c<l-1?e[c+1]*n:t.length,x=uie(t,h,p,n,!1,i&&i[c+1],o),x===x.next&&(x.steiner=!0),s.push(vBe(x));for(s.sort(mBe),c=0;c<s.length;c++)r=ABe(s[c],r);return r}function mBe(t,e){return t.x-e.x}function ABe(t,e){let r=gBe(t,e);if(!r)return e;let n=fie(r,t);return ng(n,n.next),ng(r,r.next)}function gBe(t,e){let r=e,n=t.x,i=t.y,o=-1/0,s;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let w=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(w<=n&&w>o&&(o=w,s=r.x<r.next.x?r:r.next,w===n))return s}r=r.next}while(r!==e);if(!s)return null;let c=s,l=s.x,h=s.y,p=1/0,x;r=s;do n>=r.x&&r.x>=l&&n!==r.x&&T1(i<h?n:o,i,l,h,i<h?o:n,i,r.x,r.y)&&(x=Math.abs(i-r.y)/(n-r.x),Ow(r,t)&&(x<p||x===p&&(r.x>s.x||r.x===s.x&&_Be(s,r)))&&(s=r,p=x)),r=r.next;while(r!==c);return s}function _Be(t,e){return Bs(t.prev,t,e.prev)<0&&Bs(e.next,t,t.next)<0}function yBe(t,e,r,n){let i=t;do i.z===0&&(i.z=x5(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,xBe(i)}function xBe(t){let e,r,n=1,i,o,s,c,l,h;do{for(o=t,t=null,h=null,i=0;o;){for(i++,c=o,s=0,r=0;r<n&&(s++,c=c.nextZ,!!c);r++);for(l=n;s>0||l>0&&c;)s!==0&&(l===0||!c||o.z<=c.z)?(e=o,o=o.nextZ,s--):(e=c,c=c.nextZ,l--),h?h.nextZ=e:t=e,e.prevZ=h,h=e;o=c}h.nextZ=null,n*=2}while(i>1);return t}function x5(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function vBe(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function T1(t,e,r,n,i,o,s,c){return(i-s)*(e-c)>=(t-s)*(o-c)&&(t-s)*(n-c)>=(r-s)*(e-c)&&(r-s)*(o-c)>=(i-s)*(n-c)}function bBe(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!wBe(t,e)&&(Ow(t,e)&&Ow(e,t)&&TBe(t,e)&&(Bs(t.prev,t,e.prev)||Bs(t,e.prev,e))||JP(t,e)&&Bs(t.prev,t,t.next)>0&&Bs(e.prev,e,e.next)>0)}function Bs(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function JP(t,e){return t.x===e.x&&t.y===e.y}function hie(t,e,r,n){let i=QP(Bs(t,e,r)),o=QP(Bs(t,e,n)),s=QP(Bs(r,n,t)),c=QP(Bs(r,n,e));return!!(i!==o&&s!==c||i===0&&$P(t,r,e)||o===0&&$P(t,n,e)||s===0&&$P(r,t,n)||c===0&&$P(r,e,n))}function $P(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function QP(t){return t>0?1:t<0?-1:0}function wBe(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&hie(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Ow(t,e){return Bs(t.prev,t,t.next)<0?Bs(t,e,t.next)>=0&&Bs(t,t.prev,e)>=0:Bs(t,e,t.prev)<0||Bs(t,t.next,e)<0}function TBe(t,e){let r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function fie(t,e){let r=new Dw(t.i,t.x,t.y),n=new Dw(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function lie(t,e,r,n){let i=new Dw(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Bw(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}var Dw=class{constructor(e,r,n){this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1,this.i=e,this.x=r,this.y=n}};function T5(t,e,r){let n=PBe(t),i=Object.keys(n).filter(o=>n[o]!==Array);return IBe(t,{propArrayTypes:n,...e},{numericPropKeys:r&&r.numericPropKeys||i,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function PBe(t){let e={};for(let r of t)if(r.properties)for(let n in r.properties){let i=r.properties[n];e[n]=NBe(i,e[n])}return e}function IBe(t,e,r){let{pointPositionsCount:n,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:c,polygonPositionsCount:l,polygonObjectsCount:h,polygonRingsCount:p,polygonFeaturesCount:x,propArrayTypes:w,coordLength:E}=e,{numericPropKeys:P=[],PositionDataType:B=Float32Array,triangulate:D=!0}=r,W=t[0]&&"id"in t[0],X=t.length>65535?Uint32Array:Uint16Array,q={type:"Point",positions:new B(n*E),globalFeatureIds:new X(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},$={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new B(o*E),globalFeatureIds:new X(o),featureIds:c>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},te={type:"Polygon",polygonIndices:l>65535?new Uint32Array(h+1):new Uint16Array(h+1),primitivePolygonIndices:l>65535?new Uint32Array(p+1):new Uint16Array(p+1),positions:new B(l*E),globalFeatureIds:new X(l),featureIds:x>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};D&&(te.triangles=[]);for(let ue of[q,$,te])for(let oe of P){let J=w[oe];ue.numericProps[oe]=new J(ue.positions.length/E)}$.pathIndices[s]=o,te.polygonIndices[h]=l,te.primitivePolygonIndices[p]=l;let F={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let ue of t){let oe=ue.geometry,J=ue.properties||{};switch(oe.type){case"Point":RBe(oe,q,F,E,J),q.properties.push(w5(J,P)),W&&q.fields.push({id:ue.id}),F.pointFeature++;break;case"LineString":LBe(oe,$,F,E,J),$.properties.push(w5(J,P)),W&&$.fields.push({id:ue.id}),F.lineFeature++;break;case"Polygon":OBe(oe,te,F,E,J),te.properties.push(w5(J,P)),W&&te.fields.push({id:ue.id}),F.polygonFeature++;break;default:throw new Error("Invalid geometry type")}F.feature++}return DBe(q,$,te,E)}function RBe(t,e,r,n,i){e.positions.set(t.data,r.pointPosition*n);let o=t.data.length/n;E5(e,i,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 LBe(t,e,r,n,i){e.positions.set(t.data,r.linePosition*n);let o=t.data.length/n;E5(e,i,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,c=t.indices.length;s<c;++s){let l=t.indices[s],h=s===c-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(h-l)/n}}function OBe(t,e,r,n,i){e.positions.set(t.data,r.polygonPosition*n);let o=t.data.length/n;E5(e,i,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,c=t.indices.length;s<c;++s){let l=r.polygonPosition;e.polygonIndices[r.polygonObject++]=l;let h=t.areas[s],p=t.indices[s],x=t.indices[s+1];for(let E=0,P=p.length;E<P;++E){let B=p[E],D=E===P-1?x===void 0?t.data.length:x[0]:p[E+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(D-B)/n}let w=r.polygonPosition;BBe(e,h,p,{startPosition:l,endPosition:w,coordLength:n})}}function BBe(t,e,r,{startPosition:n,endPosition:i,coordLength:o}){if(!t.triangles)return;let s=n*o,c=i*o,l=t.positions.subarray(s,c),h=r[0],p=r.slice(1).map(w=>(w-h)/o),x=v5(l,p,o,e);for(let w=0,E=x.length;w<E;++w)t.triangles.push(n+x[w])}function b5(t,e){let r={};for(let n in t)r[n]={value:t[n],size:e};return r}function DBe(t,e,r,n){let i={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:b5(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:b5(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:n},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:b5(r.numericProps,1)}};return i.polygons&&r.triangles&&(i.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),i}function E5(t,e,r,n){for(let i in t.numericProps)if(i in e){let o=e[i];t.numericProps[i].fill(o,r,r+n)}}function w5(t,e){let r={};for(let n in t)e.includes(n)||(r[n]=t[n]);return r}function NBe(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function rI(t,e){let r=e?.globalFeatureId;return r!==void 0?kBe(t,r):FBe(t,e?.type)}function kBe(t,e){let r=Aie(t);for(let n of r){let i=0,o=n.featureIds.value[0];for(let s=0;s<n.featureIds.value.length;s++){let c=n.featureIds.value[s];if(c!==o){if(e===n.globalFeatureIds.value[i])return eI(n,i,s);i=s,o=c}}if(e===n.globalFeatureIds.value[i])return eI(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function FBe(t,e){let r=Aie(t,e);return zBe(r)}function mie(t,e,r){switch(t.type){case"Point":return HBe(t,e,r);case"LineString":return jBe(t,e,r);case"Polygon":return gie(t,e,r);default:let n=t;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function Aie(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 zBe(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==i&&(e.push(eI(r,n,o)),n=o,i=s)}e.push(eI(r,n,r.featureIds.value.length))}return e}function eI(t,e,r){let n=mie(t,e,r),i=VBe(t,e,r),o=UBe(t,e,r);return{type:"Feature",geometry:n,properties:i,...o}}function UBe(t,e=0,r){return t.fields&&t.fields[t.featureIds.value[e]]}function VBe(t,e=0,r){let n=Object.assign({},t.properties[t.featureIds.value[e]]);for(let i in t.numericProps)n[i]=t.numericProps[i].value[e];return n}function gie(t,e=-1/0,r=1/0){let{positions:n}=t,i=t.polygonIndices.value.filter(l=>l>=e&&l<=r),o=t.primitivePolygonIndices.value.filter(l=>l>=e&&l<=r);if(!(i.length>2)){let l=[];for(let h=0;h<o.length-1;h++){let p=o[h],x=o[h+1],w=tI(n,p,x);l.push(w)}return{type:"Polygon",coordinates:l}}let c=[];for(let l=0;l<i.length-1;l++){let h=i[l],p=i[l+1],x=gie(t,h,p).coordinates;c.push(x)}return{type:"MultiPolygon",coordinates:c}}function jBe(t,e=-1/0,r=1/0){let{positions:n}=t,i=t.pathIndices.value.filter(c=>c>=e&&c<=r);if(!(i.length>2))return{type:"LineString",coordinates:tI(n,i[0],i[1])};let s=[];for(let c=0;c<i.length-1;c++){let l=tI(n,i[c],i[c+1]);s.push(l)}return{type:"MultiLineString",coordinates:s}}function HBe(t,e,r){let{positions:n}=t,i=tI(n,e,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function tI(t,e,r){e=e||0,r=r||t.value.length/t.size;let n=[];for(let i=e;i<r;i++){let o=Array();for(let s=i*t.size;s<(i+1)*t.size;s++)o.push(Number(t.value[s]));n.push(o)}return n}var L5=ec(Tie(),1);function Eie(t){let e=t.length;if(e<=1)return[t];let r=[],n,i;for(let o=0;o<e;o++){let s=a4e(t[o]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&r.push(n),r}function a4e(t){let e=0;for(let r=0,n=t.length-1,i,o;r<t.length;n=r++)i=t[r],o=t[n],e+=(o[0]-i[0])*(i[1]+o[1]);return e}function Mie(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?c4e(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function c4e(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var S1=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,n,i,o){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(Mie,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,c=[],l;for(;e.pos<r;){if(i<=0){let h=e.readVarint();n=h&7,i=h>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),n===1&&(l&&c.push(l),l=[]),l&&l.push([o,s]);else if(n===7)l&&l.push(l[0].slice());else throw new Error(`unknown command ${n}`)}return l&&c.push(l),c}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,c=1/0,l=-1/0,h=1/0,p=-1/0;for(;e.pos<r;){if(i<=0){let x=e.readVarint();n=x&7,i=x>>3}if(i--,n===1||n===2)o+=e.readSVarint(),s+=e.readSVarint(),o<c&&(c=o),o>l&&(l=o),s<h&&(h=s),s>p&&(p=s);else if(n!==7)throw new Error(`unknown command ${n}`)}return[c,h,l,p]}_toGeoJSON(e){let r=this.loadGeometry(),n=S1.types[this.type],i,o;switch(this.type){case 1:let c=[];for(i=0;i<r.length;i++)c[i]=r[i][0];r=c,e(r,this);break;case 2:for(i=0;i<r.length;i++)e(r[i],this);break;case 3:for(r=Eie(r),i=0;i<r.length;i++)for(o=0;o<r[i].length;o++)e(r[i][o],this);break}r.length===1?r=r[0]:n=`Multi${n}`;let s={type:"Feature",geometry:{type:n,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:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,c=this.extent*n;function l(h){for(let p=0;p<h.length;p++){let x=h[p];x[0]=(x[0]+s)*360/o-180;let w=180-(x[1]+c)*360/o;x[1]=360/Math.PI*Math.atan(Math.exp(w*Math.PI/180))-90}}return this._toGeoJSON(l)}};var oI=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(l4e,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 S1(this._pbf,r,this.extent,this._keys,this._values)}};function l4e(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(u4e(r)))}function u4e(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var sI=class{layers;constructor(e,r){this.layers=e.readFields(h4e,{},r)}};function h4e(t,e,r){if(t===3&&r){let n=new oI(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function Sie(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[rg(t.data)]],indices:[t.indices]};let n=[],i=[],o=[],s=[],c,l=0;for(let h,p=0,x;p<e;p++){x=t.indices[p]-l,h=t.indices[p+1]-l||t.data.length;let w=t.data.slice(x,h),E=rg(w);if(E===0){let P=t.data.slice(0,x),B=t.data.slice(h);t.data=P.concat(B),l+=h-x;continue}c===void 0&&(c=E<0),c===E<0?(s.length&&(n.push(o),i.push(s)),s=[x],o=[E]):(o.push(E),s.push(x))}return o&&n.push(o),s.length&&i.push(s),{type:r,areas:n,indices:i,data:t.data}}function Cie(t,e,r,n){for(let i=0,o=t.length;i<o;i+=2){t[i]=(t[i]+e)*360/n-180;let s=180-(t[i+1]+r)*360/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function Pie(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?f4e(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function f4e(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}var Iie,ig,C5,aI,P5,I5,Nw;var cI=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(e,r,n,i,o,s){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=s,e.readFields(Pie,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,Iie=e.readVarint()+e.pos,ig=1,aI=0,P5=0,I5=0,Nw=0;let r=[],n=[];for(;e.pos<Iie;)if(aI<=0&&(C5=e.readVarint(),ig=C5&7,aI=C5>>3),aI--,ig===1||ig===2)P5+=e.readSVarint(),I5+=e.readSVarint(),ig===1&&r.push(Nw),n.push(P5,I5),Nw+=2;else if(ig===7){if(Nw>0){let i=r[r.length-1];n.push(n[i],n[i+1]),Nw+=2}}else throw new Error(`unknown command ${ig}`);return{data:n,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),n;e(r.data,this);let i=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,n={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/i,n={type:"LineString",...r};break;case 3:n=Sie(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let s of n.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=n.data.length/i;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:n,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:n,z:i}=e,o=this.extent*Math.pow(2,i),s=this.extent*r,c=this.extent*n;return this._toBinaryCoordinates(l=>Cie(l,s,c,o))}};var lI=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(p4e,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 n=this._pbf.readVarint()+this._pbf.pos;return new cI(this._pbf,n,this.extent,this._keys,this._values,r)}};function p4e(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(d4e(r)))}function d4e(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}var uI=class{layers;constructor(e,r){this.layers=e.readFields(m4e,{},r)}};function m4e(t,e,r){if(t===3&&r){let n=new lI(r,r.readVarint()+r.pos);n.length&&e&&(e[n.name]=n)}}function O5(t,e){let r=g4e(e),n=e?.gis?.format||e?.mvt?.shape||e?.shape;switch(n){case"columnar-table":return{shape:"columnar-table",data:R5(t,r)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:Rie(t,r)};case"geojson":return Rie(t,r);case"binary-geometry":return R5(t,r);case"binary":return R5(t,r);default:throw new Error(n||"undefined shape")}}function R5(t,e){let[r,n]=A4e(t,e),i=T5(r,n);return i.byteLength=t.byteLength,i}function A4e(t,e){let r=[],n={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,n];let i=new uI(new L5.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(s=>{let c=i.layers[s];if(c)for(let l=0;l<c.length;l++){let h=c.feature(l,n),p=y4e(h,e,s);r.push(p)}}),[r,n]}function Rie(t,e){if(t.byteLength<=0)return[];let r=[],n=new sI(new L5.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(o=>{let s=n.layers[o];if(s)for(let c=0;c<s.length;c++){let l=s.feature(c),h=_4e(l,e,o);r.push(h)}}),r}function g4e(t){if(!t?.mvt)throw new Error("mvt options required");let e=t.mvt?.coordinates==="wgs84",{tileIndex:r}=t.mvt,n=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(e&&!n)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function _4e(t,e,r){let n=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:x4e);return e.layerProperty&&(n.properties[e.layerProperty]=r),n}function y4e(t,e,r){let n=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:v4e);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=r),n}function x4e(t,e){let{extent:r}=e;for(let n=0;n<t.length;n++){let i=t[n];i[0]/=r,i[1]/=r}}function v4e(t,e){let{extent:r}=e;for(let n=0,i=t.length;n<i;++n)t[n]/=r}var b4e="4.2.1",hI={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:b4e,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}}},w4e={...hI,parse:async(t,e)=>O5(t,e),parseSync:O5,binary:!0};var T4e={Point:Lie,MultiPoint:E4e,LineString:Oie,MultiLineString:M4e,Polygon:Bie,MultiPolygon:S4e};function Lie([t,e],[r,n],i){let o=ka(r[0],n[0],t),s=ka(r[1],n[1],e);return i.unprojectFlat([o,s])}function B5(t,e,r){return t.map(n=>Lie(n,e,r))}function E4e(t,e,r){return B5(t,e,r)}function Oie(t,e,r){return B5(t,e,r)}function M4e(t,e,r){return t.map(n=>Oie(n,e,r))}function Bie(t,e,r){return t.map(n=>B5(n,e,r))}function S4e(t,e,r){return t.map(n=>Bie(n,e,r))}function Die(t,e,r){let n=r.projectFlat([e.west,e.north]),i=r.projectFlat([e.east,e.south]),o=[n,i];return{...t,coordinates:T4e[t.type](t.coordinates,o,r)}}var C4e=["points","lines","polygons"];function D5(t,e,r,n){for(let i of C4e){let o=t[i]&&P4e(t[i],e,r,n);if(o>=0)return o}return-1}function P4e(t,e,r,n){let i=t.featureIds.value;if(!i.length)return-1;let o=0,s=i[i.length-1]+1;if(n){let l=I4e(t,n);if(l)o=l[0],s=l[1]+1;else return-1}let c=-1;if(e in t.numericProps){let l=t.numericProps[e].value.findIndex((h,p)=>h===r&&i[p]>=o&&i[p]<s);return l>=0?t.globalFeatureIds.value[l]:-1}else e?c=Nie(t.properties,l=>l[e]===r,o,s):t.fields&&(c=Nie(t.fields,l=>l.id===r,o,s));return c>=0?R4e(t,c):-1}function I4e(t,e){if(!t.__layers){let r={},{properties:n}=t;for(let i=0;i<n.length;i++){let{layerName:o}=n[i];o&&(r[o]?r[o][1]=i:r[o]=[i,i])}t.__layers=r}return t.__layers[e]}function R4e(t,e){if(!t.__ids){let r=[],n=t.featureIds.value,i=t.globalFeatureIds.value;for(let o=0;o<n.length;o++)r[n[o]]=i[o];t.__ids=r}return t.__ids[e]}function Nie(t,e,r,n){for(let i=r;i<n;i++)if(e(t[i],i))return i;return-1}var N5=512,L4e={...C0.defaultProps,data:Bm,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[hI],binary:!0},kw=class extends D0{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:n,changeFlags:i}){i.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:n,changeFlags:i}),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"&&!TN(e)){let{onDataLoad:n,fetch:i}=this.props;this.setState({data:null,tileJSON:null});try{r=await i(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}n&&n(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:n,maxZoom:i}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>n&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(i)||r.maxzoom<i)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:n}=this.state,{index:i,signal:o}=e,s=Qf(r,e);if(!s)return Promise.reject("Invalid URL");let c=this.getLoadOptions(),{fetch:l}=this.props;return c={...c,mimeType:"application/x-protobuf",mvt:{...c?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:i},gis:n?{format:"binary"}:{}},l(s,{propName:"data",layer:this,loadOptions:c,signal:o})}renderSubLayers(e){let{x:r,y:n,z:i}=e.tile.index,o=Math.pow(2,i),s=N5/o,c=-s,l=N5*r/o,h=N5*(1-n/o),p=new Fn().scale([s,c,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=p,e.coordinateOrigin=[l,h,0],e.coordinateSystem=Yr.CARTESIAN,e.extensions=[...e.extensions||[],new y5]);let x=super.renderSubLayers(e);return this.state.binary&&!(x instanceof C0)&&br.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),x}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,o=e.object,s=null,c=null;o&&(s=k5(o,r),c=kie(o));let{highlightColor:l}=this.props;typeof l=="function"&&(l=l(e)),(n!==s||i!==c)&&this.setState({highlightColor:l,hoveredFeatureId:s,hoveredFeatureLayerName:c})}_isWGS84(){return Boolean(this.context.viewport.resolution)}getPickingInfo(e){let r=super.getPickingInfo(e);if(this.state.binary&&r.index!==-1){let{data:n}=e.sourceLayer.props;r.object=rI(n,{globalFeatureId:r.index})}return r.object&&!this._isWGS84()&&(r.object=zie(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:n,binary:i}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,c=e.content,l=Fie(s);if(!(Fie(r)||l))return-1;let p=l?s:r;return Array.isArray(c)?c.findIndex(x=>{let w=k5(x,o)===p,E=l||kie(x)===n;return w&&E}):c&&i?D5(c,o,p,l?"":n):-1}_pickObjects(e){let{deck:r,viewport:n}=this.context,i=n.width,o=n.height,s=n.x,c=n.y,l=[this.id];return r.pickObjects({x:s,y:c,width:i,height:o,layerIds:l,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),n=new Set,i=[];for(let o of r){let s=k5(o.object,this.props.uniqueIdProperty);s===void 0?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}return i}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(n=>{n.hasOwnProperty(e)||Object.defineProperty(n,e,{get:()=>{if(!n.content)return null;if(this.state.binary&&Array.isArray(n.content)&&!n.content.length)return[];let{bbox:i}=n;if(n._contentWGS84===void 0&&EN(i)){let o=this.state.binary?rI(n.content):n.content;n._contentWGS84=o.map(s=>zie(s,i,this.context.viewport))}return n._contentWGS84}})})}};kw.layerName="MVTLayer";kw.defaultProps=L4e;var Uie=kw;function k5(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function kie(t){return t.properties?.layerName||null}function Fie(t){return t!=null&&t!==""}function zie(t,e,r){let n={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(n.geometry,"coordinates",{get:()=>Die(t.geometry,e,r).coordinates}),n}var Vie="0123456789bcdefghjkmnpqrstuvwxyz",jie={};for(let t=0;t<Vie.length;t++)jie[Vie.charAt(t)]=t;var O4e=-90,B4e=90,D4e=-180,N4e=180;function k4e(t){let e=!0,r=B4e,n=O4e,i=N4e,o=D4e,s,c=0;for(let l=0,h=t.length;l<h;l++){let p=t[l].toLowerCase();c=jie[p];for(let x=4;x>=0;x--){let w=c>>x&1;e?(s=(i+o)/2,w===1?o=s:i=s):(s=(r+n)/2,w===1?n=s:r=s),e=!e}}return[n,o,r,i]}function Hie(t){let[e,r,n,i]=k4e(t);return[i,n,i,e,r,e,r,n,i,n]}var F4e={getGeohash:{type:"accessor",value:t=>t.geohash}},Fw=class extends Zf{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>Hie(r(n,i))}}};Fw.layerName="GeohashLayer";Fw.defaultProps=F4e;var Wie=Fw;function C1(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function Gie(t,e){let r=U4e(e),n=t;for(let i of r)n=z4e(n)?n[i]:void 0;return n}function z4e(t){return t!==null&&typeof t=="object"}var qie={};function U4e(t){if(typeof t=="string"){let e=qie[t];return e||(e=t.split("."),qie[t]=e),e}return Array.isArray(t)?t:[t]}var F5=ec(Xie(),1);var Yie={"||":(t,e)=>t||e,"&&":(t,e)=>t&&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e},V4e={"-":t=>-t,"+":t=>+t,"~":t=>~t,"!":t=>!t};function Kie(t,e){return t.map(function(r){return sc(r,e)})}function Zie(t,e){let r=sc(t.object,e),n;if(t.computed?n=sc(t.property,e):n=t.property.name,/^__proto__|prototype|constructor$/.test(n))throw Error(`Access to member "${n}" disallowed.`);return[r,r[n]]}function sc(t,e){let r=t;switch(r.type){case"ArrayExpression":return Kie(r.elements,e);case"BinaryExpression":return Yie[r.operator](sc(r.left,e),sc(r.right,e));case"CallExpression":let n,i,o;return r.callee.type==="MemberExpression"?(o=Zie(r.callee,e),n=o[0],i=o[1]):i=sc(r.callee,e),typeof i!="function"?void 0:i.apply(n,Kie(r.arguments,e));case"ConditionalExpression":return sc(r.test,e)?sc(r.consequent,e):sc(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?sc(r.left,e)||sc(r.right,e):r.operator==="&&"?sc(r.left,e)&&sc(r.right,e):Yie[r.operator](sc(r.left,e),sc(r.right,e));case"MemberExpression":return Zie(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return V4e[r.operator](sc(r.argument,e));default:return}}var z5={"-":t=>t};function og(t,e){if(t in z5)return z5[t];let r,n=(0,F5.default)(t);return n.type==="Identifier"?r=i=>Gie(i,t):(U5(n,i=>{if(i.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=i=>sc(n,i)),z5[t]=r,r}function U5(t,e){if(Array.isArray(t))t.forEach(r=>U5(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)U5(t[r],e)}}var P1="@@=",V5="@@#",$ie="@@type",pI="@@function";var Qie=t=>t&&typeof t=="object",yd=class{constructor(...e){this.typeKey=$ie,this.functionKey=pI,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=og,this.preProcessClassProps=(r,n)=>n,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 n=e[r];this[r]=Qie(this[r])?Object.assign(this[r],n):n}}}validate(e){return C1(!this.typeKey||typeof this.typeKey=="string"),C1(Qie(this.classes)),!0}};function j4e(t){return typeof t=="string"&&t.startsWith(P1)}function H4e(t){return t.replace(P1,"")}function I1(t,e){let r={};for(let n in t){let i=t[n];j4e(i)&&(i=H4e(i),i=og(i,e)),r[n]=i}return r}function Jie(t,e,r){let n=r.classes[t],i=r.reactComponents[t];if(!n&&!i){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 n?W4e(n,e,r):q4e(i,e,r)}function W4e(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=I1(e,r),new t(e)}function q4e(t,e,r){let{React:n}=r,{children:i=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=I1(e,r),n.createElement(t,e,i)}function eoe(t,e,r){let n=r.functions[t];if(!n){let{log:i}=r;if(i){let o=JSON.stringify(e,null,0).slice(0,40);i.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return n(e)}function j5(t){return typeof t=="string"?JSON.parse(t):t}var H5=t=>t&&typeof t=="object",sg=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=j5(e),n=G4e(r,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}convertJson(e){return this.convert(e)}};function G4e(t,e){return e=new yd(e),W5(t,"",e)}function W5(t,e,r){return Array.isArray(t)?t.map((n,i)=>W5(n,String(i),r)):X4e(t,r)?Y4e(t,r):H5(t)?pI in t?K4e(t,r):q5(t,r):typeof t=="string"?Z4e(t,e,r):t}function X4e(t,e){let{typeKey:r}=e;return H5(t)&&Boolean(t[r])}function Y4e(t,e){let{typeKey:r}=e,n=t[r],i={...t};return delete i[r],i=q5(i,e),Jie(n,i,e)}function K4e(t,e){let{functionKey:r}=e,n=t[r],i={...t};return delete i[r],i=q5(i,e),eoe(n,i,e)}function q5(t,e){C1(H5(t));let r={};for(let n in t){let i=t[n];r[n]=W5(i,n,e)}return r}function Z4e(t,e,r){if(t.startsWith(P1)&&r.convertFunction)return t=t.replace(P1,""),r.convertFunction(t,r);if(t.startsWith(V5)){if(t=t.replace(V5,""),r.constants[t])return r.constants[t];let[n,i]=t.split(".");return r.enumerations[n][i]}return t}var R1={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},op=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:n}){e&&(R1.onInitialize=e),r&&(R1.onFinalize=r),n&&(R1.onMessage=n)}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};R1.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};R1.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),R1.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))try{return JSON.parse(JSON.stringify(i))}catch{return}r.add(i)}return i})}};function toe(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 _I,hs,soe,$4e,ag,roe,aoe,G5,Z5,X5,Y5,Q4e,Uw={},coe=[],J4e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$5=Array.isArray;function Qm(t,e){for(var r in e)t[r]=e[r];return t}function loe(t){var e=t.parentNode;e&&e.removeChild(t)}function eDe(t,e,r){var n,i,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?_I.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return mI(t,s,n,i,null)}function mI(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++soe,__i:-1,__u:0};return i==null&&hs.vnode!=null&&hs.vnode(o),o}function L1(t){return t.children}function AI(t,e){this.props=t,this.context=e}function cg(t,e){if(e==null)return t.__?cg(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?cg(t):null}function uoe(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return uoe(t)}}function noe(t){(!t.__d&&(t.__d=!0)&&ag.push(t)&&!gI.__r++||roe!==hs.debounceRendering)&&((roe=hs.debounceRendering)||aoe)(gI)}function gI(){var t,e,r,n,i,o,s,c;for(ag.sort(G5);t=ag.shift();)t.__d&&(e=ag.length,n=void 0,o=(i=(r=t).__v).__e,s=[],c=[],r.__P&&((n=Qm({},i)).__v=i.__v+1,hs.vnode&&hs.vnode(n),Q5(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[o]:null,s,o??cg(i),!!(32&i.__u),c),n.__v=i.__v,n.__.__k[n.__i]=n,poe(s,n,c),n.__e!=o&&uoe(n)),ag.length>e&&ag.sort(G5));gI.__r=0}function hoe(t,e,r,n,i,o,s,c,l,h,p){var x,w,E,P,B,D=n&&n.__k||coe,W=e.length;for(r.__d=l,tDe(r,e,D),l=r.__d,x=0;x<W;x++)(E=r.__k[x])!=null&&typeof E!="boolean"&&typeof E!="function"&&(w=E.__i===-1?Uw:D[E.__i]||Uw,E.__i=x,Q5(t,E,w,i,o,s,c,l,h,p),P=E.__e,E.ref&&w.ref!=E.ref&&(w.ref&&J5(w.ref,null,E),p.push(E.ref,E.__c||P,E)),B==null&&P!=null&&(B=P),65536&E.__u||w.__k===E.__k?l=foe(E,l,t):typeof E.type=="function"&&E.__d!==void 0?l=E.__d:P&&(l=P.nextSibling),E.__d=void 0,E.__u&=-196609);r.__d=l,r.__e=B}function tDe(t,e,r){var n,i,o,s,c,l=e.length,h=r.length,p=h,x=0;for(t.__k=[],n=0;n<l;n++)s=n+x,(i=t.__k[n]=(i=e[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?mI(null,i,null,null,null):$5(i)?mI(L1,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?mI(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,c=rDe(i,r,s,p),i.__i=c,o=null,c!==-1&&(p--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&x--,typeof i.type!="function"&&(i.__u|=65536)):c!==s&&(c==s-1?x--:c==s+1?x++:c>s?p>l-s?x+=c-s:x--:c<s&&(c==s-x?x-=c-s:x++),c!==n+x&&(i.__u|=65536))):(o=r[s])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=cg(o)),K5(o,o,!1),r[s]=null,p--);if(p)for(n=0;n<h;n++)(o=r[n])!=null&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=cg(o)),K5(o,o))}function foe(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=foe(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=cg(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function rDe(t,e,r,n){var i=t.key,o=t.type,s=r-1,c=r+1,l=e[r];if(l===null||l&&i==l.key&&o===l.type&&!(131072&l.__u))return r;if(n>(l!=null&&!(131072&l.__u)?1:0))for(;s>=0||c<e.length;){if(s>=0){if((l=e[s])&&!(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(c<e.length){if((l=e[c])&&!(131072&l.__u)&&i==l.key&&o===l.type)return c;c++}}return-1}function ioe(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||J4e.test(e)?r:r+"px"}function dI(t,e,r,n,i){var o;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||ioe(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||ioe(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n?r.u=n.u:(r.u=Z5,t.addEventListener(e,o?Y5:X5,o)):t.removeEventListener(e,o?Y5:X5,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function ooe(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Z5++;else if(e.t<r.u)return;return r(hs.event?hs.event(e):e)}}}function Q5(t,e,r,n,i,o,s,c,l,h){var p,x,w,E,P,B,D,W,X,q,$,te,F,ue,oe,J,G=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=e.__e=r.__e]),(p=hs.__b)&&p(e);e:if(typeof G=="function")try{if(W=e.props,X="prototype"in G&&G.prototype.render,q=(p=G.contextType)&&n[p.__c],$=p?q?q.props.value:p.__:n,r.__c?D=(x=e.__c=r.__c).__=x.__E:(X?e.__c=x=new G(W,$):(e.__c=x=new AI(W,$),x.constructor=G,x.render=iDe),q&&q.sub(x),x.props=W,x.state||(x.state={}),x.context=$,x.__n=n,w=x.__d=!0,x.__h=[],x._sb=[]),X&&x.__s==null&&(x.__s=x.state),X&&G.getDerivedStateFromProps!=null&&(x.__s==x.state&&(x.__s=Qm({},x.__s)),Qm(x.__s,G.getDerivedStateFromProps(W,x.__s))),E=x.props,P=x.state,x.__v=e,w)X&&G.getDerivedStateFromProps==null&&x.componentWillMount!=null&&x.componentWillMount(),X&&x.componentDidMount!=null&&x.__h.push(x.componentDidMount);else{if(X&&G.getDerivedStateFromProps==null&&W!==E&&x.componentWillReceiveProps!=null&&x.componentWillReceiveProps(W,$),!x.__e&&(x.shouldComponentUpdate!=null&&x.shouldComponentUpdate(W,x.__s,$)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(x.props=W,x.state=x.__s,x.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(me){me&&(me.__=e)}),te=0;te<x._sb.length;te++)x.__h.push(x._sb[te]);x._sb=[],x.__h.length&&s.push(x);break e}x.componentWillUpdate!=null&&x.componentWillUpdate(W,x.__s,$),X&&x.componentDidUpdate!=null&&x.__h.push(function(){x.componentDidUpdate(E,P,B)})}if(x.context=$,x.props=W,x.__P=t,x.__e=!1,F=hs.__r,ue=0,X){for(x.state=x.__s,x.__d=!1,F&&F(e),p=x.render(x.props,x.state,x.context),oe=0;oe<x._sb.length;oe++)x.__h.push(x._sb[oe]);x._sb=[]}else do x.__d=!1,F&&F(e),p=x.render(x.props,x.state,x.context),x.state=x.__s;while(x.__d&&++ue<25);x.state=x.__s,x.getChildContext!=null&&(n=Qm(Qm({},n),x.getChildContext())),X&&!w&&x.getSnapshotBeforeUpdate!=null&&(B=x.getSnapshotBeforeUpdate(E,P)),hoe(t,$5(J=p!=null&&p.type===L1&&p.key==null?p.props.children:p)?J:[J],e,r,n,i,o,s,c,l,h),x.base=e.__e,e.__u&=-161,x.__h.length&&s.push(x),D&&(x.__E=x.__=null)}catch(me){if(e.__v=null,l||o!=null){for(e.__u|=l?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,e.__e=c}else e.__e=r.__e,e.__k=r.__k;hs.__e(me,e,r)}else o==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=nDe(r.__e,e,r,n,i,o,s,l,h);(p=hs.diffed)&&p(e)}function poe(t,e,r){e.__d=void 0;for(var n=0;n<r.length;n++)J5(r[n],r[++n],r[++n]);hs.__c&&hs.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){hs.__e(o,i.__v)}})}function nDe(t,e,r,n,i,o,s,c,l){var h,p,x,w,E,P,B,D=r.props,W=e.props,X=e.type;if(X==="svg"?i="http://www.w3.org/2000/svg":X==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(h=0;h<o.length;h++)if((E=o[h])&&"setAttribute"in E==!!X&&(X?E.localName===X:E.nodeType===3)){t=E,o[h]=null;break}}if(t==null){if(X===null)return document.createTextNode(W);t=document.createElementNS(i,X,W.is&&W),o=null,c=!1}if(X===null)D===W||c&&t.data===W||(t.data=W);else{if(o=o&&_I.call(t.childNodes),D=r.props||Uw,!c&&o!=null)for(D={},h=0;h<t.attributes.length;h++)D[(E=t.attributes[h]).name]=E.value;for(h in D)if(E=D[h],h!="children"){if(h=="dangerouslySetInnerHTML")x=E;else if(h!=="key"&&!(h in W)){if(h=="value"&&"defaultValue"in W||h=="checked"&&"defaultChecked"in W)continue;dI(t,h,null,E,i)}}for(h in W)E=W[h],h=="children"?w=E:h=="dangerouslySetInnerHTML"?p=E:h=="value"?P=E:h=="checked"?B=E:h==="key"||c&&typeof E!="function"||D[h]===E||dI(t,h,E,D[h],i);if(p)c||x&&(p.__html===x.__html||p.__html===t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(x&&(t.innerHTML=""),hoe(t,$5(w)?w:[w],e,r,n,X==="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:r.__k&&cg(r,0),c,l),o!=null)for(h=o.length;h--;)o[h]!=null&&loe(o[h]);c||(h="value",P!==void 0&&(P!==t[h]||X==="progress"&&!P||X==="option"&&P!==D[h])&&dI(t,h,P,D[h],i),h="checked",B!==void 0&&B!==t[h]&&dI(t,h,B,D[h],i))}return t}function J5(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){hs.__e(i,r)}}function K5(t,e,r){var n,i;if(hs.unmount&&hs.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||J5(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){hs.__e(o,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&K5(n[i],e,r||typeof t.type!="function");r||t.__e==null||loe(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function iDe(t,e,r){return this.constructor(t,r)}function O1(t,e,r){var n,i,o,s;hs.__&&hs.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,o=[],s=[],Q5(e,t=(!n&&r||e).__k=eDe(L1,null,[t]),i||Uw,Uw,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?_I.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n,s),poe(o,t,s)}_I=coe.slice,hs={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(c){t=c}throw t}},soe=0,$4e=function(t){return t!=null&&t.constructor==null},AI.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Qm({},this.state),typeof t=="function"&&(t=t(Qm({},r),this.props)),t&&Qm(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),noe(this))},AI.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),noe(this))},AI.prototype.render=L1,ag=[],aoe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,G5=function(t,e){return t.__v.__b-e.__v.__b},gI.__r=0,Z5=0,X5=ooe(!1),Y5=ooe(!0),Q4e=0;var oDe=0,iDt=Array.isArray;function Ys(t,e,r,n,i,o){e||(e={});var s,c,l=e;if("ref"in l)for(c in l={},e)c=="ref"?s=e[c]:l[c]=e[c];var h={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--oDe,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(s=t.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return hs.vnode&&hs.vnode(h),h}var doe=t=>{let{className:e,label:r,onClick:n}=t;return Ys("div",{className:"deck-widget-button",children:Ys("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:n,title:r,children:Ys("div",{className:"deck-widget-icon"})})})},moe=t=>{let{children:e,orientation:r}=t;return Ys("div",{className:`deck-widget-button-group ${r}`,children:e})},e6=t=>{let{className:e,label:r,onClick:n}=t;return Ys("button",{className:`deck-widget-icon-button ${e}`,type:"button",onClick:n,title:r,children:Ys("div",{className:"deck-widget-icon"})})};var yI=class{constructor(e){this.id="fullscreen",this.placement="top-left",this.fullscreen=!1,this.id=e.id??this.id,this.placement=e.placement??this.placement,this.props={...e,enterLabel:e.enterLabel??"Enter Fullscreen",exitLabel:e.exitLabel??"Exit Fullscreen",style:e.style??{}}}onAdd({deck:e}){let{style:r,className:n}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-fullscreen"),n&&i.classList.add(n),zh(i,r),this.deck=e,this.element=i,this.update(),document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this)),i}onRemove(){this.deck=void 0,this.element=void 0,document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}update(){let{enterLabel:e,exitLabel:r}=this.props,n=this.element;if(!n)return;let i=Ys(doe,{onClick:this.handleClick.bind(this),label:this.fullscreen?r:e,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"});O1(i,n)}setProps(e){this.placement=e.placement??this.placement;let r=this.props,n=this.element;n&&(r.className!==e.className&&(r.className&&n.classList.remove(r.className),e.className&&n.classList.add(e.className)),Oi(r.style,e.style,1)||(bm(n,r.style),zh(n,e.style))),Object.assign(this.props,e),this.update()}getContainer(){return this.props.container||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,r=document.fullscreenElement===this.getContainer();e!==r&&(this.fullscreen=!this.fullscreen),this.update()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.update()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};var xI=class{constructor(e){this.id="compass",this.placement="top-left",this.viewId=null,this.viewports={},this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...e,transitionDuration:e.transitionDuration??200,label:e.label??"Reset Compass",style:e.style??{}}}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==e.className&&(r.className&&n.classList.remove(r.className),e.className&&n.classList.add(e.className)),Oi(r.style,e.style,1)||(bm(n,r.style),zh(n,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.update())}onAdd({deck:e}){let{style:r,className:n}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-compass"),n&&i.classList.add(n),zh(i,r),this.deck=e,this.element=i,this.update(),i}getRotation(e){return e instanceof Uc?[-e.bearing,e.pitch]:e instanceof Fh?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}update(){let e=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",r=this.viewports[e],[n,i]=this.getRotation(r),o=this.element;if(!o)return;let s=Ys("div",{className:"deck-widget-button",style:{perspective:100},children:Ys("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.handleCompassReset(c)},title:this.props.label,style:{transform:`rotateX(${i}deg)`},children:Ys("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:Ys("g",{transform:`rotate(${n},13,13)`,children:[Ys("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, #F05C44)"}),Ys("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, #C2C2CC)"})]})})})});O1(s,o)}onRemove(){this.deck=void 0,this.element=void 0}handleCompassReset(e){let r=this.viewId||e.id||"default-view";if(e instanceof Uc){let n={...e,bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new td};this.deck._onViewStateChange({viewId:r,viewState:n,interactionState:{}})}}};var vI=class{constructor(e){this.id="zoom",this.placement="top-left",this.viewId=null,this.viewports={},this.id=e.id??this.id,this.viewId=e.viewId??this.viewId,this.placement=e.placement??this.placement,this.props={...e,orientation:e.orientation??"vertical",transitionDuration:e.transitionDuration??200,zoomInLabel:e.zoomInLabel??"Zoom In",zoomOutLabel:e.zoomOutLabel??"Zoom Out",style:e.style??{}}}onAdd({deck:e}){let{style:r,className:n}=this.props,i=document.createElement("div");return i.classList.add("deck-widget","deck-widget-zoom"),n&&i.classList.add(n),zh(i,r),this.deck=e,this.element=i,this.update(),i}onRemove(){this.deck=void 0,this.element=void 0}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId;let r=this.props,n=this.element;n&&(r.className!==e.className&&(r.className&&n.classList.remove(r.className),e.className&&n.classList.add(e.className)),Oi(r.style,e.style,1)||(bm(n,r.style),zh(n,e.style))),Object.assign(this.props,e),this.update()}onViewportChange(e){this.viewports[e.id]=e}handleZoom(e,r){let n=this.viewId||e?.id||"default-view",i={...e,zoom:r,transitionDuration:this.props.transitionDuration,transitionInterpolator:new td};this.deck._onViewStateChange({viewId:n,viewState:i,interactionState:{}})}handleZoomIn(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom+1)}handleZoomOut(){for(let e of Object.values(this.viewports))this.handleZoom(e,e.zoom-1)}update(){let e=this.element;if(!e)return;let r=Ys(moe,{orientation:this.props.orientation,children:[Ys(e6,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),Ys(e6,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});O1(r,e)}};var sDe={"--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},aDe={"--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},cDe={"--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"},lDe={"--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--icon-compass-north-color":"#F05C44","--icon-compass-south-color":"#C2C2CC"};var bI=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,n={...this.props,...e};if(this.props=n,!this.map)return;this._update(r,n)&&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:n}=e;r.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({container:n,maxZoom:24,...e.mapOptions,...Aoe(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1}),Object.defineProperty(n,"offsetWidth",{get:()=>this.width}),Object.defineProperty(n,"clientWidth",{get:()=>this.width}),Object.defineProperty(n,"offsetHeight",{get:()=>this.height}),Object.defineProperty(n,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,r){e.mapStyle!==r.mapStyle&&this.map.setStyle(r.mapStyle);let i=e.width!==r.width||e.height!==r.height;i&&(this.width=r.width,this.height=r.height,this.map.resize());let o=e.viewState,s=r.viewState,c=s.latitude!==o.latitude||s.longitude!==o.longitude||s.zoom!==o.zoom||s.pitch!==o.pitch||s.bearing!==o.bearing;return c&&this.map.jumpTo(Aoe(s)),i||c}};function Aoe(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing??0,pitch:t.pitch??0}}var goe={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function uDe(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 n=document.createElement("div");e.appendChild(n),Object.assign(n.style,goe);let i=document.createElement("canvas");return e.appendChild(i),Object.assign(i.style,goe),{container:e,mapCanvas:n,deckCanvas:i}}var lg=class extends cy{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:n}=uDe(e),i=e.viewState||e.initialViewState,o=Number.isFinite(i&&i.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:n,...e}),s&&s.Map?this._map=o&&new bI({...e,width:0,height:0,viewState:i,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 n=this.getViewports()[0];n&&this._map.setProps({width:n.width,height:n.height,viewState:n})}super._drawLayers(e,r)}};Rf.registerDevices([Na]);var _oe=t=>t.charAt(0)===t.charAt(0).toUpperCase(),hDe=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function t6(t={},e){let r={},n=Object.keys(t).filter(e);for(let i of n)r[i]=t[i];return r}var fDe={classes:t6(Vw,_oe),enumerations:{COORDINATE_SYSTEM:Yr,GL:Of}};HA([ov]);var Jm=new sg({configuration:fDe});function pDe(t,e){let r={classes:t6(t,_oe),functions:t6(t,hDe)};e.mergeConfiguration(r)}function dDe(t,e){if(!t)return;let r={};function n(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function i(o,s){pDe(s,Jm),r[o]=s,n()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){i(o,window[o]);return}Object.defineProperty(window,o,{set:c=>i(o,c),get:()=>r[o]}),W7(s)})}function yoe(t,e){let r=Jm.convert(t);e.setProps(r)}function mDe(t,e){return t.filter(r=>r&&r.id&&!e.find(n=>n.id===r.id))}function ADe({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:n,handleEvent:i,getTooltip:o,container:s,onError:c}){let l=i?{onClick:p=>i("deck-click-event",p),onHover:p=>i("deck-hover-event",p),onResize:p=>i("deck-resize-event",p),onViewStateChange:({viewState:p,interactionState:x,oldViewState:w})=>{let E=new Uc(p);p.nw=E.unproject([0,0]),p.se=E.unproject([E.width,E.height]),i("deck-view-state-change-event",p)},onDragStart:p=>i("deck-drag-start-event",p),onDrag:p=>i("deck-drag-event",p),onDragEnd:p=>i("deck-drag-end-event",p)}:{};l.onError=c;let h={...l,getTooltip:o,container:s};switch(t){case"mapbox":return br.info("Using Mapbox base maps")(),new lg({...h,...e,map:jO,mapboxApiAccessToken:r,onLoad:H7});case"carto":return br.info("Using Carto base maps")(),new lg({map:jO,...h,...e});case"google_maps":return br.info("Using Google Maps base maps")(),Iq({...h,...e,googleMapsKey:n});default:return br.info("No recognized map provider specified")(),new lg({...h,...e,map:null,mapboxApiAccessToken:null})}}function wI({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:n,tooltip:i,handleEvent:o,customLibraries:s,configuration:c,showError:l}){let h,p=x=>{if(l){let w=window.document.createElement("pre");w.textContent=`Error: ${x.message}
4466
+ Source: ${x.source}
4467
+ Line: ${x.lineno}:${x.colno}
4468
+ ${x.error?x.error.stack:""}`,w.className="error_text",r.appendChild(w)}console.error(x)};try{c&&Jm.mergeConfiguration(c);let x=n.layers||[],w=Jm.convert(n);CD(r,w);let E=(w.layers||[]).filter(X=>X),P=mDe(x,E),B=zO(i),{mapProvider:D}=w;h=ADe({mapProvider:D,props:w,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:B,container:r,onError:p}),dDe(s,()=>{if(P.length){let q=(Jm.convert({layers:n.layers}).layers||[]).filter($=>$);q.length>E.length&&h.setProps({layers:q})}})}catch(x){p(x)}return h}function TI(){op.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:n,mapboxApiKey:i,jsonInput:o,tooltip:s}=xDe(t);j7();let c=t.getRootDOMElement(),l=z7(e,r);c.appendChild(l);let h=JSON.parse(o),p=wI({mapboxApiKey:i,container:l,jsonInput:h,tooltip:s,handleEvent:(x,w)=>yDe(t,x,w),customLibraries:n});t.userData.deck=p},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:n}){let{deck:i}=t.userData,o;switch(e){case"json":o=Jm.convert(r),i.setProps(o);break;case"json-with-binary":o=Jm.convert(r);let s=t.jupyterModel.get("data_buffer"),c=gDe({binary:s,convertedJson:o});i.setProps(c);break;default:}}})}function gDe({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let n=e.layers[r].id,i=e.layers[r];e.layers[r]=i.clone({data:t[n]})}return e}function _De(t,e){return e instanceof qi?e.id:e}function yDe(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let n=JSON.parse(JSON.stringify(r,_De));t.sendJSONMessage(e,n)}function xDe(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 ug=class extends op{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let n=op._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(n)}};var zT={};Lo(zT,{CONTROL_COMM_PROTOCOL_VERSION:()=>ale,CONTROL_COMM_TARGET:()=>sle,CONTROL_COMM_TIMEOUT:()=>cle,DOMWidgetModel:()=>Sx,DOMWidgetView:()=>FT,IJupyterWidgetRegistry:()=>zze,JUPYTER_WIDGETS_VERSION:()=>BI,JupyterPhosphorPanelWidget:()=>O8,JupyterPhosphorWidget:()=>$R,LayoutModel:()=>B8,LayoutView:()=>D8,ManagerBase:()=>S6,PROTOCOL_VERSION:()=>DI,StyleModel:()=>QR,StyleView:()=>N8,ViewList:()=>F8,WidgetModel:()=>up,WidgetView:()=>gA,WrappedError:()=>Zw,assign:()=>xd,base64ToBuffer:()=>E6,bufferToBase64:()=>T6,bufferToHex:()=>aze,difference:()=>OI,hexToBuffer:()=>w6,isEqual:()=>W1,pack_models:()=>L8,put_buffers:()=>eA,reject:()=>cp,remove_buffers:()=>Qw,resolvePromisesDict:()=>q1,serialize_state:()=>lle,shims:()=>k8,unpack_models:()=>kT,uuid:()=>$w});var LI=ec(boe()),tle=ec(B1()),rle=ec(Kce()),nle=ec(ele());function OI(t,e){return t.filter(r=>e.indexOf(r)===-1)}function W1(t,e){return(0,rle.default)(t,e)}var xd=Object.assign||function(t){for(let e=1;e<arguments.length;e++){let r=arguments[e];for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function $w(){return tle.UUID.uuid4()}var Zw=class extends Error{constructor(e,r){super(e),console.warn("WrappedError has been deprecated!"),r instanceof Zw?this.error_stack=r.error_stack:this.error_stack=[r],this.error_stack.push(this)}};function q1(t){let e=Object.keys(t),r=[];return e.forEach(function(n){r.push(t[n])}),Promise.all(r).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function cp(t,e){return function(n){throw e&&console.error(new Error(t)),n}}function eA(t,e,r){for(let n=0;n<e.length;n++){let i=e[n],o=t;for(let s=0;s<i.length-1;s++)o=o[i[s]];o[i[i.length-1]]=r[n]}}function Qw(t){let e=[],r=[];function n(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o)){let c=!1;for(let l=0;l<o.length;l++){let h=o[l];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))c||(o=o.slice(),c=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([l])),o[l]=null;else{let p=n(h,s.concat([l]));p!==h&&(c||(o=o.slice(),c=!0),o[l]=p)}}}else if((0,nle.default)(o))for(let c in o){let l=!1;if(o.hasOwnProperty(c)){let h=o[c];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=Object.assign({},o),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([c])),delete o[c];else{let p=n(h,s.concat([c]));p!==h&&(l||(o=Object.assign({},o),l=!0),o[c]=p)}}}return o}return{state:n(t,[]),buffers:e,buffer_paths:r}}var sze=["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 aze(t){let e=new Uint8Array(t),r=[];for(let n=0;n<e.length;n++)r.push(sze[e[n]]);return r.join("")}function w6(t){let e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function T6(t){return(0,LI.fromByteArray)(new Uint8Array(t))}function E6(t){return(0,LI.toByteArray)(t).buffer}var ole=ec(B1());var BI="1.2.0",DI="2.1.0";var ile=DI.split(".",1)[0],sle="jupyter.widget.control",ale="1.0.0",cle=4e3,S6=class{constructor(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}display_model(e,r,n={}){return this.create_view(r,n).then(i=>this.display_view(e,i,n)).catch(cp("Could not create view",!0))}setViewOptions(e={}){return e}create_view(e,r={}){let n=e.state_change=e.state_change.then(()=>this.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(o=>{let s=new o({model:e,options:this.setViewOptions(r)});return s.listenTo(e,"destroy",s.remove),Promise.resolve(s.render()).then(()=>s)}).catch(cp("Could not create a view for model id "+e.model_id,!0))),i=$w();return e.views[i]=n,n.then(o=>{o.once("remove",()=>{delete o.model.views[i]},this)}),e.state_change}callbacks(e){return{}}get_model(e){return this._models[e]}has_model(e){return this._models[e]!==void 0}handle_comm_open(e,r){let n=(r.metadata||{}).version||"";if(n.split(".",1)[0]!==ile){let c=`Wrong widget protocol version: received protocol version '${n}', but was expecting major version '${ile}'`;return console.error(c),Promise.reject(c)}let i=r.content.data,o=i.buffer_paths||[],s=(r.buffers||[]).map(c=>c instanceof DataView?c:new DataView(c instanceof ArrayBuffer?c:c.buffer));return eA(i.state,o,s),this.new_model({model_name:i.state._model_name,model_module:i.state._model_module,model_module_version:i.state._model_module_version,comm:e},i.state).catch(cp("Could not create a model.",!0))}new_widget(e,r={}){let 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:DI});let i=Object.assign({},e);return n.then(o=>(i.comm=o,this.new_model(i,r).then(c=>(c.sync("create",c),c))),()=>(i.model_id||(i.model_id=$w()),this.new_model(i,r)))}register_model(e,r){this._models[e]=r,r.then(n=>{n.once("comm:close",()=>{delete this._models[e]})})}async new_model(e,r={}){let n;if(e.model_id)n=e.model_id;else if(e.comm)n=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.");let i=this._make_model(e,r);return this.register_model(n,i),await i}async _make_model(e,r={}){let n=e.model_id,i=this.loadClass(e.model_name,e.model_module,e.model_module_version),o;try{o=await i}catch(h){throw console.error("Could not instantiate widget"),h}if(!o)throw new Error(`Cannot find model module ${e.model_module}@${e.model_module_version}, ${e.model_name}`);let s=await o._deserialize_state(r,this),c={widget_manager:this,model_id:n,comm:e.comm},l=new o(s,c);return l.name=e.model_name,l.module=e.model_module,l}async _loadFromKernel(){let e,r;try{let c=await this._create_comm(sle,$w(),{},{version:ale});await new Promise((l,h)=>{c.on_msg(p=>{if(e=p.content.data,e.method!=="update_states"){console.warn(`
4466
4469
  Unknown ${e.method} message on the Control channel
4467
4470
  `);return}r=(p.buffers||[]).map(x=>x instanceof DataView?x:new DataView(x instanceof ArrayBuffer?x:x.buffer)),l(null)}),c.on_close(()=>h("Control comm was closed too early")),c.send({method:"request_states"},{}),setTimeout(()=>h("Control comm did not respond in time"),cle)}),c.close()}catch(c){return console.warn('Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason:',c),this._loadFromKernelModels()}let n=e.states,i={},o={};for(let c=0;c<e.buffer_paths.length;c++){let[l,...h]=e.buffer_paths[c],p=r[c];i[l]||(i[l]=[],o[l]=[]),i[l].push(h),o[l].push(p)}let s=await Promise.all(Object.keys(n).map(async c=>{let l=this.has_model(c)?void 0:await this._create_comm("jupyter.widget",c);return{widget_id:c,comm:l}}));await Promise.all(s.map(async({widget_id:c,comm:l})=>{let h=n[c];c in i&&eA(h,i[c],o[c]);try{if(l)await this.new_model({model_name:h.model_name,model_module:h.model_module,model_module_version:h.model_module_version,model_id:c,comm:l},h.state);else{let p=await this.get_model(c),x=await p.constructor._deserialize_state(h.state,this);p.set_state(x)}}catch(p){console.error(p)}}))}async _loadFromKernelModels(){let e=await this._get_comm_info(),r=await Promise.all(Object.keys(e).map(async n=>{if(this.has_model(n))return;let i=await this._create_comm(this.comm_target_name,n),o="",s=new ole.PromiseDelegate;return i.on_msg(c=>{if(c.parent_header.msg_id===o&&c.header.msg_type==="comm_msg"&&c.content.data.method==="update"){let l=c.content.data,h=l.buffer_paths||[],p=c.buffers||[];eA(l.state,h,p),s.resolve({comm:i,msg:c})}}),o=i.send({method:"request_state"},this.callbacks(void 0)),s.promise}));await Promise.all(r.map(async n=>{if(!n)return;let i=n.msg.content;await this.new_model({model_name:i.data.state._model_name,model_module:i.data.state._model_module,model_module_version:i.data.state._model_module_version,comm:n.comm},i.data.state)}))}clear_state(){return q1(this._models).then(e=>{Object.keys(e).forEach(r=>e[r].close()),this._models=Object.create(null)})}get_state(e={}){let r=Object.keys(this._models).map(n=>this._models[n]);return Promise.all(r).then(n=>lle(n,e))}set_state(e){if(!(e.version_major&&e.version_major<=2))throw"Unsupported widget state format";let r=e.state;return this._get_comm_info().then(i=>Promise.all(Object.keys(r).map(o=>{let s={base64:E6,hex:w6},c=r[o],l=c.state;if(c.buffers){let p=c.buffers.map(w=>w.path),x=c.buffers.map(w=>new DataView(s[w.encoding](w.data)));eA(c.state,p,x)}if(this.has_model(o))return this.get_model(o).then(p=>p.constructor._deserialize_state(l||{},this).then(x=>(p.set_state(x),p)));let h={model_id:o,model_name:c.model_name,model_module:c.model_module,model_module_version:c.model_module_version};return i.hasOwnProperty(o)?this._create_comm(this.comm_target_name,o).then(p=>(h.comm=p,this.new_model(h))):this.new_model(h,l)})))}disconnect(){Object.keys(this._models).forEach(e=>{this._models[e].then(r=>{r.comm_live=!1})})}resolveUrl(e){return Promise.resolve(e)}filterExistingModelState(e){let r=e.state;return r=Object.keys(r).filter(n=>!this.has_model(n)).reduce((n,i)=>(n[i]=r[i],n),{}),Object.assign(Object.assign({},e),{state:r})}};function lle(t,e={}){let r={};return t.forEach(n=>{let i=n.model_id,o=Qw(n.serialize(n.get_state(e.drop_defaults))),s=o.buffers.map((c,l)=>({data:T6(c),path:o.buffer_paths[l],encoding:"base64"}));r[i]={model_name:n.name,model_module:n.module,model_module_version:n.get("_model_module_version"),state:o.state},s.length>0&&(r[i].buffers=s)}),{version_major:2,version_minor:0,state:r}}function ule(t,e,r){if(t==null)return this;let n;if(typeof t=="object"?(n=t,r=e):(n={})[t]=e,r||(r={}),!this._validate(n,r))return!1;let i=r.unset,o=r.silent,s=[],c=this._changing;this._changing=!0;try{c||(this._previousAttributes=Object.assign({},this.attributes),this.changed={});let l=this.attributes,h=this.changed,p=this._previousAttributes;for(let x in n)e=n[x],W1(l[x],e)||s.push(x),W1(p[x],e)?delete h[x]:h[x]=e,i?delete l[x]:l[x]=e;if(this.id=this.get(this.idAttribute),!o){s.length&&(this._pending=r);for(let x=0;x<s.length;x++)this.trigger("change:"+s[x],this,l[s[x]],r)}if(c)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 hhe=ec(h8()),R8=ec(l8());var Zue=ec(h8()),IT=Element.prototype,bze=IT.matches||IT.webkitMatchesSelector||IT.mozMatchesSelector||IT.msMatchesSelector||IT.oMatchesSelector||function(e){let r=(this.document||this.ownerDocument).querySelectorAll(e),n=r.length;for(;--n>=0&&r.item(n)!==this;);return n>-1},VR=class extends Zue.View{_removeElement(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}_setElement(e){this.el=e}_setAttributes(e){for(let r in e)r in this.el?this.el[r]=e[r]:this.el.setAttribute(r,e[r])}delegate(e,r,n){typeof r!="string"&&(n=r,r=null),this._domEvents===void 0&&(this._domEvents=[]);let i=this.el,o=r?function(s){let c=s.target||s.srcElement;for(;c&&c!==i;c=c.parentNode)if(bze.call(c,r))return s.delegateTarget=c,n.handleEvent?n.handleEvent(s):n(s)}:n;return this.el.addEventListener(e,o,!1),this._domEvents.push({eventName:e,handler:o,listener:n,selector:r}),o}undelegate(e,r,n){if(typeof r=="function"&&(n=r,r=null),this.el&&this._domEvents){let i=this._domEvents.slice(),o=i.length;for(;o--;){let s=i[o];s.eventName===e&&(!n||s.listener===n)&&(!r||s.selector===r)&&(this.el.removeEventListener(s.eventName,s.handler,!1),this._domEvents.splice(o,1))}}return this}undelegateEvents(){if(this.el&&this._domEvents){let e=this._domEvents.length;for(let r=0;r<e;r++){let n=this._domEvents[r];this.el.removeEventListener(n.eventName,n.handler,!1)}this._domEvents.length=0}return this}};var Zt;(function(t){function e(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=ue.length;if(me===0)return-1;J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1);var Me;G<J?Me=G+1+(me-J):Me=G-J+1;for(var ce=0;ce<Me;++ce){var ge=(J+ce)%me;if(ue[ge]===oe)return ge}return-1}t.firstIndexOf=e;function r(ue,oe,J,G){J===void 0&&(J=-1),G===void 0&&(G=0);var me=ue.length;if(me===0)return-1;J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1);var Me;J<G?Me=J+1+(me-G):Me=J-G+1;for(var ce=0;ce<Me;++ce){var ge=(J-ce+me)%me;if(ue[ge]===oe)return ge}return-1}t.lastIndexOf=r;function n(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=ue.length;if(me===0)return-1;J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1);var Me;G<J?Me=G+1+(me-J):Me=G-J+1;for(var ce=0;ce<Me;++ce){var ge=(J+ce)%me;if(oe(ue[ge],ge))return ge}return-1}t.findFirstIndex=n;function i(ue,oe,J,G){J===void 0&&(J=-1),G===void 0&&(G=0);var me=ue.length;if(me===0)return-1;J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1);var Me;J<G?Me=J+1+(me-G):Me=J-G+1;for(var ce=0;ce<Me;++ce){var ge=(J-ce+me)%me;if(oe(ue[ge],ge))return ge}return-1}t.findLastIndex=i;function o(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=n(ue,oe,J,G);return me!==-1?ue[me]:void 0}t.findFirstValue=o;function s(ue,oe,J,G){J===void 0&&(J=-1),G===void 0&&(G=0);var me=i(ue,oe,J,G);return me!==-1?ue[me]:void 0}t.findLastValue=s;function c(ue,oe,J,G,me){G===void 0&&(G=0),me===void 0&&(me=-1);var Me=ue.length;if(Me===0)return 0;G<0?G=Math.max(0,G+Me):G=Math.min(G,Me-1),me<0?me=Math.max(0,me+Me):me=Math.min(me,Me-1);for(var ce=G,ge=me-G+1;ge>0;){var tt=ge>>1,Nt=ce+tt;J(ue[Nt],oe)<0?(ce=Nt+1,ge-=tt+1):ge=tt}return ce}t.lowerBound=c;function l(ue,oe,J,G,me){G===void 0&&(G=0),me===void 0&&(me=-1);var Me=ue.length;if(Me===0)return 0;G<0?G=Math.max(0,G+Me):G=Math.min(G,Me-1),me<0?me=Math.max(0,me+Me):me=Math.min(me,Me-1);for(var ce=G,ge=me-G+1;ge>0;){var tt=ge>>1,Nt=ce+tt;J(ue[Nt],oe)>0?ge=tt:(ce=Nt+1,ge-=tt+1)}return ce}t.upperBound=l;function h(ue,oe,J){if(ue===oe)return!0;if(ue.length!==oe.length)return!1;for(var G=0,me=ue.length;G<me;++G)if(J?!J(ue[G],oe[G]):ue[G]!==oe[G])return!1;return!0}t.shallowEqual=h;function p(ue,oe){oe===void 0&&(oe={});var J=oe.start,G=oe.stop,me=oe.step;if(me===void 0&&(me=1),me===0)throw new Error("Slice `step` cannot be zero.");var Me=ue.length;J===void 0?J=me<0?Me-1:0:J<0?J=Math.max(J+Me,me<0?-1:0):J>=Me&&(J=me<0?Me-1:Me),G===void 0?G=me<0?-1:Me:G<0?G=Math.max(G+Me,me<0?-1:0):G>=Me&&(G=me<0?Me-1:Me);var ce;me<0&&G>=J||me>0&&J>=G?ce=0:me<0?ce=Math.floor((G-J+1)/me+1):ce=Math.floor((G-J-1)/me+1);for(var ge=[],tt=0;tt<ce;++tt)ge[tt]=ue[J+tt*me];return ge}t.slice=p;function x(ue,oe,J){var G=ue.length;if(!(G<=1)&&(oe<0?oe=Math.max(0,oe+G):oe=Math.min(oe,G-1),J<0?J=Math.max(0,J+G):J=Math.min(J,G-1),oe!==J)){for(var me=ue[oe],Me=oe<J?1:-1,ce=oe;ce!==J;ce+=Me)ue[ce]=ue[ce+Me];ue[J]=me}}t.move=x;function w(ue,oe,J){oe===void 0&&(oe=0),J===void 0&&(J=-1);var G=ue.length;if(!(G<=1))for(oe<0?oe=Math.max(0,oe+G):oe=Math.min(oe,G-1),J<0?J=Math.max(0,J+G):J=Math.min(J,G-1);oe<J;){var me=ue[oe],Me=ue[J];ue[oe++]=Me,ue[J--]=me}}t.reverse=w;function E(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=ue.length;if(!(me<=1)&&(J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1),!(J>=G))){var Me=G-J+1;if(oe>0?oe=oe%Me:oe<0&&(oe=(oe%Me+Me)%Me),oe!==0){var ce=J+oe;w(ue,J,ce-1),w(ue,ce,G),w(ue,J,G)}}}t.rotate=E;function P(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=ue.length;if(me!==0){J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1);var Me;G<J?Me=G+1+(me-J):Me=G-J+1;for(var ce=0;ce<Me;++ce)ue[(J+ce)%me]=oe}}t.fill=P;function B(ue,oe,J){var G=ue.length;oe<0?oe=Math.max(0,oe+G):oe=Math.min(oe,G);for(var me=G;me>oe;--me)ue[me]=ue[me-1];ue[oe]=J}t.insert=B;function D(ue,oe){var J=ue.length;if(oe<0&&(oe+=J),!(oe<0||oe>=J)){for(var G=ue[oe],me=oe+1;me<J;++me)ue[me-1]=ue[me];return ue.length=J-1,G}}t.removeAt=D;function W(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=e(ue,oe,J,G);return me!==-1&&D(ue,me),me}t.removeFirstOf=W;function X(ue,oe,J,G){J===void 0&&(J=-1),G===void 0&&(G=0);var me=r(ue,oe,J,G);return me!==-1&&D(ue,me),me}t.removeLastOf=X;function q(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=ue.length;if(me===0)return 0;J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1);for(var Me=0,ce=0;ce<me;++ce)J<=G&&ce>=J&&ce<=G&&ue[ce]===oe||G<J&&(ce<=G||ce>=J)&&ue[ce]===oe?Me++:Me>0&&(ue[ce-Me]=ue[ce]);return Me>0&&(ue.length=me-Me),Me}t.removeAllOf=q;function $(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me,Me=n(ue,oe,J,G);return Me!==-1&&(me=D(ue,Me)),{index:Me,value:me}}t.removeFirstWhere=$;function te(ue,oe,J,G){J===void 0&&(J=-1),G===void 0&&(G=0);var me,Me=i(ue,oe,J,G);return Me!==-1&&(me=D(ue,Me)),{index:Me,value:me}}t.removeLastWhere=te;function F(ue,oe,J,G){J===void 0&&(J=0),G===void 0&&(G=-1);var me=ue.length;if(me===0)return 0;J<0?J=Math.max(0,J+me):J=Math.min(J,me-1),G<0?G=Math.max(0,G+me):G=Math.min(G,me-1);for(var Me=0,ce=0;ce<me;++ce)J<=G&&ce>=J&&ce<=G&&oe(ue[ce],ce)||G<J&&(ce<=G||ce>=J)&&oe(ue[ce],ce)?Me++:Me>0&&(ue[ce-Me]=ue[ce]);return Me>0&&(ue.length=me-Me),Me}t.removeAllWhere=F})(Zt||(Zt={}));function gu(t){var e;return typeof t.iter=="function"?e=t.iter():e=new wze(t),e}function yn(t,e){for(var r=0,n=gu(t),i;(i=n.next())!==void 0;)if(e(i,r++)===!1)return}function $ue(t,e){for(var r=0,n=gu(t),i;(i=n.next())!==void 0;)if(!e(i,r++))return!1;return!0}function Que(t,e){for(var r=0,n=gu(t),i;(i=n.next())!==void 0;)if(e(i,r++))return!0;return!1}function Jue(t){for(var e=0,r=[],n=gu(t),i;(i=n.next())!==void 0;)r[e++]=i;return r}var wze=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}(),QHt=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}(),JHt=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}(),eWt=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}(),tWt=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 p8(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Pg(gu(t.map(gu)))}var Pg=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 _u(){return new Tze}var Tze=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var rWt=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 ehe(t,e){return new Eze(gu(t),e)}var Eze=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,n;(n=r.next())!==void 0;)if(e(n,this._index++))return n},t}();function yx(t,e){for(var r=0,n=gu(t),i;(i=n.next())!==void 0;)if(e(i,r++))return i}function the(t,e){var r=gu(t),n=r.next();if(n!==void 0){for(var i=n;(n=r.next())!==void 0;)e(n,i)>0&&(i=n);return i}}function hA(t,e){return new Mze(gu(t),e)}var Mze=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 nWt=function(){function t(e,r,n){this._index=0,this._start=e,this._stop=r,this._step=n,this._length=f8.rangeLength(e,r,n)}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}(),f8;(function(t){function e(r,n,i){return i===0?1/0:r>n&&i>0||r<n&&i<0?0:Math.ceil((n-r)/i)}t.rangeLength=e})(f8||(f8={}));function d8(t,e,r){var n=0,i=gu(t),o=i.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=i.next();if(s===void 0&&r===void 0)return o;if(s===void 0)return e(r,o,n++);var c;r===void 0?c=e(o,s,n++):c=e(e(r,o,n++),s,n++);for(var l;(l=i.next())!==void 0;)c=e(c,l,n++);return c}function RT(t){return new Sze(t,1)}var Sze=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 rhe(t){var e;return typeof t.retro=="function"?e=t.retro():e=new Cze(t),e}var Cze=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 iWt=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}(),_x;(function(t){function e(s,c,l){l===void 0&&(l=0);for(var h=new Array(c.length),p=0,x=l,w=c.length;p<w;++p,++x){if(x=s.indexOf(c[p],x),x===-1)return null;h[p]=x}return h}t.findIndices=e;function r(s,c,l){l===void 0&&(l=0);var h=e(s,c,l);if(!h)return null;for(var p=0,x=0,w=h.length;x<w;++x){var E=h[x]-l;p+=E*E}return{score:p,indices:h}}t.matchSumOfSquares=r;function n(s,c,l){l===void 0&&(l=0);var h=e(s,c,l);if(!h)return null;for(var p=0,x=l-1,w=0,E=h.length;w<E;++w){var P=h[w];p+=P-x-1,x=P}return{score:p,indices:h}}t.matchSumOfDeltas=n;function i(s,c,l){for(var h=[],p=0,x=0,w=c.length;p<w;){for(var E=c[p],P=c[p];++p<w&&c[p]===P+1;)P++;x<E&&h.push(s.slice(x,E)),E<P+1&&h.push(l(s.slice(E,P+1))),x=P+1}return x<s.length&&h.push(s.slice(x)),h}t.highlight=i;function o(s,c){return s<c?-1:s>c?1:0}t.cmp=o})(_x||(_x={}));var oWt=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 sWt=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,n=this._source.length;r<n;++r){var i=this._source[r].next();if(i===void 0)return;e[r]=i}return e},t}();var nhe;(function(t){function e(r){var n=document.body,i=function(o){o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",r),n.removeEventListener("copy",i,!0)};n.addEventListener("copy",i,!0),document.execCommand("copy")}t.copyText=e})(nhe||(nhe={}));var co;(function(t){function e(o){var s=window.getComputedStyle(o),c=parseFloat(s.borderTopWidth)||0,l=parseFloat(s.borderLeftWidth)||0,h=parseFloat(s.borderRightWidth)||0,p=parseFloat(s.borderBottomWidth)||0,x=parseFloat(s.paddingTop)||0,w=parseFloat(s.paddingLeft)||0,E=parseFloat(s.paddingRight)||0,P=parseFloat(s.paddingBottom)||0,B=l+w+E+h,D=c+x+P+p;return{borderTop:c,borderLeft:l,borderRight:h,borderBottom:p,paddingTop:x,paddingLeft:w,paddingRight:E,paddingBottom:P,horizontalSum:B,verticalSum:D}}t.boxSizing=e;function r(o){var s=window.getComputedStyle(o),c=parseFloat(s.minWidth)||0,l=parseFloat(s.minHeight)||0,h=parseFloat(s.maxWidth)||1/0,p=parseFloat(s.maxHeight)||1/0;return h=Math.max(c,h),p=Math.max(l,p),{minWidth:c,minHeight:l,maxWidth:h,maxHeight:p}}t.sizeLimits=r;function n(o,s,c){var l=o.getBoundingClientRect();return s>=l.left&&s<l.right&&c>=l.top&&c<l.bottom}t.hitTest=n;function i(o,s){var c=o.getBoundingClientRect(),l=s.getBoundingClientRect();if(!(l.top<=c.top&&l.bottom>=c.bottom)){if(l.top<c.top&&l.height<=c.height){o.scrollTop-=c.top-l.top;return}if(l.bottom>c.bottom&&l.height>=c.height){o.scrollTop-=c.top-l.top;return}if(l.top<c.top&&l.height>c.height){o.scrollTop-=c.bottom-l.bottom;return}if(l.bottom>c.bottom&&l.height<c.height){o.scrollTop-=c.bottom-l.bottom;return}}}t.scrollIntoViewIfNeeded=i})(co||(co={}));var lc;(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})(lc||(lc={}));var Qh;(function(t){function e(i){if(i in $h.specificityCache)return $h.specificityCache[i];var o=$h.calculateSingle(i);return $h.specificityCache[i]=o}t.calculateSpecificity=e;function r(i){if(i in $h.validityCache)return $h.validityCache[i];var o=!0;try{$h.testElem.querySelector(i)}catch{o=!1}return $h.validityCache[i]=o}t.isValid=r;function n(i,o){return $h.protoMatchFunc.call(i,o)}t.matches=n})(Qh||(Qh={}));var $h;(function(t){t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=function(){var p=Element.prototype;return p.matches||p.matchesSelector||p.mozMatchesSelector||p.msMatchesSelector||p.oMatchesSelector||p.webkitMatchesSelector||function(x){var w=this,E=w.ownerDocument?w.ownerDocument.querySelectorAll(x):[];return Array.prototype.indexOf.call(E,w)!==-1}}();function e(p){p=p.split(",",1)[0];var x=0,w=0,E=0;function P(B){var D=p.match(B);return D===null?!1:(p=p.slice(D[0].length),!0)}for(p=p.replace(h," $1 ");p.length>0;){if(P(r)){x++;continue}if(P(n)){w++;continue}if(P(i)){w++;continue}if(P(s)){E++;continue}if(P(c)){w++;continue}if(P(o)){E++;continue}if(!P(l))return 0}return x=Math.min(x,255),w=Math.min(w,255),E=Math.min(E,255),x<<16|w<<8|E}t.calculateSingle=e;var r=/^#[^\s\+>~#\.\[:]+/,n=/^\.[^\s\+>~#\.\[:]+/,i=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,s=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,c=/^:[^\s\+>~#\.\[:]+/,l=/^[\s\+>~\*]+/,h=/:not\(([^\)]+)\)/g})($h||($h={}));var ihe=function(){function t(e){this._root=new ua.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=ua.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=ua.lastLeaf(this._root);return e.size>0?e.items[e.size-1]:void 0},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return ua.iterItems(this._root)},t.prototype.retro=function(){return ua.retroItems(this._root)},t.prototype.slice=function(e,r){return ua.sliceItems(this._root,e,r)},t.prototype.retroSlice=function(e,r){return ua.retroSliceItems(this._root,e,r)},t.prototype.at=function(e){return ua.itemAt(this._root,e)},t.prototype.has=function(e,r){return ua.hasItem(this._root,e,r)},t.prototype.indexOf=function(e,r){return ua.indexOf(this._root,e,r)},t.prototype.get=function(e,r){return ua.getItem(this._root,e,r)},t.prototype.assign=function(e){this.clear(),this.update(e)},t.prototype.insert=function(e){var r=ua.insertItem(this._root,e,this.cmp);return this._root=ua.maybeSplitRoot(this._root),r},t.prototype.update=function(e){var r=this;yn(e,function(n){r.insert(n)})},t.prototype.delete=function(e,r){var n=ua.deleteItem(this._root,e,r);return this._root=ua.maybeExtractRoot(this._root),n},t.prototype.remove=function(e){var r=ua.removeItem(this._root,e);return this._root=ua.maybeExtractRoot(this._root),r},t.prototype.clear=function(){ua.clear(this._root),this._root=new ua.LeafNode},t}();(function(t){function e(r,n){var i=new t(n);return i.assign(r),i}t.from=e})(ihe||(ihe={}));var ua;(function(t){var e=function(){function ce(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(ce.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(ce.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(ce.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),ce}();t.BranchNode=e;var r=function(){function ce(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(ce.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(ce.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(ce.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),ce}();t.LeafNode=r;function n(ce){for(;ce.type===0;)ce=ce.children[0];return ce}t.firstLeaf=n;function i(ce){for(;ce.type===0;)ce=ce.children[ce.children.length-1];return ce}t.lastLeaf=i;function o(ce){var ge=n(ce);return new te(ge,0,-1)}t.iterItems=o;function s(ce){var ge=i(ce);return new F(ge,ge.size-1,-1)}t.retroItems=s;function c(ce,ge,tt){ge===void 0?ge=0:ge<0?ge=Math.max(0,ge+ce.size):ge=Math.min(ge,ce.size),tt===void 0?tt=ce.size:tt<0?tt=Math.max(0,tt+ce.size):tt=Math.min(tt,ce.size);var Nt=Math.max(0,tt-ge);if(Nt===0)return _u();for(;ce.type===0;){var Ut=ue(ce.sizes,ge);Ut>0&&(ge-=ce.sizes[Ut-1]),ce=ce.children[Ut]}return new te(ce,ge,Nt)}t.sliceItems=c;function l(ce,ge,tt){ge===void 0?ge=ce.size-1:ge<0?ge=Math.max(-1,ge+ce.size):ge=Math.min(ge,ce.size-1),tt===void 0?tt=-1:tt<0?tt=Math.max(-1,tt+ce.size):tt=Math.min(tt,ce.size-1);var Nt=Math.max(0,ge-tt);if(Nt===0)return _u();for(;ce.type===0;){var Ut=ue(ce.sizes,ge);Ut>0&&(ge-=ce.sizes[Ut-1]),ce=ce.children[Ut]}return new F(ce,ge,Nt)}t.retroSliceItems=l;function h(ce,ge){if(ge<0&&(ge+=ce.size),!(ge<0||ge>=ce.size)){for(;ce.type===0;){var tt=ue(ce.sizes,ge);tt>0&&(ge-=ce.sizes[tt-1]),ce=ce.children[tt]}return ce.items[ge]}}t.itemAt=h;function p(ce,ge,tt){for(;ce.type===0;){var Nt=oe(ce.items,ge,tt);ce=ce.children[Nt]}var Ut=J(ce.items,ge,tt);return Ut>=0}t.hasItem=p;function x(ce,ge,tt){for(var Nt=0;ce.type===0;){var Ut=oe(ce.items,ge,tt);Ut>0&&(Nt+=ce.sizes[Ut-1]),ce=ce.children[Ut]}var sr=J(ce.items,ge,tt);return sr>=0?Nt+sr:-Nt+sr}t.indexOf=x;function w(ce,ge,tt){for(;ce.type===0;){var Nt=oe(ce.items,ge,tt);ce=ce.children[Nt]}var Ut=J(ce.items,ge,tt);return Ut>=0?ce.items[Ut]:void 0}t.getItem=w;function E(ce,ge,tt){if(ce.type===1){var Nt=J(ce.items,ge,tt),Ut;return Nt>=0?(Ut=ce.items[Nt],ce.items[Nt]=ge):(Ut=void 0,Zt.insert(ce.items,-Nt-1,ge)),Ut}var sr=oe(ce.items,ge,tt),gr=ce.children[sr],Xr=gr.size,ir=E(gr,ge,tt),on=gr.size;if(ce.items[sr]=gr.items[0],Xr===on)return ir;if(gr.width>q){var Xt=me(gr);Zt.insert(ce.children,sr+1,Xt),Zt.insert(ce.items,sr+1,Xt.items[0])}return G(ce,sr),ir}t.insertItem=E;function P(ce,ge,tt){if(ce.type===1){var Nt=J(ce.items,ge,tt);return Nt<0?void 0:Zt.removeAt(ce.items,Nt)}var Ut=oe(ce.items,ge,tt),sr=ce.children[Ut],gr=sr.size,Xr=P(sr,ge,tt),ir=sr.size;return gr===ir||(ce.items[Ut]=sr.items[0],sr.width<$&&(Ut=Me(ce,Ut)),G(ce,Ut)),Xr}t.deleteItem=P;function B(ce,ge){if(ge<0&&(ge+=ce.size),!(ge<0||ge>=ce.size)){if(ce.type===1)return Zt.removeAt(ce.items,ge);var tt=ue(ce.sizes,ge);tt>0&&(ge-=ce.sizes[tt]);var Nt=ce.children[tt],Ut=B(Nt,ge);return ce.items[tt]=Nt.items[0],Nt.width<$&&(tt=Me(ce,tt)),G(ce,tt),Ut}}t.removeItem=B;function D(ce){ce.type===0?(yn(ce.children,D),ce.children.length=0,ce.sizes.length=0,ce.items.length=0):(ce.items.length=0,ce.next=null,ce.prev=null)}t.clear=D;function W(ce){if(ce.width<=q)return ce;var ge=new e,tt=me(ce);return ge.sizes[0]=ce.size,ge.sizes[1]=ce.size+tt.size,ge.children[0]=ce,ge.children[1]=tt,ge.items[0]=ce.items[0],ge.items[1]=tt.items[0],ge}t.maybeSplitRoot=W;function X(ce){if(ce.type===1||ce.children.length>1)return ce;var ge=ce.children.pop();return D(ce),ge}t.maybeExtractRoot=X;var q=32,$=q>>1,te=function(){function ce(ge,tt,Nt){this._node=ge,this._index=tt,this._count=Nt}return ce.prototype.iter=function(){return this},ce.prototype.clone=function(){return new ce(this._node,this._index,this._count)},ce.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++])},ce}(),F=function(){function ce(ge,tt,Nt){this._node=ge,this._index=tt,this._count=Nt}return ce.prototype.iter=function(){return this},ce.prototype.clone=function(){return new ce(this._node,this._index,this._count)},ce.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--])},ce}();function ue(ce,ge){for(var tt=ce.length,Nt=0;Nt<tt;++Nt)if(ce[Nt]>ge)return Nt;return tt-1}function oe(ce,ge,tt){for(var Nt=ce.length,Ut=1;Ut<Nt;++Ut)if(tt(ce[Ut],ge)>0)return Ut-1;return Nt-1}function J(ce,ge,tt){for(var Nt=ce.length,Ut=0;Ut<Nt;++Ut){var sr=tt(ce[Ut],ge);if(sr===0)return Ut;if(sr>0)return-Ut-1}return-Nt-1}function G(ce,ge){for(var tt=ce.sizes,Nt=ce.children,Ut=ge>0?tt[ge-1]:0,sr=Nt.length;ge<sr;++ge)Ut=tt[ge]=Ut+Nt[ge].size;tt.length=Nt.length}function me(ce){if(ce.type===1){for(var ge=new r,tt=ce.items,Nt=ge.items,Ut=$,sr=tt.length;Ut<sr;++Ut)Nt.push(tt[Ut]);return tt.length=$,ce.next&&(ce.next.prev=ge),ge.next=ce.next,ge.prev=ce,ce.next=ge,ge}for(var gr=new e,Xr=ce.children,ir=gr.children,Ut=$,sr=Xr.length;Ut<sr;++Ut)ir.push(Xr[Ut]);Xr.length=$;for(var on=ce.items,Xt=gr.items,Ut=$,sr=on.length;Ut<sr;++Ut)Xt.push(on[Ut]);return on.length=$,G(ce,$),G(gr,0),gr}function Me(ce,ge){var tt,Nt,Ut,sr,gr,Xr,ir=ce.children[ge],on=ge===0?ce.children[ge+1]:ce.children[ge-1],Xt=ge===0,Ht=ir.type===1,_n=on.width>$;if(Ht&&_n&&Xt){var de=ir,we=on;return de.items.push(we.items.shift()),ce.items[ge+1]=we.items[0],ge}if(Ht&&_n&&!Xt){var de=ir,we=on;return de.items.unshift(we.items.pop()),ce.items[ge]=de.items[0],ge-1}if(Ht&&!_n&&Xt){var de=ir,we=on;return(tt=we.items).unshift.apply(tt,de.items),Zt.removeAt(ce.children,ge),Zt.removeAt(ce.items,ge+1),de.prev&&(de.prev.next=we),we.prev=de.prev,D(de),ge}if(Ht&&!_n&&!Xt){var de=ir,we=on;return(Nt=we.items).push.apply(Nt,de.items),Zt.removeAt(ce.children,ge),Zt.removeAt(ce.items,ge),de.next&&(de.next.prev=we),we.next=de.next,D(de),ge-1}if(!Ht&&_n&&Xt){var de=ir,we=on;return de.children.push(we.children.shift()),de.items.push(we.items.shift()),ce.items[ge+1]=we.items[0],G(de,de.width-1),G(we,0),ge}if(!Ht&&_n&&!Xt){var de=ir,we=on;return de.children.unshift(we.children.pop()),de.items.unshift(we.items.pop()),ce.items[ge]=de.items[0],G(de,0),G(we,we.width-1),ge-1}if(!Ht&&!_n&&Xt){var de=ir,we=on;return(Ut=we.children).unshift.apply(Ut,de.children),(sr=we.items).unshift.apply(sr,de.items),Zt.removeAt(ce.children,ge),Zt.removeAt(ce.items,ge+1),G(we,0),de.children.length=0,D(de),ge}if(!Ht&&!_n&&!Xt){var de=ir,we=on;return(gr=we.children).push.apply(gr,de.children),(Xr=we.items).push.apply(Xr,de.items),Zt.removeAt(ce.children,ge),Zt.removeAt(ce.items,ge),G(we,0),de.children.length=0,D(de),ge-1}throw"unreachable"}})(ua||(ua={}));var jR=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(),yn(e,function(n){r.addLast(n)})},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 Md.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 Md.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 Md.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var n=new Md.LinkedListNode(this,e),i=r,o=i.prev;return n.next=i,n.prev=o,i.prev=n,o.next=n,this._size++,n},t.prototype.insertAfter=function(e,r){if(!r||r===this._last)return this.addLast(e);if(!(r instanceof Md.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var n=new Md.LinkedListNode(this,e),i=r,o=i.next;return n.next=o,n.prev=i,i.next=n,o.prev=n,this._size++,n},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 Md.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 c=new t;return c.assign(s),c}t.from=e;var r=function(){function s(c){this._node=c}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var c=this._node;return this._node=c.next,c.value}},s}();t.ForwardValueIterator=r;var n=function(){function s(c){this._node=c}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var c=this._node;return this._node=c.prev,c.value}},s}();t.RetroValueIterator=n;var i=function(){function s(c){this._node=c}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var c=this._node;return this._node=c.next,c}},s}();t.ForwardNodeIterator=i;var o=function(){function s(c){this._node=c}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var c=this._node;return this._node=c.prev,c}},s}();t.RetroNodeIterator=o})(jR||(jR={}));var Md;(function(t){var e=function(){function r(n,i){this.list=null,this.next=null,this.prev=null,this.list=n,this.value=i}return r}();t.LinkedListNode=e})(Md||(Md={}));var m8=function(t,e){return m8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},m8(t,e)};function Pze(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");m8(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var yu=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}(),xx=function(t){Pze(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}(yu),mr;(function(t){function e(J,G){var me=p.get(J);if(!me||me.length===0){X(J,G);return}var Me=$ue(rhe(me),function(ce){return ce?W(ce,J,G):!0});Me&&X(J,G)}t.sendMessage=e;function r(J,G){if(!G.isConflatable){q(J,G);return}var me=Que(h,function(Me){return Me.handler!==J||!Me.msg||Me.msg.type!==G.type||!Me.msg.isConflatable?!1:Me.msg.conflate(G)});me||q(J,G)}t.postMessage=r;function n(J,G){var me=p.get(J);me&&me.indexOf(G)!==-1||(me?me.push(G):p.set(J,[G]))}t.installMessageHook=n;function i(J,G){var me=p.get(J);if(me){var Me=me.indexOf(G);Me!==-1&&(me[Me]=null,te(me))}}t.removeMessageHook=i;function o(J){var G=p.get(J);G&&G.length>0&&(Zt.fill(G,null),te(G)),yn(h,function(me){me.handler===J&&(me.handler=null,me.msg=null)})}t.clearData=o;function s(){P||E===0||(D(E),P=!0,$(),P=!1)}t.flush=s;function c(){return w}t.getExceptionHandler=c;function l(J){var G=w;return w=J,G}t.setExceptionHandler=l;var h=new jR,p=new WeakMap,x=new Set,w=function(J){console.error(J)},E=0,P=!1,B=function(){var J=typeof requestAnimationFrame=="function";return J?requestAnimationFrame:setImmediate}(),D=function(){var J=typeof cancelAnimationFrame=="function";return J?cancelAnimationFrame:clearImmediate}();function W(J,G,me){var Me=!0;try{typeof J=="function"?Me=J(G,me):Me=J.messageHook(G,me)}catch(ce){w(ce)}return Me}function X(J,G){try{J.processMessage(G)}catch(me){w(me)}}function q(J,G){h.addLast({handler:J,msg:G}),E===0&&(E=B($))}function $(){if(E=0,!h.isEmpty){var J={handler:null,msg:null};for(h.addLast(J);;){var G=h.removeFirst();if(G===J)return;G.handler&&G.msg&&e(G.handler,G.msg)}}}function te(J){x.size===0&&B(F),x.add(J)}function F(){x.forEach(ue),x.clear()}function ue(J){Zt.removeAllWhere(J,oe)}function oe(J){return J===null}})(mr||(mr={}));var vl=function(){function t(e){this._pid=Ig.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,n=Ig.ensureMap(e);return this._pid in n?r=n[this._pid]:r=n[this._pid]=this._createValue(e),r},t.prototype.set=function(e,r){var n,i=Ig.ensureMap(e);this._pid in i?n=i[this._pid]:n=i[this._pid]=this._createValue(e);var o=this._coerceValue(e,r);this._maybeNotify(e,n,i[this._pid]=o)},t.prototype.coerce=function(e){var r,n=Ig.ensureMap(e);this._pid in n?r=n[this._pid]:r=n[this._pid]=this._createValue(e);var i=this._coerceValue(e,r);this._maybeNotify(e,r,n[this._pid]=i)},t.prototype._createValue=function(e){var r=this._create;return r(e)},t.prototype._coerceValue=function(e,r){var n=this._coerce;return n?n(e,r):r},t.prototype._compareValue=function(e,r){var n=this._compare;return n?n(e,r):e===r},t.prototype._maybeNotify=function(e,r,n){var i=this._changed;i&&!this._compareValue(r,n)&&i(e,r,n)},t}();(function(t){function e(r){Ig.ownerData.delete(r)}t.clearData=e})(vl||(vl={}));var Ig;(function(t){t.ownerData=new WeakMap,t.nextPID=function(){var r=0;return function(){var n=Math.random(),i=(""+n).slice(2);return"pid-"+i+"-"+r++}}();function e(r){var n=t.ownerData.get(r);return n||(n=Object.create(null),t.ownerData.set(r,n),n)}t.ensureMap=e})(Ig||(Ig={}));var Di=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 Gl.connect(this,e,r)},t.prototype.disconnect=function(e,r){return Gl.disconnect(this,e,r)},t.prototype.emit=function(e){this._blockedCount||Gl.emit(this,e)},t}();(function(t){function e(h,p){var x=Gl.blockedProperty;x.set(h,x.get(h)+1);try{p()}finally{x.set(h,x.get(h)-1)}}t.blockAll=e;function r(h,p){Gl.disconnectBetween(h,p)}t.disconnectBetween=r;function n(h){Gl.disconnectSender(h)}t.disconnectSender=n;function i(h){Gl.disconnectReceiver(h)}t.disconnectReceiver=i;function o(h){Gl.disconnectAll(h)}t.disconnectAll=o;function s(h){Gl.disconnectAll(h)}t.clearData=s;function c(){return Gl.exceptionHandler}t.getExceptionHandler=c;function l(h){var p=Gl.exceptionHandler;return Gl.exceptionHandler=h,p}t.setExceptionHandler=l})(Di||(Di={}));var Gl;(function(t){t.exceptionHandler=function(X){console.error(X)};function e(X,q,$){$=$||void 0;var te=l.get(X.sender);if(te||(te=[],l.set(X.sender,te)),w(te,X,q,$))return!1;var F=$||q,ue=h.get(F);ue||(ue=[],h.set(F,ue));var oe={signal:X,slot:q,thisArg:$};return te.push(oe),ue.push(oe),!0}t.connect=e;function r(X,q,$){$=$||void 0;var te=l.get(X.sender);if(!te||te.length===0)return!1;var F=w(te,X,q,$);if(!F)return!1;var ue=$||q,oe=h.get(ue);return F.signal=null,P(te),P(oe),!0}t.disconnect=r;function n(X,q){var $=l.get(X);if(!(!$||$.length===0)){var te=h.get(q);!te||te.length===0||(yn(te,function(F){F.signal&&F.signal.sender===X&&(F.signal=null)}),P($),P(te))}}t.disconnectBetween=n;function i(X){var q=l.get(X);!q||q.length===0||(yn(q,function($){if($.signal){var te=$.thisArg||$.slot;$.signal=null,P(h.get(te))}}),P(q))}t.disconnectSender=i;function o(X){var q=h.get(X);!q||q.length===0||(yn(q,function($){if($.signal){var te=$.signal.sender;$.signal=null,P(l.get(te))}}),P(q))}t.disconnectReceiver=o;function s(X){i(X),o(X)}t.disconnectAll=s;function c(X,q){if(!(t.blockedProperty.get(X.sender)>0)){var $=l.get(X.sender);if(!(!$||$.length===0))for(var te=0,F=$.length;te<F;++te){var ue=$[te];ue.signal===X&&E(ue,q)}}}t.emit=c;var l=new WeakMap,h=new WeakMap,p=new Set,x=function(){var X=typeof requestAnimationFrame=="function";return X?requestAnimationFrame:setImmediate}();function w(X,q,$,te){return yx(X,function(F){return F.signal===q&&F.slot===$&&F.thisArg===te})}function E(X,q){var $=X.signal,te=X.slot,F=X.thisArg;try{te.call(F,$.sender,q)}catch(ue){t.exceptionHandler(ue)}}function P(X){p.size===0&&x(B),p.add(X)}function B(){p.forEach(D),p.clear()}function D(X){Zt.removeAllWhere(X,W)}function W(X){return X.signal===null}t.blockedProperty=new vl({name:"blocked",create:function(){return 0}})})(Gl||(Gl={}));var A8=function(t,e){return A8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},A8(t,e)};function she(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");A8(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var fA=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}(),xWt=function(t){she(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Di(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),Di.clearData(this))},e}(fA),g8=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 n=new t;return yn(r,function(i){n.add(i)}),n}t.from=e})(g8||(g8={}));var ohe=function(t){she(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Di(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),Di.clearData(this))},e}(g8);(function(t){function e(r){var n=new t;return yn(r,function(i){n.add(i)}),n}t.from=e})(ohe||(ohe={}));var pA=function(){function t(e){var r=this;this._onScrollFrame=function(){if(r._scrollTarget){var n=r._scrollTarget,i=n.element,o=n.edge,s=n.distance,c=el.SCROLL_EDGE_SIZE-s,l=Math.pow(c/el.SCROLL_EDGE_SIZE,2),h=Math.max(1,Math.round(l*el.SCROLL_EDGE_SIZE));switch(o){case"top":i.scrollTop-=h;break;case"left":i.scrollLeft-=h;break;case"right":i.scrollLeft+=h;break;case"bottom":i.scrollTop+=h;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=el.createMouseEvent("pointerup",-1,-1);el.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 n=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){n._resolve=o});var i=el.createMouseEvent("pointermove",e,r);return document.dispatchEvent(i),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 n=this.dragImage.style;n.top=r+"px",n.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"){el.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}var r=el.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=el.findScrollTarget(e);!this._scrollTarget&&!r||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=r)},t.prototype._updateCurrentTarget=function(e){var r=this._currentTarget,n=this._currentTarget,i=this._currentElement,o=this.document.elementFromPoint(e.clientX,e.clientY);this._currentElement=o,o!==i&&o!==n&&el.dispatchDragExit(this,n,o,e),o!==i&&o!==n&&(n=el.dispatchDragEnter(this,o,n,e)),n!==r&&(this._currentTarget=n,el.dispatchDragLeave(this,r,n,e));var s=el.dispatchDragOver(this,n,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 n=this.dragImage.style;n.pointerEvents="none",n.position="fixed",n.top=r+"px",n.left=e+"px";var i=this.document instanceof Document?this.document.body:this.document.firstElementChild;i.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=el.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(n,i){i===void 0&&(i=document);var o=++r,s=i instanceof Document?i.body:i.firstElementChild;return s.style.cursor=n,s.classList.add("lm-mod-override-cursor"),s.classList.add("p-mod-override-cursor"),new fA(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})(pA||(pA={}));var el;(function(t){t.SCROLL_EDGE_SIZE=20;function e(w,E){return h[w]&p[E]?w:"none"}t.validateAction=e;function r(w,E,P){var B=document.createEvent("MouseEvent");return B.initMouseEvent(w,!0,!0,window,0,0,0,E,P,!1,!1,!1,!1,0,null),B}t.createMouseEvent=r;function n(w){for(var E=w.clientX,P=w.clientY,B=document.elementFromPoint(E,P);B;B=B.parentElement){var D=B.hasAttribute("data-lm-dragscroll");if(D=D||B.hasAttribute("data-p-dragscroll"),!!D){var W=0,X=0;B===document.body&&(W=window.pageXOffset,X=window.pageYOffset);var q=B.getBoundingClientRect(),$=q.top+X,te=q.left+W,F=te+q.width,ue=$+q.height;if(!(E<te||E>=F||P<$||P>=ue)){var oe=E-te+1,J=P-$+1,G=F-E,me=ue-P,Me=Math.min(oe,J,G,me);if(!(Me>t.SCROLL_EDGE_SIZE)){var ce=void 0;switch(Me){case me:ce="bottom";break;case J:ce="top";break;case G:ce="right";break;case oe:ce="left";break;default:throw"unreachable"}var ge=B.scrollWidth-B.clientWidth,tt=B.scrollHeight-B.clientHeight,Nt=void 0;switch(ce){case"top":Nt=tt>0&&B.scrollTop>0;break;case"left":Nt=ge>0&&B.scrollLeft>0;break;case"right":Nt=ge>0&&B.scrollLeft<ge;break;case"bottom":Nt=tt>0&&B.scrollTop<tt;break;default:throw"unreachable"}if(Nt)return{element:B,edge:ce,distance:Me}}}}}return null}t.findScrollTarget=n;function i(w,E,P,B){if(!E)return null;var D=x("lm-dragenter",w,B,P),W=!E.dispatchEvent(D);if(W||(D=x("p-dragenter",w,B,P),W=!E.dispatchEvent(D),W))return E;var X=w.document instanceof Document?w.document.body:w.document.firstElementChild;return E===X?P:(D=x("lm-dragenter",w,B,P),X.dispatchEvent(D),D=x("p-dragenter",w,B,P),X.dispatchEvent(D),X)}t.dispatchDragEnter=i;function o(w,E,P,B){if(E){var D=x("lm-dragexit",w,B,P);E.dispatchEvent(D),D=x("p-dragexit",w,B,P),E.dispatchEvent(D)}}t.dispatchDragExit=o;function s(w,E,P,B){if(E){var D=x("lm-dragleave",w,B,P);E.dispatchEvent(D),D=x("p-dragleave",w,B,P),E.dispatchEvent(D)}}t.dispatchDragLeave=s;function c(w,E,P){if(!E)return"none";var B=x("lm-dragover",w,P,null),D=!E.dispatchEvent(B);return D||(B=x("p-dragover",w,P,null),D=!E.dispatchEvent(B),D)?B.dropAction:"none"}t.dispatchDragOver=c;function l(w,E,P){if(!E)return"none";var B=x("lm-drop",w,P,null),D=!E.dispatchEvent(B);return D||(B=x("p-drop",w,P,null),D=!E.dispatchEvent(B),D)?B.dropAction:"none"}t.dispatchDrop=l;var h={none:0,copy:1,link:2,move:4},p={none:h.none,copy:h.copy,link:h.link,move:h.move,"copy-link":h.copy|h.link,"copy-move":h.copy|h.move,"link-move":h.link|h.move,all:h.copy|h.link|h.move};function x(w,E,P,B){var D=document.createEvent("MouseEvent");return D.initMouseEvent(w,!0,!0,window,0,P.screenX,P.screenY,P.clientX,P.clientY,P.ctrlKey,P.altKey,P.shiftKey,P.metaKey,P.button,B),D.dropAction="none",D.mimeData=E.mimeData,D.proposedAction=E.proposedAction,D.supportedActions=E.supportedActions,D.source=E.source,D}})(el||(el={}));var Og=ec(B1());var bl=ec(B1());function vx(){return y8.keyboardLayout}var _8=function(){function t(e,r,n){n===void 0&&(n=[]),this.name=e,this._codes=r,this._keys=t.extractKeys(r),this._modifierKeys=t.convertToKeySet(n)}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(n){var i=Object.create(null);for(var o in n)i[n[o]]=!0;return i}t.extractKeys=e;function r(n){for(var i=Object(null),o=0,s=n.length;o<s;++o)i[n[o]]=!0;return i}t.convertToKeySet=r})(_8||(_8={}));var Ize=new _8("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"]),y8;(function(t){t.keyboardLayout=Ize})(y8||(y8={}));var x8=function(){return x8=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},x8.apply(this,arguments)},bx=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 Di(this),this._commandExecuted=new Di(this),this._keyBindingChanged=new Di(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 n=this;if(e in this._commands)throw new Error("Command '"+e+"' already registered.");return this._commands[e]=dA.createCommand(r),this._commandChanged.emit({id:e,type:"added"}),new fA(function(){delete n._commands[e],n._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=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.label.call(void 0,r):""},t.prototype.mnemonic=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.mnemonic.call(void 0,r):-1},t.prototype.icon=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.icon.call(void 0,r):""},t.prototype.iconClass=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.iconClass.call(void 0,r):""},t.prototype.iconLabel=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.iconLabel.call(void 0,r):""},t.prototype.caption=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.caption.call(void 0,r):""},t.prototype.usage=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.usage.call(void 0,r):""},t.prototype.className=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.className.call(void 0,r):""},t.prototype.dataset=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.dataset.call(void 0,r):{}},t.prototype.isEnabled=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.isEnabled.call(void 0,r):!1},t.prototype.isToggled=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.isToggled.call(void 0,r):!1},t.prototype.isToggleable=function(e,r){var n=this._commands[e];return n?n.isToggleable:!1},t.prototype.isVisible=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];return n?n.isVisible.call(void 0,r):!1},t.prototype.execute=function(e,r){r===void 0&&(r=bl.JSONExt.emptyObject);var n=this._commands[e];if(!n)return Promise.reject(new Error("Command '"+e+"' not registered."));var i;try{i=n.execute.call(void 0,r)}catch(s){i=Promise.reject(s)}var o=Promise.resolve(i);return this._commandExecuted.emit({id:e,args:r,result:o}),o},t.prototype.addKeyBinding=function(e){var r=this,n=dA.createKeyBinding(e);return this._keyBindings.push(n),this._keyBindingChanged.emit({binding:n,type:"added"}),new fA(function(){Zt.removeFirstOf(r._keyBindings,n),r._keyBindingChanged.emit({binding:n,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 n=dA.matchKeyBinding(this._keyBindings,this._keystrokes,e),i=n.exact,o=n.partial;if(!i&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if(e.preventDefault(),e.stopPropagation(),i&&!o){this._executeKeyBinding(i),this._clearPendingState();return}i&&(this._exactKeyMatch=i),this._keydownEvents.push(e),this._startTimer()}},t.prototype._startTimer=function(){var e=this;this._clearTimer(),this._timerID=window.setTimeout(function(){e._onPendingTimeout()},dA.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(dA.replayKeyEvent),this._replaying=!1)},t.prototype._executeKeyBinding=function(e){var r=e.command,n=e.args;if(!this.hasCommand(r)||!this.isEnabled(r,n)){var i=this.hasCommand(r)?"enabled":"registered",o=e.keys.join(", "),s="Cannot execute key binding '"+o+"':",c="command '"+r+"' is not "+i+".";console.warn(s+" "+c);return}this.execute(r,n)},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(c){for(var l="",h=!1,p=!1,x=!1,w=!1,E=0,P=c.split(/\s+/);E<P.length;E++){var B=P[E];B==="Accel"?lc.IS_MAC?p=!0:x=!0:B==="Alt"?h=!0:B==="Cmd"?p=!0:B==="Ctrl"?x=!0:B==="Shift"?w=!0:B.length>0&&(l=B)}return{cmd:p,ctrl:x,alt:h,shift:w,key:l}}t.parseKeystroke=e;function r(c){var l="",h=e(c);return h.ctrl&&(l+="Ctrl "),h.alt&&(l+="Alt "),h.shift&&(l+="Shift "),h.cmd&&lc.IS_MAC&&(l+="Cmd "),l+h.key}t.normalizeKeystroke=r;function n(c){var l;return lc.IS_WIN?l=c.winKeys||c.keys:lc.IS_MAC?l=c.macKeys||c.keys:l=c.linuxKeys||c.keys,l.map(r)}t.normalizeKeys=n;function i(c){return typeof c=="string"?l(c):c.map(l).join(", ");function l(h){var p=[],x=lc.IS_MAC?" ":"+",w=e(h);return w.ctrl&&p.push("Ctrl"),w.alt&&p.push("Alt"),w.shift&&p.push("Shift"),lc.IS_MAC&&w.cmd&&p.push("Cmd"),p.push(w.key),p.map(dA.formatKey).join(x)}}t.formatKeystroke=i;function o(c){var l=vx(),h=l.keyForKeydownEvent(c);return l.isModifierKey(h)}t.isModifierKeyPressed=o;function s(c){var l=vx(),h=l.keyForKeydownEvent(c);if(!h||l.isModifierKey(h))return"";var p=[];return c.ctrlKey&&p.push("Ctrl"),c.altKey&&p.push("Alt"),c.shiftKey&&p.push("Shift"),c.metaKey&&lc.IS_MAC&&p.push("Cmd"),p.push(h),p.join(" ")}t.keystrokeForKeydownEvent=s})(bx||(bx={}));var dA;(function(t){t.CHORD_TIMEOUT=1e3;function e(q){var $,te;return!q.icon||typeof q.icon=="string"?(te=P(q.iconClass||q.icon,l),$=te):(te=P(q.iconClass,l),$=P(q.icon,E)),{execute:q.execute,describedBy:x8({args:null},q.describedBy),label:P(q.label,l),mnemonic:P(q.mnemonic,h),icon:$,iconClass:te,iconLabel:P(q.iconLabel,l),caption:P(q.caption,l),usage:P(q.usage,l),className:P(q.className,l),dataset:P(q.dataset,w),isEnabled:q.isEnabled||p,isToggled:q.isToggled||x,isToggleable:q.isToggleable||!!q.isToggled,isVisible:q.isVisible||p}}t.createCommand=e;function r(q){return{keys:bx.normalizeKeys(q),selector:B(q),command:q.command,args:q.args||bl.JSONExt.emptyObject}}t.createKeyBinding=r;function n(q,$,te){for(var F=null,ue=!1,oe=1/0,J=0,G=0,me=q.length;G<me;++G){var Me=q[G],ce=D(Me.keys,$);if(ce!==0){if(ce===2){!ue&&W(Me.selector,te)!==-1&&(ue=!0);continue}var ge=W(Me.selector,te);if(!(ge===-1||ge>oe)){var tt=Qh.calculateSpecificity(Me.selector);(!F||ge<oe||tt>=J)&&(F=Me,oe=ge,J=tt)}}}return{exact:F,partial:ue}}t.matchKeyBinding=n;function i(q){q.target.dispatchEvent(X(q))}t.replayKeyEvent=i;function o(q){return lc.IS_MAC?s.hasOwnProperty(q)?s[q]:q:c.hasOwnProperty(q)?c[q]:q}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"},c={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},l=function(){return""},h=function(){return-1},p=function(){return!0},x=function(){return!1},w=function(){return{}},E=function(){};function P(q,$){return q===void 0?$:typeof q=="function"?q:function(){return q}}function B(q){if(q.selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+q.selector);if(!Qh.isValid(q.selector))throw new Error("Invalid selector: "+q.selector);return q.selector}function D(q,$){if(q.length<$.length)return 0;for(var te=0,F=$.length;te<F;++te)if(q[te]!==$[te])return 0;return q.length>$.length?2:1}function W(q,$){for(var te=$.target,F=$.currentTarget,ue=0;te!==null;te=te.parentElement,++ue){if(te.hasAttribute("data-lm-suppress-shortcuts")||te.hasAttribute("data-p-suppress-shortcuts"))return-1;if(Qh.matches(te,q))return ue;if(te===F)return-1}return-1}function X(q){var $=document.createEvent("Event"),te=q.bubbles||!0,F=q.cancelable||!0;return $.initEvent(q.type||"keydown",te,F),$.key=q.key||"",$.keyCode=q.keyCode||0,$.which=q.keyCode||0,$.ctrlKey=q.ctrlKey||!1,$.altKey=q.altKey||!1,$.shiftKey=q.shiftKey||!1,$.metaKey=q.metaKey||!1,$.view=q.view||window,$}})(dA||(dA={}));var v8=function(t,e){return v8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},v8(t,e)};function Rze(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");v8(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var HR=function(){function t(e){this.type="text",this.content=e}return t}(),WR=function(){function t(e,r,n,i){this.type="element",this.tag=e,this.attrs=r,this.children=n,this.renderer=i}return t}(),LWt=function(t){Rze(e,t);function e(r,n,i){return t.call(this,r,n,[],i||void 0)||this}return e}(WR);function Ji(t){for(var e={},r,n=[],i=1,o=arguments.length;i<o;++i){var s=arguments[i];typeof s=="string"?n.push(new HR(s)):s instanceof HR||s instanceof WR?n.push(s):s instanceof Array?c(n,s):(i===1||i===2)&&s&&typeof s=="object"&&("render"in s?r=s:e=s)}return new WR(t,e,n,r);function c(l,h){for(var p=0,x=h;p<x.length;p++){var w=x[p];typeof w=="string"?l.push(new HR(w)):(w instanceof HR||w instanceof WR)&&l.push(w)}}}(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")})(Ji||(Ji={}));var Sd;(function(t){function e(n){return Rg.createDOMNode(n)}t.realize=e;function r(n,i){var o=Rg.hostMap.get(i)||[],s=Rg.asContentArray(n);Rg.hostMap.set(i,s),Rg.updateContent(i,o,s)}t.render=r})(Sd||(Sd={}));var Rg;(function(t){t.hostMap=new WeakMap;function e(E){return E?E instanceof Array?E:[E]:[]}t.asContentArray=e;function r(E){var P=arguments[1]||null,B=arguments[2]||null;if(P)P.insertBefore(r(E),B);else{if(E.type==="text")return document.createTextNode(E.content);if(P=document.createElement(E.tag),s(P,E.attrs),E.renderer)return E.renderer.render(P,{attrs:E.attrs,children:E.children}),P;for(var D=0,W=E.children.length;D<W;++D)r(E.children[D],P)}return P}t.createDOMNode=r;function n(E,P,B){if(P!==B){for(var D=w(E,P),W=P.slice(),X=E.firstChild,q=B.length,$=0;$<q;++$){if($>=W.length){r(B[$],E);continue}var te=W[$],F=B[$];if(te===F){X=X.nextSibling;continue}if(te.type==="text"&&F.type==="text"){X.textContent!==F.content&&(X.textContent=F.content),X=X.nextSibling;continue}if(te.type==="text"||F.type==="text"){Zt.insert(W,$,F),r(F,E,X);continue}if(!te.renderer!=!F.renderer){Zt.insert(W,$,F),r(F,E,X);continue}var ue=F.attrs.key;if(ue&&ue in D){var oe=D[ue];oe.vNode!==te&&(Zt.move(W,W.indexOf(oe.vNode,$+1),$),E.insertBefore(oe.element,X),te=oe.vNode,X=oe.element)}if(te===F){X=X.nextSibling;continue}var J=te.attrs.key;if(J&&J!==ue){Zt.insert(W,$,F),r(F,E,X);continue}if(te.tag!==F.tag){Zt.insert(W,$,F),r(F,E,X);continue}c(X,te.attrs,F.attrs),F.renderer?F.renderer.render(X,{attrs:F.attrs,children:F.children}):n(X,te.children,F.children),X=X.nextSibling}i(E,W,q,!0)}}t.updateContent=n;function i(E,P,B,D){for(var W=P.length-1;W>=B;--W){var X=P[W],q=D?E.lastChild:E.childNodes[W];X.type==="text"||(X.renderer&&X.renderer.unrender?X.renderer.unrender(q,{attrs:X.attrs,children:X.children}):i(q,X.children,0,!1)),D&&E.removeChild(q)}}var o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function s(E,P){for(var B in P)B in o||(B.substr(0,2)==="on"?E[B]=P[B]:E.setAttribute(B,P[B]));P.className!==void 0&&E.setAttribute("class",P.className),P.htmlFor!==void 0&&E.setAttribute("for",P.htmlFor),P.dataset&&l(E,P.dataset),P.style&&p(E,P.style)}function c(E,P,B){if(P!==B){var D;for(D in P)D in o||D in B||(D.substr(0,2)==="on"?E[D]=null:E.removeAttribute(D));for(D in B)D in o||P[D]===B[D]||(D.substr(0,2)==="on"?E[D]=B[D]:E.setAttribute(D,B[D]));P.className!==B.className&&(B.className!==void 0?E.setAttribute("class",B.className):E.removeAttribute("class")),P.htmlFor!==B.htmlFor&&(B.htmlFor!==void 0?E.setAttribute("for",B.htmlFor):E.removeAttribute("for")),P.dataset!==B.dataset&&h(E,P.dataset||{},B.dataset||{}),P.style!==B.style&&x(E,P.style||{},B.style||{})}}function l(E,P){for(var B in P)E.setAttribute("data-"+B,P[B])}function h(E,P,B){for(var D in P)D in B||E.removeAttribute("data-"+D);for(var W in B)P[W]!==B[W]&&E.setAttribute("data-"+W,B[W])}function p(E,P){var B=E.style,D;for(D in P)B[D]=P[D]}function x(E,P,B){var D=E.style,W;for(W in P)W in B||(D[W]="");for(W in B)P[W]!==B[W]&&(D[W]=B[W])}function w(E,P){for(var B=E.firstChild,D=Object.create(null),W=0,X=P;W<X.length;W++){var q=X[W];q.type==="element"&&q.attrs.key&&(D[q.attrs.key]={vNode:q,element:B}),B=B.nextSibling}return D}})(Rg||(Rg={}));var b8=function(t,e){return b8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},b8(t,e)};function Ds(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");b8(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var uc=function(){return uc=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},uc.apply(this,arguments)};function Lze(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Oze(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,c=o.length;s<c;s++,i++)n[i]=o[s];return n}var mA=function(){function t(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}return t}(),xu;(function(t){function e(o,s){var c=o.length;if(c===0)return s;for(var l=0,h=0,p=0,x=0,w=0,E=0;E<c;++E){var P=o[E],B=P.minSize,D=P.maxSize,W=P.sizeHint;P.done=!1,P.size=Math.max(B,Math.min(W,D)),p+=P.size,l+=B,h+=D,P.stretch>0&&(x+=P.stretch,w++)}if(s===p)return 0;if(s<=l){for(var E=0;E<c;++E){var P=o[E];P.size=P.minSize}return s-l}if(s>=h){for(var E=0;E<c;++E){var P=o[E];P.size=P.maxSize}return s-h}var X=.01,q=c;if(s<p){for(var $=p-s;w>0&&$>X;)for(var te=$,F=x,E=0;E<c;++E){var P=o[E];if(!(P.done||P.stretch===0)){var ue=P.stretch*te/F;P.size-ue<=P.minSize?($-=P.size-P.minSize,x-=P.stretch,P.size=P.minSize,P.done=!0,q--,w--):($-=ue,P.size-=ue)}}for(;q>0&&$>X;)for(var ue=$/q,E=0;E<c;++E){var P=o[E];P.done||(P.size-ue<=P.minSize?($-=P.size-P.minSize,P.size=P.minSize,P.done=!0,q--):($-=ue,P.size-=ue))}}else{for(var $=s-p;w>0&&$>X;)for(var te=$,F=x,E=0;E<c;++E){var P=o[E];if(!(P.done||P.stretch===0)){var ue=P.stretch*te/F;P.size+ue>=P.maxSize?($-=P.maxSize-P.size,x-=P.stretch,P.size=P.maxSize,P.done=!0,q--,w--):($-=ue,P.size+=ue)}}for(;q>0&&$>X;)for(var ue=$/q,E=0;E<c;++E){var P=o[E];P.done||(P.size+ue>=P.maxSize?($-=P.maxSize-P.size,P.size=P.maxSize,P.done=!0,q--):($-=ue,P.size+=ue))}}return 0}t.calc=e;function r(o,s,c){o.length===0||c===0||(c>0?n(o,s,c):i(o,s,-c))}t.adjust=r;function n(o,s,c){for(var l=0,h=0;h<=s;++h){var p=o[h];l+=p.maxSize-p.size}for(var x=0,h=s+1,w=o.length;h<w;++h){var p=o[h];x+=p.size-p.minSize}c=Math.min(c,l,x);for(var E=c,h=s;h>=0&&E>0;--h){var p=o[h],P=p.maxSize-p.size;P>=E?(p.sizeHint=p.size+E,E=0):(p.sizeHint=p.size+P,E-=P)}for(var B=c,h=s+1,w=o.length;h<w&&B>0;++h){var p=o[h],P=p.size-p.minSize;P>=B?(p.sizeHint=p.size-B,B=0):(p.sizeHint=p.size-P,B-=P)}}function i(o,s,c){for(var l=0,h=s+1,p=o.length;h<p;++h){var x=o[h];l+=x.maxSize-x.size}for(var w=0,h=0;h<=s;++h){var x=o[h];w+=x.size-x.minSize}c=Math.min(c,l,w);for(var E=c,h=s+1,p=o.length;h<p&&E>0;++h){var x=o[h],P=x.maxSize-x.size;P>=E?(x.sizeHint=x.size+E,E=0):(x.sizeHint=x.size+P,E-=P)}for(var B=c,h=s;h>=0&&B>0;--h){var x=o[h],P=x.size-x.minSize;P>=B?(x.sizeHint=x.size-B,B=0):(x.sizeHint=x.size-P,B-=P)}}})(xu||(xu={}));var w8=function(){function t(e){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Di(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,Di.clearData(this))},t}(),Mr=function(){function t(e){e===void 0&&(e={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new Di(this),this._hiddenMode=t.HiddenMode.Display,this.node=qR.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(),Di.clearData(this),mr.clearData(this),vl.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 qR.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);mr.sendMessage(this._parent,r)}if(this._parent=e,this._parent&&!this._parent.isDisposed){var r=new t.ChildMessage("child-added",this);mr.sendMessage(this._parent,r)}this.isDisposed||mr.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():_u()},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(){mr.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){mr.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){mr.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){mr.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&mr.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)&&mr.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);mr.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&mr.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)&&mr.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);mr.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 yu("before-show"),o.AfterShow=new yu("after-show"),o.BeforeHide=new yu("before-hide"),o.AfterHide=new yu("after-hide"),o.BeforeAttach=new yu("before-attach"),o.AfterAttach=new yu("after-attach"),o.BeforeDetach=new yu("before-detach"),o.AfterDetach=new yu("after-detach"),o.ParentChanged=new yu("parent-changed"),o.UpdateRequest=new xx("update-request"),o.FitRequest=new xx("fit-request"),o.ActivateRequest=new xx("activate-request"),o.CloseRequest=new xx("close-request")}(t.Msg||(t.Msg={}));var e=function(o){Ds(s,o);function s(c,l){var h=o.call(this,c)||this;return h.child=l,h}return s}(yu);t.ChildMessage=e;var r=function(o){Ds(s,o);function s(c,l){var h=o.call(this,"resize")||this;return h.width=c,h.height=l,h}return s}(yu);t.ResizeMessage=r,function(o){o.UnknownSize=new o(-1,-1)}(r=t.ResizeMessage||(t.ResizeMessage={}));function n(o,s,c){if(c===void 0&&(c=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.");mr.sendMessage(o,t.Msg.BeforeAttach),s.insertBefore(o.node,c),mr.sendMessage(o,t.Msg.AfterAttach)}t.attach=n;function i(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.");mr.sendMessage(o,t.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),mr.sendMessage(o,t.Msg.AfterDetach)}t.detach=i})(Mr||(Mr={}));var qR;(function(t){t.titleProperty=new vl({name:"title",create:function(r){return new w8({owner:r})}});function e(r){return r.node||document.createElement(r.tag||"div")}t.createNode=e})(qR||(qR={}));var AA=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,Di.clearData(this),vl.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;yn(this,function(r){r.parent=e.parent})},t.prototype.onResize=function(e){yn(this,function(r){mr.sendMessage(r,Mr.ResizeMessage.UnknownSize)})},t.prototype.onUpdateRequest=function(e){yn(this,function(r){mr.sendMessage(r,Mr.ResizeMessage.UnknownSize)})},t.prototype.onBeforeAttach=function(e){yn(this,function(r){mr.sendMessage(r,e)})},t.prototype.onAfterAttach=function(e){yn(this,function(r){mr.sendMessage(r,e)})},t.prototype.onBeforeDetach=function(e){yn(this,function(r){mr.sendMessage(r,e)})},t.prototype.onAfterDetach=function(e){yn(this,function(r){mr.sendMessage(r,e)})},t.prototype.onBeforeShow=function(e){yn(this,function(r){r.isHidden||mr.sendMessage(r,e)})},t.prototype.onAfterShow=function(e){yn(this,function(r){r.isHidden||mr.sendMessage(r,e)})},t.prototype.onBeforeHide=function(e){yn(this,function(r){r.isHidden||mr.sendMessage(r,e)})},t.prototype.onAfterHide=function(e){yn(this,function(r){r.isHidden||mr.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 wx.horizontalAlignmentProperty.get(o)}t.getHorizontalAlignment=e;function r(o,s){wx.horizontalAlignmentProperty.set(o,s)}t.setHorizontalAlignment=r;function n(o){return wx.verticalAlignmentProperty.get(o)}t.getVerticalAlignment=n;function i(o,s){wx.verticalAlignmentProperty.set(o,s)}t.setVerticalAlignment=i})(AA||(AA={}));var DT=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=co.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,n,i){var o=Math.max(this._minWidth,Math.min(n,this._maxWidth)),s=Math.max(this._minHeight,Math.min(i,this._maxHeight));if(o<n)switch(AA.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(n-o)/2;break;case"right":e+=n-o;break;default:throw"unreachable"}if(s<i)switch(AA.getVerticalAlignment(this.widget)){case"top":break;case"center":r+=(i-s)/2;break;case"bottom":r+=i-s;break;default:throw"unreachable"}var c=!1,l=this.widget.node.style;if(this._top!==r&&(this._top=r,l.top=r+"px"),this._left!==e&&(this._left=e,l.left=e+"px"),this._width!==o&&(c=!0,this._width=o,l.width=o+"px"),this._height!==s&&(c=!0,this._height=s,l.height=s+"px"),c){var h=new Mr.ResizeMessage(o,s);mr.sendMessage(this.widget,h)}},t}(),wx;(function(t){t.horizontalAlignmentProperty=new vl({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new vl({name:"verticalAlignment",create:function(){return"top"},changed:e});function e(r){r.parent&&r.parent.layout&&r.parent.update()}})(wx||(wx={}));var ZR=function(t){Ds(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 gu(this._widgets)},e.prototype.addWidget=function(r){this.insertWidget(this._widgets.length,r)},e.prototype.insertWidget=function(r,n){n.parent=this.parent;var i=this._widgets.indexOf(n),o=Math.max(0,Math.min(r,this._widgets.length));if(i===-1){Zt.insert(this._widgets,o,n),this.parent&&this.attachWidget(o,n);return}o===this._widgets.length&&o--,i!==o&&(Zt.move(this._widgets,i,o),this.parent&&this.moveWidget(i,o,n))},e.prototype.removeWidget=function(r){this.removeWidgetAt(this._widgets.indexOf(r))},e.prototype.removeWidgetAt=function(r){var n=Zt.removeAt(this._widgets,r);n&&this.parent&&this.detachWidget(r,n)},e.prototype.init=function(){var r=this;t.prototype.init.call(this),yn(this,function(n,i){r.attachWidget(i,n)})},e.prototype.attachWidget=function(r,n){var i=this.parent.node.children[r];this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,i),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterAttach)},e.prototype.moveWidget=function(r,n,i){this.parent.isAttached&&mr.sendMessage(i,Mr.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&mr.sendMessage(i,Mr.Msg.AfterDetach);var o=this.parent.node.children[n];this.parent.isAttached&&mr.sendMessage(i,Mr.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,o),this.parent.isAttached&&mr.sendMessage(i,Mr.Msg.AfterAttach)},e.prototype.detachWidget=function(r,n){this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterDetach)},e}(AA),LT;(function(t){function e(r){return Math.max(0,Math.floor(r))}t.clampDimension=e})(LT||(LT={}));var OT=LT,Bg=function(t){Ds(e,t);function e(r){var n=t.call(this)||this;return n.widgetOffset=0,n._fixed=0,n._spacing=4,n._dirty=!1,n._hasNormedSizes=!1,n._sizers=[],n._items=[],n._handles=[],n._box=null,n._alignment="start",n._orientation="horizontal",n.renderer=r.renderer,r.orientation!==void 0&&(n._orientation=r.orientation),r.alignment!==void 0&&(n._alignment=r.alignment),r.spacing!==void 0&&(n._spacing=LT.clampDimension(r.spacing)),n}return e.prototype.dispose=function(){yn(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=LT.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 Pd.normalize(this._sizers.map(function(r){return r.size}))},e.prototype.setRelativeSizes=function(r,n){n===void 0&&(n=!0);for(var i=this._sizers.length,o=r.slice(0,i);o.length<i;)o.push(0);for(var s=Pd.normalize(o),c=0;c<i;++c){var l=this._sizers[c];l.sizeHint=s[c],l.size=s[c]}this._hasNormedSizes=!0,n&&this.parent&&this.parent.update()},e.prototype.moveHandle=function(r,n){var i=this._handles[r];if(!(!i||i.classList.contains("lm-mod-hidden"))){var o;if(this._orientation==="horizontal"?o=n-i.offsetLeft:o=n-i.offsetTop,o!==0){for(var s=0,c=this._sizers;s<c.length;s++){var l=c[s];l.size>0&&(l.sizeHint=l.size)}xu.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,n){var i=new DT(n),o=Pd.createHandle(this.renderer),s=Pd.averageSize(this._sizers),c=Pd.createSizer(s);Zt.insert(this._items,r,i),Zt.insert(this._sizers,r,c),Zt.insert(this._handles,r,o),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeAttach),this.parent.node.appendChild(n.node),this.parent.node.appendChild(o),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,n,i){Zt.move(this._items,r,n),Zt.move(this._sizers,r,n),Zt.move(this._handles,r,n),this.parent.fit()},e.prototype.detachWidget=function(r,n){var i=Zt.removeAt(this._items,r),o=Zt.removeAt(this._handles,r);Zt.removeAt(this._sizers,r),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.node.removeChild(o),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterDetach),i.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,n,i,o,s,c,l){var h=this._items[r];if(!h.isHidden){var p=this._handles[r].style;n?(i+=this.widgetOffset,h.update(i,o,l,s),i+=l,p.top=o+"px",p.left=i+"px",p.width=this._spacing+"px",p.height=s+"px"):(o+=this.widgetOffset,h.update(i,o,c,l),o+=l,p.top=o+"px",p.left=i+"px",p.width=c+"px",p.height=this._spacing+"px")}},e.prototype._fit=function(){for(var r=0,n=-1,i=0,o=this._items.length;i<o;++i)this._items[i].isHidden?(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")):(this._handles[i].classList.remove("lm-mod-hidden"),this._handles[i].classList.remove("p-mod-hidden"),n=i,r++);n!==-1&&(this._handles[n].classList.add("lm-mod-hidden"),this._handles[n].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",c=s?this._fixed:0,l=s?0:this._fixed,i=0,o=this._items.length;i<o;++i){var h=this._items[i],p=this._sizers[i];if(p.size>0&&(p.sizeHint=p.size),h.isHidden){p.minSize=0,p.maxSize=0;continue}h.fit(),p.stretch=e.getStretch(h.widget),s?(p.minSize=h.minWidth,p.maxSize=h.maxWidth,c+=h.minWidth,l=Math.max(l,h.minHeight)):(p.minSize=h.minHeight,p.maxSize=h.maxHeight,l+=h.minHeight,c=Math.max(c,h.minWidth))}var x=this._box=co.boxSizing(this.parent.node);c+=x.horizontalSum,l+=x.verticalSum;var w=this.parent.node.style;w.minWidth=c+"px",w.minHeight=l+"px",this._dirty=!0,this.parent.parent&&mr.sendMessage(this.parent.parent,Mr.Msg.FitRequest),this._dirty&&mr.sendMessage(this.parent,Mr.Msg.UpdateRequest)},e.prototype._update=function(r,n){this._dirty=!1;for(var i=0,o=0,s=this._items.length;o<s;++o)i+=+!this._items[o].isHidden;if(!(i===0&&this.widgetOffset===0)){r<0&&(r=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=co.boxSizing(this.parent.node));var c=this._box.paddingTop,l=this._box.paddingLeft,h=r-this._box.horizontalSum,p=n-this._box.verticalSum,x=0,w=0,E=this._orientation==="horizontal";if(i>0){var P=void 0;if(E?P=Math.max(0,h-this._fixed):P=Math.max(0,p-this._fixed),this._hasNormedSizes){for(var B=0,D=this._sizers;B<D.length;B++){var W=D[B];W.sizeHint*=P}this._hasNormedSizes=!1}var X=xu.calc(this._sizers,P);if(X>0)switch(this._alignment){case"start":break;case"center":x=0,w=X/2;break;case"end":x=0,w=X;break;case"justify":x=X/i,w=0;break;default:throw"unreachable"}}for(var o=0,s=this._items.length;o<s;++o){var q=this._items[o],$=q.isHidden?0:this._sizers[o].size+x;this.updateItemPosition(o,E,E?l+w:l,E?c:c+w,p,h,$);var te=this.widgetOffset+(this._handles[o].classList.contains("lm-mod-hidden")?0:this._spacing);E?l+=$+te:c+=$+te}}},e}(ZR);(function(t){function e(n){return Pd.stretchProperty.get(n)}t.getStretch=e;function r(n,i){Pd.stretchProperty.set(n,i)}t.setStretch=r})(Bg||(Bg={}));var Pd;(function(t){t.stretchProperty=new vl({name:"stretch",create:function(){return 0},coerce:function(s,c){return Math.max(0,Math.floor(c))},changed:o});function e(s){var c=new mA;return c.sizeHint=Math.floor(s),c}t.createSizer=e;function r(s){var c=s.createHandle();return c.style.position="absolute",c}t.createHandle=r;function n(s){return s.reduce(function(c,l){return c+l.size},0)/s.length||0}t.averageSize=n;function i(s){var c=s.length;if(c===0)return[];var l=s.reduce(function(h,p){return h+Math.abs(p)},0);return l===0?s.map(function(h){return 1/c}):s.map(function(h){return h/l})}t.normalize=i;function o(s){s.parent&&s.parent.layout instanceof Bg&&s.parent.fit()}})(Pd||(Pd={}));var Bze=function(t){Ds(e,t);function e(r){var n=t.call(this,uc(uc({},r),{orientation:r.orientation||"vertical"}))||this;return n._titles=[],n.titleSpace=r.titleSpace||22,n}return Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(r){r=OT.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,n){var i=this._titles[r],o=i.classList.contains("lm-mod-expanded"),s=GR.createTitle(this.renderer,n.title,o);this._titles[r]=s,this.parent.node.replaceChild(s,i)},e.prototype.attachWidget=function(r,n){var i=GR.createTitle(this.renderer,n.title);Zt.insert(this._titles,r,i),this.parent.node.appendChild(i),n.node.setAttribute("role","region"),n.node.setAttribute("aria-labelledby",i.id),t.prototype.attachWidget.call(this,r,n)},e.prototype.moveWidget=function(r,n,i){Zt.move(this._titles,r,n),t.prototype.moveWidget.call(this,r,n,i)},e.prototype.detachWidget=function(r,n){var i=Zt.removeAt(this._titles,r);this.parent.node.removeChild(i),t.prototype.detachWidget.call(this,r,n)},e.prototype.updateItemPosition=function(r,n,i,o,s,c,l){var h=this._titles[r].style;h.top=o+"px",h.left=i+"px",h.height=this.widgetOffset+"px",n?h.width=s+"px":h.width=c+"px",t.prototype.updateItemPosition.call(this,r,n,i,o,s,c,l)},e}(Bg),GR;(function(t){function e(r,n,i){i===void 0&&(i=!0);var o=r.createSectionTitle(n);return o.style.position="absolute",o.setAttribute("aria-label",n.label+" Section"),o.setAttribute("aria-expanded",i?"true":"false"),o.setAttribute("aria-controls",n.owner.id),i&&o.classList.add("lm-mod-expanded"),o}t.createTitle=e})(GR||(GR={}));var NT=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.addClass("lm-Panel"),n.addClass("p-Panel"),n.layout=T8.createLayout(r),n}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,n){this.layout.insertWidget(r,n)},e}(Mr),T8;(function(t){function e(r){return r.layout||new ZR}t.createLayout=e})(T8||(T8={}));var BT=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,{layout:E8.createLayout(r)})||this;return n._handleMoved=new Di(n),n._pressData=null,n.addClass("lm-SplitPanel"),n.addClass("p-SplitPanel"),n}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,n){n===void 0&&(n=!0),this.layout.setRelativeSizes(r,n)},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 n=this.layout,i=Zt.findFirstIndex(n.handles,function(p){return p.contains(r.target)});if(i!==-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=n.handles[i],c=s.getBoundingClientRect();n.orientation==="horizontal"?o=r.clientX-c.left:o=r.clientY-c.top;var l=window.getComputedStyle(s),h=pA.overrideCursor(l.cursor);this._pressData={index:i,delta:o,override:h}}}},e.prototype._evtMouseMove=function(r){r.preventDefault(),r.stopPropagation();var n,i=this.layout,o=this.node.getBoundingClientRect();i.orientation==="horizontal"?n=r.clientX-o.left-this._pressData.delta:n=r.clientY-o.top-this._pressData.delta,i.moveHandle(this._pressData.index,n)},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}(NT);(function(t){var e=function(){function i(){}return i.prototype.createHandle=function(){var o=document.createElement("div");return o.className="lm-SplitPanel-handle",o.classList.add("p-SplitPanel-handle"),o},i}();t.Renderer=e,t.defaultRenderer=new e;function r(i){return Bg.getStretch(i)}t.getStretch=r;function n(i,o){Bg.setStretch(i,o)}t.setStretch=n})(BT||(BT={}));var E8;(function(t){function e(r){return r.layout||new Bg({renderer:r.renderer||BT.defaultRenderer,orientation:r.orientation,alignment:r.alignment,spacing:r.spacing})}t.createLayout=e})(E8||(E8={}));var M8=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,uc(uc({},r),{layout:S8.createLayout(r)}))||this;return n._widgetSizesCache=new WeakMap,n.addClass("lm-AccordionPanel"),n}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 n=this.layout.widgets[r];n&&!n.isHidden&&this._toggleExpansion(r)},e.prototype.expand=function(r){var n=this.layout.widgets[r];n&&n.isHidden&&this._toggleExpansion(r)},e.prototype.insertWidget=function(r,n){t.prototype.insertWidget.call(this,r,n),n.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 n=Zt.findFirstIndex(this.widgets,function(i){return i.contains(r.owner)});n>=0&&(this.layout.updateTitle(n,r.owner),this.update())},e.prototype._computeWidgetSize=function(r){var n=this.layout,i=n.widgets[r];if(i){var o=i.isHidden,s=n.absoluteSizes(),c=(o?-1:1)*this.spacing,l=s.reduce(function(E,P){return E+P}),h=Oze(s);if(o){var w=this._widgetSizesCache.get(i);if(!w)return;h[r]+=w;var x=h.map(function(P){return P-w>0}).lastIndexOf(!0);x===-1?h.forEach(function(P,B){B!==r&&(h[B]-=s[B]/l*(w-c))}):h[x]-=w-c}else{var p=s[r];this._widgetSizesCache.set(i,p),h[r]=0;var x=h.map(function(E){return E>0}).lastIndexOf(!0);if(x===-1)return;h[x]=s[x]+p+c}return h.map(function(E){return E/(l+c)})}},e.prototype._evtClick=function(r){var n=r.target;if(n){var i=Zt.findFirstIndex(this.titles,function(o){return o.contains(n)});i>=0&&(r.preventDefault(),r.stopPropagation(),this._toggleExpansion(i))}},e.prototype._eventKeyDown=function(r){if(!r.defaultPrevented){var n=r.target,i=!1;if(n){var o=Zt.findFirstIndex(this.titles,function(p){return p.contains(n)});if(o>=0){var s=r.keyCode.toString();if(r.key.match(/Space|Enter/)||s.match(/13|32/))n.click(),i=!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 c=r.key.match(/ArrowLeft|ArrowUp/)||s.match(/37|38/)?-1:1,l=this.titles.length,h=(o+l+c)%l;this.titles[h].focus(),i=!0}else r.key==="End"||s==="35"?(this.titles[this.titles.length-1].focus(),i=!0):(r.key==="Home"||s==="36")&&(this.titles[0].focus(),i=!0)}i&&r.preventDefault()}}},e.prototype._toggleExpansion=function(r){var n=this.titles[r],i=this.layout.widgets[r],o=this._computeWidgetSize(r);o&&this.setRelativeSizes(o,!1),i.isHidden?(n.classList.add("lm-mod-expanded"),n.setAttribute("aria-expanded","true"),i.show()):(n.classList.remove("lm-mod-expanded"),n.setAttribute("aria-expanded","false"),i.hide())},e}(BT);(function(t){var e=function(r){Ds(n,r);function n(){var i=r.call(this)||this;return i.titleClassName="lm-AccordionPanel-title",i._titleID=0,i._titleKeys=new WeakMap,i._uuid=++n._nInstance,i}return n.prototype.createCollapseIcon=function(i){return document.createElement("span")},n.prototype.createSectionTitle=function(i){var o=document.createElement("h3");o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.id=this.createTitleKey(i),o.className=this.titleClassName;for(var s in i.dataset)o.dataset[s]=i.dataset[s];var c=o.appendChild(this.createCollapseIcon(i));c.className="lm-AccordionPanel-titleCollapser";var l=o.appendChild(document.createElement("span"));return l.className="lm-AccordionPanel-titleLabel",l.textContent=i.label,l.title=i.caption||i.label,o},n.prototype.createTitleKey=function(i){var o=this._titleKeys.get(i);return o===void 0&&(o="title-key-"+this._uuid+"-"+this._titleID++,this._titleKeys.set(i,o)),o},n._nInstance=0,n}(BT.Renderer);t.Renderer=e,t.defaultRenderer=new e})(M8||(M8={}));var S8;(function(t){function e(r){return r.layout||new Bze({renderer:r.renderer||M8.defaultRenderer,orientation:r.orientation,alignment:r.alignment,spacing:r.spacing,titleSpace:r.titleSpace})}t.createLayout=e})(S8||(S8={}));var Jh=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n._fixed=0,n._spacing=4,n._dirty=!1,n._sizers=[],n._items=[],n._box=null,n._alignment="start",n._direction="top-to-bottom",r.direction!==void 0&&(n._direction=r.direction),r.alignment!==void 0&&(n._alignment=r.alignment),r.spacing!==void 0&&(n._spacing=OT.clampDimension(r.spacing)),n}return e.prototype.dispose=function(){yn(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=OT.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,n){Zt.insert(this._items,r,new DT(n)),Zt.insert(this._sizers,r,new mA),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeAttach),this.parent.node.appendChild(n.node),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,n,i){Zt.move(this._items,r,n),Zt.move(this._sizers,r,n),this.parent.update()},e.prototype.detachWidget=function(r,n){var i=Zt.removeAt(this._items,r);Zt.removeAt(this._sizers,r),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterDetach),i.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,n=0,i=this._items.length;n<i;++n)r+=+!this._items[n].isHidden;this._fixed=this._spacing*Math.max(0,r-1);for(var o=Lg.isHorizontal(this._direction),s=o?this._fixed:0,c=o?0:this._fixed,n=0,i=this._items.length;n<i;++n){var l=this._items[n],h=this._sizers[n];if(l.isHidden){h.minSize=0,h.maxSize=0;continue}l.fit(),h.sizeHint=e.getSizeBasis(l.widget),h.stretch=e.getStretch(l.widget),o?(h.minSize=l.minWidth,h.maxSize=l.maxWidth,s+=l.minWidth,c=Math.max(c,l.minHeight)):(h.minSize=l.minHeight,h.maxSize=l.maxHeight,c+=l.minHeight,s=Math.max(s,l.minWidth))}var p=this._box=co.boxSizing(this.parent.node);s+=p.horizontalSum,c+=p.verticalSum;var x=this.parent.node.style;x.minWidth=s+"px",x.minHeight=c+"px",this._dirty=!0,this.parent.parent&&mr.sendMessage(this.parent.parent,Mr.Msg.FitRequest),this._dirty&&mr.sendMessage(this.parent,Mr.Msg.UpdateRequest)},e.prototype._update=function(r,n){this._dirty=!1;for(var i=0,o=0,s=this._items.length;o<s;++o)i+=+!this._items[o].isHidden;if(i!==0){r<0&&(r=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=co.boxSizing(this.parent.node));var c=this._box.paddingTop,l=this._box.paddingLeft,h=r-this._box.horizontalSum,p=n-this._box.verticalSum,x;switch(this._direction){case"left-to-right":x=xu.calc(this._sizers,Math.max(0,h-this._fixed));break;case"top-to-bottom":x=xu.calc(this._sizers,Math.max(0,p-this._fixed));break;case"right-to-left":x=xu.calc(this._sizers,Math.max(0,h-this._fixed)),l+=h;break;case"bottom-to-top":x=xu.calc(this._sizers,Math.max(0,p-this._fixed)),c+=p;break;default:throw"unreachable"}var w=0,E=0;if(x>0)switch(this._alignment){case"start":break;case"center":w=0,E=x/2;break;case"end":w=0,E=x;break;case"justify":w=x/i,E=0;break;default:throw"unreachable"}for(var o=0,s=this._items.length;o<s;++o){var P=this._items[o];if(!P.isHidden){var B=this._sizers[o].size;switch(this._direction){case"left-to-right":P.update(l+E,c,B+w,p),l+=B+w+this._spacing;break;case"top-to-bottom":P.update(l,c+E,h,B+w),c+=B+w+this._spacing;break;case"right-to-left":P.update(l-E-B-w,c,B+w,p),l-=B+w+this._spacing;break;case"bottom-to-top":P.update(l,c-E-B-w,h,B+w),c-=B+w+this._spacing;break;default:throw"unreachable"}}}}},e}(ZR);(function(t){function e(o){return Lg.stretchProperty.get(o)}t.getStretch=e;function r(o,s){Lg.stretchProperty.set(o,s)}t.setStretch=r;function n(o){return Lg.sizeBasisProperty.get(o)}t.getSizeBasis=n;function i(o,s){Lg.sizeBasisProperty.set(o,s)}t.setSizeBasis=i})(Jh||(Jh={}));var Lg;(function(t){t.stretchProperty=new vl({name:"stretch",create:function(){return 0},coerce:function(i,o){return Math.max(0,Math.floor(o))},changed:n}),t.sizeBasisProperty=new vl({name:"sizeBasis",create:function(){return 0},coerce:function(i,o){return Math.max(0,Math.floor(o))},changed:n});function e(i){return i==="left-to-right"||i==="right-to-left"}t.isHorizontal=e;function r(i){return Math.max(0,Math.floor(i))}t.clampSpacing=r;function n(i){i.parent&&i.parent.layout instanceof Jh&&i.parent.fit()}})(Lg||(Lg={}));var ahe=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,{layout:C8.createLayout(r)})||this;return n.addClass("lm-BoxPanel"),n.addClass("p-BoxPanel"),n}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}(NT);(function(t){function e(o){return Jh.getStretch(o)}t.getStretch=e;function r(o,s){Jh.setStretch(o,s)}t.setStretch=r;function n(o){return Jh.getSizeBasis(o)}t.getSizeBasis=n;function i(o,s){Jh.setSizeBasis(o,s)}t.setSizeBasis=i})(ahe||(ahe={}));var C8;(function(t){function e(r){return r.layout||new Jh(r)}t.createLayout=e})(C8||(C8={}));var che=function(t){Ds(e,t);function e(r){var n=t.call(this,{node:Cd.createNode()})||this;return n._activeIndex=-1,n._items=[],n._results=null,n.addClass("lm-CommandPalette"),n.addClass("p-CommandPalette"),n.setFlag(Mr.Flag.DisallowLayout),n.commands=r.commands,n.renderer=r.renderer||e.defaultRenderer,n.commands.commandChanged.connect(n._onGenericChange,n),n.commands.keyBindingChanged.connect(n._onGenericChange,n),n}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 n=Cd.createItem(this.commands,r);return this._items.push(n),this.refresh(),n},e.prototype.addItems=function(r){var n=this,i=r.map(function(o){return Cd.createItem(n.commands,o)});return i.forEach(function(o){return n._items.push(o)}),this.refresh(),i},e.prototype.removeItem=function(r){this.removeItemAt(this._items.indexOf(r))},e.prototype.removeItemAt=function(r){var n=Zt.removeAt(this._items,r);n&&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 n=this.inputNode;n.focus(),n.select()}},e.prototype.onUpdateRequest=function(r){var n=this.inputNode.value,i=this.contentNode,o=this._results;if(o||(o=this._results=Cd.search(this._items,n),this._activeIndex=n?Zt.findFirstIndex(o,Cd.canActivate):-1),!n&&o.length===0){Sd.render(null,i);return}if(n&&o.length===0){var s=this.renderer.renderEmptyMessage({query:n});Sd.render(s,i);return}for(var c=this.renderer,l=this._activeIndex,h=new Array(o.length),p=0,x=o.length;p<x;++p){var w=o[p];if(w.type==="header"){var E=w.indices,P=w.category;h[p]=c.renderHeader({category:P,indices:E})}else{var B=w.item,E=w.indices,D=p===l;h[p]=c.renderItem({item:B,indices:E,active:D})}}if(Sd.render(h,i),l<0||l>=o.length)i.scrollTop=0;else{var W=i.children[l];co.scrollIntoViewIfNeeded(i,W)}},e.prototype._evtClick=function(r){if(r.button===0){if(r.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}var n=Zt.findFirstIndex(this.contentNode.children,function(i){return i.contains(r.target)});n!==-1&&(r.preventDefault(),r.stopPropagation(),this._execute(n))}},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,n=this._results.length,i=r<n-1?r+1:0,o=i===0?n-1:i-1;this._activeIndex=Zt.findFirstIndex(this._results,Cd.canActivate,i,o),this.update()}},e.prototype._activatePreviousItem=function(){if(!(!this._results||this._results.length===0)){var r=this._activeIndex,n=this._results.length,i=r<=0?n-1:r-1,o=i===n-1?0:i+1;this._activeIndex=Zt.findLastIndex(this._results,Cd.canActivate,i,o),this.update()}},e.prototype._execute=function(r){if(this._results){var n=this._results[r];if(n){if(n.type==="header"){var i=this.inputNode;i.value=n.category.toLowerCase()+" ",i.focus(),this.refresh();return}n.item.isEnabled&&(this.commands.execute(n.item.command,n.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}(Mr);(function(t){var e=function(){function r(){}return r.prototype.renderHeader=function(n){var i=this.formatHeader(n);return Ji.li({className:"lm-CommandPalette-header p-CommandPalette-header"},i)},r.prototype.renderItem=function(n){var i=this.createItemClass(n),o=this.createItemDataset(n);return n.item.isToggleable?Ji.li({className:i,dataset:o,role:"checkbox","aria-checked":""+n.item.isToggled},this.renderItemIcon(n),this.renderItemContent(n),this.renderItemShortcut(n)):Ji.li({className:i,dataset:o},this.renderItemIcon(n),this.renderItemContent(n),this.renderItemShortcut(n))},r.prototype.renderEmptyMessage=function(n){var i=this.formatEmptyMessage(n);return Ji.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},i)},r.prototype.renderItemIcon=function(n){var i=this.createIconClass(n);return typeof n.item.icon=="string"?Ji.div({className:i},n.item.iconLabel):Ji.div({className:i},n.item.icon,n.item.iconLabel)},r.prototype.renderItemContent=function(n){return Ji.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(n),this.renderItemCaption(n))},r.prototype.renderItemLabel=function(n){var i=this.formatItemLabel(n);return Ji.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},i)},r.prototype.renderItemCaption=function(n){var i=this.formatItemCaption(n);return Ji.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},i)},r.prototype.renderItemShortcut=function(n){var i=this.formatItemShortcut(n);return Ji.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},i)},r.prototype.createItemClass=function(n){var i="lm-CommandPalette-item";i+=" p-CommandPalette-item",n.item.isEnabled||(i+=" lm-mod-disabled",i+=" p-mod-disabled"),n.item.isToggled&&(i+=" lm-mod-toggled",i+=" p-mod-toggled"),n.active&&(i+=" lm-mod-active",i+=" p-mod-active");var o=n.item.className;return o&&(i+=" "+o),i},r.prototype.createItemDataset=function(n){return uc(uc({},n.item.dataset),{command:n.item.command})},r.prototype.createIconClass=function(n){var i="lm-CommandPalette-itemIcon";i+=" p-CommandPalette-itemIcon";var o=n.item.iconClass;return o?i+" "+o:i},r.prototype.formatHeader=function(n){return!n.indices||n.indices.length===0?n.category:_x.highlight(n.category,n.indices,Ji.mark)},r.prototype.formatEmptyMessage=function(n){return"No commands found that match '"+n.query+"'"},r.prototype.formatItemShortcut=function(n){var i=n.item.keyBinding;return i?bx.formatKeystroke(i.keys):null},r.prototype.formatItemLabel=function(n){return!n.indices||n.indices.length===0?n.item.label:_x.highlight(n.item.label,n.indices,Ji.mark)},r.prototype.formatItemCaption=function(n){return n.item.caption},r}();t.Renderer=e,t.defaultRenderer=new e})(che||(che={}));var Cd;(function(t){function e(){var w=document.createElement("div"),E=document.createElement("div"),P=document.createElement("div"),B=document.createElement("input"),D=document.createElement("ul"),W=document.createElement("button");return E.className="lm-CommandPalette-search",P.className="lm-CommandPalette-wrapper",B.className="lm-CommandPalette-input",W.className="lm-close-icon",D.className="lm-CommandPalette-content",E.classList.add("p-CommandPalette-search"),P.classList.add("p-CommandPalette-wrapper"),B.classList.add("p-CommandPalette-input"),D.classList.add("p-CommandPalette-content"),B.spellcheck=!1,P.appendChild(B),P.appendChild(W),E.appendChild(P),w.appendChild(E),w.appendChild(D),w}t.createNode=e;function r(w,E){return new x(w,E)}t.createItem=r;function n(w,E){var P=c(w,E);return P.sort(h),p(P)}t.search=n;function i(w){return w.type==="item"&&w.item.isEnabled}t.canActivate=i;function o(w){return w.trim().replace(/\s+/g," ")}function s(w){return w.replace(/\s+/g,"").toLowerCase()}function c(w,E){E=s(E);for(var P=[],B=0,D=w.length;B<D;++B){var W=w[B];if(W.isVisible){if(!E){P.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:W});continue}var X=l(W,E);X&&(W.isEnabled||(X.score+=1e3),P.push(X))}}return P}function l(w,E){for(var P=w.category.toLowerCase(),B=w.label.toLowerCase(),D=P+" "+B,W=1/0,X=null,q=/\b\w/g;;){var $=q.exec(D);if(!$)break;var te=_x.matchSumOfDeltas(D,E,$.index);if(!te)break;te&&te.score<=W&&(W=te.score,X=te.indices)}if(!X||W===1/0)return null;for(var F=P.length+1,ue=Zt.lowerBound(X,F,function(Me,ce){return Me-ce}),oe=X.slice(0,ue),J=X.slice(ue),G=0,me=J.length;G<me;++G)J[G]-=F;return oe.length===0?{matchType:0,categoryIndices:null,labelIndices:J,score:W,item:w}:J.length===0?{matchType:1,categoryIndices:oe,labelIndices:null,score:W,item:w}:{matchType:2,categoryIndices:oe,labelIndices:J,score:W,item:w}}function h(w,E){var P=w.matchType-E.matchType;if(P!==0)return P;var B=w.score-E.score;if(B!==0)return B;var D=0,W=0;switch(w.matchType){case 0:D=w.labelIndices[0],W=E.labelIndices[0];break;case 1:case 2:D=w.categoryIndices[0],W=E.categoryIndices[0];break}if(D!==W)return D-W;var X=w.item.category.localeCompare(E.item.category);if(X!==0)return X;var q=w.item.rank,$=E.item.rank;return q!==$?q<$?-1:1:w.item.label.localeCompare(E.item.label)}function p(w){var E=new Array(w.length);Zt.fill(E,!1);for(var P=[],B=0,D=w.length;B<D;++B)if(!E[B]){var W=w[B],X=W.item,q=W.categoryIndices,$=X.category;P.push({type:"header",category:$,indices:q});for(var te=B;te<D;++te)if(!E[te]){var F=w[te],ue=F.item,oe=F.labelIndices;ue.category===$&&(P.push({type:"item",item:ue,indices:oe}),E[te]=!0)}}return P}var x=function(){function w(E,P){this._commands=E,this.category=o(P.category),this.command=P.command,this.args=P.args||Og.JSONExt.emptyObject,this.rank=P.rank!==void 0?P.rank:1/0}return Object.defineProperty(w.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"keyBinding",{get:function(){var E=this,P=E.command,B=E.args;return Zt.findLastValue(this._commands.keyBindings,function(D){return D.command===P&&Og.JSONExt.deepEqual(D.args,B)})||null},enumerable:!0,configurable:!0}),w}()})(Cd||(Cd={}));var Ex=function(t){Ds(e,t);function e(r){var n=t.call(this,{node:wl.createNode()})||this;return n._childIndex=-1,n._activeIndex=-1,n._openTimerID=0,n._closeTimerID=0,n._items=[],n._childMenu=null,n._parentMenu=null,n._aboutToClose=new Di(n),n._menuRequested=new Di(n),n.addClass("lm-Menu"),n.addClass("p-Menu"),n.setFlag(Mr.Flag.DisallowLayout),n.commands=r.commands,n.renderer=r.renderer||e.defaultRenderer,n}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&&!wl.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,n=this._activeIndex,i=n<r-1?n+1:0,o=i===0?r-1:i-1;this.activeIndex=Zt.findFirstIndex(this._items,wl.canActivate,i,o)},e.prototype.activatePreviousItem=function(){var r=this._items.length,n=this._activeIndex,i=n<=0?r-1:n-1,o=i===r-1?0:i+1;this.activeIndex=Zt.findLastIndex(this._items,wl.canActivate,i,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 n=r.command,i=r.args;this.commands.isEnabled(n,i)?this.commands.execute(n,i):console.log("Command '"+n+"' is disabled.")}}},e.prototype.addItem=function(r){return this.insertItem(this._items.length,r)},e.prototype.insertItem=function(r,n){this.isAttached&&this.close(),this.activeIndex=-1;var i=Math.max(0,Math.min(r,this._items.length)),o=wl.createItem(this,n);return Zt.insert(this._items,i,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 n=Zt.removeAt(this._items,r);n&&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,n,i){if(i===void 0&&(i={}),!this.isAttached){var o=i.forceX||!1,s=i.forceY||!1;wl.openRootMenu(this,r,n,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 n=this,i=this._items,o=this.renderer,s=this._activeIndex,c=wl.computeCollapsed(i),l=new Array(i.length),h=function(w,E){var P=i[w],B=w===s,D=c[w];l[w]=o.renderItem({item:P,active:B,collapsed:D,onfocus:function(){n.activeIndex=w}})},p=0,x=i.length;p<x;++p)h(p);Sd.render(l,this.contentNode)},e.prototype.onCloseRequest=function(r){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var n=this._childMenu;n&&(this._childIndex=-1,this._childMenu=null,n._parentMenu=null,n.close());var i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,r)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation();var n=r.keyCode;if(n===13){this.triggerActiveItem();return}if(n===27){this.close();return}if(n===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(n===38){this.activatePreviousItem();return}if(n===39){var i=this.activeItem;i&&i.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(n===40){this.activateNextItem();return}var o=vx().keyForKeydownEvent(r);if(o){var s=this._activeIndex+1,c=wl.findMnemonic(this._items,o,s);c.index!==-1&&!c.multiple?(this.activeIndex=c.index,this.triggerActiveItem()):c.index!==-1?this.activeIndex=c.index:c.auto!==-1&&(this.activeIndex=c.auto)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(r){var n=Zt.findFirstIndex(this.contentNode.children,function(o){return co.hitTest(o,r.clientX,r.clientY)});if(n!==this._activeIndex){if(this.activeIndex=n,n=this.activeIndex,n===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();var i=this.activeItem;!i||i.type!=="submenu"||!i.submenu||this._startOpenTimer()}},e.prototype._evtMouseEnter=function(r){for(var n=this._parentMenu;n;n=n._parentMenu)n._cancelOpenTimer(),n._cancelCloseTimer(),n.activeIndex=n._childIndex},e.prototype._evtMouseLeave=function(r){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var n=r.clientX,i=r.clientY;if(co.hitTest(this._childMenu.node,n,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()},e.prototype._evtMouseDown=function(r){this._parentMenu||(wl.hitTestMenus(this,r.clientX,r.clientY)?(r.preventDefault(),r.stopPropagation()):this.close())},e.prototype._openChildMenu=function(r){r===void 0&&(r=!1);var n=this.activeItem;if(!n||n.type!=="submenu"||!n.submenu){this._closeChildMenu();return}var i=n.submenu;if(i!==this._childMenu){e.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,mr.sendMessage(this,Mr.Msg.UpdateRequest);var o=this.contentNode.children[this._activeIndex];wl.openSubmenu(i,o),r&&(i.activeIndex=-1,i.activateNextItem()),i.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()},wl.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var r=this;this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(function(){r._closeTimerID=0,r._closeChildMenu()},wl.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(){wl.saveWindowData()},e}(Mr);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(n){var i=this.createItemClass(n),o=this.createItemDataset(n),s=this.createItemARIA(n);return Ji.li(uc({className:i,dataset:o,tabindex:"0",onfocus:n.onfocus},s),this.renderIcon(n),this.renderLabel(n),this.renderShortcut(n),this.renderSubmenu(n))},r.prototype.renderIcon=function(n){var i=this.createIconClass(n);return typeof n.item.icon=="string"?Ji.div({className:i},n.item.iconLabel):Ji.div({className:i},n.item.icon,n.item.iconLabel)},r.prototype.renderLabel=function(n){var i=this.formatLabel(n);return Ji.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},i)},r.prototype.renderShortcut=function(n){var i=this.formatShortcut(n);return Ji.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},i)},r.prototype.renderSubmenu=function(n){return Ji.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},r.prototype.createItemClass=function(n){var i="lm-Menu-item";i+=" p-Menu-item",n.item.isEnabled||(i+=" lm-mod-disabled",i+=" p-mod-disabled"),n.item.isToggled&&(i+=" lm-mod-toggled",i+=" p-mod-toggled"),n.item.isVisible||(i+=" lm-mod-hidden",i+=" p-mod-hidden"),n.active&&(i+=" lm-mod-active",i+=" p-mod-active"),n.collapsed&&(i+=" lm-mod-collapsed",i+=" p-mod-collapsed");var o=n.item.className;return o&&(i+=" "+o),i},r.prototype.createItemDataset=function(n){var i,o=n.item,s=o.type,c=o.command,l=o.dataset;return s==="command"?i=uc(uc({},l),{type:s,command:c}):i=uc(uc({},l),{type:s}),i},r.prototype.createIconClass=function(n){var i="lm-Menu-itemIcon";i+=" p-Menu-itemIcon";var o=n.item.iconClass;return o?i+" "+o:i},r.prototype.createItemARIA=function(n){var i={};switch(n.item.type){case"separator":i.role="presentation";break;case"submenu":i["aria-haspopup"]="true",n.item.isEnabled||(i["aria-disabled"]="true");break;default:n.item.isEnabled||(i["aria-disabled"]="true"),i.role="menuitem"}return i},r.prototype.formatLabel=function(n){var i=n.item,o=i.label,s=i.mnemonic;if(s<0||s>=o.length)return o;var c=o.slice(0,s),l=o.slice(s+1),h=o[s],p=Ji.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},h);return[c,p,l]},r.prototype.formatShortcut=function(n){var i=n.item.keyBinding;return i?bx.formatKeystroke(i.keys):null},r}();t.Renderer=e,t.defaultRenderer=new e})(Ex||(Ex={}));var wl;(function(t){t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3;var e=null,r=0;function n(){return r>0?(r--,e):p()}function i(){e=p(),r++}t.saveWindowData=i;function o(){var B=document.createElement("div"),D=document.createElement("ul");return D.className="lm-Menu-content",D.classList.add("p-Menu-content"),B.appendChild(D),D.setAttribute("role","menu"),B.tabIndex=0,B}t.createNode=o;function s(B){return B.type!=="separator"&&B.isEnabled&&B.isVisible}t.canActivate=s;function c(B,D){return new P(B.commands,D)}t.createItem=c;function l(B,D,W){for(var X=B;X;X=X.childMenu)if(co.hitTest(X.node,D,W))return!0;return!1}t.hitTestMenus=l;function h(B){var D=new Array(B.length);Zt.fill(D,!1);for(var W=0,X=B.length;W<X;++W){var q=B[W];if(q.isVisible){if(q.type!=="separator")break;D[W]=!0}}for(var $=X-1;$>=0;--$){var q=B[$];if(q.isVisible){if(q.type!=="separator")break;D[$]=!0}}for(var te=!1;++W<$;){var q=B[W];q.isVisible&&(q.type!=="separator"?te=!1:te?D[W]=!0:te=!0)}return D}t.computeCollapsed=h;function p(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function x(B,D,W,X,q){var $=n(),te=$.pageXOffset,F=$.pageYOffset,ue=$.clientWidth,oe=$.clientHeight;mr.sendMessage(B,Mr.Msg.UpdateRequest);var J=oe-(q?W:0),G=B.node,me=G.style;me.opacity="0",me.maxHeight=J+"px",Mr.attach(B,document.body);var Me=G.getBoundingClientRect(),ce=Me.width,ge=Me.height;!X&&D+ce>te+ue&&(D=te+ue-ce),!q&&W+ge>F+oe&&(W>F+oe?W=F+oe-ge:W=W-ge),me.transform="translate("+Math.max(0,D)+"px, "+Math.max(0,W)+"px",me.opacity="1"}t.openRootMenu=x;function w(B,D){var W=n(),X=W.pageXOffset,q=W.pageYOffset,$=W.clientWidth,te=W.clientHeight;mr.sendMessage(B,Mr.Msg.UpdateRequest);var F=te,ue=B.node,oe=ue.style;oe.opacity="0",oe.maxHeight=F+"px",Mr.attach(B,document.body);var J=ue.getBoundingClientRect(),G=J.width,me=J.height,Me=co.boxSizing(B.node),ce=D.getBoundingClientRect(),ge=ce.right-t.SUBMENU_OVERLAP;ge+G>X+$&&(ge=ce.left+t.SUBMENU_OVERLAP-G);var tt=ce.top-Me.borderTop-Me.paddingTop;tt+me>q+te&&(tt=ce.bottom+Me.borderBottom+Me.paddingBottom-me),oe.transform="translate("+Math.max(0,ge)+"px, "+Math.max(0,tt)+"px",oe.opacity="1"}t.openSubmenu=w;function E(B,D,W){for(var X=-1,q=-1,$=!1,te=D.toUpperCase(),F=0,ue=B.length;F<ue;++F){var oe=(F+W)%ue,J=B[oe];if(s(J)){var G=J.label;if(G.length!==0){var me=J.mnemonic;if(me>=0&&me<G.length){G[me].toUpperCase()===te&&(X===-1?X=oe:$=!0);continue}q===-1&&G[0].toUpperCase()===te&&(q=oe)}}}return{index:X,multiple:$,auto:q}}t.findMnemonic=E;var P=function(){function B(D,W){this._commands=D,this.type=W.type||"command",this.command=W.command||"",this.args=W.args||Og.JSONExt.emptyObject,this.submenu=W.submenu||null}return Object.defineProperty(B.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(B.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(B.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(B.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(B.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(B.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(B.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(B.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(B.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(B.prototype,"isToggled",{get:function(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1},enumerable:!0,configurable:!0}),Object.defineProperty(B.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(B.prototype,"keyBinding",{get:function(){if(this.type==="command"){var D=this,W=D.command,X=D.args;return Zt.findLastValue(this._commands.keyBindings,function(q){return q.command===W&&Og.JSONExt.deepEqual(q.args,X)})||null}return null},enumerable:!0,configurable:!0}),B}()})(wl||(wl={}));var WWt=function(){function t(e){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var r=e.groupByTarget,n=e.sortBySelector,i=Lze(e,["groupByTarget","sortBySelector"]);this.menu=new Ex(i),this._groupByTarget=r!==!1,this._sortBySelector=n!==!1}return t.prototype.addItem=function(e){var r=this,n=XR.createItem(e,this._idTick++);return this._items.push(n),new fA(function(){Zt.removeFirstOf(r._items,n)})},t.prototype.open=function(e){var r=this;if(Ex.saveWindowData(),this.menu.clearItems(),this._items.length===0)return!1;var n=XR.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);return!n||n.length===0?!1:(yn(n,function(i){r.menu.addItem(i)}),this.menu.open(e.clientX,e.clientY),!0)},t}(),XR;(function(t){function e(s,c){var l=n(s.selector),h=s.rank!==void 0?s.rank:1/0;return uc(uc({},s),{selector:l,rank:h,id:c})}t.createItem=e;function r(s,c,l,h){var p=c.target;if(!p)return null;var x=c.currentTarget;if(!x||!x.contains(p)&&(p=document.elementFromPoint(c.clientX,c.clientY),!p||!x.contains(p)))return null;for(var w=[],E=s.slice();p!==null;){for(var P=[],B=0,D=E.length;B<D;++B){var W=E[B];W&&Qh.matches(p,W.selector)&&(P.push(W),E[B]=null)}if(P.length!==0&&(l&&P.sort(h?o:i),w.push.apply(w,P)),p===x)break;p=p.parentElement}return l||w.sort(h?o:i),w}t.matchItems=r;function n(s){if(s.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+s);if(!Qh.isValid(s))throw new Error("Invalid selector: "+s);return s}function i(s,c){var l=s.rank,h=c.rank;return l!==h?l<h?-1:1:s.id-c.id}function o(s,c){var l=Qh.calculateSpecificity(s.selector),h=Qh.calculateSpecificity(c.selector);return l!==h?h-l:i(s,c)}})(XR||(XR={}));var Mx=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,{node:ah.createNode()})||this;return n._currentIndex=-1,n._titles=[],n._titlesEditable=!1,n._previousTitle=null,n._dragData=null,n._addButtonEnabled=!1,n._tabMoved=new Di(n),n._currentChanged=new Di(n),n._addRequested=new Di(n),n._tabCloseRequested=new Di(n),n._tabDetachRequested=new Di(n),n._tabActivateRequested=new Di(n),n.addClass("lm-TabBar"),n.addClass("p-TabBar"),n.contentNode.setAttribute("role","tablist"),n.setFlag(Mr.Flag.DisallowLayout),n._document=r.document||document,n.tabsMovable=r.tabsMovable||!1,n.titlesEditable=r.titlesEditable||!1,n.allowDeselect=r.allowDeselect||!1,n.addButtonEnabled=r.addButtonEnabled||!1,n.insertBehavior=r.insertBehavior||"select-tab-if-needed",n.name=r.name||"",n.orientation=r.orientation||"horizontal",n.removeBehavior=r.removeBehavior||"select-tab-after",n.renderer=r.renderer||e.defaultRenderer,n}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 n=this._currentIndex,i=this._titles[n]||null,o=r,s=this._titles[o]||null;this._currentIndex=o,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:n,previousTitle:i,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,n){this._releaseMouse();var i=ah.asTitle(n),o=this._titles.indexOf(i),s=Math.max(0,Math.min(r,this._titles.length));return o===-1?(Zt.insert(this._titles,s,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,i),i):(s===this._titles.length&&s--,o===s||(Zt.move(this._titles,o,s),this.update(),this._adjustCurrentForMove(o,s)),i)},e.prototype.removeTab=function(r){this.removeTabAt(this._titles.indexOf(r))},e.prototype.removeTabAt=function(r){this._releaseMouse();var n=Zt.removeAt(this._titles,r);n&&(n.changed.disconnect(this._onTitleChanged,this),n===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(r,n))},e.prototype.clearTabs=function(){if(this._titles.length!==0){this._releaseMouse();for(var r=0,n=this._titles;r<n.length;r++){var i=n[r];i.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 n=this._titles,i=this.renderer,o=this.currentTitle,s=new Array(n.length),c=0,l=n.length;c<l;++c){var h=n[c],p=h===o,x=p?l:l-c-1;s[c]=i.renderTab({title:h,current:p,zIndex:x})}Sd.render(s,this.contentNode)},e.prototype._evtDblClick=function(r){if(this.titlesEditable){var n=this.contentNode.children,i=Zt.findFirstIndex(n,function(x){return co.hitTest(x,r.clientX,r.clientY)});if(i!==-1){var o=this.titles[i],s=n[i].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(r.target)){var c=o.label||"",l=s.innerHTML;s.innerHTML="";var h=document.createElement("input");h.classList.add("lm-TabBar-tabInput"),h.value=c,s.appendChild(h);var p=function(){h.removeEventListener("blur",p),s.innerHTML=l};h.addEventListener("dblclick",function(x){return x.stopPropagation()}),h.addEventListener("blur",p),h.addEventListener("keydown",function(x){x.key==="Enter"?(h.value!==""&&(o.label=o.caption=h.value),p()):x.key==="Escape"&&p()}),h.select(),h.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 n=this.addButtonEnabled&&this.addButtonNode.contains(r.target),i=this.contentNode.children,o=Zt.findFirstIndex(i,function(c){return co.hitTest(c,r.clientX,r.clientY)});if(!(o===-1&&!n)&&(r.preventDefault(),r.stopPropagation(),this._dragData={tab:i[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||n))){var s=i[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 n=this._dragData;if(n){r.preventDefault(),r.stopPropagation();var i=this.contentNode.children;if(!(!n.dragActive&&!ah.dragExceeded(n,r))){if(!n.dragActive){var o=n.tab.getBoundingClientRect();this._orientation==="horizontal"?(n.tabPos=n.tab.offsetLeft,n.tabSize=o.width,n.tabPressPos=n.pressX-o.left):(n.tabPos=n.tab.offsetTop,n.tabSize=o.height,n.tabPressPos=n.pressY-o.top),n.tabLayout=ah.snapTabLayout(i,this._orientation),n.contentRect=this.contentNode.getBoundingClientRect(),n.override=pA.overrideCursor("default"),n.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),n.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),n.dragActive=!0}if(!n.detachRequested&&ah.detachExceeded(n,r)){n.detachRequested=!0;var s=n.index,c=r.clientX,l=r.clientY,h=i[s],p=this._titles[s];if(this._tabDetachRequested.emit({index:s,title:p,tab:h,clientX:c,clientY:l}),n.dragAborted)return}ah.layoutTabs(i,n,r,this._orientation)}}},e.prototype._evtMouseUp=function(r){var n=this;if(!(r.button!==0&&r.button!==1)){var i=this._dragData;if(i){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),!i.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,c=Zt.findFirstIndex(s,function(x){return co.hitTest(x,r.clientX,r.clientY)});if(c!==i.index)return;var l=this._titles[c];if(!l.closable)return;if(r.button===1){this._tabCloseRequested.emit({index:c,title:l});return}var h=s[c].querySelector(this.renderer.closeIconSelector);if(h&&h.contains(r.target)){this._tabCloseRequested.emit({index:c,title:l});return}return}if(r.button===0){ah.finalizeTabPosition(i,this._orientation),i.tab.classList.remove("lm-mod-dragging"),i.tab.classList.remove("p-mod-dragging");var p=ah.parseTransitionDuration(i.tab);setTimeout(function(){if(!i.dragAborted){n._dragData=null,ah.resetTabPositions(n.contentNode.children,n._orientation),i.override.dispose(),n.removeClass("lm-mod-dragging"),n.removeClass("p-mod-dragging");var x=i.index,w=i.targetIndex;w===-1||x===w||(Zt.move(n._titles,x,w),n._adjustCurrentForMove(x,w),n._tabMoved.emit({fromIndex:x,toIndex:w,title:n._titles[w]}),mr.sendMessage(n,Mr.Msg.UpdateRequest))}},p)}}}},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&&(ah.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,n){var i=this.currentTitle,o=this._currentIndex,s=this.insertBehavior;if(s==="select-tab"||s==="select-tab-if-needed"&&o===-1){this._currentIndex=r,this._previousTitle=i,this._currentChanged.emit({previousIndex:o,previousTitle:i,currentIndex:r,currentTitle:n});return}o>=r&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(r,n){this._currentIndex===r?this._currentIndex=n:this._currentIndex<r&&this._currentIndex>=n?this._currentIndex++:this._currentIndex>r&&this._currentIndex<=n&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(r,n){var i=this._currentIndex,o=this.removeBehavior;if(i!==r){i>r&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:n,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:n,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:n,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:n,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:n,currentIndex:-1,currentTitle:null})},e.prototype._onTitleChanged=function(r){this.update()},e}(Mr);(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(n){var i=n.title.caption,o=this.createTabKey(n),s=o,c=this.createTabStyle(n),l=this.createTabClass(n),h=this.createTabDataset(n),p=this.createTabARIA(n);return n.title.closable?Ji.li(uc({id:s,key:o,className:l,title:i,style:c,dataset:h},p),this.renderIcon(n),this.renderLabel(n),this.renderCloseIcon(n)):Ji.li(uc({id:s,key:o,className:l,title:i,style:c,dataset:h},p),this.renderIcon(n),this.renderLabel(n))},r.prototype.renderIcon=function(n){var i=n.title,o=this.createIconClass(n);return typeof i.icon=="string"?Ji.div({className:o},i.iconLabel):Ji.div({className:o},i.icon,i.iconLabel)},r.prototype.renderLabel=function(n){return Ji.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},n.title.label)},r.prototype.renderCloseIcon=function(n){return Ji.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},r.prototype.createTabKey=function(n){var i=this._tabKeys.get(n.title);return i===void 0&&(i="tab-key-"+this._uuid+"-"+this._tabID++,this._tabKeys.set(n.title,i)),i},r.prototype.createTabStyle=function(n){return{zIndex:""+n.zIndex}},r.prototype.createTabClass=function(n){var i="lm-TabBar-tab";return i+=" p-TabBar-tab",n.title.className&&(i+=" "+n.title.className),n.title.closable&&(i+=" lm-mod-closable",i+=" p-mod-closable"),n.current&&(i+=" lm-mod-current",i+=" p-mod-current"),i},r.prototype.createTabDataset=function(n){return n.title.dataset},r.prototype.createTabARIA=function(n){return{role:"tab","aria-selected":n.current.toString()}},r.prototype.createIconClass=function(n){var i="lm-TabBar-tabIcon";i+=" p-TabBar-tabIcon";var o=n.title.iconClass;return o?i+" "+o:i},r._nInstance=0,r}();t.Renderer=e,t.defaultRenderer=new e,t.addButtonSelector=".lm-TabBar-addButton"})(Mx||(Mx={}));var ah;(function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20;function e(){var p=document.createElement("div"),x=document.createElement("ul");x.setAttribute("role","tablist"),x.className="lm-TabBar-content",x.classList.add("p-TabBar-content"),p.appendChild(x);var w=document.createElement("div");return w.className="lm-TabBar-addButton lm-mod-hidden",p.appendChild(w),p}t.createNode=e;function r(p){return p instanceof w8?p:new w8(p)}t.asTitle=r;function n(p){var x=window.getComputedStyle(p);return 1e3*(parseFloat(x.transitionDuration)||0)}t.parseTransitionDuration=n;function i(p,x){for(var w=new Array(p.length),E=0,P=p.length;E<P;++E){var B=p[E],D=window.getComputedStyle(B);x==="horizontal"?w[E]={pos:B.offsetLeft,size:B.offsetWidth,margin:parseFloat(D.marginLeft)||0}:w[E]={pos:B.offsetTop,size:B.offsetHeight,margin:parseFloat(D.marginTop)||0}}return w}t.snapTabLayout=i;function o(p,x){var w=Math.abs(x.clientX-p.pressX),E=Math.abs(x.clientY-p.pressY);return w>=t.DRAG_THRESHOLD||E>=t.DRAG_THRESHOLD}t.dragExceeded=o;function s(p,x){var w=p.contentRect;return x.clientX<w.left-t.DETACH_THRESHOLD||x.clientX>=w.right+t.DETACH_THRESHOLD||x.clientY<w.top-t.DETACH_THRESHOLD||x.clientY>=w.bottom+t.DETACH_THRESHOLD}t.detachExceeded=s;function c(p,x,w,E){var P,B,D,W;E==="horizontal"?(P=x.pressX,B=w.clientX-x.contentRect.left,D=w.clientX,W=x.contentRect.width):(P=x.pressY,B=w.clientY-x.contentRect.top,D=w.clientY,W=x.contentRect.height);for(var X=x.index,q=B-x.tabPressPos,$=q+x.tabSize,te=0,F=p.length;te<F;++te){var ue=void 0,oe=x.tabLayout[te],J=oe.pos+(oe.size>>1);if(te<x.index&&q<J)ue=x.tabSize+x.tabLayout[te+1].margin+"px",X=Math.min(X,te);else if(te>x.index&&$>J)ue=-x.tabSize-oe.margin+"px",X=Math.max(X,te);else if(te===x.index){var G=D-P,me=W-(x.tabPos+x.tabSize);ue=Math.max(-x.tabPos,Math.min(G,me))+"px"}else ue="";E==="horizontal"?p[te].style.left=ue:p[te].style.top=ue}x.targetIndex=X}t.layoutTabs=c;function l(p,x){var w;x==="horizontal"?w=p.contentRect.width:w=p.contentRect.height;var E;if(p.targetIndex===p.index)E=0;else if(p.targetIndex>p.index){var P=p.tabLayout[p.targetIndex];E=P.pos+P.size-p.tabSize-p.tabPos}else{var P=p.tabLayout[p.targetIndex];E=P.pos-p.tabPos}var B=w-(p.tabPos+p.tabSize),D=Math.max(-p.tabPos,Math.min(E,B));x==="horizontal"?p.tab.style.left=D+"px":p.tab.style.top=D+"px"}t.finalizeTabPosition=l;function h(p,x){yn(p,function(w){x==="horizontal"?w.style.left="":w.style.top=""})}t.resetTabPositions=h})(ah||(ah={}));var Dze=function(t){Ds(e,t);function e(r){var n=t.call(this)||this;return n._spacing=4,n._dirty=!1,n._root=null,n._box=null,n._items=new Map,n.renderer=r.renderer,r.spacing!==void 0&&(n._spacing=OT.clampDimension(r.spacing)),n._document=r.document||document,n._hiddenMode=r.hiddenMode!==void 0?r.hiddenMode:Mr.HiddenMode.Display,n}return e.prototype.dispose=function(){var r=this.iter();this._items.forEach(function(n){n.dispose()}),this._box=null,this._root=null,this._items.clear(),yn(r,function(n){n.dispose()}),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(r){var n=this;this._hiddenMode!==r&&(this._hiddenMode=r,yn(this.tabBars(),function(i){i.titles.length>1&&i.titles.forEach(function(o){o.owner.hiddenMode=n._hiddenMode})}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=OT.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():_u()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():_u()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():_u()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():_u()},e.prototype.handles=function(){return this._root?this._root.iterHandles():_u()},e.prototype.moveHandle=function(r,n,i){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 c;s.node.orientation==="horizontal"?c=n-r.offsetLeft:c=i-r.offsetTop,c!==0&&(s.node.holdSizes(),xu.adjust(s.node.sizers,s.index,c),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 n=this,i=new Set,o;r.main?o=Ma.normalizeAreaConfig(r.main,i):o=null;var s=this.widgets(),c=this.tabBars(),l=this.handles();this._root=null,yn(s,function(h){i.has(h)||(h.parent=null)}),yn(c,function(h){h.dispose()}),yn(l,function(h){h.parentNode&&h.parentNode.removeChild(h)}),i.forEach(function(h){h.parent=n.parent}),o?this._root=Ma.realizeAreaConfig(o,{createTabBar:function(h){return n._createTabBar()},createHandle:function(){return n._createHandle()}},this._document):this._root=null,this.parent&&(i.forEach(function(h){n.attachWidget(h)}),this.parent.fit())},e.prototype.addWidget=function(r,n){n===void 0&&(n={});var i=n.ref||null,o=n.mode||"tab-after",s=null;if(this._root&&i&&(s=this._root.findTabNode(i)),i&&!s)throw new Error("Reference widget is not in the layout.");switch(r.parent=this.parent,o){case"tab-after":this._insertTab(r,i,s,!0);break;case"tab-before":this._insertTab(r,i,s,!1);break;case"split-top":this._insertSplit(r,i,s,"vertical",!1);break;case"split-left":this._insertSplit(r,i,s,"horizontal",!1);break;case"split-right":this._insertSplit(r,i,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(r,i,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,n){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=co.boxSizing(this.parent.node));var i=this.parent.node.getBoundingClientRect(),o=r-i.left-this._box.borderLeft,s=n-i.top-this._box.borderTop,c=this._root.hitTestTabNodes(o,s);if(!c)return null;var l=c.tabBar,h=c.top,p=c.left,x=c.width,w=c.height,E=this._box.borderLeft+this._box.borderRight,P=this._box.borderTop+this._box.borderBottom,B=i.width-E-(p+x),D=i.height-P-(h+w);return{tabBar:l,x:o,y:s,top:h,left:p,right:B,bottom:D,width:x,height:w}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),yn(this,function(n){r.attachWidget(n)}),yn(this.handles(),function(n){r.parent.node.appendChild(n)}),this.parent.fit()},e.prototype.attachWidget=function(r){this.parent.node!==r.node.parentNode&&(this._items.set(r,new DT(r)),this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.AfterAttach))},e.prototype.detachWidget=function(r){if(this.parent.node===r.node.parentNode){this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.AfterDetach);var n=this._items.get(r);n&&(this._items.delete(r),n.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 n=this._root.findTabNode(r);if(n){if(Ma.removeAria(r),n.tabBar.titles.length>1){if(n.tabBar.removeTab(r.title),this._hiddenMode===Mr.HiddenMode.Scale&&n.tabBar.titles.length==1){var i=n.tabBar.titles[0].owner;i.hiddenMode=Mr.HiddenMode.Display}return}if(n.tabBar.dispose(),this._root===n){this._root=null;return}this._root.holdAllSizes();var o=n.parent;n.parent=null;var s=Zt.removeFirstOf(o.children,n),c=Zt.removeAt(o.handles,s);if(Zt.removeAt(o.sizers,s),c.parentNode&&c.parentNode.removeChild(c),o.children.length>1){o.syncHandles();return}var l=o.parent;o.parent=null;var h=o.children[0],p=o.handles[0];if(o.children.length=0,o.handles.length=0,o.sizers.length=0,p.parentNode&&p.parentNode.removeChild(p),this._root===o){h.parent=null,this._root=h;return}var x=l,w=x.children.indexOf(o);if(h instanceof Ma.TabLayoutNode){h.parent=x,x.children[w]=h;return}var E=Zt.removeAt(x.handles,w);Zt.removeAt(x.children,w),Zt.removeAt(x.sizers,w),E.parentNode&&E.parentNode.removeChild(E);for(var P=0,B=h.children.length;P<B;++P){var D=h.children[P],W=h.handles[P],X=h.sizers[P];Zt.insert(x.children,w+P,D),Zt.insert(x.handles,w+P,W),Zt.insert(x.sizers,w+P,X),D.parent=x}h.children.length=0,h.handles.length=0,h.sizers.length=0,h.parent=null,x.syncHandles()}}},e.prototype._insertTab=function(r,n,i,o){if(r!==n){if(!this._root){var s=new Ma.TabLayoutNode(this._createTabBar());s.tabBar.addTab(r.title),this._root=s,Ma.addAria(r,s.tabBar);return}i||(i=this._root.findFirstTabNode()),i.tabBar.titles.indexOf(r.title)===-1&&(this._removeWidget(r),r.hide());var c;if(n?c=i.tabBar.titles.indexOf(n.title):c=i.tabBar.currentIndex,this._hiddenMode===Mr.HiddenMode.Scale)if(i.tabBar.titles.length===0)r.hiddenMode=Mr.HiddenMode.Display;else if(i.tabBar.titles.length==1){var l=i.tabBar.titles[0].owner;l.hiddenMode=Mr.HiddenMode.Scale}else r.hiddenMode=Mr.HiddenMode.Scale;else r.hiddenMode=this._hiddenMode;i.tabBar.insertTab(c+(o?1:0),r.title),Ma.addAria(r,i.tabBar)}},e.prototype._insertSplit=function(r,n,i,o,s){if(!(r===n&&i&&i.tabBar.titles.length===1)){this._removeWidget(r);var c=new Ma.TabLayoutNode(this._createTabBar());if(c.tabBar.addTab(r.title),Ma.addAria(r,c.tabBar),!this._root){this._root=c;return}if(!i||!i.parent){var l=this._splitRoot(o),h=s?l.children.length:0;l.normalizeSizes();var p=Ma.createSizer(i?1:Ma.GOLDEN_RATIO);Zt.insert(l.children,h,c),Zt.insert(l.sizers,h,p),Zt.insert(l.handles,h,this._createHandle()),c.parent=l,l.normalizeSizes(),l.syncHandles();return}var x=i.parent;if(x.orientation===o){var w=x.children.indexOf(i);x.normalizeSizes();var E=x.sizers[w].sizeHint/=2,P=w+(s?1:0);Zt.insert(x.children,P,c),Zt.insert(x.sizers,P,Ma.createSizer(E)),Zt.insert(x.handles,P,this._createHandle()),c.parent=x,x.syncHandles();return}var B=Zt.removeFirstOf(x.children,i),D=new Ma.SplitLayoutNode(o);D.normalized=!0,D.children.push(i),D.sizers.push(Ma.createSizer(.5)),D.handles.push(this._createHandle()),i.parent=D;var W=s?1:0;Zt.insert(D.children,W,c),Zt.insert(D.sizers,W,Ma.createSizer(.5)),Zt.insert(D.handles,W,this._createHandle()),c.parent=D,D.syncHandles(),Zt.insert(x.children,B,D),D.parent=x}},e.prototype._splitRoot=function(r){var n=this._root;if(n instanceof Ma.SplitLayoutNode&&n.orientation===r)return n;var i=this._root=new Ma.SplitLayoutNode(r);return n&&(i.children.push(n),i.sizers.push(Ma.createSizer(0)),i.handles.push(this._createHandle()),n.parent=i),i},e.prototype._fit=function(){var r=0,n=0;if(this._root){var i=this._root.fit(this._spacing,this._items);r=i.minWidth,n=i.minHeight}var o=this._box=co.boxSizing(this.parent.node);r+=o.horizontalSum,n+=o.verticalSum;var s=this.parent.node.style;s.minWidth=r+"px",s.minHeight=n+"px",this._dirty=!0,this.parent.parent&&mr.sendMessage(this.parent.parent,Mr.Msg.FitRequest),this._dirty&&mr.sendMessage(this.parent,Mr.Msg.UpdateRequest)},e.prototype._update=function(r,n){if(this._dirty=!1,!!this._root){r<0&&(r=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=co.boxSizing(this.parent.node));var i=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,c=n-this._box.verticalSum;this._root.update(i,o,s,c,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(),n=r.style;return n.position="absolute",n.top="0",n.left="0",n.width="0",n.height="0",this.parent&&this.parent.node.appendChild(r),r},e}(AA),Ma;(function(t){t.GOLDEN_RATIO=.618;function e(w){var E=new mA;return E.sizeHint=w,E.size=w,E}t.createSizer=e;function r(w,E){var P;return w.type==="tab-area"?P=l(w,E):P=h(w,E),P}t.normalizeAreaConfig=r;function n(w,E,P){var B;return w.type==="tab-area"?B=p(w,E,P):B=x(w,E,P),B}t.realizeAreaConfig=n;var i=function(){function w(E){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var P=new mA,B=new mA;P.stretch=0,B.stretch=1,this.tabBar=E,this.sizers=[P,B]}return Object.defineProperty(w.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(w.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),w.prototype.iterAllWidgets=function(){return p8(RT(this.tabBar),this.iterUserWidgets())},w.prototype.iterUserWidgets=function(){return hA(this.tabBar.titles,function(E){return E.owner})},w.prototype.iterSelectedWidgets=function(){var E=this.tabBar.currentTitle;return E?RT(E.owner):_u()},w.prototype.iterTabBars=function(){return RT(this.tabBar)},w.prototype.iterHandles=function(){return _u()},w.prototype.findTabNode=function(E){return this.tabBar.titles.indexOf(E.title)!==-1?this:null},w.prototype.findSplitNode=function(E){return null},w.prototype.findFirstTabNode=function(){return this},w.prototype.hitTestTabNodes=function(E,P){return E<this._left||E>=this._left+this._width||P<this._top||P>=this._top+this._height?null:this},w.prototype.createConfig=function(){var E=this.tabBar.titles.map(function(B){return B.owner}),P=this.tabBar.currentIndex;return{type:"tab-area",widgets:E,currentIndex:P}},w.prototype.holdAllSizes=function(){},w.prototype.fit=function(E,P){var B=0,D=0,W=1/0,X=1/0,q=P.get(this.tabBar),$=this.tabBar.currentTitle,te=$?P.get($.owner):void 0,F=this.sizers,ue=F[0],oe=F[1];return q&&q.fit(),te&&te.fit(),q&&!q.isHidden?(B=Math.max(B,q.minWidth),D+=q.minHeight,ue.minSize=q.minHeight,ue.maxSize=q.maxHeight):(ue.minSize=0,ue.maxSize=0),te&&!te.isHidden?(B=Math.max(B,te.minWidth),D+=te.minHeight,oe.minSize=te.minHeight,oe.maxSize=1/0):(oe.minSize=0,oe.maxSize=1/0),{minWidth:B,minHeight:D,maxWidth:W,maxHeight:X}},w.prototype.update=function(E,P,B,D,W,X){this._top=P,this._left=E,this._width=B,this._height=D;var q=X.get(this.tabBar),$=this.tabBar.currentTitle,te=$?X.get($.owner):void 0;if(xu.calc(this.sizers,D),q&&!q.isHidden){var F=this.sizers[0].size;q.update(E,P,B,F),P+=F}if(te&&!te.isHidden){var F=this.sizers[1].size;te.update(E,P,B,F)}},w}();t.TabLayoutNode=i;var o=function(){function w(E){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=E}return w.prototype.iterAllWidgets=function(){var E=hA(this.children,function(P){return P.iterAllWidgets()});return new Pg(E)},w.prototype.iterUserWidgets=function(){var E=hA(this.children,function(P){return P.iterUserWidgets()});return new Pg(E)},w.prototype.iterSelectedWidgets=function(){var E=hA(this.children,function(P){return P.iterSelectedWidgets()});return new Pg(E)},w.prototype.iterTabBars=function(){var E=hA(this.children,function(P){return P.iterTabBars()});return new Pg(E)},w.prototype.iterHandles=function(){var E=hA(this.children,function(P){return P.iterHandles()});return p8(this.handles,new Pg(E))},w.prototype.findTabNode=function(E){for(var P=0,B=this.children.length;P<B;++P){var D=this.children[P].findTabNode(E);if(D)return D}return null},w.prototype.findSplitNode=function(E){var P=this.handles.indexOf(E);if(P!==-1)return{index:P,node:this};for(var B=0,D=this.children.length;B<D;++B){var W=this.children[B].findSplitNode(E);if(W)return W}return null},w.prototype.findFirstTabNode=function(){return this.children.length===0?null:this.children[0].findFirstTabNode()},w.prototype.hitTestTabNodes=function(E,P){for(var B=0,D=this.children.length;B<D;++B){var W=this.children[B].hitTestTabNodes(E,P);if(W)return W}return null},w.prototype.createConfig=function(){var E=this.orientation,P=this.createNormalizedSizes(),B=this.children.map(function(D){return D.createConfig()});return{type:"split-area",orientation:E,children:B,sizes:P}},w.prototype.syncHandles=function(){var E=this;yn(this.handles,function(P,B){P.setAttribute("data-orientation",E.orientation),B===E.handles.length-1?(P.classList.add("lm-mod-hidden"),P.classList.add("p-mod-hidden")):(P.classList.remove("lm-mod-hidden"),P.classList.remove("p-mod-hidden"))})},w.prototype.holdSizes=function(){yn(this.sizers,function(E){E.sizeHint=E.size})},w.prototype.holdAllSizes=function(){yn(this.children,function(E){return E.holdAllSizes()}),this.holdSizes()},w.prototype.normalizeSizes=function(){var E=this.sizers.length;if(E!==0){this.holdSizes();var P=d8(this.sizers,function(B,D){return B+D.sizeHint},0);P===0?yn(this.sizers,function(B){B.size=B.sizeHint=1/E}):yn(this.sizers,function(B){B.size=B.sizeHint/=P}),this.normalized=!0}},w.prototype.createNormalizedSizes=function(){var E=this.sizers.length;if(E===0)return[];var P=this.sizers.map(function(D){return D.size}),B=d8(P,function(D,W){return D+W},0);return B===0?yn(P,function(D,W){P[W]=1/E}):yn(P,function(D,W){P[W]=D/B}),P},w.prototype.fit=function(E,P){for(var B=this.orientation==="horizontal",D=Math.max(0,this.children.length-1)*E,W=B?D:0,X=B?0:D,q=1/0,$=1/0,te=0,F=this.children.length;te<F;++te){var ue=this.children[te].fit(E,P);B?(X=Math.max(X,ue.minHeight),W+=ue.minWidth,this.sizers[te].minSize=ue.minWidth):(W=Math.max(W,ue.minWidth),X+=ue.minHeight,this.sizers[te].minSize=ue.minHeight)}return{minWidth:W,minHeight:X,maxWidth:q,maxHeight:$}},w.prototype.update=function(E,P,B,D,W,X){var q=this.orientation==="horizontal",$=Math.max(0,this.children.length-1)*W,te=Math.max(0,(q?B:D)-$);this.normalized&&(yn(this.sizers,function(me){me.sizeHint*=te}),this.normalized=!1),xu.calc(this.sizers,te);for(var F=0,ue=this.children.length;F<ue;++F){var oe=this.children[F],J=this.sizers[F].size,G=this.handles[F].style;q?(oe.update(E,P,J,D,W,X),E+=J,G.top=P+"px",G.left=E+"px",G.width=W+"px",G.height=D+"px",E+=W):(oe.update(E,P,B,J,W,X),P+=J,G.top=P+"px",G.left=E+"px",G.width=B+"px",G.height=W+"px",P+=W)}},w}();t.SplitLayoutNode=o;function s(w,E){w.node.setAttribute("role","tabpanel");var P=E.renderer;if(P instanceof Mx.Renderer){var B=P.createTabKey({title:w.title,current:!1,zIndex:0});w.node.setAttribute("aria-labelledby",B)}}t.addAria=s;function c(w){w.node.removeAttribute("role"),w.node.removeAttribute("aria-labelledby")}t.removeAria=c;function l(w,E){if(w.widgets.length===0)return null;var P=[];if(yn(w.widgets,function(D){E.has(D)||(E.add(D),P.push(D))}),P.length===0)return null;var B=w.currentIndex;return B!==-1&&(B<0||B>=P.length)&&(B=0),{type:"tab-area",widgets:P,currentIndex:B}}function h(w,E){for(var P=w.orientation,B=[],D=[],W=0,X=w.children.length;W<X;++W){var q=r(w.children[W],E);q&&(q.type==="tab-area"||q.orientation!==P?(B.push(q),D.push(Math.abs(w.sizes[W]||0))):(B.push.apply(B,q.children),D.push.apply(D,q.sizes)))}return B.length===0?null:B.length===1?B[0]:{type:"split-area",orientation:P,children:B,sizes:D}}function p(w,E,P){var B=E.createTabBar(P);return yn(w.widgets,function(D){D.hide(),B.addTab(D.title),t.addAria(D,B)}),B.currentIndex=w.currentIndex,new i(B)}function x(w,E,P){var B=new o(w.orientation);return yn(w.children,function(D,W){var X=n(D,E,P),q=e(w.sizes[W]),$=E.createHandle();B.children.push(X),B.handles.push($),B.sizers.push(q),X.parent=B}),B.syncHandles(),B.normalizeSizes(),B}})(Ma||(Ma={}));var lhe=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;n._drag=null,n._tabsMovable=!0,n._tabsConstrained=!1,n._addButtonEnabled=!1,n._pressData=null,n._layoutModified=new Di(n),n._addRequested=new Di(n),n.addClass("lm-DockPanel"),n.addClass("p-DockPanel"),n._document=r.document||document,n._mode=r.mode||"multiple-document",n._renderer=r.renderer||e.defaultRenderer,n._edges=r.edges||Ks.DEFAULT_EDGES,r.tabsMovable!==void 0&&(n._tabsMovable=r.tabsMovable),r.tabsConstrained!==void 0&&(n._tabsConstrained=r.tabsConstrained),r.addButtonEnabled!==void 0&&(n._addButtonEnabled=r.addButtonEnabled),n.dataset.mode=n._mode;var i={createTabBar:function(){return n._createTabBar()},createHandle:function(){return n._createHandle()}};return n.layout=new Dze({document:n._document,renderer:i,spacing:r.spacing,hiddenMode:r.hiddenMode}),n.overlay=r.overlay||new e.Overlay,n.node.appendChild(n.overlay.node),n}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 n=this.layout;switch(r){case"multiple-document":yn(n.tabBars(),function(i){i.show()});break;case"single-document":n.restoreLayout(Ks.createSingleDocumentConfig(this));break;default:throw"unreachable"}mr.postMessage(this,Ks.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(r){this._tabsMovable=r,yn(this.tabBars(),function(n){n.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,yn(this.tabBars(),function(n){n.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 n=yx(this.tabBars(),function(i){return i.titles.indexOf(r.title)!==-1});if(!n)throw new Error("Widget is not contained in the dock panel.");n.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),(lc.IS_EDGE||lc.IS_IE)&&mr.flush(),mr.postMessage(this,Ks.LayoutModified)},e.prototype.addWidget=function(r,n){n===void 0&&(n={}),this._mode==="single-document"?this.layout.addWidget(r):this.layout.addWidget(r,n),mr.postMessage(this,Ks.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){Ks.isGeneratedTabBarProperty.get(r.child)||(r.child.addClass("lm-DockPanel-widget"),r.child.addClass("p-DockPanel-widget"))},e.prototype.onChildRemoved=function(r){Ks.isGeneratedTabBarProperty.get(r.child)||(r.child.removeClass("lm-DockPanel-widget"),r.child.removeClass("p-DockPanel-widget"),mr.postMessage(this,Ks.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 n=r.clientX,i=r.clientY,o=Ks.findDropTarget(this,n,i,this._edges),s=o.zone,c=o.target;if(this._tabsConstrained&&r.source!==this||s==="invalid"){r.dropAction="none";return}var l=r.mimeData,h=l.getData("application/vnd.lumino.widget-factory");if(typeof h!="function"){r.dropAction="none";return}var p=h();if(!(p instanceof Mr)){r.dropAction="none";return}if(p.contains(this)){r.dropAction="none";return}var x=c?Ks.getDropRef(c.tabBar):null;switch(s){case"root-all":this.addWidget(p);break;case"root-top":this.addWidget(p,{mode:"split-top"});break;case"root-left":this.addWidget(p,{mode:"split-left"});break;case"root-right":this.addWidget(p,{mode:"split-right"});break;case"root-bottom":this.addWidget(p,{mode:"split-bottom"});break;case"widget-all":this.addWidget(p,{mode:"tab-after",ref:x});break;case"widget-top":this.addWidget(p,{mode:"split-top",ref:x});break;case"widget-left":this.addWidget(p,{mode:"split-left",ref:x});break;case"widget-right":this.addWidget(p,{mode:"split-right",ref:x});break;case"widget-bottom":this.addWidget(p,{mode:"split-bottom",ref:x});break;case"widget-tab":this.addWidget(p,{mode:"tab-after",ref:x});break;default:throw"unreachable"}r.dropAction=r.proposedAction,r.stopPropagation(),this.activateWidget(p)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&(this._releaseMouse(),mr.postMessage(this,Ks.LayoutModified))},e.prototype._evtMouseDown=function(r){if(r.button===0){var n=this.layout,i=r.target,o=yx(n.handles(),function(x){return x.contains(i)});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(),c=r.clientX-s.left,l=r.clientY-s.top,h=window.getComputedStyle(o),p=pA.overrideCursor(h.cursor,this._document);this._pressData={handle:o,deltaX:c,deltaY:l,override:p}}}},e.prototype._evtMouseMove=function(r){if(this._pressData){r.preventDefault(),r.stopPropagation();var n=this.node.getBoundingClientRect(),i=r.clientX-n.left-this._pressData.deltaX,o=r.clientY-n.top-this._pressData.deltaY,s=this.layout;s.moveHandle(this._pressData.handle,i,o)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse(),mr.postMessage(this,Ks.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,n){var i=Ks.findDropTarget(this,r,n,this._edges),o=i.zone,s=i.target;if(o==="invalid")return this.overlay.hide(100),o;var c,l,h,p,x=co.boxSizing(this.node),w=this.node.getBoundingClientRect();switch(o){case"root-all":c=x.paddingTop,l=x.paddingLeft,h=x.paddingRight,p=x.paddingBottom;break;case"root-top":c=x.paddingTop,l=x.paddingLeft,h=x.paddingRight,p=w.height*Ks.GOLDEN_RATIO;break;case"root-left":c=x.paddingTop,l=x.paddingLeft,h=w.width*Ks.GOLDEN_RATIO,p=x.paddingBottom;break;case"root-right":c=x.paddingTop,l=w.width*Ks.GOLDEN_RATIO,h=x.paddingRight,p=x.paddingBottom;break;case"root-bottom":c=w.height*Ks.GOLDEN_RATIO,l=x.paddingLeft,h=x.paddingRight,p=x.paddingBottom;break;case"widget-all":c=s.top,l=s.left,h=s.right,p=s.bottom;break;case"widget-top":c=s.top,l=s.left,h=s.right,p=s.bottom+s.height/2;break;case"widget-left":c=s.top,l=s.left,h=s.right+s.width/2,p=s.bottom;break;case"widget-right":c=s.top,l=s.left+s.width/2,h=s.right,p=s.bottom;break;case"widget-bottom":c=s.top+s.height/2,l=s.left,h=s.right,p=s.bottom;break;case"widget-tab":var E=s.tabBar.node.getBoundingClientRect().height;c=s.top,l=s.left,h=s.right,p=s.bottom+s.height-E;break;default:throw"unreachable"}return this.overlay.show({top:c,left:l,right:h,bottom:p}),o},e.prototype._createTabBar=function(){var r=this._renderer.createTabBar(this._document);return Ks.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(){mr.postMessage(this,Ks.LayoutModified)},e.prototype._onCurrentChanged=function(r,n){var i=n.previousTitle,o=n.currentTitle;i&&i.owner.hide(),o&&o.owner.show(),(lc.IS_EDGE||lc.IS_IE)&&mr.flush(),mr.postMessage(this,Ks.LayoutModified)},e.prototype._onTabAddRequested=function(r){this._addRequested.emit(r)},e.prototype._onTabActivateRequested=function(r,n){n.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,n){n.title.owner.close()},e.prototype._onTabDetachRequested=function(r,n){var i=this;if(!this._drag){r.releaseMouse();var o=n.title,s=n.tab,c=n.clientX,l=n.clientY,h=new Og.MimeData,p=function(){return o.owner};h.setData("application/vnd.lumino.widget-factory",p);var x=s.cloneNode(!0);this._drag=new pA({document:this._document,mimeData:h,dragImage:x,proposedAction:"move",supportedActions:"move",source:this}),s.classList.add("lm-mod-hidden"),s.classList.add("p-mod-hidden");var w=function(){i._drag=null,s.classList.remove("lm-mod-hidden"),s.classList.remove("p-mod-hidden")};this._drag.start(c,l).then(w)}},e}(Mr);(function(t){var e=function(){function n(){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 n.prototype.show=function(i){var o=this.node.style;o.top=i.top+"px",o.left=i.left+"px",o.right=i.right+"px",o.bottom=i.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"))},n.prototype.hide=function(i){var o=this;if(!this._hidden){if(i<=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")},i))}},n}();t.Overlay=e;var r=function(){function n(){}return n.prototype.createTabBar=function(i){var o=new Mx({document:i});return o.addClass("lm-DockPanel-tabBar"),o.addClass("p-DockPanel-tabBar"),o},n.prototype.createHandle=function(){var i=document.createElement("div");return i.className="lm-DockPanel-handle",i.classList.add("p-DockPanel-handle"),i},n}();t.Renderer=r,t.defaultRenderer=new r})(lhe||(lhe={}));var Ks;(function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new xx("layout-modified"),t.isGeneratedTabBarProperty=new vl({name:"isGeneratedTabBar",create:function(){return!1}});function e(i){if(i.isEmpty)return{main:null};var o=Jue(i.widgets()),s=i.selectedWidgets().next(),c=s?o.indexOf(s):-1;return{main:{type:"tab-area",widgets:o,currentIndex:c}}}t.createSingleDocumentConfig=e;function r(i,o,s,c){if(!co.hitTest(i.node,o,s))return{zone:"invalid",target:null};var l=i.layout;if(l.isEmpty)return{zone:"root-all",target:null};if(i.mode==="multiple-document"){var h=i.node.getBoundingClientRect(),p=o-h.left+1,x=s-h.top+1,w=h.right-o,E=h.bottom-s,P=Math.min(x,w,E,p);switch(P){case x:if(x<c.top)return{zone:"root-top",target:null};break;case w:if(w<c.right)return{zone:"root-right",target:null};break;case E:if(E<c.bottom)return{zone:"root-bottom",target:null};break;case p:if(p<c.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var B=l.hitTestTabAreas(o,s);if(!B)return{zone:"invalid",target:null};if(i.mode==="single-document")return{zone:"widget-all",target:B};var D=B.x-B.left+1,W=B.y-B.top+1,X=B.left+B.width-B.x,q=B.top+B.height-B.y,$=B.tabBar.node.getBoundingClientRect().height;if(W<$)return{zone:"widget-tab",target:B};var te=Math.round(B.width/3),F=Math.round(B.height/3);if(D>te&&X>te&&W>F&&q>F)return{zone:"widget-all",target:B};D/=te,W/=F,X/=te,q/=F;var ue=Math.min(D,W,X,q),oe;switch(ue){case D:oe="widget-left";break;case W:oe="widget-top";break;case X:oe="widget-right";break;case q:oe="widget-bottom";break;default:throw"unreachable"}return{zone:oe,target:B}}t.findDropTarget=r;function n(i){return i.titles.length===0?null:i.currentTitle?i.currentTitle.owner:i.titles[i.titles.length-1].owner}t.getDropRef=n})(Ks||(Ks={}));var qWt=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 Di(this),this._currentChanged=new Di(this)}return t.prototype.dispose=function(){var e=this;this._counter<0||(this._counter=-1,Di.clearData(this),yn(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),n=r?this._counter++:-1;this._widgets.push(e),this._numbers.set(e,n),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),Zt.removeFirstOf(this._widgets,e),this._nodes.delete(e.node),this._numbers.delete(e),this._currentWidget===e)){var n=ehe(this._widgets,function(o){return r._numbers.get(o)!==-1}),i=the(n,function(o,s){var c=r._numbers.get(o),l=r._numbers.get(s);return c-l})||null;this._setWidgets(i,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 n=this._currentWidget;this._currentWidget=e;var i=this._activeWidget;this._activeWidget=r,n!==e&&this._currentChanged.emit({oldValue:n,newValue:e}),i!==r&&this._activeChanged.emit({oldValue:i,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),n=e.relatedTarget;if(!n){this._setWidgets(this._currentWidget,null);return}if(!r.node.contains(n)&&!yx(this._widgets,function(i){return i.node.contains(n)})){this._setWidgets(this._currentWidget,null);return}},t.prototype._onWidgetDisposed=function(e){this.remove(e)},t}(),P8=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;return n._dirty=!1,n._rowSpacing=4,n._columnSpacing=4,n._items=[],n._rowStarts=[],n._columnStarts=[],n._rowSizers=[new mA],n._columnSizers=[new mA],n._box=null,r.rowCount!==void 0&&ja.reallocSizers(n._rowSizers,r.rowCount),r.columnCount!==void 0&&ja.reallocSizers(n._columnSizers,r.columnCount),r.rowSpacing!==void 0&&(n._rowSpacing=ja.clampValue(r.rowSpacing)),r.columnSpacing!==void 0&&(n._columnSpacing=ja.clampValue(r.columnSpacing)),n}return e.prototype.dispose=function(){yn(this._items,function(r){var n=r.widget;r.dispose(),n.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&&(ja.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&&(ja.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=ja.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=ja.clampValue(r),this._columnSpacing!==r&&(this._columnSpacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(r){var n=this._rowSizers[r];return n?n.stretch:-1},e.prototype.setRowStretch=function(r,n){var i=this._rowSizers[r];i&&(n=ja.clampValue(n),i.stretch!==n&&(i.stretch=n,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(r){var n=this._columnSizers[r];return n?n.stretch:-1},e.prototype.setColumnStretch=function(r,n){var i=this._columnSizers[r];i&&(n=ja.clampValue(n),i.stretch!==n&&(i.stretch=n,this.parent&&this.parent.update()))},e.prototype.iter=function(){return hA(this._items,function(r){return r.widget})},e.prototype.addWidget=function(r){var n=Zt.findFirstIndex(this._items,function(i){return i.widget===r});n===-1&&(this._items.push(new DT(r)),this.parent&&this.attachWidget(r))},e.prototype.removeWidget=function(r){var n=Zt.findFirstIndex(this._items,function(o){return o.widget===r});if(n!==-1){var i=Zt.removeAt(this._items,n);this.parent&&this.detachWidget(r),i.dispose()}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),yn(this,function(n){r.attachWidget(n)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(r){this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&mr.sendMessage(r,Mr.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,n=this.rowCount;r<n;++r)this._rowSizers[r].minSize=0;for(var r=0,n=this.columnCount;r<n;++r)this._columnSizers[r].minSize=0;for(var i=this._items.filter(function(W){return!W.isHidden}),r=0,n=i.length;r<n;++r)i[r].fit();var o=this.rowCount-1,s=this.columnCount-1;i.sort(ja.rowSpanCmp);for(var r=0,n=i.length;r<n;++r){var c=i[r],l=e.getCellConfig(c.widget),h=Math.min(l.row,o),p=Math.min(l.row+l.rowSpan-1,o);ja.distributeMin(this._rowSizers,h,p,c.minHeight)}i.sort(ja.columnSpanCmp);for(var r=0,n=i.length;r<n;++r){var c=i[r],l=e.getCellConfig(c.widget),x=Math.min(l.column,s),w=Math.min(l.column+l.columnSpan-1,s);ja.distributeMin(this._columnSizers,x,w,c.minWidth)}if(this.fitPolicy==="set-no-constraint"){mr.sendMessage(this.parent,Mr.Msg.UpdateRequest);return}for(var E=o*this._rowSpacing,P=s*this._columnSpacing,r=0,n=this.rowCount;r<n;++r)E+=this._rowSizers[r].minSize;for(var r=0,n=this.columnCount;r<n;++r)P+=this._columnSizers[r].minSize;var B=this._box=co.boxSizing(this.parent.node);P+=B.horizontalSum,E+=B.verticalSum;var D=this.parent.node.style;D.minWidth=P+"px",D.minHeight=E+"px",this._dirty=!0,this.parent.parent&&mr.sendMessage(this.parent.parent,Mr.Msg.FitRequest),this._dirty&&mr.sendMessage(this.parent,Mr.Msg.UpdateRequest)},e.prototype._update=function(r,n){this._dirty=!1,r<0&&(r=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=co.boxSizing(this.parent.node));var i=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,c=n-this._box.verticalSum,l=this.rowCount-1,h=this.columnCount-1,p=l*this._rowSpacing,x=h*this._columnSpacing;xu.calc(this._rowSizers,Math.max(0,c-p)),xu.calc(this._columnSizers,Math.max(0,s-x));for(var w=0,E=i,P=this.rowCount;w<P;++w)this._rowStarts[w]=E,E+=this._rowSizers[w].size+this._rowSpacing;for(var w=0,E=o,P=this.columnCount;w<P;++w)this._columnStarts[w]=E,E+=this._columnSizers[w].size+this._columnSpacing;for(var w=0,P=this._items.length;w<P;++w){var B=this._items[w];if(!B.isHidden){var D=e.getCellConfig(B.widget),W=Math.min(D.row,l),X=Math.min(D.column,h),q=Math.min(D.row+D.rowSpan-1,l),$=Math.min(D.column+D.columnSpan-1,h),te=this._columnStarts[X],F=this._rowStarts[W],ue=this._columnStarts[$]+this._columnSizers[$].size-te,oe=this._rowStarts[q]+this._rowSizers[q].size-F;B.update(te,F,ue,oe)}}},e}(AA);(function(t){function e(n){return ja.cellConfigProperty.get(n)}t.getCellConfig=e;function r(n,i){ja.cellConfigProperty.set(n,ja.normalizeConfig(i))}t.setCellConfig=r})(P8||(P8={}));var ja;(function(t){t.cellConfigProperty=new vl({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:c});function e(l){var h=Math.max(0,Math.floor(l.row||0)),p=Math.max(0,Math.floor(l.column||0)),x=Math.max(1,Math.floor(l.rowSpan||0)),w=Math.max(1,Math.floor(l.columnSpan||0));return{row:h,column:p,rowSpan:x,columnSpan:w}}t.normalizeConfig=e;function r(l){return Math.max(0,Math.floor(l))}t.clampValue=r;function n(l,h){var p=t.cellConfigProperty.get(l.widget),x=t.cellConfigProperty.get(h.widget);return p.rowSpan-x.rowSpan}t.rowSpanCmp=n;function i(l,h){var p=t.cellConfigProperty.get(l.widget),x=t.cellConfigProperty.get(h.widget);return p.columnSpan-x.columnSpan}t.columnSpanCmp=i;function o(l,h){for(h=Math.max(1,Math.floor(h));l.length<h;)l.push(new mA);l.length>h&&(l.length=h)}t.reallocSizers=o;function s(l,h,p,x){if(!(p<h)){if(h===p){var w=l[h];w.minSize=Math.max(w.minSize,x);return}for(var E=0,P=h;P<=p;++P)E+=l[P].minSize;if(!(E>=x))for(var B=(x-E)/(p-h+1),P=h;P<=p;++P)l[P].minSize+=B}}t.distributeMin=s;function c(l){l.parent&&l.parent.layout instanceof P8&&l.parent.fit()}})(ja||(ja={}));var uhe=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,{node:YR.createNode()})||this;return n._activeIndex=-1,n._tabFocusIndex=0,n._menus=[],n._childMenu=null,n.addClass("lm-MenuBar"),n.addClass("p-MenuBar"),n.setFlag(Mr.Flag.DisallowLayout),n.renderer=r.renderer||e.defaultRenderer,n._forceItemsPosition=r.forceItemsPosition||{forceX:!0,forceY:!0},n}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,n){this._closeChildMenu();var i=this._menus.indexOf(n),o=Math.max(0,Math.min(r,this._menus.length));if(i===-1){Zt.insert(this._menus,o,n),n.addClass("lm-MenuBar-menu"),n.addClass("p-MenuBar-menu"),n.aboutToClose.connect(this._onMenuAboutToClose,this),n.menuRequested.connect(this._onMenuMenuRequested,this),n.title.changed.connect(this._onTitleChanged,this),this.update();return}o===this._menus.length&&o--,i!==o&&(Zt.move(this._menus,i,o),this.update())},e.prototype.removeMenu=function(r){this.removeMenuAt(this._menus.indexOf(r))},e.prototype.removeMenuAt=function(r){this._closeChildMenu();var n=Zt.removeAt(this._menus,r);n&&(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.update())},e.prototype.clearMenus=function(){if(this._menus.length!==0){this._closeChildMenu();for(var r=0,n=this._menus;r<n.length;r++){var i=n[r];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._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 n=this,i=this._menus,o=this.renderer,s=this._activeIndex,c=this._tabFocusIndex>=0&&this._tabFocusIndex<i.length?this._tabFocusIndex:0,l=new Array(i.length),h=function(w,E){var P=i[w].title,B=w===s;B&&i[w].items.length==0&&(B=!1),l[w]=o.renderItem({title:P,active:B,tabbable:w===c,onfocus:function(){n.activeIndex=w}})},p=0,x=i.length;p<x;++p)h(p);Sd.render(l,this.contentNode)},e.prototype._evtKeyDown=function(r){var n=r.keyCode;if(n===9){this.activeIndex=-1;return}if(r.preventDefault(),r.stopPropagation(),n===13||n===32||n===38||n===40){this.openActiveMenu();return}if(n===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(n===37){var i=this._activeIndex,o=this._menus.length;this.activeIndex=i===0?o-1:i-1;return}if(n===39){var i=this._activeIndex,o=this._menus.length;this.activeIndex=i===o-1?0:i+1;return}var s=vx().keyForKeydownEvent(r);if(s){var c=this._activeIndex+1,l=YR.findMnemonic(this._menus,s,c);l.index!==-1&&!l.multiple?(this.activeIndex=l.index,this.openActiveMenu()):l.index!==-1?this.activeIndex=l.index:l.auto!==-1&&(this.activeIndex=l.auto)}},e.prototype._evtMouseDown=function(r){if(co.hitTest(this.node,r.clientX,r.clientY)){r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation();var n=Zt.findFirstIndex(this.contentNode.children,function(o){return co.hitTest(o,r.clientX,r.clientY)});if(n===-1){this._closeChildMenu();return}if(r.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=n;else{var i=this._positionForMenu(n);Ex.saveWindowData(),this.activeIndex=n,this._openChildMenu(i)}}},e.prototype._evtMouseMove=function(r){var n=Zt.findFirstIndex(this.contentNode.children,function(o){return co.hitTest(o,r.clientX,r.clientY)});if(n!==this._activeIndex&&!(n===-1&&this._childMenu)){var i=this._positionForMenu(n);Ex.saveWindowData(),this.activeIndex=n,this._childMenu&&this._openChildMenu(i)}},e.prototype._positionForMenu=function(r){var n=this.contentNode.children[r],i=n.getBoundingClientRect(),o=i.left,s=i.bottom;return{top:s,left:o}},e.prototype._evtMouseLeave=function(r){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(r){var n;r===void 0&&(r={});var i=this.activeMenu;if(!i){this._closeChildMenu();return}var o=this._childMenu;if(o!==i){this._childMenu=i,o?o.close():document.addEventListener("mousedown",this,!0),mr.sendMessage(this,Mr.Msg.UpdateRequest);var s=r.left,c=r.top;(typeof s>"u"||typeof c>"u")&&(n=this._positionForMenu(this._activeIndex),s=n.left,c=n.top),o||(this.addClass("lm-mod-active"),this.addClass("p-mod-active")),i.items.length>0&&i.open(s,c,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,n){if(r===this._childMenu){var i=this._activeIndex,o=this._menus.length;switch(n){case"next":this.activeIndex=i===o-1?0:i+1;break;case"previous":this.activeIndex=i===0?o-1:i-1;break}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(Mr);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(n){var i=this.createItemClass(n),o=this.createItemDataset(n),s=this.createItemARIA(n);return Ji.li(uc({className:i,dataset:o,tabindex:n.tabbable?"0":"-1",onfocus:n.onfocus},s),this.renderIcon(n),this.renderLabel(n))},r.prototype.renderIcon=function(n){var i=this.createIconClass(n);return typeof n.title.icon=="string"?Ji.div({className:i},n.title.iconLabel):Ji.div({className:i},n.title.icon,n.title.iconLabel)},r.prototype.renderLabel=function(n){var i=this.formatLabel(n);return Ji.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},i)},r.prototype.createItemClass=function(n){var i="lm-MenuBar-item";return i+=" p-MenuBar-item",n.title.className&&(i+=" "+n.title.className),n.active&&(i+=" lm-mod-active",i+=" p-mod-active"),i},r.prototype.createItemDataset=function(n){return n.title.dataset},r.prototype.createItemARIA=function(n){return{role:"menuitem","aria-haspopup":"true"}},r.prototype.createIconClass=function(n){var i="lm-MenuBar-itemIcon";i+=" p-MenuBar-itemIcon";var o=n.title.iconClass;return o?i+" "+o:i},r.prototype.formatLabel=function(n){var i=n.title,o=i.label,s=i.mnemonic;if(s<0||s>=o.length)return o;var c=o.slice(0,s),l=o.slice(s+1),h=o[s],p=Ji.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},h);return[c,p,l]},r}();t.Renderer=e,t.defaultRenderer=new e})(uhe||(uhe={}));var YR;(function(t){function e(){var n=document.createElement("div"),i=document.createElement("ul");return i.className="lm-MenuBar-content",i.classList.add("p-MenuBar-content"),n.appendChild(i),i.setAttribute("role","menubar"),n}t.createNode=e;function r(n,i,o){for(var s=-1,c=-1,l=!1,h=i.toUpperCase(),p=0,x=n.length;p<x;++p){var w=(p+o)%x,E=n[w].title;if(E.label.length!==0){var P=E.mnemonic;if(P>=0&&P<E.label.length){E.label[P].toUpperCase()===h&&(s===-1?s=w:l=!0);continue}c===-1&&E.label[0].toUpperCase()===h&&(c=w)}}return{index:s,multiple:l,auto:c}}t.findMnemonic=r})(YR||(YR={}));var GWt=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,{node:KR.createNode()})||this;return n._onRepeat=function(){if(n._repeatTimer=-1,!!n._pressData){var i=n._pressData.part;if(i!=="thumb"){n._repeatTimer=window.setTimeout(n._onRepeat,20);var o=n._pressData.mouseX,s=n._pressData.mouseY;if(i==="decrement"){if(!co.hitTest(n.decrementNode,o,s))return;n._stepRequested.emit("decrement");return}if(i==="increment"){if(!co.hitTest(n.incrementNode,o,s))return;n._stepRequested.emit("increment");return}if(i==="track"){if(!co.hitTest(n.trackNode,o,s))return;var c=n.thumbNode;if(co.hitTest(c,o,s))return;var l=c.getBoundingClientRect(),h=void 0;n._orientation==="horizontal"?h=o<l.left?"decrement":"increment":h=s<l.top?"decrement":"increment",n._pageRequested.emit(h);return}}}},n._value=0,n._page=10,n._maximum=100,n._repeatTimer=-1,n._pressData=null,n._thumbMoved=new Di(n),n._stepRequested=new Di(n),n._pageRequested=new Di(n),n.addClass("lm-ScrollBar"),n.addClass("p-ScrollBar"),n.setFlag(Mr.Flag.DisallowLayout),n._orientation=r.orientation||"vertical",n.dataset.orientation=n._orientation,r.maximum!==void 0&&(n._maximum=Math.max(0,r.maximum)),r.page!==void 0&&(n._page=Math.max(0,r.page)),r.value!==void 0&&(n._value=Math.max(0,Math.min(r.value,n._maximum))),n}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 n=this._value*100/this._maximum,i=this._page*100/(this._page+this._maximum);n=Math.max(0,Math.min(n,100)),i=Math.max(0,Math.min(i,100));var o=this.thumbNode.style;this._orientation==="horizontal"?(o.top="",o.height="",o.left=n+"%",o.width=i+"%",o.transform="translate("+-n+"%, 0%)"):(o.left="",o.width="",o.top=n+"%",o.height=i+"%",o.transform="translate(0%, "+-n+"%)")},e.prototype._evtKeyDown=function(r){if(r.preventDefault(),r.stopPropagation(),r.keyCode===27){var n=this._pressData?this._pressData.value:-1;this._releaseMouse(),n!==-1&&this._moveThumb(n)}},e.prototype._evtMouseDown=function(r){if(r.button===0&&(this.activate(),!this._pressData)){var n=KR.findPart(this,r.target);if(n){r.preventDefault(),r.stopPropagation();var i=pA.overrideCursor("default");if(this._pressData={part:n,override:i,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),n==="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(n==="track"){var s=this.thumbNode.getBoundingClientRect(),c=void 0;this._orientation==="horizontal"?c=r.clientX<s.left?"decrement":"increment":c=r.clientY<s.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),this._pageRequested.emit(c);return}if(n==="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(n==="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 n=this.thumbNode.getBoundingClientRect(),i=this.trackNode.getBoundingClientRect(),o,s;this._orientation==="horizontal"?(o=r.clientX-i.left-this._pressData.delta,s=i.width-n.width):(o=r.clientY-i.top-this._pressData.delta,s=i.height-n.height);var c=s===0?0:o*this._maximum/s;this._moveThumb(c)}},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}(Mr),KR;(function(t){function e(){var n=document.createElement("div"),i=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),c=document.createElement("div");return i.className="lm-ScrollBar-button",o.className="lm-ScrollBar-button",i.dataset.action="decrement",o.dataset.action="increment",s.className="lm-ScrollBar-track",c.className="lm-ScrollBar-thumb",i.classList.add("p-ScrollBar-button"),o.classList.add("p-ScrollBar-button"),s.classList.add("p-ScrollBar-track"),c.classList.add("p-ScrollBar-thumb"),s.appendChild(c),n.appendChild(i),n.appendChild(s),n.appendChild(o),n}t.createNode=e;function r(n,i){return n.thumbNode.contains(i)?"thumb":n.trackNode.contains(i)?"track":n.decrementNode.contains(i)?"decrement":n.incrementNode.contains(i)?"increment":null}t.findPart=r})(KR||(KR={}));var XWt=function(t){Ds(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?RT(this._widget):_u()},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),yn(this,function(n){r.attachWidget(n)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.AfterAttach)},e.prototype.detachWidget=function(r){this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&mr.sendMessage(r,Mr.Msg.AfterDetach)},e}(AA),Nze=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,r)||this;return n._dirty=!1,n._items=[],n._box=null,n._hiddenMode=r.hiddenMode!==void 0?r.hiddenMode:Mr.HiddenMode.Display,n}return Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(r){var n=this;this._hiddenMode!==r&&(this._hiddenMode=r,this.widgets.length>1&&this.widgets.forEach(function(i){i.hiddenMode=n._hiddenMode}))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){yn(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(r,n){this._hiddenMode===Mr.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Mr.HiddenMode.Scale),n.hiddenMode=Mr.HiddenMode.Scale):n.hiddenMode=Mr.HiddenMode.Display,Zt.insert(this._items,r,new DT(n)),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeAttach),this.parent.node.appendChild(n.node),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,n,i){Zt.move(this._items,r,n),this.parent.update()},e.prototype.detachWidget=function(r,n){var i=Zt.removeAt(this._items,r);this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&mr.sendMessage(n,Mr.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===Mr.HiddenMode.Scale&&(n.hiddenMode=Mr.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Mr.HiddenMode.Display)),i.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,n=0,i=0,o=this._items.length;i<o;++i){var s=this._items[i];s.isHidden||(s.fit(),r=Math.max(r,s.minWidth),n=Math.max(n,s.minHeight))}var c=this._box=co.boxSizing(this.parent.node);r+=c.horizontalSum,n+=c.verticalSum;var l=this.parent.node.style;l.minWidth=r+"px",l.minHeight=n+"px",this._dirty=!0,this.parent.parent&&mr.sendMessage(this.parent.parent,Mr.Msg.FitRequest),this._dirty&&mr.sendMessage(this.parent,Mr.Msg.UpdateRequest)},e.prototype._update=function(r,n){this._dirty=!1;for(var i=0,o=0,s=this._items.length;o<s;++o)i+=+!this._items[o].isHidden;if(i!==0){r<0&&(r=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=co.boxSizing(this.parent.node));for(var c=this._box.paddingTop,l=this._box.paddingLeft,h=r-this._box.horizontalSum,p=n-this._box.verticalSum,o=0,s=this._items.length;o<s;++o){var x=this._items[o];x.isHidden||(x.widget.node.style.zIndex=""+o,x.update(l,c,h,p))}}},e}(ZR),kze=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,{layout:I8.createLayout(r)})||this;return n._widgetRemoved=new Di(n),n.addClass("lm-StackedPanel"),n.addClass("p-StackedPanel"),n}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}(NT),I8;(function(t){function e(r){return r.layout||new Nze}t.createLayout=e})(I8||(I8={}));var YWt=function(t){Ds(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;n._currentChanged=new Di(n),n._addRequested=new Di(n),n.addClass("lm-TabPanel"),n.addClass("p-TabPanel"),n.tabBar=new Mx(r),n.tabBar.addClass("lm-TabPanel-tabBar"),n.stackedPanel=new kze,n.stackedPanel.addClass("lm-TabPanel-stackedPanel"),n.tabBar.addClass("p-TabPanel-tabBar"),n.stackedPanel.addClass("p-TabPanel-stackedPanel"),n.tabBar.tabMoved.connect(n._onTabMoved,n),n.tabBar.currentChanged.connect(n._onCurrentChanged,n),n.tabBar.tabCloseRequested.connect(n._onTabCloseRequested,n),n.tabBar.tabActivateRequested.connect(n._onTabActivateRequested,n),n.tabBar.addRequested.connect(n._onTabAddRequested,n),n.stackedPanel.widgetRemoved.connect(n._onWidgetRemoved,n),n._tabPlacement=r.tabPlacement||"top";var i=Tx.directionFromPlacement(n._tabPlacement),o=Tx.orientationFromPlacement(n._tabPlacement);n.tabBar.orientation=o,n.tabBar.dataset.placement=n._tabPlacement;var s=new Jh({direction:i,spacing:0});return Jh.setStretch(n.tabBar,0),Jh.setStretch(n.stackedPanel,1),s.addWidget(n.tabBar),s.addWidget(n.stackedPanel),n.layout=s,n}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 n=Tx.directionFromPlacement(r),i=Tx.orientationFromPlacement(r);this.tabBar.orientation=i,this.tabBar.dataset.placement=r,this.layout.direction=n}},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,n){n!==this.currentWidget&&n.hide(),this.stackedPanel.insertWidget(r,n),this.tabBar.insertTab(r,n.title),n.node.setAttribute("role","tabpanel");var i=this.tabBar.renderer;if(i instanceof Mx.Renderer){var o=i.createTabKey({title:n.title,current:!1,zIndex:0});n.node.setAttribute("aria-labelledby",o)}},e.prototype._onCurrentChanged=function(r,n){var i=n.previousIndex,o=n.previousTitle,s=n.currentIndex,c=n.currentTitle,l=o?o.owner:null,h=c?c.owner:null;l&&l.hide(),h&&h.show(),this._currentChanged.emit({previousIndex:i,previousWidget:l,currentIndex:s,currentWidget:h}),(lc.IS_EDGE||lc.IS_IE)&&mr.flush()},e.prototype._onTabAddRequested=function(r,n){this._addRequested.emit(r)},e.prototype._onTabActivateRequested=function(r,n){n.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,n){n.title.owner.close()},e.prototype._onTabMoved=function(r,n){this.stackedPanel.insertWidget(n.toIndex,n.title.owner)},e.prototype._onWidgetRemoved=function(r,n){n.node.removeAttribute("role"),n.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(n.title)},e}(Mr),Tx;(function(t){function e(o){return n[o]}t.orientationFromPlacement=e;function r(o){return i[o]}t.directionFromPlacement=r;var n={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},i={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(Tx||(Tx={}));var Fze="IPY_MODEL_";function kT(t,e){if(Array.isArray(t)){let r=[];return t.forEach((n,i)=>{r.push(kT(n,e))}),Promise.all(r)}else if(t instanceof Object){let r={};return Object.keys(t).forEach(n=>{r[n]=kT(t[n],e)}),q1(r)}else return typeof t=="string"&&t.slice(0,10)==="IPY_MODEL_"?e.get_model(t.slice(10,t.length)):Promise.resolve(t)}function L8(t,e){if(Array.isArray(t)){let r=[];for(let n of t)r.push(L8(n,e));return r}else{if(t instanceof up)return`${Fze}${t.model_id}`;if(t instanceof Object&&typeof t!="string"){let r={};Object.keys(t).forEach(n=>{r[n]=L8(t[n],e)})}else return t}}var up=class extends hhe.Model{defaults(){return{_model_module:"@jupyter-widgets/base",_model_name:"WidgetModel",_model_module_version:BI,_view_module:"@jupyter-widgets/base",_view_name:null,_view_module_version:BI,_view_count:null}}isNew(){return!1}initialize(e,r){this._expectedEchoMsgIds={},this._attrsToUpdate={},super.initialize(e,r),this.widget_manager=r.widget_manager,this.model_id=r.model_id;let n=r.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}get comm_live(){return this._comm_live}set comm_live(e){this._comm_live=e,this.trigger("comm_live_update")}send(e,r,n){if(this.comm!==void 0){let i={method:"custom",content:e};this.comm.send(i,r,{},n)}}close(e=!1){if(this._closed)return;this._closed=!0,this.comm&&!e&&this.comm.close(),this.stopListening(),this.trigger("destroy",this),this.comm&&delete this.comm;let r=Object.keys(this.views).map(n=>this.views[n].then(i=>i.remove()));return delete this.views,Promise.all(r).then(()=>{})}_handle_comm_closed(e){this.trigger("comm:close"),this.close(!0)}_handle_comm_msg(e){let r=e.content.data,n=r.method;switch(n){case"update":case"echo_update":return this.state_change=this.state_change.then(()=>{var i,o,s;let c=r.state,l=(i=r.buffer_paths,i??[]),h=(s=(o=e.buffers)===null||o===void 0?void 0:o.slice(0,l.length),s??[]).map(p=>p instanceof DataView?p:new DataView(p instanceof ArrayBuffer?p:p.buffer));if(eA(c,l,h),e.parent_header&&n==="echo_update"){let p=e.parent_header.msg_id;Object.keys(c).filter(w=>this._expectedEchoMsgIds.hasOwnProperty(w)).forEach(w=>{this._expectedEchoMsgIds[w]!==p?delete c[w]:(delete this._expectedEchoMsgIds[w],this._msg_buffer!==null&&Object.prototype.hasOwnProperty.call(this._msg_buffer,w)&&delete c[w])})}return this.constructor._deserialize_state(c,this.widget_manager)}).then(i=>{this.set_state(i)}).catch(cp(`Could not process update msg for model id: ${this.model_id}`,!0)),this.state_change;case"custom":return this.trigger("msg:custom",r.content,e.buffers),Promise.resolve()}}set_state(e){this._state_lock=e;try{this.set(e)}catch(r){console.error(`Error setting state: ${r.message}`)}finally{this._state_lock=null}}get_state(e){let r=this.attributes;if(e){let n=this.defaults,i=typeof n=="function"?n.call(this):n,o={};return Object.keys(r).forEach(s=>{W1(r[s],i[s])||(o[s]=r[s])}),o}else return Object.assign({},r)}_handle_status(e){if(this.comm!==void 0&&e.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)){let r=this.send_sync_message(this._msg_buffer,this._msg_buffer_callbacks);this.rememberLastUpdateFor(r),this._msg_buffer=null,this._msg_buffer_callbacks=null}}callbacks(e){return this.widget_manager.callbacks(e)}set(e,r,n){let i=ule.call(this,e,r,n);if(this._buffered_state_diff!==void 0){let o=this.changedAttributes()||{};if(this._state_lock)for(let s of Object.keys(this._state_lock))o[s]===this._state_lock[s]&&delete o[s];this._buffered_state_diff=xd(this._buffered_state_diff,o)}return i}sync(e,r,n={}){if(this.comm===void 0)throw"Syncing error: no comm channel defined";let i=e==="patch"?n.attrs:r.get_state(n.drop_defaults);if(this._state_lock)for(let s of Object.keys(this._state_lock))i[s]===this._state_lock[s]&&delete i[s];Object.keys(i).forEach(s=>{this._attrsToUpdate[s]=!0});let o=this.serialize(i);if(Object.keys(o).length>0){let s=n.callbacks||this.callbacks();if(this._pending_msgs>=1){switch(e){case"patch":this._msg_buffer=xd(this._msg_buffer||{},o);break;case"update":case"create":this._msg_buffer=o;break;default:throw"unrecognized syncing method"}this._msg_buffer_callbacks=s}else{let c=this.send_sync_message(i,s);this.rememberLastUpdateFor(c)}}}rememberLastUpdateFor(e){Object.keys(this._attrsToUpdate).forEach(r=>{this._expectedEchoMsgIds[r]=e}),this._attrsToUpdate={}}serialize(e){let r=this.constructor.serializers||{};for(let n of Object.keys(e))try{r[n]&&r[n].serialize?e[n]=r[n].serialize(e[n],this):e[n]=JSON.parse(JSON.stringify(e[n])),e[n]&&e[n].toJSON&&(e[n]=e[n].toJSON())}catch(i){throw console.error("Error serializing widget state attribute: ",n),i}return e}send_sync_message(e,r={}){if(!this.comm)return"";try{r={shell:Object.assign({},r.shell),iopub:Object.assign({},r.iopub),input:r.input};let n=r.iopub.status;r.iopub.status=s=>{this._handle_status(s),n&&n(s)};let i=Qw(e),o=this.comm.send({method:"update",state:i.state,buffer_paths:i.buffer_paths},r,{},i.buffers);return this._pending_msgs++,o}catch(n){console.error("Could not send widget sync message",n)}return""}save_changes(e){if(this.comm_live){let r={patch:!0};e&&(r.callbacks=e),this.save(this._buffered_state_diff,r),this._buffered_state_diff={}}}on_some_change(e,r,n){let i=this;this.on("change",function(){e.some(i.hasChanged,i)&&r.apply(n,arguments)},this)}toJSON(e){return`IPY_MODEL_${this.model_id}`}static _deserialize_state(e,r){let n=this.serializers,i;if(n){i={};for(let o in e)n[o]&&n[o].deserialize?i[o]=n[o].deserialize(e[o],r):i[o]=e[o]}else i=e;return q1(i)}},Sx=class extends up{defaults(){return xd(super.defaults(),{_dom_classes:[]})}};Sx.serializers=Object.assign(Object.assign({},up.serializers),{layout:{deserialize:kT},style:{deserialize:kT}});var gA=class extends VR{constructor(e){super(e)}initialize(e){this.listenTo(this.model,"change",()=>{let r=Object.keys(this.model.changedAttributes()||{});r[0]==="_view_count"&&r.length===1||this.update()}),this.options=e.options,this.once("remove",()=>{typeof this.model.get("_view_count")=="number"&&(this.model.set("_view_count",this.model.get("_view_count")-1),this.model.save_changes())}),this.once("displayed",()=>{typeof this.model.get("_view_count")=="number"&&(this.model.set("_view_count",this.model.get("_view_count")+1),this.model.save_changes())}),this.displayed=new Promise((r,n)=>{this.once("displayed",r)})}update(e){}render(){}create_child_view(e,r={}){return r=Object.assign({parent:this},r),this.model.widget_manager.create_view(e,r).catch(cp("Could not create child view",!0))}callbacks(){return this.model.callbacks(this)}send(e,r){this.model.send(e,this.callbacks(),r)}touch(){this.model.save_changes(this.callbacks())}remove(){return super.remove(),this.trigger("remove"),this}},$R=class extends Mr{constructor(e){let r=e.view;delete e.view,super(e),this._view=r}dispose(){this.isDisposed||(super.dispose(),this._view&&this._view.remove(),this._view=null)}processMessage(e){super.processMessage(e),this._view.processPhosphorMessage(e)}},O8=class extends NT{constructor(e){let r=e.view;delete e.view,super(e),this._view=r}processMessage(e){super.processMessage(e),this._view.processPhosphorMessage(e)}dispose(){this.isDisposed||(super.dispose(),this._view&&this._view.remove(),this._view=null)}},FT=class extends gA{initialize(e){super.initialize(e),this.listenTo(this.model,"change:_dom_classes",(r,n)=>{let i=r.previous("_dom_classes");this.update_classes(i,n)}),this.layoutPromise=Promise.resolve(),this.listenTo(this.model,"change:layout",(r,n)=>{this.setLayout(n,r.previous("layout"))}),this.stylePromise=Promise.resolve(),this.listenTo(this.model,"change:style",(r,n)=>{this.setStyle(n,r.previous("style"))}),this.displayed.then(()=>{this.update_classes([],this.model.get("_dom_classes")),this.setLayout(this.model.get("layout")),this.setStyle(this.model.get("style"))}),this._comm_live_update(),this.listenTo(this.model,"comm_live_update",()=>{this._comm_live_update()})}setLayout(e,r){e&&(this.layoutPromise=this.layoutPromise.then(n=>(n&&(n.unlayout(),this.stopListening(n.model),n.remove()),this.create_child_view(e).then(i=>this.displayed.then(()=>(i.trigger("displayed"),this.listenTo(i.model,"change",()=>{mr.postMessage(this.pWidget,Mr.ResizeMessage.UnknownSize)}),mr.postMessage(this.pWidget,Mr.ResizeMessage.UnknownSize),i))).catch(cp("Could not add LayoutView to DOMWidgetView",!0)))))}setStyle(e,r){e&&(this.stylePromise=this.stylePromise.then(n=>(n&&(n.unstyle(),this.stopListening(n.model),n.remove()),this.create_child_view(e).then(i=>this.displayed.then(()=>(i.trigger("displayed"),i))).catch(cp("Could not add styleView to DOMWidgetView",!0)))))}update_classes(e,r,n){n===void 0&&(n=this.el),OI(e,r).map(function(i){n.classList?n.classList.remove(i):n.setAttribute("class",n.getAttribute("class").replace(i,""))}),OI(r,e).map(function(i){n.classList?n.classList.add(i):n.setAttribute("class",n.getAttribute("class").concat(" ",i))})}update_mapped_classes(e,r,n){let i=this.model.previous(r),o=e[i]?e[i]:[];i=this.model.get(r);let s=e[i]?e[i]:[];this.update_classes(o,s,n||this.el)}set_mapped_classes(e,r,n){let i=this.model.get(r),o=e[i]?e[i]:[];this.update_classes([],o,n||this.el)}_setElement(e){this.pWidget&&this.pWidget.dispose(),this.$el=e instanceof R8.default?e:(0,R8.default)(e),this.el=this.$el[0],this.pWidget=new $R({node:e,view:this})}remove(){return this.pWidget&&this.pWidget.dispose(),super.remove()}processPhosphorMessage(e){switch(e.type){case"after-attach":this.trigger("displayed");break}}_comm_live_update(){this.model.comm_live?this.pWidget.removeClass("jupyter-widgets-disconnected"):this.pWidget.addClass("jupyter-widgets-disconnected")}};var fhe={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},B8=class extends up{defaults(){return xd(super.defaults(),{_model_name:"LayoutModel",_view_name:"LayoutView"},fhe)}},D8=class extends gA{initialize(e){this._traitNames=[],super.initialize(e);for(let r of Object.keys(fhe))this.registerTrait(r)}registerTrait(e){if(this._traitNames.push(e),e==="overflow_x"||e==="overflow_y"){this.listenTo(this.model,"change:"+e,(r,n)=>{this.handleOverflowChange(e,n)}),this.handleOverflowChange(e,this.model.get(e));return}this.listenTo(this.model,"change:"+e,(r,n)=>{this.handleChange(e,n)}),this.handleChange(e,this.model.get(e))}css_name(e){return e.replace(/_/g,"-")}handleChange(e,r){let n=this.options.parent;n?r===null?n.el.style.removeProperty(this.css_name(e)):n.el.style[this.css_name(e)]=r:console.warn("Style not applied because a parent view does not exist")}handleOverflowChange(e,r){let n=this.options.parent;n?r===null?this.model.get("overflow")===null&&n.el.style.removeProperty(this.css_name(e)):n.el.style[this.css_name(e)]=r:console.warn("Style not applied because a parent view does not exist")}unlayout(){let e=this.options.parent;this._traitNames.forEach(r=>{e?e.el.style.removeProperty(this.css_name(r)):console.warn("Style not removed because a parent view does not exist")},this)}};var QR=class extends up{defaults(){let e=this.constructor;return xd(super.defaults(),{_model_name:"StyleModel",_view_name:"StyleView"},Object.keys(e.styleProperties).reduce((r,n)=>(r[n]=e.styleProperties[n].default,r),{}))}};QR.styleProperties={};var N8=class extends gA{initialize(e){this._traitNames=[],super.initialize(e);let r=this.model.constructor;for(let n of Object.keys(r.styleProperties))this.registerTrait(n);this.style()}registerTrait(e){this._traitNames.push(e),this.listenTo(this.model,"change:"+e,(r,n)=>{this.handleChange(e,n)})}handleChange(e,r){let n=this.options.parent;if(n){let o=this.model.constructor.styleProperties,s=o[e].attribute,c=o[e].selector,l=c?n.el.querySelectorAll(c):[n.el];if(r===null)for(let h=0;h!==l.length;++h)l[h].style.removeProperty(s);else for(let h=0;h!==l.length;++h)l[h].style[s]=r}else console.warn("Style not applied because a parent view does not exist")}style(){for(let e of this._traitNames)this.handleChange(e,this.model.get(e))}unstyle(){let e=this.options.parent,n=this.model.constructor.styleProperties;this._traitNames.forEach(i=>{if(e){let o=n[i].attribute,s=n[i].selector,c=s?e.el.querySelectorAll(s):[e.el];for(let l=0;l!==c.length;++l)c[l].style.removeProperty(o)}else console.warn("Style not removed because a parent view does not exist")},this)}};var k8;(function(t){let e;(function(r){class n{constructor(s){this.targets=Object.create(null),this.comms=Object.create(null),this.kernel=null,this.jsServicesKernel=null,this.init_kernel(s)}init_kernel(s){this.kernel=s,this.jsServicesKernel=s}async new_comm(s,c,l,h,p,x){let w=this.jsServicesKernel.createComm(s,p),E=new i(w);return this.register_comm(E),E.open(c,l,h,x),E}register_target(s,c){let l=this.jsServicesKernel.registerCommTarget(s,(h,p)=>{let x=new i(h);this.register_comm(x);try{return c(x,p)}catch(w){x.close(),console.error(w),console.error(new Error("Exception opening new comm"))}});this.targets[s]=l}unregister_target(s,c){this.targets[s].dispose(),delete this.targets[s]}register_comm(s){return this.comms[s.comm_id]=Promise.resolve(s),s.kernel=this.kernel,s.comm_id}}r.CommManager=n;class i{constructor(s){this.jsServicesComm=null,this.kernel=null,this.jsServicesComm=s}get comm_id(){return this.jsServicesComm.commId}get target_name(){return this.jsServicesComm.targetName}open(s,c,l,h){let p=this.jsServicesComm.open(s,l,h);return this._hookupCallbacks(p,c),p.msg.header.msg_id}send(s,c,l,h){let p=this.jsServicesComm.send(s,l,h);return this._hookupCallbacks(p,c),p.msg.header.msg_id}close(s,c,l,h){let p=this.jsServicesComm.close(s,l,h);return this._hookupCallbacks(p,c),p.msg.header.msg_id}on_msg(s){this.jsServicesComm.onMsg=s.bind(this)}on_close(s){this.jsServicesComm.onClose=s.bind(this)}_hookupCallbacks(s,c){c&&(s.onReply=function(l){c.shell&&c.shell.reply&&c.shell.reply(l)},s.onStdin=function(l){c.input&&c.input(l)},s.onIOPub=function(l){if(c.iopub){if(c.iopub.status&&l.header.msg_type==="status")c.iopub.status(l);else if(c.iopub.clear_output&&l.header.msg_type==="clear_output")c.iopub.clear_output(l);else if(c.iopub.output)switch(l.header.msg_type){case"display_data":case"execute_result":case"stream":case"error":c.iopub.output(l);break;default:break}}})}}r.Comm=i})(e=t.services||(t.services={}))})(k8||(k8={}));var F8=class{constructor(e,r,n){this.initialize(e,r,n)}initialize(e,r,n){this._handler_context=n||this,this._models=[],this.views=[],this._create_view=e,this._remove_view=r||function(i){i.remove()}}update(e,r,n,i){let o=n||this._remove_view,s=r||this._create_view;i=i||this._handler_context;let c=0;for(;c<e.length&&!(c>=this._models.length||e[c]!==this._models[c]);c++);let l=c,h=this.views.splice(l,this.views.length-l);for(let p=0;p<h.length;p++)h[p].then(function(x){o.call(i,x)});for(;c<e.length;c++)this.views.push(Promise.resolve(s.call(i,e[c],c)));return this._models=e.slice(),Promise.all(this.views)}remove(){return Promise.all(this.views).then(e=>{e.forEach(r=>this._remove_view.call(this._handler_context,r)),this.views=[],this._models=[]})}dispose(){this.views=null,this._models=null}};var phe=ec(B1()),zze=new phe.Token("jupyter.extensions.jupyterWidgetRegistry");function Uze(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 dhe(t,e){if(!t)return null;for(let r in t){let n=t[r].attributes;for(let i in n){let{dtype:o,value:s}=n[i],c=Uze(o);n[i].value=new c(s.buffer)}}return t}var _A=null,z8=zT&&Sx;if(z8){class t extends z8{defaults(){return{...super.defaults(),_model_name:_A.model_name,_model_module:_A.model_module,_model_module_version:_A.model_module_version,_view_name:_A.view_name,_view_module:_A.view_module,_view_module_version:_A.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{...z8.serializers,data_buffer:{deserialize:dhe}}}static get model_name(){return"JupyterTransportModel"}static get model_module(){return tv}static get model_module_version(){return ev}static get view_name(){return"JupyterTransportView"}static get view_module(){return tv}static get view_module_version(){return ev}}_A=t}var mhe=_A;var ghe=null,Ahe=zT&&FT;if(Ahe){class t extends Ahe{initialize(){this.listenTo(this.model,"destroy",this.remove),this.transport=new ug,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"),n=this.model.get("data_buffer");r&&n?this.transport._messageReceived({type:"json-with-binary",json:r,binary:n}):this.transport._messageReceived({type:"json",json:r})}}ghe=t}var _he=ghe;var U8={};Lo(U8,{Buffer:()=>Vn,BufferTransform:()=>uu,CubeGeometry:()=>Xp,Device:()=>hl,Framebuffer:()=>Lf,Geometry:()=>Mi,GroupNode:()=>hu,Model:()=>jn,ModelNode:()=>Wf,ScenegraphNode:()=>Zu,SphereGeometry:()=>x2,Texture:()=>fi,TextureTransform:()=>gm,attachDevice:()=>Gze,createDevice:()=>Xze,enforceWebGL2:()=>Yze,getBestAvailableAdapter:()=>Wze,getSupportedAdapters:()=>Hze,registerDevices:()=>jze,setDefaultDeviceProps:()=>qze,stats:()=>Vze});var{stats:Vze,registerDevices:jze,getSupportedAdapters:Hze,getBestAvailableAdapter:Wze,setDefaultDeviceProps:qze,attachDevice:Gze,createDevice:Xze,enforceWebGL2:Yze}=Rf;var V8={};Lo(V8,{fetchFile:()=>y_,load:()=>xa,parse:()=>Qd,registerLoaders:()=>HA});var yhe=document.body&&document.body.getAttribute("data-base-url");yhe&&(window.__webpack_public_path__=`${yhe}nbextensions/pydeck/nb_extension`);TI();globalThis.deck=globalThis.deck||{};Object.assign(globalThis.deck,Vw);globalThis.luma=globalThis.luma||{};Object.assign(globalThis.luma,U8);globalThis.loaders=globalThis.loaders||{};Object.assign(globalThis.loaders,V8);return rV(Kze);})();
4468
4471
  /*! Bundled license information: