@mappedin/react-sdk 6.0.1-beta.27 → 6.0.1-beta.29
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/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-3X7TR33L.js → GLTFExporter-6H5C7YOO.js} +1 -1
- package/lib/esm/{GLTFLoader-3TUZFG3M.js → GLTFLoader-VBY6Z7DV.js} +1 -1
- package/lib/esm/{browser-NNGET42K.js → browser-GRBSHXMN.js} +1 -1
- package/lib/esm/{chunk-SHEIERRZ.js → chunk-CPI6X7UJ.js} +1 -1
- package/lib/esm/{chunk-XIHMUHIU.js → chunk-FLFBEGLN.js} +1 -1
- package/lib/esm/{chunk-GRB6RQHB.js → chunk-HBL5RRXD.js} +1 -1
- package/lib/esm/chunk-KPW4CO5D.js +1 -0
- package/lib/esm/{chunk-DJA7HTCQ.js → chunk-ZQUOGXWB.js} +1 -1
- package/lib/esm/{chunk-5KTGEHHQ.js → chunk-ZXWC3C7V.js} +1 -1
- package/lib/esm/index.d.ts +1542 -1429
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-37P22AMI.js → inspector-FBXPZPC4.js} +1 -1
- package/lib/esm/{internal-U3D35TTR.js → internal-BZ4ZKZ7Z.js} +1 -1
- package/lib/esm/{outdoor-context-v4-XREJJ7S4.js → outdoor-context-v4-YKREXFAR.js} +1 -1
- package/lib/esm/{text3d-FOTKVKS4.js → text3d-TO4ISQF2.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-VFSIFWYP.js +0 -1
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as V,j as E,k}from"./chunk-
|
|
1
|
+
import{i as V,j as E,k}from"./chunk-KPW4CO5D.js";import{c as x,k as A}from"./chunk-CPI6X7UJ.js";import"./chunk-FLFBEGLN.js";import"./chunk-ZXWC3C7V.js";import"./chunk-ZQUOGXWB.js";import{a}from"./chunk-HBL5RRXD.js";import{a as n}from"./chunk-J5IUISYU.js";a();a();import U,{useCallback as Y,useMemo as $}from"react";import{useContext as C,useEffect as T,useRef as S,useState as D}from"react";import{createPortal as q}from"react-dom";a();import{createContext as I,useContext as z}from"react";a();var L=class L extends Error{constructor(t){super("".concat(t," must be used within a MapView component."))}};n(L,"MapViewNullError");var m=L;var p=I({mapData:void 0,mapView:void 0});function F(){let{mapData:e,mapView:t}=z(p);if(!e||!t)throw new m("useMap");return{mapData:e,mapView:t}}n(F,"useMap");a();import{useEffect as G}from"react";function s(e,t){G(()=>{t!=null&&typeof e=="function"&&e(t)},[e,t])}n(s,"useOnLoad");function O(e){let{mapView:t}=C(p),r=S(),[o,i]=D(null);return T(()=>{if(t==null)throw new m("Marker");return r.current=t.Markers.add(e.target,"",{...e.options,dynamicResize:!0}),i(r.current),()=>{t==null||r.current==null||t.Markers.remove(r.current)}},[t,e.target]),T(()=>{o&&(t==null||t.updateState(o,{...e.options}))},[e.options]),s(e.onLoad,o),t==null||o==null?null:q(e.children,o.contentEl,o.id)}n(O,"Marker");function B(e){let{mapView:t}=C(p),[r,o]=D(null),i=S(A()),u=S(e.target),f=Y(l=>{var M;o(l),(M=e.onLoad)==null||M.call(e,l)},[e.onLoad]);T(()=>{if(t==null)throw new m("Marker");if(r&&r.target!==e.target){let{duration:l=300,easing:M="linear"}=e;t.Markers.animateTo(r,e.target,{duration:l,easing:M})}},[t,e.target,r]);let c=$(()=>({...e,duration:void 0,easing:void 0}),[e.duration,e.easing]);return U.createElement(O,{...c,key:i.current,target:u.current,onLoad:f})}n(B,"AnimatedMarker");a();import{useContext as J,useEffect as R,useRef as K,useState as Q}from"react";function X(e){let{mapView:t}=J(p),r=K(),[o,i]=Q(void 0);return R(()=>{if(t==null)throw new m("Label");return r.current=t.Labels.add(e.target,e.text,e.options),i(r.current),()=>{t==null||r.current==null||t.Labels.remove(r.current)}},[t,e.target]),R(()=>{r.current&&(t==null||t.updateState(r.current,{text:e.text,...e.options}))},[e.text,e.options]),s(e.onLoad,o),null}n(X,"Label");a();import{useCallback as Z,useContext as _,useEffect as ee}from"react";function te(e,t){let{mapView:r}=_(p),o=Z(i=>t(i),[t]);ee(()=>{if(r==null)throw new m("useEvent");return r.on(e,o),()=>{r!=null&&r.off(e,o)}},[r,e,t])}n(te,"useEvent");a();import{useContext as re,useEffect as ae,useRef as oe,useState as ne}from"react";function ie(e){let{mapView:t}=re(p),r=oe(),[o,i]=ne(void 0);return ae(()=>{if(t==null)throw new m("Path");let u=t.Paths.add(e.coordinate,e.options);return u.animation.then(()=>{var f;(f=e.onDrawComplete)==null||f.call(e)}),i(u),r.current=u,()=>{r.current&&t.Paths.remove(r.current)}},[t,e.coordinate,e.options]),s(e.onLoad,o),null}n(ie,"Path");a();import w,{useCallback as pe,useEffect as me,useMemo as se,useRef as j,useState as W}from"react";var de={width:"100%",height:"100%",position:"relative"};function ue(e){let{mapData:t,options:r,style:o,fallback:i,children:u,...f}=e,c=j(!1),[l,M]=W(void 0),[h,P]=W(!0),y=j(null),b=se(()=>r,[]),v=pe(()=>{if(t&&(y!=null&&y.current)){if(l)return;E(y.current,t,b).then(g=>{M(g)}).catch(g=>{x.error("Failed to render MapView",g)}).finally(()=>{P(!1)})}},[t,y.current,b]);return me(()=>{c.current||(c.current=!0,v())},[v]),s(e.onLoad,l),w.createElement(p.Provider,{value:{mapData:t,mapView:l}},w.createElement("div",{"data-testid":"mappedin-map",ref:y,style:{...de,...o},...f}),h?w.createElement(w.Fragment,null,i):u)}n(ue,"MapView");a();import{useContext as le,useEffect as H,useState as fe}from"react";function ce(e){let{mapView:t}=le(p),[r,o]=fe(!1);return H(()=>{if(t==null)throw new m("Navigation");return t.Navigation.draw(e.directions,e.options).then(()=>{var i;o(!0),(i=e.onDrawComplete)==null||i.call(e)}),()=>{t.Navigation.clear()}},[t,e.directions,e.options]),H(()=>{r!==!1&&typeof e.onLoad=="function"&&e.onLoad()},[e.onLoad,r]),null}n(ce,"Navigation");a();import{useContext as Me,useEffect as Pe,useRef as ye,useState as he}from"react";function xe(e){let{mapView:t}=Me(p),r=ye(),[o,i]=he(void 0);return Pe(()=>{if(t==null)throw new Error("MapView not initialized");return r.current=t.Shapes.add(e.geometry,e.style,e.floor),i(r.current),()=>{t==null||r.current==null||t.Shapes.remove(r.current)}},[t,e.geometry,e.style,e.floor]),s(e.onLoad,o),null}n(xe,"Shape");a();import{useContext as we,useEffect as ge,useRef as Le,useState as Te}from"react";function Se(e){let{mapView:t}=we(p),r=Le(),[o,i]=Te(void 0);return ge(()=>{if(t==null)throw new m("Model");return r.current=t.Models.add(e.models,e.options),i(r.current),()=>{if(!(t==null||r.current==null))for(let u of r.current)t.Models.remove(u)}},[t,e.models,e.options]),s(e.onLoad,o),null}n(Se,"Model");a();import{useCallback as Ne,useEffect as be,useMemo as ve,useRef as Ae,useState as N}from"react";function Ve(e){let[t,r]=N(void 0),[o,i]=N(!0),[u,f]=N(void 0),c=Ae(0),l=ve(()=>e,[]),M=Ne(()=>{let h=++c.current;i(!0),f(void 0),V(l).then(P=>{c.current===h&&r(P)}).catch(P=>{c.current===h&&(x.error("Failed to fetch MapData",P),f(P))}).finally(()=>{c.current===h&&i(!1)})},[l]);return be(()=>{M()},[M]),{mapData:t,isLoading:o,error:u}}n(Ve,"useMapData");var Xt=k;export{B as AnimatedMarker,X as Label,ue as MapView,O as Marker,Se as Model,ce as Navigation,ie as Path,xe as Shape,Xt as default,te as useEvent,F as useMap,Ve as useMapData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Et,c as J,f as D,g as W,h as _t}from"./chunk-VFSIFWYP.js";import{j as U}from"./chunk-SHEIERRZ.js";import"./chunk-XIHMUHIU.js";import"./chunk-5KTGEHHQ.js";import{N as Mt}from"./chunk-DJA7HTCQ.js";import{a as C}from"./chunk-GRB6RQHB.js";import{a,f as T,g as x,h as S,i as kt,j as G}from"./chunk-J5IUISYU.js";C();C();C();C();var P=class P{constructor(t,o,e,n,s="div"){this.parent=t,this.object=o,this.property=e,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),P.nextNameID=P.nextNameID||0,this.$name.id="lil-gui-name-".concat(++P.nextNameID),this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",r=>r.stopPropagation()),this.domElement.addEventListener("keyup",r=>r.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(e)}name(t){return this._name=t,this.$name.textContent=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled?this:(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t),this)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){let o=this.parent.add(this.object,this.property,t);return o.name(this._name),this.destroy(),o}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.getValue()!==t&&(this.object[this.property]=t,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}};a(P,"Controller");var L=P,at=class at extends L{constructor(t,o,e){super(t,o,e,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};a(at,"BooleanController");var et=at;function it(i){let t,o;return(t=i.match(/(#|0x)?([a-f0-9]{6})/i))?o=t[2]:(t=i.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?o=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=i.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(o=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),o?"#"+o:!1}a(it,"normalizeColorString");var Xt={isPrimitive:!0,match:i=>typeof i=="string",fromHexString:it,toHexString:it},H={isPrimitive:!0,match:i=>typeof i=="number",fromHexString:i=>parseInt(i.substring(1),16),toHexString:i=>"#"+i.toString(16).padStart(6,0)},Kt={isPrimitive:!1,match:i=>Array.isArray(i),fromHexString(i,t,o=1){let e=H.fromHexString(i);t[0]=(e>>16&255)/255*o,t[1]=(e>>8&255)/255*o,t[2]=(e&255)/255*o},toHexString([i,t,o],e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return H.toHexString(n)}},Zt={isPrimitive:!1,match:i=>Object(i)===i,fromHexString(i,t,o=1){let e=H.fromHexString(i);t.r=(e>>16&255)/255*o,t.g=(e>>8&255)/255*o,t.b=(e&255)/255*o},toHexString({r:i,g:t,b:o},e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return H.toHexString(n)}},Qt=[Xt,H,Kt,Zt];function qt(i){return Qt.find(t=>t.match(i))}a(qt,"getColorFormat");var lt=class lt extends L{constructor(t,o,e,n){super(t,o,e,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=qt(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=it(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){let o=this._format.fromHexString(t);this.setValue(o)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}};a(lt,"ColorController");var ot=lt,dt=class dt extends L{constructor(t,o,e){super(t,o,e,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}};a(dt,"FunctionController");var B=dt,ct=class ct extends L{constructor(t,o,e,n,s,r){super(t,o,e,"number"),this._initInput(),this.min(n),this.max(s);let l=r!==void 0;this.step(l?r:this._getImplicitStep(),l),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,o=!0){return this._step=t,this._stepExplicit=o,this}updateDisplay(){let t=this.getValue();if(this._hasSlider){let o=(t-this._min)/(this._max-this._min);o=Math.max(0,Math.min(o,1)),this.$fill.style.width=o*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let o=a(()=>{let v=parseFloat(this.$input.value);isNaN(v)||(this._stepExplicit&&(v=this._snap(v)),this.setValue(this._clamp(v)))},"onInput"),e=a(v=>{let w=parseFloat(this.$input.value);isNaN(w)||(this._snapClampSetValue(w+v),this.$input.value=this.getValue())},"increment"),n=a(v=>{v.key==="Enter"&&this.$input.blur(),v.code==="ArrowUp"&&(v.preventDefault(),e(this._step*this._arrowKeyMultiplier(v))),v.code==="ArrowDown"&&(v.preventDefault(),e(this._step*this._arrowKeyMultiplier(v)*-1))},"onKeyDown"),s=a(v=>{this._inputFocused&&(v.preventDefault(),e(this._step*this._normalizeMouseWheel(v)))},"onWheel"),r=!1,l,d,g,h,c,p=5,f=a(v=>{l=v.clientX,d=g=v.clientY,r=!0,h=this.getValue(),c=0,window.addEventListener("mousemove",u),window.addEventListener("mouseup",b)},"onMouseDown"),u=a(v=>{if(r){let w=v.clientX-l,O=v.clientY-d;Math.abs(O)>p?(v.preventDefault(),this.$input.blur(),r=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(w)>p&&b()}if(!r){let w=v.clientY-g;c-=w*this._step*this._arrowKeyMultiplier(v),h+c>this._max?c=this._max-h:h+c<this._min&&(c=this._min-h),this._snapClampSetValue(h+c)}g=v.clientY},"onMouseMove"),b=a(()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",b)},"onMouseUp"),y=a(()=>{this._inputFocused=!0},"onFocus"),m=a(()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()},"onBlur");this.$input.addEventListener("input",o),this.$input.addEventListener("keydown",n),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",f),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",m)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let t=a((m,v,w,O,R)=>(m-v)/(w-v)*(R-O)+O,"map"),o=a(m=>{let v=this.$slider.getBoundingClientRect(),w=t(m,v.left,v.right,this._min,this._max);this._snapClampSetValue(w)},"setValueFromX"),e=a(m=>{this._setDraggingStyle(!0),o(m.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",s)},"mouseDown"),n=a(m=>{o(m.clientX)},"mouseMove"),s=a(()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",s)},"mouseUp"),r=!1,l,d,g=a(m=>{m.preventDefault(),this._setDraggingStyle(!0),o(m.touches[0].clientX),r=!1},"beginTouchDrag"),h=a(m=>{m.touches.length>1||(this._hasScrollBar?(l=m.touches[0].clientX,d=m.touches[0].clientY,r=!0):g(m),window.addEventListener("touchmove",c,{passive:!1}),window.addEventListener("touchend",p))},"onTouchStart"),c=a(m=>{if(r){let v=m.touches[0].clientX-l,w=m.touches[0].clientY-d;Math.abs(v)>Math.abs(w)?g(m):(window.removeEventListener("touchmove",c),window.removeEventListener("touchend",p))}else m.preventDefault(),o(m.touches[0].clientX)},"onTouchMove"),p=a(()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",p)},"onTouchEnd"),f=this._callOnFinishChange.bind(this),u=400,b,y=a(m=>{if(Math.abs(m.deltaX)<Math.abs(m.deltaY)&&this._hasScrollBar)return;m.preventDefault();let w=this._normalizeMouseWheel(m)*this._step;this._snapClampSetValue(this.getValue()+w),this.$input.value=this.getValue(),clearTimeout(b),b=setTimeout(f,u)},"onWheel");this.$slider.addEventListener("mousedown",e),this.$slider.addEventListener("touchstart",h,{passive:!1}),this.$slider.addEventListener("wheel",y,{passive:!1})}_setDraggingStyle(t,o="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle("lil-gui-".concat(o),t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:o,deltaY:e}=t;return Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(o=0,e=-t.wheelDelta/120,e*=this._stepExplicit?1:10),o+-e}_arrowKeyMultiplier(t){let o=this._stepExplicit?1:10;return t.shiftKey?o*=10:t.altKey&&(o/=10),o}_snap(t){let o=Math.round(t/this._step)*this._step;return parseFloat(o.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){let t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}};a(ct,"NumberController");var nt=ct,ht=class ht extends L{constructor(t,o,e,n){super(t,o,e,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(n)}options(t){return this._values=Array.isArray(t)?t:Object.values(t),this._names=Array.isArray(t)?t:Object.keys(t),this.$select.replaceChildren(),this._names.forEach(o=>{let e=document.createElement("option");e.textContent=o,this.$select.appendChild(e)}),this.updateDisplay(),this}updateDisplay(){let t=this.getValue(),o=this._values.indexOf(t);return this.$select.selectedIndex=o,this.$display.textContent=o===-1?t:this._names[o],this}};a(ht,"OptionController");var rt=ht,ut=class ut extends L{constructor(t,o,e){super(t,o,e,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}};a(ut,"StringController");var st=ut,Vt='.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n background: var(--background-color);\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "\u2195";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "\u25BE";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "\u25B8";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui label, .lil-gui input, .lil-gui button {\n -webkit-tap-highlight-color: transparent;\n}\n.lil-gui input {\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n -moz-appearance: textfield;\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "\u2713";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: none;\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n }\n .lil-gui button:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}';function te(i){let t=document.createElement("style");t.innerHTML=i;let o=document.querySelector("head link[rel=stylesheet], head style");o?document.head.insertBefore(t,o):document.head.appendChild(t)}a(te,"_injectStyles");var Ft=!1,X=class X{constructor({parent:t,autoPlace:o=t===void 0,container:e,width:n,title:s="Controls",closeFolders:r=!1,injectStyles:l=!0,touchStyles:d=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",g=>{(g.code==="Enter"||g.code==="Space")&&(g.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),d&&this.domElement.classList.add("allow-touch-styles"),!Ft&&l&&(te(Vt),Ft=!0),e?e.appendChild(this.domElement):o&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this._closeFolders=r}add(t,o,e,n,s){if(Object(e)===e)return new rt(this,t,o,e);let r=t[o];switch(typeof r){case"number":return new nt(this,t,o,e,n,s);case"boolean":return new et(this,t,o);case"string":return new st(this,t,o);case"function":return new B(this,t,o)}console.error("gui.add failed\n property:",o,"\n object:",t,"\n value:",r)}addColor(t,o,e=1){return new ot(this,t,o,e)}addFolder(t){let o=new X({parent:this,title:t});return this.root._closeFolders&&o.close(),o}load(t,o=!0){return t.controllers&&this.controllers.forEach(e=>{e instanceof B||e._name in t.controllers&&e.load(t.controllers[e._name])}),o&&t.folders&&this.folders.forEach(e=>{e._title in t.folders&&e.load(t.folders[e._title])}),this}save(t=!0){let o={controllers:{},folders:{}};return this.controllers.forEach(e=>{if(!(e instanceof B)){if(e._name in o.controllers)throw new Error('Cannot save GUI with duplicate property "'.concat(e._name,'"'));o.controllers[e._name]=e.save()}}),t&&this.folders.forEach(e=>{if(e._title in o.folders)throw new Error('Cannot save GUI with duplicate folder "'.concat(e._title,'"'));o.folders[e._title]=e.save()}),o}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let o=this.$children.clientHeight;this.$children.style.height=o+"px",this.domElement.classList.add("transition");let e=a(s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",e))},"onTransitionEnd");this.$children.addEventListener("transitionend",e);let n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.textContent=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(e=>e.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(o=>{t=t.concat(o.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(o=>{t=t.concat(o.foldersRecursive())}),t}};a(X,"GUI");var z=X,K=z;C();C();var _=(()=>{let i=new Mt;return a(function(o){return i.set(o),"#".concat(i.getHexString())},"normalize")})();function St(i){let t;for(t of i)t()}a(St,"runAll");function pt(i,t){let o=window.location.href,e=new URL(o),n=new URLSearchParams(e.search);for(let s in i)if(i.hasOwnProperty(s)){let r="".concat(t,".").concat(s);n.set(r,i[s])}e.search=n.toString(),history.pushState({path:e.toString()},"",e.toString())}a(pt,"updateCurrentUrlParamsWithNamespace");function gt(i,t){let o=new URLSearchParams(window.location.search),e={};for(let[n,s]of o)if(n.startsWith("".concat(i,"."))){let r=n.slice(i.length+1);s==="true"||s==="false"?e[r]=s==="true":typeof(t==null?void 0:t[r])=="number"?e[r]=Number(s):e[r]=s}return{namespace:i,params:e}}a(gt,"getUrlParamsWithNamespace");var ee=["interactive"];function Z(i,t,o){var n,s;let e=o.addFolder("".concat(t.type,"-").concat(t.id));for(let r in t){if(r==="visible"&&e.add(t,r).onChange(l=>{i.updateState(t.id,{[r]:l})}),r==="color"||r==="hoverColor"){t[r]=_(t[r]),e.addColor(t,r).onChange(l=>{i.updateState(t.id,{[r]:l})});continue}if(r==="height"){e.add(t,r,0,20,1).onChange(l=>{i.updateState(t.id,{[r]:l})});continue}if(r==="texture"&&t.texture){(n=e.addFolder("Texture - side").add(t,"texture"))==null||n.onChange(d=>{i.updateState(t.id,{texture:{url:d}})});continue}if(r==="topTexture"&&t.topTexture){(s=e.addFolder("Texture - top").add(t,"topTexture"))==null||s.onChange(d=>{i.updateState(t.id,{topTexture:{url:d}})});continue}if(r==="opacity"){e.add(t,r,0,1,.1).onChange(l=>{i.updateState(t.id,{[r]:l})});continue}ee.includes(r)&&e.add(t,r).onChange(l=>{i.updateState(t.id,{[r]:l})})}return t.isInView&&(e.add(t,"isInView").listen().disable(),e.add(t,"isInViewCheck")),{cleanup(){e.destroy()}}}a(Z,"renderByProp");C();C();function ie(){let i=[];function t(n,s){var d;let r=Object.values(n.getMapData())[0],l=s;if(l&&J.is(l)){let g=(d=r.getByType("enterprise-location"))==null?void 0:d.find(h=>h.spaces.some(c=>c.id===l.id));g&&(l=g)}return l}a(t,"getHighlightTarget");async function o(n,s){return s instanceof W?n.Camera.focusOn(s.locations.flatMap(r=>r.spaces),j):s instanceof D?n.Camera.focusOn(s.spaces,j):n.Camera.focusOn(s,j)}a(o,"focusOn");function e(n,s,{focus:r=!1}={}){if(!window.enableHighlightCard)return()=>{};let l=t(n,s),d=document.createElement("div");if(d.style.cssText="\n position: absolute;\n top: 20px;\n left: 20px;\n background-color: rgba(30, 30, 30, 0.95);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n border-radius: 12px;\n padding: 24px;\n max-width: 320px;\n z-index: 1000;\n font-family: 'Arial', sans-serif;\n transition: all 0.3s ease;\n color: #e0e0e0;\n ","name"in l){let h=document.createElement("h3");h.textContent=l.name,h.style.cssText="\n margin: 0 0 16px;\n font-size: 22px;\n font-weight: 600;\n color: #ffffff;\n letter-spacing: -0.5px;\n ",d.appendChild(h)}if(l instanceof D){if(l.description){let h=document.createElement("p");h.textContent=l.description,h.style.cssText="\n margin: 0 0 16px;\n font-size: 14px;\n color: #b0b0b0;\n line-height: 1.5;\n ",d.appendChild(h)}if(l.tags&&l.tags.length>0){let h=document.createElement("div");h.style.cssText="\n display: flex;\n flex-wrap: nowrap;\n gap: 8px;\n margin-bottom: 16px;\n overflow-x: hidden;\n max-height: 30px; /* Adjust this value based on your font size and padding */\n ",l.tags.forEach(c=>{let p=document.createElement("span");p.textContent=c,p.style.cssText="\n background-color: #3a3a3a;\n color: #e0e0e0;\n padding: 6px 12px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n white-space: nowrap;\n ",h.appendChild(p)}),d.appendChild(h)}}let g;if(!(s instanceof W)){let h=new K({autoPlace:!1});h.domElement.style.cssText="\n position: relative;\n overflow-y: auto;\n margin-top: 16px;\n border-top: 1px solid #444;\n padding-top: 16px;\n ";let c=n.getState(s);c&&(Z(n,{id:s.id,...c},h),d.appendChild(h.domElement)),g=h}return document.body.appendChild(d),r&&o(n,l),()=>{d.style.opacity="0",d.style.transform="translateY(-10px)",setTimeout(()=>d.remove(),300),g==null||g.destroy()}}return a(e,"highlightCard"),{highlightCard:e,highlight:(n,s,{focus:r=!0}={})=>{i.length>0&&i.forEach(d=>n.Markers.remove(d));let l=t(n,s);if(l instanceof D)r&&n.Camera.focusOn(l.spaces,j),i.push(...l.spaces.map(d=>n.Markers.add(d,'<div style="padding: 15px; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); max-width: 250px; position: relative;">\n <h3 style="margin: 0 0 10px; color: #333; font-size: 16px; font-weight: 600;">'.concat(l.name,"</h3>\n ").concat(l.description?'<p style="margin: 0 0 10px; color: #666; font-size: 14px; font-weight: 400;">'.concat(l.description,"</p>"):"","\n ").concat(l.tags?l.tags.map(g=>'<span style="display: inline-block; padding: 3px 8px; background-color: #e0f2f1; color: #00796b; border-radius: 12px; font-size: 12px;">'.concat(g,"</span>")).join(" "):"",'\n <div style="position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #ffffff;"></div>\n </div>'),{rank:"always-visible",anchor:"top"})));else if(l instanceof W){r&&n.Camera.focusOn(l.locations.flatMap(h=>h.spaces),j);let d=new Map,g=new Set;l.locations.forEach(h=>{d.has(h.name)||(h.spaces.forEach(c=>{i.push(n.Markers.add(c,'<div style="padding: 12px; background-color: rgba(0, 153, 51, 0.95); border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); transform: translateY(-4px); transition: all 0.3s ease;">\n <span style="font-weight: 600; color: #FFFFFF; font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">'.concat(h.name,"</span>\n </div>"),{rank:"always-visible"}))}),d.set(h.name,!0))}),l.locations.forEach(h=>{h.coordinates.forEach(c=>{let p="".concat(c.latitude,",").concat(c.longitude);if(!g.has(p)&&!d.has(h.name)){let f=n.Markers.add(c,'<div style="padding: 10px; background-color: rgba(51, 102, 204, 0.9); border-radius: 6px; box-shadow: 0 3px 6px rgba(0,0,0,0.2);">\n <span style="font-weight: 500; color: #FFFFFF; font-size: 16px;">'.concat(h.name,'</span>\n <br>\n <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>\n </div>'),{rank:"always-visible"});g.add(p),i.push(f)}})})}return()=>{i.forEach(d=>n.Markers.remove(d))}}}}a(ie,"createHighlightControl");var j={duration:300,easing:"ease-in-out"},Q=ie();C();var M={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function oe(i){i.add(M.options.places.fields,"name").name("Places: Name"),i.add(M.options.places.fields,"description").name("Places: Description"),i.add(M.options.places.fields,"link").name("Places: Link"),i.add(M.options.places.fields,"category").name("Places: Category"),i.add(M.options.places,"limit"),i.add(M.options.locations.fields,"name").name("Locations: Name"),i.add(M.options.locations.fields,"tag").name("Locations: Tag"),i.add(M.options.locations.fields,"description").name("Locations: Description"),i.add(M.options.places,"limit"),i.add(M.options.categories.fields,"name").name("Categories: Name")}a(oe,"createAdvancedSettings");function Lt(i,t,o){var h;let e=new U,n=o.addFolder("Search");n.open();let s=n.add(M,"search").onChange(async c=>{let p=await t.Search.query(c,M.options);p&&(M.results=p,l(p,e))}),r=document.createElement("div");r.style.marginLeft="10px",(h=s.domElement.parentElement)==null||h.appendChild(r);let{renderSearch:l,close:d}=ne(i,t,r,s.$input),g=n.addFolder("Advanced");return g.close(),oe(g),document.addEventListener("keydown",c=>{(c.metaKey||c.ctrlKey)&&c.key==="k"?(c.preventDefault(),n._closed&&n.open(),s.$input.focus()):c.key==="Escape"&&(d(),e.publish("highlight",void 0))}),{pubsub:e}}a(Lt,"createSearchControl");function ne(i,t,o,e){let n,s;e.addEventListener("input",async l=>{l instanceof InputEvent&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")&&(clearTimeout(n),n=setTimeout(async()=>{var g;let d=await t.Search.suggest(e.value);d&&d.length>0&&r((g=d[0])==null?void 0:g.suggestion)},100))});function r(l){if(!l){e.placeholder="";return}let d=e.value;e.value=l,e.setSelectionRange(d.length,l.length)}return a(r,"renderSuggestion"),{renderSearch(l,d){var g,h;if(l.places.length===0&&((g=l.enterpriseCategories)==null?void 0:g.length)===0&&((h=l.enterpriseLocations)==null?void 0:h.length)===0){o.textContent="No results found.";return}s=re(o,l,i,d)},close(){s.destroy()}}}a(ne,"mount");function re(i,t,o,e){i.innerHTML="";let n=document.createElement("div");Object.assign(n.style,q.dropdownContainer);let s=document.createElement("ul");s.className="options-list",Object.assign(s.style,q.optionsList),s.style.display="block";let r=[],l=a((p,f)=>{if(f&&f.length>0){let u=document.createElement("li");u.textContent=p,Object.assign(u.style,q.sectionHeader),s.appendChild(u),f.forEach((b,y)=>{let m=document.createElement("li");m.textContent="".concat("name"in b.item?b.item.name:""," (").concat(b.type,")"),Object.assign(m.style,q.option),m.tabIndex=0,m.addEventListener("focus",()=>{g(r.indexOf(m))}),m.addEventListener("mouseover",()=>{m.style.backgroundColor="#f0f0f0"}),m.addEventListener("mouseout",()=>{m.style.backgroundColor=""}),m.addEventListener("click",()=>{}),m.setAttribute("data-type",p),m.setAttribute("data-index",y.toString()),s.appendChild(m),r.push(m)})}},"addSection");l("enterpriseLocations",t.enterpriseLocations),l("enterpriseCategories",t.enterpriseCategories),l("Places",t.places),n.appendChild(s),i.appendChild(n);let d=[],g=a(p=>{d.forEach(m=>m()),d=[],r.forEach((m,v)=>{v===p?m.style.backgroundColor="#e0e0e0":m.style.backgroundColor=""});let f=r[p],u=f.getAttribute("data-type"),b=parseInt(f.getAttribute("data-index")||"0",10);if(!u)return;let{item:y}=t[u][b];e.publish("highlight",y)},"highlightOption"),h=a(p=>{!n.contains(p.target)&&p.target!==i&&c()},"handleClickOutside");document.addEventListener("click",h);let c=a(()=>{i.innerHTML="",document.removeEventListener("click",h)},"destroy");return{destroy(){i.innerHTML="",e.publish("highlight",void 0)}}}a(re,"createCustomDropdown");var q={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function $t(i,t,o){o.domElement.id="interactionPanel";let e=[],{pubsub:n}=Lt(i,t,o);n.on("highlight",h=>{if(h){e.forEach(p=>p()),e=[];let c=h instanceof D?h.spaces[0]:h;if(c&&!J.is(c))return;e.push(Q.highlightCard(i,c,{focus:!0}))}else e.forEach(c=>c()),e=[]});let s=o.addFolder("Click \u{1F447}").close(),{sub:r}=se(i,s);r.on("click",h=>{e.forEach(c=>c()),e=[],h.spaces[0]&&(e=[Q.highlightCard(i,h.spaces[0])])});let l=o.addFolder("Hover \u{1F681}").close(),{sub:d}=ae(i,l),g;d.on("hover",h=>{h.spaces[0]?(g==null||g(),e.length===0&&(g=Q.highlightCard(i,h.spaces[0]))):(g==null||g(),g=void 0)})}a($t,"createInteractionControls");function se(i,t){let o=new U,e={position:"",hoverColor:_(i.getHoverColor())},n=t.add(e,"position").disable(),s=[];function r(){s.forEach(d=>d()),s.length=0}a(r,"reset");let l=0;return i.on("click",d=>{var u;let{labels:g,markers:h,coordinate:c}=d;r(),o.publish("click",d),clearInterval(l),n.load(JSON.stringify([c.longitude,c.latitude]));let p=g[0]||h[0];if(p){let b=mt(i,p,t);if(!b)return;s.push(b.destroy),b.labelItemFolder.openAnimated()}let f=(u=d.spaces[0])!=null?u:d.objects[0];if(f){let b={id:f.id,...i.getState(f.id),type:f.type,isInView:!1,isInViewCheck:ft(i,f.id)},{cleanup:y}=Z(i,b,t);l=setInterval(()=>{b.isInView=i.isInView(p||f)},500),s.push(y)}}),{sub:o}}a(se,"createClickControls");function ae(i,t){let o=new U;i.setHoverColor("#1f3a7a");let e={position:"",hoverColor:_(i.getHoverColor()),intersected:"",type:"",id:""},n=t.add(e,"position").disable();t.add(e,"id").disable().listen(),t.add(e,"type").disable().listen(),t.addColor(e,"hoverColor").onChange(l=>{i.setHoverColor(l)});let s=[];function r(){s.forEach(l=>l()),s.length=0}return a(r,"reset"),i.on("hover",l=>{var b,y,m;let{coordinate:d,spaces:g,objects:h,markers:c,labels:p}=l;r(),o.publish("hover",l),n.load(JSON.stringify([d.longitude,d.latitude]));let f=(m=(y=(b=g[0])!=null?b:h[0])!=null?y:c[0])!=null?m:p[0];if(!f)return;let u=i.getState(f);u&&(e.type=u.type,e.id=f.id)}),{sub:o}}a(ae,"createHoverControls");function ft(i,t){return a(function(){console.log("isInView",i.isInView(t))},"isInView")}a(ft,"createIsInViewHandler");function It(i,t,o){let e={labels:{},all(){o.Labels.all().forEach(f=>{this.labels[f.id]=f}),d()},removeAllLabels(){o.Labels.removeAll().forEach(f=>{delete this.labels[f.id]}),d()}},{addLabel:n,destroy:s}=le(i,o);i.add(e,"all"),i.add(e,"removeAllLabels");let r=i.addFolder("Label List");i.close();let l=new Map,{rerender:d}=g();function g(){function p(b){var y;delete e.labels[b.id],(y=l.get(b.id))==null||y.destroy()}a(p,"remove");function f(b){let y=mt(o,b,r,{onRemove:v=>{p(v)}});if(!y)return;let{labelItemFolder:m}=y;l.set(b.id,m)}a(f,"add");function u(){r.destroy(),r=i.addFolder("Label");for(let b in e.labels){let y=e.labels[b];f(y)}}return a(u,"rerender"),{rerender:u,add:f,remove:p}}a(g,"createLabelControls"),i.domElement.classList.add("list-items");let h;o.on("click",({labels:p,coordinate:f})=>{if(!i._closed)if(p[0]){h==null||h.close();let u=l.get(p[0].id);if(i.open(),!u)return;u==null||u.open(),u==null||u.domElement.scrollIntoView({block:"start"}),u==null||u.domElement.focus(),h=u}else n(f)});function c(p){for(let f of p)e.labels[f.id]=f;d()}return a(c,"populatelabels"),{populatelabels:c,destroy(){s()}}}a(It,"createLabelControls");function mt(i,t,o,{onRemove:e}={}){var g,h,c,p;let n=o.addFolder("".concat((g=t.text)==null?void 0:g.substring(0,12)));n.onChange(f=>{i.updateState(t,{appearance:d.appearance,interactive:d.interactive})}),n.close();let s=i.getState(t);if((s==null?void 0:s.type)!=="label")throw new Error("error getting state for label: ".concat(t.id));let{appearance:r,interactive:l}=s;if(!r||r.margin==null||l==null)throw new Error("incomplte label state");let d={text:t.text,interactive:l,appearance:{...r,margin:r.margin||0,marker:{foregroundColor:(c=(h=r.marker)==null?void 0:h.foregroundColor)!=null&&c.active?_((p=r.marker.foregroundColor)==null?void 0:p.active):"black"},text:{foregroundColor:_(r.text.foregroundColor)}},remove(){i.Labels.remove(t),e==null||e(t),n.destroy()},isInView:ft(i,t.id)};return n.add(d.appearance,"margin",0,20).name("margin"),n.add(d,"text"),n.add(d,"interactive"),n.addColor(d.appearance.marker,"foregroundColor").name("marker foreground"),n.addColor(d.appearance.text,"foregroundColor").name("text forground"),n.add(d,"isInView"),n.add(d,"remove"),{labelItemFolder:n,destroy(){n.destroy()}}}a(mt,"addLabelControlToFolder");function le(i,t){let o=i.addFolder("Add"),e={onClick:!1,margin:0,text:"New Label!",interactive:!0,marginForegroundColor:_("skyblue"),marginBackgroundColor:_("coral"),textForegroundColor:_("slategray"),textBackgroundColor:_("white")};return o.add(e,"onClick"),o.add(e,"margin"),o.add(e,"interactive"),o.add(e,"text"),o.addColor(e,"marginForegroundColor"),o.addColor(e,"marginBackgroundColor"),o.addColor(e,"textForegroundColor"),o.addColor(e,"textBackgroundColor"),{destroy(){o.destroy()},addLabel(n){return o._closed||!e.onClick?void 0:t.Labels.add(n,e.text,{appearance:{margin:e.margin,marker:{foregroundColor:{active:e.marginForegroundColor,inactive:e.marginForegroundColor},backgroundColor:{active:e.marginBackgroundColor,inactive:e.marginBackgroundColor}},text:{foregroundColor:e.textForegroundColor,backgroundColor:e.marginBackgroundColor}},interactive:e.interactive})}}}a(le,"createAddControl");var Ot={};C();var Tt="camera-ui";function Dt(i,t,o){var R,At;let e=i.addFolder("Camera \u{1F4F7}").onOpenClose(A=>{pt({opened:!A._closed},Tt)}),{params:n}=gt(Tt);n.opened||e.close();let s=t.Camera.center.toJSON(),r=document.createElement("div");Object.assign(r.style,{display:"none",position:"absolute",left:"0px",top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),document.body.appendChild(r);let[l,d,g,h]=(R=o==null?void 0:o.padding)!=null?R:[],c={center_lat:s.latitude,center_lon:s.longitude,zoomLevel:t.Camera.zoomLevel,pitch:t.Camera.pitch,bearing:t.Camera.bearing,minZoomLevel:t.Camera.minZoomLevel,maxZoomLevel:t.Camera.maxZoomLevel,inset_type:"pixel",inset_top:l!=null?l:0,inset_left:h!=null?h:0,inset_right:d!=null?d:0,inset_bottom:g!=null?g:0,animateOnLoad:!0,persist:()=>{pt(e.save().controllers,"camera"),navigator.clipboard.writeText(window.location.href)},visualizeInset:!!(l||d||g||h),"Focus on click":(At=o==null?void 0:o.focusOnClick)!=null?At:!0,"Focus on current floor":()=>{t.Camera.focusOn([t.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function p(){c.inset_type==="portion"?Object.assign(r.style,{left:c.inset_left*u+"px",top:c.inset_top*f+"px",bottom:c.inset_bottom*f+"px",right:c.inset_right*u+"px"}):Object.assign(r.style,{left:c.inset_left+"px",top:c.inset_top+"px",bottom:c.inset_bottom+"px",right:c.inset_right+"px"})}a(p,"updateInsetVisualizer"),e.add(c,"center_lat").listen().disable(),e.add(c,"center_lon").listen().disable(),e.add(c,"zoomLevel",16,22,.5).listen().disable(),e.add(c,"pitch").listen().disable(),e.add(c,"bearing").listen().disable(),e.add(c,"minZoomLevel",5,22,.5).onChange(A=>{t.Camera.setMinZoomLevel(A)}),e.add(c,"maxZoomLevel",10,22,.5).onChange(A=>{t.Camera.setMaxZoomLevel(A)}),e.add(c,"animateOnLoad"),e.add(c,"visualizeInset").onChange(O),O(c.visualizeInset);let{innerHeight:f,innerWidth:u}=window;e.add(c,"inset_type",["pixel","portion"]).onChange(w),e.add(c,"inset_top",0,f).onChange(w),e.add(c,"inset_bottom",0,f).onChange(w),e.add(c,"inset_left",0,u).onChange(w),e.add(c,"inset_right",0,u).onChange(w);let b=ce(t);e.add(c,"Focus on click").onChange(A=>{A?t.on("click",b):t.off("click",b)}),c["Focus on click"]&&t.on("click",b),e.add(c,"persist"),e.add(c,"Focus on current floor");let y=a(A=>{e._closed||(c.center_lat=A.center.latitude,c.center_lon=A.center.longitude,c.zoomLevel=A.zoomLevel,c.bearing=A.bearing,c.pitch=A.pitch)},"onCameraChanged");t.on("camera-change",y);let{params:m}=gt("camera",c);if(Object.keys(m).length>0){let A=m;t.Camera.setScreenOffsets({top:A.inset_top,left:A.inset_left,right:A.inset_right,bottom:A.inset_bottom,type:A.inset_type});let wt={pitch:A.pitch,center:new Et(A.center_lat,A.center_lon),bearing:A.bearing,zoomLevel:A.zoomLevel};A.animateOnLoad?t.Camera.animateTo(wt):t.Camera.set(wt),e.load({controllers:A,folders:{}}),p()}let v=[()=>{t.off("camera-change",y)}];function w(){t.Camera.setScreenOffsets({top:c.inset_top,left:c.inset_left,right:c.inset_right,bottom:c.inset_bottom,type:c.inset_type}),p()}a(w,"updateInset"),(c.inset_top||c.inset_right||c.inset_bottom||c.inset_left)&&w();function O(A){A?r.style.display="block":r.style.display="none"}return a(O,"visualizeInsetUpdated"),()=>({destroy(){e.destroy(),St(v)}})}a(Dt,"createCameraControls");function ce(i){return a(function(o){var r;let{spaces:e,objects:n}=o,s=(r=e[0])!=null?r:n[0];s&&i.Camera.focusOn(s)},"handler")}a(ce,"createHandler");C();function Pt(i,t,o){let e={markers:{},removeAllMarkers(){o.Markers.removeAll().forEach(f=>{delete this.markers[f.id]}),d()}},{addMarker:n,destroy:s}=ue(i,o);i.add(e,"removeAllMarkers");let r=i.addFolder("Marker List");i.close();let l=new Map,{rerender:d}=g();function g(){function p(b){var y;delete e.markers[b.id],(y=l.get(b.id))==null||y.destroy()}a(p,"remove");function f(b){let y=he(o,b,r,{onRemove:v=>{p(v)}});if(!y)return;let{markerItemFolder:m}=y;l.set(b.id,m)}a(f,"add");function u(){r.destroy(),r=i.addFolder("marker");for(let b in e.markers){let y=e.markers[b];f(y)}}return a(u,"rerender"),{rerender:u,add:f,remove:p}}a(g,"createMarkerControls"),i.domElement.classList.add("list-items");let h;o.on("click",({markers:p,coordinate:f})=>{if(!i._closed)if(p[0]){h==null||h.close();let u=l.get(p[0].id);if(i.open(),!u)return;u==null||u.open(),u==null||u.domElement.scrollIntoView({block:"start"}),u==null||u.domElement.focus(),h=u}else n(f)});function c(p){for(let f of p)e.markers[f.id]=f;d()}return a(c,"populateMarkers"),{populateMarkers:c,destroy(){s()}}}a(Pt,"createMarkerControls");function he(i,t,o,{onRemove:e}={}){let n=o.addFolder("".concat(t.id.toString().substring(0,8)));n.onChange(d=>{i.updateState(t,{interactive:l.interactive})}),n.close();let s=i.getState(t);if((s==null?void 0:s.type)!=="marker")throw new Error("error getting state for marker: ".concat(t.id));let{interactive:r}=s;if(r==null)throw new Error("incomplte label state");let l={interactive:r,remove(){i.Markers.remove(t),e==null||e(t),n.destroy()}};return n.add(l,"interactive"),n.add(l,"remove"),{markerItemFolder:n,destroy(){n.destroy()}}}a(he,"addMarkerControlToFolder");function ue(i,t){let o=i.addFolder("Add"),e={onClick:!1,interactive:!0};return o.add(e,"onClick"),o.add(e,"interactive"),{destroy(){o.destroy()},addMarker(n){return o._closed||!e.onClick?void 0:t.Markers.add(n,"<div>New Marker</div>",{interactive:e.interactive})}}}a(ue,"createAddControl");C();function zt(i,t){let o=i.addFolder("Walls").close(),e={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};o.add(e,"visible").onChange(r=>{t.updateState("walls",{visible:r})}),o.addColor(e,"topColor").onChange(r=>{t.updateState("walls",{topColor:r})}),o.addColor(e,"color").onChange(r=>{t.updateState("walls",{color:r})}),o.addFolder("Texture - side").add(e.texture,"url").onFinishChange(r=>{t.updateState("walls",{texture:{url:r}})}),o.addFolder("Texture - top").add(e.topTexture,"url").onFinishChange(r=>{t.updateState("walls",{topTexture:{url:r}})}),t.updateState("walls",{topColor:e.topColor}),t.updateState("walls",{color:e.color})}a(zt,"createGeometryControl");C();function Gt(i,t,o){var s,r;i.close();let e={language:(r=(s=o.currentLanguage)==null?void 0:s.code)!=null?r:"en"},n=o.getByType("enterprise-venue");i.add(e,"language",n==null?void 0:n.languages.map(l=>l.code)).onChange(l=>{o.changeLanguage(l)})}a(Gt,"createMiscControl");C();function Ut(i,t,o){let e=i.addFolder("Debug");e.close();let n={showPolygonLabelTextAreaMesh:!1};e.add(n,"showPolygonLabelTextAreaMesh").onChange(s=>{t.Debug.update({showPolygonLabelTextAreaMesh:s})}).name("Show Flat Label Text Area Mesh"),t.Debug.update(n)}a(Ut,"createDebugControl");C();function Bt(i,t,o){let e=i.addFolder("Text3D").close(),n={all:()=>{t.Text3D.labelAll()},removeAll:()=>{t.Text3D.removeAll()}};e.add(n,"all").name("Show All"),e.add(n,"removeAll").name("Remove All")}a(Bt,"createText3DControl");C();C();C();var F,Y,$,k,I,V,Ht,N,vt,tt,jt,yt=class yt{constructor(t=new z({autoPlace:!0})){S(this,V);S(this,N);S(this,tt);S(this,F,void 0);S(this,Y,[]);S(this,$,{});S(this,k,{});S(this,I,{});kt(this,F,t),x(this,F).domElement.style.left="0"}add(t,o,e){if(x(this,k)[t])throw new Error("Control ".concat(t," already exists"));x(this,$)[t]=o,x(this,I)[t]=o.default,G(this,V,Ht).call(this,t,o,e),this.show()}addColor(t,o,e){if(x(this,k)[t])throw new Error("Control ".concat(t," already exists"));x(this,$)[t]=o,x(this,I)[t]=o.default,G(this,tt,jt).call(this,t,o,e),this.show()}update(t,o){if(!x(this,k)[t])throw new Error("Control ".concat(t," does not exist"));x(this,k)[t].setValue(o),x(this,$)[t].onChange&&x(this,$)[t].onChange(o,t)}replace(t,o,e){if(!x(this,k)[t]){this.add(t,o,e);return}o.args&&x(this,k)[t].options(o.args),o.default&&x(this,k)[t].setValue(o.default),o.onChange&&x(this,k)[t].onChange(n=>{o.onChange(n,t)})}remove(t){if(!x(this,k)[t])throw new Error("Control ".concat(t," does not exist"));x(this,k)[t].destroy(),x(this,k)[t].parent.children.length===0&&x(this,k)[t].parent.hide(),delete x(this,k)[t],delete x(this,$)[t],delete x(this,I)[t]}show(){x(this,F).show()}hide(){x(this,F).hide()}removeAll(){for(let t in x(this,k))this.remove(t)}destroy(){x(this,F).destroy()}};F=new WeakMap,Y=new WeakMap,$=new WeakMap,k=new WeakMap,I=new WeakMap,V=new WeakSet,Ht=a(function(t,o,e){let s=G(this,N,vt).call(this,e).add(x(this,I),t,o.args,o.max,o.step);o.onChange&&s.onChange(r=>{o.onChange(r,t)}),o.onAdd&&o.onAdd(o.default,t),x(this,k)[t]=s},"#addControl"),N=new WeakSet,vt=a(function(t){if(!t)return x(this,F);let o=x(this,Y).find(e=>e._title===t);return o?(o.show(),o):(o=x(this,F).addFolder(t),x(this,Y).push(o),o)},"#getFolder"),tt=new WeakSet,jt=a(function(t,o,e){let s=G(this,N,vt).call(this,e).addColor(x(this,I),t);o.onChange&&s.onChange(r=>{o.onChange(r,t)}),x(this,k)[t]=s},"#addColorControl"),a(yt,"GUI");var bt=yt;function pe(i,t,o){var l;let e={},n=i.getByType("floor"),s=i.getByType("floor-stack");s.length>1&&(e.FloorStack={default:t.currentFloorStack.id,args:s.reduce((d,{id:g,name:h})=>({...d,[h]:g}),{}),onChange:d=>{d!==t.currentFloorStack.id&&(t.setFloorStack(d),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((g,{id:h,name:c})=>({...g,[c]:h}),{})}))}}),n.length>1&&(e.Floor={default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((d,{id:g,name:h})=>({...d,[h]:g}),{}),onChange:d=>{d!==t.currentFloor.id&&t.setFloor(d)},onAdd:()=>{t.on("floor-change",d=>{d!=null&&d.floor.id&&(o.replace("FloorStack",{default:t.currentFloorStack.id}),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((h,{id:c,name:p})=>({...h,[p]:c}),{})}))})}});let r=i.getByType("enterprise-venue");return r&&r.languages.length>1&&(e.Language={default:((l=i.currentLanguage)==null?void 0:l.code)||r.languages[0].code,args:r.languages.reduce((d,{code:g,name:h})=>({...d,[h]:g}),{}),onChange:d=>{i.changeLanguage(d)}}),e}a(pe,"createDefaultControls");function Yt(i,t,o=new z){let e=new bt(o),n=pe(i,t,e);Object.keys(n).length||e.hide();for(let s in n)e.add(s,n[s]);return e}a(Yt,"createGUI");async function Nt(i,t,{initialfloorsInStack:o,root:e,floorsInDirections:n,showLabelsPerFloor:s=!0}){async function r(u){i.StackedMaps.changeFloorOnElevationChanges(!1),i.Outdoor.setOpacity(.15),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),await i.Camera.focusOn(u,{pitch:10})}a(r,"zoomToFloor");async function l(){i.Outdoor.setOpacity(.25),i.StackedMaps.changeFloorOnElevationChanges(!0),i.Camera.setPanMode("elevation"),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.focusOn(i.currentFloor,{axisAlignedPadding:{vertical:d},pitch:90})}a(l,"showCurrentFloorWithPadding");let d=50;async function g(u){await i.Camera.animateElevation(u.elevation*d)}a(g,"scrollToFloor");let h=i.currentFloor;i.on("floor-change",async u=>{i.StackedMaps.expanded&&u.reason!=="stacked-maps-elevation-change"&&(i.StackedMaps.changeFloorOnElevationChanges(!1),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.focusOn(h,{axisAlignedPadding:{vertical:d},pitch:90,duration:500}),i.StackedMaps.changeFloorOnElevationChanges(!0),await g(i.currentFloor),await r(i.currentFloor),i.StackedMaps.setFloorVisiblityMode("only-current-floor")),h=i.currentFloor}),i.on("stacked-maps-state-change",({state:u})=>{console.log("stacked-maps-state-change",u)});let c=t.getByType("space");if(s){let u=c.reduce((b,y)=>(b.has(y.floor)||b.set(y.floor,[]),y.name&&y.name!==""&&b.get(y.floor).push(i.Labels.add(y,y.name)),b),new Map);i.on("floor-change",()=>{u.forEach((b,y)=>{b.forEach(m=>{i.updateState(m,{enabled:i.currentFloor===y})})})})}let p=Yt(t,i,e),f=o!=null?o:[];return p.add("Expand - All",{default:async()=>{i.Outdoor.setOpacity(.25),f=t.getByType("floor"),await i.Camera.animateTo({pitch:90}),await i.StackedMaps.collapse(),await i.StackedMaps.expand({distanceBetweenFloors:d})}},"Stack Maps"),n&&p.add("Expand - Only Navigation",{default:async()=>{i.Outdoor.setOpacity(.25),f=n,await i.StackedMaps.collapse(),i.setFloor(n[0]),await i.StackedMaps.expand({includedFloors:n,distanceBetweenFloors:20})}},"Stack Maps"),p.add("Show All Floors",{default:async()=>{f=t.getByType("floor"),i.Outdoor.setOpacity(.25),i.StackedMaps.setFloorVisiblityMode("all-floors"),i.StackedMaps.changeFloorOnElevationChanges(!1),i.Camera.setPanMode("elevation"),i.Camera.focusOn(f,{pitch:90})}},"Stack Maps"),p.add("Show Current Floor with padding",{default:async()=>{await l()}},"Stack Maps"),p.add("Zoom to Current Floor",{default:async()=>{r(i.currentFloor)}},"Stack Maps"),p.add("Collapse",{default:()=>{i.Outdoor.setOpacity("initial"),i.StackedMaps.collapse()}},"Stack Maps"),p.add("Default",{default:async()=>{i.Camera.setPanMode("default")}},"Camera Pan Mode"),p.add("Elevation",{default:async()=>{i.Camera.setPanMode("elevation")}},"Camera Pan Mode"),p.add("zoom in to floor 2",{default:async()=>{i.Outdoor.setOpacity(.25),console.log(i.currentFloor.name),await i.Camera.focusOn(i.currentFloor,{axisAlignedPadding:{vertical:d},pitch:90}),i.StackedMaps.expanded||await i.StackedMaps.expand({distanceBetweenFloors:d});let u=i.StackedMaps.includedFloors[2],b=f.findIndex(y=>y.id===u.id);i.StackedMaps.changeFloorOnElevationChanges(!0),i.Camera.setPanMode("elevation"),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.animateElevation(b*d),i.Outdoor.setOpacity(.15),console.log("focusing on",u.name),await i.Camera.focusOn(u,{pitch:10}),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),i.StackedMaps.changeFloorOnElevationChanges(!1)}},"Camera Pan Mode"),p.add("All Floors",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("all-floors")}},"Visibility Mode"),p.add("Only Active Floor",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("only-current-floor")}},"Visibility Mode"),p.add("Up",{default:async()=>{let u=f.find(b=>b.elevation===i.currentFloor.elevation+1);u&&await g(u)}},"Floors Up/Down"),p.add("Down",{default:async()=>{let u=f.find(b=>b.elevation===i.currentFloor.elevation-1);u&&await g(u)}},"Floors Up/Down"),{zoomToFloor:r}}a(Nt,"createStackMapsControl");function Rt(i,t,o){let e=i.addFolder("StackedMaps");e.close(),Nt(t,o,{root:e,showLabelsPerFloor:!1})}a(Rt,"createStackmapsControl");function Wt(i,t,o){ge();let e=new K({title:"SDK Controls"});e.domElement.classList.add("mappedin-js-inspector"),$t(t,i,e),Dt(e,t,o==null?void 0:o.camera);let n=e.addFolder("Levels").close(),s=e.addFolder("Scene Controls");s.close();let r=e.addFolder("Labels");Bt(e,t,i);let l=e.addFolder("Markers");zt(e,t),Rt(e,t,i);let d=e.addFolder("misc");Ut(e,t,i),Gt(d,t,i);let g={level:t.currentFloor.id},{populatelabels:h}=It(r,i,t),{populateMarkers:c}=Pt(l,i,t),p=i.getByType("floor").reduce((u,b)=>(u[b.name]=b.id,u),{}),f=n.add(g,"level",p).onChange(u=>{t.setFloor(u),g.level=t.currentFloor.id,f.updateDisplay()});return t.on("floor-change-start",u=>{n.controllers[0].setValue(u.floor.id)}),i.getByType("space").forEach(u=>{t.updateState(u,{interactive:!0})}),i.getByType("object").forEach(u=>{t.updateState(u,{interactive:!0})}),i.getByType("object").forEach(u=>{t.updateState(u,{interactive:!0})}),t.setHoverColor("#a2b7e6"),t.Camera.setMaxZoomLevel(20),{populatelabels:h,sceneFolder:s,populateMarkers:c}}a(Wt,"createUi");var Jt="mappedin-sdk-debug-css";function ge(){if(document.getElementById(Jt))return;let i=document.createElement("style");i.id=Jt,i.textContent=Ot,document.head.appendChild(i)}a(ge,"injectCss");var xt=class xt{constructor(t,o){T(this,"_enabled",!1);T(this,"mv");T(this,"api");T(this,"mapData");T(this,"scenegraphVisualizerMounted",!1);T(this,"storeStateToLocalStorageEnabled",!1);this.mv=t,this.api=o,this.mapData=this.api.getMapData()}setMapData(t){this.mapData=t}async enable(t={}){var e;if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:o}=Wt(this.mapData,this.mv,t);o.onOpenClose(n=>{n===o&&!n._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,_t(this.api.core,o))}),(e=this.api.getMapDataInternal())==null||e.spaces.forEach(n=>{this.mv.updateState(n.id,{interactive:!0})})}get enabled(){return this._enabled}};a(xt,"Inspector");var Ct=xt;export{Ct as Inspector};
|
|
1
|
+
import{a as Et,c as J,f as D,g as W,h as _t}from"./chunk-KPW4CO5D.js";import{j as U}from"./chunk-CPI6X7UJ.js";import"./chunk-FLFBEGLN.js";import"./chunk-ZXWC3C7V.js";import{N as Mt}from"./chunk-ZQUOGXWB.js";import{a as C}from"./chunk-HBL5RRXD.js";import{a,f as T,g as x,h as S,i as kt,j as G}from"./chunk-J5IUISYU.js";C();C();C();C();var P=class P{constructor(t,o,e,n,s="div"){this.parent=t,this.object=o,this.property=e,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(s),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),P.nextNameID=P.nextNameID||0,this.$name.id="lil-gui-name-".concat(++P.nextNameID),this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",r=>r.stopPropagation()),this.domElement.addEventListener("keyup",r=>r.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(e)}name(t){return this._name=t,this.$name.textContent=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled?this:(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t),this)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){let o=this.parent.add(this.object,this.property,t);return o.name(this._name),this.destroy(),o}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.getValue()!==t&&(this.object[this.property]=t,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}};a(P,"Controller");var L=P,at=class at extends L{constructor(t,o,e){super(t,o,e,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};a(at,"BooleanController");var et=at;function it(i){let t,o;return(t=i.match(/(#|0x)?([a-f0-9]{6})/i))?o=t[2]:(t=i.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?o=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=i.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(o=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),o?"#"+o:!1}a(it,"normalizeColorString");var Xt={isPrimitive:!0,match:i=>typeof i=="string",fromHexString:it,toHexString:it},H={isPrimitive:!0,match:i=>typeof i=="number",fromHexString:i=>parseInt(i.substring(1),16),toHexString:i=>"#"+i.toString(16).padStart(6,0)},Kt={isPrimitive:!1,match:i=>Array.isArray(i),fromHexString(i,t,o=1){let e=H.fromHexString(i);t[0]=(e>>16&255)/255*o,t[1]=(e>>8&255)/255*o,t[2]=(e&255)/255*o},toHexString([i,t,o],e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return H.toHexString(n)}},Zt={isPrimitive:!1,match:i=>Object(i)===i,fromHexString(i,t,o=1){let e=H.fromHexString(i);t.r=(e>>16&255)/255*o,t.g=(e>>8&255)/255*o,t.b=(e&255)/255*o},toHexString({r:i,g:t,b:o},e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return H.toHexString(n)}},Qt=[Xt,H,Kt,Zt];function qt(i){return Qt.find(t=>t.match(i))}a(qt,"getColorFormat");var lt=class lt extends L{constructor(t,o,e,n){super(t,o,e,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=qt(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=it(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){let o=this._format.fromHexString(t);this.setValue(o)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}};a(lt,"ColorController");var ot=lt,dt=class dt extends L{constructor(t,o,e){super(t,o,e,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}};a(dt,"FunctionController");var B=dt,ct=class ct extends L{constructor(t,o,e,n,s,r){super(t,o,e,"number"),this._initInput(),this.min(n),this.max(s);let l=r!==void 0;this.step(l?r:this._getImplicitStep(),l),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,o=!0){return this._step=t,this._stepExplicit=o,this}updateDisplay(){let t=this.getValue();if(this._hasSlider){let o=(t-this._min)/(this._max-this._min);o=Math.max(0,Math.min(o,1)),this.$fill.style.width=o*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let o=a(()=>{let v=parseFloat(this.$input.value);isNaN(v)||(this._stepExplicit&&(v=this._snap(v)),this.setValue(this._clamp(v)))},"onInput"),e=a(v=>{let w=parseFloat(this.$input.value);isNaN(w)||(this._snapClampSetValue(w+v),this.$input.value=this.getValue())},"increment"),n=a(v=>{v.key==="Enter"&&this.$input.blur(),v.code==="ArrowUp"&&(v.preventDefault(),e(this._step*this._arrowKeyMultiplier(v))),v.code==="ArrowDown"&&(v.preventDefault(),e(this._step*this._arrowKeyMultiplier(v)*-1))},"onKeyDown"),s=a(v=>{this._inputFocused&&(v.preventDefault(),e(this._step*this._normalizeMouseWheel(v)))},"onWheel"),r=!1,l,d,g,h,c,p=5,f=a(v=>{l=v.clientX,d=g=v.clientY,r=!0,h=this.getValue(),c=0,window.addEventListener("mousemove",u),window.addEventListener("mouseup",b)},"onMouseDown"),u=a(v=>{if(r){let w=v.clientX-l,O=v.clientY-d;Math.abs(O)>p?(v.preventDefault(),this.$input.blur(),r=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(w)>p&&b()}if(!r){let w=v.clientY-g;c-=w*this._step*this._arrowKeyMultiplier(v),h+c>this._max?c=this._max-h:h+c<this._min&&(c=this._min-h),this._snapClampSetValue(h+c)}g=v.clientY},"onMouseMove"),b=a(()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",b)},"onMouseUp"),y=a(()=>{this._inputFocused=!0},"onFocus"),m=a(()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()},"onBlur");this.$input.addEventListener("input",o),this.$input.addEventListener("keydown",n),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",f),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",m)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let t=a((m,v,w,O,R)=>(m-v)/(w-v)*(R-O)+O,"map"),o=a(m=>{let v=this.$slider.getBoundingClientRect(),w=t(m,v.left,v.right,this._min,this._max);this._snapClampSetValue(w)},"setValueFromX"),e=a(m=>{this._setDraggingStyle(!0),o(m.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",s)},"mouseDown"),n=a(m=>{o(m.clientX)},"mouseMove"),s=a(()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",s)},"mouseUp"),r=!1,l,d,g=a(m=>{m.preventDefault(),this._setDraggingStyle(!0),o(m.touches[0].clientX),r=!1},"beginTouchDrag"),h=a(m=>{m.touches.length>1||(this._hasScrollBar?(l=m.touches[0].clientX,d=m.touches[0].clientY,r=!0):g(m),window.addEventListener("touchmove",c,{passive:!1}),window.addEventListener("touchend",p))},"onTouchStart"),c=a(m=>{if(r){let v=m.touches[0].clientX-l,w=m.touches[0].clientY-d;Math.abs(v)>Math.abs(w)?g(m):(window.removeEventListener("touchmove",c),window.removeEventListener("touchend",p))}else m.preventDefault(),o(m.touches[0].clientX)},"onTouchMove"),p=a(()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",p)},"onTouchEnd"),f=this._callOnFinishChange.bind(this),u=400,b,y=a(m=>{if(Math.abs(m.deltaX)<Math.abs(m.deltaY)&&this._hasScrollBar)return;m.preventDefault();let w=this._normalizeMouseWheel(m)*this._step;this._snapClampSetValue(this.getValue()+w),this.$input.value=this.getValue(),clearTimeout(b),b=setTimeout(f,u)},"onWheel");this.$slider.addEventListener("mousedown",e),this.$slider.addEventListener("touchstart",h,{passive:!1}),this.$slider.addEventListener("wheel",y,{passive:!1})}_setDraggingStyle(t,o="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle("lil-gui-".concat(o),t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:o,deltaY:e}=t;return Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(o=0,e=-t.wheelDelta/120,e*=this._stepExplicit?1:10),o+-e}_arrowKeyMultiplier(t){let o=this._stepExplicit?1:10;return t.shiftKey?o*=10:t.altKey&&(o/=10),o}_snap(t){let o=Math.round(t/this._step)*this._step;return parseFloat(o.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){let t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}};a(ct,"NumberController");var nt=ct,ht=class ht extends L{constructor(t,o,e,n){super(t,o,e,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(n)}options(t){return this._values=Array.isArray(t)?t:Object.values(t),this._names=Array.isArray(t)?t:Object.keys(t),this.$select.replaceChildren(),this._names.forEach(o=>{let e=document.createElement("option");e.textContent=o,this.$select.appendChild(e)}),this.updateDisplay(),this}updateDisplay(){let t=this.getValue(),o=this._values.indexOf(t);return this.$select.selectedIndex=o,this.$display.textContent=o===-1?t:this._names[o],this}};a(ht,"OptionController");var rt=ht,ut=class ut extends L{constructor(t,o,e){super(t,o,e,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}};a(ut,"StringController");var st=ut,Vt='.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n background: var(--background-color);\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles, .lil-gui.allow-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles, .lil-gui.force-touch-styles .lil-gui {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "\u2195";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "\u25BE";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "\u25B8";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui label, .lil-gui input, .lil-gui button {\n -webkit-tap-highlight-color: transparent;\n}\n.lil-gui input {\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n -moz-appearance: textfield;\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n width: var(--checkbox-size);\n height: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "\u2713";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: none;\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n }\n .lil-gui button:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}';function te(i){let t=document.createElement("style");t.innerHTML=i;let o=document.querySelector("head link[rel=stylesheet], head style");o?document.head.insertBefore(t,o):document.head.appendChild(t)}a(te,"_injectStyles");var Ft=!1,X=class X{constructor({parent:t,autoPlace:o=t===void 0,container:e,width:n,title:s="Controls",closeFolders:r=!1,injectStyles:l=!0,touchStyles:d=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",g=>{(g.code==="Enter"||g.code==="Space")&&(g.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),d&&this.domElement.classList.add("allow-touch-styles"),!Ft&&l&&(te(Vt),Ft=!0),e?e.appendChild(this.domElement):o&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this._closeFolders=r}add(t,o,e,n,s){if(Object(e)===e)return new rt(this,t,o,e);let r=t[o];switch(typeof r){case"number":return new nt(this,t,o,e,n,s);case"boolean":return new et(this,t,o);case"string":return new st(this,t,o);case"function":return new B(this,t,o)}console.error("gui.add failed\n property:",o,"\n object:",t,"\n value:",r)}addColor(t,o,e=1){return new ot(this,t,o,e)}addFolder(t){let o=new X({parent:this,title:t});return this.root._closeFolders&&o.close(),o}load(t,o=!0){return t.controllers&&this.controllers.forEach(e=>{e instanceof B||e._name in t.controllers&&e.load(t.controllers[e._name])}),o&&t.folders&&this.folders.forEach(e=>{e._title in t.folders&&e.load(t.folders[e._title])}),this}save(t=!0){let o={controllers:{},folders:{}};return this.controllers.forEach(e=>{if(!(e instanceof B)){if(e._name in o.controllers)throw new Error('Cannot save GUI with duplicate property "'.concat(e._name,'"'));o.controllers[e._name]=e.save()}}),t&&this.folders.forEach(e=>{if(e._title in o.folders)throw new Error('Cannot save GUI with duplicate folder "'.concat(e._title,'"'));o.folders[e._title]=e.save()}),o}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let o=this.$children.clientHeight;this.$children.style.height=o+"px",this.domElement.classList.add("transition");let e=a(s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",e))},"onTransitionEnd");this.$children.addEventListener("transitionend",e);let n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.textContent=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(e=>e.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(o=>{t=t.concat(o.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(o=>{t=t.concat(o.foldersRecursive())}),t}};a(X,"GUI");var z=X,K=z;C();C();var _=(()=>{let i=new Mt;return a(function(o){return i.set(o),"#".concat(i.getHexString())},"normalize")})();function St(i){let t;for(t of i)t()}a(St,"runAll");function pt(i,t){let o=window.location.href,e=new URL(o),n=new URLSearchParams(e.search);for(let s in i)if(i.hasOwnProperty(s)){let r="".concat(t,".").concat(s);n.set(r,i[s])}e.search=n.toString(),history.pushState({path:e.toString()},"",e.toString())}a(pt,"updateCurrentUrlParamsWithNamespace");function gt(i,t){let o=new URLSearchParams(window.location.search),e={};for(let[n,s]of o)if(n.startsWith("".concat(i,"."))){let r=n.slice(i.length+1);s==="true"||s==="false"?e[r]=s==="true":typeof(t==null?void 0:t[r])=="number"?e[r]=Number(s):e[r]=s}return{namespace:i,params:e}}a(gt,"getUrlParamsWithNamespace");var ee=["interactive"];function Z(i,t,o){var n,s;let e=o.addFolder("".concat(t.type,"-").concat(t.id));for(let r in t){if(r==="visible"&&e.add(t,r).onChange(l=>{i.updateState(t.id,{[r]:l})}),r==="color"||r==="hoverColor"){t[r]=_(t[r]),e.addColor(t,r).onChange(l=>{i.updateState(t.id,{[r]:l})});continue}if(r==="height"){e.add(t,r,0,20,1).onChange(l=>{i.updateState(t.id,{[r]:l})});continue}if(r==="texture"&&t.texture){(n=e.addFolder("Texture - side").add(t,"texture"))==null||n.onChange(d=>{i.updateState(t.id,{texture:{url:d}})});continue}if(r==="topTexture"&&t.topTexture){(s=e.addFolder("Texture - top").add(t,"topTexture"))==null||s.onChange(d=>{i.updateState(t.id,{topTexture:{url:d}})});continue}if(r==="opacity"){e.add(t,r,0,1,.1).onChange(l=>{i.updateState(t.id,{[r]:l})});continue}ee.includes(r)&&e.add(t,r).onChange(l=>{i.updateState(t.id,{[r]:l})})}return t.isInView&&(e.add(t,"isInView").listen().disable(),e.add(t,"isInViewCheck")),{cleanup(){e.destroy()}}}a(Z,"renderByProp");C();C();function ie(){let i=[];function t(n,s){var d;let r=Object.values(n.getMapData())[0],l=s;if(l&&J.is(l)){let g=(d=r.getByType("enterprise-location"))==null?void 0:d.find(h=>h.spaces.some(c=>c.id===l.id));g&&(l=g)}return l}a(t,"getHighlightTarget");async function o(n,s){return s instanceof W?n.Camera.focusOn(s.locations.flatMap(r=>r.spaces),j):s instanceof D?n.Camera.focusOn(s.spaces,j):n.Camera.focusOn(s,j)}a(o,"focusOn");function e(n,s,{focus:r=!1}={}){if(!window.enableHighlightCard)return()=>{};let l=t(n,s),d=document.createElement("div");if(d.style.cssText="\n position: absolute;\n top: 20px;\n left: 20px;\n background-color: rgba(30, 30, 30, 0.95);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n border-radius: 12px;\n padding: 24px;\n max-width: 320px;\n z-index: 1000;\n font-family: 'Arial', sans-serif;\n transition: all 0.3s ease;\n color: #e0e0e0;\n ","name"in l){let h=document.createElement("h3");h.textContent=l.name,h.style.cssText="\n margin: 0 0 16px;\n font-size: 22px;\n font-weight: 600;\n color: #ffffff;\n letter-spacing: -0.5px;\n ",d.appendChild(h)}if(l instanceof D){if(l.description){let h=document.createElement("p");h.textContent=l.description,h.style.cssText="\n margin: 0 0 16px;\n font-size: 14px;\n color: #b0b0b0;\n line-height: 1.5;\n ",d.appendChild(h)}if(l.tags&&l.tags.length>0){let h=document.createElement("div");h.style.cssText="\n display: flex;\n flex-wrap: nowrap;\n gap: 8px;\n margin-bottom: 16px;\n overflow-x: hidden;\n max-height: 30px; /* Adjust this value based on your font size and padding */\n ",l.tags.forEach(c=>{let p=document.createElement("span");p.textContent=c,p.style.cssText="\n background-color: #3a3a3a;\n color: #e0e0e0;\n padding: 6px 12px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n white-space: nowrap;\n ",h.appendChild(p)}),d.appendChild(h)}}let g;if(!(s instanceof W)){let h=new K({autoPlace:!1});h.domElement.style.cssText="\n position: relative;\n overflow-y: auto;\n margin-top: 16px;\n border-top: 1px solid #444;\n padding-top: 16px;\n ";let c=n.getState(s);c&&(Z(n,{id:s.id,...c},h),d.appendChild(h.domElement)),g=h}return document.body.appendChild(d),r&&o(n,l),()=>{d.style.opacity="0",d.style.transform="translateY(-10px)",setTimeout(()=>d.remove(),300),g==null||g.destroy()}}return a(e,"highlightCard"),{highlightCard:e,highlight:(n,s,{focus:r=!0}={})=>{i.length>0&&i.forEach(d=>n.Markers.remove(d));let l=t(n,s);if(l instanceof D)r&&n.Camera.focusOn(l.spaces,j),i.push(...l.spaces.map(d=>n.Markers.add(d,'<div style="padding: 15px; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); max-width: 250px; position: relative;">\n <h3 style="margin: 0 0 10px; color: #333; font-size: 16px; font-weight: 600;">'.concat(l.name,"</h3>\n ").concat(l.description?'<p style="margin: 0 0 10px; color: #666; font-size: 14px; font-weight: 400;">'.concat(l.description,"</p>"):"","\n ").concat(l.tags?l.tags.map(g=>'<span style="display: inline-block; padding: 3px 8px; background-color: #e0f2f1; color: #00796b; border-radius: 12px; font-size: 12px;">'.concat(g,"</span>")).join(" "):"",'\n <div style="position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid #ffffff;"></div>\n </div>'),{rank:"always-visible",anchor:"top"})));else if(l instanceof W){r&&n.Camera.focusOn(l.locations.flatMap(h=>h.spaces),j);let d=new Map,g=new Set;l.locations.forEach(h=>{d.has(h.name)||(h.spaces.forEach(c=>{i.push(n.Markers.add(c,'<div style="padding: 12px; background-color: rgba(0, 153, 51, 0.95); border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); transform: translateY(-4px); transition: all 0.3s ease;">\n <span style="font-weight: 600; color: #FFFFFF; font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.2);">'.concat(h.name,"</span>\n </div>"),{rank:"always-visible"}))}),d.set(h.name,!0))}),l.locations.forEach(h=>{h.coordinates.forEach(c=>{let p="".concat(c.latitude,",").concat(c.longitude);if(!g.has(p)&&!d.has(h.name)){let f=n.Markers.add(c,'<div style="padding: 10px; background-color: rgba(51, 102, 204, 0.9); border-radius: 6px; box-shadow: 0 3px 6px rgba(0,0,0,0.2);">\n <span style="font-weight: 500; color: #FFFFFF; font-size: 16px;">'.concat(h.name,'</span>\n <br>\n <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>\n </div>'),{rank:"always-visible"});g.add(p),i.push(f)}})})}return()=>{i.forEach(d=>n.Markers.remove(d))}}}}a(ie,"createHighlightControl");var j={duration:300,easing:"ease-in-out"},Q=ie();C();var M={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function oe(i){i.add(M.options.places.fields,"name").name("Places: Name"),i.add(M.options.places.fields,"description").name("Places: Description"),i.add(M.options.places.fields,"link").name("Places: Link"),i.add(M.options.places.fields,"category").name("Places: Category"),i.add(M.options.places,"limit"),i.add(M.options.locations.fields,"name").name("Locations: Name"),i.add(M.options.locations.fields,"tag").name("Locations: Tag"),i.add(M.options.locations.fields,"description").name("Locations: Description"),i.add(M.options.places,"limit"),i.add(M.options.categories.fields,"name").name("Categories: Name")}a(oe,"createAdvancedSettings");function Lt(i,t,o){var h;let e=new U,n=o.addFolder("Search");n.open();let s=n.add(M,"search").onChange(async c=>{let p=await t.Search.query(c,M.options);p&&(M.results=p,l(p,e))}),r=document.createElement("div");r.style.marginLeft="10px",(h=s.domElement.parentElement)==null||h.appendChild(r);let{renderSearch:l,close:d}=ne(i,t,r,s.$input),g=n.addFolder("Advanced");return g.close(),oe(g),document.addEventListener("keydown",c=>{(c.metaKey||c.ctrlKey)&&c.key==="k"?(c.preventDefault(),n._closed&&n.open(),s.$input.focus()):c.key==="Escape"&&(d(),e.publish("highlight",void 0))}),{pubsub:e}}a(Lt,"createSearchControl");function ne(i,t,o,e){let n,s;e.addEventListener("input",async l=>{l instanceof InputEvent&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")&&(clearTimeout(n),n=setTimeout(async()=>{var g;let d=await t.Search.suggest(e.value);d&&d.length>0&&r((g=d[0])==null?void 0:g.suggestion)},100))});function r(l){if(!l){e.placeholder="";return}let d=e.value;e.value=l,e.setSelectionRange(d.length,l.length)}return a(r,"renderSuggestion"),{renderSearch(l,d){var g,h;if(l.places.length===0&&((g=l.enterpriseCategories)==null?void 0:g.length)===0&&((h=l.enterpriseLocations)==null?void 0:h.length)===0){o.textContent="No results found.";return}s=re(o,l,i,d)},close(){s.destroy()}}}a(ne,"mount");function re(i,t,o,e){i.innerHTML="";let n=document.createElement("div");Object.assign(n.style,q.dropdownContainer);let s=document.createElement("ul");s.className="options-list",Object.assign(s.style,q.optionsList),s.style.display="block";let r=[],l=a((p,f)=>{if(f&&f.length>0){let u=document.createElement("li");u.textContent=p,Object.assign(u.style,q.sectionHeader),s.appendChild(u),f.forEach((b,y)=>{let m=document.createElement("li");m.textContent="".concat("name"in b.item?b.item.name:""," (").concat(b.type,")"),Object.assign(m.style,q.option),m.tabIndex=0,m.addEventListener("focus",()=>{g(r.indexOf(m))}),m.addEventListener("mouseover",()=>{m.style.backgroundColor="#f0f0f0"}),m.addEventListener("mouseout",()=>{m.style.backgroundColor=""}),m.addEventListener("click",()=>{}),m.setAttribute("data-type",p),m.setAttribute("data-index",y.toString()),s.appendChild(m),r.push(m)})}},"addSection");l("enterpriseLocations",t.enterpriseLocations),l("enterpriseCategories",t.enterpriseCategories),l("Places",t.places),n.appendChild(s),i.appendChild(n);let d=[],g=a(p=>{d.forEach(m=>m()),d=[],r.forEach((m,v)=>{v===p?m.style.backgroundColor="#e0e0e0":m.style.backgroundColor=""});let f=r[p],u=f.getAttribute("data-type"),b=parseInt(f.getAttribute("data-index")||"0",10);if(!u)return;let{item:y}=t[u][b];e.publish("highlight",y)},"highlightOption"),h=a(p=>{!n.contains(p.target)&&p.target!==i&&c()},"handleClickOutside");document.addEventListener("click",h);let c=a(()=>{i.innerHTML="",document.removeEventListener("click",h)},"destroy");return{destroy(){i.innerHTML="",e.publish("highlight",void 0)}}}a(re,"createCustomDropdown");var q={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function $t(i,t,o){o.domElement.id="interactionPanel";let e=[],{pubsub:n}=Lt(i,t,o);n.on("highlight",h=>{if(h){e.forEach(p=>p()),e=[];let c=h instanceof D?h.spaces[0]:h;if(c&&!J.is(c))return;e.push(Q.highlightCard(i,c,{focus:!0}))}else e.forEach(c=>c()),e=[]});let s=o.addFolder("Click \u{1F447}").close(),{sub:r}=se(i,s);r.on("click",h=>{e.forEach(c=>c()),e=[],h.spaces[0]&&(e=[Q.highlightCard(i,h.spaces[0])])});let l=o.addFolder("Hover \u{1F681}").close(),{sub:d}=ae(i,l),g;d.on("hover",h=>{h.spaces[0]?(g==null||g(),e.length===0&&(g=Q.highlightCard(i,h.spaces[0]))):(g==null||g(),g=void 0)})}a($t,"createInteractionControls");function se(i,t){let o=new U,e={position:"",hoverColor:_(i.getHoverColor())},n=t.add(e,"position").disable(),s=[];function r(){s.forEach(d=>d()),s.length=0}a(r,"reset");let l=0;return i.on("click",d=>{var u;let{labels:g,markers:h,coordinate:c}=d;r(),o.publish("click",d),clearInterval(l),n.load(JSON.stringify([c.longitude,c.latitude]));let p=g[0]||h[0];if(p){let b=mt(i,p,t);if(!b)return;s.push(b.destroy),b.labelItemFolder.openAnimated()}let f=(u=d.spaces[0])!=null?u:d.objects[0];if(f){let b={id:f.id,...i.getState(f.id),type:f.type,isInView:!1,isInViewCheck:ft(i,f.id)},{cleanup:y}=Z(i,b,t);l=setInterval(()=>{b.isInView=i.isInView(p||f)},500),s.push(y)}}),{sub:o}}a(se,"createClickControls");function ae(i,t){let o=new U;i.setHoverColor("#1f3a7a");let e={position:"",hoverColor:_(i.getHoverColor()),intersected:"",type:"",id:""},n=t.add(e,"position").disable();t.add(e,"id").disable().listen(),t.add(e,"type").disable().listen(),t.addColor(e,"hoverColor").onChange(l=>{i.setHoverColor(l)});let s=[];function r(){s.forEach(l=>l()),s.length=0}return a(r,"reset"),i.on("hover",l=>{var b,y,m;let{coordinate:d,spaces:g,objects:h,markers:c,labels:p}=l;r(),o.publish("hover",l),n.load(JSON.stringify([d.longitude,d.latitude]));let f=(m=(y=(b=g[0])!=null?b:h[0])!=null?y:c[0])!=null?m:p[0];if(!f)return;let u=i.getState(f);u&&(e.type=u.type,e.id=f.id)}),{sub:o}}a(ae,"createHoverControls");function ft(i,t){return a(function(){console.log("isInView",i.isInView(t))},"isInView")}a(ft,"createIsInViewHandler");function It(i,t,o){let e={labels:{},all(){o.Labels.all().forEach(f=>{this.labels[f.id]=f}),d()},removeAllLabels(){o.Labels.removeAll().forEach(f=>{delete this.labels[f.id]}),d()}},{addLabel:n,destroy:s}=le(i,o);i.add(e,"all"),i.add(e,"removeAllLabels");let r=i.addFolder("Label List");i.close();let l=new Map,{rerender:d}=g();function g(){function p(b){var y;delete e.labels[b.id],(y=l.get(b.id))==null||y.destroy()}a(p,"remove");function f(b){let y=mt(o,b,r,{onRemove:v=>{p(v)}});if(!y)return;let{labelItemFolder:m}=y;l.set(b.id,m)}a(f,"add");function u(){r.destroy(),r=i.addFolder("Label");for(let b in e.labels){let y=e.labels[b];f(y)}}return a(u,"rerender"),{rerender:u,add:f,remove:p}}a(g,"createLabelControls"),i.domElement.classList.add("list-items");let h;o.on("click",({labels:p,coordinate:f})=>{if(!i._closed)if(p[0]){h==null||h.close();let u=l.get(p[0].id);if(i.open(),!u)return;u==null||u.open(),u==null||u.domElement.scrollIntoView({block:"start"}),u==null||u.domElement.focus(),h=u}else n(f)});function c(p){for(let f of p)e.labels[f.id]=f;d()}return a(c,"populatelabels"),{populatelabels:c,destroy(){s()}}}a(It,"createLabelControls");function mt(i,t,o,{onRemove:e}={}){var g,h,c,p;let n=o.addFolder("".concat((g=t.text)==null?void 0:g.substring(0,12)));n.onChange(f=>{i.updateState(t,{appearance:d.appearance,interactive:d.interactive})}),n.close();let s=i.getState(t);if((s==null?void 0:s.type)!=="label")throw new Error("error getting state for label: ".concat(t.id));let{appearance:r,interactive:l}=s;if(!r||r.margin==null||l==null)throw new Error("incomplte label state");let d={text:t.text,interactive:l,appearance:{...r,margin:r.margin||0,marker:{foregroundColor:(c=(h=r.marker)==null?void 0:h.foregroundColor)!=null&&c.active?_((p=r.marker.foregroundColor)==null?void 0:p.active):"black"},text:{foregroundColor:_(r.text.foregroundColor)}},remove(){i.Labels.remove(t),e==null||e(t),n.destroy()},isInView:ft(i,t.id)};return n.add(d.appearance,"margin",0,20).name("margin"),n.add(d,"text"),n.add(d,"interactive"),n.addColor(d.appearance.marker,"foregroundColor").name("marker foreground"),n.addColor(d.appearance.text,"foregroundColor").name("text forground"),n.add(d,"isInView"),n.add(d,"remove"),{labelItemFolder:n,destroy(){n.destroy()}}}a(mt,"addLabelControlToFolder");function le(i,t){let o=i.addFolder("Add"),e={onClick:!1,margin:0,text:"New Label!",interactive:!0,marginForegroundColor:_("skyblue"),marginBackgroundColor:_("coral"),textForegroundColor:_("slategray"),textBackgroundColor:_("white")};return o.add(e,"onClick"),o.add(e,"margin"),o.add(e,"interactive"),o.add(e,"text"),o.addColor(e,"marginForegroundColor"),o.addColor(e,"marginBackgroundColor"),o.addColor(e,"textForegroundColor"),o.addColor(e,"textBackgroundColor"),{destroy(){o.destroy()},addLabel(n){return o._closed||!e.onClick?void 0:t.Labels.add(n,e.text,{appearance:{margin:e.margin,marker:{foregroundColor:{active:e.marginForegroundColor,inactive:e.marginForegroundColor},backgroundColor:{active:e.marginBackgroundColor,inactive:e.marginBackgroundColor}},text:{foregroundColor:e.textForegroundColor,backgroundColor:e.marginBackgroundColor}},interactive:e.interactive})}}}a(le,"createAddControl");var Ot={};C();var Tt="camera-ui";function Dt(i,t,o){var R,At;let e=i.addFolder("Camera \u{1F4F7}").onOpenClose(A=>{pt({opened:!A._closed},Tt)}),{params:n}=gt(Tt);n.opened||e.close();let s=t.Camera.center.toJSON(),r=document.createElement("div");Object.assign(r.style,{display:"none",position:"absolute",left:"0px",top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),document.body.appendChild(r);let[l,d,g,h]=(R=o==null?void 0:o.padding)!=null?R:[],c={center_lat:s.latitude,center_lon:s.longitude,zoomLevel:t.Camera.zoomLevel,pitch:t.Camera.pitch,bearing:t.Camera.bearing,minZoomLevel:t.Camera.minZoomLevel,maxZoomLevel:t.Camera.maxZoomLevel,inset_type:"pixel",inset_top:l!=null?l:0,inset_left:h!=null?h:0,inset_right:d!=null?d:0,inset_bottom:g!=null?g:0,animateOnLoad:!0,persist:()=>{pt(e.save().controllers,"camera"),navigator.clipboard.writeText(window.location.href)},visualizeInset:!!(l||d||g||h),"Focus on click":(At=o==null?void 0:o.focusOnClick)!=null?At:!0,"Focus on current floor":()=>{t.Camera.focusOn([t.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function p(){c.inset_type==="portion"?Object.assign(r.style,{left:c.inset_left*u+"px",top:c.inset_top*f+"px",bottom:c.inset_bottom*f+"px",right:c.inset_right*u+"px"}):Object.assign(r.style,{left:c.inset_left+"px",top:c.inset_top+"px",bottom:c.inset_bottom+"px",right:c.inset_right+"px"})}a(p,"updateInsetVisualizer"),e.add(c,"center_lat").listen().disable(),e.add(c,"center_lon").listen().disable(),e.add(c,"zoomLevel",16,22,.5).listen().disable(),e.add(c,"pitch").listen().disable(),e.add(c,"bearing").listen().disable(),e.add(c,"minZoomLevel",5,22,.5).onChange(A=>{t.Camera.setMinZoomLevel(A)}),e.add(c,"maxZoomLevel",10,22,.5).onChange(A=>{t.Camera.setMaxZoomLevel(A)}),e.add(c,"animateOnLoad"),e.add(c,"visualizeInset").onChange(O),O(c.visualizeInset);let{innerHeight:f,innerWidth:u}=window;e.add(c,"inset_type",["pixel","portion"]).onChange(w),e.add(c,"inset_top",0,f).onChange(w),e.add(c,"inset_bottom",0,f).onChange(w),e.add(c,"inset_left",0,u).onChange(w),e.add(c,"inset_right",0,u).onChange(w);let b=ce(t);e.add(c,"Focus on click").onChange(A=>{A?t.on("click",b):t.off("click",b)}),c["Focus on click"]&&t.on("click",b),e.add(c,"persist"),e.add(c,"Focus on current floor");let y=a(A=>{e._closed||(c.center_lat=A.center.latitude,c.center_lon=A.center.longitude,c.zoomLevel=A.zoomLevel,c.bearing=A.bearing,c.pitch=A.pitch)},"onCameraChanged");t.on("camera-change",y);let{params:m}=gt("camera",c);if(Object.keys(m).length>0){let A=m;t.Camera.setScreenOffsets({top:A.inset_top,left:A.inset_left,right:A.inset_right,bottom:A.inset_bottom,type:A.inset_type});let wt={pitch:A.pitch,center:new Et(A.center_lat,A.center_lon),bearing:A.bearing,zoomLevel:A.zoomLevel};A.animateOnLoad?t.Camera.animateTo(wt):t.Camera.set(wt),e.load({controllers:A,folders:{}}),p()}let v=[()=>{t.off("camera-change",y)}];function w(){t.Camera.setScreenOffsets({top:c.inset_top,left:c.inset_left,right:c.inset_right,bottom:c.inset_bottom,type:c.inset_type}),p()}a(w,"updateInset"),(c.inset_top||c.inset_right||c.inset_bottom||c.inset_left)&&w();function O(A){A?r.style.display="block":r.style.display="none"}return a(O,"visualizeInsetUpdated"),()=>({destroy(){e.destroy(),St(v)}})}a(Dt,"createCameraControls");function ce(i){return a(function(o){var r;let{spaces:e,objects:n}=o,s=(r=e[0])!=null?r:n[0];s&&i.Camera.focusOn(s)},"handler")}a(ce,"createHandler");C();function Pt(i,t,o){let e={markers:{},removeAllMarkers(){o.Markers.removeAll().forEach(f=>{delete this.markers[f.id]}),d()}},{addMarker:n,destroy:s}=ue(i,o);i.add(e,"removeAllMarkers");let r=i.addFolder("Marker List");i.close();let l=new Map,{rerender:d}=g();function g(){function p(b){var y;delete e.markers[b.id],(y=l.get(b.id))==null||y.destroy()}a(p,"remove");function f(b){let y=he(o,b,r,{onRemove:v=>{p(v)}});if(!y)return;let{markerItemFolder:m}=y;l.set(b.id,m)}a(f,"add");function u(){r.destroy(),r=i.addFolder("marker");for(let b in e.markers){let y=e.markers[b];f(y)}}return a(u,"rerender"),{rerender:u,add:f,remove:p}}a(g,"createMarkerControls"),i.domElement.classList.add("list-items");let h;o.on("click",({markers:p,coordinate:f})=>{if(!i._closed)if(p[0]){h==null||h.close();let u=l.get(p[0].id);if(i.open(),!u)return;u==null||u.open(),u==null||u.domElement.scrollIntoView({block:"start"}),u==null||u.domElement.focus(),h=u}else n(f)});function c(p){for(let f of p)e.markers[f.id]=f;d()}return a(c,"populateMarkers"),{populateMarkers:c,destroy(){s()}}}a(Pt,"createMarkerControls");function he(i,t,o,{onRemove:e}={}){let n=o.addFolder("".concat(t.id.toString().substring(0,8)));n.onChange(d=>{i.updateState(t,{interactive:l.interactive})}),n.close();let s=i.getState(t);if((s==null?void 0:s.type)!=="marker")throw new Error("error getting state for marker: ".concat(t.id));let{interactive:r}=s;if(r==null)throw new Error("incomplte label state");let l={interactive:r,remove(){i.Markers.remove(t),e==null||e(t),n.destroy()}};return n.add(l,"interactive"),n.add(l,"remove"),{markerItemFolder:n,destroy(){n.destroy()}}}a(he,"addMarkerControlToFolder");function ue(i,t){let o=i.addFolder("Add"),e={onClick:!1,interactive:!0};return o.add(e,"onClick"),o.add(e,"interactive"),{destroy(){o.destroy()},addMarker(n){return o._closed||!e.onClick?void 0:t.Markers.add(n,"<div>New Marker</div>",{interactive:e.interactive})}}}a(ue,"createAddControl");C();function zt(i,t){let o=i.addFolder("Walls").close(),e={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};o.add(e,"visible").onChange(r=>{t.updateState("walls",{visible:r})}),o.addColor(e,"topColor").onChange(r=>{t.updateState("walls",{topColor:r})}),o.addColor(e,"color").onChange(r=>{t.updateState("walls",{color:r})}),o.addFolder("Texture - side").add(e.texture,"url").onFinishChange(r=>{t.updateState("walls",{texture:{url:r}})}),o.addFolder("Texture - top").add(e.topTexture,"url").onFinishChange(r=>{t.updateState("walls",{topTexture:{url:r}})}),t.updateState("walls",{topColor:e.topColor}),t.updateState("walls",{color:e.color})}a(zt,"createGeometryControl");C();function Gt(i,t,o){var s,r;i.close();let e={language:(r=(s=o.currentLanguage)==null?void 0:s.code)!=null?r:"en"},n=o.getByType("enterprise-venue");i.add(e,"language",n==null?void 0:n.languages.map(l=>l.code)).onChange(l=>{o.changeLanguage(l)})}a(Gt,"createMiscControl");C();function Ut(i,t,o){let e=i.addFolder("Debug");e.close();let n={showPolygonLabelTextAreaMesh:!1};e.add(n,"showPolygonLabelTextAreaMesh").onChange(s=>{t.Debug.update({showPolygonLabelTextAreaMesh:s})}).name("Show Flat Label Text Area Mesh"),t.Debug.update(n)}a(Ut,"createDebugControl");C();function Bt(i,t,o){let e=i.addFolder("Text3D").close(),n={all:()=>{t.Text3D.labelAll()},removeAll:()=>{t.Text3D.removeAll()}};e.add(n,"all").name("Show All"),e.add(n,"removeAll").name("Remove All")}a(Bt,"createText3DControl");C();C();C();var F,Y,$,k,I,V,Ht,N,vt,tt,jt,yt=class yt{constructor(t=new z({autoPlace:!0})){S(this,V);S(this,N);S(this,tt);S(this,F,void 0);S(this,Y,[]);S(this,$,{});S(this,k,{});S(this,I,{});kt(this,F,t),x(this,F).domElement.style.left="0"}add(t,o,e){if(x(this,k)[t])throw new Error("Control ".concat(t," already exists"));x(this,$)[t]=o,x(this,I)[t]=o.default,G(this,V,Ht).call(this,t,o,e),this.show()}addColor(t,o,e){if(x(this,k)[t])throw new Error("Control ".concat(t," already exists"));x(this,$)[t]=o,x(this,I)[t]=o.default,G(this,tt,jt).call(this,t,o,e),this.show()}update(t,o){if(!x(this,k)[t])throw new Error("Control ".concat(t," does not exist"));x(this,k)[t].setValue(o),x(this,$)[t].onChange&&x(this,$)[t].onChange(o,t)}replace(t,o,e){if(!x(this,k)[t]){this.add(t,o,e);return}o.args&&x(this,k)[t].options(o.args),o.default&&x(this,k)[t].setValue(o.default),o.onChange&&x(this,k)[t].onChange(n=>{o.onChange(n,t)})}remove(t){if(!x(this,k)[t])throw new Error("Control ".concat(t," does not exist"));x(this,k)[t].destroy(),x(this,k)[t].parent.children.length===0&&x(this,k)[t].parent.hide(),delete x(this,k)[t],delete x(this,$)[t],delete x(this,I)[t]}show(){x(this,F).show()}hide(){x(this,F).hide()}removeAll(){for(let t in x(this,k))this.remove(t)}destroy(){x(this,F).destroy()}};F=new WeakMap,Y=new WeakMap,$=new WeakMap,k=new WeakMap,I=new WeakMap,V=new WeakSet,Ht=a(function(t,o,e){let s=G(this,N,vt).call(this,e).add(x(this,I),t,o.args,o.max,o.step);o.onChange&&s.onChange(r=>{o.onChange(r,t)}),o.onAdd&&o.onAdd(o.default,t),x(this,k)[t]=s},"#addControl"),N=new WeakSet,vt=a(function(t){if(!t)return x(this,F);let o=x(this,Y).find(e=>e._title===t);return o?(o.show(),o):(o=x(this,F).addFolder(t),x(this,Y).push(o),o)},"#getFolder"),tt=new WeakSet,jt=a(function(t,o,e){let s=G(this,N,vt).call(this,e).addColor(x(this,I),t);o.onChange&&s.onChange(r=>{o.onChange(r,t)}),x(this,k)[t]=s},"#addColorControl"),a(yt,"GUI");var bt=yt;function pe(i,t,o){var l;let e={},n=i.getByType("floor"),s=i.getByType("floor-stack");s.length>1&&(e.FloorStack={default:t.currentFloorStack.id,args:s.reduce((d,{id:g,name:h})=>({...d,[h]:g}),{}),onChange:d=>{d!==t.currentFloorStack.id&&(t.setFloorStack(d),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((g,{id:h,name:c})=>({...g,[c]:h}),{})}))}}),n.length>1&&(e.Floor={default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((d,{id:g,name:h})=>({...d,[h]:g}),{}),onChange:d=>{d!==t.currentFloor.id&&t.setFloor(d)},onAdd:()=>{t.on("floor-change",d=>{d!=null&&d.floor.id&&(o.replace("FloorStack",{default:t.currentFloorStack.id}),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((h,{id:c,name:p})=>({...h,[p]:c}),{})}))})}});let r=i.getByType("enterprise-venue");return r&&r.languages.length>1&&(e.Language={default:((l=i.currentLanguage)==null?void 0:l.code)||r.languages[0].code,args:r.languages.reduce((d,{code:g,name:h})=>({...d,[h]:g}),{}),onChange:d=>{i.changeLanguage(d)}}),e}a(pe,"createDefaultControls");function Yt(i,t,o=new z){let e=new bt(o),n=pe(i,t,e);Object.keys(n).length||e.hide();for(let s in n)e.add(s,n[s]);return e}a(Yt,"createGUI");async function Nt(i,t,{initialfloorsInStack:o,root:e,floorsInDirections:n,showLabelsPerFloor:s=!0}){async function r(u){i.StackedMaps.changeFloorOnElevationChanges(!1),i.Outdoor.setOpacity(.15),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),await i.Camera.focusOn(u,{pitch:10})}a(r,"zoomToFloor");async function l(){i.Outdoor.setOpacity(.25),i.StackedMaps.changeFloorOnElevationChanges(!0),i.Camera.setPanMode("elevation"),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.focusOn(i.currentFloor,{axisAlignedPadding:{vertical:d},pitch:90})}a(l,"showCurrentFloorWithPadding");let d=50;async function g(u){await i.Camera.animateElevation(u.elevation*d)}a(g,"scrollToFloor");let h=i.currentFloor;i.on("floor-change",async u=>{i.StackedMaps.expanded&&u.reason!=="stacked-maps-elevation-change"&&(i.StackedMaps.changeFloorOnElevationChanges(!1),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.focusOn(h,{axisAlignedPadding:{vertical:d},pitch:90,duration:500}),i.StackedMaps.changeFloorOnElevationChanges(!0),await g(i.currentFloor),await r(i.currentFloor),i.StackedMaps.setFloorVisiblityMode("only-current-floor")),h=i.currentFloor}),i.on("stacked-maps-state-change",({state:u})=>{console.log("stacked-maps-state-change",u)});let c=t.getByType("space");if(s){let u=c.reduce((b,y)=>(b.has(y.floor)||b.set(y.floor,[]),y.name&&y.name!==""&&b.get(y.floor).push(i.Labels.add(y,y.name)),b),new Map);i.on("floor-change",()=>{u.forEach((b,y)=>{b.forEach(m=>{i.updateState(m,{enabled:i.currentFloor===y})})})})}let p=Yt(t,i,e),f=o!=null?o:[];return p.add("Expand - All",{default:async()=>{i.Outdoor.setOpacity(.25),f=t.getByType("floor"),await i.Camera.animateTo({pitch:90}),await i.StackedMaps.collapse(),await i.StackedMaps.expand({distanceBetweenFloors:d})}},"Stack Maps"),n&&p.add("Expand - Only Navigation",{default:async()=>{i.Outdoor.setOpacity(.25),f=n,await i.StackedMaps.collapse(),i.setFloor(n[0]),await i.StackedMaps.expand({includedFloors:n,distanceBetweenFloors:20})}},"Stack Maps"),p.add("Show All Floors",{default:async()=>{f=t.getByType("floor"),i.Outdoor.setOpacity(.25),i.StackedMaps.setFloorVisiblityMode("all-floors"),i.StackedMaps.changeFloorOnElevationChanges(!1),i.Camera.setPanMode("elevation"),i.Camera.focusOn(f,{pitch:90})}},"Stack Maps"),p.add("Show Current Floor with padding",{default:async()=>{await l()}},"Stack Maps"),p.add("Zoom to Current Floor",{default:async()=>{r(i.currentFloor)}},"Stack Maps"),p.add("Collapse",{default:()=>{i.Outdoor.setOpacity("initial"),i.StackedMaps.collapse()}},"Stack Maps"),p.add("Default",{default:async()=>{i.Camera.setPanMode("default")}},"Camera Pan Mode"),p.add("Elevation",{default:async()=>{i.Camera.setPanMode("elevation")}},"Camera Pan Mode"),p.add("zoom in to floor 2",{default:async()=>{i.Outdoor.setOpacity(.25),console.log(i.currentFloor.name),await i.Camera.focusOn(i.currentFloor,{axisAlignedPadding:{vertical:d},pitch:90}),i.StackedMaps.expanded||await i.StackedMaps.expand({distanceBetweenFloors:d});let u=i.StackedMaps.includedFloors[2],b=f.findIndex(y=>y.id===u.id);i.StackedMaps.changeFloorOnElevationChanges(!0),i.Camera.setPanMode("elevation"),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.animateElevation(b*d),i.Outdoor.setOpacity(.15),console.log("focusing on",u.name),await i.Camera.focusOn(u,{pitch:10}),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),i.StackedMaps.changeFloorOnElevationChanges(!1)}},"Camera Pan Mode"),p.add("All Floors",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("all-floors")}},"Visibility Mode"),p.add("Only Active Floor",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("only-current-floor")}},"Visibility Mode"),p.add("Up",{default:async()=>{let u=f.find(b=>b.elevation===i.currentFloor.elevation+1);u&&await g(u)}},"Floors Up/Down"),p.add("Down",{default:async()=>{let u=f.find(b=>b.elevation===i.currentFloor.elevation-1);u&&await g(u)}},"Floors Up/Down"),{zoomToFloor:r}}a(Nt,"createStackMapsControl");function Rt(i,t,o){let e=i.addFolder("StackedMaps");e.close(),Nt(t,o,{root:e,showLabelsPerFloor:!1})}a(Rt,"createStackmapsControl");function Wt(i,t,o){ge();let e=new K({title:"SDK Controls"});e.domElement.classList.add("mappedin-js-inspector"),$t(t,i,e),Dt(e,t,o==null?void 0:o.camera);let n=e.addFolder("Levels").close(),s=e.addFolder("Scene Controls");s.close();let r=e.addFolder("Labels");Bt(e,t,i);let l=e.addFolder("Markers");zt(e,t),Rt(e,t,i);let d=e.addFolder("misc");Ut(e,t,i),Gt(d,t,i);let g={level:t.currentFloor.id},{populatelabels:h}=It(r,i,t),{populateMarkers:c}=Pt(l,i,t),p=i.getByType("floor").reduce((u,b)=>(u[b.name]=b.id,u),{}),f=n.add(g,"level",p).onChange(u=>{t.setFloor(u),g.level=t.currentFloor.id,f.updateDisplay()});return t.on("floor-change-start",u=>{n.controllers[0].setValue(u.floor.id)}),i.getByType("space").forEach(u=>{t.updateState(u,{interactive:!0})}),i.getByType("object").forEach(u=>{t.updateState(u,{interactive:!0})}),i.getByType("object").forEach(u=>{t.updateState(u,{interactive:!0})}),t.setHoverColor("#a2b7e6"),t.Camera.setMaxZoomLevel(20),{populatelabels:h,sceneFolder:s,populateMarkers:c}}a(Wt,"createUi");var Jt="mappedin-sdk-debug-css";function ge(){if(document.getElementById(Jt))return;let i=document.createElement("style");i.id=Jt,i.textContent=Ot,document.head.appendChild(i)}a(ge,"injectCss");var xt=class xt{constructor(t,o){T(this,"_enabled",!1);T(this,"mv");T(this,"api");T(this,"mapData");T(this,"scenegraphVisualizerMounted",!1);T(this,"storeStateToLocalStorageEnabled",!1);this.mv=t,this.api=o,this.mapData=this.api.getMapData()}setMapData(t){this.mapData=t}async enable(t={}){var e;if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:o}=Wt(this.mapData,this.mv,t);o.onOpenClose(n=>{n===o&&!n._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,_t(this.api.core,o))}),(e=this.api.getMapDataInternal())==null||e.spaces.forEach(n=>{this.mv.updateState(n.id,{interactive:!0})})}get enabled(){return this._enabled}};a(xt,"Inspector");var Ct=xt;export{Ct as Inspector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ne,d as oe,e as re,f as ce,g as ae}from"./chunk-VFSIFWYP.js";import{A as _,B as ve,i as ie}from"./chunk-SHEIERRZ.js";import"./chunk-XIHMUHIU.js";import"./chunk-5KTGEHHQ.js";import"./chunk-DJA7HTCQ.js";import{a as E}from"./chunk-GRB6RQHB.js";import{a as h,e as Oe,f as A,g as ee,h as B,i as te,j as se}from"./chunk-J5IUISYU.js";E();E();function V(r,e,t,s){function i(n){return n instanceof t?n:new t(function(o){o(n)})}return h(i,"adopt"),new(t||(t=Promise))(function(n,o){function c(u){try{d(s.next(u))}catch(f){o(f)}}h(c,"fulfilled");function a(u){try{d(s.throw(u))}catch(f){o(f)}}h(a,"rejected");function d(u){u.done?n(u.value):i(u.value).then(c,a)}h(d,"step"),d((s=s.apply(r,e||[])).next())})}h(V,"__awaiter");var Fe="ENTRIES",fe="KEYS",pe="VALUES",b="",Z=class Z{constructor(e,t){let s=e._tree,i=Array.from(s.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:s,keys:i}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=v(this._path);if(v(t)===b)return{done:!1,value:this.result()};let s=e.get(v(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=v(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>v(e)).filter(e=>e!==b).join("")}value(){return v(this._path).node.get(b)}result(){switch(this._type){case pe:return this.value();case fe:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}};h(Z,"TreeIterator");var M=Z,v=h(r=>r[r.length-1],"last$1"),Me=h((r,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,n=i+t,o=new Uint8Array(n*i).fill(t+1);for(let c=0;c<i;++c)o[c]=c;for(let c=1;c<n;++c)o[c*i]=c;return me(r,e,t,s,o,1,i,""),s},"fuzzySearch"),me=h((r,e,t,s,i,n,o,c)=>{let a=n*o;e:for(let d of r.keys())if(d===b){let u=i[a-1];u<=t&&s.set(c,[r.get(d),u])}else{let u=n;for(let f=0;f<d.length;++f,++u){let l=d[f],m=o*u,y=m-o,p=i[m],g=Math.max(0,u-t-1),w=Math.min(o-1,u+t);for(let S=g;S<w;++S){let P=l!==e[S],W=i[y+S]+ +P,k=i[y+S+1]+1,x=i[m+S]+1,F=i[m+S+1]=Math.min(W,k,x);F<p&&(p=F)}if(p>t)continue e}me(r.get(d),e,t,s,i,u,o,c+d)}},"recurse"),z=class z{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[t,s]=R(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,n]=K(s);for(let o of i.keys())if(o!==b&&o.startsWith(n)){let c=new Map;return c.set(o.slice(n.length),i.get(o)),new z(c,e)}}return new z(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ce(this._tree,e)}entries(){return new M(this,Fe)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return Me(this._tree,e,t)}get(e){let t=Q(this._tree,e);return t!==void 0?t.get(b):void 0}has(e){let t=Q(this._tree,e);return t!==void 0&&t.has(b)}keys(){return new M(this,fe)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,N(this._tree,e).set(b,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=N(this._tree,e);return s.set(b,t(s.get(b))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=N(this._tree,e),i=s.get(b);return i===void 0&&s.set(b,i=t()),i}values(){return new M(this,pe)}[Symbol.iterator](){return this.entries()}static from(e){let t=new z;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return z.from(Object.entries(e))}};h(z,"SearchableMap");var C=z,R=h((r,e,t=[])=>{if(e.length===0||r==null)return[r,t];for(let s of r.keys())if(s!==b&&e.startsWith(s))return t.push([r,s]),R(r.get(s),e.slice(s.length),t);return t.push([r,e]),R(void 0,"",t)},"trackDown"),Q=h((r,e)=>{if(e.length===0||r==null)return r;for(let t of r.keys())if(t!==b&&e.startsWith(t))return Q(r.get(t),e.slice(t.length))},"lookup"),N=h((r,e)=>{let t=e.length;e:for(let s=0;r&&s<t;){for(let n of r.keys())if(n!==b&&e[s]===n[0]){let o=Math.min(t-s,n.length),c=1;for(;c<o&&e[s+c]===n[c];)++c;let a=r.get(n);if(c===n.length)r=a;else{let d=new Map;d.set(n.slice(c),a),r.set(e.slice(s,s+c),d),r.delete(n),r=d}s+=c;continue e}let i=new Map;return r.set(e.slice(s),i),i}return r},"createPath"),Ce=h((r,e)=>{let[t,s]=R(r,e);if(t!==void 0){if(t.delete(b),t.size===0)ge(s);else if(t.size===1){let[i,n]=t.entries().next().value;_e(s,i,n)}}},"remove"),ge=h(r=>{if(r.length===0)return;let[e,t]=K(r);if(e.delete(t),e.size===0)ge(r.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==b&&_e(r.slice(0,-1),s,i)}},"cleanup"),_e=h((r,e,t)=>{if(r.length===0)return;let[s,i]=K(r);s.set(i+e,t),s.delete(i)},"merge"),K=h(r=>r[r.length-1],"last"),Y="or",ye="and",Le="and_not",I=class I{constructor(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?q:e.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},J),e),{autoVacuum:t,searchOptions:Object.assign(Object.assign({},ue),e.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},Te),e.autoSuggestOptions||{})}),this._index=new C,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=G,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:n,idField:o}=this._options,c=t(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));if(this._idToShortId.has(c))throw new Error("MiniSearch: duplicate ID ".concat(c));let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let d of n){let u=t(e,d);if(u==null)continue;let f=s(u.toString(),d),l=this._fieldIds[d],m=new Set(f).size;this.addFieldLength(a,l,this._documentCount-1,m);for(let y of f){let p=i(y,d);if(Array.isArray(p))for(let g of p)this.addTerm(l,a,g);else p&&this.addTerm(l,a,p)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:n,promise:o}=e.reduce(({chunk:c,promise:a},d,u)=>(c.push(d),(u+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(f=>setTimeout(f,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return o.then(()=>this.addAll(n))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:n,idField:o}=this._options,c=i(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));let a=this._idToShortId.get(c);if(a==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(c,": it is not in the index"));for(let d of n){let u=i(e,d);if(u==null)continue;let f=t(u.toString(),d),l=this._fieldIds[d],m=new Set(f).size;this.removeFieldLength(a,l,this._documentCount,m);for(let y of f){let p=s(y,d);if(Array.isArray(p))for(let g of p)this.removeTerm(l,a,g);else p&&this.removeTerm(l,a,p)}}this._storedFields.delete(a),this._documentIds.delete(a),this._idToShortId.delete(c),this._fieldLength.delete(a),this._documentCount-=1}removeAll(e){if(e)for(let t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new C,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let t=this._idToShortId.get(e);if(t==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((s,i)=>{this.removeFieldLength(t,i,this._documentCount,s)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:s,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:s,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let s of e)this.discard(s)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:s}=this._options,i=s(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let s=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=G,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}performVacuuming(e,t){return V(this,void 0,void 0,function*(){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||U.batchSize,n=e.batchWait||U.batchWait,o=1;for(let[c,a]of this._index){for(let[d,u]of a)for(let[f]of u)this._documentIds.has(f)||(u.size<=1?a.delete(d):u.delete(f));this._index.get(c).size===0&&this._index.delete(c),o%i===0&&(yield new Promise(d=>setTimeout(d,n))),o+=1}this._dirtCount-=s}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||q.minDirtCount,s=s||q.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=s}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){let s=this.executeQuery(e,t),i=[];for(let[n,{score:o,terms:c,match:a}]of s){let d=c.length||1,u={id:this._documentIds.get(n),score:o*d,terms:Object.keys(a),queryTerms:c,match:a};Object.assign(u,this._storedFields.get(n)),(t.filter==null||t.filter(u))&&i.push(u)}return e===I.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||i.sort(le),i}autoSuggest(e,t={}){t=Object.assign(Object.assign({},this._options.autoSuggestOptions),t);let s=new Map;for(let{score:n,terms:o}of this.search(e,t)){let c=o.join(" "),a=s.get(c);a!=null?(a.score+=n,a.count+=1):s.set(c,{score:n,terms:o,count:1})}let i=[];for(let[n,{score:o,terms:c,count:a}]of s)i.push({suggestion:n,terms:c,score:o/a});return i.sort(le),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static loadJSONAsync(e,t){return V(this,void 0,void 0,function*(){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)})}static getDefault(e){if(J.hasOwnProperty(e))return $(J,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:n,storedFields:o,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=j(i),a._fieldLength=j(n),a._storedFields=j(o);for(let[d,u]of a._documentIds)a._idToShortId.set(u,d);for(let[d,u]of s){let f=new Map;for(let l of Object.keys(u)){let m=u[l];c===1&&(m=m.ds),f.set(parseInt(l,10),j(m))}a._index.set(d,f)}return a}static loadJSAsync(e,t){return V(this,void 0,void 0,function*(){let{index:s,documentIds:i,fieldLength:n,storedFields:o,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=yield T(i),a._fieldLength=yield T(n),a._storedFields=yield T(o);for(let[u,f]of a._documentIds)a._idToShortId.set(f,u);let d=0;for(let[u,f]of s){let l=new Map;for(let m of Object.keys(f)){let y=f[m];c===1&&(y=y.ds),l.set(parseInt(m,10),yield T(y))}++d%1e3===0&&(yield be(0)),a._index.set(u,l)}return a})}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:n,averageFieldLength:o,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let d=new I(t);return d._documentCount=s,d._nextId=i,d._idToShortId=new Map,d._fieldIds=n,d._avgFieldLength=o,d._dirtCount=c||0,d._index=new C,d}executeQuery(e,t={}){if(e===I.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let l=Object.assign(Object.assign(Object.assign({},t),e),{queries:void 0}),m=e.queries.map(y=>this.executeQuery(y,l));return this.combineResults(m,l.combineWith)}let{tokenize:s,processTerm:i,searchOptions:n}=this._options,o=Object.assign(Object.assign({tokenize:s,processTerm:i},n),t),{tokenize:c,processTerm:a}=o,f=c(e).flatMap(l=>a(l)).filter(l=>!!l).map(je(o)).map(l=>this.executeQuerySpec(l,o));return this.combineResults(f,o.combineWith)}executeQuerySpec(e,t){let s=Object.assign(Object.assign({},this._options.searchOptions),t),i=(s.fields||this._options.fields).reduce((p,g)=>Object.assign(Object.assign({},p),{[g]:$(s.boost,g)||1}),{}),{boostDocument:n,weights:o,maxFuzzy:c,bm25:a}=s,{fuzzy:d,prefix:u}=Object.assign(Object.assign({},ue.weights),o),f=this._index.get(e.term),l=this.termResults(e.term,e.term,1,e.termBoost,f,i,n,a),m,y;if(e.prefix&&(m=this._index.atPrefix(e.term)),e.fuzzy){let p=e.fuzzy===!0?.2:e.fuzzy,g=p<1?Math.min(c,Math.round(e.term.length*p)):p;g&&(y=this._index.fuzzyGet(e.term,g))}if(m)for(let[p,g]of m){let w=p.length-e.term.length;if(!w)continue;y==null||y.delete(p);let S=u*p.length/(p.length+.3*w);this.termResults(e.term,p,S,e.termBoost,g,i,n,a,l)}if(y)for(let p of y.keys()){let[g,w]=y.get(p);if(!w)continue;let S=d*p.length/(p.length+w);this.termResults(e.term,p,S,e.termBoost,g,i,n,a,l)}return l}executeWildcardQuery(e){let t=new Map,s=Object.assign(Object.assign({},this._options.searchOptions),e);for(let[i,n]of this._documentIds){let o=s.boostDocument?s.boostDocument(n,"",this._storedFields.get(i)):1;t.set(i,{score:o,terms:[],match:{}})}return t}combineResults(e,t=Y){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ke[s];if(!i)throw new Error("Invalid combination operator: ".concat(t));return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[n,o]of s)i[n]=Object.fromEntries(o);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,s,i,n,o,c,a,d=new Map){if(n==null)return d;for(let u of Object.keys(o)){let f=o[u],l=this._fieldIds[u],m=n.get(l);if(m==null)continue;let y=m.size,p=this._avgFieldLength[l];for(let g of m.keys()){if(!this._documentIds.has(g)){this.removeTerm(l,g,t),y-=1;continue}let w=c?c(this._documentIds.get(g),t,this._storedFields.get(g)):1;if(!w)continue;let S=m.get(g),P=this._fieldLength.get(g)[l],W=Ee(S,y,this._documentCount,P,p,a),k=s*i*f*w*W,x=d.get(g);if(x){x.score+=k,Ve(x.terms,e);let F=$(x.match,t);F?F.push(u):x.match[t]=[u]}else d.set(g,{score:k,terms:[e],match:{[t]:[u]}})}}return d}addTerm(e,t,s){let i=this._index.fetch(s,he),n=i.get(e);if(n==null)n=new Map,n.set(t,1),i.set(e,n);else{let o=n.get(t);n.set(t,(o||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,he),n=i.get(e);n==null||n.get(t)==null?this.warnDocumentChanged(t,e,s):n.get(t)<=1?n.size<=1?i.delete(e):n.delete(t):n.set(t,n.get(t)-1),this._index.get(s).size===0&&this._index.delete(s)}warnDocumentChanged(e,t,s){for(let i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(s,'" was not present in field "').concat(i,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,s,i){let n=this._fieldLength.get(e);n==null&&this._fieldLength.set(e,n=[]),n[t]=i;let c=(this._avgFieldLength[t]||0)*s+i;this._avgFieldLength[t]=c/(s+1)}removeFieldLength(e,t,s,i){if(s===1){this._avgFieldLength[t]=0;return}let n=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=n/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let n=this._storedFields.get(e);n==null&&this._storedFields.set(e,n={});for(let o of s){let c=i(t,o);c!==void 0&&(n[o]=c)}}};h(I,"MiniSearch");var O=I;O.wildcard=Symbol("*");var $=h((r,e)=>Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0,"getOwnProperty"),ke={[Y]:(r,e)=>{for(let t of e.keys()){let s=r.get(t);if(s==null)r.set(t,e.get(t));else{let{score:i,terms:n,match:o}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,o),de(s.terms,n)}}return r},[ye]:(r,e)=>{let t=new Map;for(let s of e.keys()){let i=r.get(s);if(i==null)continue;let{score:n,terms:o,match:c}=e.get(s);de(i.terms,o),t.set(s,{score:i.score+n,terms:i.terms,match:Object.assign(i.match,c)})}return t},[Le]:(r,e)=>{for(let t of e.keys())r.delete(t);return r}},Ae={k:1.2,b:.7,d:.5},Ee=h((r,e,t,s,i,n)=>{let{k:o,b:c,d:a}=n;return Math.log(1+(t-e+.5)/(e+.5))*(a+r*(o+1)/(r+o*(1-c+c*s/i)))},"calcBM25Score"),je=h(r=>(e,t,s)=>{let i=typeof r.fuzzy=="function"?r.fuzzy(e,t,s):r.fuzzy||!1,n=typeof r.prefix=="function"?r.prefix(e,t,s):r.prefix===!0,o=typeof r.boostTerm=="function"?r.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:n,termBoost:o}},"termToQuerySpec"),J={idField:"id",extractField:(r,e)=>r[e],tokenize:r=>r.split(Re),processTerm:r=>r.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(r,e)=>{typeof(console==null?void 0:console[r])=="function"&&console[r](e)},autoVacuum:!0},ue={combineWith:Y,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Ae},Te={combineWith:ye,prefix:(r,e,t)=>e===t.length-1},U={batchSize:1e3,batchWait:10},G={minDirtFactor:.1,minDirtCount:20},q=Object.assign(Object.assign({},U),G),Ve=h((r,e)=>{r.includes(e)||r.push(e)},"assignUniqueTerm"),de=h((r,e)=>{for(let t of e)r.includes(t)||r.push(t)},"assignUniqueTerms"),le=h(({score:r},{score:e})=>e-r,"byScore"),he=h(()=>new Map,"createMap"),j=h(r=>{let e=new Map;for(let t of Object.keys(r))e.set(parseInt(t,10),r[t]);return e},"objectToNumericMap"),T=h(r=>V(void 0,void 0,void 0,function*(){let e=new Map,t=0;for(let s of Object.keys(r))e.set(parseInt(s,10),r[s]),++t%1e3===0&&(yield be(0));return e}),"objectToNumericMapAsync"),be=h(r=>new Promise(e=>setTimeout(e,r)),"wait"),Re=/[\n\r\p{Z}\p{P}]+/u;var xe=Oe(ve(),1);var L,D,ze,X=class X{constructor(e){B(this,D);A(this,"mapData");A(this,"indexes");A(this,"ready");B(this,L,void 0);this.mapData=e,this.indexes=We(e),this.ready=this.populate(),te(this,L,ie(se(this,D,ze).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,n=[];return e.removeAll(),n.concat([e.addAllAsync(i.getByType("space")),e.addAllAsync(i.getByType("point-of-interest")),e.addAllAsync(i.getByType("connection")),e.addAllAsync(i.getByType("floor")),e.addAllAsync(i.getByType("door")),e.addAllAsync(i.getByType("annotation")),e.addAllAsync(i.getByType("area"))]),t&&(t==null||t.removeAll(),n.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s==null||s.removeAll(),n.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(n)}async search(e,t={}){var a,d;await this.ready,Be.parse(t);let s=(0,xe.default)({},t,Pe),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(u=>s.places.fields[u])}).slice(0,s.places.limit),n=(a=this.indexes.enterpriseLocations)==null?void 0:a.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(u=>s.enterpriseLocations.fields[u])}).slice(0,s.enterpriseLocations.limit),o=(d=this.indexes.enterpriseCategories)==null?void 0:d.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(u=>s.enterpriseCategories.fields[u])}).slice(0,s.enterpriseCategories.limit),c=De(this.mapData,{placesResult:i,locationsResult:n,categoriesResult:o});return ee(this,L).call(this,e),c}async suggest(e,t={}){await this.ready,Ne.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:n=!0}={}}=t;return n&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(o=>s.push(o)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(o=>s.push(o)),s.sort((o,c)=>c.score-o.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(o=>o.suggestion)}),s}};L=new WeakMap,D=new WeakSet,ze=h(function(e){this.mapData.Analytics.capture("$query-search",{query:e})},"#trackSearch"),h(X,"InternalSearch");var Se=X;function De(r,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:d,score:u,__type:f})=>{let l=r.getById(f,a);return l!=null&&!ne.is(l)&&!oe.is(l)&&!re.is(l)&&!ce.is(l)&&!ae.is(l)&&c.push({type:l.__type,match:d,score:u,item:l}),c},[]),n;if(t){n=[];for(let{id:c,match:a,score:d}of t){let u=r.getById("enterprise-location",c);u&&n.push({type:u.__type,match:a,score:d,item:u})}}let o;if(s){o=[];for(let{id:c,match:a,score:d}of s){let u=r.getById("enterprise-category",c);u&&o.push({type:u.__type,match:a,score:d,item:u})}}return{places:i,enterpriseLocations:n,enterpriseCategories:o}}h(De,"processSearchResult");var Pe={places:{fields:{name:!0,description:!0},limit:5},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0},limit:5},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0},limit:5}};function H(r){return r.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}h(H,"removeAccents");function We(r){let e=new O({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(o,c)=>{let a=o[c];return typeof a=="string"?H(a):o[c]},processTerm:o=>$e.has(o)?"":o.toLowerCase()}),t=r.getByType("enterprise-location"),s;t&&(s=new O({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(o,c)=>Array.isArray(o[c])?o[c].join(" "):typeof o[c]=="string"?H(o[c]):o[c]}));let i=r.getByType("enterprise-category"),n;return i&&(n=new O({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(o,c){return c==="locations.name"?o.locations.reduce((d,u)=>d+" ".concat(we," ")+u.name,"")+" ".concat(we):typeof o[c]=="string"?H(o[c]):o[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:n,enterpriseLocations:s,places:e}}h(We,"buildIndexes");var Be=_.object({places:_.object({fields:_.object({name:_.boolean().optional(),description:_.boolean().optional()}).optional(),limit:_.number().positive().optional()}).optional(),enterpriseCategories:_.object({fields:_.object({name:_.boolean().optional(),description:_.boolean().optional(),"locations.name":_.boolean().optional()}).optional(),limit:_.number().positive().optional()}).optional(),enterpriseLocations:_.object({fields:_.object({name:_.boolean().optional(),tags:_.boolean().optional(),description:_.boolean().optional()}).optional(),limit:_.number().positive().optional()}).optional()}),Ne=_.object({places:_.object({enabled:_.boolean().optional()}).optional(),enterpriseLocations:_.object({enabled:_.boolean().optional()}).optional()}),$e=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),we="";export{Se as InternalSearch,H as removeAccents};
|
|
1
|
+
import{b as ne,d as oe,e as re,f as ce,g as ae}from"./chunk-KPW4CO5D.js";import{A as _,B as ve,i as ie}from"./chunk-CPI6X7UJ.js";import"./chunk-FLFBEGLN.js";import"./chunk-ZXWC3C7V.js";import"./chunk-ZQUOGXWB.js";import{a as E}from"./chunk-HBL5RRXD.js";import{a as h,e as Oe,f as A,g as ee,h as B,i as te,j as se}from"./chunk-J5IUISYU.js";E();E();function V(r,e,t,s){function i(n){return n instanceof t?n:new t(function(o){o(n)})}return h(i,"adopt"),new(t||(t=Promise))(function(n,o){function c(u){try{d(s.next(u))}catch(f){o(f)}}h(c,"fulfilled");function a(u){try{d(s.throw(u))}catch(f){o(f)}}h(a,"rejected");function d(u){u.done?n(u.value):i(u.value).then(c,a)}h(d,"step"),d((s=s.apply(r,e||[])).next())})}h(V,"__awaiter");var Fe="ENTRIES",fe="KEYS",pe="VALUES",b="",Z=class Z{constructor(e,t){let s=e._tree,i=Array.from(s.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:s,keys:i}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=v(this._path);if(v(t)===b)return{done:!1,value:this.result()};let s=e.get(v(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=v(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>v(e)).filter(e=>e!==b).join("")}value(){return v(this._path).node.get(b)}result(){switch(this._type){case pe:return this.value();case fe:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}};h(Z,"TreeIterator");var M=Z,v=h(r=>r[r.length-1],"last$1"),Me=h((r,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,n=i+t,o=new Uint8Array(n*i).fill(t+1);for(let c=0;c<i;++c)o[c]=c;for(let c=1;c<n;++c)o[c*i]=c;return me(r,e,t,s,o,1,i,""),s},"fuzzySearch"),me=h((r,e,t,s,i,n,o,c)=>{let a=n*o;e:for(let d of r.keys())if(d===b){let u=i[a-1];u<=t&&s.set(c,[r.get(d),u])}else{let u=n;for(let f=0;f<d.length;++f,++u){let l=d[f],m=o*u,y=m-o,p=i[m],g=Math.max(0,u-t-1),w=Math.min(o-1,u+t);for(let S=g;S<w;++S){let P=l!==e[S],W=i[y+S]+ +P,k=i[y+S+1]+1,x=i[m+S]+1,F=i[m+S+1]=Math.min(W,k,x);F<p&&(p=F)}if(p>t)continue e}me(r.get(d),e,t,s,i,u,o,c+d)}},"recurse"),z=class z{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[t,s]=R(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,n]=K(s);for(let o of i.keys())if(o!==b&&o.startsWith(n)){let c=new Map;return c.set(o.slice(n.length),i.get(o)),new z(c,e)}}return new z(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ce(this._tree,e)}entries(){return new M(this,Fe)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return Me(this._tree,e,t)}get(e){let t=Q(this._tree,e);return t!==void 0?t.get(b):void 0}has(e){let t=Q(this._tree,e);return t!==void 0&&t.has(b)}keys(){return new M(this,fe)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,N(this._tree,e).set(b,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=N(this._tree,e);return s.set(b,t(s.get(b))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=N(this._tree,e),i=s.get(b);return i===void 0&&s.set(b,i=t()),i}values(){return new M(this,pe)}[Symbol.iterator](){return this.entries()}static from(e){let t=new z;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return z.from(Object.entries(e))}};h(z,"SearchableMap");var C=z,R=h((r,e,t=[])=>{if(e.length===0||r==null)return[r,t];for(let s of r.keys())if(s!==b&&e.startsWith(s))return t.push([r,s]),R(r.get(s),e.slice(s.length),t);return t.push([r,e]),R(void 0,"",t)},"trackDown"),Q=h((r,e)=>{if(e.length===0||r==null)return r;for(let t of r.keys())if(t!==b&&e.startsWith(t))return Q(r.get(t),e.slice(t.length))},"lookup"),N=h((r,e)=>{let t=e.length;e:for(let s=0;r&&s<t;){for(let n of r.keys())if(n!==b&&e[s]===n[0]){let o=Math.min(t-s,n.length),c=1;for(;c<o&&e[s+c]===n[c];)++c;let a=r.get(n);if(c===n.length)r=a;else{let d=new Map;d.set(n.slice(c),a),r.set(e.slice(s,s+c),d),r.delete(n),r=d}s+=c;continue e}let i=new Map;return r.set(e.slice(s),i),i}return r},"createPath"),Ce=h((r,e)=>{let[t,s]=R(r,e);if(t!==void 0){if(t.delete(b),t.size===0)ge(s);else if(t.size===1){let[i,n]=t.entries().next().value;_e(s,i,n)}}},"remove"),ge=h(r=>{if(r.length===0)return;let[e,t]=K(r);if(e.delete(t),e.size===0)ge(r.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==b&&_e(r.slice(0,-1),s,i)}},"cleanup"),_e=h((r,e,t)=>{if(r.length===0)return;let[s,i]=K(r);s.set(i+e,t),s.delete(i)},"merge"),K=h(r=>r[r.length-1],"last"),Y="or",ye="and",Le="and_not",I=class I{constructor(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?q:e.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},J),e),{autoVacuum:t,searchOptions:Object.assign(Object.assign({},ue),e.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},Te),e.autoSuggestOptions||{})}),this._index=new C,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=G,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:n,idField:o}=this._options,c=t(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));if(this._idToShortId.has(c))throw new Error("MiniSearch: duplicate ID ".concat(c));let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let d of n){let u=t(e,d);if(u==null)continue;let f=s(u.toString(),d),l=this._fieldIds[d],m=new Set(f).size;this.addFieldLength(a,l,this._documentCount-1,m);for(let y of f){let p=i(y,d);if(Array.isArray(p))for(let g of p)this.addTerm(l,a,g);else p&&this.addTerm(l,a,p)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:n,promise:o}=e.reduce(({chunk:c,promise:a},d,u)=>(c.push(d),(u+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(f=>setTimeout(f,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return o.then(()=>this.addAll(n))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:n,idField:o}=this._options,c=i(e,o);if(c==null)throw new Error('MiniSearch: document does not have ID field "'.concat(o,'"'));let a=this._idToShortId.get(c);if(a==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(c,": it is not in the index"));for(let d of n){let u=i(e,d);if(u==null)continue;let f=t(u.toString(),d),l=this._fieldIds[d],m=new Set(f).size;this.removeFieldLength(a,l,this._documentCount,m);for(let y of f){let p=s(y,d);if(Array.isArray(p))for(let g of p)this.removeTerm(l,a,g);else p&&this.removeTerm(l,a,p)}}this._storedFields.delete(a),this._documentIds.delete(a),this._idToShortId.delete(c),this._fieldLength.delete(a),this._documentCount-=1}removeAll(e){if(e)for(let t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new C,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let t=this._idToShortId.get(e);if(t==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((s,i)=>{this.removeFieldLength(t,i,this._documentCount,s)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:s,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:s,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let s of e)this.discard(s)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:s}=this._options,i=s(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let s=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=G,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}performVacuuming(e,t){return V(this,void 0,void 0,function*(){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||U.batchSize,n=e.batchWait||U.batchWait,o=1;for(let[c,a]of this._index){for(let[d,u]of a)for(let[f]of u)this._documentIds.has(f)||(u.size<=1?a.delete(d):u.delete(f));this._index.get(c).size===0&&this._index.delete(c),o%i===0&&(yield new Promise(d=>setTimeout(d,n))),o+=1}this._dirtCount-=s}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||q.minDirtCount,s=s||q.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=s}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){let s=this.executeQuery(e,t),i=[];for(let[n,{score:o,terms:c,match:a}]of s){let d=c.length||1,u={id:this._documentIds.get(n),score:o*d,terms:Object.keys(a),queryTerms:c,match:a};Object.assign(u,this._storedFields.get(n)),(t.filter==null||t.filter(u))&&i.push(u)}return e===I.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||i.sort(le),i}autoSuggest(e,t={}){t=Object.assign(Object.assign({},this._options.autoSuggestOptions),t);let s=new Map;for(let{score:n,terms:o}of this.search(e,t)){let c=o.join(" "),a=s.get(c);a!=null?(a.score+=n,a.count+=1):s.set(c,{score:n,terms:o,count:1})}let i=[];for(let[n,{score:o,terms:c,count:a}]of s)i.push({suggestion:n,terms:c,score:o/a});return i.sort(le),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static loadJSONAsync(e,t){return V(this,void 0,void 0,function*(){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)})}static getDefault(e){if(J.hasOwnProperty(e))return $(J,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:n,storedFields:o,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=j(i),a._fieldLength=j(n),a._storedFields=j(o);for(let[d,u]of a._documentIds)a._idToShortId.set(u,d);for(let[d,u]of s){let f=new Map;for(let l of Object.keys(u)){let m=u[l];c===1&&(m=m.ds),f.set(parseInt(l,10),j(m))}a._index.set(d,f)}return a}static loadJSAsync(e,t){return V(this,void 0,void 0,function*(){let{index:s,documentIds:i,fieldLength:n,storedFields:o,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=yield T(i),a._fieldLength=yield T(n),a._storedFields=yield T(o);for(let[u,f]of a._documentIds)a._idToShortId.set(f,u);let d=0;for(let[u,f]of s){let l=new Map;for(let m of Object.keys(f)){let y=f[m];c===1&&(y=y.ds),l.set(parseInt(m,10),yield T(y))}++d%1e3===0&&(yield be(0)),a._index.set(u,l)}return a})}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:n,averageFieldLength:o,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let d=new I(t);return d._documentCount=s,d._nextId=i,d._idToShortId=new Map,d._fieldIds=n,d._avgFieldLength=o,d._dirtCount=c||0,d._index=new C,d}executeQuery(e,t={}){if(e===I.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let l=Object.assign(Object.assign(Object.assign({},t),e),{queries:void 0}),m=e.queries.map(y=>this.executeQuery(y,l));return this.combineResults(m,l.combineWith)}let{tokenize:s,processTerm:i,searchOptions:n}=this._options,o=Object.assign(Object.assign({tokenize:s,processTerm:i},n),t),{tokenize:c,processTerm:a}=o,f=c(e).flatMap(l=>a(l)).filter(l=>!!l).map(je(o)).map(l=>this.executeQuerySpec(l,o));return this.combineResults(f,o.combineWith)}executeQuerySpec(e,t){let s=Object.assign(Object.assign({},this._options.searchOptions),t),i=(s.fields||this._options.fields).reduce((p,g)=>Object.assign(Object.assign({},p),{[g]:$(s.boost,g)||1}),{}),{boostDocument:n,weights:o,maxFuzzy:c,bm25:a}=s,{fuzzy:d,prefix:u}=Object.assign(Object.assign({},ue.weights),o),f=this._index.get(e.term),l=this.termResults(e.term,e.term,1,e.termBoost,f,i,n,a),m,y;if(e.prefix&&(m=this._index.atPrefix(e.term)),e.fuzzy){let p=e.fuzzy===!0?.2:e.fuzzy,g=p<1?Math.min(c,Math.round(e.term.length*p)):p;g&&(y=this._index.fuzzyGet(e.term,g))}if(m)for(let[p,g]of m){let w=p.length-e.term.length;if(!w)continue;y==null||y.delete(p);let S=u*p.length/(p.length+.3*w);this.termResults(e.term,p,S,e.termBoost,g,i,n,a,l)}if(y)for(let p of y.keys()){let[g,w]=y.get(p);if(!w)continue;let S=d*p.length/(p.length+w);this.termResults(e.term,p,S,e.termBoost,g,i,n,a,l)}return l}executeWildcardQuery(e){let t=new Map,s=Object.assign(Object.assign({},this._options.searchOptions),e);for(let[i,n]of this._documentIds){let o=s.boostDocument?s.boostDocument(n,"",this._storedFields.get(i)):1;t.set(i,{score:o,terms:[],match:{}})}return t}combineResults(e,t=Y){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ke[s];if(!i)throw new Error("Invalid combination operator: ".concat(t));return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[n,o]of s)i[n]=Object.fromEntries(o);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,s,i,n,o,c,a,d=new Map){if(n==null)return d;for(let u of Object.keys(o)){let f=o[u],l=this._fieldIds[u],m=n.get(l);if(m==null)continue;let y=m.size,p=this._avgFieldLength[l];for(let g of m.keys()){if(!this._documentIds.has(g)){this.removeTerm(l,g,t),y-=1;continue}let w=c?c(this._documentIds.get(g),t,this._storedFields.get(g)):1;if(!w)continue;let S=m.get(g),P=this._fieldLength.get(g)[l],W=Ee(S,y,this._documentCount,P,p,a),k=s*i*f*w*W,x=d.get(g);if(x){x.score+=k,Ve(x.terms,e);let F=$(x.match,t);F?F.push(u):x.match[t]=[u]}else d.set(g,{score:k,terms:[e],match:{[t]:[u]}})}}return d}addTerm(e,t,s){let i=this._index.fetch(s,he),n=i.get(e);if(n==null)n=new Map,n.set(t,1),i.set(e,n);else{let o=n.get(t);n.set(t,(o||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,he),n=i.get(e);n==null||n.get(t)==null?this.warnDocumentChanged(t,e,s):n.get(t)<=1?n.size<=1?i.delete(e):n.delete(t):n.set(t,n.get(t)-1),this._index.get(s).size===0&&this._index.delete(s)}warnDocumentChanged(e,t,s){for(let i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(s,'" was not present in field "').concat(i,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,s,i){let n=this._fieldLength.get(e);n==null&&this._fieldLength.set(e,n=[]),n[t]=i;let c=(this._avgFieldLength[t]||0)*s+i;this._avgFieldLength[t]=c/(s+1)}removeFieldLength(e,t,s,i){if(s===1){this._avgFieldLength[t]=0;return}let n=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=n/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let n=this._storedFields.get(e);n==null&&this._storedFields.set(e,n={});for(let o of s){let c=i(t,o);c!==void 0&&(n[o]=c)}}};h(I,"MiniSearch");var O=I;O.wildcard=Symbol("*");var $=h((r,e)=>Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0,"getOwnProperty"),ke={[Y]:(r,e)=>{for(let t of e.keys()){let s=r.get(t);if(s==null)r.set(t,e.get(t));else{let{score:i,terms:n,match:o}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,o),de(s.terms,n)}}return r},[ye]:(r,e)=>{let t=new Map;for(let s of e.keys()){let i=r.get(s);if(i==null)continue;let{score:n,terms:o,match:c}=e.get(s);de(i.terms,o),t.set(s,{score:i.score+n,terms:i.terms,match:Object.assign(i.match,c)})}return t},[Le]:(r,e)=>{for(let t of e.keys())r.delete(t);return r}},Ae={k:1.2,b:.7,d:.5},Ee=h((r,e,t,s,i,n)=>{let{k:o,b:c,d:a}=n;return Math.log(1+(t-e+.5)/(e+.5))*(a+r*(o+1)/(r+o*(1-c+c*s/i)))},"calcBM25Score"),je=h(r=>(e,t,s)=>{let i=typeof r.fuzzy=="function"?r.fuzzy(e,t,s):r.fuzzy||!1,n=typeof r.prefix=="function"?r.prefix(e,t,s):r.prefix===!0,o=typeof r.boostTerm=="function"?r.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:n,termBoost:o}},"termToQuerySpec"),J={idField:"id",extractField:(r,e)=>r[e],tokenize:r=>r.split(Re),processTerm:r=>r.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(r,e)=>{typeof(console==null?void 0:console[r])=="function"&&console[r](e)},autoVacuum:!0},ue={combineWith:Y,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Ae},Te={combineWith:ye,prefix:(r,e,t)=>e===t.length-1},U={batchSize:1e3,batchWait:10},G={minDirtFactor:.1,minDirtCount:20},q=Object.assign(Object.assign({},U),G),Ve=h((r,e)=>{r.includes(e)||r.push(e)},"assignUniqueTerm"),de=h((r,e)=>{for(let t of e)r.includes(t)||r.push(t)},"assignUniqueTerms"),le=h(({score:r},{score:e})=>e-r,"byScore"),he=h(()=>new Map,"createMap"),j=h(r=>{let e=new Map;for(let t of Object.keys(r))e.set(parseInt(t,10),r[t]);return e},"objectToNumericMap"),T=h(r=>V(void 0,void 0,void 0,function*(){let e=new Map,t=0;for(let s of Object.keys(r))e.set(parseInt(s,10),r[s]),++t%1e3===0&&(yield be(0));return e}),"objectToNumericMapAsync"),be=h(r=>new Promise(e=>setTimeout(e,r)),"wait"),Re=/[\n\r\p{Z}\p{P}]+/u;var xe=Oe(ve(),1);var L,D,ze,X=class X{constructor(e){B(this,D);A(this,"mapData");A(this,"indexes");A(this,"ready");B(this,L,void 0);this.mapData=e,this.indexes=We(e),this.ready=this.populate(),te(this,L,ie(se(this,D,ze).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,n=[];return e.removeAll(),n.concat([e.addAllAsync(i.getByType("space")),e.addAllAsync(i.getByType("point-of-interest")),e.addAllAsync(i.getByType("connection")),e.addAllAsync(i.getByType("floor")),e.addAllAsync(i.getByType("door")),e.addAllAsync(i.getByType("annotation")),e.addAllAsync(i.getByType("area"))]),t&&(t==null||t.removeAll(),n.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s==null||s.removeAll(),n.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(n)}async search(e,t={}){var a,d;await this.ready,Be.parse(t);let s=(0,xe.default)({},t,Pe),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(u=>s.places.fields[u])}).slice(0,s.places.limit),n=(a=this.indexes.enterpriseLocations)==null?void 0:a.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(u=>s.enterpriseLocations.fields[u])}).slice(0,s.enterpriseLocations.limit),o=(d=this.indexes.enterpriseCategories)==null?void 0:d.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(u=>s.enterpriseCategories.fields[u])}).slice(0,s.enterpriseCategories.limit),c=De(this.mapData,{placesResult:i,locationsResult:n,categoriesResult:o});return ee(this,L).call(this,e),c}async suggest(e,t={}){await this.ready,Ne.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:n=!0}={}}=t;return n&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(o=>s.push(o)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(o=>s.push(o)),s.sort((o,c)=>c.score-o.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(o=>o.suggestion)}),s}};L=new WeakMap,D=new WeakSet,ze=h(function(e){this.mapData.Analytics.capture("$query-search",{query:e})},"#trackSearch"),h(X,"InternalSearch");var Se=X;function De(r,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:d,score:u,__type:f})=>{let l=r.getById(f,a);return l!=null&&!ne.is(l)&&!oe.is(l)&&!re.is(l)&&!ce.is(l)&&!ae.is(l)&&c.push({type:l.__type,match:d,score:u,item:l}),c},[]),n;if(t){n=[];for(let{id:c,match:a,score:d}of t){let u=r.getById("enterprise-location",c);u&&n.push({type:u.__type,match:a,score:d,item:u})}}let o;if(s){o=[];for(let{id:c,match:a,score:d}of s){let u=r.getById("enterprise-category",c);u&&o.push({type:u.__type,match:a,score:d,item:u})}}return{places:i,enterpriseLocations:n,enterpriseCategories:o}}h(De,"processSearchResult");var Pe={places:{fields:{name:!0,description:!0},limit:5},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0},limit:5},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0},limit:5}};function H(r){return r.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}h(H,"removeAccents");function We(r){let e=new O({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(o,c)=>{let a=o[c];return typeof a=="string"?H(a):o[c]},processTerm:o=>$e.has(o)?"":o.toLowerCase()}),t=r.getByType("enterprise-location"),s;t&&(s=new O({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(o,c)=>Array.isArray(o[c])?o[c].join(" "):typeof o[c]=="string"?H(o[c]):o[c]}));let i=r.getByType("enterprise-category"),n;return i&&(n=new O({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(o,c){return c==="locations.name"?o.locations.reduce((d,u)=>d+" ".concat(we," ")+u.name,"")+" ".concat(we):typeof o[c]=="string"?H(o[c]):o[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:n,enterpriseLocations:s,places:e}}h(We,"buildIndexes");var Be=_.object({places:_.object({fields:_.object({name:_.boolean().optional(),description:_.boolean().optional()}).optional(),limit:_.number().positive().optional()}).optional(),enterpriseCategories:_.object({fields:_.object({name:_.boolean().optional(),description:_.boolean().optional(),"locations.name":_.boolean().optional()}).optional(),limit:_.number().positive().optional()}).optional(),enterpriseLocations:_.object({fields:_.object({name:_.boolean().optional(),tags:_.boolean().optional(),description:_.boolean().optional()}).optional(),limit:_.number().positive().optional()}).optional()}),Ne=_.object({places:_.object({enabled:_.boolean().optional()}).optional(),enterpriseLocations:_.object({enabled:_.boolean().optional()}).optional()}),$e=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),we="";export{Se as InternalSearch,H as removeAccents};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
1
|
+
import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-FLFBEGLN.js";import"./chunk-HBL5RRXD.js";import"./chunk-J5IUISYU.js";var export_Point=T.default;export{d as AJAXError,J as AttributionControl,y as BoxZoomHandler,q as CanvasSource,I as CooperativeGesturesHandler,E as DoubleClickZoomHandler,F as DragPanHandler,G as DragRotateHandler,t as EdgeInsets,e as Evented,Q as FullscreenControl,n as GeoJSONSource,O as GeolocateControl,u as Hash,o as ImageSource,C as KeyboardHandler,h as LngLat,i as LngLatBounds,K as LogoControl,L as Map,v as MapMouseEvent,w as MapTouchEvent,x as MapWheelEvent,N as Marker,j as MercatorCoordinate,M as NavigationControl,export_Point as Point,S as Popup,m as RasterDEMTileSource,l as RasterTileSource,P as ScaleControl,D as ScrollZoomHandler,s as Style,R as TerrainControl,B as TwoFingersTouchPitchHandler,A as TwoFingersTouchRotateHandler,z as TwoFingersTouchZoomHandler,H as TwoFingersTouchZoomRotateHandler,k as VectorTileSource,p as VideoSource,b as addProtocol,r as addSourceType,g as clearPrewarmedResources,a as config,Z as getMaxParallelImageRequests,V as getRTLTextPluginStatus,W as getVersion,X as getWorkerCount,$ as getWorkerUrl,ba as importScriptInWorkers,f as prewarm,c as removeProtocol,_ as setMaxParallelImageRequests,U as setRTLTextPlugin,Y as setWorkerCount,aa as setWorkerUrl};
|