@mappedin/mappedin-js 6.0.1-beta.52 → 6.0.1-beta.53

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.
Files changed (41) hide show
  1. package/lib/esm/{GLTFExporter-QN63B2QE.js → GLTFExporter-YFXXQH2L.js} +2 -2
  2. package/lib/esm/{GLTFLoader-7E66XH6W.js → GLTFLoader-LZNQSDLP.js} +2 -2
  3. package/lib/esm/{browser-UPE3UIJH.js → browser-L6WJGOEX.js} +2 -2
  4. package/lib/esm/{chunk-RMM4JL5D.js → chunk-BNEW6WES.js} +2 -2
  5. package/lib/esm/{chunk-EDIABNX3.js → chunk-EMVX4D2H.js} +2 -2
  6. package/lib/esm/{chunk-A2N3FISM.js → chunk-KKLQ3TRA.js} +3 -3
  7. package/lib/esm/{chunk-A2N3FISM.js.map → chunk-KKLQ3TRA.js.map} +3 -3
  8. package/lib/esm/{chunk-F3D2AS2N.js → chunk-LWBDZWW4.js} +2 -2
  9. package/lib/esm/chunk-ROCNZJLL.js +2 -0
  10. package/lib/esm/chunk-T5QQA4HH.js +2 -0
  11. package/lib/esm/{chunk-X26M5SQZ.js.map → chunk-T5QQA4HH.js.map} +1 -1
  12. package/lib/esm/chunk-W57RTQ3G.js +2214 -0
  13. package/lib/esm/{chunk-CUKGTP3B.js.map → chunk-W57RTQ3G.js.map} +4 -4
  14. package/lib/esm/{chunk-UQJ6CFWP.js → chunk-Y5QWL6TS.js} +2 -2
  15. package/lib/esm/{dist-33QC5I55.js → dist-HJXMUEN5.js} +2 -2
  16. package/lib/esm/index.d.ts +614 -480
  17. package/lib/esm/index.js +1 -1
  18. package/lib/esm/{inspector-2YAWFES6.js → inspector-FXVGOLBH.js} +2 -2
  19. package/lib/esm/{internal-GHV4UNDA.js → internal-7ECOLP5R.js} +2 -2
  20. package/lib/esm/{outdoor-context-v4-5AXRLXXA.js → outdoor-context-v4-IZYE32JG.js} +2 -2
  21. package/lib/esm/{roboto-regular-25PMWR2T.js → roboto-regular-R5KXKW73.js} +2 -2
  22. package/lib/esm/{text3d-3IUOJSOH.js → text3d-2TVGBQ3N.js} +18 -18
  23. package/lib/esm/{text3d-3IUOJSOH.js.map → text3d-2TVGBQ3N.js.map} +3 -3
  24. package/lib/index-rn.js +194 -194
  25. package/package.json +2 -2
  26. package/lib/esm/chunk-AHC6OWNT.js +0 -2
  27. package/lib/esm/chunk-CUKGTP3B.js +0 -2214
  28. package/lib/esm/chunk-X26M5SQZ.js +0 -2
  29. /package/lib/esm/{GLTFExporter-QN63B2QE.js.map → GLTFExporter-YFXXQH2L.js.map} +0 -0
  30. /package/lib/esm/{GLTFLoader-7E66XH6W.js.map → GLTFLoader-LZNQSDLP.js.map} +0 -0
  31. /package/lib/esm/{browser-UPE3UIJH.js.map → browser-L6WJGOEX.js.map} +0 -0
  32. /package/lib/esm/{chunk-RMM4JL5D.js.map → chunk-BNEW6WES.js.map} +0 -0
  33. /package/lib/esm/{chunk-EDIABNX3.js.map → chunk-EMVX4D2H.js.map} +0 -0
  34. /package/lib/esm/{chunk-F3D2AS2N.js.map → chunk-LWBDZWW4.js.map} +0 -0
  35. /package/lib/esm/{chunk-AHC6OWNT.js.map → chunk-ROCNZJLL.js.map} +0 -0
  36. /package/lib/esm/{chunk-UQJ6CFWP.js.map → chunk-Y5QWL6TS.js.map} +0 -0
  37. /package/lib/esm/{dist-33QC5I55.js.map → dist-HJXMUEN5.js.map} +0 -0
  38. /package/lib/esm/{inspector-2YAWFES6.js.map → inspector-FXVGOLBH.js.map} +0 -0
  39. /package/lib/esm/{internal-GHV4UNDA.js.map → internal-7ECOLP5R.js.map} +0 -0
  40. /package/lib/esm/{outdoor-context-v4-5AXRLXXA.js.map → outdoor-context-v4-IZYE32JG.js.map} +0 -0
  41. /package/lib/esm/{roboto-regular-25PMWR2T.js.map → roboto-regular-R5KXKW73.js.map} +0 -0
package/lib/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{A as C,C as D,D as E,F,G,I as H,J as I,K as J,L as K,M as L,N as M,O as N,P as O,Q as P,R as Q,S as R,T as S,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"./chunk-CUKGTP3B.js";import"./chunk-UQJ6CFWP.js";import{a,b}from"./chunk-A2N3FISM.js";import"./chunk-EDIABNX3.js";import"./chunk-RMM4JL5D.js";import"./chunk-F3D2AS2N.js";import"./chunk-X26M5SQZ.js";import"./chunk-AHC6OWNT.js";export{x as ACTION_TYPE,o as Annotation,g as Area,y as BEARING_TYPE,z as CONNECTION_TYPE,l as Connection,c as Coordinate,B as DOORS,C as Directions,h as Door,a as E_SDK_LOG_LEVEL,s as EnterpriseCategory,r as EnterpriseLocation,t as EnterpriseVenue,q as Facade,j as Floor,p as FloorStack,e as Hyperlink,f as ImageMetaData,E as LocationCategory,D as LocationProfile,k as MAPPEDIN_COLORS,m as MapObject,d as Node,n as PointOfInterest,i as Space,A as WALLS,L as __setWatermarkOnClickFn,Q as createMapLibreOverlay,H as disableText3DWorker,F as enableTestMode,K as findPreferredLanguageInVenue,O as getMapData,P as getMapDataEnterprise,J as hydrateMapData,M as hydrateMapDataFromMVF,u as parseMVF,G as preloadFont,b as setLoggerLevel,N as setUseEnterpriseAPI,I as setWorkersUrl,R as show3dMap,S as show3dMapGeojson,w as unzipAndParseMVFv2,v as unzipMVF};
1
+ import{A as C,C as D,D as E,F,G,I as H,J as I,K as J,L as K,M as L,N as M,O as N,P as O,Q as P,R as Q,S as R,T as S,U as T,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,v as x,w as y,x as z,y as A,z as B}from"./chunk-W57RTQ3G.js";import"./chunk-Y5QWL6TS.js";import{a,b}from"./chunk-KKLQ3TRA.js";import"./chunk-EMVX4D2H.js";import"./chunk-BNEW6WES.js";import"./chunk-LWBDZWW4.js";import"./chunk-T5QQA4HH.js";import"./chunk-ROCNZJLL.js";export{x as ACTION_TYPE,o as Annotation,g as Area,y as BEARING_TYPE,z as CONNECTION_TYPE,l as Connection,c as Coordinate,B as DOORS,C as Directions,h as Door,a as E_SDK_LOG_LEVEL,s as EnterpriseCategory,r as EnterpriseLocation,t as EnterpriseVenue,q as Facade,j as Floor,p as FloorStack,e as Hyperlink,f as ImageMetaData,E as LocationCategory,D as LocationProfile,k as MAPPEDIN_COLORS,m as MapObject,d as Node,n as PointOfInterest,i as Space,A as WALLS,L as __setWatermarkOnClickFn,R as checkWorkerUrls,Q as createMapLibreOverlay,H as disableText3DWorker,F as enableTestMode,K as findPreferredLanguageInVenue,O as getMapData,P as getMapDataEnterprise,J as hydrateMapData,M as hydrateMapDataFromMVF,u as parseMVF,G as preloadFont,b as setLoggerLevel,N as setUseEnterpriseAPI,I as setWorkersUrl,S as show3dMap,T as show3dMapGeojson,w as unzipAndParseMVFv2,v as unzipMVF};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import{H as bt,a as mt,g as N,p as B,q as W}from"./chunk-CUKGTP3B.js";import"./chunk-UQJ6CFWP.js";import{t as z}from"./chunk-A2N3FISM.js";import"./chunk-EDIABNX3.js";import"./chunk-RMM4JL5D.js";import{W as ft}from"./chunk-F3D2AS2N.js";import{a as y}from"./chunk-X26M5SQZ.js";import{f as T,g as C,h as G,i as gt,j as U}from"./chunk-AHC6OWNT.js";y();y();y();y();var $=class i{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"),i.nextNameID=i.nextNameID||0,this.$name.id=`lil-gui-name-${++i.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",a=>a.stopPropagation()),this.domElement.addEventListener("keyup",a=>a.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)}},tt=class extends ${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}};function et(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}var Ut={isPrimitive:!0,match:i=>typeof i=="string",fromHexString:et,toHexString:et},R={isPrimitive:!0,match:i=>typeof i=="number",fromHexString:i=>parseInt(i.substring(1),16),toHexString:i=>"#"+i.toString(16).padStart(6,0)},zt={isPrimitive:!1,match:i=>Array.isArray(i),fromHexString(i,t,o=1){let e=R.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 R.toHexString(n)}},Pt={isPrimitive:!1,match:i=>Object(i)===i,fromHexString(i,t,o=1){let e=R.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 R.toHexString(n)}},Rt=[Ut,R,zt,Pt];function jt(i){return Rt.find(t=>t.match(i))}var it=class extends ${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=jt(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=et(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}},P=class extends ${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}},ot=class extends ${constructor(t,o,e,n,s,a){super(t,o,e,"number"),this._initInput(),this.min(n),this.max(s);let l=a!==void 0;this.step(l?a: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=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},e=b=>{let M=parseFloat(this.$input.value);isNaN(M)||(this._snapClampSetValue(M+b),this.$input.value=this.getValue())},n=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b)*-1))},s=b=>{this._inputFocused&&(b.preventDefault(),e(this._step*this._normalizeMouseWheel(b)))},a=!1,l,d,g,c,u,r=5,f=b=>{l=b.clientX,d=g=b.clientY,a=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",h),window.addEventListener("mouseup",m)},h=b=>{if(a){let M=b.clientX-l,D=b.clientY-d;Math.abs(D)>r?(b.preventDefault(),this.$input.blur(),a=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(M)>r&&m()}if(!a){let M=b.clientY-g;u-=M*this._step*this._arrowKeyMultiplier(b),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}g=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",m)},x=()=>{this._inputFocused=!0},p=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};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",x),this.$input.addEventListener("blur",p)}_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=(p,b,M,D,Y)=>(p-b)/(M-b)*(Y-D)+D,o=p=>{let b=this.$slider.getBoundingClientRect(),M=t(p,b.left,b.right,this._min,this._max);this._snapClampSetValue(M)},e=p=>{this._setDraggingStyle(!0),o(p.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",s)},n=p=>{o(p.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",s)},a=!1,l,d,g=p=>{p.preventDefault(),this._setDraggingStyle(!0),o(p.touches[0].clientX),a=!1},c=p=>{p.touches.length>1||(this._hasScrollBar?(l=p.touches[0].clientX,d=p.touches[0].clientY,a=!0):g(p),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",r))},u=p=>{if(a){let b=p.touches[0].clientX-l,M=p.touches[0].clientY-d;Math.abs(b)>Math.abs(M)?g(p):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",r))}else p.preventDefault(),o(p.touches[0].clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",r)},f=this._callOnFinishChange.bind(this),h=400,m,x=p=>{if(Math.abs(p.deltaX)<Math.abs(p.deltaY)&&this._hasScrollBar)return;p.preventDefault();let M=this._normalizeMouseWheel(p)*this._step;this._snapClampSetValue(this.getValue()+M),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(f,h)};this.$slider.addEventListener("mousedown",e),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",x,{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-${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}},nt=class extends ${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}},rt=class extends ${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}},Xt=`.lil-gui {
1
+ import{H as bt,a as mt,g as N,p as B,q as W}from"./chunk-W57RTQ3G.js";import"./chunk-Y5QWL6TS.js";import{t as z}from"./chunk-KKLQ3TRA.js";import"./chunk-EMVX4D2H.js";import"./chunk-BNEW6WES.js";import{W as ft}from"./chunk-LWBDZWW4.js";import{a as y}from"./chunk-T5QQA4HH.js";import{e as T,f as C,g as G,h as gt,i as U}from"./chunk-ROCNZJLL.js";y();y();y();y();var $=class i{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"),i.nextNameID=i.nextNameID||0,this.$name.id=`lil-gui-name-${++i.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",a=>a.stopPropagation()),this.domElement.addEventListener("keyup",a=>a.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)}},tt=class extends ${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}};function et(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}var Ut={isPrimitive:!0,match:i=>typeof i=="string",fromHexString:et,toHexString:et},R={isPrimitive:!0,match:i=>typeof i=="number",fromHexString:i=>parseInt(i.substring(1),16),toHexString:i=>"#"+i.toString(16).padStart(6,0)},zt={isPrimitive:!1,match:i=>Array.isArray(i),fromHexString(i,t,o=1){let e=R.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 R.toHexString(n)}},Pt={isPrimitive:!1,match:i=>Object(i)===i,fromHexString(i,t,o=1){let e=R.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 R.toHexString(n)}},Rt=[Ut,R,zt,Pt];function jt(i){return Rt.find(t=>t.match(i))}var it=class extends ${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=jt(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=et(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}},P=class extends ${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}},ot=class extends ${constructor(t,o,e,n,s,a){super(t,o,e,"number"),this._initInput(),this.min(n),this.max(s);let l=a!==void 0;this.step(l?a: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=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},e=b=>{let M=parseFloat(this.$input.value);isNaN(M)||(this._snapClampSetValue(M+b),this.$input.value=this.getValue())},n=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b)*-1))},s=b=>{this._inputFocused&&(b.preventDefault(),e(this._step*this._normalizeMouseWheel(b)))},a=!1,l,d,g,c,u,r=5,f=b=>{l=b.clientX,d=g=b.clientY,a=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",h),window.addEventListener("mouseup",m)},h=b=>{if(a){let M=b.clientX-l,D=b.clientY-d;Math.abs(D)>r?(b.preventDefault(),this.$input.blur(),a=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(M)>r&&m()}if(!a){let M=b.clientY-g;u-=M*this._step*this._arrowKeyMultiplier(b),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}g=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",m)},x=()=>{this._inputFocused=!0},p=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};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",x),this.$input.addEventListener("blur",p)}_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=(p,b,M,D,Y)=>(p-b)/(M-b)*(Y-D)+D,o=p=>{let b=this.$slider.getBoundingClientRect(),M=t(p,b.left,b.right,this._min,this._max);this._snapClampSetValue(M)},e=p=>{this._setDraggingStyle(!0),o(p.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",s)},n=p=>{o(p.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",s)},a=!1,l,d,g=p=>{p.preventDefault(),this._setDraggingStyle(!0),o(p.touches[0].clientX),a=!1},c=p=>{p.touches.length>1||(this._hasScrollBar?(l=p.touches[0].clientX,d=p.touches[0].clientY,a=!0):g(p),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",r))},u=p=>{if(a){let b=p.touches[0].clientX-l,M=p.touches[0].clientY-d;Math.abs(b)>Math.abs(M)?g(p):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",r))}else p.preventDefault(),o(p.touches[0].clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",r)},f=this._callOnFinishChange.bind(this),h=400,m,x=p=>{if(Math.abs(p.deltaX)<Math.abs(p.deltaY)&&this._hasScrollBar)return;p.preventDefault();let M=this._normalizeMouseWheel(p)*this._step;this._snapClampSetValue(this.getValue()+M),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(f,h)};this.$slider.addEventListener("mousedown",e),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",x,{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-${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}},nt=class extends ${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}},rt=class extends ${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}},Xt=`.lil-gui {
2
2
  font-family: var(--font-family);
3
3
  font-size: var(--font-size);
4
4
  line-height: 1;
@@ -480,4 +480,4 @@ import{H as bt,a as mt,g as N,p as B,q as W}from"./chunk-CUKGTP3B.js";import"./c
480
480
  <br>
481
481
  <span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>
482
482
  </div>`,{rank:"always-visible"});g.add(r),i.push(f)}})})}return()=>{i.forEach(d=>n.Markers.remove(d))}}}}var j={duration:300,easing:"ease-in-out"},Q=Wt();y();var E={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 Jt(i){i.add(E.options.places.fields,"name").name("Places: Name"),i.add(E.options.places.fields,"description").name("Places: Description"),i.add(E.options.places.fields,"link").name("Places: Link"),i.add(E.options.places.fields,"category").name("Places: Category"),i.add(E.options.places,"limit"),i.add(E.options.locations.fields,"name").name("Locations: Name"),i.add(E.options.locations.fields,"tag").name("Locations: Tag"),i.add(E.options.locations.fields,"description").name("Locations: Description"),i.add(E.options.places,"limit"),i.add(E.options.categories.fields,"name").name("Categories: Name")}function Ct(i,t,o){let e=new z,n=o.addFolder("Search");n.open();let s=n.add(E,"search").onChange(async c=>{let u=await t.Search.query(c,E.options);u&&(E.results=u,l(u,e))}),a=document.createElement("div");a.style.marginLeft="10px",s.domElement.parentElement?.appendChild(a);let{renderSearch:l,close:d}=Zt(i,t,a,s.$input),g=n.addFolder("Advanced");return g.close(),Jt(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}}function Zt(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()=>{let d=await t.Search.suggest(e.value);d&&d.length>0&&a(d[0]?.suggestion)},100))});function a(l){if(!l){e.placeholder="";return}let d=e.value;e.value=l,e.setSelectionRange(d.length,l.length)}return{renderSearch(l,d){if(l.places.length===0&&l.enterpriseCategories?.length===0&&l.enterpriseLocations?.length===0){o.textContent="No results found.";return}s=Qt(o,l,i,d)},close(){s.destroy()}}}function Qt(i,t,o,e){i.innerHTML="";let n=document.createElement("div");Object.assign(n.style,K.dropdownContainer);let s=document.createElement("ul");s.className="options-list",Object.assign(s.style,K.optionsList),s.style.display="block";let a=[],l=(r,f)=>{if(f&&f.length>0){let h=document.createElement("li");h.textContent=r,Object.assign(h.style,K.sectionHeader),s.appendChild(h),f.forEach((m,x)=>{let p=document.createElement("li");p.textContent=`${"name"in m.item?m.item.name:""} (${m.type})`,Object.assign(p.style,K.option),p.tabIndex=0,p.addEventListener("focus",()=>{g(a.indexOf(p))}),p.addEventListener("mouseover",()=>{p.style.backgroundColor="#f0f0f0"}),p.addEventListener("mouseout",()=>{p.style.backgroundColor=""}),p.addEventListener("click",()=>{}),p.setAttribute("data-type",r),p.setAttribute("data-index",x.toString()),s.appendChild(p),a.push(p)})}};l("enterpriseLocations",t.enterpriseLocations),l("enterpriseCategories",t.enterpriseCategories),l("Places",t.places),n.appendChild(s),i.appendChild(n);let d=[],g=r=>{d.forEach(p=>p()),d=[],a.forEach((p,b)=>{b===r?p.style.backgroundColor="#e0e0e0":p.style.backgroundColor=""});let f=a[r],h=f.getAttribute("data-type"),m=parseInt(f.getAttribute("data-index")||"0",10);if(!h)return;let{item:x}=t[h.toLowerCase()][m];e.publish("highlight",x)},c=r=>{!n.contains(r.target)&&r.target!==i&&u()};document.addEventListener("click",c);let u=()=>{i.innerHTML="",document.removeEventListener("click",c)};return{destroy(){i.innerHTML="",e.publish("highlight",void 0)}}}var K={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 xt(i,t,o){o.domElement.id="interactionPanel";let e=[],{pubsub:n}=Ct(i,t,o);n.on("highlight",c=>{if(c){e.forEach(r=>r()),e=[];let u=c instanceof B?c.spaces[0]:c;if(i.Camera.focusOn(c),u&&!N.is(u))return;e.push(Q.highlightCard(i,u,{focus:!0}))}else e.forEach(u=>u()),e=[]});let s=o.addFolder("Click \u{1F447}").close(),{sub:a}=Kt(i,s);a.on("click",c=>{e.forEach(u=>u()),e=[],c.spaces[0]&&(e=[Q.highlightCard(i,c.spaces[0])])});let l=o.addFolder("Hover \u{1F681}").close(),{sub:d}=qt(i,l),g;d.on("hover",c=>{c.spaces[0]?(g?.(),e.length===0&&(g=Q.highlightCard(i,c.spaces[0]))):(g?.(),g=void 0)})}function Kt(i,t){let o=new z,e={position:"",hoverColor:w(i.getHoverColor())},n=t.add(e,"position").disable(),s=[];function a(){s.forEach(d=>d()),s.length=0}let l=0;return i.on("click",d=>{let{labels:g,markers:c,coordinate:u}=d;a(),o.publish("click",d),clearInterval(l),n.load(JSON.stringify([u.longitude,u.latitude]));let r=g[0]||c[0];if(r){let h=dt(i,r,t);if(!h)return;s.push(h.destroy),h.labelItemFolder.openAnimated()}let f=d.spaces[0]??d.objects[0];if(f){let h={id:f.id,...i.getState(f.id),type:f.type,isInView:!1,isInViewCheck:lt(i,f.id)},{cleanup:m}=Z(i,h,t);l=setInterval(()=>{h.isInView=i.isInView(r||f)},500),s.push(m)}}),{sub:o}}function qt(i,t){let o=new z;i.setHoverColor("#1f3a7a");let e={position:"",hoverColor:w(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 a(){s.forEach(l=>l()),s.length=0}return i.on("hover",l=>{let{coordinate:d,spaces:g,objects:c,markers:u,labels:r}=l;a(),o.publish("hover",l),n.load(JSON.stringify([d.longitude,d.latitude]));let f=g[0]??c[0]??u[0]??r[0];if(!f)return;let h=i.getState(f);h&&(e.type=h.type,e.id=f.id)}),{sub:o}}function lt(i,t){return function(){console.log("isInView",i.isInView(t))}}function At(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}=Vt(i,o);i.add(e,"all"),i.add(e,"removeAllLabels");let a=i.addFolder("Label List");i.close();let l=new Map,{rerender:d}=g();function g(){function r(m){delete e.labels[m.id],l.get(m.id)?.destroy()}function f(m){let x=dt(o,m,a,{onRemove:b=>{r(b)}});if(!x)return;let{labelItemFolder:p}=x;l.set(m.id,p)}function h(){a.destroy(),a=i.addFolder("Label");for(let m in e.labels){let x=e.labels[m];f(x)}}return{rerender:h,add:f,remove:r}}i.domElement.classList.add("list-items");let c;o.on("click",({labels:r,coordinate:f})=>{if(!i._closed)if(r[0]){c?.close();let h=l.get(r[0].id);if(i.open(),!h)return;h?.open(),h?.domElement.scrollIntoView({block:"start"}),h?.domElement.focus(),c=h}else n(f)});function u(r){for(let f of r)e.labels[f.id]=f;d()}return{populatelabels:u,destroy(){s()}}}function dt(i,t,o,{onRemove:e}={}){let n=o.addFolder(`${t.text?.substring(0,12)}`);n.onChange(g=>{i.updateState(t,{appearance:d.appearance,interactive:d.interactive})}),n.close();let s=i.getState(t);if(s?.type!=="label")throw new Error(`error getting state for label: ${t.id}`);let{appearance:a,interactive:l}=s;if(!a||a.margin==null||l==null)throw new Error("incomplte label state");let d={text:t.text,interactive:l,appearance:{...a,margin:a.margin||0,marker:{foregroundColor:a.marker?.foregroundColor?.active?w(a.marker.foregroundColor?.active):"black"},text:{foregroundColor:w(a.text.foregroundColor)}},remove(){i.Labels.remove(t),e?.(t),n.destroy()},isInView:lt(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()}}}function Vt(i,t){let o=i.addFolder("Add"),e={onClick:!1,margin:0,text:"New Label!",interactive:!0,marginForegroundColor:w("skyblue"),marginBackgroundColor:w("coral"),textForegroundColor:w("slategray"),textBackgroundColor:w("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})}}}var Mt={};y();var _t="camera-ui";function kt(i,t,o){let e=i.addFolder("Camera \u{1F4F7}").onOpenClose(v=>{st({opened:!v._closed},_t)}),{params:n}=at(_t);n.opened||e.close();let s=t.Camera.center.toJSON(),a=document.createElement("div");Object.assign(a.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),t.__core.container.appendChild(a);let l=()=>t.getDimensions(),[d,g,c,u]=o?.padding??[t.Camera.screenOffsets.top,t.Camera.screenOffsets.right,t.Camera.screenOffsets.bottom,t.Camera.screenOffsets.left],r={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:o?.padding?"pixel":t.Camera.screenOffsets.type,inset_top:d,inset_left:u,inset_right:g,inset_bottom:c,animateOnLoad:!0,persist:()=>{st(e.save().controllers,"camera"),navigator.clipboard.writeText(window.location.href)},visualizeInset:!!(d||g||c||u),"Focus on click":o?.focusOnClick??!0,"Focus on current floor":()=>{t.Camera.focusOn([t.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function f(){r.inset_type=t.Camera.screenOffsets.type,r.inset_left=t.Camera.screenOffsets.left,r.inset_top=t.Camera.screenOffsets.top,r.inset_right=t.Camera.screenOffsets.right,r.inset_bottom=t.Camera.screenOffsets.bottom;let{width:v,height:k}=l();r.inset_type==="portion"?Object.assign(a.style,{left:r.inset_left*v+"px",top:r.inset_top*k+"px",bottom:r.inset_bottom*k+"px",right:r.inset_right*v+"px"}):Object.assign(a.style,{left:r.inset_left+"px",top:r.inset_top+"px",bottom:r.inset_bottom+"px",right:r.inset_right+"px"})}e.add(r,"center_lat").listen().disable(),e.add(r,"center_lon").listen().disable(),e.add(r,"zoomLevel",16,22,.5).listen().disable(),e.add(r,"pitch").listen().disable(),e.add(r,"bearing").listen().disable(),e.add(r,"minZoomLevel",5,22,.5).onChange(v=>{t.Camera.setMinZoomLevel(v)}),e.add(r,"maxZoomLevel",10,22,.5).onChange(v=>{t.Camera.setMaxZoomLevel(v)}),e.add(r,"animateOnLoad"),e.add(r,"visualizeInset").onChange(pt),pt(r.visualizeInset);let h,m,x,p;function b(){let{width:v,height:k}=l(),q=t.Camera.screenOffsets.type,V=r.inset_type;q!==V&&(V==="portion"&&q==="pixel"?(r.inset_top=v>0?Math.min(r.inset_top/k,1):0,r.inset_bottom=v>0?Math.min(r.inset_bottom/k,1):0,r.inset_left=k>0?Math.min(r.inset_left/v,1):0,r.inset_right=k>0?Math.min(r.inset_right/v,1):0):V==="pixel"&&q==="portion"&&(r.inset_top=Math.round(r.inset_top*k),r.inset_bottom=Math.round(r.inset_bottom*k),r.inset_left=Math.round(r.inset_left*v),r.inset_right=Math.round(r.inset_right*v))),h&&h.destroy(),m&&m.destroy(),x&&x.destroy(),p&&p.destroy(),r.inset_type==="portion"?(h=e.add(r,"inset_top",0,1,.01).onChange(F),m=e.add(r,"inset_bottom",0,1,.01).onChange(F),x=e.add(r,"inset_left",0,1,.01).onChange(F),p=e.add(r,"inset_right",0,1,.01).onChange(F)):(h=e.add(r,"inset_top",0,k,1).onChange(F),m=e.add(r,"inset_bottom",0,k,1).onChange(F),x=e.add(r,"inset_left",0,v,1).onChange(F),p=e.add(r,"inset_right",0,v,1).onChange(F))}e.add(r,"inset_type",["pixel","portion"]).onChange(()=>{b(),F()}),b();let M=ee(t);e.add(r,"Focus on click").onChange(v=>{v?t.on("click",M):t.off("click",M)}),r["Focus on click"]&&t.on("click",M),e.add(r,"persist"),e.add(r,"Focus on current floor");let D=v=>{e._closed||(r.center_lat=v.center.latitude,r.center_lon=v.center.longitude,r.zoomLevel=v.zoomLevel,r.bearing=v.bearing,r.pitch=v.pitch)};t.on("camera-change",D);let{params:Y}=at("camera",r);if(Object.keys(Y).length>0){let v=Y;t.Camera.setScreenOffsets({top:v.inset_top,left:v.inset_left,right:v.inset_right,bottom:v.inset_bottom,type:v.inset_type});let k={pitch:v.pitch,center:new mt(v.center_lat,v.center_lon),bearing:v.bearing,zoomLevel:v.zoomLevel};v.animateOnLoad?t.Camera.animateTo(k):t.Camera.set(k),e.load({controllers:v,folders:{}}),f()}let Ht=[()=>{t.off("camera-change",D)}];function F(){t.Camera.setScreenOffsets({top:r.inset_top,left:r.inset_left,right:r.inset_right,bottom:r.inset_bottom,type:r.inset_type}),f()}(r.inset_top||r.inset_right||r.inset_bottom||r.inset_left)&&F();function pt(v){f(),v?a.style.display="block":a.style.display="none"}return()=>({destroy(){e.destroy(),yt(Ht)}})}function ee(i){return function(o){let{spaces:e,objects:n}=o,s=e[0]??n[0];s&&i.Camera.focusOn(s)}}y();function Et(i,t,o){let e={markers:{},removeAllMarkers(){o.Markers.removeAll().forEach(f=>{delete this.markers[f.id]}),d()}},{addMarker:n,destroy:s}=oe(i,o);i.add(e,"removeAllMarkers");let a=i.addFolder("Marker List");i.close();let l=new Map,{rerender:d}=g();function g(){function r(m){delete e.markers[m.id],l.get(m.id)?.destroy()}function f(m){let x=ie(o,m,a,{onRemove:b=>{r(b)}});if(!x)return;let{markerItemFolder:p}=x;l.set(m.id,p)}function h(){a.destroy(),a=i.addFolder("marker");for(let m in e.markers){let x=e.markers[m];f(x)}}return{rerender:h,add:f,remove:r}}i.domElement.classList.add("list-items");let c;o.on("click",({markers:r,coordinate:f})=>{if(!i._closed)if(r[0]){c?.close();let h=l.get(r[0].id);if(i.open(),!h)return;h?.open(),h?.domElement.scrollIntoView({block:"start"}),h?.domElement.focus(),c=h}else n(f)});function u(r){for(let f of r)e.markers[f.id]=f;d()}return{populateMarkers:u,destroy(){s()}}}function ie(i,t,o,{onRemove:e}={}){let n=o.addFolder(`${t.id.toString().substring(0,8)}`);n.onChange(d=>{i.updateState(t,{interactive:l.interactive})}),n.close();let s=i.getState(t);if(s?.type!=="marker")throw new Error(`error getting state for marker: ${t.id}`);let{interactive:a}=s;if(a==null)throw new Error("incomplte label state");let l={interactive:a,remove(){i.Markers.remove(t),e?.(t),n.destroy()}};return n.add(l,"interactive"),n.add(l,"remove"),{markerItemFolder:n,destroy(){n.destroy()}}}function oe(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})}}}y();function wt(i,t){let o=i.addFolder("Walls").close(),e={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};o.add(e,"visible").onChange(a=>{t.updateState("walls",{visible:a})}),o.addColor(e,"topColor").onChange(a=>{t.updateState("walls",{topColor:a})}),o.addColor(e,"color").onChange(a=>{t.updateState("walls",{color:a})}),o.addFolder("Texture - side").add(e.texture,"url").onFinishChange(a=>{t.updateState("walls",{texture:{url:a}})}),o.addFolder("Texture - top").add(e.topTexture,"url").onFinishChange(a=>{t.updateState("walls",{topTexture:{url:a}})}),t.updateState("walls",{topColor:e.topColor}),t.updateState("walls",{color:e.color})}y();function Ft(i,t,o){i.close();let e={language:o.currentLanguage?.code??"en"},n=o.getByType("enterprise-venue");i.add(e,"language",n?.languages.map(s=>s.code)).onChange(s=>{o.changeLanguage(s)})}y();function St(i,t,o){let e=i.addFolder("Debug");e.close();let n=t.Debug.state,s={showPolygonLabelTextAreaMesh:n.showPolygonLabelTextAreaMesh,showCollisionBoxes:n.showCollisionBoxes,showEnvMap:n.showEnvMap};e.add(s,"showPolygonLabelTextAreaMesh").onChange(a=>{t.Debug.update({showPolygonLabelTextAreaMesh:a})}).name("Show Flat Label Text Area Mesh"),e.add(s,"showCollisionBoxes").onChange(a=>{t.Debug.update({showCollisionBoxes:a})}).name("Show Collision Boxes"),e.add(s,"showEnvMap").onChange(a=>{t.Debug.update({showEnvMap:a})}).name("Show Environment Map"),t.Debug.update(s)}y();function Lt(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")}y();y();y();var S,X,I,A,O,L,$t,ht,It,ct=class{constructor(t=new H({autoPlace:!0})){G(this,L);G(this,S);G(this,X,[]);G(this,I,{});G(this,A,{});G(this,O,{});gt(this,S,t),C(this,S).domElement.style.left="0"}add(t,o,e){if(C(this,A)[t])throw new Error(`Control ${t} already exists`);C(this,I)[t]=o,C(this,O)[t]=o.default,U(this,L,$t).call(this,t,o,e),this.show()}addColor(t,o,e){if(C(this,A)[t])throw new Error(`Control ${t} already exists`);C(this,I)[t]=o,C(this,O)[t]=o.default,U(this,L,It).call(this,t,o,e),this.show()}update(t,o){if(!C(this,A)[t])throw new Error(`Control ${t} does not exist`);C(this,A)[t].setValue(o),C(this,I)[t].onChange&&C(this,I)[t].onChange(o,t)}replace(t,o,e){if(!C(this,A)[t]){this.add(t,o,e);return}o.args&&C(this,A)[t].options(o.args),o.default&&C(this,A)[t].setValue(o.default),o.onChange&&C(this,A)[t].onChange(n=>{o.onChange(n,t)})}remove(t){if(!C(this,A)[t])throw new Error(`Control ${t} does not exist`);C(this,A)[t].destroy(),C(this,A)[t].parent.children.length===0&&C(this,A)[t].parent.hide(),delete C(this,A)[t],delete C(this,I)[t],delete C(this,O)[t]}show(){C(this,S).show()}hide(){C(this,S).hide()}removeAll(){for(let t in C(this,A))this.remove(t)}destroy(){C(this,S).destroy()}};S=new WeakMap,X=new WeakMap,I=new WeakMap,A=new WeakMap,O=new WeakMap,L=new WeakSet,$t=function(t,o,e){let s=U(this,L,ht).call(this,e).add(C(this,O),t,o.args,o.max,o.step);o.onChange&&s.onChange(a=>{o.onChange(a,t)}),o.onAdd&&o.onAdd(o.default,t),C(this,A)[t]=s},ht=function(t){if(!t)return C(this,S);let o=C(this,X).find(e=>e._title===t);return o?(o.show(),o):(o=C(this,S).addFolder(t),C(this,X).push(o),o)},It=function(t,o,e){let s=U(this,L,ht).call(this,e).addColor(C(this,O),t);o.onChange&&s.onChange(a=>{o.onChange(a,t)}),C(this,A)[t]=s};function ne(i,t,o){let e={},n=i.getByType("floor"),s=i.getByType("floor-stack");s.length>1&&(e.FloorStack={default:t.currentFloorStack.id,args:s.reduce((l,{id:d,name:g})=>({...l,[g]:d}),{}),onChange:l=>{l!==t.currentFloorStack.id&&(t.setFloorStack(l),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((d,{id:g,name:c})=>({...d,[c]:g}),{})}))}}),n.length>1&&(e.Floor={default:t.currentFloor.id,args:[...t.currentFloorStack.floors.sort((l,d)=>d.elevation-l.elevation)].reduce((l,{id:d,name:g})=>({...l,[g]:d}),{}),onChange:l=>{l!==t.currentFloor.id&&t.setFloor(l)},onAdd:()=>{t.on("floor-change",l=>{l?.floor.id&&(s.length>1&&o.replace("FloorStack",{default:t.currentFloorStack.id}),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((g,{id:c,name:u})=>({...g,[u]:c}),{})}))})}});let a=i.getByType("enterprise-venue");return a&&a.languages.length>1&&(e.Language={default:i.currentLanguage?.code||a.languages[0].code,args:a.languages.reduce((l,{code:d,name:g})=>({...l,[g]:d}),{}),onChange:l=>{i.changeLanguage(l)}}),e}function Ot(i,t,o=new H){let e=new ct(o),n=ne(i,t,e);Object.keys(n).length||e.hide();for(let s in n)e.add(s,n[s]);return e}async function Dt(i,t,{initialfloorsInStack:o,root:e,floorsInDirections:n,showLabelsPerFloor:s=!0}){async function a(h){i.StackedMaps.changeFloorOnElevationChanges(!1),i.Outdoor.setOpacity(.15),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),await i.Camera.focusOn(h,{pitch:10})}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:i.StackedMaps.distanceBetweenFloors},pitch:90})}async function d(h){await i.Camera.animateElevation(h.elevation*i.StackedMaps.distanceBetweenFloors)}let g=i.currentFloor;i.on("floor-change",async h=>{i.StackedMaps.expanded&&h.reason!=="stacked-maps-elevation-change"&&(i.StackedMaps.changeFloorOnElevationChanges(!1),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.focusOn(g,{axisAlignedPadding:{vertical:i.StackedMaps.distanceBetweenFloors},pitch:90,duration:500}),i.StackedMaps.changeFloorOnElevationChanges(!0),await d(i.currentFloor),await a(i.currentFloor),i.StackedMaps.setFloorVisiblityMode("only-current-floor")),g=i.currentFloor}),i.on("stacked-maps-state-change",({state:h})=>{console.log("stacked-maps-state-change",h)});let c=t.getByType("space");if(s){let h=c.reduce((m,x)=>(m.has(x.floor)||m.set(x.floor,[]),x.name&&x.name!==""&&m.get(x.floor).push(i.Labels.add(x,x.name)),m),new Map);i.on("floor-change",()=>{h.forEach((m,x)=>{m.forEach(p=>{i.updateState(p,{enabled:i.currentFloor===x})})})})}let u=Ot(t,i,e),r=o??[];async function f(){i.Outdoor.setOpacity(.25),r=t.getByType("floor"),await i.Camera.animateTo({pitch:90}),await i.StackedMaps.collapse(),i.StackedMaps.clearCachedFloorSeparationDistance(),await i.StackedMaps.expand({distanceBetweenFloors:"auto"})}return u.add("Expand - All",{default:async()=>{await f()}},"Stack Maps"),n&&u.add("Expand - Only Navigation",{default:async()=>{i.Outdoor.setOpacity(.25),r=n,await i.StackedMaps.collapse(),i.setFloor(n[0]),await i.StackedMaps.expand({includedFloors:n,distanceBetweenFloors:"auto"})}},"Stack Maps"),u.add("Show All Floors",{default:async()=>{r=t.getByType("floor"),i.Outdoor.setOpacity(.25),i.StackedMaps.setFloorVisiblityMode("all-floors"),i.StackedMaps.changeFloorOnElevationChanges(!1),i.Camera.setPanMode("elevation"),i.Camera.focusOn(r,{pitch:90})}},"Stack Maps"),u.add("Show Current Floor with padding",{default:async()=>{await l()}},"Stack Maps"),u.add("Zoom to Current Floor",{default:async()=>{a(i.currentFloor)}},"Stack Maps"),u.add("Collapse",{default:()=>{i.Outdoor.setOpacity("initial"),i.StackedMaps.collapse()}},"Stack Maps"),u.add("Default",{default:async()=>{i.Camera.setPanMode("default")}},"Camera Pan Mode"),u.add("Elevation",{default:async()=>{i.Camera.setPanMode("elevation")}},"Camera Pan Mode"),u.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:i.StackedMaps.distanceBetweenFloors},pitch:90}),i.StackedMaps.expanded||await i.StackedMaps.expand({distanceBetweenFloors:i.StackedMaps.distanceBetweenFloors});let h=i.StackedMaps.includedFloors[2],m=r.findIndex(x=>x.id===h.id);i.StackedMaps.changeFloorOnElevationChanges(!0),i.Camera.setPanMode("elevation"),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.animateElevation(m*i.StackedMaps.distanceBetweenFloors),i.Outdoor.setOpacity(.15),console.log("focusing on",h.name),await i.Camera.focusOn(h,{pitch:10}),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),i.StackedMaps.changeFloorOnElevationChanges(!1)}},"Camera Pan Mode"),u.add("All Floors",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("all-floors")}},"Visibility Mode"),u.add("Only Active Floor",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("only-current-floor")}},"Visibility Mode"),u.add("Up",{default:async()=>{let h=r.find(m=>m.elevation===i.currentFloor.elevation+1);h&&await d(h)}},"Floors Up/Down"),u.add("Down",{default:async()=>{let h=r.find(m=>m.elevation===i.currentFloor.elevation-1);h&&await d(h)}},"Floors Up/Down"),{zoomToFloor:a,expandAll:f}}function Tt(i,t,o){let e=i.addFolder("StackedMaps");e.close(),Dt(t,o,{root:e,showLabelsPerFloor:!1})}function Bt(i,t,o){re();let e=new J({title:"SDK Controls"});e.domElement.classList.add("mappedin-js-inspector"),xt(t,i,e),kt(e,t,o?.camera);let n=e.addFolder("Levels").close(),s=e.addFolder("Scene Controls");s.close();let a=e.addFolder("Labels");Lt(e,t,i);let l=e.addFolder("Markers");wt(e,t),Tt(e,t,i);let d=e.addFolder("misc");St(e,t,i),Ft(d,t,i);let g={level:t.currentFloor.id},{populatelabels:c}=At(a,i,t),{populateMarkers:u}=Et(l,i,t),r=i.getByType("floor").reduce((h,m)=>(h[m.name]=m.id,h),{}),f=n.add(g,"level",r).onChange(h=>{t.setFloor(h),g.level=t.currentFloor.id,f.updateDisplay()});return t.on("floor-change-start",h=>{n.controllers[0].setValue(h.floor.id)}),i.getByType("space").forEach(h=>{t.updateState(h,{interactive:!0})}),i.getByType("object").forEach(h=>{t.updateState(h,{interactive:!0})}),i.getByType("object").forEach(h=>{t.updateState(h,{interactive:!0})}),t.setHoverColor("#a2b7e6"),t.Camera.setMaxZoomLevel(20),{populatelabels:c,sceneFolder:s,populateMarkers:u}}var Gt="mappedin-sdk-debug-css";function re(){if(document.getElementById(Gt))return;let i=document.createElement("style");i.id=Gt,i.textContent=Mt,document.head.appendChild(i)}var ut=class{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={}){if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:o}=Bt(this.mapData,this.mv,t);o.onOpenClose(e=>{e===o&&!e._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,bt(this.api.core,o))}),this.api.getMapDataInternal()?.spaces.forEach(e=>{this.mv.updateState(e.id,{interactive:!0})})}get enabled(){return this._enabled}};export{ut as Inspector};
483
- //# sourceMappingURL=inspector-2YAWFES6.js.map
483
+ //# sourceMappingURL=inspector-FXVGOLBH.js.map
@@ -1,2 +1,2 @@
1
- import{B as g,E as Se,b as H,n as X,o as ee,p as te,q as se}from"./chunk-CUKGTP3B.js";import"./chunk-UQJ6CFWP.js";import{q as Z}from"./chunk-A2N3FISM.js";import"./chunk-EDIABNX3.js";import"./chunk-RMM4JL5D.js";import"./chunk-F3D2AS2N.js";import{a as O}from"./chunk-X26M5SQZ.js";import{e as ye,f as L,g as G,h as D,i as K,j as Y}from"./chunk-AHC6OWNT.js";O();O();var be="ENTRIES",ce="KEYS",ae="VALUES",y="",v=class{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}=I(this._path);if(I(t)===y)return{done:!1,value:this.result()};let s=e.get(I(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=I(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>I(e)).filter(e=>e!==y).join("")}value(){return I(this._path).node.get(y)}result(){switch(this._type){case ae:return this.value();case ce:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},I=n=>n[n.length-1],xe=(n,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,o=i+t,r=new Uint8Array(o*i).fill(t+1);for(let c=0;c<i;++c)r[c]=c;for(let c=1;c<o;++c)r[c*i]=c;return ue(n,e,t,s,r,1,i,""),s},ue=(n,e,t,s,i,o,r,c)=>{let a=o*r;e:for(let u of n.keys())if(u===y){let l=i[a-1];l<=t&&s.set(c,[n.get(u),l])}else{let l=o;for(let h=0;h<u.length;++h,++l){let d=u[h],p=r*l,_=p-r,f=i[p],m=Math.max(0,l-t-1),w=Math.min(r-1,l+t);for(let S=m;S<w;++S){let V=d!==e[S],R=i[_+S]+ +V,C=i[_+S+1]+1,b=i[p+S]+1,z=i[p+S+1]=Math.min(R,C,b);z<f&&(f=z)}if(f>t)continue e}ue(n.get(u),e,t,s,i,l,r,c+u)}},F=class n{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]=T(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,o]=q(s);for(let r of i.keys())if(r!==y&&r.startsWith(o)){let c=new Map;return c.set(r.slice(o.length),i.get(r)),new n(c,e)}}return new n(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ie(this._tree,e)}entries(){return new v(this,be)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return xe(this._tree,e,t)}get(e){let t=N(this._tree,e);return t!==void 0?t.get(y):void 0}has(e){let t=N(this._tree,e);return t!==void 0&&t.has(y)}keys(){return new v(this,ce)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,j(this._tree,e).set(y,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=j(this._tree,e);return s.set(y,t(s.get(y))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e),i=s.get(y);return i===void 0&&s.set(y,i=t()),i}values(){return new v(this,ae)}[Symbol.iterator](){return this.entries()}static from(e){let t=new n;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return n.from(Object.entries(e))}},T=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(let s of n.keys())if(s!==y&&e.startsWith(s))return t.push([n,s]),T(n.get(s),e.slice(s.length),t);return t.push([n,e]),T(void 0,"",t)},N=(n,e)=>{if(e.length===0||n==null)return n;for(let t of n.keys())if(t!==y&&e.startsWith(t))return N(n.get(t),e.slice(t.length))},j=(n,e)=>{let t=e.length;e:for(let s=0;n&&s<t;){for(let o of n.keys())if(o!==y&&e[s]===o[0]){let r=Math.min(t-s,o.length),c=1;for(;c<r&&e[s+c]===o[c];)++c;let a=n.get(o);if(c===o.length)n=a;else{let u=new Map;u.set(o.slice(c),a),n.set(e.slice(s,s+c),u),n.delete(o),n=u}s+=c;continue e}let i=new Map;return n.set(e.slice(s),i),i}return n},Ie=(n,e)=>{let[t,s]=T(n,e);if(t!==void 0){if(t.delete(y),t.size===0)le(s);else if(t.size===1){let[i,o]=t.entries().next().value;de(s,i,o)}}},le=n=>{if(n.length===0)return;let[e,t]=q(n);if(e.delete(t),e.size===0)le(n.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==y&&de(n.slice(0,-1),s,i)}},de=(n,e,t)=>{if(n.length===0)return;let[s,i]=q(n);s.set(i+e,t),s.delete(i)},q=n=>n[n.length-1],Q="or",he="and",ze="and_not",x=class n{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?B:e.autoVacuum;this._options={...W,...e,autoVacuum:t,searchOptions:{...ie,...e.searchOptions||{}},autoSuggestOptions:{...Le,...e.autoSuggestOptions||{}}},this._index=new F,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=J,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:o,idField:r}=this._options,c=t(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let u of o){let l=t(e,u);if(l==null)continue;let h=s(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.addFieldLength(a,d,this._documentCount-1,p);for(let _ of h){let f=i(_,u);if(Array.isArray(f))for(let m of f)this.addTerm(d,a,m);else f&&this.addTerm(d,a,f)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:r}=e.reduce(({chunk:c,promise:a},u,l)=>(c.push(u),(l+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return r.then(()=>this.addAll(o))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:o,idField:r}=this._options,c=i(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);let a=this._idToShortId.get(c);if(a==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let u of o){let l=i(e,u);if(l==null)continue;let h=t(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.removeFieldLength(a,d,this._documentCount,p);for(let _ of h){let f=s(_,u);if(Array.isArray(f))for(let m of f)this.removeTerm(d,a,m);else f&&this.removeTerm(d,a,f)}}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 F,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 ${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=J,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||$.batchSize,o=e.batchWait||$.batchWait,r=1;for(let[c,a]of this._index){for(let[u,l]of a)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?a.delete(u):l.delete(h));this._index.get(c).size===0&&this._index.delete(c),r%i===0&&await new Promise(u=>setTimeout(u,o)),r+=1}this._dirtCount-=s}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||B.minDirtCount,s=s||B.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{searchOptions:s}=this._options,i={...s,...t},o=this.executeQuery(e,t),r=[];for(let[c,{score:a,terms:u,match:l}]of o){let h=u.length||1,d={id:this._documentIds.get(c),score:a*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(c)),(i.filter==null||i.filter(d))&&r.push(d)}return e===n.wildcard&&i.boostDocument==null||r.sort(oe),r}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let s=new Map;for(let{score:o,terms:r}of this.search(e,t)){let c=r.join(" "),a=s.get(c);a!=null?(a.score+=o,a.count+=1):s.set(c,{score:o,terms:r,count:1})}let i=[];for(let[o,{score:r,terms:c,count:a}]of s)i.push({suggestion:o,terms:c,score:r/a});return i.sort(oe),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 async loadJSONAsync(e,t){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(W.hasOwnProperty(e))return P(W,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=k(i),a._fieldLength=k(o),a._storedFields=k(r);for(let[u,l]of a._documentIds)a._idToShortId.set(l,u);for(let[u,l]of s){let h=new Map;for(let d of Object.keys(l)){let p=l[d];c===1&&(p=p.ds),h.set(parseInt(d,10),k(p))}a._index.set(u,h)}return a}static async loadJSAsync(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=await A(i),a._fieldLength=await A(o),a._storedFields=await A(r);for(let[l,h]of a._documentIds)a._idToShortId.set(h,l);let u=0;for(let[l,h]of s){let d=new Map;for(let p of Object.keys(h)){let _=h[p];c===1&&(_=_.ds),d.set(parseInt(p,10),await A(_))}++u%1e3===0&&await fe(0),a._index.set(l,d)}return a}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:o,averageFieldLength:r,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new n(t);return u._documentCount=s,u._nextId=i,u._idToShortId=new Map,u._fieldIds=o,u._avgFieldLength=r,u._dirtCount=c||0,u._index=new F,u}executeQuery(e,t={}){if(e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let d={...t,...e,queries:void 0},p=e.queries.map(_=>this.executeQuery(_,d));return this.combineResults(p,d.combineWith)}let{tokenize:s,processTerm:i,searchOptions:o}=this._options,r={tokenize:s,processTerm:i,...o,...t},{tokenize:c,processTerm:a}=r,h=c(e).flatMap(d=>a(d)).filter(d=>!!d).map(Ce(r)).map(d=>this.executeQuerySpec(d,r));return this.combineResults(h,r.combineWith)}executeQuerySpec(e,t){let s={...this._options.searchOptions,...t},i=(s.fields||this._options.fields).reduce((f,m)=>({...f,[m]:P(s.boost,m)||1}),{}),{boostDocument:o,weights:r,maxFuzzy:c,bm25:a}=s,{fuzzy:u,prefix:l}={...ie.weights,...r},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,i,o,a),p,_;if(e.prefix&&(p=this._index.atPrefix(e.term)),e.fuzzy){let f=e.fuzzy===!0?.2:e.fuzzy,m=f<1?Math.min(c,Math.round(e.term.length*f)):f;m&&(_=this._index.fuzzyGet(e.term,m))}if(p)for(let[f,m]of p){let w=f.length-e.term.length;if(!w)continue;_?.delete(f);let S=l*f.length/(f.length+.3*w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}if(_)for(let f of _.keys()){let[m,w]=_.get(f);if(!w)continue;let S=u*f.length/(f.length+w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}return d}executeWildcardQuery(e){let t=new Map,s={...this._options.searchOptions,...e};for(let[i,o]of this._documentIds){let r=s.boostDocument?s.boostDocument(o,"",this._storedFields.get(i)):1;t.set(i,{score:r,terms:[],match:{}})}return t}combineResults(e,t=Q){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ve[s];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[o,r]of s)i[o]=Object.fromEntries(r);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,o,r,c,a,u=new Map){if(o==null)return u;for(let l of Object.keys(r)){let h=r[l],d=this._fieldIds[l],p=o.get(d);if(p==null)continue;let _=p.size,f=this._avgFieldLength[d];for(let m of p.keys()){if(!this._documentIds.has(m)){this.removeTerm(d,m,t),_-=1;continue}let w=c?c(this._documentIds.get(m),t,this._storedFields.get(m)):1;if(!w)continue;let S=p.get(m),V=this._fieldLength.get(m)[d],R=Me(S,_,this._documentCount,V,f,a),C=s*i*h*w*R,b=u.get(m);if(b){b.score+=C,Oe(b.terms,e);let z=P(b.match,t);z?z.push(l):b.match[t]=[l]}else u.set(m,{score:C,terms:[e],match:{[t]:[l]}})}}return u}addTerm(e,t,s){let i=this._index.fetch(s,re),o=i.get(e);if(o==null)o=new Map,o.set(t,1),i.set(e,o);else{let r=o.get(t);o.set(t,(r||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,re),o=i.get(e);o==null||o.get(t)==null?this.warnDocumentChanged(t,e,s):o.get(t)<=1?o.size<=1?i.delete(e):o.delete(t):o.set(t,o.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 ${this._documentIds.get(e)} has changed before removal: term "${s}" was not present in field "${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 o=this._fieldLength.get(e);o==null&&this._fieldLength.set(e,o=[]),o[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 o=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=o/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let o=this._storedFields.get(e);o==null&&this._storedFields.set(e,o={});for(let r of s){let c=i(t,r);c!==void 0&&(o[r]=c)}}};x.wildcard=Symbol("*");var P=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,ve={[Q]:(n,e)=>{for(let t of e.keys()){let s=n.get(t);if(s==null)n.set(t,e.get(t));else{let{score:i,terms:o,match:r}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,r),ne(s.terms,o)}}return n},[he]:(n,e)=>{let t=new Map;for(let s of e.keys()){let i=n.get(s);if(i==null)continue;let{score:o,terms:r,match:c}=e.get(s);ne(i.terms,r),t.set(s,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,c)})}return t},[ze]:(n,e)=>{for(let t of e.keys())n.delete(t);return n}},Fe={k:1.2,b:.7,d:.5},Me=(n,e,t,s,i,o)=>{let{k:r,b:c,d:a}=o;return Math.log(1+(t-e+.5)/(e+.5))*(a+n*(r+1)/(n+r*(1-c+c*s/i)))},Ce=n=>(e,t,s)=>{let i=typeof n.fuzzy=="function"?n.fuzzy(e,t,s):n.fuzzy||!1,o=typeof n.prefix=="function"?n.prefix(e,t,s):n.prefix===!0,r=typeof n.boostTerm=="function"?n.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:o,termBoost:r}},W={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(ke),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},ie={combineWith:Q,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fe},Le={combineWith:he,prefix:(n,e,t)=>e===t.length-1},$={batchSize:1e3,batchWait:10},J={minDirtFactor:.1,minDirtCount:20},B={...$,...J},Oe=(n,e)=>{n.includes(e)||n.push(e)},ne=(n,e)=>{for(let t of e)n.includes(t)||n.push(t)},oe=({score:n},{score:e})=>e-n,re=()=>new Map,k=n=>{let e=new Map;for(let t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},A=async n=>{let e=new Map,t=0;for(let s of Object.keys(n))e.set(parseInt(s,10),n[s]),++t%1e3===0&&await fe(0);return e},fe=n=>new Promise(e=>setTimeout(e,n)),ke=/[\n\r\p{Z}\p{P}]+/u;var ge=ye(Se(),1);var M,E,_e,pe=class{constructor(e){D(this,E);L(this,"mapData");L(this,"indexes");L(this,"ready");D(this,M);this.mapData=e,this.indexes=Ee(e),this.ready=this.populate(),K(this,M,Z(Y(this,E,_e).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,o=[];return e.removeAll(),o=o.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?.removeAll(),o.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s?.removeAll(),o.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(o)}async search(e,t={}){await this.ready,Ve.parse(t);let s=(0,ge.default)({},t,Te),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(a=>s.places.fields[a])});s.places.limit&&(i=i.slice(0,s.places.limit));let o=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(a=>s.enterpriseLocations.fields[a])});o&&s.enterpriseLocations.limit&&(o=o.slice(0,s.enterpriseLocations.limit));let r=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(a=>s.enterpriseCategories.fields[a])});r&&s.enterpriseCategories.limit&&(r=r.slice(0,s.enterpriseCategories.limit));let c=Ae(this.mapData,{placesResult:i,locationsResult:o,categoriesResult:r});return G(this,M).call(this,e),c}async suggest(e,t={}){await this.ready,Re.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:o=!0}={}}=t;return o&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(r=>s.push(r)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(r=>s.push(r)),s.sort((r,c)=>c.score-r.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(r=>r.suggestion)}),s}};M=new WeakMap,E=new WeakSet,_e=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ae(n,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:u,score:l,__type:h})=>{let d=n.getById(h,a);return d!=null&&!H.is(d)&&!X.is(d)&&!ee.is(d)&&!te.is(d)&&!se.is(d)&&c.push({type:d.__type,match:u,score:l,item:d}),c},[]),o;if(t){o=[];for(let{id:c,match:a,score:u}of t){let l=n.getById("enterprise-location",c);l&&o.push({type:l.__type,match:a,score:u,item:l})}}let r;if(s){r=[];for(let{id:c,match:a,score:u}of s){let l=n.getById("enterprise-category",c);l&&r.push({type:l.__type,match:a,score:u,item:l})}}return{places:i,enterpriseLocations:o,enterpriseCategories:r}}var Te={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function U(n){return n.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ee(n){let e=new x({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(r,c)=>{let a=r[c];return typeof a=="string"?U(a):r[c]},processTerm:r=>De.has(r)?"":r.toLowerCase()}),t=n.getByType("enterprise-location"),s;t&&(s=new x({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(r,c)=>Array.isArray(r[c])?r[c].join(" "):typeof r[c]=="string"?U(r[c]):r[c]}));let i=n.getByType("enterprise-category"),o;return i&&(o=new x({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(r,c){return c==="locations.name"?r.locations.reduce((u,l)=>u+` ${me} `+l.name,"")+` ${me}`:typeof r[c]=="string"?U(r[c]):r[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:o,enterpriseLocations:s,places:e}}var Ve=g.object({places:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseCategories:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional(),"locations.name":g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseLocations:g.object({fields:g.object({name:g.boolean().optional(),tags:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional()}),Re=g.object({places:g.object({enabled:g.boolean().optional()}).optional(),enterpriseLocations:g.object({enabled:g.boolean().optional()}).optional()}),De=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),me="";export{pe as InternalSearch,U as removeAccents};
2
- //# sourceMappingURL=internal-GHV4UNDA.js.map
1
+ import{B as g,E as Se,b as H,n as X,o as ee,p as te,q as se}from"./chunk-W57RTQ3G.js";import"./chunk-Y5QWL6TS.js";import{q as Z}from"./chunk-KKLQ3TRA.js";import"./chunk-EMVX4D2H.js";import"./chunk-BNEW6WES.js";import"./chunk-LWBDZWW4.js";import{a as O}from"./chunk-T5QQA4HH.js";import{d as ye,e as L,f as G,g as D,h as K,i as Y}from"./chunk-ROCNZJLL.js";O();O();var be="ENTRIES",ce="KEYS",ae="VALUES",y="",v=class{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}=I(this._path);if(I(t)===y)return{done:!1,value:this.result()};let s=e.get(I(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=I(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>I(e)).filter(e=>e!==y).join("")}value(){return I(this._path).node.get(y)}result(){switch(this._type){case ae:return this.value();case ce:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},I=n=>n[n.length-1],xe=(n,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,o=i+t,r=new Uint8Array(o*i).fill(t+1);for(let c=0;c<i;++c)r[c]=c;for(let c=1;c<o;++c)r[c*i]=c;return ue(n,e,t,s,r,1,i,""),s},ue=(n,e,t,s,i,o,r,c)=>{let a=o*r;e:for(let u of n.keys())if(u===y){let l=i[a-1];l<=t&&s.set(c,[n.get(u),l])}else{let l=o;for(let h=0;h<u.length;++h,++l){let d=u[h],p=r*l,_=p-r,f=i[p],m=Math.max(0,l-t-1),w=Math.min(r-1,l+t);for(let S=m;S<w;++S){let V=d!==e[S],R=i[_+S]+ +V,C=i[_+S+1]+1,b=i[p+S]+1,z=i[p+S+1]=Math.min(R,C,b);z<f&&(f=z)}if(f>t)continue e}ue(n.get(u),e,t,s,i,l,r,c+u)}},F=class n{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]=T(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,o]=q(s);for(let r of i.keys())if(r!==y&&r.startsWith(o)){let c=new Map;return c.set(r.slice(o.length),i.get(r)),new n(c,e)}}return new n(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ie(this._tree,e)}entries(){return new v(this,be)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return xe(this._tree,e,t)}get(e){let t=N(this._tree,e);return t!==void 0?t.get(y):void 0}has(e){let t=N(this._tree,e);return t!==void 0&&t.has(y)}keys(){return new v(this,ce)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,j(this._tree,e).set(y,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=j(this._tree,e);return s.set(y,t(s.get(y))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e),i=s.get(y);return i===void 0&&s.set(y,i=t()),i}values(){return new v(this,ae)}[Symbol.iterator](){return this.entries()}static from(e){let t=new n;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return n.from(Object.entries(e))}},T=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(let s of n.keys())if(s!==y&&e.startsWith(s))return t.push([n,s]),T(n.get(s),e.slice(s.length),t);return t.push([n,e]),T(void 0,"",t)},N=(n,e)=>{if(e.length===0||n==null)return n;for(let t of n.keys())if(t!==y&&e.startsWith(t))return N(n.get(t),e.slice(t.length))},j=(n,e)=>{let t=e.length;e:for(let s=0;n&&s<t;){for(let o of n.keys())if(o!==y&&e[s]===o[0]){let r=Math.min(t-s,o.length),c=1;for(;c<r&&e[s+c]===o[c];)++c;let a=n.get(o);if(c===o.length)n=a;else{let u=new Map;u.set(o.slice(c),a),n.set(e.slice(s,s+c),u),n.delete(o),n=u}s+=c;continue e}let i=new Map;return n.set(e.slice(s),i),i}return n},Ie=(n,e)=>{let[t,s]=T(n,e);if(t!==void 0){if(t.delete(y),t.size===0)le(s);else if(t.size===1){let[i,o]=t.entries().next().value;de(s,i,o)}}},le=n=>{if(n.length===0)return;let[e,t]=q(n);if(e.delete(t),e.size===0)le(n.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==y&&de(n.slice(0,-1),s,i)}},de=(n,e,t)=>{if(n.length===0)return;let[s,i]=q(n);s.set(i+e,t),s.delete(i)},q=n=>n[n.length-1],Q="or",he="and",ze="and_not",x=class n{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?B:e.autoVacuum;this._options={...W,...e,autoVacuum:t,searchOptions:{...ie,...e.searchOptions||{}},autoSuggestOptions:{...Le,...e.autoSuggestOptions||{}}},this._index=new F,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=J,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:o,idField:r}=this._options,c=t(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let u of o){let l=t(e,u);if(l==null)continue;let h=s(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.addFieldLength(a,d,this._documentCount-1,p);for(let _ of h){let f=i(_,u);if(Array.isArray(f))for(let m of f)this.addTerm(d,a,m);else f&&this.addTerm(d,a,f)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:r}=e.reduce(({chunk:c,promise:a},u,l)=>(c.push(u),(l+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return r.then(()=>this.addAll(o))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:o,idField:r}=this._options,c=i(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);let a=this._idToShortId.get(c);if(a==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let u of o){let l=i(e,u);if(l==null)continue;let h=t(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.removeFieldLength(a,d,this._documentCount,p);for(let _ of h){let f=s(_,u);if(Array.isArray(f))for(let m of f)this.removeTerm(d,a,m);else f&&this.removeTerm(d,a,f)}}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 F,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 ${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=J,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||$.batchSize,o=e.batchWait||$.batchWait,r=1;for(let[c,a]of this._index){for(let[u,l]of a)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?a.delete(u):l.delete(h));this._index.get(c).size===0&&this._index.delete(c),r%i===0&&await new Promise(u=>setTimeout(u,o)),r+=1}this._dirtCount-=s}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||B.minDirtCount,s=s||B.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{searchOptions:s}=this._options,i={...s,...t},o=this.executeQuery(e,t),r=[];for(let[c,{score:a,terms:u,match:l}]of o){let h=u.length||1,d={id:this._documentIds.get(c),score:a*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(c)),(i.filter==null||i.filter(d))&&r.push(d)}return e===n.wildcard&&i.boostDocument==null||r.sort(oe),r}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let s=new Map;for(let{score:o,terms:r}of this.search(e,t)){let c=r.join(" "),a=s.get(c);a!=null?(a.score+=o,a.count+=1):s.set(c,{score:o,terms:r,count:1})}let i=[];for(let[o,{score:r,terms:c,count:a}]of s)i.push({suggestion:o,terms:c,score:r/a});return i.sort(oe),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 async loadJSONAsync(e,t){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(W.hasOwnProperty(e))return P(W,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=k(i),a._fieldLength=k(o),a._storedFields=k(r);for(let[u,l]of a._documentIds)a._idToShortId.set(l,u);for(let[u,l]of s){let h=new Map;for(let d of Object.keys(l)){let p=l[d];c===1&&(p=p.ds),h.set(parseInt(d,10),k(p))}a._index.set(u,h)}return a}static async loadJSAsync(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=await A(i),a._fieldLength=await A(o),a._storedFields=await A(r);for(let[l,h]of a._documentIds)a._idToShortId.set(h,l);let u=0;for(let[l,h]of s){let d=new Map;for(let p of Object.keys(h)){let _=h[p];c===1&&(_=_.ds),d.set(parseInt(p,10),await A(_))}++u%1e3===0&&await fe(0),a._index.set(l,d)}return a}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:o,averageFieldLength:r,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new n(t);return u._documentCount=s,u._nextId=i,u._idToShortId=new Map,u._fieldIds=o,u._avgFieldLength=r,u._dirtCount=c||0,u._index=new F,u}executeQuery(e,t={}){if(e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let d={...t,...e,queries:void 0},p=e.queries.map(_=>this.executeQuery(_,d));return this.combineResults(p,d.combineWith)}let{tokenize:s,processTerm:i,searchOptions:o}=this._options,r={tokenize:s,processTerm:i,...o,...t},{tokenize:c,processTerm:a}=r,h=c(e).flatMap(d=>a(d)).filter(d=>!!d).map(Ce(r)).map(d=>this.executeQuerySpec(d,r));return this.combineResults(h,r.combineWith)}executeQuerySpec(e,t){let s={...this._options.searchOptions,...t},i=(s.fields||this._options.fields).reduce((f,m)=>({...f,[m]:P(s.boost,m)||1}),{}),{boostDocument:o,weights:r,maxFuzzy:c,bm25:a}=s,{fuzzy:u,prefix:l}={...ie.weights,...r},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,i,o,a),p,_;if(e.prefix&&(p=this._index.atPrefix(e.term)),e.fuzzy){let f=e.fuzzy===!0?.2:e.fuzzy,m=f<1?Math.min(c,Math.round(e.term.length*f)):f;m&&(_=this._index.fuzzyGet(e.term,m))}if(p)for(let[f,m]of p){let w=f.length-e.term.length;if(!w)continue;_?.delete(f);let S=l*f.length/(f.length+.3*w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}if(_)for(let f of _.keys()){let[m,w]=_.get(f);if(!w)continue;let S=u*f.length/(f.length+w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}return d}executeWildcardQuery(e){let t=new Map,s={...this._options.searchOptions,...e};for(let[i,o]of this._documentIds){let r=s.boostDocument?s.boostDocument(o,"",this._storedFields.get(i)):1;t.set(i,{score:r,terms:[],match:{}})}return t}combineResults(e,t=Q){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ve[s];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[o,r]of s)i[o]=Object.fromEntries(r);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,o,r,c,a,u=new Map){if(o==null)return u;for(let l of Object.keys(r)){let h=r[l],d=this._fieldIds[l],p=o.get(d);if(p==null)continue;let _=p.size,f=this._avgFieldLength[d];for(let m of p.keys()){if(!this._documentIds.has(m)){this.removeTerm(d,m,t),_-=1;continue}let w=c?c(this._documentIds.get(m),t,this._storedFields.get(m)):1;if(!w)continue;let S=p.get(m),V=this._fieldLength.get(m)[d],R=Me(S,_,this._documentCount,V,f,a),C=s*i*h*w*R,b=u.get(m);if(b){b.score+=C,Oe(b.terms,e);let z=P(b.match,t);z?z.push(l):b.match[t]=[l]}else u.set(m,{score:C,terms:[e],match:{[t]:[l]}})}}return u}addTerm(e,t,s){let i=this._index.fetch(s,re),o=i.get(e);if(o==null)o=new Map,o.set(t,1),i.set(e,o);else{let r=o.get(t);o.set(t,(r||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,re),o=i.get(e);o==null||o.get(t)==null?this.warnDocumentChanged(t,e,s):o.get(t)<=1?o.size<=1?i.delete(e):o.delete(t):o.set(t,o.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 ${this._documentIds.get(e)} has changed before removal: term "${s}" was not present in field "${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 o=this._fieldLength.get(e);o==null&&this._fieldLength.set(e,o=[]),o[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 o=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=o/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let o=this._storedFields.get(e);o==null&&this._storedFields.set(e,o={});for(let r of s){let c=i(t,r);c!==void 0&&(o[r]=c)}}};x.wildcard=Symbol("*");var P=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,ve={[Q]:(n,e)=>{for(let t of e.keys()){let s=n.get(t);if(s==null)n.set(t,e.get(t));else{let{score:i,terms:o,match:r}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,r),ne(s.terms,o)}}return n},[he]:(n,e)=>{let t=new Map;for(let s of e.keys()){let i=n.get(s);if(i==null)continue;let{score:o,terms:r,match:c}=e.get(s);ne(i.terms,r),t.set(s,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,c)})}return t},[ze]:(n,e)=>{for(let t of e.keys())n.delete(t);return n}},Fe={k:1.2,b:.7,d:.5},Me=(n,e,t,s,i,o)=>{let{k:r,b:c,d:a}=o;return Math.log(1+(t-e+.5)/(e+.5))*(a+n*(r+1)/(n+r*(1-c+c*s/i)))},Ce=n=>(e,t,s)=>{let i=typeof n.fuzzy=="function"?n.fuzzy(e,t,s):n.fuzzy||!1,o=typeof n.prefix=="function"?n.prefix(e,t,s):n.prefix===!0,r=typeof n.boostTerm=="function"?n.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:o,termBoost:r}},W={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(ke),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},ie={combineWith:Q,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fe},Le={combineWith:he,prefix:(n,e,t)=>e===t.length-1},$={batchSize:1e3,batchWait:10},J={minDirtFactor:.1,minDirtCount:20},B={...$,...J},Oe=(n,e)=>{n.includes(e)||n.push(e)},ne=(n,e)=>{for(let t of e)n.includes(t)||n.push(t)},oe=({score:n},{score:e})=>e-n,re=()=>new Map,k=n=>{let e=new Map;for(let t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},A=async n=>{let e=new Map,t=0;for(let s of Object.keys(n))e.set(parseInt(s,10),n[s]),++t%1e3===0&&await fe(0);return e},fe=n=>new Promise(e=>setTimeout(e,n)),ke=/[\n\r\p{Z}\p{P}]+/u;var ge=ye(Se(),1);var M,E,_e,pe=class{constructor(e){D(this,E);L(this,"mapData");L(this,"indexes");L(this,"ready");D(this,M);this.mapData=e,this.indexes=Ee(e),this.ready=this.populate(),K(this,M,Z(Y(this,E,_e).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,o=[];return e.removeAll(),o=o.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?.removeAll(),o.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s?.removeAll(),o.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(o)}async search(e,t={}){await this.ready,Ve.parse(t);let s=(0,ge.default)({},t,Te),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(a=>s.places.fields[a])});s.places.limit&&(i=i.slice(0,s.places.limit));let o=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(a=>s.enterpriseLocations.fields[a])});o&&s.enterpriseLocations.limit&&(o=o.slice(0,s.enterpriseLocations.limit));let r=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(a=>s.enterpriseCategories.fields[a])});r&&s.enterpriseCategories.limit&&(r=r.slice(0,s.enterpriseCategories.limit));let c=Ae(this.mapData,{placesResult:i,locationsResult:o,categoriesResult:r});return G(this,M).call(this,e),c}async suggest(e,t={}){await this.ready,Re.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:o=!0}={}}=t;return o&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(r=>s.push(r)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(r=>s.push(r)),s.sort((r,c)=>c.score-r.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(r=>r.suggestion)}),s}};M=new WeakMap,E=new WeakSet,_e=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ae(n,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:u,score:l,__type:h})=>{let d=n.getById(h,a);return d!=null&&!H.is(d)&&!X.is(d)&&!ee.is(d)&&!te.is(d)&&!se.is(d)&&c.push({type:d.__type,match:u,score:l,item:d}),c},[]),o;if(t){o=[];for(let{id:c,match:a,score:u}of t){let l=n.getById("enterprise-location",c);l&&o.push({type:l.__type,match:a,score:u,item:l})}}let r;if(s){r=[];for(let{id:c,match:a,score:u}of s){let l=n.getById("enterprise-category",c);l&&r.push({type:l.__type,match:a,score:u,item:l})}}return{places:i,enterpriseLocations:o,enterpriseCategories:r}}var Te={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function U(n){return n.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ee(n){let e=new x({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(r,c)=>{let a=r[c];return typeof a=="string"?U(a):r[c]},processTerm:r=>De.has(r)?"":r.toLowerCase()}),t=n.getByType("enterprise-location"),s;t&&(s=new x({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(r,c)=>Array.isArray(r[c])?r[c].join(" "):typeof r[c]=="string"?U(r[c]):r[c]}));let i=n.getByType("enterprise-category"),o;return i&&(o=new x({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(r,c){return c==="locations.name"?r.locations.reduce((u,l)=>u+` ${me} `+l.name,"")+` ${me}`:typeof r[c]=="string"?U(r[c]):r[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:o,enterpriseLocations:s,places:e}}var Ve=g.object({places:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseCategories:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional(),"locations.name":g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseLocations:g.object({fields:g.object({name:g.boolean().optional(),tags:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional()}),Re=g.object({places:g.object({enabled:g.boolean().optional()}).optional(),enterpriseLocations:g.object({enabled:g.boolean().optional()}).optional()}),De=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),me="";export{pe as InternalSearch,U as removeAccents};
2
+ //# sourceMappingURL=internal-7ECOLP5R.js.map
@@ -1,2 +1,2 @@
1
- import{$ as Z,A as y,B as z,C as A,D as B,E as C,F as D,G as E,H as F,I as G,J as H,K as I,L as J,M as K,N as L,O as M,P as N,Q as O,R as P,S as Q,T as R,U as S,V as T,W as U,X as V,Y as W,Z as X,_ as Y,aa as _,b as a,ba as $,c as b,ca as aa,d as c,da as ba,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,w as u,x as v,y as w,z as x}from"./chunk-EDIABNX3.js";import"./chunk-RMM4JL5D.js";import"./chunk-X26M5SQZ.js";import"./chunk-AHC6OWNT.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};
2
- //# sourceMappingURL=outdoor-context-v4-5AXRLXXA.js.map
1
+ import{$ as Z,A as y,B as z,C as A,D as B,E as C,F as D,G as E,H as F,I as G,J as H,K as I,L as J,M as K,N as L,O as M,P as N,Q as O,R as P,S as Q,T as R,U as S,V as T,W as U,X as V,Y as W,Z as X,_ as Y,aa as _,b as a,ba as $,c as b,ca as aa,d as c,da as ba,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,w as u,x as v,y as w,z as x}from"./chunk-EMVX4D2H.js";import"./chunk-BNEW6WES.js";import"./chunk-T5QQA4HH.js";import"./chunk-ROCNZJLL.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};
2
+ //# sourceMappingURL=outdoor-context-v4-IZYE32JG.js.map