@mappedin/mappedin-js 6.30.0 → 6.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +60 -123
- package/lib/esm/chunk-KVLT22ON.js +1254 -0
- package/lib/esm/chunk-X2E2A75O.js +1785 -0
- package/lib/esm/chunk-YLNWGJAU.js +661 -0
- package/lib/esm/index.d.ts +632 -59
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-6TN57EHG.js → inspector-ZUNZBXJH.js} +2 -2
- package/lib/esm/internal-2IB3DTOO.js +1 -0
- package/lib/esm/src-2IR6EZ5S.js +1 -0
- package/lib/esm/text3d-PXV6OP4G.js +1 -0
- package/lib/esm/workers/collision-worker.csp.js +1 -1
- package/package.json +2 -1
- package/lib/esm/GLTFExporter-6CFIB35E.js +0 -1
- package/lib/esm/GLTFLoader-4HJWTRLM.js +0 -1
- package/lib/esm/chunk-7WSSZSL2.js +0 -661
- package/lib/esm/chunk-NO3DWTOG.js +0 -1515
- package/lib/esm/chunk-NRL4CNJO.js +0 -1222
- package/lib/esm/chunk-Q7BEUNXA.js +0 -1
- package/lib/esm/chunk-UHBPXUGN.js +0 -3819
- package/lib/esm/internal-GAAKLDRM.js +0 -1
- package/lib/esm/src-PT63JZBF.js +0 -1
- package/lib/esm/text3d-CZ52NRGO.js +0 -252
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as D,B as E,C as F,D as G,E as O,F as P,I as Q,J as R,K as S,L as T,M as U,N as V,O as W,P as X,Q as Y,R as Z,S as _,T as $,U as aa,V as ba,W as ca,X as da,a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A,y as B,z as C}from"./chunk-
|
|
1
|
+
import{A as D,B as E,C as F,D as G,E as O,F as P,I as Q,J as R,K as S,L as T,M as U,N as V,O as W,P as X,Q as Y,R as Z,S as _,T as $,U as aa,V as ba,W as ca,X as da,a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A,y as B,z as C}from"./chunk-YLNWGJAU.js";import{C as M,E as N}from"./chunk-KVLT22ON.js";import{Ob as L,Ta as K,U as H,c as a,ca as I,d as b,f as c,ga as J}from"./chunk-X2E2A75O.js";import"./chunk-PWEV3AFA.js";export{z as ACTION_TYPE,H as ANIMATION_TWEENS,t as Annotation,m as Area,A as BEARING_TYPE,B as CONNECTION_TYPE,q as Connection,g as Coordinate,D as DOORS,k as DetailedMapData,E as Directions,n as Door,a as E_SDK_LOG_LEVEL,x as EnterpriseCategory,w as EnterpriseLocation,y as EnterpriseVenue,v as Facade,p as Floor,u as FloorStack,i as Hyperlink,j as ImageMetaData,G as LocationCategory,F as LocationProfile,l as MAPPEDIN_COLORS,r as MapObject,R as MapView,h as Node,s as PointOfInterest,o as Space,C as WALLS,K as __INTERNAL__MAPPEDIN_LAYER_ID,N as __INTERNAL__MapLibreOverlay,M as __INTERNAL__RendererCore,T as __INTERNAL__convertToRendererCoreOptions,V as __setWatermarkOnClickFn,aa as checkWorkerUrls,P as disableText3DWorker,I as enableTestMode,U as findPreferredLanguageInVenue,Y as forceEnterpriseLocations,_ as getMapData,$ as getMapDataEnterprise,O as getMultiFloorState,ca as getVersion,S as hydrateMapData,W as hydrateMapDataFromMVF,b as parseLogLevel,d as parseMVF,L as preloadFont,J as setHeadlessViewport,c as setLoggerLevel,X as setUseEnterpriseAPI,Q as setWorkersUrl,Z as shouldForceEnterpriseLocations,ba as show3dMap,da as show3dMapGeojson,f as unzipAndParseMVFv2,e as unzipMVF};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as N,H as ee,l as O,t as $,u as P}from"./chunk-7WSSZSL2.js";import"./chunk-NRL4CNJO.js";import{j as S}from"./chunk-NO3DWTOG.js";import"./chunk-Q7BEUNXA.js";import{a as v}from"./chunk-UHBPXUGN.js";import"./chunk-PWEV3AFA.js";v();v();v();v();var M=class n{constructor(e,i,t,o,r="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.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",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.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(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,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(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),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)}},Y=class extends M{constructor(e,i,t){super(e,i,t,"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 V(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var be={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:V,toHexString:V},D={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},ye={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=D.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},ve={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=D.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},xe=[be,D,ye,ve];function Ce(n){return xe.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,o){super(e,i,t,"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=Ce(this.initialValue),this._rgbScale=o,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 r=V(this.$text.value);r&&this._setValueFromHexString(r)}),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(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),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}},I=class extends M{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},W=class extends M{constructor(e,i,t,o,r,l){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(r);let s=l!==void 0;this.step(s?l:this._getImplicitStep(),s),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.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 i=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},t=b=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+b),this.$input.value=this.getValue())},o=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b)*-1))},r=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,s,c,f,d,a,p=5,h=b=>{s=b.clientX,c=f=b.clientY,l=!0,d=this.getValue(),a=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let C=b.clientX-s,L=b.clientY-c;Math.abs(L)>p?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>p&&m()}if(!l){let C=b.clientY-f;a-=C*this._step*this._arrowKeyMultiplier(b),d+a>this._max?a=this._max-d:d+a<this._min&&(a=this._min-d),this._snapClampSetValue(d+a)}f=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m)},y=()=>{this._inputFocused=!0},u=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",h),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",u)}_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 e=(u,b,C,L,_)=>(u-b)/(C-b)*(_-L)+L,i=u=>{let b=this.$slider.getBoundingClientRect(),C=e(u,b.left,b.right,this._min,this._max);this._snapClampSetValue(C)},t=u=>{this._setDraggingStyle(!0),i(u.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",r)},o=u=>{i(u.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r)},l=!1,s,c,f=u=>{u.preventDefault(),this._setDraggingStyle(!0),i(u.touches[0].clientX),l=!1},d=u=>{u.touches.length>1||(this._hasScrollBar?(s=u.touches[0].clientX,c=u.touches[0].clientY,l=!0):f(u),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",p))},a=u=>{if(l){let b=u.touches[0].clientX-s,C=u.touches[0].clientY-c;Math.abs(b)>Math.abs(C)?f(u):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p))}else u.preventDefault(),i(u.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p)},h=this._callOnFinishChange.bind(this),g=400,m,y=u=>{if(Math.abs(u.deltaX)<Math.abs(u.deltaY)&&this._hasScrollBar)return;u.preventDefault();let C=this._normalizeMouseWheel(u)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(h,g)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",y,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${i}`,e)}_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(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},X=class extends M{constructor(e,i,t,o){super(e,i,t,"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(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},K=class extends M{constructor(e,i,t){super(e,i,t,"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",o=>{o.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}},Ae=`.lil-gui {
|
|
1
|
+
import{G as N,H as ee,l as O,t as $,u as P}from"./chunk-YLNWGJAU.js";import"./chunk-KVLT22ON.js";import{a as v,l as S}from"./chunk-X2E2A75O.js";import"./chunk-PWEV3AFA.js";v();v();v();v();var M=class n{constructor(e,i,t,o,r="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.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",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.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(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,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(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),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)}},Y=class extends M{constructor(e,i,t){super(e,i,t,"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 V(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var be={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:V,toHexString:V},D={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},ye={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=D.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},ve={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=D.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},xe=[be,D,ye,ve];function Ce(n){return xe.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,o){super(e,i,t,"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=Ce(this.initialValue),this._rgbScale=o,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 r=V(this.$text.value);r&&this._setValueFromHexString(r)}),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(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),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}},I=class extends M{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},W=class extends M{constructor(e,i,t,o,r,l){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(r);let s=l!==void 0;this.step(s?l:this._getImplicitStep(),s),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.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 i=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},t=b=>{let C=parseFloat(this.$input.value);isNaN(C)||(this._snapClampSetValue(C+b),this.$input.value=this.getValue())},o=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b)*-1))},r=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,s,c,f,d,a,p=5,h=b=>{s=b.clientX,c=f=b.clientY,l=!0,d=this.getValue(),a=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let C=b.clientX-s,L=b.clientY-c;Math.abs(L)>p?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(C)>p&&m()}if(!l){let C=b.clientY-f;a-=C*this._step*this._arrowKeyMultiplier(b),d+a>this._max?a=this._max-d:d+a<this._min&&(a=this._min-d),this._snapClampSetValue(d+a)}f=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m)},y=()=>{this._inputFocused=!0},u=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",h),this.$input.addEventListener("focus",y),this.$input.addEventListener("blur",u)}_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 e=(u,b,C,L,_)=>(u-b)/(C-b)*(_-L)+L,i=u=>{let b=this.$slider.getBoundingClientRect(),C=e(u,b.left,b.right,this._min,this._max);this._snapClampSetValue(C)},t=u=>{this._setDraggingStyle(!0),i(u.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",r)},o=u=>{i(u.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r)},l=!1,s,c,f=u=>{u.preventDefault(),this._setDraggingStyle(!0),i(u.touches[0].clientX),l=!1},d=u=>{u.touches.length>1||(this._hasScrollBar?(s=u.touches[0].clientX,c=u.touches[0].clientY,l=!0):f(u),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",p))},a=u=>{if(l){let b=u.touches[0].clientX-s,C=u.touches[0].clientY-c;Math.abs(b)>Math.abs(C)?f(u):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p))}else u.preventDefault(),i(u.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p)},h=this._callOnFinishChange.bind(this),g=400,m,y=u=>{if(Math.abs(u.deltaX)<Math.abs(u.deltaY)&&this._hasScrollBar)return;u.preventDefault();let C=this._normalizeMouseWheel(u)*this._step;this._snapClampSetValue(this.getValue()+C),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(h,g)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",y,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${i}`,e)}_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(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},X=class extends M{constructor(e,i,t,o){super(e,i,t,"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(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},K=class extends M{constructor(e,i,t){super(e,i,t,"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",o=>{o.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}},Ae=`.lil-gui {
|
|
2
2
|
font-family: var(--font-family);
|
|
3
3
|
font-size: var(--font-size);
|
|
4
4
|
line-height: 1;
|
|
@@ -479,4 +479,4 @@ import{G as N,H as ee,l as O,t as $,u as P}from"./chunk-7WSSZSL2.js";import"./ch
|
|
|
479
479
|
<span style="font-weight: 500; color: #FFFFFF; font-size: 16px;">${d.name}</span>
|
|
480
480
|
<br>
|
|
481
481
|
<span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>
|
|
482
|
-
</div>`,{rank:"always-visible"});f.add(p),n.push(h)}})})}return()=>{n.forEach(c=>o.Markers.remove(c))}}}}var F={duration:300,easing:"ease-in-out"},H=Ee();v();var w={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 ke(n){n.add(w.options.places.fields,"name").name("Places: Name"),n.add(w.options.places.fields,"description").name("Places: Description"),n.add(w.options.places.fields,"link").name("Places: Link"),n.add(w.options.places.fields,"category").name("Places: Category"),n.add(w.options.places,"limit"),n.add(w.options.locations.fields,"name").name("Locations: Name"),n.add(w.options.locations.fields,"tag").name("Locations: Tag"),n.add(w.options.locations.fields,"description").name("Locations: Description"),n.add(w.options.places,"limit"),n.add(w.options.categories.fields,"name").name("Categories: Name")}function ne(n,e,i){let t=new S,o=i.addFolder("Search");o.open();let r=o.add(w,"search").onChange(async d=>{let a=await e.Search.query(d,w.options);a&&(w.results=a,s(a,t))}),l=document.createElement("div");l.style.marginLeft="10px",r.domElement.parentElement?.appendChild(l);let{renderSearch:s,close:c}=Me(n,e,l,r.$input),f=o.addFolder("Advanced");return f.close(),ke(f),document.addEventListener("keydown",d=>{(d.metaKey||d.ctrlKey)&&d.key==="k"?(d.preventDefault(),o._closed&&o.open(),r.$input.focus()):d.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function Me(n,e,i,t){let o,r;t.addEventListener("input",async s=>{s instanceof InputEvent&&(s.inputType==="insertText"||s.inputType==="insertCompositionText")&&(clearTimeout(o),o=setTimeout(async()=>{let c=await e.Search.suggest(t.value);c&&c.length>0&&l(c[0]?.suggestion)},100))});function l(s){if(!s){t.placeholder="";return}let c=t.value;t.value=s,t.setSelectionRange(c.length,s.length)}return{renderSearch(s,c){if(s.places.length===0&&s.enterpriseCategories?.length===0&&s.enterpriseLocations?.length===0){i.textContent="No results found.";return}r=Le(i,s,n,c)},close(){r.destroy()}}}function Le(n,e,i,t){n.innerHTML="";let o=document.createElement("div");Object.assign(o.style,G.dropdownContainer);let r=document.createElement("ul");r.className="options-list",Object.assign(r.style,G.optionsList),r.style.display="block";let l=[],s=(p,h)=>{if(h&&h.length>0){let g=document.createElement("li");g.textContent=p,Object.assign(g.style,G.sectionHeader),r.appendChild(g),h.forEach((m,y)=>{let u=document.createElement("li");u.textContent=`${"name"in m.item?m.item.name:""} (${m.type})`,Object.assign(u.style,G.option),u.tabIndex=0,u.addEventListener("focus",()=>{f(l.indexOf(u))}),u.addEventListener("mouseover",()=>{u.style.backgroundColor="#f0f0f0"}),u.addEventListener("mouseout",()=>{u.style.backgroundColor=""}),u.addEventListener("click",()=>{}),u.setAttribute("data-type",p),u.setAttribute("data-index",y.toString()),r.appendChild(u),l.push(u)})}};s("enterpriseLocations",e.enterpriseLocations),s("enterpriseCategories",e.enterpriseCategories),s("Places",e.places),o.appendChild(r),n.appendChild(o);let c=[],f=p=>{c.forEach(u=>u()),c=[],l.forEach((u,b)=>{b===p?u.style.backgroundColor="#e0e0e0":u.style.backgroundColor=""});let h=l[p],g=h.getAttribute("data-type"),m=parseInt(h.getAttribute("data-index")||"0",10);if(!g)return;let{item:y}=e[g.toLowerCase()][m];t.publish("highlight",y)},d=p=>{!o.contains(p.target)&&p.target!==n&&a()};document.addEventListener("click",d);let a=()=>{n.innerHTML="",document.removeEventListener("click",d)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var G={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 oe(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:o}=ne(n,e,i);o.on("highlight",d=>{if(d){t.forEach(p=>p()),t=[];let a=d instanceof $?d.spaces[0]:d;if(n.Camera.focusOn(d),a&&!O.is(a))return;t.push(H.highlightCard(n,a,{focus:!0}))}else t.forEach(a=>a()),t=[]});let r=i.addFolder("Click \u{1F447}").close(),{sub:l}=$e(n,r);l.on("click",d=>{t.forEach(a=>a()),t=[],d.spaces?.[0]&&(t=[H.highlightCard(n,d.spaces[0])])});let s=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Se(n,s),f;c.on("hover",d=>{d.spaces?.[0]?(f?.(),t.length===0&&(f=H.highlightCard(n,d.spaces[0]))):(f?.(),f=void 0)})}function $e(n,e){let i=new S,t={position:"",hoverColor:E(n.getHoverColor())},o=e.add(t,"position").disable(),r=[];function l(){r.forEach(c=>c()),r.length=0}let s=0;return n.on("click",c=>{let{labels:f,coordinate:d}=c;l(),i.publish("click",c),clearInterval(s),o.load(JSON.stringify([d.longitude,d.latitude]));let a=f?.[0];if(a!=null){let h=T(n,a,e);if(!h)return;r.push(h.destroy),h.labelItemFolder.openAnimated()}let p=c.spaces?.[0]??c.objects?.[0];if(p){let h={...p,...n.getState(p),isInView:!1,isInViewCheck:U(n,p.id)},{cleanup:g}=B(n,h,e);s=setInterval(()=>{h.isInView=n.isInView(a||p)},500),r.push(g)}}),{sub:i}}function Se(n,e){let i=new S;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},o=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(s=>{n.setHoverColor(s)});let r=[];function l(){r.forEach(s=>s()),r.length=0}return n.on("hover",s=>{let{coordinate:c,spaces:f,objects:d,markers:a,labels:p}=s;l(),i.publish("hover",s),o.load(JSON.stringify([c.longitude,c.latitude]));let h=f?.[0]??d?.[0]??a?.[0]??p?.[0];if(!h)return;let g=n.getState(h);g&&(t.type=g.type,t.id=h.id)}),{sub:i}}function U(n,e){return function(){console.log("isInView",n.isInView(e))}}function re(n,e,i){let t={labels:{},all(){i.Labels.__EXPERIMENTAL__all().forEach(h=>{this.labels[h.id]=h}),c()},removeAllLabels(){i.Labels.removeAll().forEach(h=>{delete this.labels[h.id]}),c()}},{addLabel:o,destroy:r}=Fe(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.labels[m.id],s.get(m.id)?.destroy()}function h(m){let y=T(i,m,l,{onRemove:b=>{p(b)}});if(!y)return;let{labelItemFolder:u}=y;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let y=t.labels[m];h(y)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({labels:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.labels[h.id]=h;c()}return{populatelabels:a,destroy(){r()}}}function Ie(n,e,i,t,o){let{interactive:r,enabled:l,rank:s,anchor:c,dynamicResize:f,zIndex:d,contentHTML:a,lowPriorityPin:p}=t;if(r==null||l==null)throw new Error("incomplete marker state");let h={interactive:r,enabled:l,rank:s||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:f||!1,zIndex:d||0,contentHTML:a||"",lowPriorityPin:{enabled:p?.enabled??!0,size:p?.size??8,color:E(p?.color??"#666")},remove(){n.Markers.remove(e),o?.(e),i.destroy()},isInView:U(n,e.id)};i.onChange(m=>{let y={interactive:h.interactive,enabled:h.enabled,rank:h.rank,dynamicResize:h.dynamicResize,contentHTML:h.contentHTML,lowPriorityPin:{enabled:h.lowPriorityPin.enabled,size:h.lowPriorityPin.size,color:h.lowPriorityPin.color}};h.rank==="always-visible"&&(y.zIndex=h.zIndex),n.updateState(e,y)}),i.add(h,"interactive"),i.add(h,"enabled"),i.add(h,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(h,"anchor").name("anchor (read-only)").disable(),i.add(h,"dynamicResize").name("dynamic resize"),h.rank==="always-visible"&&i.add(h,"zIndex",0,1e3,1).name("z-index"),i.add(h,"contentHTML").name("content HTML");let g=i.addFolder("Low Priority Pin");g.add(h.lowPriorityPin,"enabled"),g.add(h.lowPriorityPin,"size",1,20,1),g.addColor(h.lowPriorityPin,"color"),g.close(),i.add(h,"isInView"),i.add(h,"remove")}function De(n,e,i,t,o){let{appearance:r,interactive:l}=t;if(!r||r.margin==null||l==null)throw new Error("incomplte label state");let s={text:e.text,interactive:l,appearance:{...r,margin:r.margin||0,pinColor:r.pinColor?E(r.pinColor):"black",textColor:r.textColor?E(r.textColor):"black"},remove(){n.Labels.remove(e),o?.(e),i.destroy()},isInView:U(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:s.appearance,interactive:s.interactive})}),i.add(s.appearance,"margin",0,20).name("margin"),i.add(s,"text"),i.add(s,"interactive"),i.addColor(s.appearance,"pinColor").name("pin color"),i.addColor(s.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(s.appearance,"textColor").name("text color"),i.addColor(s.appearance,"textOutlineColor").name("text outline color"),i.add(s,"isInView"),i.add(s,"remove")}function T(n,e,i,{onRemove:t}={}){let o=n.getState(e);if(!o)throw new Error(`error getting state for entity: ${e.id}`);let r=o.type===N?e.text?.substring(0,12)||"Label":`Marker ${e.id.toString().substring(0,8)}`,l=i.addFolder(r);if(l.close(),o.type===N)De(n,e,l,o,t);else if(o.type===ee)Ie(n,e,l,o,t);else throw new Error(`unsupported entity type: ${o.type}`);return{labelItemFolder:l,destroy(){l.destroy()}}}function Fe(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:6,text:"New Label!",interactive:!0,marginForegroundColor:E("skyblue"),marginBackgroundColor:E("coral"),textForegroundColor:E("slategray"),textBackgroundColor:E("white")};return i.add(t,"onClick"),i.add(t,"margin"),i.add(t,"interactive"),i.add(t,"text"),{destroy(){i.destroy()},addLabel(o){return i._closed||!t.onClick?void 0:e.Labels.add(o,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var se={};v();function ae(n,e,i){let t=n.addFolder("Camera \u{1F4F7}"),o=e.Camera.center.toJSON(),r=document.createElement("div");Object.assign(r.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(r);let l=()=>e.getDimensions(),[s,c,f,d]=i?.padding??[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],a={center_lat:o.latitude,center_lon:o.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i?.padding?"pixel":e.Camera.screenOffsets.type,inset_top:s,inset_left:d,inset_right:c,inset_bottom:f,animateOnLoad:!0,visualizeInset:!!(s||c||f||d),"Focus on click":i?.focusOnClick??!1,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function p(){a.inset_type=e.Camera.screenOffsets.type,a.inset_left=e.Camera.screenOffsets.left,a.inset_top=e.Camera.screenOffsets.top,a.inset_right=e.Camera.screenOffsets.right,a.inset_bottom=e.Camera.screenOffsets.bottom;let{width:x,height:k}=l();a.inset_type==="portion"?Object.assign(r.style,{left:a.inset_left*x+"px",top:a.inset_top*k+"px",bottom:a.inset_bottom*k+"px",right:a.inset_right*x+"px"}):Object.assign(r.style,{left:a.inset_left+"px",top:a.inset_top+"px",bottom:a.inset_bottom+"px",right:a.inset_right+"px"})}t.add(a,"center_lat").listen().disable(),t.add(a,"center_lon").listen().disable(),t.add(a,"zoomLevel",16,22,.5).listen().disable(),t.add(a,"pitch").listen().disable(),t.add(a,"bearing").listen().disable(),t.add(a,"minZoomLevel",5,22,.5).onChange(x=>{e.Camera.setMinZoomLevel(x)}),t.add(a,"maxZoomLevel",10,22,.5).onChange(x=>{e.Camera.setMaxZoomLevel(x)}),t.add(a,"animateOnLoad"),t.add(a,"visualizeInset").onChange(q),q(a.visualizeInset);let h,g,m,y;function u(){let{width:x,height:k}=l(),R=e.Camera.screenOffsets.type,j=a.inset_type;R!==j&&(j==="portion"&&R==="pixel"?(a.inset_top=x>0?Math.min(a.inset_top/k,1):0,a.inset_bottom=x>0?Math.min(a.inset_bottom/k,1):0,a.inset_left=k>0?Math.min(a.inset_left/x,1):0,a.inset_right=k>0?Math.min(a.inset_right/x,1):0):j==="pixel"&&R==="portion"&&(a.inset_top=Math.round(a.inset_top*k),a.inset_bottom=Math.round(a.inset_bottom*k),a.inset_left=Math.round(a.inset_left*x),a.inset_right=Math.round(a.inset_right*x))),h&&h.destroy(),g&&g.destroy(),m&&m.destroy(),y&&y.destroy(),a.inset_type==="portion"?(h=t.add(a,"inset_top",0,1,.01).onChange(_),g=t.add(a,"inset_bottom",0,1,.01).onChange(_),m=t.add(a,"inset_left",0,1,.01).onChange(_),y=t.add(a,"inset_right",0,1,.01).onChange(_)):(h=t.add(a,"inset_top",0,k,1).onChange(_),g=t.add(a,"inset_bottom",0,k,1).onChange(_),m=t.add(a,"inset_left",0,x,1).onChange(_),y=t.add(a,"inset_right",0,x,1).onChange(_))}t.add(a,"inset_type",["pixel","portion"]).onChange(()=>{u(),_()}),u();let b=Oe(e);t.add(a,"Focus on click").onChange(x=>{x?e.on("click",b):e.off("click",b)}),a["Focus on click"]&&e.on("click",b),t.add(a,"Focus on current floor");let C=x=>{t._closed||(a.center_lat=x.center.latitude,a.center_lon=x.center.longitude,a.zoomLevel=x.zoomLevel,a.bearing=x.bearing,a.pitch=x.pitch)};e.on("camera-change",C);let L=[()=>{e.off("camera-change",C)}];function _(){e.Camera.setScreenOffsets({top:a.inset_top,left:a.inset_left,right:a.inset_right,bottom:a.inset_bottom,type:a.inset_type}),p()}(a.inset_top||a.inset_right||a.inset_bottom||a.inset_left)&&_();function q(x){p(),x?r.style.display="block":r.style.display="none"}return()=>({destroy(){t.destroy(),ie(L)}})}function Oe(n){return function(i){let{spaces:t,objects:o}=i,r=t?.[0]??o?.[0];r&&n.Camera.focusOn(r)}}v();function le(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(h=>{delete this.markers[h.id]}),c()}},{addMarker:o,destroy:r}=Pe(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.markers[m.id],s.get(m.id)?.destroy()}function h(m){let y=T(i,m,l,{onRemove:b=>{p(b)}});if(!y)return;let{labelItemFolder:u}=y;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let y=t.markers[m];h(y)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({markers:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.markers[h.id]=h;c()}return{populateMarkers:a,destroy(){r()}}}function Pe(n,e){let i=n.addFolder("Add"),t={onClick:!1,interactive:!0,rank:"medium",anchor:"center",dynamicResize:!1,enabled:!0,zIndex:0,lowPriorityPin:{enabled:!0,size:8,color:"#666"},contentHTML:'<div style="padding: 8px; background: white; border: 2px solid #333; border-radius: 4px;">New Marker</div>'};i.add(t,"onClick"),i.add(t,"interactive"),i.add(t,"enabled"),i.add(t,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(t,"anchor",["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]).name("anchor"),i.add(t,"dynamicResize").name("dynamic resize"),i.add(t,"zIndex",0,1e3,1).name("z-index (always-visible only)"),i.add(t,"contentHTML").name("content HTML");let o=i.addFolder("Low Priority Pin");return o.add(t.lowPriorityPin,"enabled"),o.add(t.lowPriorityPin,"size",1,20,1),o.addColor(t.lowPriorityPin,"color"),o.close(),{destroy(){i.destroy()},addMarker(r){if(i._closed||!t.onClick)return;let l={interactive:t.interactive,enabled:t.enabled,rank:t.rank,anchor:t.anchor,dynamicResize:t.dynamicResize,lowPriorityPin:{enabled:t.lowPriorityPin.enabled,size:t.lowPriorityPin.size,color:t.lowPriorityPin.color}};return t.rank==="always-visible"&&(l.zIndex=t.zIndex),e.Markers.add(r,t.contentHTML,l)}}}v();function de(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(l=>{e.updateState("exterior-walls",{visible:l})}),i.addColor(t,"topColor").onChange(l=>{e.updateState("exterior-walls",{topColor:l})}),i.addColor(t,"color").onChange(l=>{e.updateState("exterior-walls",{color:l})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{texture:{url:l}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{topTexture:{url:l}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}v();function ce(n,e,i){n.close();let t={language:i.currentLanguage?.code??"en"},o=i.getByType("enterprise-venue");n.add(t,"language",o?.languages.map(r=>r.code)).onChange(r=>{i.changeLanguage(r)})}v();function he(n,e,i){let t=n.addFolder("Debug");t.close();let o=e.Debug.state,r={showPolygonLabelTextAreaMesh:o.showPolygonLabelTextAreaMesh,showCollisionBoxes:o.showCollisionBoxes,showEnvMap:o.showEnvMap};t.add(r,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(r,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(r,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(r)}v();function ue(n,e,i){let t=n.addFolder("Text3D").close(),o={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(o,"all").name("Show All"),t.add(o,"removeAll").name("Remove All")}v();function pe(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let o=localStorage.getItem("directionsMethod"),r=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",s={enabled:!1,method:o||"dp-optimal",radius:r?parseFloat(r):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,f,d;t.add(s,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(s,"startCoordinate").name("Start").disable().listen(),t.add(s,"endCoordinate").name("End").disable().listen(),t.add(s,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&f&&s.enabled&&h(c,f)}),t.add(s,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"pathInfo").name("Path Info").disable().listen();let a={clear:()=>p()};t.add(a,"clear").name("Clear Path");function p(){c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function h(m,y){d&&(e.Paths.remove(d),d=void 0);try{let u=await e.getDirections(m,y,{smoothing:{enabled:!0,method:s.method,radius:s.radius,includeDoorBufferNodes:s.includeDoorBufferNodes}});if(u){d=e.Paths.add(u.coordinates,{interactive:!0,color:"green",width:1});let C=u.distance?.toFixed(2)||"N/A";s.pathInfo=`${u.coordinates.length} pts, ${C}m`}else s.pathInfo="No path found"}catch(u){s.pathInfo=`Error: ${u instanceof Error?u.message:"Unknown"}`}}let g=async m=>{if(s.enabled)if(c){let y=m.coordinate;f=y,s.endCoordinate=`${y.latitude.toFixed(6)}, ${y.longitude.toFixed(6)}`,s.pathInfo="Calculating...",await h(c,f),c=void 0,f=void 0}else{let y=m.coordinate;c=y,s.startCoordinate=`${y.latitude.toFixed(6)}, ${y.longitude.toFixed(6)}`,s.pathInfo="Click to set end..."}};return e.on("click",g),{destroy(){e.off("click",g),t.destroy()}}}v();function fe(n,e){let i=n.addFolder("Spaces Open To Below Visual Effect").close(),t=e.getGlobalState().multiFloorView,o={enabled:t.spacesOpenToBelowVisualEffectEnabled,darkenAmount:t.spacesOpenToBelowVisualEffectDarkenAmount,darkenUseDepth:t.spacesOpenToBelowVisualEffectDarkenUseDepth,desaturateAmount:t.spacesOpenToBelowVisualEffectDesaturateAmount,desaturateUseDepth:t.spacesOpenToBelowVisualEffectDesaturateUseDepth,washOutAmount:t.spacesOpenToBelowVisualEffectWashOutAmount,washOutUseDepth:t.spacesOpenToBelowVisualEffectWashOutUseDepth};function r(){e.updateGlobalState({multiFloorView:{spacesOpenToBelowVisualEffectEnabled:o.enabled,spacesOpenToBelowVisualEffectDarkenAmount:o.darkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:o.darkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:o.desaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:o.desaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:o.washOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:o.washOutUseDepth}})}i.add(o,"enabled").name("Enabled").onChange(()=>r());let l=i.addFolder("Darken");l.add(o,"darkenAmount",0,1,.01).name("Amount").onChange(()=>r()),l.add(o,"darkenUseDepth").name("Use Depth").onChange(()=>r());let s=i.addFolder("Desaturate");s.add(o,"desaturateAmount",0,1,.01).name("Amount").onChange(()=>r()),s.add(o,"desaturateUseDepth").name("Use Depth").onChange(()=>r());let c=i.addFolder("Wash Out");c.add(o,"washOutAmount",0,1,.01).name("Amount").onChange(()=>r()),c.add(o,"washOutUseDepth").name("Use Depth").onChange(()=>r())}function me(n,e,i){ze();let t=new z({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),oe(e,n,t),ae(t,e,i?.camera);let o=t.addFolder("Levels").close(),r=t.addFolder("Scene Controls");r.close();let l=t.addFolder("Labels");ue(t,e,n);let s=t.addFolder("Markers");de(t,e);let c=t.addFolder("misc");he(t,e,n),fe(t,e),pe(t,e,n),ce(c,e,n);let f={level:e.currentFloor.id},{populatelabels:d}=re(l,n,e),{populateMarkers:a}=le(s,n,e),p=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),h=o.add(f,"level",p).onChange(g=>{e.setFloor(g),f.level=e.currentFloor.id,h.updateDisplay()});return e.on("floor-change-start",g=>{o.controllers[0].setValue(g.floor.id)}),n.getByType("space").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:r,populateMarkers:a}}var ge="mappedin-sdk-debug-css";function ze(){if(document.getElementById(ge))return;let n=document.createElement("style");n.id=ge,n.textContent=se,document.head.appendChild(n)}var Q=class{_enabled=!1;mv;api;mapData;storeStateToLocalStorageEnabled=!1;constructor(e,i){this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:i}=me(this.mapData,this.mv,e),t=!1;i.onOpenClose(async o=>{if(!(o!==i||o._closed||t)){t=!0,[...i.children].forEach(r=>r.destroy());try{let{mountSceneGraphVisualizer:r}=await import("./src-PT63JZBF.js");r(this.api.core,i)}catch{}finally{i.open(),t=!1}}}),this.api.getMapDataInternal()?.spaces.forEach(o=>{this.mv.updateState(o,{interactive:!0})})}get enabled(){return this._enabled}};export{Q as Inspector};
|
|
482
|
+
</div>`,{rank:"always-visible"});f.add(p),n.push(h)}})})}return()=>{n.forEach(c=>o.Markers.remove(c))}}}}var F={duration:300,easing:"ease-in-out"},H=Ee();v();var w={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 ke(n){n.add(w.options.places.fields,"name").name("Places: Name"),n.add(w.options.places.fields,"description").name("Places: Description"),n.add(w.options.places.fields,"link").name("Places: Link"),n.add(w.options.places.fields,"category").name("Places: Category"),n.add(w.options.places,"limit"),n.add(w.options.locations.fields,"name").name("Locations: Name"),n.add(w.options.locations.fields,"tag").name("Locations: Tag"),n.add(w.options.locations.fields,"description").name("Locations: Description"),n.add(w.options.places,"limit"),n.add(w.options.categories.fields,"name").name("Categories: Name")}function ne(n,e,i){let t=new S,o=i.addFolder("Search");o.open();let r=o.add(w,"search").onChange(async d=>{let a=await e.Search.query(d,w.options);a&&(w.results=a,s(a,t))}),l=document.createElement("div");l.style.marginLeft="10px",r.domElement.parentElement?.appendChild(l);let{renderSearch:s,close:c}=Me(n,e,l,r.$input),f=o.addFolder("Advanced");return f.close(),ke(f),document.addEventListener("keydown",d=>{(d.metaKey||d.ctrlKey)&&d.key==="k"?(d.preventDefault(),o._closed&&o.open(),r.$input.focus()):d.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function Me(n,e,i,t){let o,r;t.addEventListener("input",async s=>{s instanceof InputEvent&&(s.inputType==="insertText"||s.inputType==="insertCompositionText")&&(clearTimeout(o),o=setTimeout(async()=>{let c=await e.Search.suggest(t.value);c&&c.length>0&&l(c[0]?.suggestion)},100))});function l(s){if(!s){t.placeholder="";return}let c=t.value;t.value=s,t.setSelectionRange(c.length,s.length)}return{renderSearch(s,c){if(s.places.length===0&&s.enterpriseCategories?.length===0&&s.enterpriseLocations?.length===0){i.textContent="No results found.";return}r=Le(i,s,n,c)},close(){r.destroy()}}}function Le(n,e,i,t){n.innerHTML="";let o=document.createElement("div");Object.assign(o.style,G.dropdownContainer);let r=document.createElement("ul");r.className="options-list",Object.assign(r.style,G.optionsList),r.style.display="block";let l=[],s=(p,h)=>{if(h&&h.length>0){let g=document.createElement("li");g.textContent=p,Object.assign(g.style,G.sectionHeader),r.appendChild(g),h.forEach((m,y)=>{let u=document.createElement("li");u.textContent=`${"name"in m.item?m.item.name:""} (${m.type})`,Object.assign(u.style,G.option),u.tabIndex=0,u.addEventListener("focus",()=>{f(l.indexOf(u))}),u.addEventListener("mouseover",()=>{u.style.backgroundColor="#f0f0f0"}),u.addEventListener("mouseout",()=>{u.style.backgroundColor=""}),u.addEventListener("click",()=>{}),u.setAttribute("data-type",p),u.setAttribute("data-index",y.toString()),r.appendChild(u),l.push(u)})}};s("enterpriseLocations",e.enterpriseLocations),s("enterpriseCategories",e.enterpriseCategories),s("Places",e.places),o.appendChild(r),n.appendChild(o);let c=[],f=p=>{c.forEach(u=>u()),c=[],l.forEach((u,b)=>{b===p?u.style.backgroundColor="#e0e0e0":u.style.backgroundColor=""});let h=l[p],g=h.getAttribute("data-type"),m=parseInt(h.getAttribute("data-index")||"0",10);if(!g)return;let{item:y}=e[g.toLowerCase()][m];t.publish("highlight",y)},d=p=>{!o.contains(p.target)&&p.target!==n&&a()};document.addEventListener("click",d);let a=()=>{n.innerHTML="",document.removeEventListener("click",d)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var G={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 oe(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:o}=ne(n,e,i);o.on("highlight",d=>{if(d){t.forEach(p=>p()),t=[];let a=d instanceof $?d.spaces[0]:d;if(n.Camera.focusOn(d),a&&!O.is(a))return;t.push(H.highlightCard(n,a,{focus:!0}))}else t.forEach(a=>a()),t=[]});let r=i.addFolder("Click \u{1F447}").close(),{sub:l}=$e(n,r);l.on("click",d=>{t.forEach(a=>a()),t=[],d.spaces?.[0]&&(t=[H.highlightCard(n,d.spaces[0])])});let s=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Se(n,s),f;c.on("hover",d=>{d.spaces?.[0]?(f?.(),t.length===0&&(f=H.highlightCard(n,d.spaces[0]))):(f?.(),f=void 0)})}function $e(n,e){let i=new S,t={position:"",hoverColor:E(n.getHoverColor())},o=e.add(t,"position").disable(),r=[];function l(){r.forEach(c=>c()),r.length=0}let s=0;return n.on("click",c=>{let{labels:f,coordinate:d}=c;l(),i.publish("click",c),clearInterval(s),o.load(JSON.stringify([d.longitude,d.latitude]));let a=f?.[0];if(a!=null){let h=T(n,a,e);if(!h)return;r.push(h.destroy),h.labelItemFolder.openAnimated()}let p=c.spaces?.[0]??c.objects?.[0];if(p){let h={...p,...n.getState(p),isInView:!1,isInViewCheck:U(n,p.id)},{cleanup:g}=B(n,h,e);s=setInterval(()=>{h.isInView=n.isInView(a||p)},500),r.push(g)}}),{sub:i}}function Se(n,e){let i=new S;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},o=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(s=>{n.setHoverColor(s)});let r=[];function l(){r.forEach(s=>s()),r.length=0}return n.on("hover",s=>{let{coordinate:c,spaces:f,objects:d,markers:a,labels:p}=s;l(),i.publish("hover",s),o.load(JSON.stringify([c.longitude,c.latitude]));let h=f?.[0]??d?.[0]??a?.[0]??p?.[0];if(!h)return;let g=n.getState(h);g&&(t.type=g.type,t.id=h.id)}),{sub:i}}function U(n,e){return function(){console.log("isInView",n.isInView(e))}}function re(n,e,i){let t={labels:{},all(){i.Labels.__EXPERIMENTAL__all().forEach(h=>{this.labels[h.id]=h}),c()},removeAllLabels(){i.Labels.removeAll().forEach(h=>{delete this.labels[h.id]}),c()}},{addLabel:o,destroy:r}=Fe(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.labels[m.id],s.get(m.id)?.destroy()}function h(m){let y=T(i,m,l,{onRemove:b=>{p(b)}});if(!y)return;let{labelItemFolder:u}=y;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let y=t.labels[m];h(y)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({labels:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.labels[h.id]=h;c()}return{populatelabels:a,destroy(){r()}}}function Ie(n,e,i,t,o){let{interactive:r,enabled:l,rank:s,anchor:c,dynamicResize:f,zIndex:d,contentHTML:a,lowPriorityPin:p}=t;if(r==null||l==null)throw new Error("incomplete marker state");let h={interactive:r,enabled:l,rank:s||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:f||!1,zIndex:d||0,contentHTML:a||"",lowPriorityPin:{enabled:p?.enabled??!0,size:p?.size??8,color:E(p?.color??"#666")},remove(){n.Markers.remove(e),o?.(e),i.destroy()},isInView:U(n,e.id)};i.onChange(m=>{let y={interactive:h.interactive,enabled:h.enabled,rank:h.rank,dynamicResize:h.dynamicResize,contentHTML:h.contentHTML,lowPriorityPin:{enabled:h.lowPriorityPin.enabled,size:h.lowPriorityPin.size,color:h.lowPriorityPin.color}};h.rank==="always-visible"&&(y.zIndex=h.zIndex),n.updateState(e,y)}),i.add(h,"interactive"),i.add(h,"enabled"),i.add(h,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(h,"anchor").name("anchor (read-only)").disable(),i.add(h,"dynamicResize").name("dynamic resize"),h.rank==="always-visible"&&i.add(h,"zIndex",0,1e3,1).name("z-index"),i.add(h,"contentHTML").name("content HTML");let g=i.addFolder("Low Priority Pin");g.add(h.lowPriorityPin,"enabled"),g.add(h.lowPriorityPin,"size",1,20,1),g.addColor(h.lowPriorityPin,"color"),g.close(),i.add(h,"isInView"),i.add(h,"remove")}function De(n,e,i,t,o){let{appearance:r,interactive:l}=t;if(!r||r.margin==null||l==null)throw new Error("incomplte label state");let s={text:e.text,interactive:l,appearance:{...r,margin:r.margin||0,pinColor:r.pinColor?E(r.pinColor):"black",textColor:r.textColor?E(r.textColor):"black"},remove(){n.Labels.remove(e),o?.(e),i.destroy()},isInView:U(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:s.appearance,interactive:s.interactive})}),i.add(s.appearance,"margin",0,20).name("margin"),i.add(s,"text"),i.add(s,"interactive"),i.addColor(s.appearance,"pinColor").name("pin color"),i.addColor(s.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(s.appearance,"textColor").name("text color"),i.addColor(s.appearance,"textOutlineColor").name("text outline color"),i.add(s,"isInView"),i.add(s,"remove")}function T(n,e,i,{onRemove:t}={}){let o=n.getState(e);if(!o)throw new Error(`error getting state for entity: ${e.id}`);let r=o.type===N?e.text?.substring(0,12)||"Label":`Marker ${e.id.toString().substring(0,8)}`,l=i.addFolder(r);if(l.close(),o.type===N)De(n,e,l,o,t);else if(o.type===ee)Ie(n,e,l,o,t);else throw new Error(`unsupported entity type: ${o.type}`);return{labelItemFolder:l,destroy(){l.destroy()}}}function Fe(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:6,text:"New Label!",interactive:!0,marginForegroundColor:E("skyblue"),marginBackgroundColor:E("coral"),textForegroundColor:E("slategray"),textBackgroundColor:E("white")};return i.add(t,"onClick"),i.add(t,"margin"),i.add(t,"interactive"),i.add(t,"text"),{destroy(){i.destroy()},addLabel(o){return i._closed||!t.onClick?void 0:e.Labels.add(o,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var se={};v();function ae(n,e,i){let t=n.addFolder("Camera \u{1F4F7}"),o=e.Camera.center.toJSON(),r=document.createElement("div");Object.assign(r.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(r);let l=()=>e.getDimensions(),[s,c,f,d]=i?.padding??[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],a={center_lat:o.latitude,center_lon:o.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i?.padding?"pixel":e.Camera.screenOffsets.type,inset_top:s,inset_left:d,inset_right:c,inset_bottom:f,animateOnLoad:!0,visualizeInset:!!(s||c||f||d),"Focus on click":i?.focusOnClick??!1,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function p(){a.inset_type=e.Camera.screenOffsets.type,a.inset_left=e.Camera.screenOffsets.left,a.inset_top=e.Camera.screenOffsets.top,a.inset_right=e.Camera.screenOffsets.right,a.inset_bottom=e.Camera.screenOffsets.bottom;let{width:x,height:k}=l();a.inset_type==="portion"?Object.assign(r.style,{left:a.inset_left*x+"px",top:a.inset_top*k+"px",bottom:a.inset_bottom*k+"px",right:a.inset_right*x+"px"}):Object.assign(r.style,{left:a.inset_left+"px",top:a.inset_top+"px",bottom:a.inset_bottom+"px",right:a.inset_right+"px"})}t.add(a,"center_lat").listen().disable(),t.add(a,"center_lon").listen().disable(),t.add(a,"zoomLevel",16,22,.5).listen().disable(),t.add(a,"pitch").listen().disable(),t.add(a,"bearing").listen().disable(),t.add(a,"minZoomLevel",5,22,.5).onChange(x=>{e.Camera.setMinZoomLevel(x)}),t.add(a,"maxZoomLevel",10,22,.5).onChange(x=>{e.Camera.setMaxZoomLevel(x)}),t.add(a,"animateOnLoad"),t.add(a,"visualizeInset").onChange(q),q(a.visualizeInset);let h,g,m,y;function u(){let{width:x,height:k}=l(),R=e.Camera.screenOffsets.type,j=a.inset_type;R!==j&&(j==="portion"&&R==="pixel"?(a.inset_top=x>0?Math.min(a.inset_top/k,1):0,a.inset_bottom=x>0?Math.min(a.inset_bottom/k,1):0,a.inset_left=k>0?Math.min(a.inset_left/x,1):0,a.inset_right=k>0?Math.min(a.inset_right/x,1):0):j==="pixel"&&R==="portion"&&(a.inset_top=Math.round(a.inset_top*k),a.inset_bottom=Math.round(a.inset_bottom*k),a.inset_left=Math.round(a.inset_left*x),a.inset_right=Math.round(a.inset_right*x))),h&&h.destroy(),g&&g.destroy(),m&&m.destroy(),y&&y.destroy(),a.inset_type==="portion"?(h=t.add(a,"inset_top",0,1,.01).onChange(_),g=t.add(a,"inset_bottom",0,1,.01).onChange(_),m=t.add(a,"inset_left",0,1,.01).onChange(_),y=t.add(a,"inset_right",0,1,.01).onChange(_)):(h=t.add(a,"inset_top",0,k,1).onChange(_),g=t.add(a,"inset_bottom",0,k,1).onChange(_),m=t.add(a,"inset_left",0,x,1).onChange(_),y=t.add(a,"inset_right",0,x,1).onChange(_))}t.add(a,"inset_type",["pixel","portion"]).onChange(()=>{u(),_()}),u();let b=Oe(e);t.add(a,"Focus on click").onChange(x=>{x?e.on("click",b):e.off("click",b)}),a["Focus on click"]&&e.on("click",b),t.add(a,"Focus on current floor");let C=x=>{t._closed||(a.center_lat=x.center.latitude,a.center_lon=x.center.longitude,a.zoomLevel=x.zoomLevel,a.bearing=x.bearing,a.pitch=x.pitch)};e.on("camera-change",C);let L=[()=>{e.off("camera-change",C)}];function _(){e.Camera.setScreenOffsets({top:a.inset_top,left:a.inset_left,right:a.inset_right,bottom:a.inset_bottom,type:a.inset_type}),p()}(a.inset_top||a.inset_right||a.inset_bottom||a.inset_left)&&_();function q(x){p(),x?r.style.display="block":r.style.display="none"}return()=>({destroy(){t.destroy(),ie(L)}})}function Oe(n){return function(i){let{spaces:t,objects:o}=i,r=t?.[0]??o?.[0];r&&n.Camera.focusOn(r)}}v();function le(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(h=>{delete this.markers[h.id]}),c()}},{addMarker:o,destroy:r}=Pe(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.markers[m.id],s.get(m.id)?.destroy()}function h(m){let y=T(i,m,l,{onRemove:b=>{p(b)}});if(!y)return;let{labelItemFolder:u}=y;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let y=t.markers[m];h(y)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({markers:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.markers[h.id]=h;c()}return{populateMarkers:a,destroy(){r()}}}function Pe(n,e){let i=n.addFolder("Add"),t={onClick:!1,interactive:!0,rank:"medium",anchor:"center",dynamicResize:!1,enabled:!0,zIndex:0,lowPriorityPin:{enabled:!0,size:8,color:"#666"},contentHTML:'<div style="padding: 8px; background: white; border: 2px solid #333; border-radius: 4px;">New Marker</div>'};i.add(t,"onClick"),i.add(t,"interactive"),i.add(t,"enabled"),i.add(t,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(t,"anchor",["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]).name("anchor"),i.add(t,"dynamicResize").name("dynamic resize"),i.add(t,"zIndex",0,1e3,1).name("z-index (always-visible only)"),i.add(t,"contentHTML").name("content HTML");let o=i.addFolder("Low Priority Pin");return o.add(t.lowPriorityPin,"enabled"),o.add(t.lowPriorityPin,"size",1,20,1),o.addColor(t.lowPriorityPin,"color"),o.close(),{destroy(){i.destroy()},addMarker(r){if(i._closed||!t.onClick)return;let l={interactive:t.interactive,enabled:t.enabled,rank:t.rank,anchor:t.anchor,dynamicResize:t.dynamicResize,lowPriorityPin:{enabled:t.lowPriorityPin.enabled,size:t.lowPriorityPin.size,color:t.lowPriorityPin.color}};return t.rank==="always-visible"&&(l.zIndex=t.zIndex),e.Markers.add(r,t.contentHTML,l)}}}v();function de(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(l=>{e.updateState("exterior-walls",{visible:l})}),i.addColor(t,"topColor").onChange(l=>{e.updateState("exterior-walls",{topColor:l})}),i.addColor(t,"color").onChange(l=>{e.updateState("exterior-walls",{color:l})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{texture:{url:l}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{topTexture:{url:l}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}v();function ce(n,e,i){n.close();let t={language:i.currentLanguage?.code??"en"},o=i.getByType("enterprise-venue");n.add(t,"language",o?.languages.map(r=>r.code)).onChange(r=>{i.changeLanguage(r)})}v();function he(n,e,i){let t=n.addFolder("Debug");t.close();let o=e.Debug.state,r={showPolygonLabelTextAreaMesh:o.showPolygonLabelTextAreaMesh,showCollisionBoxes:o.showCollisionBoxes,showEnvMap:o.showEnvMap};t.add(r,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(r,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(r,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(r)}v();function ue(n,e,i){let t=n.addFolder("Text3D").close(),o={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(o,"all").name("Show All"),t.add(o,"removeAll").name("Remove All")}v();function pe(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let o=localStorage.getItem("directionsMethod"),r=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",s={enabled:!1,method:o||"dp-optimal",radius:r?parseFloat(r):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,f,d;t.add(s,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(s,"startCoordinate").name("Start").disable().listen(),t.add(s,"endCoordinate").name("End").disable().listen(),t.add(s,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&f&&s.enabled&&h(c,f)}),t.add(s,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"pathInfo").name("Path Info").disable().listen();let a={clear:()=>p()};t.add(a,"clear").name("Clear Path");function p(){c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function h(m,y){d&&(e.Paths.remove(d),d=void 0);try{let u=await e.getDirections(m,y,{smoothing:{enabled:!0,method:s.method,radius:s.radius,includeDoorBufferNodes:s.includeDoorBufferNodes}});if(u){d=e.Paths.add(u.coordinates,{interactive:!0,color:"green",width:1});let C=u.distance?.toFixed(2)||"N/A";s.pathInfo=`${u.coordinates.length} pts, ${C}m`}else s.pathInfo="No path found"}catch(u){s.pathInfo=`Error: ${u instanceof Error?u.message:"Unknown"}`}}let g=async m=>{if(s.enabled)if(c){let y=m.coordinate;f=y,s.endCoordinate=`${y.latitude.toFixed(6)}, ${y.longitude.toFixed(6)}`,s.pathInfo="Calculating...",await h(c,f),c=void 0,f=void 0}else{let y=m.coordinate;c=y,s.startCoordinate=`${y.latitude.toFixed(6)}, ${y.longitude.toFixed(6)}`,s.pathInfo="Click to set end..."}};return e.on("click",g),{destroy(){e.off("click",g),t.destroy()}}}v();function fe(n,e){let i=n.addFolder("Spaces Open To Below Visual Effect").close(),t=e.getGlobalState().multiFloorView,o={enabled:t.spacesOpenToBelowVisualEffectEnabled,darkenAmount:t.spacesOpenToBelowVisualEffectDarkenAmount,darkenUseDepth:t.spacesOpenToBelowVisualEffectDarkenUseDepth,desaturateAmount:t.spacesOpenToBelowVisualEffectDesaturateAmount,desaturateUseDepth:t.spacesOpenToBelowVisualEffectDesaturateUseDepth,washOutAmount:t.spacesOpenToBelowVisualEffectWashOutAmount,washOutUseDepth:t.spacesOpenToBelowVisualEffectWashOutUseDepth};function r(){e.updateGlobalState({multiFloorView:{spacesOpenToBelowVisualEffectEnabled:o.enabled,spacesOpenToBelowVisualEffectDarkenAmount:o.darkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:o.darkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:o.desaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:o.desaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:o.washOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:o.washOutUseDepth}})}i.add(o,"enabled").name("Enabled").onChange(()=>r());let l=i.addFolder("Darken");l.add(o,"darkenAmount",0,1,.01).name("Amount").onChange(()=>r()),l.add(o,"darkenUseDepth").name("Use Depth").onChange(()=>r());let s=i.addFolder("Desaturate");s.add(o,"desaturateAmount",0,1,.01).name("Amount").onChange(()=>r()),s.add(o,"desaturateUseDepth").name("Use Depth").onChange(()=>r());let c=i.addFolder("Wash Out");c.add(o,"washOutAmount",0,1,.01).name("Amount").onChange(()=>r()),c.add(o,"washOutUseDepth").name("Use Depth").onChange(()=>r())}function me(n,e,i){ze();let t=new z({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),oe(e,n,t),ae(t,e,i?.camera);let o=t.addFolder("Levels").close(),r=t.addFolder("Scene Controls");r.close();let l=t.addFolder("Labels");ue(t,e,n);let s=t.addFolder("Markers");de(t,e);let c=t.addFolder("misc");he(t,e,n),fe(t,e),pe(t,e,n),ce(c,e,n);let f={level:e.currentFloor.id},{populatelabels:d}=re(l,n,e),{populateMarkers:a}=le(s,n,e),p=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),h=o.add(f,"level",p).onChange(g=>{e.setFloor(g),f.level=e.currentFloor.id,h.updateDisplay()});return e.on("floor-change-start",g=>{o.controllers[0].setValue(g.floor.id)}),n.getByType("space").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:r,populateMarkers:a}}var ge="mappedin-sdk-debug-css";function ze(){if(document.getElementById(ge))return;let n=document.createElement("style");n.id=ge,n.textContent=se,document.head.appendChild(n)}var Q=class{_enabled=!1;mv;api;mapData;storeStateToLocalStorageEnabled=!1;constructor(e,i){this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:i}=me(this.mapData,this.mv,e),t=!1;i.onOpenClose(async o=>{if(!(o!==i||o._closed||t)){t=!0,[...i.children].forEach(r=>r.destroy());try{let{mountSceneGraphVisualizer:r}=await import("./src-2IR6EZ5S.js");r(this.api.core,i)}catch{}finally{i.open(),t=!1}}}),this.api.getMapDataInternal()?.spaces.forEach(o=>{this.mv.updateState(o,{interactive:!0})})}get enabled(){return this._enabled}};export{Q as Inspector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as Fe,r as Te,s as Ce,t as Me,u as Le}from"./chunk-YLNWGJAU.js";import"./chunk-KVLT22ON.js";import{a as F,j as Oe}from"./chunk-X2E2A75O.js";import{b as It,d as At}from"./chunk-PWEV3AFA.js";var wt=It((P,C)=>{F();var Vt=200,et="__lodash_hash_undefined__",Bt=800,Nt=16,tt=9007199254740991,nt="[object Arguments]",kt="[object Array]",Wt="[object AsyncFunction]",Ut="[object Boolean]",$t="[object Date]",Gt="[object Error]",it="[object Function]",qt="[object GeneratorFunction]",Jt="[object Map]",Ht="[object Number]",Kt="[object Null]",st="[object Object]",Qt="[object Proxy]",Yt="[object RegExp]",Zt="[object Set]",Xt="[object String]",en="[object Undefined]",tn="[object WeakMap]",nn="[object ArrayBuffer]",sn="[object DataView]",rn="[object Float32Array]",on="[object Float64Array]",an="[object Int8Array]",cn="[object Int16Array]",un="[object Int32Array]",ln="[object Uint8Array]",dn="[object Uint8ClampedArray]",hn="[object Uint16Array]",fn="[object Uint32Array]",pn=/[\\^$.*+?()[\]{}|]/g,gn=/^\[object .+?Constructor\]$/,mn=/^(?:0|[1-9]\d*)$/,_={};_[rn]=_[on]=_[an]=_[cn]=_[un]=_[ln]=_[dn]=_[hn]=_[fn]=!0;_[nt]=_[kt]=_[nn]=_[Ut]=_[sn]=_[$t]=_[Gt]=_[it]=_[Jt]=_[Ht]=_[st]=_[Yt]=_[Zt]=_[Xt]=_[tn]=!1;var rt=typeof global=="object"&&global&&global.Object===Object&&global,_n=typeof self=="object"&&self&&self.Object===Object&&self,N=rt||_n||Function("return this")(),ot=typeof P=="object"&&P&&!P.nodeType&&P,V=ot&&typeof C=="object"&&C&&!C.nodeType&&C,at=V&&V.exports===ot,fe=at&&rt.process,Ge=(function(){try{var t=V&&V.require&&V.require("util").types;return t||fe&&fe.binding&&fe.binding("util")}catch{}})(),qe=Ge&&Ge.isTypedArray;function ct(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function yn(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function bn(t){return function(e){return t(e)}}function Sn(t,e){return t?.[e]}function wn(t,e){return function(n){return t(e(n))}}var vn=Array.prototype,xn=Function.prototype,Q=Object.prototype,pe=N["__core-js_shared__"],Y=xn.toString,v=Q.hasOwnProperty,Je=(function(){var t=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),ut=Q.toString,zn=Y.call(Object),In=RegExp("^"+Y.call(v).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=at?N.Buffer:void 0,He=N.Symbol,Ke=N.Uint8Array,Qe=H?H.allocUnsafe:void 0,lt=wn(Object.getPrototypeOf,Object),Ye=Object.create,An=Q.propertyIsEnumerable,On=vn.splice,A=He?He.toStringTag:void 0,K=(function(){try{var t=we(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Fn=H?H.isBuffer:void 0,Ze=Math.max,Tn=Date.now,dt=we(N,"Map"),B=we(Object,"create"),Cn=(function(){function t(){}return function(e){if(!w(e))return{};if(Ye)return Ye(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function O(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Mn(){this.__data__=B?B(null):{},this.size=0}function Ln(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function En(t){var e=this.__data__;if(B){var n=e[t];return n===et?void 0:n}return v.call(e,t)?e[t]:void 0}function Dn(t){var e=this.__data__;return B?e[t]!==void 0:v.call(e,t)}function Rn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=B&&e===void 0?et:e,this}O.prototype.clear=Mn;O.prototype.delete=Ln;O.prototype.get=En;O.prototype.has=Dn;O.prototype.set=Rn;function x(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function jn(){this.__data__=[],this.size=0}function Pn(t){var e=this.__data__,n=Z(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():On.call(e,n,1),--this.size,!0}function Vn(t){var e=this.__data__,n=Z(e,t);return n<0?void 0:e[n][1]}function Bn(t){return Z(this.__data__,t)>-1}function Nn(t,e){var n=this.__data__,i=Z(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}x.prototype.clear=jn;x.prototype.delete=Pn;x.prototype.get=Vn;x.prototype.has=Bn;x.prototype.set=Nn;function M(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function kn(){this.size=0,this.__data__={hash:new O,map:new(dt||x),string:new O}}function Wn(t){var e=ee(this,t).delete(t);return this.size-=e?1:0,e}function Un(t){return ee(this,t).get(t)}function $n(t){return ee(this,t).has(t)}function Gn(t,e){var n=ee(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}M.prototype.clear=kn;M.prototype.delete=Wn;M.prototype.get=Un;M.prototype.has=$n;M.prototype.set=Gn;function L(t){var e=this.__data__=new x(t);this.size=e.size}function qn(){this.__data__=new x,this.size=0}function Jn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Hn(t){return this.__data__.get(t)}function Kn(t){return this.__data__.has(t)}function Qn(t,e){var n=this.__data__;if(n instanceof x){var i=n.__data__;if(!dt||i.length<Vt-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new M(i)}return n.set(t,e),this.size=n.size,this}L.prototype.clear=qn;L.prototype.delete=Jn;L.prototype.get=Hn;L.prototype.has=Kn;L.prototype.set=Qn;function Yn(t,e){var n=ye(t),i=!n&&_e(t),s=!n&&!i&&mt(t),r=!n&&!i&&!s&&yt(t),a=n||i||s||r,o=a?yn(t.length,String):[],c=o.length;for(var u in t)(e||v.call(t,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||r&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||pt(u,c)))&&o.push(u);return o}function ge(t,e,n){(n!==void 0&&!te(t[e],n)||n===void 0&&!(e in t))&&be(t,e,n)}function Zn(t,e,n){var i=t[e];(!(v.call(t,e)&&te(i,n))||n===void 0&&!(e in t))&&be(t,e,n)}function Z(t,e){for(var n=t.length;n--;)if(te(t[n][0],e))return n;return-1}function be(t,e,n){e=="__proto__"&&K?K(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Xn=di();function X(t){return t==null?t===void 0?en:Kt:A&&A in Object(t)?hi(t):yi(t)}function Xe(t){return k(t)&&X(t)==nt}function ei(t){if(!w(t)||mi(t))return!1;var e=xe(t)?In:gn;return e.test(vi(t))}function ti(t){return k(t)&&_t(t.length)&&!!_[X(t)]}function ni(t){if(!w(t))return _i(t);var e=gt(t),n=[];for(var i in t)i=="constructor"&&(e||!v.call(t,i))||n.push(i);return n}function Se(t,e,n,i,s){t!==e&&Xn(e,function(r,a){if(s||(s=new L),w(r))ii(t,e,a,n,Se,i,s);else{var o=i?i(me(t,a),r,a+"",t,e,s):void 0;o===void 0&&(o=r),ge(t,a,o)}},bt)}function ii(t,e,n,i,s,r,a){var o=me(t,n),c=me(e,n),u=a.get(c);if(u){ge(t,n,u);return}var l=r?r(o,c,n+"",t,e,a):void 0,h=l===void 0;if(h){var d=ye(c),f=!d&&mt(c),g=!d&&!f&&yt(c);l=c,d||f||g?ye(o)?l=o:xi(o)?l=ci(o):f?(h=!1,l=ri(c,!0)):g?(h=!1,l=ai(c,!0)):l=[]:zi(c)||_e(c)?(l=o,_e(o)?l=Ii(o):(!w(o)||xe(o))&&(l=fi(c))):h=!1}h&&(a.set(c,l),s(l,c,i,r,a),a.delete(c)),ge(t,n,l)}function ht(t,e){return Si(bi(t,e,St),t+"")}var si=K?function(t,e){return K(t,"toString",{configurable:!0,enumerable:!1,value:Fi(e),writable:!0})}:St;function ri(t,e){if(e)return t.slice();var n=t.length,i=Qe?Qe(n):new t.constructor(n);return t.copy(i),i}function oi(t){var e=new t.constructor(t.byteLength);return new Ke(e).set(new Ke(t)),e}function ai(t,e){var n=e?oi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ci(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}function ui(t,e,n,i){var s=!n;n||(n={});for(var r=-1,a=e.length;++r<a;){var o=e[r],c=i?i(n[o],t[o],o,n,t):void 0;c===void 0&&(c=t[o]),s?be(n,o,c):Zn(n,o,c)}return n}function li(t){return ht(function(e,n){var i=-1,s=n.length,r=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(s--,r):void 0,a&&pi(n[0],n[1],a)&&(r=s<3?void 0:r,s=1),e=Object(e);++i<s;){var o=n[i];o&&t(e,o,i,r)}return e})}function di(t){return function(e,n,i){for(var s=-1,r=Object(e),a=i(e),o=a.length;o--;){var c=a[t?o:++s];if(n(r[c],c,r)===!1)break}return e}}function ft(t,e,n,i,s,r){return w(t)&&w(e)&&(r.set(e,t),Se(t,e,void 0,ft,r),r.delete(e)),t}function ee(t,e){var n=t.__data__;return gi(e)?n[typeof e=="string"?"string":"hash"]:n.map}function we(t,e){var n=Sn(t,e);return ei(n)?n:void 0}function hi(t){var e=v.call(t,A),n=t[A];try{t[A]=void 0;var i=!0}catch{}var s=ut.call(t);return i&&(e?t[A]=n:delete t[A]),s}function fi(t){return typeof t.constructor=="function"&&!gt(t)?Cn(lt(t)):{}}function pt(t,e){var n=typeof t;return e=e??tt,!!e&&(n=="number"||n!="symbol"&&mn.test(t))&&t>-1&&t%1==0&&t<e}function pi(t,e,n){if(!w(n))return!1;var i=typeof e;return(i=="number"?ve(n)&&pt(e,n.length):i=="string"&&e in n)?te(n[e],t):!1}function gi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function mi(t){return!!Je&&Je in t}function gt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Q;return t===n}function _i(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function yi(t){return ut.call(t)}function bi(t,e,n){return e=Ze(e===void 0?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=Ze(i.length-e,0),a=Array(r);++s<r;)a[s]=i[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=i[s];return o[e]=n(a),ct(t,this,o)}}function me(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Si=wi(si);function wi(t){var e=0,n=0;return function(){var i=Tn(),s=Nt-(i-n);if(n=i,s>0){if(++e>=Bt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function vi(t){if(t!=null){try{return Y.call(t)}catch{}try{return t+""}catch{}}return""}function te(t,e){return t===e||t!==t&&e!==e}var _e=Xe((function(){return arguments})())?Xe:function(t){return k(t)&&v.call(t,"callee")&&!An.call(t,"callee")},ye=Array.isArray;function ve(t){return t!=null&&_t(t.length)&&!xe(t)}function xi(t){return k(t)&&ve(t)}var mt=Fn||Ti;function xe(t){if(!w(t))return!1;var e=X(t);return e==it||e==qt||e==Wt||e==Qt}function _t(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=tt}function w(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function k(t){return t!=null&&typeof t=="object"}function zi(t){if(!k(t)||X(t)!=st)return!1;var e=lt(t);if(e===null)return!0;var n=v.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Y.call(n)==zn}var yt=qe?bn(qe):ti;function Ii(t){return ui(t,bt(t))}var Ai=ht(function(t){return t.push(void 0,ft),ct(Oi,void 0,t)});function bt(t){return ve(t)?Yn(t,!0):ni(t)}var Oi=li(function(t,e,n,i){Se(t,e,n,i)});function Fi(t){return function(){return t}}function St(t){return t}function Ti(){return!1}C.exports=Ai});F();F();var Ot="ENTRIES",Ve="KEYS",Be="VALUES";var R=class{constructor(e,n){let i=e._tree,s=Array.from(i.keys());this.set=e,this._type=n,this._path=s.length>0?[{node:i,keys:s}]:[]}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:n}=T(this._path);if(T(n)==="")return{done:!1,value:this.result()};let i=e.get(T(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=T(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>T(e)).filter(e=>e!=="").join("")}value(){return T(this._path).node.get("")}result(){switch(this._type){case Be:return this.value();case Ve:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},T=t=>t[t.length-1],Ft=(t,e,n)=>{let i=new Map;if(e===void 0)return i;let s=e.length+1,r=s+n,a=new Uint8Array(r*s).fill(n+1);for(let o=0;o<s;++o)a[o]=o;for(let o=1;o<r;++o)a[o*s]=o;return Ne(t,e,n,i,a,1,s,""),i},Ne=(t,e,n,i,s,r,a,o)=>{let c=r*a;e:for(let u of t.keys())if(u===""){let l=s[c-1];l<=n&&i.set(o,[t.get(u),l])}else{let l=r;for(let h=0;h<u.length;++h,++l){let d=u[h],f=a*l,g=f-a,m=s[f],p=Math.max(0,l-n-1),b=Math.min(a-1,l+n);for(let S=p;S<b;++S){let ne=d!==e[S],ie=s[g+S]+ +ne,$=s[g+S+1]+1,z=s[f+S]+1,D=s[f+S+1]=Math.min(ie,$,z);D<m&&(m=D)}if(m>n)continue e}Ne(t.get(u),e,n,i,s,l,a,o+u)}},j=class t{constructor(e=new Map,n=""){this._size=void 0,this._tree=e,this._prefix=n}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[n,i]=J(this._tree,e.slice(this._prefix.length));if(n===void 0){let[s,r]=de(i);for(let a of s.keys())if(a!==""&&a.startsWith(r)){let o=new Map;return o.set(a.slice(r.length),s.get(a)),new t(o,e)}}return new t(n,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Tt(this._tree,e)}entries(){return new R(this,Ot)}forEach(e){for(let[n,i]of this)e(n,i,this)}fuzzyGet(e,n){return Ft(this._tree,e,n)}get(e){let n=ce(this._tree,e);return n!==void 0?n.get(""):void 0}has(e){let n=ce(this._tree,e);return n!==void 0&&n.has("")}keys(){return new R(this,Ve)}set(e,n){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,se(this._tree,e).set("",n),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,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=se(this._tree,e);return i.set("",n(i.get(""))),this}fetch(e,n){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let i=se(this._tree,e),s=i.get("");return s===void 0&&i.set("",s=n()),s}values(){return new R(this,Be)}[Symbol.iterator](){return this.entries()}static from(e){let n=new t;for(let[i,s]of e)n.set(i,s);return n}static fromObject(e){return t.from(Object.entries(e))}},J=(t,e,n=[])=>{if(e.length===0||t==null)return[t,n];for(let i of t.keys())if(i!==""&&e.startsWith(i))return n.push([t,i]),J(t.get(i),e.slice(i.length),n);return n.push([t,e]),J(void 0,"",n)},ce=(t,e)=>{if(e.length===0||t==null)return t;for(let n of t.keys())if(n!==""&&e.startsWith(n))return ce(t.get(n),e.slice(n.length))},se=(t,e)=>{let n=e.length;e:for(let i=0;t&&i<n;){for(let r of t.keys())if(r!==""&&e[i]===r[0]){let a=Math.min(n-i,r.length),o=1;for(;o<a&&e[i+o]===r[o];)++o;let c=t.get(r);if(o===r.length)t=c;else{let u=new Map;u.set(r.slice(o),c),t.set(e.slice(i,i+o),u),t.delete(r),t=u}i+=o;continue e}let s=new Map;return t.set(e.slice(i),s),s}return t},Tt=(t,e)=>{let[n,i]=J(t,e);if(n!==void 0){if(n.delete(""),n.size===0)ke(i);else if(n.size===1){let[s,r]=n.entries().next().value;We(i,s,r)}}},ke=t=>{if(t.length===0)return;let[e,n]=de(t);if(e.delete(n),e.size===0)ke(t.slice(0,-1));else if(e.size===1){let[i,s]=e.entries().next().value;i!==""&&We(t.slice(0,-1),i,s)}},We=(t,e,n)=>{if(t.length===0)return;let[i,s]=de(t);i.set(s+e,n),i.delete(s)},de=t=>t[t.length-1],he="or",Ue="and",Ct="and_not",I=class t{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let n=e.autoVacuum==null||e.autoVacuum===!0?ae:e.autoVacuum;this._options={...oe,...e,autoVacuum:n,searchOptions:{...Ee,...e.searchOptions||{}},autoSuggestOptions:{...Rt,...e.autoSuggestOptions||{}}},this._index=new j,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=le,this.addFields(this._options.fields)}add(e){let{extractField:n,stringifyField:i,tokenize:s,processTerm:r,fields:a,idField:o}=this._options,c=n(e,o);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let u=this.addDocumentId(c);this.saveStoredFields(u,e);for(let l of a){let h=n(e,l);if(h==null)continue;let d=s(i(h,l),l),f=this._fieldIds[l],g=new Set(d).size;this.addFieldLength(u,f,this._documentCount-1,g);for(let m of d){let p=r(m,l);if(Array.isArray(p))for(let b of p)this.addTerm(f,u,b);else p&&this.addTerm(f,u,p)}}}addAll(e){for(let n of e)this.add(n)}addAllAsync(e,n={}){let{chunkSize:i=10}=n,s={chunk:[],promise:Promise.resolve()},{chunk:r,promise:a}=e.reduce(({chunk:o,promise:c},u,l)=>(o.push(u),(l+1)%i===0?{chunk:[],promise:c.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(o))}:{chunk:o,promise:c}),s);return a.then(()=>this.addAll(r))}remove(e){let{tokenize:n,processTerm:i,extractField:s,stringifyField:r,fields:a,idField:o}=this._options,c=s(e,o);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);let u=this._idToShortId.get(c);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let l of a){let h=s(e,l);if(h==null)continue;let d=n(r(h,l),l),f=this._fieldIds[l],g=new Set(d).size;this.removeFieldLength(u,f,this._documentCount,g);for(let m of d){let p=i(m,l);if(Array.isArray(p))for(let b of p)this.removeTerm(f,u,b);else p&&this.removeTerm(f,u,p)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(c),this._fieldLength.delete(u),this._documentCount-=1}removeAll(e){if(e)for(let n of e)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new j,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 n=this._idToShortId.get(e);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((i,s)=>{this.removeFieldLength(n,s,this._documentCount,i)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:n,batchSize:i,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:i,batchWait:s},{minDirtCount:n,minDirtFactor:e})}discardAll(e){let n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let i of e)this.discard(i)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(e){let{idField:n,extractField:i}=this._options,s=i(e,n);this.discard(s),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let i=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=le,this.performVacuuming(e,i)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,n){let i=this._dirtCount;if(this.vacuumConditionsMet(n)){let s=e.batchSize||ue.batchSize,r=e.batchWait||ue.batchWait,a=1;for(let[o,c]of this._index){for(let[u,l]of c)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?c.delete(u):l.delete(h));this._index.get(o).size===0&&this._index.delete(o),a%s===0&&await new Promise(u=>setTimeout(u,r)),a+=1}this._dirtCount-=i}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:n,minDirtFactor:i}=e;return n=n||ae.minDirtCount,i=i||ae.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=i}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 n=this._idToShortId.get(e);if(n!=null)return this._storedFields.get(n)}search(e,n={}){let{searchOptions:i}=this._options,s={...i,...n},r=this.executeQuery(e,n),a=[];for(let[o,{score:c,terms:u,match:l}]of r){let h=u.length||1,d={id:this._documentIds.get(o),score:c*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(o)),(s.filter==null||s.filter(d))&&a.push(d)}return e===t.wildcard&&s.boostDocument==null||a.sort(Re),a}autoSuggest(e,n={}){n={...this._options.autoSuggestOptions,...n};let i=new Map;for(let{score:r,terms:a}of this.search(e,n)){let o=a.join(" "),c=i.get(o);c!=null?(c.score+=r,c.count+=1):i.set(o,{score:r,terms:a,count:1})}let s=[];for(let[r,{score:a,terms:o,count:c}]of i)s.push({suggestion:r,terms:o,score:a/c});return s.sort(Re),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),n)}static async loadJSONAsync(e,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),n)}static getDefault(e){if(oe.hasOwnProperty(e))return re(oe,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=G(s),c._fieldLength=G(r),c._storedFields=G(a);for(let[u,l]of c._documentIds)c._idToShortId.set(l,u);for(let[u,l]of i){let h=new Map;for(let d of Object.keys(l)){let f=l[d];o===1&&(f=f.ds),h.set(parseInt(d,10),G(f))}c._index.set(u,h)}return c}static async loadJSAsync(e,n){let{index:i,documentIds:s,fieldLength:r,storedFields:a,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,n);c._documentIds=await q(s),c._fieldLength=await q(r),c._storedFields=await q(a);for(let[l,h]of c._documentIds)c._idToShortId.set(h,l);let u=0;for(let[l,h]of i){let d=new Map;for(let f of Object.keys(h)){let g=h[f];o===1&&(g=g.ds),d.set(parseInt(f,10),await q(g))}++u%1e3===0&&await $e(0),c._index.set(l,d)}return c}static instantiateMiniSearch(e,n){let{documentCount:i,nextId:s,fieldIds:r,averageFieldLength:a,dirtCount:o,serializationVersion:c}=e;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new t(n);return u._documentCount=i,u._nextId=s,u._idToShortId=new Map,u._fieldIds=r,u._avgFieldLength=a,u._dirtCount=o||0,u._index=new j,u}executeQuery(e,n={}){if(e===t.wildcard)return this.executeWildcardQuery(n);if(typeof e!="string"){let d={...n,...e,queries:void 0},f=e.queries.map(g=>this.executeQuery(g,d));return this.combineResults(f,d.combineWith)}let{tokenize:i,processTerm:s,searchOptions:r}=this._options,a={tokenize:i,processTerm:s,...r,...n},{tokenize:o,processTerm:c}=a,h=o(e).flatMap(d=>c(d)).filter(d=>!!d).map(Dt(a)).map(d=>this.executeQuerySpec(d,a));return this.combineResults(h,a.combineWith)}executeQuerySpec(e,n){let i={...this._options.searchOptions,...n},s=(i.fields||this._options.fields).reduce((m,p)=>({...m,[p]:re(i.boost,p)||1}),{}),{boostDocument:r,weights:a,maxFuzzy:o,bm25:c}=i,{fuzzy:u,prefix:l}={...Ee.weights,...a},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,s,r,c),f,g;if(e.prefix&&(f=this._index.atPrefix(e.term)),e.fuzzy){let m=e.fuzzy===!0?.2:e.fuzzy,p=m<1?Math.min(o,Math.round(e.term.length*m)):m;p&&(g=this._index.fuzzyGet(e.term,p))}if(f)for(let[m,p]of f){let b=m.length-e.term.length;if(!b)continue;g?.delete(m);let S=l*m.length/(m.length+.3*b);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,d)}if(g)for(let m of g.keys()){let[p,b]=g.get(m);if(!b)continue;let S=u*m.length/(m.length+b);this.termResults(e.term,m,S,e.termBoost,p,s,r,c,d)}return d}executeWildcardQuery(e){let n=new Map,i={...this._options.searchOptions,...e};for(let[s,r]of this._documentIds){let a=i.boostDocument?i.boostDocument(r,"",this._storedFields.get(s)):1;n.set(s,{score:a,terms:[],match:{}})}return n}combineResults(e,n=he){if(e.length===0)return new Map;let i=n.toLowerCase(),s=Mt[i];if(!s)throw new Error(`Invalid combination operator: ${n}`);return e.reduce(s)||new Map}toJSON(){let e=[];for(let[n,i]of this._index){let s={};for(let[r,a]of i)s[r]=Object.fromEntries(a);e.push([n,s])}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,n,i,s,r,a,o,c,u=new Map){if(r==null)return u;for(let l of Object.keys(a)){let h=a[l],d=this._fieldIds[l],f=r.get(d);if(f==null)continue;let g=f.size,m=this._avgFieldLength[d];for(let p of f.keys()){if(!this._documentIds.has(p)){this.removeTerm(d,p,n),g-=1;continue}let b=o?o(this._documentIds.get(p),n,this._storedFields.get(p)):1;if(!b)continue;let S=f.get(p),ne=this._fieldLength.get(p)[d],ie=Et(S,g,this._documentCount,ne,m,c),$=i*s*h*b*ie,z=u.get(p);if(z){z.score+=$,jt(z.terms,e);let D=re(z.match,n);D?D.push(l):z.match[n]=[l]}else u.set(p,{score:$,terms:[e],match:{[n]:[l]}})}}return u}addTerm(e,n,i){let s=this._index.fetch(i,je),r=s.get(e);if(r==null)r=new Map,r.set(n,1),s.set(e,r);else{let a=r.get(n);r.set(n,(a||0)+1)}}removeTerm(e,n,i){if(!this._index.has(i)){this.warnDocumentChanged(n,e,i);return}let s=this._index.fetch(i,je),r=s.get(e);r==null||r.get(n)==null?this.warnDocumentChanged(n,e,i):r.get(n)<=1?r.size<=1?s.delete(e):r.delete(n):r.set(n,r.get(n)-1),this._index.get(i).size===0&&this._index.delete(i)}warnDocumentChanged(e,n,i){for(let s of Object.keys(this._fieldIds))if(this._fieldIds[s]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${i}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let n=this._nextId;return this._idToShortId.set(e,n),this._documentIds.set(n,e),this._documentCount+=1,this._nextId+=1,n}addFields(e){for(let n=0;n<e.length;n++)this._fieldIds[e[n]]=n}addFieldLength(e,n,i,s){let r=this._fieldLength.get(e);r==null&&this._fieldLength.set(e,r=[]),r[n]=s;let o=(this._avgFieldLength[n]||0)*i+s;this._avgFieldLength[n]=o/(i+1)}removeFieldLength(e,n,i,s){if(i===1){this._avgFieldLength[n]=0;return}let r=this._avgFieldLength[n]*i-s;this._avgFieldLength[n]=r/(i-1)}saveStoredFields(e,n){let{storeFields:i,extractField:s}=this._options;if(i==null||i.length===0)return;let r=this._storedFields.get(e);r==null&&this._storedFields.set(e,r={});for(let a of i){let o=s(n,a);o!==void 0&&(r[a]=o)}}};I.wildcard=Symbol("*");var re=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0,Mt={[he]:(t,e)=>{for(let n of e.keys()){let i=t.get(n);if(i==null)t.set(n,e.get(n));else{let{score:s,terms:r,match:a}=e.get(n);i.score=i.score+s,i.match=Object.assign(i.match,a),De(i.terms,r)}}return t},[Ue]:(t,e)=>{let n=new Map;for(let i of e.keys()){let s=t.get(i);if(s==null)continue;let{score:r,terms:a,match:o}=e.get(i);De(s.terms,a),n.set(i,{score:s.score+r,terms:s.terms,match:Object.assign(s.match,o)})}return n},[Ct]:(t,e)=>{for(let n of e.keys())t.delete(n);return t}},Lt={k:1.2,b:.7,d:.5},Et=(t,e,n,i,s,r)=>{let{k:a,b:o,d:c}=r;return Math.log(1+(n-e+.5)/(e+.5))*(c+t*(a+1)/(t+a*(1-o+o*i/s)))},Dt=t=>(e,n,i)=>{let s=typeof t.fuzzy=="function"?t.fuzzy(e,n,i):t.fuzzy||!1,r=typeof t.prefix=="function"?t.prefix(e,n,i):t.prefix===!0,a=typeof t.boostTerm=="function"?t.boostTerm(e,n,i):1;return{term:e,fuzzy:s,prefix:r,termBoost:a}},oe={idField:"id",extractField:(t,e)=>t[e],stringifyField:(t,e)=>t.toString(),tokenize:t=>t.split(Pt),processTerm:t=>t.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(t,e)=>{typeof console?.[t]=="function"&&console[t](e)},autoVacuum:!0},Ee={combineWith:he,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Lt},Rt={combineWith:Ue,prefix:(t,e,n)=>e===n.length-1},ue={batchSize:1e3,batchWait:10},le={minDirtFactor:.1,minDirtCount:20},ae={...ue,...le},jt=(t,e)=>{t.includes(e)||t.push(e)},De=(t,e)=>{for(let n of e)t.includes(n)||t.push(n)},Re=({score:t},{score:e})=>e-t,je=()=>new Map,G=t=>{let e=new Map;for(let n of Object.keys(t))e.set(parseInt(n,10),t[n]);return e},q=async t=>{let e=new Map,n=0;for(let i of Object.keys(t))e.set(parseInt(i,10),t[i]),++n%1e3===0&&await $e(0);return e},$e=t=>new Promise(e=>setTimeout(e,t)),Pt=/[\n\r\p{Z}\p{P}]+/u;var zt=At(wt(),1);import{z as y}from"zod";var vt=class{mapData;indexes;ready;constructor(e){this.mapData=e,this.indexes=Li(e),this.ready=this.populate(),this.#e=Oe(this.#t.bind(this),2e3)}#e;async populate(){let{places:e,enterpriseLocations:n,enterpriseCategories:i}=this.indexes,s=this.mapData,r=[];return e.removeAll(),r=r.concat([e.addAllAsync(s.getByType("space")),e.addAllAsync(s.getByType("point-of-interest")),e.addAllAsync(s.getByType("object")),e.addAllAsync(s.getByType("connection")),e.addAllAsync(s.getByType("floor")),e.addAllAsync(s.getByType("door")),e.addAllAsync(s.getByType("annotation")),e.addAllAsync(s.getByType("area"))]),n&&(n?.removeAll(),r.push(n.addAllAsync(s.getByType("enterprise-location")))),i&&(i?.removeAll(),r.push(i.addAllAsync(s.getByType("enterprise-category")))),Promise.all(r)}async search(e,n={}){await this.ready,Ei.parse(n);let i=(0,zt.default)({},n,Mi),s=this.indexes.places.search(e,ze(i.places));i.places.limit&&(s=s.slice(0,i.places.limit));let r=this.indexes.enterpriseLocations?.search(e,ze(i.enterpriseLocations));r&&i.enterpriseLocations.limit&&(r=r.slice(0,i.enterpriseLocations.limit));let a=this.indexes.enterpriseCategories?.search(e,ze(i.enterpriseCategories));a&&i.enterpriseCategories.limit&&(a=a.slice(0,i.enterpriseCategories.limit));let o=Ci(this.mapData,{placesResult:s,locationsResult:r,categoriesResult:a}),c=o.places.length+(o.enterpriseLocations?.length??0)+(o.enterpriseCategories?.length??0);return this.#e(e,c),o}#t(e,n){this.mapData.Analytics.capture("$query-search",{query:e,resultCount:n})}async suggest(e,n={}){await this.ready,Di.parse(n);let i=[],{places:{enabled:s=!0}={},enterpriseLocations:{enabled:r=!0}={}}=n;r&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,Ae(n.enterpriseLocations,{fields:["name","tags"],combineWith:"AND",boost:{name:2,tags:1}})).forEach(c=>i.push(c)),s&&this.indexes.places.autoSuggest(e,Ae(n.places,{fields:["name"],combineWith:"AND"})).forEach(c=>i.push(c));let a=new Map;i.forEach(c=>{let u=a.get(c.suggestion);(!u||c.score>u.score)&&a.set(c.suggestion,c)});let o=Array.from(a.values());return o.sort((c,u)=>u.score-c.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:o.map(c=>c.suggestion)}),o}};function Ci(t,{placesResult:e,locationsResult:n,categoriesResult:i}){let s=e.reduce((o,{id:c,match:u,score:l,__type:h})=>{let d=t.getById(h,c);return d!=null&&!Fe.is(d)&&!Te.is(d)&&!Ce.is(d)&&!Me.is(d)&&!Le.is(d)&&o.push({type:d.__type,match:u,score:l,item:d}),o},[]),r;if(n){r=[];for(let{id:o,match:c,score:u}of n){let l=t.getById("enterprise-location",o);l&&r.push({type:l.__type,match:c,score:u,item:l})}}let a;if(i){a=[];for(let{id:o,match:c,score:u}of i){let l=t.getById("enterprise-category",o);l&&a.push({type:l.__type,match:c,score:u,item:l})}}return{places:s,enterpriseLocations:r,enterpriseCategories:a}}var E=.2;function ze(t){let e={},n=[];for(let i in t.fields)t.fields[i]&&n.push(i);return e.fields=n,Ae(t,e),e}function Ae(t,e){return t?.fuzzy!==void 0&&(e.fuzzy=t.fuzzy),t?.prefix!==void 0&&(e.prefix=t.prefix),e}var Mi={places:{fuzzy:E,prefix:!0,fields:{name:!0,description:!0}},enterpriseCategories:{fuzzy:E,prefix:!0,fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fuzzy:E,prefix:!0,fields:{name:!0,tags:!0,description:!0}}};function Ie(t){return t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Li(t){let e=new I({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:E,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(a,o)=>{let c=a[o];return typeof c=="string"?Ie(c):a[o]},processTerm:a=>Ri.has(a)?"":a.toLowerCase()}),n=t.getByType("enterprise-location"),i;n&&(i=new I({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:E,boost:{name:3,tags:2,description:1}},extractField:(a,o)=>Array.isArray(a[o])?a[o].join(" "):typeof a[o]=="string"?Ie(a[o]):a[o]}));let s=t.getByType("enterprise-category"),r;return s&&(r=new I({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(a,o){return o==="locations.name"?a.locations.reduce((u,l)=>u+` ${xt} `+l.name,"")+` ${xt}`:typeof a[o]=="string"?Ie(a[o]):a[o]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:E,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:r,enterpriseLocations:i,places:e}}var W=y.number().finite().nonnegative(),U=y.custom(t=>typeof t=="boolean"||typeof t=="function"),Ei=y.object({places:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:W.optional(),prefix:U.optional()}).optional(),enterpriseCategories:y.object({fields:y.object({name:y.boolean().optional(),description:y.boolean().optional(),"locations.name":y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:W.optional(),prefix:U.optional()}).optional(),enterpriseLocations:y.object({fields:y.object({name:y.boolean().optional(),tags:y.boolean().optional(),description:y.boolean().optional()}).optional(),limit:y.number().positive().optional(),fuzzy:W.optional(),prefix:U.optional()}).optional()}),Di=y.object({places:y.object({enabled:y.boolean().optional(),fuzzy:W.optional(),prefix:U.optional()}).optional(),enterpriseLocations:y.object({enabled:y.boolean().optional(),fuzzy:W.optional(),prefix:U.optional()}).optional()}),Ri=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),xt="";export{vt as InternalSearch,Ie as removeAccents};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as r,B as s,C as t,D as u,E as v,F as w,t as b,v as n,w as o,y as p,z as q}from"./chunk-KVLT22ON.js";import{$ as g,F as c,Nb as k,Ob as l,Ta as h,Tc as m,Wa as i,Y as d,Ya as j,Z as e,_ as f,j as a}from"./chunk-X2E2A75O.js";import"./chunk-PWEV3AFA.js";export{n as ANIMATION_TWEENS,o as ATTRIBUTION_POSITIONS,d as COLLISION_WORKER_PATH,j as DEFAULT_PATH_SMOOTHING,e as MAPLIBRE_WORKER_PATH,h as MAPPEDIN_LAYER_ID,v as MapLibreOverlay,b as Navigator,p as PROJECT_BATCH_INPUT_STRIDE,q as PROJECT_BATCH_STRIDE,s as PROJECT_BEHIND_CAMERA,r as ProjectBatchFlags,t as RendererCore,i as STENCIL_REF,m as TEXT3D_STYLE_UPDATE_PROPS,f as collisionWorkerUrl,k as configureWorker,w as createRenderer,a as debounce,c as interpolate,u as mountSceneGraphVisualizer,l as preloadFont,g as setCollisionWorkerUrl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bb as r,Fb as w,Gb as y,Hb as Y,Ib as S,Jb as B,Kb as b,Lb as O,a as A,hb as k}from"./chunk-X2E2A75O.js";import"./chunk-PWEV3AFA.js";A();import{MathUtils as P,Matrix4 as E,Vector3 as z}from"three";function H({useWorker:s=!0}){w({useWorker:s})}var u=new E,i=new z,I=new z(0,0,1);async function U(s,f,o,d){let n=f.feature.properties,t=new y;f.textMesh=t,t.text=n.text,t.anchorX="center",t.anchorY="middle",t.textAlign=n.align??"center",t.color=n.color??"black",t.fontSize=n.fontSize||20;let a=o.font??r.font;a?t.font=a:l?t.font=await l:t.font=await O(),t.outlineOpacity=o.outlineOpacity??r.outlineOpacity,t.outlineColor=o.outlineColor??r.outlineColor,t.outlineOffsetY=o.outlineOffsetY??r.outlineOffsetY,t.outlineOffsetX=o.outlineOffsetX??r.outlineOffsetX,t.outlineWidth=o.outlineWidth??r.outlineWidth,t.outlineBlur=o.outlineBlur??r.outlineBlur,t.strokeWidth=o.strokeWidth??r.strokeWidth,t.strokeColor=o.strokeColor??r.strokeColor,t.strokeOpacity=o.strokeOpacity??r.strokeOpacity;let p=d(f.feature.geometry.coordinates);t.position.copy(p),t.position.z=n.verticalOffset;let c=k(P.degToRad(-n.rotation));return t.rotation.z=c,t.userData={entityId:s.toString(),rotationZ:c},{text:t}}async function $(s,f,o,d){let n=f.feature.properties,{textArea:t}=n;if(!t)throw new Error("textArea is required");let a=o.margin??r.margin,[p,c,D,m]=Array.isArray(a)?a:[a,a,a,a],e=new y;e.text=n.content;let g=t.maxHeight-p-D,M=t.maxWidth-m-c;e.fontSize=Math.min(g,o.fontSize??r.fontSize),e.color=o.color??r.color,e.maxWidth=o.maxWidth??M,e.anchorX="center",e.anchorY="middle",e.textAlign="center";let W=o.font??r.font;W?e.font=W:l?e.font=await l:e.font=await O(),e.outlineOpacity=o.outlineOpacity??r.outlineOpacity,e.outlineColor=o.outlineColor??r.outlineColor,e.outlineOffsetY=o.outlineOffsetY??r.outlineOffsetY,e.outlineOffsetX=o.outlineOffsetX??r.outlineOffsetX,e.outlineWidth=o.outlineWidth??r.outlineWidth,e.outlineBlur=o.outlineBlur??r.outlineBlur,e.strokeWidth=o.strokeWidth??r.strokeWidth,e.strokeColor=o.strokeColor??r.strokeColor,e.strokeOpacity=o.strokeOpacity??r.strokeOpacity;let F=d(t.position,i);e.position.copy(F);let x=k(Math.PI/2-P.degToRad(t.rotation));e.rotation.z=x,e.userData={entityId:s.toString(),rotationZ:x};let T,h;try{h=(await B(e,M,g,e.fontSize*.2)).size}catch(X){throw e.dispose?.(),new Error(`Cannot fit text to area: entityId: ${f.polygonEntityId} ${X}`)}if(h)return u.identity(),i.set(0,0,1),u.makeRotationAxis(I,x),i.set(t.align==="near"?m+h[0]/2:t.maxWidth/2,0,0),i.applyMatrix4(u),e.position.x-=i.x,e.position.y-=i.y,f.textMesh=e,T&&(i.set(t.maxWidth/2,0,0),i.applyMatrix4(u),T.position.x-=i.x,T.position.y-=i.y),{text:e}}var l;function q(s){return l=S(s),l}export{Y as BatchedText,y as Text,H as configureTroikaTextBuilder,$ as createTroikaTextArea,U as createTroikaTextPoint,l as fontPreloadLoadPromise,q as preloadFont,b as syncText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var ge=Object.defineProperty;var c=(t,e)=>ge(t,"name",{value:e,configurable:!0});function ce(t,e){return e.x+e.w<t.x+t.w&&e.x>t.x&&e.y>t.y&&e.y+e.h<t.y+t.h}c(ce,"contains");function le(t,e){let[s,n]=e;return s>=t.x&&s<=t.x+t.w&&n>=t.y&&n<=t.y+t.h}c(le,"intersectPoint");function ue(t,e){let s=e.x,n=e.y,r=e.x+e.w,o=e.y+e.h,l=t.x,f=t.y,_=t.x+t.w,T=t.y+t.h;return s<_&&l<r&&n<T&&f<o}c(ue,"intersects");var Q=class Q{x;y;w;h;userData;constructor(e,s,n,r,o){this.userData=typeof o>"u"?null:o,this.x=e,this.y=s,this.w=n,this.h=r}contains(e){return e===this?!1:ce(this,e)}intersects(e){return ue(this,e)}intersectsPoint(e){return le(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};c(Q,"Rectangle");var b=Q;var Te=["bottom-left","top-left","top-right","bottom-right","center","top","bottom","left","right"];function be(t){return Te[t]??"bottom-left"}c(be,"decodeWatermarkPosition");function fe(t,e,s,n,r){switch(r){case"top-left":return new b(0,0,s,n);case"top-right":return new b(t-s,0,s,n);case"bottom-left":return new b(0,e-n,s,n);case"bottom-right":return new b(t-s,e-n,s,n);case"center":return new b((t-s)/2,(e-n)/2,s,n);case"top":return new b((t-s)/2,0,s,n);case"bottom":return new b((t-s)/2,e-n,s,n);case"left":return new b(0,(e-n)/2,s,n);case"right":return new b(t-s,(e-n)/2,s,n);default:return new b(0,e-n,s,n)}}c(fe,"getWatermarkBoundary");var Ee=.0078125,de=-64,he=192;function w(t,e,s,n,r,o,l,f){return r<t+s&&t<r+l&&o<e+n&&e<o+f}c(w,"intersects");function k(t,e,s,n,r,o,l,f){return r+l<t+s&&r>t&&o>e&&o+f<e+n}c(k,"contains");function g(t){let e=Math.floor(t*Ee);return e<de?de:e>he?he:e}c(g,"cellOf");var Z=class Z{xs=new Float64Array(1024);ys=new Float64Array(1024);ws=new Float64Array(1024);hs=new Float64Array(1024);stamps=new Uint32Array(1024);count=0;_stamp=0;_cells=new Map;_used=[];reset(){this.count=0;for(let e=0;e<this._used.length;e++)this._used[e].length=0;this._used.length=0}_grow(){let e=this.xs.length*2,s=c(r=>{let o=new Float64Array(e);return o.set(r),o},"f");this.xs=s(this.xs),this.ys=s(this.ys),this.ws=s(this.ws),this.hs=s(this.hs);let n=new Uint32Array(e);n.set(this.stamps),this.stamps=n}insert(e,s,n,r){if(!(Number.isFinite(e)&&Number.isFinite(s)&&Number.isFinite(n)&&Number.isFinite(r)))return;this.count===this.xs.length&&this._grow();let o=this.count++;this.xs[o]=e,this.ys[o]=s,this.ws[o]=n,this.hs[o]=r,this.stamps[o]=0;let l=g(e),f=g(s),_=g(e+n),T=g(s+r);for(let C=l;C<=_;C++)for(let I=f;I<=T;I++){let R=C*1024+I,h=this._cells.get(R);h===void 0&&(h=[],this._cells.set(R,h)),h.length===0&&this._used.push(h),h.push(o)}}countIntersections(e,s,n,r){if(this.count===0||!(Number.isFinite(e)&&Number.isFinite(s)&&Number.isFinite(n)&&Number.isFinite(r)))return 0;let o=++this._stamp;o>=4294967280&&(this.stamps.fill(0),this._stamp=o=1);let l=0,f=g(e),_=g(s),T=g(e+n),C=g(s+r),{xs:I,ys:R,ws:h,hs:N,stamps:M}=this;for(let O=f;O<=T;O++)for(let A=_;A<=C;A++){let F=this._cells.get(O*1024+A);if(F!==void 0)for(let u=0;u<F.length;u++){let d=F[u];M[d]!==o&&(M[d]=o,w(e,s,n,r,I[d],R[d],h[d],N[d])&&l++)}}return l}};c(Z,"RectHash");var V=Z;var D=200,U=10;function W(t){return Number.isInteger(t)&&t>=0}c(W,"isCount");function xe(t,e=t.length){if(!W(e)||e>t.length||e<7)return!1;let s=t[5],n=t[6];if(!W(s)||!W(n))return!1;let r=7+s*4;if(r>e)return!1;for(let o=0;o<n;o++){if(r+7>e)return!1;let l=t[r+6];if(!W(l)||(r+=7+l*5,r>e))return!1}return!0}c(xe,"isValidFlatRequest");var De=new V;function Re(t,e){let s=t[0],n=t[1],r=t[5],o=t[6],l=fe(s,n,t[2],t[3],be(t[4])),f=l.x,_=l.y,T=l.w,C=l.h,I=o*7;(e==null||e.length<I)&&(e=new Float64Array(Math.max(I*2,64)));let R=De;R.reset();let h=-D,N=-D,M=s+D,O=n+D,A=s+D*2,F=n+D*2,u=7;for(let d=0;d<r;d++){let v=t[u],q=t[u+1],E=v-t[u+2]/2,S=q-t[u+3]/2;R.insert(E,S,v+t[u+2]/2-E,q+t[u+3]/2-S),u+=4}for(let d=0;d<o;d++){let v=t[u],q=t[u+1]===1,E=t[u+2],S=t[u+3],Ie=t[u+4]===1,ee=t[u+5],te=t[u+6],ne=u+7;u=ne+te*5;let i=d*7,se=E<h||E>M||S<N||S>O?1:0;if(e[i]=-1,e[i+1]=se,e[i+2]=0,e[i+3]=0,e[i+4]=0,e[i+5]=0,e[i+6]=0,v!==1)continue;let oe=1/0,re=-1,B=0,X=0,j=0,z=0,ie=!1;for(let G=0;G<te;G++){let P=ne+G*5,K=t[P+4];if(ee!==-1&&K!==ee)continue;let m=E-t[P+2],p=S-t[P],y=E+t[P+3]-m,x=S+t[P+1]-p,L=R.countIntersections(m,p,y,x);if(Ie&&(w(m,p,y,x,-U,0,5,n)&&L++,w(m,p,y,x,-U,0,s,5)&&L++,w(m,p,y,x,s-5,0,s+U,n)&&L++,w(m,p,y,x,0,n-5,s,n+U)&&L++),w(m,p,y,x,f,_,T,C)){e[i]=-1,e[i+1]=se,e[i+2]=1,e[i+3]=m,e[i+4]=p,e[i+5]=y,e[i+6]=x;break}if(L<oe&&(B=m,X=p,j=y,z=x,ie=!0,re=K,oe=L),L===0){R.insert(m,p,y,x),e[i]=K,e[i+1]=k(h,N,A,F,m,p,y,x)?0:1,e[i+2]=1,e[i+3]=m,e[i+4]=p,e[i+5]=y,e[i+6]=x;break}}q&&ie&&(R.insert(B,X,j,z),e[i]=re,e[i+1]=k(h,N,A,F,B,X,j,z)?0:1,e[i+2]=1,e[i+3]=B,e[i+4]=X,e[i+5]=j,e[i+6]=z)}return e}c(Re,"processFlatRequest");self.onmessage=t=>{let e=t.data;if(e==null||!(e.input instanceof Float64Array))return;let{id:s,input:n}=e,r=e.output instanceof Float64Array?e.output:new Float64Array(0),o=xe(n,e.length),l=o?Re(n,r):r,f={id:s,input:n,output:l,colliderCount:o?n[6]:0};self.postMessage(f,[n.buffer,l.buffer])};})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/mappedin-js",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.31.0",
|
|
4
4
|
"homepage": "https://developer.mappedin.com/",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
18
18
|
"dependencies": {
|
|
19
|
+
"three": "0.178.0",
|
|
19
20
|
"zod": "^4.0.0"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as Ae,E as Me,Ja as D,P,R as Ee,S as O,V as Ie,W as Re,a as ae,ba as H,ea as Ne,f as ce,ha as S,i as ue,j as le,k as fe,l as he,m as pe,n as de,o as xe,p as ye,pb as v,q as ge,ra as G,u as Te,w as we,x as me}from"./chunk-UHBPXUGN.js";import"./chunk-PWEV3AFA.js";ae();var be={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},z=class{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new j(e)}),this.register(function(e){return new q(e)}),this.register(function(e){return new Z(e)}),this.register(function(e){return new Q(e)}),this.register(function(e){return new $(e)}),this.register(function(e){return new ee(e)}),this.register(function(e){return new X(e)}),this.register(function(e){return new W(e)}),this.register(function(e){return new J(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new te(e)}),this.register(function(e){return new ne(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new re(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,s,n,t){let i=new K,r=[];for(let o=0,c=this.pluginCallbacks.length;o<c;o++)r.push(this.pluginCallbacks[o](i));i.setPlugins(r),i.setTextureUtils(this.textureUtils),i.writeAsync(e,s,t).catch(n)}parseAsync(e,s){let n=this;return new Promise(function(t,i){n.parse(e,t,i,s)})}},y={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},V="KHR_mesh_quantization",R={};R[he]=y.NEAREST;R[pe]=y.NEAREST_MIPMAP_NEAREST;R[de]=y.NEAREST_MIPMAP_LINEAR;R[xe]=y.LINEAR;R[ye]=y.LINEAR_MIPMAP_NEAREST;R[ge]=y.LINEAR_MIPMAP_LINEAR;R[le]=y.CLAMP_TO_EDGE;R[ue]=y.REPEAT;R[fe]=y.MIRRORED_REPEAT;var Se={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Fe=new Ne,_e=12,ze=1179937895,Be=2,Ue=8,Pe=1313821514,De=5130562;function F(a,e){return a.length===e.length&&a.every(function(s,n){return s===e[n]})}function ke(a){return new TextEncoder().encode(a).buffer}function He(a){return F(a.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function Ge(a,e,s){let n={min:new Array(a.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(a.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let t=e;t<e+s;t++)for(let i=0;i<a.itemSize;i++){let r;a.itemSize>4?r=a.array[t*a.itemSize+i]:(i===0?r=a.getX(t):i===1?r=a.getY(t):i===2?r=a.getZ(t):i===3&&(r=a.getW(t)),a.normalized===!0&&(r=P.normalize(r,a.array))),n.min[i]=Math.min(n.min[i],r),n.max[i]=Math.max(n.max[i],r)}return n}function Le(a){return Math.ceil(a/4)*4}function Y(a,e=0){let s=Le(a.byteLength);if(s!==a.byteLength){let n=new Uint8Array(s);if(n.set(new Uint8Array(a)),e!==0)for(let t=a.byteLength;t<s;t++)n[t]=e;return n.buffer}return a}function Ce(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Ve(a,e){if(a.toBlob!==void 0)return new Promise(n=>a.toBlob(n,e));let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),a.convertToBlob({type:e,quality:s})}var K=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r178"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,s,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);let t=this,i=t.buffers,r=t.json;n=t.options;let o=t.extensionsUsed,c=t.extensionsRequired,l=new Blob(i,{type:"application/octet-stream"}),h=Object.keys(o),u=Object.keys(c);if(h.length>0&&(r.extensionsUsed=h),u.length>0&&(r.extensionsRequired=u),r.buffers&&r.buffers.length>0&&(r.buffers[0].byteLength=l.size),n.binary===!0){let T=new FileReader;T.readAsArrayBuffer(l),T.onloadend=function(){let f=Y(T.result),p=new DataView(new ArrayBuffer(Ue));p.setUint32(0,f.byteLength,!0),p.setUint32(4,De,!0);let d=Y(ke(JSON.stringify(r)),32),g=new DataView(new ArrayBuffer(Ue));g.setUint32(0,d.byteLength,!0),g.setUint32(4,Pe,!0);let A=new ArrayBuffer(_e),N=new DataView(A);N.setUint32(0,ze,!0),N.setUint32(4,Be,!0);let B=_e+g.byteLength+d.byteLength+p.byteLength+f.byteLength;N.setUint32(8,B,!0);let x=new Blob([A,g,d,p,f],{type:"application/octet-stream"}),w=new FileReader;w.readAsArrayBuffer(x),w.onloadend=function(){s(w.result)}}}else if(r.buffers&&r.buffers.length>0){let T=new FileReader;T.readAsDataURL(l),T.onloadend=function(){let f=T.result;r.buffers[0].uri=f,s(r)}}else s(r)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;let n=this.options,t=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(let r in i.gltfExtensions)s.extensions[r]=i.gltfExtensions[r],t[r]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(s.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,s=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(s)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let n=new O;for(let t=0,i=e.count;t<i;t++)if(Math.abs(n.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let s=this.cache;if(s.attributesNormalized.has(e))return s.attributesNormalized.get(e);let n=e.clone(),t=new O;for(let i=0,r=n.count;i<r;i++)t.fromBufferAttribute(n,i),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),n.setXYZ(i,t.x,t.y,t.z);return s.attributesNormalized.set(e,n),n}applyTextureTransform(e,s){let n=!1,t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),n=!0),s.rotation!==0&&(t.rotation=s.rotation,n=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=t,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,s){if(e===s)return e;function n(f){return f.colorSpace===Me?function(d){return d<.04045?d*.0773993808:Math.pow(d*.9478672986+.0521327014,2.4)}:function(d){return d}}e instanceof D&&(e=await this.decompressTextureAsync(e)),s instanceof D&&(s=await this.decompressTextureAsync(s));let t=e?e.image:null,i=s?s.image:null,r=Math.max(t?t.width:0,i?i.width:0),o=Math.max(t?t.height:0,i?i.height:0),c=Ce();c.width=r,c.height=o;let l=c.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,r,o);let h=l.getImageData(0,0,r,o);if(t){l.drawImage(t,0,0,r,o);let f=n(e),p=l.getImageData(0,0,r,o).data;for(let d=2;d<p.length;d+=4)h.data[d]=f(p[d]/256)*256}if(i){l.drawImage(i,0,0,r,o);let f=n(s),p=l.getImageData(0,0,r,o).data;for(let d=1;d<p.length;d+=4)h.data[d]=f(p[d]/256)*256}l.putImageData(h,0,0);let T=(e||s).clone();return T.source=new Re(c),T.colorSpace=Ae,T.channel=(e||s).channel,e&&s&&e.channel!==s.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),T}async decompressTextureAsync(e,s=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,s)}processBuffer(e){let s=this.json,n=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,s,n,t,i){let r=this.json;r.bufferViews||(r.bufferViews=[]);let o;switch(s){case y.BYTE:case y.UNSIGNED_BYTE:o=1;break;case y.SHORT:case y.UNSIGNED_SHORT:o=2;break;default:o=4}let c=e.itemSize*o;i===y.ARRAY_BUFFER&&(c=Math.ceil(c/4)*4);let l=Le(t*c),h=new DataView(new ArrayBuffer(l)),u=0;for(let p=n;p<n+t;p++){for(let d=0;d<e.itemSize;d++){let g;e.itemSize>4?g=e.array[p*e.itemSize+d]:(d===0?g=e.getX(p):d===1?g=e.getY(p):d===2?g=e.getZ(p):d===3&&(g=e.getW(p)),e.normalized===!0&&(g=P.normalize(g,e.array))),s===y.FLOAT?h.setFloat32(u,g,!0):s===y.INT?h.setInt32(u,g,!0):s===y.UNSIGNED_INT?h.setUint32(u,g,!0):s===y.SHORT?h.setInt16(u,g,!0):s===y.UNSIGNED_SHORT?h.setUint16(u,g,!0):s===y.BYTE?h.setInt8(u,g):s===y.UNSIGNED_BYTE&&h.setUint8(u,g),u+=o}u%c!==0&&(u+=c-u%c)}let T={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return i!==void 0&&(T.target=i),i===y.ARRAY_BUFFER&&(T.byteStride=c),this.byteOffset+=l,r.bufferViews.push(T),{id:r.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let s=this,n=s.json;return n.bufferViews||(n.bufferViews=[]),new Promise(function(t){let i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){let r=Y(i.result),o={buffer:s.processBuffer(r),byteOffset:s.byteOffset,byteLength:r.byteLength};s.byteOffset+=r.byteLength,t(n.bufferViews.push(o)-1)}})}processAccessor(e,s,n,t){let i=this.json,r={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},o;if(e.array.constructor===Float32Array)o=y.FLOAT;else if(e.array.constructor===Int32Array)o=y.INT;else if(e.array.constructor===Uint32Array)o=y.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=y.SHORT;else if(e.array.constructor===Uint16Array)o=y.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=y.BYTE;else if(e.array.constructor===Uint8Array)o=y.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(n===void 0&&(n=0),(t===void 0||t===1/0)&&(t=e.count),t===0)return null;let c=Ge(e,n,t),l;s!==void 0&&(l=e===s.index?y.ELEMENT_ARRAY_BUFFER:y.ARRAY_BUFFER);let h=this.processBufferView(e,o,n,t,l),u={bufferView:h.id,byteOffset:h.byteOffset,componentType:o,count:t,max:c.max,min:c.min,type:r[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(u)-1}processImage(e,s,n,t="image/png"){if(e!==null){let i=this,r=i.cache,o=i.json,c=i.options,l=i.pending;r.images.has(e)||r.images.set(e,{});let h=r.images.get(e),u=t+":flipY/"+n.toString();if(h[u]!==void 0)return h[u];o.images||(o.images=[]);let T={mimeType:t},f=Ce();f.width=Math.min(e.width,c.maxTextureSize),f.height=Math.min(e.height,c.maxTextureSize);let p=f.getContext("2d",{willReadFrequently:!0});if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){s!==Te&&console.error("GLTFExporter: Only RGBAFormat is supported.",s),(e.width>c.maxTextureSize||e.height>c.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let g=new Uint8ClampedArray(e.height*e.width*4);for(let A=0;A<g.length;A+=4)g[A+0]=e.data[A+0],g[A+1]=e.data[A+1],g[A+2]=e.data[A+2],g[A+3]=e.data[A+3];p.putImageData(new ImageData(g,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)p.drawImage(e,0,0,f.width,f.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");c.binary===!0?l.push(Ve(f,t).then(g=>i.processBufferViewImage(g)).then(g=>{T.bufferView=g})):T.uri=Ie.getDataURL(f,t);let d=o.images.push(T)-1;return h[u]=d,d}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let s=this.json;s.samplers||(s.samplers=[]);let n={magFilter:R[e.magFilter],minFilter:R[e.minFilter],wrapS:R[e.wrapS],wrapT:R[e.wrapT]};return s.samplers.push(n)-1}async processTextureAsync(e){let n=this.options,t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]),e instanceof D&&(e=await this.decompressTextureAsync(e,n.maxTextureSize));let r=e.userData.mimeType;r==="image/webp"&&(r="image/png");let o={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(o.name=e.name),await this._invokeAllAsync(async function(l){l.writeTexture&&await l.writeTexture(e,o)});let c=i.textures.push(o)-1;return t.textures.set(e,c),c}async processMaterialAsync(e){let s=this.cache,n=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);let t={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let i=e.color.toArray().concat([e.opacity]);if(F(i,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(t.pbrMetallicRoughness.metallicFactor=e.metalness,t.pbrMetallicRoughness.roughnessFactor=e.roughness):(t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){let o=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),c={index:await this.processTextureAsync(o),texCoord:o.channel};this.applyTextureTransform(c,o),t.pbrMetallicRoughness.metallicRoughnessTexture=c}if(e.map){let o={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(o,e.map),t.pbrMetallicRoughness.baseColorTexture=o}if(e.emissive){let o=e.emissive;if(Math.max(o.r,o.g,o.b)>0&&(t.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let l={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),t.emissiveTexture=l}}if(e.normalMap){let o={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(o.scale=e.normalScale.x),this.applyTextureTransform(o,e.normalMap),t.normalTexture=o}if(e.aoMap){let o={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(o.strength=e.aoMapIntensity),this.applyTextureTransform(o,e.aoMap),t.occlusionTexture=o}e.transparent?t.alphaMode="BLEND":e.alphaTest>0&&(t.alphaMode="MASK",t.alphaCutoff=e.alphaTest),e.side===ce&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),await this._invokeAllAsync(async function(o){o.writeMaterialAsync&&await o.writeMaterialAsync(e,t)});let r=n.materials.push(t)-1;return s.materials.set(e,r),r}async processMeshAsync(e){let s=this.cache,n=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,w=e.material.length;x<w;x++)t.push(e.material[x].uuid);else t.push(e.material.uuid);let i=t.join(":");if(s.meshes.has(i))return s.meshes.get(i);let r=e.geometry,o;e.isLineSegments?o=y.LINES:e.isLineLoop?o=y.LINE_LOOP:e.isLine?o=y.LINE_STRIP:e.isPoints?o=y.POINTS:o=e.material.wireframe?y.LINES:y.TRIANGLES;let c={},l={},h=[],u=[],T={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=r.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let p=null;for(let x in r.attributes){if(x.slice(0,5)==="morph")continue;let w=r.attributes[x];if(x=T[x]||x.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(x)||(x="_"+x),s.attributes.has(this.getUID(w))){l[x]=s.attributes.get(this.getUID(w));continue}p=null;let m=w.array;x==="JOINTS_0"&&!(m instanceof Uint16Array)&&!(m instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),p=new S(new Uint16Array(m),w.itemSize,w.normalized)):(m instanceof Uint32Array||m instanceof Int32Array)&&!x.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${x}" converted to type FLOAT.`),p=z.Utils.toFloat32BufferAttribute(w));let I=this.processAccessor(p||w,r);I!==null&&(x.startsWith("_")||this.detectMeshQuantization(x,w),l[x]=I,s.attributes.set(this.getUID(w),I))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let x=[],w=[],M={};if(e.morphTargetDictionary!==void 0)for(let m in e.morphTargetDictionary)M[e.morphTargetDictionary[m]]=m;for(let m=0;m<e.morphTargetInfluences.length;++m){let I={},oe=!1;for(let U in r.morphAttributes){if(U!=="position"&&U!=="normal"){oe||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),oe=!0);continue}let b=r.morphAttributes[U][m],k=U.toUpperCase(),C=r.attributes[U];if(s.attributes.has(this.getUID(b,!0))){I[k]=s.attributes.get(this.getUID(b,!0));continue}let L=b.clone();if(!r.morphTargetsRelative)for(let E=0,Oe=b.count;E<Oe;E++)for(let _=0;_<b.itemSize;_++)_===0&&L.setX(E,b.getX(E)-C.getX(E)),_===1&&L.setY(E,b.getY(E)-C.getY(E)),_===2&&L.setZ(E,b.getZ(E)-C.getZ(E)),_===3&&L.setW(E,b.getW(E)-C.getW(E));I[k]=this.processAccessor(L,r),s.attributes.set(this.getUID(C,!0),I[k])}u.push(I),x.push(e.morphTargetInfluences[m]),e.morphTargetDictionary!==void 0&&w.push(M[m])}c.weights=x,w.length>0&&(c.extras={},c.extras.targetNames=w)}let d=Array.isArray(e.material);if(d&&r.groups.length===0)return null;let g=!1;if(d&&r.index===null){let x=[];for(let w=0,M=r.attributes.position.count;w<M;w++)x[w]=w;r.setIndex(x),g=!0}let A=d?e.material:[e.material],N=d?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,w=N.length;x<w;x++){let M={mode:o,attributes:l};if(this.serializeUserData(r,M),u.length>0&&(M.targets=u),r.index!==null){let I=this.getUID(r.index);(N[x].start!==void 0||N[x].count!==void 0)&&(I+=":"+N[x].start+":"+N[x].count),s.attributes.has(I)?M.indices=s.attributes.get(I):(M.indices=this.processAccessor(r.index,r,N[x].start,N[x].count),s.attributes.set(I,M.indices)),M.indices===null&&delete M.indices}let m=await this.processMaterialAsync(A[N[x].materialIndex]);m!==null&&(M.material=m),h.push(M)}g===!0&&r.setIndex(null),c.primitives=h,n.meshes||(n.meshes=[]),await this._invokeAllAsync(function(x){x.writeMesh&&x.writeMesh(e,c)});let B=n.meshes.push(c)-1;return s.meshes.set(i,B),B}detectMeshQuantization(e,s){if(this.extensionsUsed[V])return;let n;switch(s.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}s.normalized&&(n+=" normalized");let t=e.split("_",1)[0];be[t]&&be[t].includes(n)&&(this.extensionsUsed[V]=!0,this.extensionsRequired[V]=!0)}processCamera(e){let s=this.json;s.cameras||(s.cameras=[]);let n=e.isOrthographicCamera,t={type:n?"orthographic":"perspective"};return n?t.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:t.perspective={aspectRatio:e.aspect,yfov:P.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(t.name=e.type),s.cameras.push(t)-1}processAnimation(e,s){let n=this.json,t=this.nodeMap;n.animations||(n.animations=[]),e=z.Utils.mergeMorphTargetTracks(e.clone(),s);let i=e.tracks,r=[],o=[];for(let c=0;c<i.length;++c){let l=i[c],h=v.parseTrackName(l.name),u=v.findNode(s,h.nodeName),T=Se[h.propertyName];if(h.objectName==="bones"&&(u.isSkinnedMesh===!0?u=u.skeleton.getBoneByName(h.objectIndex):u=void 0),!u||!T){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name);continue}let f=1,p=l.values.length/l.times.length;T===Se.morphTargetInfluences&&(p/=u.morphTargetInfluences.length);let d;l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(d="CUBICSPLINE",p/=3):l.getInterpolation()===we?d="STEP":d="LINEAR",o.push({input:this.processAccessor(new S(l.times,f)),output:this.processAccessor(new S(l.values,p)),interpolation:d}),r.push({sampler:o.length-1,target:{node:t.get(u),path:T}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:o,channels:r}),n.animations.length-1}processSkin(e){let s=this.json,n=this.nodeMap,t=s.nodes[n.get(e)],i=e.skeleton;if(i===void 0)return null;let r=e.skeleton.bones[0];if(r===void 0)return null;let o=[],c=new Float32Array(i.bones.length*16),l=new H;for(let u=0;u<i.bones.length;++u)o.push(n.get(i.bones[u])),l.copy(i.boneInverses[u]),l.multiply(e.bindMatrix).toArray(c,u*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new S(c,16)),joints:o,skeleton:n.get(r)}),t.skin=s.skins.length-1}async processNodeAsync(e){let s=this.json,n=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);let i={};if(n.trs){let o=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();F(o,[0,0,0,1])||(i.rotation=o),F(c,[0,0,0])||(i.translation=c),F(l,[1,1,1])||(i.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),He(e.matrix)===!1&&(i.matrix=e.matrix.elements);if(e.name!==""&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){let o=await this.processMeshAsync(e);o!==null&&(i.mesh=o)}else e.isCamera&&(i.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);let r=s.nodes.push(i)-1;if(t.set(e,r),e.children.length>0){let o=[];for(let c=0,l=e.children.length;c<l;c++){let h=e.children[c];if(h.visible||n.onlyVisible===!1){let u=await this.processNodeAsync(h);u!==null&&o.push(u)}}o.length>0&&(i.children=o)}return await this._invokeAllAsync(function(o){o.writeNode&&o.writeNode(e,i)}),r}async processSceneAsync(e){let s=this.json,n=this.options;s.scenes||(s.scenes=[],s.scene=0);let t={};e.name!==""&&(t.name=e.name),s.scenes.push(t);let i=[];for(let r=0,o=e.children.length;r<o;r++){let c=e.children[r];if(c.visible||n.onlyVisible===!1){let l=await this.processNodeAsync(c);l!==null&&i.push(l)}}i.length>0&&(t.nodes=i),this.serializeUserData(e,t)}async processObjectsAsync(e){let s=new G;s.name="AuxScene";for(let n=0;n<e.length;n++)s.children.push(e[n]);await this.processSceneAsync(s)}async processInputAsync(e){let s=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(t){t.beforeParse&&t.beforeParse(e)});let n=[];for(let t=0;t<e.length;t++)e[t]instanceof G?await this.processSceneAsync(e[t]):n.push(e[t]);n.length>0&&await this.processObjectsAsync(n);for(let t=0;t<this.skins.length;++t)this.processSkin(this.skins[t]);for(let t=0;t<s.animations.length;++t)this.processAnimation(s.animations[t],e[0]);await this._invokeAllAsync(function(t){t.afterParse&&t.afterParse(e)})}async _invokeAllAsync(e){for(let s=0,n=this.plugins.length;s<n;s++)await e(this.plugins[s])}},j=class{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,s){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let n=this.writer,t=n.json,i=n.extensionsUsed,r={};e.name&&(r.name=e.name),r.color=e.color.toArray(),r.intensity=e.intensity,e.isDirectionalLight?r.type="directional":e.isPointLight?(r.type="point",e.distance>0&&(r.range=e.distance)):e.isSpotLight&&(r.type="spot",e.distance>0&&(r.range=e.distance),r.spot={},r.spot.innerConeAngle=(1-e.penumbra)*e.angle,r.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(t.extensions=t.extensions||{},t.extensions[this.name]={lights:[]},i[this.name]=!0);let o=t.extensions[this.name].lights;o.push(r),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}},q=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,s){if(!e.isMeshBasicMaterial)return;let t=this.writer.extensionsUsed;s.extensions=s.extensions||{},s.extensions[this.name]={},t[this.name]=!0,s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=.9}},X=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let r={index:await n.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(r,e.clearcoatMap),i.clearcoatTexture=r}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let r={index:await n.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(r,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=r}if(e.clearcoatNormalMap){let r={index:await n.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(r.scale=e.clearcoatNormalScale.x),n.applyTextureTransform(r,e.clearcoatNormalMap),i.clearcoatNormalTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},W=class{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;let t=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},J=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let r={index:await n.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(r,e.iridescenceMap),i.iridescenceTexture=r}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let r={index:await n.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(r,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},Z=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let r={index:await n.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(r,e.transmissionMap),i.transmissionTexture=r}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},Q=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,t=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let r={index:await n.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(r,e.thicknessMap),i.thicknessTexture=r}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},$=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let t=this.writer.extensionsUsed,i={};i.ior=e.ior,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},ee=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Fe)&&!e.specularIntensityMap&&!e.specularColorMap)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.specularIntensityMap){let r={index:await n.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(r,e.specularIntensityMap),i.specularTexture=r}if(e.specularColorMap){let r={index:await n.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(r,e.specularColorMap),i.specularColorTexture=r}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},se=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.sheenRoughnessMap){let r={index:await n.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(r,e.sheenRoughnessMap),i.sheenRoughnessTexture=r}if(e.sheenColorMap){let r={index:await n.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(r,e.sheenColorMap),i.sheenColorTexture=r}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},te=class{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,s){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.anisotropyMap){let r={index:await n.processTextureAsync(e.anisotropyMap)};n.applyTextureTransform(r,e.anisotropyMap),i.anisotropyTexture=r}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},ne=class{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,s){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let t=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},ie=class{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,s){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;let n=this.writer,t=n.extensionsUsed,i={};if(e.bumpMap){let r={index:await n.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};n.applyTextureTransform(r,e.bumpMap),i.bumpTexture=r}i.bumpFactor=e.bumpScale,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}},re=class{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,s){if(!e.isInstancedMesh)return;let n=this.writer,t=e,i=new Float32Array(t.count*3),r=new Float32Array(t.count*4),o=new Float32Array(t.count*3),c=new H,l=new O,h=new Ee,u=new O;for(let f=0;f<t.count;f++)t.getMatrixAt(f,c),c.decompose(l,h,u),l.toArray(i,f*3),h.toArray(r,f*4),u.toArray(o,f*3);let T={TRANSLATION:n.processAccessor(new S(i,3)),ROTATION:n.processAccessor(new S(r,4)),SCALE:n.processAccessor(new S(o,3))};t.instanceColor&&(T._COLOR_0=n.processAccessor(t.instanceColor)),s.extensions=s.extensions||{},s.extensions[this.name]={attributes:T},n.extensionsUsed[this.name]=!0,n.extensionsRequired[this.name]=!0}};z.Utils={insertKeyframe:function(a,e){let n=a.getValueSize(),t=new a.TimeBufferType(a.times.length+1),i=new a.ValueBufferType(a.values.length+n),r=a.createInterpolant(new a.ValueBufferType(n)),o;if(a.times.length===0){t[0]=e;for(let c=0;c<n;c++)i[c]=0;o=0}else if(e<a.times[0]){if(Math.abs(a.times[0]-e)<.001)return 0;t[0]=e,t.set(a.times,1),i.set(r.evaluate(e),0),i.set(a.values,n),o=0}else if(e>a.times[a.times.length-1]){if(Math.abs(a.times[a.times.length-1]-e)<.001)return a.times.length-1;t[t.length-1]=e,t.set(a.times,0),i.set(a.values,0),i.set(r.evaluate(e),a.values.length),o=t.length-1}else for(let c=0;c<a.times.length;c++){if(Math.abs(a.times[c]-e)<.001)return c;if(a.times[c]<e&&a.times[c+1]>e){t.set(a.times.slice(0,c+1),0),t[c+1]=e,t.set(a.times.slice(c+1),c+2),i.set(a.values.slice(0,(c+1)*n),0),i.set(r.evaluate(e),(c+1)*n),i.set(a.values.slice((c+1)*n),(c+2)*n),o=c+1;break}}return a.times=t,a.values=i,o},mergeMorphTargetTracks:function(a,e){let s=[],n={},t=a.tracks;for(let i=0;i<t.length;++i){let r=t[i],o=v.parseTrackName(r.name),c=v.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(r);continue}if(r.createInterpolant!==r.InterpolantFactoryMethodDiscrete&&r.createInterpolant!==r.InterpolantFactoryMethodLinear){if(r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),r=r.clone(),r.setInterpolation(me)}let l=c.morphTargetInfluences.length,h=c.morphTargetDictionary[o.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let u;if(n[c.uuid]===void 0){u=r.clone();let f=new u.ValueBufferType(l*u.times.length);for(let p=0;p<u.times.length;p++)f[p*l+h]=u.values[p];u.name=(o.nodeName||"")+".morphTargetInfluences",u.values=f,n[c.uuid]=u,s.push(u);continue}let T=r.createInterpolant(new r.ValueBufferType(1));u=n[c.uuid];for(let f=0;f<u.times.length;f++)u.values[f*l+h]=T.evaluate(u.times[f]);for(let f=0;f<r.times.length;f++){let p=this.insertKeyframe(u,r.times[f]);u.values[p*l+h]=r.values[f]}}return a.tracks=s,a},toFloat32BufferAttribute:function(a){let e=new S(new Float32Array(a.count*a.itemSize),a.itemSize,!1);if(!a.normalized&&!a.isInterleavedBufferAttribute)return e.array.set(a.array),e;for(let s=0,n=a.count;s<n;s++)for(let t=0;t<a.itemSize;t++)e.setComponent(s,t,a.getComponent(s,t));return e}};export{z as GLTFExporter};
|