@vizbl/room-viewer 0.0.23 → 0.0.24
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.
|
@@ -143,7 +143,7 @@ void main() {
|
|
|
143
143
|
vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
|
|
144
144
|
gl_FragColor = vec4( clampedHdrColor , 1.0 );
|
|
145
145
|
}
|
|
146
|
-
`;class A_ extends F.ShaderMaterial{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:r,gainMapMin:n,gainMapMax:i,maxDisplayBoost:a,hdrCapacityMin:o,hdrCapacityMax:s,sdr:l,gainMap:u}){super({name:"GainMapDecoderMaterial",vertexShader:AP,fragmentShader:AR,uniforms:{sdr:{value:l},gainMap:{value:u},gamma:{value:new F.Vector3(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new F.Vector3().fromArray(t)},offsetSdr:{value:new F.Vector3().fromArray(r)},gainMapMin:{value:new F.Vector3().fromArray(n)},gainMapMax:{value:new F.Vector3().fromArray(i)},weightFactor:{value:(Math.log2(a)-o)/(s-o)}},blending:F.NoBlending,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=a,this._hdrCapacityMin=o,this._hdrCapacityMax=s,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){let e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){let t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){let e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}er={renderer:F.WebGLRenderer,createMaterial:e=>new A_(e),createQuadRenderer:e=>new AA(e)},e=>{let{sdr:t,gainMap:r,renderer:n}=e;t.colorSpace!==F.SRGBColorSpace&&(console.warn("SDR Colorspace needs to be *SRGBColorSpace*, setting it automatically"),t.colorSpace=F.SRGBColorSpace),t.needsUpdate=!0,r.colorSpace!==F.LinearSRGBColorSpace&&(console.warn("Gainmap Colorspace needs to be *LinearSRGBColorSpace*, setting it automatically"),r.colorSpace=F.LinearSRGBColorSpace),r.needsUpdate=!0;let i=er.createMaterial({...e,sdr:t,gainMap:r});return er.createQuadRenderer({width:t.image.width,height:t.image.height,type:F.HalfFloatType,colorSpace:F.LinearSRGBColorSpace,material:i,renderer:n,renderTargetOptions:e.renderTargetOptions})};class AI extends AB{constructor(e,t){super({renderer:e,createMaterial:e=>new A_(e),createQuadRenderer:e=>new AA(e)},t)}async render(e,t,r,n){let{sdrImage:i,gainMapImage:a,needsFlip:o}=await this.processImages(r,n,"flipY"),{gainMap:s,sdr:l}=this.createTextures(i,a,o);this.updateQuadRenderer(e,i,s,l,t),e.render()}}class AO extends AI{load([e,t,r],n,i,a){let o,s,l,u=this.prepareQuadRenderer(),c=async()=>{if(o&&s&&l){try{await this.render(u,l,o,s)}catch(n){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(r),"function"==typeof a&&a(n),u.disposeOnDemandRenderer();return}"function"==typeof n&&n(u),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(r),u.disposeOnDemandRenderer()}},d=!0,f=0,p=0,h=!0,m=0,v=0,g=!0,b=0,w=0,y=()=>{"function"==typeof i&&i(new ProgressEvent("progress",{lengthComputable:d&&h&&g,loaded:p+v+w,total:f+m+b}))};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(r);let x=new F.FileLoader(this._internalLoadingManager);x.setResponseType("arraybuffer"),x.setRequestHeader(this.requestHeader),x.setPath(this.path),x.setWithCredentials(this.withCredentials),x.load(e,async e=>{if("string"==typeof e)throw Error("Invalid sdr buffer");o=e,await c()},e=>{d=e.lengthComputable,p=e.loaded,f=e.total,y()},t=>{this.manager.itemError(e),"function"==typeof a&&a(t)});let C=new F.FileLoader(this._internalLoadingManager);C.setResponseType("arraybuffer"),C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(t,async e=>{if("string"==typeof e)throw Error("Invalid gainmap buffer");s=e,await c()},e=>{h=e.lengthComputable,v=e.loaded,m=e.total,y()},e=>{this.manager.itemError(t),"function"==typeof a&&a(e)});let A=new F.FileLoader(this._internalLoadingManager);return A.setRequestHeader(this.requestHeader),A.setPath(this.path),A.setWithCredentials(this.withCredentials),A.load(r,async e=>{if("string"!=typeof e)throw Error("Invalid metadata string");l=JSON.parse(e),await c()},e=>{g=e.lengthComputable,w=e.loaded,b=e.total,y()},e=>{this.manager.itemError(r),"function"==typeof a&&a(e)}),u}}class AL extends AI{load(e,t,r,n){let i=this.prepareQuadRenderer(),a=new F.FileLoader(this._internalLoadingManager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(this.withCredentials),this.manager.itemStart(e),a.load(e,async r=>{let a,o,s;if("string"==typeof r)throw Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");let l=new Uint8Array(r);try{let e=await AM(l);a=e.sdr,o=e.gainMap,s=e.metadata}catch(t){if(t instanceof Ak||t instanceof AS)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),s={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},a=l;else throw t}try{await this.render(i,s,a.buffer,o?.buffer)}catch(t){this.manager.itemError(e),"function"==typeof n&&n(t),i.disposeOnDemandRenderer();return}"function"==typeof t&&t(i),this.manager.itemEnd(e),i.disposeOnDemandRenderer()},r,t=>{this.manager.itemError(e),"function"==typeof n&&n(t)}),i}}let AF={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},AD="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",AN=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function Aj({files:e=AN,path:t="",preset:r,colorSpace:n,extensions:i}={}){r&&(AG(r),e=AF[r],t=AD);let a=Array.isArray(e),{extension:o,isCubemap:s}=Aq(e),l=A$(o);if(!l)throw Error("useEnvironment: Unrecognized file extension: "+e);let u=xr(e=>e.gl);(0,ef.useLayoutEffect)(()=>{("webp"===o||"jpg"===o||"jpeg"===o)&&u.domElement.addEventListener("webglcontextlost",function(){xa.clear(l,a?[e]:e)},{once:!0})},[e,u.domElement]);let c=xa(l,a?[e]:e,e=>{("webp"===o||"jpg"===o||"jpeg"===o)&&e.setRenderer(u),null==e.setPath||e.setPath(t),i&&i(e)}),d=a?c[0]:c;if("jpg"===o||"jpeg"===o||"webp"===o){var f;d=null==(f=d.renderTarget)?void 0:f.texture}return d.mapping=s?F.CubeReflectionMapping:F.EquirectangularReflectionMapping,d.colorSpace=null!=n?n:s?"srgb":"srgb-linear",d}let AH={files:AN,path:"",preset:void 0,extensions:void 0};Aj.preload=e=>{let t={...AH,...e},{files:r,path:n=""}=t,{preset:i,extensions:a}=t;i&&(AG(i),r=AF[i],n=AD);let{extension:o}=Aq(r);if("webp"===o||"jpg"===o||"jpeg"===o)throw Error("useEnvironment: Preloading gainmaps is not supported");let s=A$(o);if(!s)throw Error("useEnvironment: Unrecognized file extension: "+r);xa.preload(s,Array.isArray(r)?[r]:r,e=>{null==e.setPath||e.setPath(n),a&&a(e)})};let AU={files:AN,preset:void 0};function AG(e){if(!(e in AF))throw Error("Preset must be one of: "+Object.keys(AF).join(", "))}function Aq(e){var t;let r=Array.isArray(e)&&6===e.length,n=Array.isArray(e)&&3===e.length&&e.some(e=>e.endsWith("json")),i=Array.isArray(e)?e[0]:e;return{extension:r?"cube":n?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":null==(t=i.split(".").pop())||null==(t=t.split("?"))||null==(t=t.shift())?void 0:t.toLowerCase(),isCubemap:r,isGainmap:n}}function A$(e){return"cube"===e?F.CubeTextureLoader:"hdr"===e?C0:"exr"===e?Ax:"jpg"===e||"jpeg"===e?AL:"webp"===e?AO:null}function AV(e,t,r,n,i={}){var a,o,s,l,u;let c;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};let d=(c=u=t||r).current&&c.current.isScene?u.current:u,f=d.background,p=d.environment,h={backgroundBlurriness:d.backgroundBlurriness,backgroundIntensity:d.backgroundIntensity,backgroundRotation:null!=(a=null==(o=d.backgroundRotation)||null==o.clone?void 0:o.clone())?a:[0,0,0],environmentIntensity:d.environmentIntensity,environmentRotation:null!=(s=null==(l=d.environmentRotation)||null==l.clone?void 0:l.clone())?s:[0,0,0]};return"only"!==e&&(d.environment=n),e&&(d.background=n),y5(d,i),()=>{"only"!==e&&(d.environment=p),e&&(d.background=f),y5(d,h)}}function AJ({scene:e,background:t=!1,map:r,...n}){let i=xr(e=>e.scene);return ef.useLayoutEffect(()=>{if(r)return AV(t,e,i,r,n)}),null}function AK({background:e=!1,scene:t,blur:r,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s,...l}){let u=Aj(l),c=xr(e=>e.scene);return ef.useLayoutEffect(()=>AV(e,t,c,u,{backgroundBlurriness:null!=r?r:n,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s})),ef.useEffect(()=>()=>{u.dispose()},[u]),null}function AQ({children:e,near:t=.1,far:r=1e3,resolution:n=256,frames:i=1,map:a,background:o=!1,blur:s,backgroundBlurriness:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f,scene:p,files:h,path:m,preset:v,extensions:g}){var b;let w=xr(e=>e.gl),y=xr(e=>e.scene),x=ef.useRef(null),[C]=ef.useState(()=>new F.Scene),A=ef.useMemo(()=>{let e=new F.WebGLCubeRenderTarget(n);return e.texture.type=F.HalfFloatType,e},[n]);ef.useEffect(()=>()=>{A.dispose()},[A]),ef.useLayoutEffect(()=>{if(1===i){let e=w.autoClear;w.autoClear=!0,x.current.update(w,C),w.autoClear=e}return AV(o,p,y,A.texture,{backgroundBlurriness:null!=s?s:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f})},[e,C,A.texture,p,y,o,i,w]);let S=1;return!function(e,t=0){let r=xt(),n=r.getState().internal.subscribe,i=yH(e);yj(()=>n(i,t,r),[t,n,r])}(()=>{if(i===1/0||S<i){let e=w.autoClear;w.autoClear=!0,x.current.update(w,C),w.autoClear=e,S++}}),ef.createElement(ef.Fragment,null,(b=ef.createElement(ef.Fragment,null,e,ef.createElement("cubeCamera",{ref:x,args:[t,r,A]}),h||v?ef.createElement(AK,{background:!0,files:h,preset:v,path:m,extensions:g}):a?ef.createElement(AJ,{background:!0,map:a,extensions:g}):null),(0,em.jsx)(xB,{children:b,container:C,state:void 0})))}function AW(e){var t,r,n,i;let a=Aj(e),o=e.map||a;ef.useMemo(()=>xp({GroundProjectedEnvImpl:CZ}),[]),ef.useEffect(()=>()=>{a.dispose()},[a]);let s=ef.useMemo(()=>[o],[o]),l=null==(t=e.ground)?void 0:t.height,u=null==(r=e.ground)?void 0:r.radius,c=null!=(n=null==(i=e.ground)?void 0:i.scale)?n:1e3;return ef.createElement(ef.Fragment,null,ef.createElement(AJ,wR({},e,{map:o})),ef.createElement("groundProjectedEnvImpl",{args:s,scale:c,height:l,radius:u}))}function AX(e){return e.ground?ef.createElement(AW,e):e.map?ef.createElement(AJ,e):e.children?ef.createElement(AQ,e):ef.createElement(AK,e)}function AY(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}Aj.clear=e=>{let t={...AU,...e},{files:r}=t,{preset:n}=t;n&&(AG(n),r=AF[n]);let{extension:i}=Aq(r),a=A$(i);if(!a)throw Error("useEnvironment: Unrecognized file extension: "+r);xa.clear(a,Array.isArray(r)?[r]:r)};let AZ=["x","y","top","bottom","left","right","width","height"];function A0({ref:e,children:t,fallback:r,resize:n,style:i,gl:a,events:o=xG,eventSource:s,eventPrefix:l,shadows:u,linear:c,flat:d,legacy:f,orthographic:p,frameloop:h,dpr:m,performance:v,raycaster:g,camera:b,scene:w,onPointerMissed:y,onCreated:x,...C}){let A,S,k;ef.useMemo(()=>xp(F),[]);let z=(A=yO(),S=function(){let e=yO(),[t]=ef.useState(()=>new Map);t.clear();let r=e;for(;r;){let e=r.type;yF(e)&&e!==y_&&!t.has(e)&&t.set(e,ef.use(yR(e))),r=r.return}return t}(),k=ef.useMemo(()=>Array.from(S.keys()).reduce((e,t)=>r=>ef.createElement(e,null,ef.createElement(t.Provider,{...r,value:S.get(t)})),e=>ef.createElement(yI,{...e})),[S]),ef.useMemo(()=>({children:e})=>{let t=yP(A,!0,e=>e.type===ef.StrictMode)?ef.StrictMode:ef.Fragment;return(0,em.jsx)(t,{children:(0,em.jsx)(k,{children:e})})},[A,k])),[E,M]=function({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var i,a,o;let s=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[l,u]=(0,ef.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,ef.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l,orientationHandler:null}),d=e?"number"==typeof e?e:e.scroll:null,f=e?"number"==typeof e?e:e.resize:null,p=(0,ef.useRef)(!1);(0,ef.useEffect)(()=>(p.current=!0,()=>void(p.current=!1)));let[h,m,v]=(0,ef.useMemo)(()=>{let e=()=>{let e,t;if(!c.current.element)return;let{left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f}=c.current.element.getBoundingClientRect(),h={left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f};c.current.element instanceof HTMLElement&&n&&(h.height=c.current.element.offsetHeight,h.width=c.current.element.offsetWidth),Object.freeze(h),p.current&&(e=c.current.lastBounds,t=h,!AZ.every(r=>e[r]===t[r]))&&u(c.current.lastBounds=h)};return[e,f?AY(e,f):e,d?AY(e,d):e]},[u,n,d,f]);function g(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",v,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function b(){c.current.element&&(c.current.resizeObserver=new s(v),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(e=>e.addEventListener("scroll",v,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{v()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}return i=v,a=!!t,(0,ef.useEffect)(()=>{if(a)return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)},[i,a]),o=m,(0,ef.useEffect)(()=>(window.addEventListener("resize",o),()=>void window.removeEventListener("resize",o)),[o]),(0,ef.useEffect)(()=>{g(),b()},[t,v,m]),(0,ef.useEffect)(()=>g,[]),[e=>{e&&e!==c.current.element&&(g(),c.current.element=e,c.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),b())},l,h]}({scroll:!0,debounce:{scroll:50,resize:0},...n}),T=ef.useRef(null),B=ef.useRef(null);ef.useImperativeHandle(e,()=>T.current);let P=yH(y),[R,_]=ef.useState(!1),[I,O]=ef.useState(!1);if(R)throw R;if(I)throw I;let L=ef.useRef(null);yj(()=>{let e=T.current;if(M.width>0&&M.height>0&&e){let r,n,i,y,C,A,S,k,E,T,R,I,D,N,j;L.current||(y=null==(i=xz.get(e))?void 0:i.fiber,C=null==i?void 0:i.store,i&&console.warn("R3F.createRoot should only be called once!"),A="function"==typeof reportError?reportError:console.error,I=C||(E=(k=(S=yz((e,t)=>{let r,n=new F.Vector3,i=new F.Vector3,a=new F.Vector3;function o(e=t().camera,r=i,s=t().size){let{width:l,height:u,top:c,left:d}=s,f=l/u;r.isVector3?a.copy(r):a.set(...r);let p=e.getWorldPosition(n).distanceTo(a);if(e&&e.isOrthographicCamera)return{width:l/e.zoom,height:u/e.zoom,top:c,left:d,factor:1,distance:p,aspect:f};{let t=2*Math.tan(e.fov*Math.PI/180/2)*p,r=l/u*t;return{width:r,height:t,top:c,left:d,factor:l/r,distance:p,aspect:f}}}let s=t=>e(e=>({performance:{...e.performance,current:t}})),l=new F.Vector2;return{set:e,get:t,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(e=1)=>xj(t(),e),advance:(e,r)=>xH(e,r,t()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new F.Clock,pointer:l,mouse:l,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=t();r&&clearTimeout(r),e.performance.current!==e.performance.min&&s(e.performance.min),r=setTimeout(()=>s(t().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:o},setEvents:t=>e(e=>({...e,events:{...e.events,...t}})),setSize:(r,n,a=0,s=0)=>{let l=t().camera,u={width:r,height:n,top:a,left:s};e(e=>({size:u,viewport:{...e.viewport,...o(l,i,u)}}))},setDpr:t=>e(e=>{let r=yq(t);return{viewport:{...e.viewport,dpr:r,initialDpr:e.viewport.initialDpr||r}}}),setFrameloop:(r="always")=>{let n=t().clock;n.stop(),n.elapsedTime=0,"never"!==r&&(n.start(),n.elapsedTime=0),e(()=>({frameloop:r}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:ef.createRef(),active:!1,frames:0,priority:0,subscribe:(e,r,n)=>{let i=t().internal;return i.priority=i.priority+ +(r>0),i.subscribers.push({ref:e,priority:r,store:n}),i.subscribers=i.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=t().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(r>0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}})).getState()).size,T=k.viewport.dpr,R=k.camera,S.subscribe(()=>{let{camera:e,size:t,viewport:r,gl:n,set:i}=S.getState();if(t.width!==E.width||t.height!==E.height||r.dpr!==T){E=t,T=r.dpr,y4(e,t),r.dpr>0&&n.setPixelRatio(r.dpr);let i="undefined"!=typeof HTMLCanvasElement&&n.domElement instanceof HTMLCanvasElement;n.setSize(t.width,t.height,i)}e!==R&&(R=e,i(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),S.subscribe(e=>xj(e)),S),D=y||xk.createContainer(I,1,null,!1,null,"",A,A,A,null),i||xz.set(e,{fiber:D,store:I}),N=!1,j=null,L.current={async configure(t={}){var i,a;let o;j=new Promise(e=>o=e);let{gl:s,size:l,scene:u,events:c,onCreated:d,shadows:f=!1,linear:p=!1,flat:h=!1,legacy:m=!1,orthographic:v=!1,frameloop:g="always",dpr:b=[1,2],performance:w,raycaster:y,camera:x,onPointerMissed:C}=t,A=I.getState(),S=A.gl;if(!A.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},r="function"==typeof s?await s(t):s;S=y7(r)?r:new F.WebGLRenderer({...t,...s}),A.set({gl:S})}let k=A.raycaster;k||A.set({raycaster:k=new F.Raycaster});let{params:z,...E}=y||{};if(yV.equ(E,k,xE)||y5(k,{...E}),yV.equ(z,k.params,xE)||y5(k,{params:{...k.params,...z}}),!A.camera||A.camera===n&&!yV.equ(n,x,xE)){n=x;let e=null==x?void 0:x.isCamera,t=e?x:v?new F.OrthographicCamera(0,0,0,0,.1,1e3):new F.PerspectiveCamera(75,0,.1,1e3);!e&&(t.position.z=5,x&&(y5(t,x),!t.manual&&("aspect"in x||"left"in x||"right"in x||"bottom"in x||"top"in x)&&(t.manual=!0,t.updateProjectionMatrix())),A.camera||null!=x&&x.rotation||t.lookAt(0,0,0)),A.set({camera:t}),k.camera=t}if(!A.scene){let e;null!=u&&u.isScene?yK(e=u,I,"",{}):(yK(e=new F.Scene,I,"",{}),u&&y5(e,u)),A.set({scene:e})}c&&!A.events.handlers&&A.set({events:c(I)});let M=function(e,t){if(!t&&"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:r,top:n,left:i}=e.parentElement.getBoundingClientRect();return{width:t,height:r,top:n,left:i}}return!t&&"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,l);if(yV.equ(M,A.size,xE)||A.setSize(M.width,M.height,M.top,M.left),b&&A.viewport.dpr!==yq(b)&&A.setDpr(b),A.frameloop!==g&&A.setFrameloop(g),A.onPointerMissed||A.set({onPointerMissed:C}),w&&!yV.equ(w,A.performance,xE)&&A.set(e=>({performance:{...e.performance,...w}})),!A.xr){let e=(e,t)=>{let r=I.getState();"never"!==r.frameloop&&xH(e,!0,r,t)},t=()=>{let t=I.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||xj(t)},r={connect(){let e=I.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=I.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(i=S.xr)?void 0:i.addEventListener)&&r.connect(),A.set({xr:r})}if(S.shadowMap){let e=S.shadowMap.enabled,t=S.shadowMap.type;if(S.shadowMap.enabled=!!f,yV.boo(f))S.shadowMap.type=F.PCFSoftShadowMap;else if(yV.str(f)){let e={basic:F.BasicShadowMap,percentage:F.PCFShadowMap,soft:F.PCFSoftShadowMap,variance:F.VSMShadowMap};S.shadowMap.type=null!=(a=e[f])?a:F.PCFSoftShadowMap}else yV.obj(f)&&Object.assign(S.shadowMap,f);(e!==S.shadowMap.enabled||t!==S.shadowMap.type)&&(S.shadowMap.needsUpdate=!0)}return F.ColorManagement.enabled=!m,N||(S.outputColorSpace=p?F.LinearSRGBColorSpace:F.SRGBColorSpace,S.toneMapping=h?F.NoToneMapping:F.ACESFilmicToneMapping),A.legacy!==m&&A.set(()=>({legacy:m})),A.linear!==p&&A.set(()=>({linear:p})),A.flat!==h&&A.set(()=>({flat:h})),!s||yV.fun(s)||y7(s)||yV.equ(s,S,xE)||y5(S,s),r=d,N=!0,o(),this},render(t){return N||j||this.configure(),j.then(()=>{xk.updateContainer((0,em.jsx)(xM,{store:I,children:t,onCreated:r,rootElement:e}),D,null,()=>void 0)}),I},unmount(){xT(e)}}),async function(){await L.current.configure({gl:a,scene:w,events:o,shadows:u,linear:c,flat:d,legacy:f,orthographic:p,frameloop:h,dpr:m,performance:v,raycaster:g,camera:b,size:M,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(s?s&&s.hasOwnProperty("current")?s.current:s:B.current),l&&e.setEvents({compute:(e,t)=>{let r=e[l+"X"],n=e[l+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==x||x(e)}}),L.current.render((0,em.jsx)(z,{children:(0,em.jsx)(yG,{set:O,children:(0,em.jsx)(ef.Suspense,{fallback:(0,em.jsx)(yU,{set:_}),children:null!=t?t:null})})}))}()}}),ef.useEffect(()=>{let e=T.current;if(e)return()=>xT(e)},[]);let D=s?"none":"auto";return(0,em.jsx)("div",{ref:B,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:D,...i},...C,children:(0,em.jsx)("div",{ref:E,style:{width:"100%",height:"100%"},children:(0,em.jsx)("canvas",{ref:T,style:{display:"block"},children:r})})})}function A1(e){return(0,em.jsx)(yI,{children:(0,em.jsx)(A0,{...e})})}let{slice:A2,forEach:A5}=[],A3=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,A4=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"},n=encodeURIComponent(t),i=`${e}=${n}`;if(r.maxAge>0){let e=r.maxAge-0;if(Number.isNaN(e))throw Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(e)}`}if(r.domain){if(!A3.test(r.domain))throw TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!A3.test(r.path))throw TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},A9={create(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*r*1e3)),n&&(i.domain=n),document.cookie=A4(e,t,i)},read(e){let t=`${e}=`,r=document.cookie.split(";");for(let e=0;e<r.length;e++){let n=r[e];for(;" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var A6={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return A9.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:i,cookieOptions:a}=t;r&&"undefined"!=typeof document&&A9.create(r,e,n,i,a)}},A8={name:"querystring",lookup(e){let t,{lookupQuerystring:r}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));let n=e.substring(1).split("&");for(let e=0;e<n.length;e++){let i=n[e].indexOf("=");i>0&&n[e].substring(0,i)===r&&(t=n[e].substring(i+1))}}return t}},A7={name:"hash",lookup(e){let t,{lookupHash:r,lookupFromHashIndex:n}=e;if("undefined"!=typeof window){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(r){let e=i.split("&");for(let n=0;n<e.length;n++){let i=e[n].indexOf("=");i>0&&e[n].substring(0,i)===r&&(t=e[n].substring(i+1))}}if(t)return t;if(!t&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;return t["number"==typeof n?n:0]?.replace("/","")}}}return t}};let Se=null,St=()=>{if(null!==Se)return Se;try{if(!(Se="undefined"!=typeof window&&null!==window.localStorage))return!1;let e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){Se=!1}return Se};var Sr={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&St())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&St()&&window.localStorage.setItem(r,e)}};let Sn=null,Si=()=>{if(null!==Sn)return Sn;try{if(!(Sn="undefined"!=typeof window&&null!==window.sessionStorage))return!1;let e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Sn=!1}return Sn};var Sa={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Si())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&Si()&&window.sessionStorage.setItem(r,e)}},So={name:"navigator",lookup(e){let t=[];if("undefined"!=typeof navigator){let{languages:e,userLanguage:r,language:n}=navigator;if(e)for(let r=0;r<e.length;r++)t.push(e[r]);r&&t.push(r),n&&t.push(n)}return t.length>0?t:void 0}},Ss={name:"htmlTag",lookup(e){let t,{htmlTag:r}=e,n=r||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},Sl={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;let r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(r))return r["number"==typeof t?t:0]?.replace("/","")}},Su={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e,r="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r["number"==typeof t?t+1:1]}};let Sc=!1;try{document.cookie,Sc=!0}catch(e){}let Sd=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Sc||Sd.splice(1,1);class Sf{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return A5.call(A2.call(arguments,1),t=>{if(t)for(let r in t)void 0===e[r]&&(e[r]=t[r])}),e}(t,this.options||{},{order:Sd,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(A6),this.addDetector(A8),this.addDetector(Sr),this.addDetector(Sa),this.addDetector(So),this.addDetector(Ss),this.addDetector(Sl),this.addDetector(Su),this.addDetector(A7)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return(e.forEach(e=>{if(this.detectors[e]){let r=this.detectors[e].lookup(this.options);r&&"string"==typeof r&&(r=[r]),r&&(t=t.concat(r))}}),t=t.filter(e=>null!=e&&!("string"==typeof e&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)))).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes)?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;!t||this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})}}Sf.type="languageDetector";let Sp=(0,ef.createContext)({theme:"system",setTheme:()=>null});function Sh({children:e,defaultTheme:t="system",storageKey:r="vizbl-theme",root:n=window.document.documentElement,enableStorage:i=!1,...a}){let[o,s]=(0,ef.useState)(()=>i&&localStorage.getItem(r)||t);return(0,ef.useEffect)(()=>{if(n.classList.remove("light","dark"),"system"===o){let e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";n.classList.add(e);return}n.classList.add(o)},[o,n]),(0,em.jsx)(Sp,{...a,value:{theme:o,setTheme:e=>{i&&localStorage.setItem(r,e),s(e)}},children:e})}function Sm(...e){return tQ(eZ(e))}function Sv(e){return(0,em.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,children:(0,em.jsx)("path",{d:"M8.21723 14.9975C8.10298 14.997 7.99004 14.9731 7.8854 14.9272C7.78077 14.8814 7.68665 14.8145 7.60889 14.7308L3.55889 10.4225C3.4075 10.2611 3.3264 10.0463 3.33343 9.82513C3.34046 9.604 3.43505 9.39471 3.59639 9.24332C3.75773 9.09192 3.97261 9.01082 4.19374 9.01785C4.41488 9.02489 4.62417 9.11948 4.77556 9.28082L8.20889 12.9392L15.2172 5.27248C15.2883 5.18392 15.3768 5.11083 15.4772 5.0577C15.5776 5.00458 15.6878 4.97254 15.8011 4.96355C15.9143 4.95456 16.0282 4.96882 16.1357 5.00544C16.2432 5.04207 16.3421 5.10029 16.4263 5.17652C16.5105 5.25276 16.5782 5.3454 16.6253 5.44877C16.6724 5.55213 16.6979 5.66403 16.7001 5.7776C16.7024 5.89116 16.6815 6.00399 16.6385 6.10916C16.5956 6.21433 16.5316 6.30961 16.4506 6.38915L8.83389 14.7225C8.75686 14.8077 8.66308 14.8761 8.55841 14.9234C8.45373 14.9707 8.34042 14.996 8.22556 14.9975H8.21723Z",fill:"currentColor"})})}function Sg(e){return(0,em.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:(0,em.jsx)("path",{d:"M12.0002 15.496C11.8686 15.4968 11.7381 15.4716 11.6163 15.4218C11.4944 15.372 11.3836 15.2987 11.2902 15.206L7.29019 11.206C7.10188 11.0177 6.99609 10.7623 6.99609 10.496C6.99609 10.2297 7.10188 9.97434 7.29019 9.78604C7.47849 9.59773 7.73388 9.49194 8.00019 9.49194C8.26649 9.49194 8.52188 9.59773 8.71019 9.78604L12.0002 13.096L15.3002 9.91604C15.3922 9.81375 15.5043 9.73154 15.6295 9.67455C15.7547 9.61756 15.8903 9.58703 16.0279 9.58485C16.1654 9.58267 16.302 9.60889 16.4289 9.66189C16.5559 9.71488 16.6705 9.79349 16.7657 9.89282C16.8609 9.99214 16.9346 10.11 16.9821 10.2391C17.0297 10.3682 17.0501 10.5057 17.042 10.6431C17.034 10.7804 16.9977 10.9146 16.9355 11.0373C16.8732 11.16 16.7863 11.2685 16.6802 11.356L12.6802 15.216C12.4973 15.3924 12.2542 15.4925 12.0002 15.496Z",fill:"currentColor"})})}function Sb(e){return(0,em.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:[(0,em.jsx)("path",{d:"M12 2C11.7348 2 11.4804 2.10536 11.2929 2.29289C11.1054 2.48043 11 2.73478 11 3V5C11 5.26522 11.1054 5.51957 11.2929 5.70711C11.4804 5.89464 11.7348 6 12 6C12.2652 6 12.5196 5.89464 12.7071 5.70711C12.8946 5.51957 13 5.26522 13 5V3C13 2.73478 12.8946 2.48043 12.7071 2.29289C12.5196 2.10536 12.2652 2 12 2Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M21.0002 11H19.0002C18.735 11 18.4806 11.1054 18.2931 11.2929C18.1055 11.4804 18.0002 11.7348 18.0002 12C18.0002 12.2652 18.1055 12.5196 18.2931 12.7071C18.4806 12.8946 18.735 13 19.0002 13H21.0002C21.2654 13 21.5197 12.8946 21.7073 12.7071C21.8948 12.5196 22.0002 12.2652 22.0002 12C22.0002 11.7348 21.8948 11.4804 21.7073 11.2929C21.5197 11.1054 21.2654 11 21.0002 11Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6 12C6 11.7348 5.89464 11.4804 5.70711 11.2929C5.51957 11.1054 5.26522 11 5 11H3C2.73478 11 2.48043 11.1054 2.29289 11.2929C2.10536 11.4804 2 11.7348 2 12C2 12.2652 2.10536 12.5196 2.29289 12.7071C2.48043 12.8946 2.73478 13 3 13H5C5.26522 13 5.51957 12.8946 5.70711 12.7071C5.89464 12.5196 6 12.2652 6 12Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6.22009 5.00298C6.02357 4.82786 5.76656 4.7362 5.50358 4.74744C5.2406 4.75869 4.99234 4.87196 4.8115 5.06322C4.63065 5.25447 4.53143 5.50867 4.5349 5.77187C4.53838 6.03507 4.64426 6.28656 4.83009 6.47298L6.27009 7.86298C6.36673 7.95629 6.48117 8.02917 6.60659 8.07728C6.73201 8.12538 6.86584 8.14773 7.00009 8.14298C7.1348 8.14246 7.26801 8.11474 7.39173 8.06147C7.51546 8.0082 7.62714 7.93048 7.72009 7.83298C7.90634 7.64561 8.01088 7.39216 8.01088 7.12798C8.01088 6.86379 7.90634 6.61034 7.72009 6.42298L6.22009 5.00298Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M17 8.14285C17.2575 8.14182 17.5047 8.04153 17.69 7.86285L19.13 6.47285C19.3057 6.2893 19.4049 6.04577 19.4075 5.79172C19.4102 5.53767 19.316 5.29214 19.1441 5.10502C18.9723 4.91789 18.7356 4.80319 18.4823 4.78421C18.2289 4.76524 17.9779 4.84341 17.78 5.00285L16.34 6.42285C16.1538 6.61021 16.0493 6.86366 16.0493 7.12785C16.0493 7.39203 16.1538 7.64548 16.34 7.83285C16.5132 8.01557 16.7489 8.12627 17 8.14285Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M12 17.9999C11.7348 17.9999 11.4804 18.1053 11.2929 18.2928C11.1054 18.4803 11 18.7347 11 18.9999V20.9999C11 21.2651 11.1054 21.5195 11.2929 21.707C11.4804 21.8946 11.7348 21.9999 12 21.9999C12.2652 21.9999 12.5196 21.8946 12.7071 21.707C12.8946 21.5195 13 21.2651 13 20.9999V18.9999C13 18.7347 12.8946 18.4803 12.7071 18.2928C12.5196 18.1053 12.2652 17.9999 12 17.9999Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M17.7302 16.1399C17.5392 15.9556 17.2829 15.8547 17.0175 15.8594C16.7521 15.864 16.4995 15.974 16.3152 16.1649C16.1309 16.3559 16.0299 16.6122 16.0346 16.8776C16.0393 17.143 16.1492 17.3956 16.3402 17.5799L17.7802 18.9999C17.9702 19.1835 18.2251 19.2845 18.4893 19.2808C18.7535 19.277 19.0055 19.1688 19.1902 18.9799C19.2837 18.8868 19.3579 18.7762 19.4085 18.6543C19.4591 18.5325 19.4851 18.4019 19.4851 18.2699C19.4851 18.138 19.4591 18.0073 19.4085 17.8855C19.3579 17.7637 19.2837 17.653 19.1902 17.5599L17.7302 16.1399Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6.27011 16.141L4.83011 17.531C4.73638 17.624 4.66198 17.7346 4.61121 17.8564C4.56045 17.9783 4.53431 18.109 4.53431 18.241C4.53431 18.373 4.56045 18.5037 4.61121 18.6256C4.66198 18.7474 4.73638 18.858 4.83011 18.951C4.9239 19.0467 5.03596 19.1226 5.15965 19.1741C5.28333 19.2256 5.41612 19.2518 5.55011 19.251C5.79662 19.2531 6.03522 19.1641 6.22011 19.001L7.66011 17.611C7.75466 17.5197 7.83031 17.4107 7.88273 17.2902C7.93516 17.1697 7.96334 17.0401 7.96566 16.9087C7.96798 16.7773 7.9444 16.6467 7.89626 16.5244C7.84813 16.4022 7.77637 16.2905 7.68511 16.196C7.59384 16.1014 7.48484 16.0258 7.36433 15.9734C7.24383 15.9209 7.11418 15.8928 6.98278 15.8904C6.85139 15.8881 6.72082 15.9117 6.59854 15.9598C6.47626 16.008 6.36466 16.0797 6.27011 16.171V16.141Z",fill:"currentColor"})]})}function Sw(e){return(0,em.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,em.jsx)("g",{clipPath:"url(#clip0_3784_10281)",children:(0,em.jsx)("path",{d:"M20.739 11.3791L18.039 8.67909C17.955 8.59517 17.8554 8.52861 17.7458 8.48319C17.6361 8.43778 17.5186 8.4144 17.4 8.4144C17.2813 8.4144 17.1638 8.43778 17.0541 8.48319C16.9445 8.52861 16.8449 8.59517 16.761 8.67909C16.6771 8.763 16.6105 8.86262 16.5651 8.97226C16.5197 9.0819 16.4963 9.19941 16.4963 9.31808C16.4963 9.43676 16.5197 9.55427 16.5651 9.66391C16.6105 9.77355 16.6771 9.87317 16.761 9.95708L17.922 11.1001H12.9V6.0691L14.061 7.23909C14.1451 7.32246 14.2448 7.38843 14.3545 7.43322C14.4641 7.478 14.5815 7.50073 14.7 7.50009C14.8787 7.50113 15.0538 7.44891 15.2027 7.35009C15.3517 7.25127 15.4679 7.11032 15.5364 6.94523C15.605 6.78013 15.6228 6.59835 15.5876 6.42308C15.5525 6.24781 15.4659 6.08698 15.339 5.9611L12.639 3.26111C12.4705 3.09326 12.2423 2.99902 12.0045 2.99902C11.7666 2.99902 11.5385 3.09326 11.37 3.26111L8.66999 5.9611C8.58608 6.04442 8.5194 6.14346 8.47376 6.25255C8.42812 6.36164 8.40441 6.47866 8.404 6.59691C8.40358 6.71517 8.42646 6.83235 8.47132 6.94176C8.51619 7.05117 8.58217 7.15068 8.66549 7.23459C8.74882 7.31851 8.84785 7.38519 8.95695 7.43083C9.06604 7.47647 9.18306 7.50017 9.30131 7.50059C9.54014 7.50144 9.76952 7.40737 9.93899 7.23909L11.1 6.0781V11.1001H6.069L7.239 9.93908C7.40847 9.76961 7.50368 9.53975 7.50368 9.30008C7.50368 9.06041 7.40847 8.83056 7.239 8.66109C7.06953 8.49161 6.83967 8.39641 6.6 8.39641C6.36033 8.39641 6.13048 8.49161 5.961 8.66109L3.26101 11.3611C3.17764 11.4452 3.11167 11.5449 3.06689 11.6546C3.0221 11.7642 2.99938 11.8816 3.00002 12.0001C2.99933 12.1185 3.02203 12.2359 3.06682 12.3456C3.11161 12.4552 3.1776 12.555 3.26101 12.6391L5.961 15.3391C6.0451 15.4225 6.14483 15.4885 6.25449 15.5333C6.36414 15.578 6.48156 15.6007 6.6 15.6001C6.77896 15.6015 6.95429 15.5496 7.10354 15.4508C7.25279 15.3521 7.36918 15.211 7.43781 15.0458C7.50643 14.8805 7.52417 14.6985 7.48876 14.5231C7.45334 14.3476 7.36638 14.1868 7.239 14.0611L6.078 12.9001H11.1V17.9311L9.93899 16.7611C9.76952 16.5916 9.53966 16.4964 9.29999 16.4964C9.06032 16.4964 8.83047 16.5916 8.661 16.7611C8.49152 16.9305 8.39631 17.1604 8.39631 17.4001C8.39631 17.6397 8.49152 17.8696 8.661 18.0391L11.361 20.739C11.5297 20.9065 11.7578 21.0004 11.9955 21.0004C12.2332 21.0004 12.4612 20.9065 12.63 20.739L15.33 18.0391C15.4139 17.9551 15.4805 17.8555 15.5259 17.7459C15.5713 17.6362 15.5947 17.5187 15.5947 17.4001C15.5947 17.2814 15.5713 17.1639 15.5259 17.0542C15.4805 16.9446 15.4139 16.845 15.33 16.7611C15.2461 16.6771 15.1464 16.6106 15.0368 16.5652C14.9272 16.5198 14.8096 16.4964 14.691 16.4964C14.5723 16.4964 14.4548 16.5198 14.3452 16.5652C14.2355 16.6106 14.1359 16.6771 14.052 16.7611L12.9 17.9221V12.9001H17.931L16.761 14.0611C16.6558 14.166 16.5781 14.2952 16.5349 14.4374C16.4917 14.5795 16.4843 14.7301 16.5134 14.8758C16.5424 15.0215 16.607 15.1578 16.7013 15.2725C16.7957 15.3873 16.917 15.4769 17.0544 15.5335C17.164 15.5784 17.2815 15.6011 17.4 15.6001C17.5184 15.6008 17.6359 15.5782 17.7455 15.5334C17.8552 15.4886 17.9549 15.4226 18.039 15.3391L20.739 12.6391C20.8224 12.555 20.8884 12.4552 20.9331 12.3456C20.9779 12.2359 21.0006 12.1185 21 12.0001C20.9966 11.7671 20.9031 11.5445 20.739 11.3791Z",fill:"currentColor"})}),(0,em.jsx)("defs",{children:(0,em.jsx)("clipPath",{id:"clip0_3784_10281",children:(0,em.jsx)("rect",{width:"24",height:"24",fill:"currentColor"})})})]})}function Sy(e){return(0,em.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:[(0,em.jsx)("path",{d:"M19.5398 5.08113C18.5372 4.08551 17.3458 3.30019 16.0356 2.77129C14.7253 2.24238 13.3226 1.98054 11.9098 2.00113C9.25763 1.9945 6.71146 3.04171 4.83141 4.91238C2.95135 6.78306 1.89143 9.32396 1.8848 11.9761C1.87817 14.6283 2.92538 17.1745 4.79605 19.0545C6.66673 20.9346 9.20763 21.9945 11.8598 22.0011C12.4313 22.0108 12.9898 21.8305 13.4477 21.4884C13.9057 21.1464 14.237 20.6619 14.3898 20.1111C14.4872 19.7134 14.4862 19.2979 14.3869 18.9006C14.2875 18.5033 14.0929 18.1362 13.8198 17.8311C13.7562 17.7594 13.7146 17.6709 13.7 17.5761C13.6854 17.4814 13.6984 17.3845 13.7374 17.2969C13.7765 17.2094 13.8399 17.1349 13.9201 17.0825C14.0003 17.03 14.0939 17.0018 14.1898 17.0011H15.8398C17.3927 17.0084 18.8909 16.4279 20.0336 15.3761C21.1762 14.3244 21.8786 12.8794 21.9998 11.3311C22.037 10.1767 21.838 9.02692 21.415 7.95218C20.992 6.87745 20.3539 5.90046 19.5398 5.08113ZM15.8798 15.0011H14.2298C13.7479 14.9984 13.2756 15.1355 12.8701 15.3959C12.4647 15.6563 12.1435 16.0288 11.9455 16.4681C11.7476 16.9075 11.6813 17.3948 11.7549 17.8711C11.8284 18.3473 12.0385 18.792 12.3598 19.1511C12.4224 19.2142 12.4666 19.2932 12.4877 19.3795C12.5088 19.4658 12.5061 19.5562 12.4798 19.6411C12.4298 19.8511 12.1998 19.9811 11.8898 20.0011C10.754 19.9869 9.63429 19.7309 8.60516 19.2502C7.57603 18.7695 6.66109 18.0751 5.92126 17.2132C5.18142 16.3513 4.63365 15.3417 4.31441 14.2516C3.99517 13.1615 3.91178 12.016 4.0698 10.8911C4.35496 9.00107 5.29935 7.27276 6.73593 6.01186C8.17251 4.75096 10.0087 4.03873 11.9198 4.00113H11.9998C13.1306 3.98632 14.253 4.19813 15.3007 4.62407C16.3483 5.05001 17.3001 5.68144 18.0998 6.48113C18.7238 7.10552 19.2141 7.85048 19.5407 8.67057C19.8674 9.49066 20.0236 10.3687 19.9998 11.2511C19.8963 12.2742 19.4184 13.2229 18.6579 13.9151C17.8974 14.6072 16.9081 14.994 15.8798 15.0011Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M11.9996 8.00025C12.3974 8.00025 12.7789 7.84222 13.0602 7.56091C13.3415 7.27961 13.4996 6.89808 13.4996 6.50025C13.4996 6.10243 13.3415 5.7209 13.0602 5.43959C12.7789 5.15829 12.3974 5.00025 11.9996 5.00025C11.6018 5.00025 11.2202 5.15829 10.9389 5.43959C10.6576 5.7209 10.4996 6.10243 10.4996 6.50025C10.4996 6.89808 10.6576 7.27961 10.9389 7.56091C11.2202 7.84222 11.6018 8.00025 11.9996 8.00025Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M15.2496 7.20116C15.079 7.29965 14.9294 7.43079 14.8094 7.58709C14.6895 7.74339 14.6014 7.92179 14.5504 8.1121C14.4994 8.30242 14.4864 8.50092 14.512 8.69627C14.5377 8.89162 14.6016 9.08 14.7001 9.25066C14.7986 9.42131 14.9298 9.57089 15.0861 9.69086C15.2424 9.81084 15.4208 9.89885 15.6111 9.94987C15.8014 10.0009 15.9999 10.0139 16.1952 9.98825C16.3906 9.96256 16.579 9.89865 16.7496 9.80016C17.0944 9.60125 17.3461 9.27352 17.4492 8.88907C17.5524 8.50462 17.4985 8.09494 17.2996 7.75016C17.1007 7.40538 16.773 7.15373 16.3885 7.05059C16.0041 6.94744 15.5944 7.00125 15.2496 7.20016V7.20116Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M8.74976 7.20016C8.57904 7.1018 8.39062 7.03803 8.19526 7.01249C7.99989 6.98695 7.80141 7.00014 7.61114 7.0513C7.42088 7.10247 7.24255 7.19061 7.08634 7.31069C6.93014 7.43077 6.79912 7.58045 6.70076 7.75116C6.6024 7.92188 6.53863 8.1103 6.51308 8.30567C6.48754 8.50103 6.50073 8.69951 6.5519 8.88978C6.60306 9.08005 6.6912 9.25837 6.81128 9.41458C6.93137 9.57078 7.08104 9.7018 7.25176 9.80016C7.59654 9.99881 8.00611 10.0524 8.39037 9.94903C8.77464 9.84569 9.10211 9.59394 9.30076 9.24916C9.4994 8.90438 9.55295 8.49481 9.44962 8.11055C9.34629 7.72629 9.09454 7.39881 8.74976 7.20016Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6.15933 11.2603C5.9133 11.4264 5.7221 11.6618 5.60993 11.9366C5.49776 12.2115 5.46967 12.5135 5.52921 12.8043C5.58876 13.0951 5.73326 13.3617 5.94443 13.5704C6.1556 13.779 6.42393 13.9204 6.71546 13.9764C7.00698 14.0325 7.30858 14.0008 7.58208 13.8853C7.85557 13.7699 8.08866 13.5759 8.25183 13.3279C8.415 13.0799 8.50091 12.789 8.49868 12.4922C8.49646 12.1953 8.4062 11.9058 8.23933 11.6603C8.12971 11.4966 7.98873 11.3563 7.82454 11.2475C7.66035 11.1387 7.47622 11.0635 7.28279 11.0263C7.08936 10.9891 6.89047 10.9906 6.69763 11.0308C6.5048 11.0709 6.32183 11.1489 6.15933 11.2603Z",fill:"currentColor"})]})}function Sx(e){return(0,em.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,em.jsx)("path",{d:"M20 15.9998C20.5522 15.9998 20.9999 16.4476 21 16.9998V18.9998C20.9999 19.7952 20.6835 20.5584 20.1211 21.1209C19.5585 21.6833 18.7955 21.9998 18 21.9998H6C5.20446 21.9998 4.44149 21.6833 3.87891 21.1209C3.31646 20.5584 3.00012 19.7952 3 18.9998V16.9998C3.00009 16.4476 3.44777 15.9998 4 15.9998C4.55223 15.9998 4.99991 16.4476 5 16.9998V18.9998C5.00012 19.2648 5.1056 19.5194 5.29297 19.7068C5.48048 19.8942 5.7349 19.9998 6 19.9998H18C18.2651 19.9998 18.5195 19.8942 18.707 19.7068C18.8944 19.5194 18.9999 19.2648 19 18.9998V16.9998C19.0001 16.4476 19.4478 15.9998 20 15.9998Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M11.3691 3.22437C11.7619 2.90402 12.3409 2.92662 12.707 3.29273L17.707 8.29273C18.0973 8.68328 18.0975 9.31635 17.707 9.7068C17.3166 10.097 16.6834 10.097 16.293 9.7068L13 6.41383V15.9998C12.9997 16.5518 12.552 16.9997 12 16.9998C11.4479 16.9998 11.0003 16.5518 11 15.9998V6.41383L7.70703 9.7068C7.31657 10.097 6.68343 10.097 6.29297 9.7068C5.90252 9.31635 5.90268 8.68328 6.29297 8.29273L11.293 3.29273L11.3691 3.22437Z",fill:"currentColor"})]})}function SC({className:e,...t}){return(0,em.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:Sm("size-6",e),...t,children:[(0,em.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0625 1.70412C12.1393 1.70359 12.2136 1.7151 12.2842 1.73439C12.6576 1.76978 13.0261 1.88527 13.3604 2.08303L19.7012 5.84084L19.7031 5.84181C20.1036 6.08032 20.4348 6.42322 20.665 6.83498C20.8952 7.24671 21.0168 7.71415 21.0166 8.19142V8.19338L20.998 15.7403C20.9979 16.1352 20.9124 16.526 20.751 16.8848C20.7319 16.9557 20.7049 17.026 20.667 17.0928C20.6355 17.1482 20.5983 17.1987 20.5576 17.2442C20.3296 17.6 20.023 17.8979 19.6631 18.1133L13.2998 21.9072C12.4738 22.3996 11.4611 22.4004 10.6436 21.917L10.6416 21.916L4.30078 18.1582L4.29883 18.1572C3.91023 17.9258 3.58764 17.5957 3.3584 17.2002C3.35105 17.1885 3.34181 17.1773 3.33496 17.1651C3.32803 17.1526 3.32268 17.1387 3.31641 17.126C3.09976 16.7236 2.98517 16.2703 2.98535 15.8076V15.8057L3.00391 8.25588C3.00603 7.28279 3.51293 6.37777 4.33984 5.88478L10.7021 2.09181C11.0682 1.87369 11.4708 1.75231 11.877 1.72658C11.9365 1.71245 11.999 1.70462 12.0625 1.70412ZM5.16895 7.36818C4.87108 7.54583 4.6844 7.87497 4.68359 8.23635L4.66602 15.3838L9.45801 12.5254C9.51085 12.7718 9.60256 13.0142 9.73535 13.2442C9.90127 13.5315 10.1161 13.7727 10.3633 13.9639L5.49512 16.8662L11.499 20.4248C11.8036 20.6044 12.1738 20.6008 12.4707 20.4238L18.5107 16.8233L13.4971 13.877C13.9543 13.482 14.2391 12.9423 14.3242 12.3672L19.3193 15.3037L19.3379 8.21291L19.3369 8.21388C19.3369 8.03517 19.2923 7.85955 19.2061 7.7051C19.1196 7.55056 18.9947 7.42151 18.8447 7.33205L12.8887 3.80275L12.8535 9.73439C12.3304 9.51037 11.7366 9.46806 11.1738 9.63576L11.21 3.76662L5.16895 7.36818Z",fill:"currentColor"}),(0,em.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.91641 8.60885C11.7928 7.52595 14.1912 8.16845 15.2748 10.0444C16.3582 11.9209 15.7156 14.3211 13.8393 15.4047C11.9627 16.4879 9.56339 15.8446 8.47989 13.9682C7.39671 12.0916 8.03987 9.69227 9.91641 8.60885ZM13.8031 10.894C13.189 9.83118 11.8293 9.46704 10.766 10.0805C9.7026 10.6945 9.33693 12.0551 9.95059 13.1186C10.5646 14.1821 11.9261 14.5469 12.9897 13.9331C14.0529 13.3189 14.4171 11.9575 13.8031 10.894Z",fill:"currentColor"})]})}let SA="var(--vizbl-borders-medium)";function SS({className:e,variant:t="default",size:r="default",state:n="loading",role:i,"aria-live":a,"aria-label":o,...s}){switch(t){case"logo":{let t="sm"===r?4:5;return(0,em.jsxs)("svg",{...s,role:i??"status","aria-live":a??"polite","aria-label":o??("success"===n?"Success":"error"===n?"Error":"Loading"),width:"93",height:"91",viewBox:"0 0 93 91",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-slot":"spinner","data-size":r,"data-state":n,className:Sm("spinner-logo shrink-0","sm"===r?"size-9":"size-22",e),children:[(0,em.jsx)("g",{className:"spinner-logo__intro-shell",children:(0,em.jsx)("path",{d:"M15.7495 62.7798L46.4936 45.0297M46.4936 45.0297L77.2661 62.5451M46.4936 45.0297L46.7111 9.62225M49.9213 79.4237L74.5719 65.1917C75.6436 64.5705 76.5344 63.6811 77.1541 62.6137C77.7738 61.5462 78.1003 60.3385 78.1007 59.1129L78.1729 30.7811C78.1734 29.5494 77.851 28.3427 77.2373 27.2798C76.6236 26.2169 75.7398 25.3343 74.6729 24.7189L50.1007 10.6155C47.926 9.3694 45.2455 9.37719 43.0689 10.6339L18.4183 24.8659C16.2385 26.1244 14.8946 28.4401 14.8895 30.9447L14.8173 59.2766C14.8168 60.5082 15.1392 61.7149 15.7529 62.7778C16.3666 63.8408 17.2504 64.7233 18.3173 65.3387L42.8895 79.4421C45.0642 80.6882 47.7447 80.6805 49.9213 79.4237Z",className:"spinner-logo__outline spinner-logo__outline--intro",vectorEffect:"sm"===r?void 0:"non-scaling-stroke"})}),(0,em.jsx)("circle",{className:"spinner-logo__intro-orb",cx:"46.27",cy:"45.8",r:"11.18",fill:"white",stroke:SA,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,em.jsx)("circle",{className:"spinner-logo__result-ring",cx:"46.5",cy:"45.5",r:"33.46",fill:"white",stroke:SA,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,em.jsx)("g",{transform:"translate(27.786 31.4489)",children:(0,em.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--success",children:(0,em.jsx)("path",{d:"M13.6758 28.1023C13.3559 28.101 13.0397 28.0341 12.7467 27.9057C12.4537 27.7772 12.1902 27.59 11.9725 27.3557L0.632479 15.2923C0.208575 14.8406 -0.0185097 14.2389 0.00118164 13.6198C0.020873 13.0006 0.285727 12.4146 0.737479 11.9907C1.18923 11.5668 1.79088 11.3397 2.41006 11.3594C3.02924 11.3791 3.61524 11.6439 4.03915 12.0957L13.6525 22.339L33.2758 0.87233C33.475 0.624349 33.7227 0.419696 34.0038 0.270944C34.2849 0.122191 34.5935 0.0324784 34.9105 0.00731496C35.2276 -0.0178485 35.5464 0.0220682 35.8475 0.124615C36.1485 0.227162 36.4254 0.390174 36.6612 0.603637C36.897 0.8171 37.0866 1.07651 37.2185 1.36593C37.3503 1.65535 37.4216 1.96867 37.428 2.28665C37.4344 2.60463 37.3756 2.92056 37.2555 3.21502C37.1353 3.50949 36.9562 3.77627 36.7291 3.999L15.4025 27.3323C15.1868 27.5709 14.9242 27.7625 14.6311 27.895C14.338 28.0275 14.0208 28.0981 13.6991 28.1023H13.6758Z",fill:SA})})}),(0,em.jsx)("g",{transform:"translate(32.4879 31.4885)",children:(0,em.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--error",children:(0,em.jsx)("path",{d:"M17.3045 14.0095L27.3378 3.99955C27.5554 3.78199 27.728 3.52371 27.8457 3.23946C27.9635 2.95521 28.0241 2.65055 28.0241 2.34288C28.0241 2.03521 27.9635 1.73055 27.8457 1.4463C27.728 1.16205 27.5554 0.903769 27.3378 0.686213C27.1203 0.468656 26.862 0.296082 26.5778 0.178341C26.2935 0.0606 25.9889 -4.58466e-09 25.6812 0C25.3735 4.58466e-09 25.0689 0.0606 24.7846 0.178341C24.5003 0.296082 24.2421 0.468656 24.0245 0.686213L14.0145 10.7195L4.00451 0.686213C3.56514 0.246838 2.96921 -4.62957e-09 2.34784 0C1.72647 4.62957e-09 1.13055 0.246838 0.691177 0.686213C0.251802 1.12559 0.0049634 1.72151 0.0049634 2.34288C0.00496339 2.96425 0.251802 3.56017 0.691177 3.99955L10.7245 14.0095L0.691177 24.0195C0.472196 24.2363 0.29836 24.4943 0.179723 24.7787C0.0610849 25.063 0 25.3681 0 25.6762C0 25.9843 0.0610849 26.2894 0.179723 26.5737C0.29836 26.8581 0.472196 27.1161 0.691177 27.3329C0.908091 27.5516 1.16616 27.7252 1.4505 27.8436C1.73484 27.9621 2.03982 28.0231 2.34784 28.0231C2.65587 28.0231 2.96085 27.9621 3.24519 27.8436C3.52953 27.7252 3.7876 27.5516 4.00451 27.3329L14.0145 17.2995L24.0245 27.3329C24.296 27.6078 24.6314 27.8111 25.0007 27.9245C25.3701 28.0379 25.7618 28.0579 26.1407 27.9828C26.5197 27.9077 26.8741 27.7397 27.1722 27.4939C27.4703 27.2481 27.7028 26.9322 27.8488 26.5745C28.0272 26.1459 28.0736 25.6738 27.9821 25.2187C27.8907 24.7636 27.6655 24.346 27.3355 24.0195L17.3045 14.0095Z",fill:SA})})})]})}case"default":return(0,em.jsx)(Sb,{...s,role:i??"status","aria-live":a??"polite","aria-label":o??"Loading","data-slot":"spinner",className:Sm("size-4 animate-spin",e)});default:return t}}function Sk({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return(0,em.jsx)(n9,{"data-slot":"separator",decorative:r,orientation:t,className:Sm("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}let Sz="undefined"==typeof window;function SE(e,{defaultValue:t=!1,initializeWithValue:r=!0}={}){let[n,i]=(0,ef.useState)(()=>{if(r)return Sz?t:window.matchMedia(e).matches;return t});return(0,ef.useEffect)(()=>{let t=window.matchMedia(e),r=()=>{i(t.matches)};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}},[e]),n}function SM(e){return cl.create({baseURL:e,timeout:3e4})}let ST=new Set(["common","delete","get","head","post","put","patch","options","purge","link","unlink"]);function SB(){return globalThis.process?.env?.NODE_ENV}function SP(e){if(void 0===e)return[];let t="function"==typeof e.toJSON?e.toJSON():e,r=[];return!function e(t,r){if(null!==t&&"object"==typeof t)for(let[n,i]of Object.entries(t)){if(null==i)continue;let t=n.toLowerCase();if("common"===t){e(i,r);continue}ST.has(t)||r.push([n,String(i)])}}(t,r),r}let SR=function({clientName:e,configureFunctionName:t,defaultBaseURL:r}){let n=SM(r),i=SM(r),a=null,o=null,s=null,l=null,u=null,c=null;async function d(e,t){let r=function(e,t){var r;let n;if(void 0===t.data||(r=t.data,"undefined"!=typeof FormData&&r instanceof FormData||null!==r&&"object"==typeof r&&(r.constructor?.name==="FormData"||"function"==typeof r.getBoundary)))return t;let i=cy.from(t.headers);return i.has("Content-Type")||void 0!==(n=e.defaults.headers.common)&&cy.from(n).has("Content-Type")||i.set("Content-Type","application/json"),t.headers=i,t}(e,function(e){let t=cy.from(e.headers);if(null!==s){let e=s()?.trim();e&&!t.has("Authorization")&&t.set("Authorization",`Bearer ${e}`)}if(null!==c)for(let[e,r]of Object.entries(c()))r&&!t.has(e)&&t.set(e,r);return e.headers=t,e}({...t}));try{return await e.request(r)}catch(e){throw e}}async function f(e){return d(e.skipUnauthorizedRecovery?i:n,function(e){let{skipUnauthorizedRecovery:t,...r}=e;return r}(e))}let p=async e=>f({...e,skipUnauthorizedRecovery:!0});function h(){return null!==a}return{configureClientRuntime:function(t){let r,o=(r=function(e){let t=SP(e);if(0===t.length)return;let r=new Map;for(let[e,n]of t)r.set(e.toLowerCase(),n);return Object.fromEntries(Array.from(r.entries()).sort(([e],[t])=>e.localeCompare(t)))}(t.headers),JSON.stringify({...void 0!==t.baseURL?{baseURL:t.baseURL}:{},...void 0!==t.timeout?{timeout:t.timeout}:{},...void 0!==r?{headers:r}:{}}));if("{}"!==o){if(null!==a){if(a===o)return;let t=`${e} already configured. Existing: ${a}. New: ${o}.`;if("production"===SB())return void console.warn(t);throw Error(t)}for(let e of[n,i])void 0!==t.baseURL&&(e.defaults.baseURL=t.baseURL),void 0!==t.timeout&&(e.defaults.timeout=t.timeout),void 0!==t.headers&&function(e,t){let r=e.defaults.headers,n=r.common,i=cy.from(n);for(let[e,r]of SP(t))i.set(e,r);r.common=i.toJSON(),e.defaults.headers=r}(e,t.headers);a=o}},configureAccessTokenResolverRuntime:function(e){s=e},configureUnauthorizedHandlerRuntime:function(e){if(l=e,null===e){null!==o&&(n.interceptors.response.eject(o),o=null),u=null;return}null===o&&(o=n.interceptors.response.use(e=>e,async e=>{let t=e.config;if(e.response?.status!==401||null===l||void 0===t||t._apiRetried)return Promise.reject(e);if(null===u){let t=l;if(null===t)return Promise.reject(e);u=Promise.resolve().then(()=>t(e,{requestWithoutUnauthorizedRecovery:p})).finally(()=>{u=null})}try{if(!await u)return Promise.reject(e);t._apiRetried=!0;let r=cy.from(t.headers);return r.delete("Authorization"),t.headers=r,d(n,t)}catch{return Promise.reject(e)}}))},configureHeadersResolverRuntime:function(e){c=e},isClientConfiguredRuntime:h,assertClientConfiguredRuntime:function(){if(!h())throw Error(`${e} is not configured. Call ${t}(...) before making requests.`)},resetClientForTestsRuntime:function(){let e;if("test"!==(e=SB())&&"testing"!==e)throw Error("resetApiClientForTests() can only be called in test environment.");n=SM(r),i=SM(r),a=null,o=null,s=null,l=null,u=null,c=null},requestRuntime:f,requestWithoutUnauthorizedRecovery:p,addResponseInterceptorRuntime:function(e,t){return n.interceptors.response.use(e,t)}}}({clientName:"@vizbl/api client",configureFunctionName:"configureApiClient",defaultBaseURL:"https://api.vizbl.us"});SR.configureClientRuntime,SR.configureAccessTokenResolverRuntime,SR.configureHeadersResolverRuntime,SR.configureUnauthorizedHandlerRuntime,SR.isClientConfiguredRuntime,SR.assertClientConfiguredRuntime,SR.resetClientForTestsRuntime;let S_=SR.requestRuntime;async function SI(e){return S_(e)}SR.requestWithoutUnauthorizedRecovery,SR.addResponseInterceptorRuntime;let SO=(e={})=>[{url:"/obj/Fetch"},...e?[e]:[]];async function SL(e,t={}){let{client:r=SI,...n}=t;return(await r({method:"POST",url:"/obj/Fetch",data:e,...n})).data}async function SF(e,t={}){let{client:r=SI,...n}=t;return(await r({method:"POST",url:"/obj/GetPublic",data:e,...n})).data}var SD=JSON.parse('{"camera":{"fov":45},"floor":{"z":95.5,"pitchDeg":-87.55,"rollDeg":-165.58},"walls":[{"id":"backWall","z":382.9,"pitchDeg":-1.89,"rollDeg":18.64},{"id":"rightWall","z":313.5,"pitchDeg":0.02,"rollDeg":-70.54}]}'),SN=JSON.parse('{"camera":{"fov":45},"floor":{"z":98.1,"pitchDeg":-86.84,"rollDeg":178.03},"walls":[{"id":"backWall","z":520.5,"pitchDeg":-2.08,"rollDeg":17.51},{"id":"rightWall","z":395.0,"pitchDeg":-1.93,"rollDeg":-70.18}]}'),Sj=JSON.parse('{"camera":{"fov":45},"floor":{"z":82.1,"pitchDeg":-87.1,"rollDeg":174.1},"walls":[{"id":"backWall","z":316.2,"pitchDeg":-1.96,"rollDeg":-25.61}]}'),SH=JSON.parse('{"camera":{"fov":45},"floor":{"z":115.7,"pitchDeg":-89.36,"rollDeg":-16.93},"walls":[{"id":"backWall","z":429.6,"pitchDeg":1.97,"rollDeg":3.45},{"id":"rightWall","z":229.3,"pitchDeg":0.37,"rollDeg":-89.13}]}'),SU=JSON.parse('{"camera":{"fov":45},"floor":{"z":146.2,"pitchDeg":-89.12,"rollDeg":-51.52},"walls":[{"id":"backWall","z":400.4,"pitchDeg":0.26,"rollDeg":34.77},{"id":"rightWall","z":421.7,"pitchDeg":0.85,"rollDeg":-55.93}]}'),SG=JSON.parse('{"camera":{"fov":45},"maskUrl":"https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/room-example-4-mask.png","floor":{"z":76.41371488571167,"pitchDeg":-88.08860421180725,"rollDeg":-1.1962583474814892},"walls":[]}'),Sq=JSON.parse('{"camera":{"fov":45},"maskUrl":"https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/room-example-5-mask.png","floor":{"z":86.81210279464722,"pitchDeg":-84.67234969139099,"rollDeg":-4.7433755826205015e-2},"walls":[]}'),S$=JSON.parse('{"camera":{"fov":45},"maskUrl":"https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/room-example-6-mask.png","floor":{"z":124.4072675704956,"pitchDeg":-70.20531892776489,"rollDeg":-0.7209355384111404},"walls":[]}');let SV=new F.Vector3(1,0,0),SJ=new F.Vector3(0,1,0),SK=new F.Vector3(0,0,1);function SQ(e,t,r,n){let i=SK.clone().applyAxisAngle(SV,F.MathUtils.degToRad(t)).applyAxisAngle(SJ,F.MathUtils.degToRad(r)).applyQuaternion(n.quaternion).normalize(),a=new F.Quaternion().setFromUnitVectors(SK,i);return{position:n.position.clone().addScaledVector(i,-(e*SZ)).toArray(),quaternion:a.toArray()}}function SW(e){return{camera:e.camera,maskUrl:e.maskUrl,surfaces:[{...e.floor,id:S0},...e.walls]}}let SX=0,SY="https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/",SZ=.01,S0="floor",S1=[{id:"poster-room-example-1",name:"",image:`${SY}room-example-11.jpg`,config:SW(SD)},{id:"poster-room-example-2",name:"",image:`${SY}room-example-12.jpg`,config:SW(SN)},{id:"poster-room-example-3",name:"",image:`${SY}room-example-13.jpg`,config:SW(Sj)},{id:"poster-room-example-4",name:"",image:`${SY}room-example-14.jpg`,config:SW(SH)},{id:"poster-room-example-5",name:"",image:`${SY}room-example-15.jpg`,config:SW(SU)}],S2=[{id:"room-example-4",name:"Hallway",image:`${SY}room-example-4.png`,config:SW(SG)},{id:"room-example-5",name:"Dining room",image:`${SY}room-example-5.png`,config:SW(Sq)},{id:"room-example-6",name:"Office",image:`${SY}room-example-6.png`,config:SW(S$)}],S5=["RcSd3KphTyq_JQEjNCqKQA","gu0109ftQmS-UQkwcW010Q","nOfGLIZcRVeU93wOkHWSbg","ozzH5I2kQMW20ao-33C86A","DBA4wR-zT92vjtuOk9varg"],S3="97f6e38a-d092-41b4-ba62-1a870b54e964";function S4(){let{t:e}=nQ();return(0,ef.useMemo)(()=>[{value:0,label:e("mattingOptions.none")},{value:.05,label:`5 ${e("units.cm")}`}],[e])}let S9=(0,ef.createContext)(null);function S6({children:e,src:t,tinuuid:r,type:n,width:i,height:a,name:o}){let s=function(){let{t:e}=nQ();return(0,ef.useMemo)(()=>[{value:.025,label:`2.5 ${e("units.cm")}`},{value:.05,label:`5 ${e("units.cm")}`}],[e])}(),l=S4(),u="carpet"===n?S2:S1,[c,d]=(0,ef.useState)(u),[f,p]=(0,ef.useState)(u[0].id),h=(0,ef.useMemo)(()=>c.find(e=>e.id===f)??c[0],[c,f]),[m,v]=(0,ef.useState)(r),[g,b]=(0,ef.useState)(null),[w,y]=(0,ef.useState)(s[0].value),[x,C]=(0,ef.useState)(l[0].value),[A,S]=(0,ef.useState)(0),[k,z]=(0,ef.useState)(0),[E,M]=(0,ef.useState)(!1),[T,B]=(0,ef.useState)(null),[P,R]=(0,ef.useState)(()=>({layoutReady:!1,placementReady:!1,materialReady:!1,artifactsReady:"poster"===n,assetsReady:!1,prepareReady:"poster"===n})),_=(0,ef.useRef)(null),I="poster"!==n,O=rH({queryKey:SO({tinuuid:m??void 0}),enabled:I&&null===g&&!!m,retry:!1,queryFn:async()=>{if(!m)throw Error("Tinuuid is required.");return SL({tinuuid:m})}},rS,void 0).data??null,L=g?.native?.glbUrl??null,F=(0,ef.useCallback)(e=>{R(t=>Object.assign({},t,e))},[]);(0,ef.useEffect)(()=>{I&&(v(r),b(null))},[r,I]),(0,ef.useEffect)(()=>{I&&O&&null===g&&b(O.materials?.[0]??null)},[g,O,I]);let D=(0,ef.useMemo)(()=>({src:t,glbUrl:L,tinuuid:m,type:n,name:o,rooms:c,setRooms:d,room:h,setRoomId:p,material:g,setTinuuid:v,width:i,height:a,frameWidth:w,matting:x,angle:A,rotation:k,isDragging:E,containerRef:T,setMaterial:b,setFrameWidth:y,setMatting:C,setAngle:S,setRotation:z,setIsDragging:M,setContainerRef:B,resourceRef:_,sceneLoad:P,patchSceneLoad:F}),[t,L,m,n,o,c,h,g,i,a,w,x,A,k,T,E,P,F]);return(0,em.jsx)(S9,{value:D,children:e})}function S8(){let e=(0,ef.use)(S9);if(!e)throw Error("useRoomViewer must be used within a RoomViewerProvider");return e}function S7({className:e,...t}){return(0,em.jsx)(n6,{"data-slot":"label",className:Sm("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function ke({className:e,...t}){return(0,em.jsx)("div",{"data-slot":"field-group",className:Sm("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),...t})}let kt=cz("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function kr({className:e,orientation:t="vertical",...r}){return(0,em.jsx)("div",{role:"group","data-slot":"field","data-orientation":t,className:Sm(kt({orientation:t}),e),...r})}function kn({className:e,...t}){return(0,em.jsx)(S7,{"data-slot":"field-label",className:Sm("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e),...t})}function ki({className:e,...t}){return(0,em.jsx)("div",{"data-slot":"field-label",className:Sm("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",e),...t})}function ka({...e}){return(0,em.jsx)(o6,{"data-slot":"select",...e})}function ko({...e}){return(0,em.jsx)(st,{"data-slot":"select-value",...e})}function ks({className:e,size:t="default",children:r,...n}){return(0,em.jsxs)(o7,{"data-slot":"select-trigger","data-size":t,className:Sm("flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-background-white shadow-sm outline-none transition-colors cursor-pointer","border-border-medium","text-text-dark","hover:border-border-dark","focus-visible:border-border-dark","aria-invalid:border-border-red","disabled:cursor-not-allowed disabled:border-border-medium disabled:bg-background-base disabled:opacity-40","data-[size=default]:h-11 data-[size=default]:px-2 data-[size=default]:py-2.5 data-[size=default]:typo-base-16","data-[size=md]:h-9 data-[size=md]:px-2 data-[size=md]:py-2 data-[size=md]:typo-base-14","data-[size=sm]:h-[1.875rem] data-[size=sm]:px-2 data-[size=sm]:typo-base-12","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6 [&_svg:not([class*='text-'])]:text-text-dark",e),...n,children:[r,(0,em.jsx)(sr,{asChild:!0,children:(0,em.jsx)(Sg,{className:"size-6"})})]})}function kl({className:e,children:t,position:r="item-aligned",align:n="center",portalContainer:i,...a}){return(0,em.jsx)(sn,{container:i,children:(0,em.jsxs)(sa,{"data-slot":"select-content",className:Sm("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border bg-background-white text-text-dark shadow-md","border-border-medium","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:n,...a,children:[(0,em.jsx)(kc,{}),(0,em.jsx)(sm,{className:Sm("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,em.jsx)(kd,{})]})})}function ku({className:e,children:t,...r}){return(0,em.jsxs)(sA,{"data-slot":"select-item",className:Sm("relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md py-2.5 pr-8 pl-3 outline-hidden","typo-base-16 text-text-sub","focus:bg-background-base focus:text-text-dark","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6 [&_svg:not([class*='text-'])]:text-text-dark","*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[(0,em.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-6 items-center justify-center",children:(0,em.jsx)(sE,{children:(0,em.jsx)(Sv,{className:"size-5"})})}),(0,em.jsx)(sk,{children:t})]})}function kc({className:e,...t}){return(0,em.jsx)(sT,{"data-slot":"select-scroll-up-button",className:Sm("flex cursor-default items-center justify-center py-1",e),...t,children:(0,em.jsx)(cR,{className:"size-4"})})}function kd({className:e,...t}){return(0,em.jsx)(sP,{"data-slot":"select-scroll-down-button",className:Sm("flex cursor-default items-center justify-center py-1",e),...t,children:(0,em.jsx)(c_,{className:"size-4"})})}function kf({className:e,...t}){let{containerRef:r,material:n,setMaterial:i,setTinuuid:a}=S8(),{t:o}=nQ(),s=function({queries:e,...t},r){let n=rB(void 0),i=ef.useContext(rL),a=ef.useContext(rR),o=ef.useMemo(()=>e.map(e=>{let t=n.defaultQueryOptions(e);return t._optimisticResults=i?"isRestoring":"optimistic",t}),[e,n,i]);o.forEach(e=>{rF(e),r_(e,a)}),rI(a);let[s]=ef.useState(()=>new rG(n,o,t)),[l,u,c]=s.getOptimisticResult(o,t.combine),d=!i&&!1!==t.subscribed;ef.useSyncExternalStore(ef.useCallback(e=>d?s.subscribe(rf.batchCalls(e)):t0,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),ef.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=l.some((e,t)=>rN(o[t],e))?l.flatMap((e,t)=>{let r=o[t];if(r){let t=new rS(n,r);if(rN(r,e))return rj(r,t,a);rD(e,i)&&rj(r,t,a)}return[]}):[];if(f.length>0)throw Promise.all(f);let p=l.find((e,t)=>{let r=o[t];return r&&rO({result:e,errorResetBoundary:a,throwOnError:r.throwOnError,query:n.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(p?.error)throw p.error;return u(c())}({queries:S5.map(e=>({queryKey:SO({tinuuid:e}),queryFn:()=>SL({tinuuid:e})}))});return(0,ef.useEffect)(()=>{let e=s[0]?.data,t=e?.materials?.[0],r=e?.tinuuid;null===n&&t&&r&&(i(t),a(r))},[n,s,i,a]),(0,em.jsxs)(kr,{className:Sm("w-fit",e),...t,children:[(0,em.jsx)(kn,{className:"text-xs text-text-sub font-medium",children:o("material")}),(0,em.jsxs)(ka,{value:n?.hid??void 0,onValueChange:e=>{let t=s.find(t=>t.data?.materials?.[0]?.hid===e)?.data;if(!t?.materials?.[0]||!t.tinuuid)return;let r=t.materials[0],n=t.tinuuid;i(r),a(n)},children:[(0,em.jsx)(ks,{className:"w-[145px]",size:"md",children:(0,em.jsxs)(ko,{placeholder:o("chooseMaterial"),children:[(0,em.jsx)("div",{className:"size-5 rounded-full border border-border-light",style:{backgroundColor:`#${n?.miniature?.color?.hex}`}}),n?.miniature?.color?.name]})}),(0,em.jsx)(kl,{portalContainer:r,children:s.map(e=>{let t=e.data;if(!t?.materials?.[0]||!t.tinuuid)return null;let r=t.materials[0];return(0,em.jsxs)(ku,{value:r.hid,children:[(0,em.jsx)("div",{className:"size-5 rounded-full border border-border-light",style:{backgroundColor:`#${r?.miniature?.color?.hex}`}}),r.miniature?.color?.name]},`${t.tinuuid}-${r.hid}`)})})]})]})}function kp({className:e,...t}){return(0,em.jsx)(dc,{"data-slot":"radio-group",className:Sm("grid gap-3",e),...t})}function kh({checked:e,className:t,...r}){return(0,em.jsx)("div",{className:Sm("absolute top-1/2 left-1/2 size-6 -translate-x-1/2 -translate-y-1/2","flex items-center justify-center rounded-full",e?"bg-lime-400":"bg-background-base-2",t),...r,children:(0,em.jsx)(cI,{className:"text-constant-white size-3.5",strokeWidth:4})})}function km({className:e,variant:t="default",...r}){return(0,em.jsxs)(df,{"data-slot":"radio-group-item",className:Sm("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50","check"===t&&"size-6","inverted"===t&&"size-5 border-button-outline data-[state=checked]:border-border-red data-[state=checked]:border-4 data-[state=checked]:bg-constant-white cursor-pointer transition-all",e),...r,children:["check"===t&&(0,em.jsx)("div",{className:"relative",children:(0,em.jsx)(kh,{})}),"inverted"!==t&&(0,em.jsx)(dp,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:"check"===t?(0,em.jsx)(kh,{checked:!0}):(0,em.jsx)(cO,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})]})}let kv=cz("cursor-pointer inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-xl transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary--hover active:bg-primary--pressed disabled:bg-primary--disabled disabled:opacity-20",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary--hover active:bg-secondary--pressed disabled:bg-secondary--disabled disabled:opacity-20",outline:"border border-button-outline bg-transparent text-foreground hover:border-button-outline-hover active:bg-button-outline-pressed disabled:border-border-dark disabled:opacity-20",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent--pressed",contrast:"bg-contrast text-contrast-foreground hover:bg-contrast--hover active:bg-contrast--pressed disabled:bg-contrast--disabled disabled:opacity-30"},size:{default:"h-9 px-3.5 typo-button-normal [&_svg]:size-5",sm:"h-8 px-3 typo-button-small [&_svg]:size-4",lg:"h-11 px-4 typo-button-big [&_svg]:size-6",icon:"size-9 rounded-full [&_svg]:size-5","icon-sm":"size-8 rounded-full [&_svg]:size-4","icon-lg":"size-11 rounded-full [&_svg]:size-6"}},defaultVariants:{variant:"default",size:"default"}});function kg({className:e,variant:t,size:r,asChild:n=!1,...i}){return(0,em.jsx)(n?fc:"button",{"data-slot":"button",className:Sm(kv({variant:t,size:r,className:e})),...i})}function kb({className:e,children:t,...r}){let{className:n,onReachEnd:i,...a}=r.swiperOptions??{},{t:o}=nQ(),[s,l]=(0,ef.useState)(null),[u,c]=(0,ef.useState)(!0),[d,f]=(0,ef.useState)(!1),[p,h]=(0,ef.useState)(!1),m=(0,ef.useCallback)(e=>{c(e.isBeginning),f(e.isEnd),h(e.isLocked)},[]),v=(0,ef.useCallback)(e=>{l(e),m(e)},[m]),g=(0,ef.useCallback)(e=>{f(!0),i?.(e)},[i]);return(0,em.jsxs)("div",{className:Sm("relative w-full overflow-hidden",e),children:[(0,em.jsx)(fa,{className:Sm("w-full py-5",n),slidesPerView:"auto",slidesPerGroup:2,onSwiper:v,onReachBeginning:()=>c(!0),onReachEnd:g,onFromEdge:m,onLock:()=>h(!0),onUnlock:()=>h(!1),onResize:m,slidesOffsetBefore:24,slidesOffsetAfter:24,spaceBetween:12,...a,children:t}),(0,em.jsxs)(kg,{className:Sm("absolute top-1/2 left-8 -translate-y-1/2 z-1",{hidden:u||p}),variant:"contrast",size:"icon",onClick:()=>s?.slidePrev(),children:[(0,em.jsx)(cL,{}),(0,em.jsx)("span",{className:"sr-only",children:o("previousSlide")})]}),(0,em.jsxs)(kg,{className:Sm("absolute top-1/2 right-8 -translate-y-1/2 z-1",{hidden:d||p}),variant:"contrast",size:"icon",onClick:()=>s?.slideNext(),children:[(0,em.jsx)(cF,{}),(0,em.jsx)("span",{className:"sr-only",children:o("nextSlide")})]})]})}function kw(e){return e.hid??""}function ky({className:e,...t}){let{material:r,tinuuid:n,setMaterial:i,setTinuuid:a}=S8(),o=r?kw(r):"",s=SE("(max-width: 640px)"),{data:l,isFetchingNextPage:u,fetchNextPage:c,hasNextPage:d}=rH({queryKey:["room-viewer","carpet-materials",S3],queryFn:({pageParam:e})=>SF({page:e,owners:[S3]}),initialPageParam:1,getNextPageParam:(e,t,r)=>{if(e.objs?.length)return r+1},getPreviousPageParam:(e,t,r)=>{if(!(r<=1))return r-1}},rJ,void 0),f=(0,ef.useMemo)(()=>l?.pages.flatMap(e=>e.objs??[])??[],[l]),p=f.find(e=>e.tinuuid===n),h=f.find(e=>e.tinuuid&&e.materials?.[0]);(0,ef.useEffect)(()=>{if(null!==r)return;let e=p??h,t=e?.materials?.[0];e&&t&&e.tinuuid&&(i(t),a(e.tinuuid))},[h,p,r,i,a]);let m=(0,ef.useCallback)(()=>{d&&!u&&c()},[c,d,u]);return(0,em.jsx)("div",{className:Sm(e),...t,children:(0,em.jsx)(kp,{value:o||void 0,onValueChange:e=>{let t=f.find(t=>t.materials?.some(t=>kw(t)===e)),r=t?.materials?.find(t=>kw(t)===e);t&&r&&t.tinuuid&&(i(r),a(t.tinuuid))},children:(0,em.jsx)(kb,{swiperOptions:{onReachEnd:m,className:"py-2 sm:py-5"},children:f.flatMap(e=>e.materials?.map(t=>{let r=kw(t);return e.tinuuid?(0,em.jsx)(fo,{className:Sm("sm:w-25! w-18! transition-transform duration-200",r!==o&&"hover:scale-110"),children:(0,em.jsxs)(kn,{htmlFor:`material-${r}`,className:"size-full flex flex-col gap-1 has-data-[state=checked]:bg-transparent",children:[(0,em.jsxs)("div",{className:"size-full relative sm:h-19 h-13 rounded-[0.75rem] overflow-hidden grid place-items-center sm:block",children:[(0,em.jsx)("img",{src:t.previews?.[0]?.subRes?.small??t.previews?.[0]?.url,alt:t.name??"",className:"size-full object-cover"}),(0,em.jsx)(km,{value:r,id:`material-${r}`,variant:"check",className:Sm("absolute sm:top-1.75 sm:right-1.75",{"sr-only":r!==o})})]}),!s&&(0,em.jsx)("span",{className:Sm("block w-full text-xs text-left text-text-light truncate",{"text-text-dark":r===o}),children:t.name})]})},`${e.tinuuid}-${r}`):null})??[])})})})}let kx=(0,ef.createContext)(null),kC=(0,ef.createContext)(null);function kA({value:e,defaultValue:t,onValueChange:r,...n}){let[i,a]=(0,ef.useState)(t),o=e??i,s=(0,ef.useMemo)(()=>({value:o}),[o]),l=(0,ef.useCallback)(t=>{r?.(t),void 0===e&&a(t)},[r,e]);return(0,em.jsx)(kx,{value:s,children:(0,em.jsx)(f_,{"data-slot":"tabs",value:o,onValueChange:l,...n})})}let kS=cz("cursor-pointer group inline-flex items-center justify-center shrink-0 whitespace-nowrap outline-none transition-colors relative z-10 text-text-base [&_svg]:text-icons-normal [&_svg]:transition-colors hover:text-text-dark hover:[&_svg]:text-icons-dark active:bg-background-base-3 active:text-text-dark active:[&_svg]:text-icons-dark data-[state=active]:bg-background-white data-[state=active]:text-text-dark data-[state=active]:[&_svg]:text-icons-dark disabled:pointer-events-none disabled:opacity-50 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",{variants:{size:{default:"h-7 rounded-lg px-2 typo-button-normal active:rounded-lg data-[state=active]:rounded-lg [&_svg]:size-4",sm:"h-6 rounded-[4px] px-2 typo-button-small active:rounded-lg data-[state=active]:rounded-lg [&_svg]:size-4",lg:"h-9 rounded-lg px-3 typo-button-big active:rounded-lg data-[state=active]:rounded-lg [&_svg]:size-6"}},defaultVariants:{size:"default"}}),kk=cz("relative inline-flex items-center rounded-xl bg-background-base-2",{variants:{size:{default:"p-1",sm:"p-[3px]",lg:"p-1"}},defaultVariants:{size:"default"}});function kz({className:e,children:t,size:r="default",...n}){let i=(0,ef.use)(kx),a=(0,ef.useRef)(null),o=(0,ef.useRef)(new Map),s=(0,ef.useRef)(null),l=(0,ef.useRef)(i?.value),u=(0,ef.useRef)(null),c=(0,ef.useCallback)(()=>{u.current=null;let e=s.current;if(!e)return;let t=l.current;if(!t){e.style.opacity="0";return}let r=a.current,n=o.current.get(t);if(!r||!n){e.style.opacity="0";return}let i=Math.round(n.offsetLeft),c=Math.round(n.offsetTop),d=Math.round(n.offsetWidth),f=Math.round(n.offsetHeight);e.style.transform=`translate3d(${i}px, ${c}px, 0)`,e.style.width=`${d}px`,e.style.height=`${f}px`,e.style.opacity="1"},[]),d=(0,ef.useCallback)(()=>{null===u.current&&(u.current=requestAnimationFrame(()=>{c()}))},[c]),f=(0,ef.useCallback)((e,t)=>{t?o.current.set(e,t):o.current.delete(e),d()},[d]);(0,ef.useLayoutEffect)(()=>{l.current=i?.value,null!==u.current&&(cancelAnimationFrame(u.current),u.current=null),c()},[i?.value,c]),(0,ef.useEffect)(()=>{let e=a.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(()=>d());t.observe(e);let r=i?.value;if(r){let e=o.current.get(r);e&&t.observe(e)}return()=>{t.disconnect()}},[d,i?.value]),(0,ef.useEffect)(()=>()=>{null!==u.current&&cancelAnimationFrame(u.current)},[]);let p=(0,ef.useMemo)(()=>({registerTrigger:f,size:r}),[f,r]);return(0,em.jsx)(fO,{ref:a,"data-slot":"tabs-list",className:Sm(kk({size:r}),e),...n,children:(0,em.jsxs)(kC,{value:p,children:[(0,em.jsx)("div",{ref:s,"aria-hidden":!0,"data-slot":"tabs-indicator",className:"pointer-events-none absolute top-0 left-0 z-0 rounded-lg bg-background-white opacity-0 transition-[transform,width,height,opacity] duration-[250ms] ease-out motion-reduce:transition-none"}),t]})})}function kE({className:e,size:t,children:r,value:n,...i}){let a=(0,ef.use)(kC),o=(0,ef.useRef)(null),s=t??a?.size??"default",l=Sm("relative z-10 inline-flex items-center justify-center","lg"===s?"gap-1.5":"gap-1");return(0,ef.useLayoutEffect)(()=>{if(a&&n)return a.registerTrigger(n,o.current),()=>{a.registerTrigger(n,null)}},[a,n]),(0,em.jsx)(fF,{ref:o,"data-slot":"tabs-trigger",className:Sm(kS({size:s}),"data-[state=active]:bg-transparent",e),value:n,...i,children:(0,em.jsx)("span",{"data-slot":"tabs-trigger-content",className:l,children:r})})}function kM({className:e,...t}){let{matting:r,setMatting:n}=S8(),{t:i}=nQ(),a=S4();return(0,em.jsxs)(kr,{className:Sm("w-fit",e),...t,children:[(0,em.jsx)(kn,{className:"text-xs text-text-sub font-medium",children:i("matting")}),(0,em.jsx)(kA,{value:r.toString(),onValueChange:e=>n(Number(e)),children:(0,em.jsx)(kz,{children:a.map(e=>(0,em.jsx)(kE,{value:e.value.toString(),children:e.label},e.value))})})]})}function kT({className:e,...t}){let{t:r}=nQ(),{rooms:n,room:i,setRoomId:a,setRooms:o,type:s}=S8(),l=SE("(max-width: 640px)"),u=(0,ef.useId)(),c=(0,ef.useCallback)((e,t)=>r(`rooms.${t}`,{defaultValue:e}),[r]),d=(0,ef.useCallback)(e=>{let t=e.target.files?.[0];if(e.target.value="",!t)return;let r=URL.createObjectURL(t),n={id:(SX+=1,`room-custom-${SX}`),name:t.name,image:r,config:{camera:{fov:45},surfaces:[{id:S0,z:0,pitchDeg:-90,rollDeg:0}]}};o(e=>[n,...e]),a(n.id)},[a,o]);return(0,em.jsx)("div",{className:Sm(e),...t,children:(0,em.jsx)(kp,{value:i.id,onValueChange:a,children:(0,em.jsxs)(kb,{swiperOptions:{className:"py-2 sm:py-5 pb-3 sm:pb-5"},children:["carpet"===s&&(0,em.jsx)(fo,{className:"sm:w-25! w-21! h-auto",children:(0,em.jsxs)(kn,{htmlFor:u,className:Sm("flex size-full cursor-pointer items-center justify-center rounded-[0.75rem] border border-dashed border-muted-foreground/40 bg-transparent px-2 text-center text-xs leading-tight text-muted-foreground transition-colors hover:border-foreground/40 hover:text-foreground"),children:[r("uploadOwnPhoto"),(0,em.jsx)("input",{id:u,type:"file",accept:"image/*",className:"sr-only",onChange:d})]})}),n.map(e=>(0,em.jsx)(fo,{className:Sm("sm:w-25! w-21! transition-transform duration-200",e.id!==i.id&&"hover:scale-110"),children:(0,em.jsxs)(kn,{htmlFor:`room-${e.id}`,className:"size-full flex flex-col gap-1 has-data-[state=checked]:bg-transparent",children:[(0,em.jsxs)("div",{className:"size-full relative h-17 sm:h-19 rounded-[0.75rem] overflow-hidden",children:[(0,em.jsx)("img",{src:e.image,alt:c(e.name,e.id),className:"size-full object-cover",crossOrigin:"anonymous"}),(0,em.jsx)(km,{value:e.id,id:`room-${e.id}`,variant:"check",className:Sm("absolute top-1.75 right-1.75",{"sr-only":e.id!==i.id})})]}),"carpet"===s&&!l&&(0,em.jsx)("span",{className:Sm("block w-full text-xs text-left text-text-light truncate",{"text-text-dark":e.id===i.id}),children:c(e.name,e.id)})]})},e.id))]})})})}function kB({className:e,...t}){let{type:r}=S8(),n=SE("(max-width: 640px)");return(0,em.jsxs)("div",{className:Sm("flex sm:items-end pl-0 overflow-hidden sm:flex-row flex-col py-3 sm:py-0",e),...t,children:[(0,em.jsx)(kT,{className:Sm("shrink-0",{"sm:min-w-120.5 min-w-full":"carpet"===r,grow:"poster"===r})}),"poster"===r&&(0,em.jsxs)("div",{className:"hidden gap-5 pr-6 pb-5 md:flex",children:[(0,em.jsx)(kf,{}),(0,em.jsx)(kM,{})]}),"carpet"===r&&(0,em.jsxs)(em.Fragment,{children:[!n&&(0,em.jsx)(Sk,{orientation:"vertical"}),(0,em.jsx)(ky,{})]})]})}function kP({className:e,...t}){let{t:r}=nQ();return(0,em.jsxs)("div",{className:Sm("group inline-flex gap-2 text-sm text-muted-foreground","hover:text-text-dark","transition-colors duration-200 ease-in-out",e),...t,children:[(0,em.jsx)("div",{className:"size-5 flex items-center justify-center rounded-full bg-icons-light group-hover:bg-icons-red transition-colors duration-200 ease-in-out",children:(0,em.jsx)(SC,{className:"size-4.25 text-icons-white"})}),r("poweredBy")]})}function kR({className:e,...t}){let{name:r}=S8();return(0,em.jsxs)("div",{className:Sm("h-16 grid gap-5 items-center px-6 sm:grid-cols-3",e),...t,children:[(0,em.jsx)("div",{className:"truncate",children:r}),(0,em.jsx)("div",{className:"hidden justify-center sm:flex",children:(0,em.jsx)(kP,{})}),(0,em.jsx)("div",{className:"hidden sm:block"})]})}function k_({...e}){return(0,em.jsx)(sV,{"data-slot":"popover",...e})}function kI({...e}){return(0,em.jsx)(sQ,{"data-slot":"popover-trigger",...e})}function kO({className:e,align:t="center",sideOffset:r=4,portalContainer:n,...i}){return(0,em.jsx)(sZ,{container:n,children:(0,em.jsx)(s1,{"data-slot":"popover-content",align:t,sideOffset:r,className:Sm("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...i})})}function kL({className:e,defaultValue:t,value:r,min:n=0,max:i=100,variant:a="default","aria-label":o,"aria-labelledby":s,...l}){let u=(0,ef.useMemo)(()=>Array.isArray(r)?r:Array.isArray(t)?t:[n],[r,t,n]);return(0,em.jsxs)(lu,{"data-slot":"slider",defaultValue:t,value:r,min:n,max:i,"data-variant":a,"aria-label":o,"aria-labelledby":s,className:Sm("relative flex w-full touch-none cursor-pointer items-center select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...l,children:[(0,em.jsx)(lv,{"data-slot":"slider-track",className:Sm("relative grow overflow-hidden rounded-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5","editor"===a?"bg-border-light data-[orientation=horizontal]:h-0.5":"bg-muted data-[orientation=horizontal]:h-1.5"),children:(0,em.jsx)(lb,{"data-slot":"slider-range",className:Sm("absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full","editor"===a?"bg-background-blue":"bg-primary")})}),Array.from({length:u.length},(e,t)=>(0,em.jsx)(ly,{"data-slot":"slider-thumb","aria-label":o,"aria-labelledby":s,className:Sm("ring-ring/50 block shrink-0 rounded-full border bg-white transition-[color,box-shadow] focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50","editor"===a?"size-3 border-background-blue shadow-none hover:ring-2 focus-visible:ring-2":"size-4 border-primary shadow-sm hover:ring-4 focus-visible:ring-4")},t))]})}function kF({...e}){return(0,em.jsx)(pX,{"data-slot":"dialog",...e})}function kD({...e}){return(0,em.jsx)(p2,{"data-slot":"dialog-portal",...e})}function kN({...e}){return(0,em.jsx)(hs,{"data-slot":"dialog-close",...e})}function kj({className:e,...t}){return(0,em.jsx)(p3,{"data-slot":"dialog-overlay",className:Sm("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function kH({className:e,children:t,showCloseButton:r=!0,portalContainer:n,...i}){return(0,em.jsxs)(kD,{"data-slot":"dialog-portal",container:n,children:[(0,em.jsx)(kj,{}),(0,em.jsxs)(p8,{"data-slot":"dialog-content",className:Sm("bg-background-containers data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-6 rounded-3xl border-0 p-6 shadow-[var(--shadow-login)] duration-200 outline-none sm:max-w-120 sm:p-10",e),...i,children:[t,r&&(0,em.jsxs)(hs,{"data-slot":"dialog-close",className:"focus-visible:ring-ring/30 absolute top-4 right-4 inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-icons-light transition-colors hover:text-icons-normal focus-visible:text-icons-dark focus-visible:ring-2 focus-visible:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[(0,em.jsx)(cD,{className:"size-6"}),(0,em.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function kU({className:e,...t}){return(0,em.jsx)("div",{"data-slot":"dialog-header",className:Sm("flex flex-col gap-2 text-left",e),...t})}function kG({className:e,...t}){return(0,em.jsx)(hn,{"data-slot":"dialog-title",className:Sm("typo-base-18 text-text-dark",e),...t})}function kq({className:e,...t}){return(0,em.jsx)(ha,{"data-slot":"dialog-description",className:Sm("typo-base-16 text-text-light",e),...t})}kz.displayName=fO.displayName,kE.displayName=fF.displayName,fN.displayName;let k$=/oklch\(([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\)/;function kV(e,t){let r=e.match(k$);return r?{l:Number.parseFloat(r[1]),c:Number.parseFloat(r[2]),h:Number.parseFloat(r[3])}:{l:t[0],c:t[1],h:t[2]}}function kJ({data:e,foreground:t,background:r,robustness:n="M",className:i,...a}){let[o,s]=(0,ef.useState)(null);return((0,ef.useEffect)(()=>{(async()=>{try{let i=getComputedStyle(document.documentElement),a=t??i.getPropertyValue("--foreground"),o=r??i.getPropertyValue("--background"),l=kV(a,[.21,.006,285.885]),u=kV(o,[.985,0,0]),c=await vK.toString(e,{type:"svg",color:{dark:vV(vJ({mode:"oklch",...l})),light:vV(vJ({mode:"oklch",...u}))},width:200,errorCorrectionLevel:n,margin:0});s(c)}catch(e){console.error(e)}})()},[e,t,r,n]),o)?(0,em.jsx)("div",{className:Sm("size-full","[&_svg]:size-full",i),dangerouslySetInnerHTML:{__html:o},...a}):null}let kK=new wP,kQ=kK.getDevice(),kW=kK.getOS(),kX="iOS"===kW.name,kY="Android"===kW.name,kZ="mobile"===kQ.type;function k0({className:e,...t}){let{src:r,tinuuid:n,type:i,width:a,height:o,name:s,containerRef:l,resourceRef:u}=S8(),{t:c,i18n:d}=nQ(),[f,p]=(0,ef.useState)(""),[h,m]=(0,ef.useState)(""),[v,g]=(0,ef.useState)(!1),[b,w]=(0,ef.useState)(!1),y=(0,ef.useRef)(null),x=d.resolvedLanguage??d.language,C=(0,ef.useMemo)(()=>{if("carpet"===i&&n){let e=new URL("https://integrations.vizbl.com/room-viewer");return e.searchParams.set("type",i),e.searchParams.set("tinuuid",n),e.searchParams.set("name",s),e.searchParams.set("language",x),e.toString()}let e=new URL("https://viewer.vizbl.com/poster/app/index.html");return e.searchParams.set("texture",r),e.searchParams.set("texture_width",(100*a).toString()),e.searchParams.set("texture_height",(100*o).toString()),decodeURIComponent(e.toString())},[r,n,i,a,o,s,x]),A=(0,ef.useMemo)(()=>{if(!n)return null;let e=new URL("https://appclip.apple.com/id");return e.searchParams.set("p","com.us.vizbl.Clip"),e.searchParams.set("tinuuid",n),e.toString()},[n]),S=async()=>{if("carpet"===i)return n?kX&&A?void window.location.assign(A):void g(!0):void 0;let e=y.current,t=u.current;if(e&&t)if(e.canActivateAR)try{w(!0);let e=t.clone(!0);if(e.position.set(0,0,0),kX){let t=new g_,r=await t.parseAsync(e),n=new File([r],"scene.usdz",{type:"model/vnd.usdz+zip"});p(URL.createObjectURL(n))}else{let t=new gG,r=await t.parseAsync(e,{binary:!0}),n=new File([r],"scene.glb",{type:"model/gltf-binary"});m(URL.createObjectURL(n))}}finally{w(!1)}else g(!0)};return((0,ef.useEffect)(()=>((""!==f||""!==h)&&y.current?.activateAR(),()=>{""!==f&&URL.revokeObjectURL(f),""!==h&&URL.revokeObjectURL(h)}),[f,h]),kY&&kZ||"carpet"===i&&!n)?null:(0,em.jsxs)("div",{className:Sm(e),...t,children:[(0,em.jsx)(kg,{variant:"contrast",disabled:b,onClick:S,children:c("ar.viewInPlace")}),(0,em.jsx)(kF,{open:v,onOpenChange:g,children:(0,em.jsxs)(kH,{className:"gap-6 sm:max-w-120",showCloseButton:!1,portalContainer:l,children:[(0,em.jsx)("div",{className:"flex items-center justify-center p-10 bg-constant-white rounded-2xl",children:(0,em.jsx)(kJ,{className:"size-48",robustness:"H",data:C})}),(0,em.jsx)("p",{className:"text-lg text-center text-text-sub font-medium",children:c("ar.scanQrCode")}),(0,em.jsx)(kN,{asChild:!0,children:(0,em.jsx)(kg,{variant:"contrast",size:"lg",children:c("close")})})]})}),(0,em.jsx)("model-viewer",{ref:y,className:"fixed w-px h-px opacity-0 pointer-events-none",src:h,iosSrc:f,reveal:"manual",ar:!0,cameraControls:!0,arPlacement:"wall",arModes:"webxr",arScale:"fixed",shadowIntensity:1,interactionPromptThreshold:100})]})}let k1={width:void 0,height:void 0};function k2(e,t,r){return e[t]?Array.isArray(e[t])?e[t][0][r]:e[t][r]:"contentBoxSize"===t?e.contentRect["inlineSize"===r?"width":"height"]:void 0}async function k5(e,t){return new Promise((r,n)=>{e.toBlob(e=>{e?r(e):n(Error(t))},"image/png")})}function k3({ref:e}){let{camera:t,gl:r,invalidate:n,scene:i}=xr();return(0,ef.useImperativeHandle)(e,()=>({capture:async()=>(n(),await new Promise(e=>requestAnimationFrame(()=>e())),r.render(i,t),k5(r.domElement,"Failed to create scene share image"))}),[t,r,n,i]),null}function k4(e){return 2===e||3===e}function k9(e,t,r){let n=SQ(e.z,e.pitchDeg,e.rollDeg,r),i=function(e){let t=0,r=0,n=0;for(let i=0;i<e.height;i++)for(let a=0;a<e.width;a++)k4(e.classes[i*e.width+a])&&(t+=a+.5,r+=i+.5,n+=1);return 0===n?null:{x:t/n,y:r/n}}(t);if(!i)return null;let a=new F.Quaternion(...n.quaternion),o=new F.Vector3(0,0,1).applyQuaternion(a).normalize(),s=new F.Vector3(...n.position),l=i.x/t.width*2-1,u=1-i.y/t.height*2,c=new F.Raycaster;c.setFromCamera(new F.Vector2(l,u),r);let d=new F.Plane().setFromNormalAndCoplanarPoint(o,s),f=c.ray.intersectPlane(d,new F.Vector3);return f?(f.addScaledVector(o,.05),{position:f.toArray(),quaternion:n.quaternion}):null}function k6(e){return new Promise((t,r)=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>t(n),n.onerror=()=>r(Error(`Failed to load image from ${e}`)),n.src=e})}function k8(e,t,r){let n=document.createElement("canvas");n.width=t,n.height=r;let i=n.getContext("2d");if(!i)throw Error("Failed to get 2D context for segmentation mask.");let a=i.createImageData(t,r),o=t*r;for(let t=0;t<o;t++){let r=k4(e[t]);a.data[4*t]=255,a.data[4*t+1]=255,a.data[4*t+2]=255,a.data[4*t+3]=255*!!r}return i.putImageData(a,0,0),n}async function k7(e){let t=await k6(e),r=document.createElement("canvas");r.width=t.naturalWidth||t.width,r.height=t.naturalHeight||t.height;let n=r.getContext("2d");if(!n)throw Error("Failed to get 2D context for segmentation mask.");n.drawImage(t,0,0);let{width:i,height:a}=r,o=n.getImageData(0,0,i,a),s=new Uint8Array(i*a);for(let e=0;e<s.length;e++){let t=o.data[4*e+3];s[e]=2*(t>127)}return{segmentationClasses:{classes:s,width:i,height:a}}}async function ze(e){let t=k8(e.classes,e.width,e.height),r=await k5(t,"Failed to serialize segmentation mask PNG.");return URL.createObjectURL(r)}async function zt(e){let t=await new Promise((t,r)=>{let n=new FileReader,i=new ArrayBuffer(e.byteLength);new Uint8Array(i).set(e),n.onerror=()=>{r(Error("Failed to encode carpet inference payload."))},n.onload=()=>{if("string"!=typeof n.result)return void r(Error("Failed to encode carpet inference payload."));let e=n.result.indexOf(",");t(e>=0?n.result.slice(e+1):n.result)},n.readAsDataURL(new Blob([i]))}),r=await fetch("https://api.vizbl.com/inference/carpet/run-raw",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!r.ok){let e=await r.text();throw Error(`Carpet inference request failed: ${r.status} ${r.statusText}${e?` - ${e}`:""}`)}return r.json()}async function zr(e){let t=function(e){let t=document.createElement("canvas");t.width=512,t.height=512;let r=t.getContext("2d");if(!r)throw Error("Failed to get 2D context for carpet inference input.");r.drawImage(e,0,0,512,512);let n=r.getImageData(0,0,512,512),i=function(e){let t={R:0,G:1,B:2},r="GBR".split("");if(3!==r.length||r.some(e=>!(e in t)))throw Error("Unsupported carpet inference input channel order: GBR");return r.map(e=>t[e])}(0),a=new Uint8Array(786432);for(let e=0,t=0;e<1048576;e+=4,t+=3)a[t]=n.data[e+i[0]],a[t+1]=n.data[e+i[1]],a[t+2]=n.data[e+i[2]];return a}(await k6(e)),r=await zt(t),n=function(e){let t=function(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}(e);if(262144!==t.length)throw Error(`Unsupported segmentation classes length: ${t.length}`);return{classes:t,width:512,height:512}}(r.segmentationClasses);return{segmentationClasses:n,floor:{z:400*Number(r.deltaZ??0),pitchDeg:-(90*Number(r.pitch??0)),rollDeg:45*Number(r.roll??0)}}}function zn(e){let t=e.getContext("2d");if(!t)throw Error("Failed to get 2D context for carpet lighting map.");return t}function zi(e,t){let r=document.createElement("canvas");return r.width=e,r.height=t,r}function za(e,t){let r=zi(e,t),n=zn(r),i=n.createImageData(e,t);for(let r=0;r<e*t;r++){let e=4*r;i.data[e]=128,i.data[e+1]=128,i.data[e+2]=128,i.data[e+3]=255}return n.putImageData(i,0,0),r}function zo(e){let t=new Uint8ClampedArray(e.width*e.height);for(let r=0;r<t.length;r++){let n=4*r,i=e.data[n],a=e.data[n+1],o=e.data[n+2];t[r]=Math.round(.299*i+.587*a+.114*o)}return t}function zs(e,t,r,n,i){let a=function(e,t,r){let n=zi(t,r),i=zn(n),a=i.createImageData(t,r);for(let n=0;n<t*r;n++){let t=Math.max(0,Math.min(255,Math.round(Number(e[n]??0)))),r=4*n;a.data[r]=t,a.data[r+1]=t,a.data[r+2]=t,a.data[r+3]=255}return i.putImageData(a,0,0),n}(e,t,r),o=zn(zi(n,i));return o.imageSmoothingEnabled=!0,o.drawImage(a,0,0,n,i),zo(o.getImageData(0,0,n,i))}function zl(e,t){let r=new Float32Array(e.length);for(let n=0;n<e.length;n++)r[n]=Number(e[n]??0)*(Number(t[n]??0)/255);return r}function zu(e,t){let r=new Uint8ClampedArray(e.length);for(let n=0;n<e.length;n++){let i=Number(t[n]??0)/255;if(i<=1e-4){r[n]=0;continue}let a=Number(e[n]??0)/i;r[n]=Math.max(0,Math.min(255,Math.round(a)))}return r}function zc(e){return 2===e||3===e}async function zd(e,t,r={}){let{width:n,height:i,classes:a}=t;if(n<=0||i<=0||0===a.length)return za(n,i);let o=await k6(e),s=zn(zi(n,i));s.drawImage(o,0,0,n,i);let l=zo(s.getImageData(0,0,n,i)),u=function(e){let t=new Uint8ClampedArray(e.length);for(let r=0;r<e.length;r++)t[r]=255*!!zc(e[r]);return t}(a),c=Math.max(1,Math.round(r.scaleDiv??8)),d=Math.max(1,Math.round(r.filterDiameter??4)),f=r.sigmaColor??70,p=r.sigmaSpace??70,h=Math.max(1,Math.round(n/c)),m=Math.max(1,Math.round(i/c)),v=zs(zl(l,u),n,i,h,m),g=zs(u,n,i,h,m),b=zs(zl(function(e,t,r,n,i,a,o){let s=new Uint8ClampedArray(e.length),l=Math.max(1,Math.floor(n/2)),u=Math.max(1,i),c=Math.max(1,a),d=2*u*u,f=2*c*c,p=new Float32Array((2*l+1)*(2*l+1)),h=0;for(let e=-l;e<=l;e++)for(let t=-l;t<=l;t++){let r=t*t+e*e;p[h]=Math.exp(-r/f),h+=1}for(let n=0;n<r;n++)for(let i=0;i<t;i++){let a=n*t+i;if(Number(o?.[a]??255)/255<=1e-4){s[a]=0;continue}let u=e[a],c=0,f=0,h=0;for(let a=-l;a<=l;a++){let s=Math.max(0,Math.min(r-1,n+a));for(let r=-l;r<=l;r++){let n=Math.max(0,Math.min(t-1,i+r)),a=s*t+n,l=Number(o?.[a]??255)/255;if(l<=1e-4){h+=1;continue}let m=e[a],v=m-u,g=Math.exp(-(v*v)/d),b=p[h]*g*l;c+=b,f+=m*b,h+=1}}s[a]=c>0?Math.round(f/c):u}return s}(zu(v,g),h,m,d,f,p,g),g),h,m,n,i),w=zu(b,zs(g,h,m,n,i)),y=0,x=0;for(let e=0;e<a.length;e++)zc(a[e])&&(x+=w[e],y+=1);if(0===y)return za(n,i);let C=x/y,A=function(e,t,r){let n=1/0,i=-1/0;for(let r=0;r<t.length;r++){if(!zc(t[r]))continue;let a=e[r];n=Math.min(n,a),i=Math.max(i,a)}return Number.isFinite(n)&&Number.isFinite(i)?{maxBrightnessDelta:Math.max(0,i-r),maxShadowDelta:Math.max(0,r-n)}:{maxBrightnessDelta:0,maxShadowDelta:0}}(w,a,C);if(A.maxBrightnessDelta<=0&&A.maxShadowDelta<=0)return za(n,i);let S=zi(n,i),k=zn(S),z=k.createImageData(n,i);for(let e=0;e<a.length;e++){let t=4*e,r=128;zc(a[e])&&(r=function(e,t){if(0===e)return 128;let r=e<0,n=r?t.maxShadowDelta:t.maxBrightnessDelta;return n<=0?128:Math.max(0,Math.min(255,Math.round(255*(.5+e/n*.5*(r?1.15:.8)))))}(w[e]-C,A)),z.data[t]=r,z.data[t+1]=r,z.data[t+2]=r,z.data[t+3]=255}return k.putImageData(z,0,0),S}let zf="uRoomMask",zp="uRoomLightingMap",zh="uRoomLightingStrength",zm="uRoomMaskResolution",zv="uRoomMaskTextureSize";function zg(e,t=F.LinearFilter,r=F.LinearFilter){let n=new F.CanvasTexture(e);return n.needsUpdate=!0,n.minFilter=t,n.magFilter=r,n.generateMipmaps=!1,n}async function zb(e,t,r,n){"function"==typeof e.compileAsync?await e.compileAsync(t,r,n):e.compile(t,r,n)}let zw=Math.PI/2;function zy({glbUrl:e,position:t,quaternion:r,maskCanvas:n,lightingCanvas:i}){let{resourceRef:a,rotation:o,setIsDragging:s,patchSceneLoad:l}=S8(),{gl:u,size:c,camera:d,scene:f,invalidate:p}=xr(),h=xJ(e),m=(0,ef.useRef)(null),v=(0,ef.useRef)(null),g=(0,ef.useRef)(null),b=(0,ef.useRef)(null),w=(0,ef.useRef)(null);null===m.current&&(m.current=new F.Vector2(1,1)),null===v.current&&(v.current=new F.Vector2(1,1));let y=m.current,x=v.current,C=(0,ef.useMemo)(()=>h.scene.clone(!0),[h]),A=(0,ef.useMemo)(()=>F.MathUtils.degToRad(o),[o]),S=(0,ef.useCallback)(()=>{s(!0)},[s]),k=(0,ef.useCallback)(()=>{s(!1)},[s]);return(0,ef.useLayoutEffect)(()=>{let e=zg(n,F.NearestFilter,F.NearestFilter);return g.current=e,x.set(Math.max(1,n.width),Math.max(1,n.height)),()=>{g.current===e&&(g.current=null),e.dispose()}},[n,x]),(0,ef.useLayoutEffect)(()=>{let e=zg(i);return b.current=e,()=>{b.current===e&&(b.current=null),e.dispose()}},[i]),(0,ef.useLayoutEffect)(()=>{let e,t=(e=new Set,C.traverse(t=>{if(!t.isMesh||!t.material)return;if(Array.isArray(t.material)){let r=t.material.map(t=>{let r=t.clone();return e.add(r),r});t.material=r;return}let r=t.material.clone();e.add(r),t.material=r}),Array.from(e));return w.current=t,()=>{w.current===t&&(w.current=null),t.forEach(e=>e.dispose())}},[C]),(0,ef.useLayoutEffect)(()=>{u.getDrawingBufferSize(y),y.set(Math.max(1,y.x),Math.max(1,y.y))},[u,y,c.width,c.height]),(0,ef.useLayoutEffect)(()=>{let e=g.current,t=b.current,r=w.current;if(!e||!t||!r)return;let n=r.map(r=>{let n,i,a;return n=r.onBeforeCompile,i=r.customProgramCacheKey.bind(r),a=r.transparent,r.onBeforeCompile=(i,a)=>{n?.call(r,i,a),i.uniforms[zf]={value:e},i.uniforms[zp]={value:t},i.uniforms[zh]={value:.18},i.uniforms[zm]={value:y},i.uniforms[zv]={value:x},i.fragmentShader=i.fragmentShader.replace("#include <common>",`
|
|
146
|
+
`;class A_ extends F.ShaderMaterial{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:r,gainMapMin:n,gainMapMax:i,maxDisplayBoost:a,hdrCapacityMin:o,hdrCapacityMax:s,sdr:l,gainMap:u}){super({name:"GainMapDecoderMaterial",vertexShader:AP,fragmentShader:AR,uniforms:{sdr:{value:l},gainMap:{value:u},gamma:{value:new F.Vector3(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new F.Vector3().fromArray(t)},offsetSdr:{value:new F.Vector3().fromArray(r)},gainMapMin:{value:new F.Vector3().fromArray(n)},gainMapMax:{value:new F.Vector3().fromArray(i)},weightFactor:{value:(Math.log2(a)-o)/(s-o)}},blending:F.NoBlending,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=a,this._hdrCapacityMin=o,this._hdrCapacityMax=s,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){let e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){let t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){let e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}er={renderer:F.WebGLRenderer,createMaterial:e=>new A_(e),createQuadRenderer:e=>new AA(e)},e=>{let{sdr:t,gainMap:r,renderer:n}=e;t.colorSpace!==F.SRGBColorSpace&&(console.warn("SDR Colorspace needs to be *SRGBColorSpace*, setting it automatically"),t.colorSpace=F.SRGBColorSpace),t.needsUpdate=!0,r.colorSpace!==F.LinearSRGBColorSpace&&(console.warn("Gainmap Colorspace needs to be *LinearSRGBColorSpace*, setting it automatically"),r.colorSpace=F.LinearSRGBColorSpace),r.needsUpdate=!0;let i=er.createMaterial({...e,sdr:t,gainMap:r});return er.createQuadRenderer({width:t.image.width,height:t.image.height,type:F.HalfFloatType,colorSpace:F.LinearSRGBColorSpace,material:i,renderer:n,renderTargetOptions:e.renderTargetOptions})};class AI extends AB{constructor(e,t){super({renderer:e,createMaterial:e=>new A_(e),createQuadRenderer:e=>new AA(e)},t)}async render(e,t,r,n){let{sdrImage:i,gainMapImage:a,needsFlip:o}=await this.processImages(r,n,"flipY"),{gainMap:s,sdr:l}=this.createTextures(i,a,o);this.updateQuadRenderer(e,i,s,l,t),e.render()}}class AO extends AI{load([e,t,r],n,i,a){let o,s,l,u=this.prepareQuadRenderer(),c=async()=>{if(o&&s&&l){try{await this.render(u,l,o,s)}catch(n){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(r),"function"==typeof a&&a(n),u.disposeOnDemandRenderer();return}"function"==typeof n&&n(u),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(r),u.disposeOnDemandRenderer()}},d=!0,f=0,p=0,h=!0,m=0,v=0,g=!0,b=0,w=0,y=()=>{"function"==typeof i&&i(new ProgressEvent("progress",{lengthComputable:d&&h&&g,loaded:p+v+w,total:f+m+b}))};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(r);let x=new F.FileLoader(this._internalLoadingManager);x.setResponseType("arraybuffer"),x.setRequestHeader(this.requestHeader),x.setPath(this.path),x.setWithCredentials(this.withCredentials),x.load(e,async e=>{if("string"==typeof e)throw Error("Invalid sdr buffer");o=e,await c()},e=>{d=e.lengthComputable,p=e.loaded,f=e.total,y()},t=>{this.manager.itemError(e),"function"==typeof a&&a(t)});let C=new F.FileLoader(this._internalLoadingManager);C.setResponseType("arraybuffer"),C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(t,async e=>{if("string"==typeof e)throw Error("Invalid gainmap buffer");s=e,await c()},e=>{h=e.lengthComputable,v=e.loaded,m=e.total,y()},e=>{this.manager.itemError(t),"function"==typeof a&&a(e)});let A=new F.FileLoader(this._internalLoadingManager);return A.setRequestHeader(this.requestHeader),A.setPath(this.path),A.setWithCredentials(this.withCredentials),A.load(r,async e=>{if("string"!=typeof e)throw Error("Invalid metadata string");l=JSON.parse(e),await c()},e=>{g=e.lengthComputable,w=e.loaded,b=e.total,y()},e=>{this.manager.itemError(r),"function"==typeof a&&a(e)}),u}}class AL extends AI{load(e,t,r,n){let i=this.prepareQuadRenderer(),a=new F.FileLoader(this._internalLoadingManager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(this.withCredentials),this.manager.itemStart(e),a.load(e,async r=>{let a,o,s;if("string"==typeof r)throw Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");let l=new Uint8Array(r);try{let e=await AM(l);a=e.sdr,o=e.gainMap,s=e.metadata}catch(t){if(t instanceof Ak||t instanceof AS)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),s={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},a=l;else throw t}try{await this.render(i,s,a.buffer,o?.buffer)}catch(t){this.manager.itemError(e),"function"==typeof n&&n(t),i.disposeOnDemandRenderer();return}"function"==typeof t&&t(i),this.manager.itemEnd(e),i.disposeOnDemandRenderer()},r,t=>{this.manager.itemError(e),"function"==typeof n&&n(t)}),i}}let AF={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},AD="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",AN=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function Aj({files:e=AN,path:t="",preset:r,colorSpace:n,extensions:i}={}){r&&(AG(r),e=AF[r],t=AD);let a=Array.isArray(e),{extension:o,isCubemap:s}=Aq(e),l=A$(o);if(!l)throw Error("useEnvironment: Unrecognized file extension: "+e);let u=xr(e=>e.gl);(0,ef.useLayoutEffect)(()=>{("webp"===o||"jpg"===o||"jpeg"===o)&&u.domElement.addEventListener("webglcontextlost",function(){xa.clear(l,a?[e]:e)},{once:!0})},[e,u.domElement]);let c=xa(l,a?[e]:e,e=>{("webp"===o||"jpg"===o||"jpeg"===o)&&e.setRenderer(u),null==e.setPath||e.setPath(t),i&&i(e)}),d=a?c[0]:c;if("jpg"===o||"jpeg"===o||"webp"===o){var f;d=null==(f=d.renderTarget)?void 0:f.texture}return d.mapping=s?F.CubeReflectionMapping:F.EquirectangularReflectionMapping,d.colorSpace=null!=n?n:s?"srgb":"srgb-linear",d}let AH={files:AN,path:"",preset:void 0,extensions:void 0};Aj.preload=e=>{let t={...AH,...e},{files:r,path:n=""}=t,{preset:i,extensions:a}=t;i&&(AG(i),r=AF[i],n=AD);let{extension:o}=Aq(r);if("webp"===o||"jpg"===o||"jpeg"===o)throw Error("useEnvironment: Preloading gainmaps is not supported");let s=A$(o);if(!s)throw Error("useEnvironment: Unrecognized file extension: "+r);xa.preload(s,Array.isArray(r)?[r]:r,e=>{null==e.setPath||e.setPath(n),a&&a(e)})};let AU={files:AN,preset:void 0};function AG(e){if(!(e in AF))throw Error("Preset must be one of: "+Object.keys(AF).join(", "))}function Aq(e){var t;let r=Array.isArray(e)&&6===e.length,n=Array.isArray(e)&&3===e.length&&e.some(e=>e.endsWith("json")),i=Array.isArray(e)?e[0]:e;return{extension:r?"cube":n?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":null==(t=i.split(".").pop())||null==(t=t.split("?"))||null==(t=t.shift())?void 0:t.toLowerCase(),isCubemap:r,isGainmap:n}}function A$(e){return"cube"===e?F.CubeTextureLoader:"hdr"===e?C0:"exr"===e?Ax:"jpg"===e||"jpeg"===e?AL:"webp"===e?AO:null}function AV(e,t,r,n,i={}){var a,o,s,l,u;let c;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};let d=(c=u=t||r).current&&c.current.isScene?u.current:u,f=d.background,p=d.environment,h={backgroundBlurriness:d.backgroundBlurriness,backgroundIntensity:d.backgroundIntensity,backgroundRotation:null!=(a=null==(o=d.backgroundRotation)||null==o.clone?void 0:o.clone())?a:[0,0,0],environmentIntensity:d.environmentIntensity,environmentRotation:null!=(s=null==(l=d.environmentRotation)||null==l.clone?void 0:l.clone())?s:[0,0,0]};return"only"!==e&&(d.environment=n),e&&(d.background=n),y5(d,i),()=>{"only"!==e&&(d.environment=p),e&&(d.background=f),y5(d,h)}}function AJ({scene:e,background:t=!1,map:r,...n}){let i=xr(e=>e.scene);return ef.useLayoutEffect(()=>{if(r)return AV(t,e,i,r,n)}),null}function AK({background:e=!1,scene:t,blur:r,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s,...l}){let u=Aj(l),c=xr(e=>e.scene);return ef.useLayoutEffect(()=>AV(e,t,c,u,{backgroundBlurriness:null!=r?r:n,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s})),ef.useEffect(()=>()=>{u.dispose()},[u]),null}function AQ({children:e,near:t=.1,far:r=1e3,resolution:n=256,frames:i=1,map:a,background:o=!1,blur:s,backgroundBlurriness:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f,scene:p,files:h,path:m,preset:v,extensions:g}){var b;let w=xr(e=>e.gl),y=xr(e=>e.scene),x=ef.useRef(null),[C]=ef.useState(()=>new F.Scene),A=ef.useMemo(()=>{let e=new F.WebGLCubeRenderTarget(n);return e.texture.type=F.HalfFloatType,e},[n]);ef.useEffect(()=>()=>{A.dispose()},[A]),ef.useLayoutEffect(()=>{if(1===i){let e=w.autoClear;w.autoClear=!0,x.current.update(w,C),w.autoClear=e}return AV(o,p,y,A.texture,{backgroundBlurriness:null!=s?s:l,backgroundIntensity:u,backgroundRotation:c,environmentIntensity:d,environmentRotation:f})},[e,C,A.texture,p,y,o,i,w]);let S=1;return!function(e,t=0){let r=xt(),n=r.getState().internal.subscribe,i=yH(e);yj(()=>n(i,t,r),[t,n,r])}(()=>{if(i===1/0||S<i){let e=w.autoClear;w.autoClear=!0,x.current.update(w,C),w.autoClear=e,S++}}),ef.createElement(ef.Fragment,null,(b=ef.createElement(ef.Fragment,null,e,ef.createElement("cubeCamera",{ref:x,args:[t,r,A]}),h||v?ef.createElement(AK,{background:!0,files:h,preset:v,path:m,extensions:g}):a?ef.createElement(AJ,{background:!0,map:a,extensions:g}):null),(0,em.jsx)(xB,{children:b,container:C,state:void 0})))}function AW(e){var t,r,n,i;let a=Aj(e),o=e.map||a;ef.useMemo(()=>xp({GroundProjectedEnvImpl:CZ}),[]),ef.useEffect(()=>()=>{a.dispose()},[a]);let s=ef.useMemo(()=>[o],[o]),l=null==(t=e.ground)?void 0:t.height,u=null==(r=e.ground)?void 0:r.radius,c=null!=(n=null==(i=e.ground)?void 0:i.scale)?n:1e3;return ef.createElement(ef.Fragment,null,ef.createElement(AJ,wR({},e,{map:o})),ef.createElement("groundProjectedEnvImpl",{args:s,scale:c,height:l,radius:u}))}function AX(e){return e.ground?ef.createElement(AW,e):e.map?ef.createElement(AJ,e):e.children?ef.createElement(AQ,e):ef.createElement(AK,e)}function AY(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}Aj.clear=e=>{let t={...AU,...e},{files:r}=t,{preset:n}=t;n&&(AG(n),r=AF[n]);let{extension:i}=Aq(r),a=A$(i);if(!a)throw Error("useEnvironment: Unrecognized file extension: "+r);xa.clear(a,Array.isArray(r)?[r]:r)};let AZ=["x","y","top","bottom","left","right","width","height"];function A0({ref:e,children:t,fallback:r,resize:n,style:i,gl:a,events:o=xG,eventSource:s,eventPrefix:l,shadows:u,linear:c,flat:d,legacy:f,orthographic:p,frameloop:h,dpr:m,performance:v,raycaster:g,camera:b,scene:w,onPointerMissed:y,onCreated:x,...C}){let A,S,k;ef.useMemo(()=>xp(F),[]);let z=(A=yO(),S=function(){let e=yO(),[t]=ef.useState(()=>new Map);t.clear();let r=e;for(;r;){let e=r.type;yF(e)&&e!==y_&&!t.has(e)&&t.set(e,ef.use(yR(e))),r=r.return}return t}(),k=ef.useMemo(()=>Array.from(S.keys()).reduce((e,t)=>r=>ef.createElement(e,null,ef.createElement(t.Provider,{...r,value:S.get(t)})),e=>ef.createElement(yI,{...e})),[S]),ef.useMemo(()=>({children:e})=>{let t=yP(A,!0,e=>e.type===ef.StrictMode)?ef.StrictMode:ef.Fragment;return(0,em.jsx)(t,{children:(0,em.jsx)(k,{children:e})})},[A,k])),[E,M]=function({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var i,a,o;let s=r||("undefined"==typeof window?class{}:window.ResizeObserver);if(!s)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[l,u]=(0,ef.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=(0,ef.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l,orientationHandler:null}),d=e?"number"==typeof e?e:e.scroll:null,f=e?"number"==typeof e?e:e.resize:null,p=(0,ef.useRef)(!1);(0,ef.useEffect)(()=>(p.current=!0,()=>void(p.current=!1)));let[h,m,v]=(0,ef.useMemo)(()=>{let e=()=>{let e,t;if(!c.current.element)return;let{left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f}=c.current.element.getBoundingClientRect(),h={left:r,top:i,width:a,height:o,bottom:s,right:l,x:d,y:f};c.current.element instanceof HTMLElement&&n&&(h.height=c.current.element.offsetHeight,h.width=c.current.element.offsetWidth),Object.freeze(h),p.current&&(e=c.current.lastBounds,t=h,!AZ.every(r=>e[r]===t[r]))&&u(c.current.lastBounds=h)};return[e,f?AY(e,f):e,d?AY(e,d):e]},[u,n,d,f]);function g(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",v,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function b(){c.current.element&&(c.current.resizeObserver=new s(v),c.current.resizeObserver.observe(c.current.element),t&&c.current.scrollContainers&&c.current.scrollContainers.forEach(e=>e.addEventListener("scroll",v,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{v()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}return i=v,a=!!t,(0,ef.useEffect)(()=>{if(a)return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)},[i,a]),o=m,(0,ef.useEffect)(()=>(window.addEventListener("resize",o),()=>void window.removeEventListener("resize",o)),[o]),(0,ef.useEffect)(()=>{g(),b()},[t,v,m]),(0,ef.useEffect)(()=>g,[]),[e=>{e&&e!==c.current.element&&(g(),c.current.element=e,c.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),b())},l,h]}({scroll:!0,debounce:{scroll:50,resize:0},...n}),T=ef.useRef(null),B=ef.useRef(null);ef.useImperativeHandle(e,()=>T.current);let P=yH(y),[R,_]=ef.useState(!1),[I,O]=ef.useState(!1);if(R)throw R;if(I)throw I;let L=ef.useRef(null);yj(()=>{let e=T.current;if(M.width>0&&M.height>0&&e){let r,n,i,y,C,A,S,k,E,T,R,I,D,N,j;L.current||(y=null==(i=xz.get(e))?void 0:i.fiber,C=null==i?void 0:i.store,i&&console.warn("R3F.createRoot should only be called once!"),A="function"==typeof reportError?reportError:console.error,I=C||(E=(k=(S=yz((e,t)=>{let r,n=new F.Vector3,i=new F.Vector3,a=new F.Vector3;function o(e=t().camera,r=i,s=t().size){let{width:l,height:u,top:c,left:d}=s,f=l/u;r.isVector3?a.copy(r):a.set(...r);let p=e.getWorldPosition(n).distanceTo(a);if(e&&e.isOrthographicCamera)return{width:l/e.zoom,height:u/e.zoom,top:c,left:d,factor:1,distance:p,aspect:f};{let t=2*Math.tan(e.fov*Math.PI/180/2)*p,r=l/u*t;return{width:r,height:t,top:c,left:d,factor:l/r,distance:p,aspect:f}}}let s=t=>e(e=>({performance:{...e.performance,current:t}})),l=new F.Vector2;return{set:e,get:t,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(e=1)=>xj(t(),e),advance:(e,r)=>xH(e,r,t()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new F.Clock,pointer:l,mouse:l,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=t();r&&clearTimeout(r),e.performance.current!==e.performance.min&&s(e.performance.min),r=setTimeout(()=>s(t().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:o},setEvents:t=>e(e=>({...e,events:{...e.events,...t}})),setSize:(r,n,a=0,s=0)=>{let l=t().camera,u={width:r,height:n,top:a,left:s};e(e=>({size:u,viewport:{...e.viewport,...o(l,i,u)}}))},setDpr:t=>e(e=>{let r=yq(t);return{viewport:{...e.viewport,dpr:r,initialDpr:e.viewport.initialDpr||r}}}),setFrameloop:(r="always")=>{let n=t().clock;n.stop(),n.elapsedTime=0,"never"!==r&&(n.start(),n.elapsedTime=0),e(()=>({frameloop:r}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:ef.createRef(),active:!1,frames:0,priority:0,subscribe:(e,r,n)=>{let i=t().internal;return i.priority=i.priority+ +(r>0),i.subscribers.push({ref:e,priority:r,store:n}),i.subscribers=i.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=t().internal;null!=n&&n.subscribers&&(n.priority=n.priority-(r>0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}})).getState()).size,T=k.viewport.dpr,R=k.camera,S.subscribe(()=>{let{camera:e,size:t,viewport:r,gl:n,set:i}=S.getState();if(t.width!==E.width||t.height!==E.height||r.dpr!==T){E=t,T=r.dpr,y4(e,t),r.dpr>0&&n.setPixelRatio(r.dpr);let i="undefined"!=typeof HTMLCanvasElement&&n.domElement instanceof HTMLCanvasElement;n.setSize(t.width,t.height,i)}e!==R&&(R=e,i(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),S.subscribe(e=>xj(e)),S),D=y||xk.createContainer(I,1,null,!1,null,"",A,A,A,null),i||xz.set(e,{fiber:D,store:I}),N=!1,j=null,L.current={async configure(t={}){var i,a;let o;j=new Promise(e=>o=e);let{gl:s,size:l,scene:u,events:c,onCreated:d,shadows:f=!1,linear:p=!1,flat:h=!1,legacy:m=!1,orthographic:v=!1,frameloop:g="always",dpr:b=[1,2],performance:w,raycaster:y,camera:x,onPointerMissed:C}=t,A=I.getState(),S=A.gl;if(!A.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},r="function"==typeof s?await s(t):s;S=y7(r)?r:new F.WebGLRenderer({...t,...s}),A.set({gl:S})}let k=A.raycaster;k||A.set({raycaster:k=new F.Raycaster});let{params:z,...E}=y||{};if(yV.equ(E,k,xE)||y5(k,{...E}),yV.equ(z,k.params,xE)||y5(k,{params:{...k.params,...z}}),!A.camera||A.camera===n&&!yV.equ(n,x,xE)){n=x;let e=null==x?void 0:x.isCamera,t=e?x:v?new F.OrthographicCamera(0,0,0,0,.1,1e3):new F.PerspectiveCamera(75,0,.1,1e3);!e&&(t.position.z=5,x&&(y5(t,x),!t.manual&&("aspect"in x||"left"in x||"right"in x||"bottom"in x||"top"in x)&&(t.manual=!0,t.updateProjectionMatrix())),A.camera||null!=x&&x.rotation||t.lookAt(0,0,0)),A.set({camera:t}),k.camera=t}if(!A.scene){let e;null!=u&&u.isScene?yK(e=u,I,"",{}):(yK(e=new F.Scene,I,"",{}),u&&y5(e,u)),A.set({scene:e})}c&&!A.events.handlers&&A.set({events:c(I)});let M=function(e,t){if(!t&&"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:r,top:n,left:i}=e.parentElement.getBoundingClientRect();return{width:t,height:r,top:n,left:i}}return!t&&"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,l);if(yV.equ(M,A.size,xE)||A.setSize(M.width,M.height,M.top,M.left),b&&A.viewport.dpr!==yq(b)&&A.setDpr(b),A.frameloop!==g&&A.setFrameloop(g),A.onPointerMissed||A.set({onPointerMissed:C}),w&&!yV.equ(w,A.performance,xE)&&A.set(e=>({performance:{...e.performance,...w}})),!A.xr){let e=(e,t)=>{let r=I.getState();"never"!==r.frameloop&&xH(e,!0,r,t)},t=()=>{let t=I.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||xj(t)},r={connect(){let e=I.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=I.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(i=S.xr)?void 0:i.addEventListener)&&r.connect(),A.set({xr:r})}if(S.shadowMap){let e=S.shadowMap.enabled,t=S.shadowMap.type;if(S.shadowMap.enabled=!!f,yV.boo(f))S.shadowMap.type=F.PCFSoftShadowMap;else if(yV.str(f)){let e={basic:F.BasicShadowMap,percentage:F.PCFShadowMap,soft:F.PCFSoftShadowMap,variance:F.VSMShadowMap};S.shadowMap.type=null!=(a=e[f])?a:F.PCFSoftShadowMap}else yV.obj(f)&&Object.assign(S.shadowMap,f);(e!==S.shadowMap.enabled||t!==S.shadowMap.type)&&(S.shadowMap.needsUpdate=!0)}return F.ColorManagement.enabled=!m,N||(S.outputColorSpace=p?F.LinearSRGBColorSpace:F.SRGBColorSpace,S.toneMapping=h?F.NoToneMapping:F.ACESFilmicToneMapping),A.legacy!==m&&A.set(()=>({legacy:m})),A.linear!==p&&A.set(()=>({linear:p})),A.flat!==h&&A.set(()=>({flat:h})),!s||yV.fun(s)||y7(s)||yV.equ(s,S,xE)||y5(S,s),r=d,N=!0,o(),this},render(t){return N||j||this.configure(),j.then(()=>{xk.updateContainer((0,em.jsx)(xM,{store:I,children:t,onCreated:r,rootElement:e}),D,null,()=>void 0)}),I},unmount(){xT(e)}}),async function(){await L.current.configure({gl:a,scene:w,events:o,shadows:u,linear:c,flat:d,legacy:f,orthographic:p,frameloop:h,dpr:m,performance:v,raycaster:g,camera:b,size:M,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(s?s&&s.hasOwnProperty("current")?s.current:s:B.current),l&&e.setEvents({compute:(e,t)=>{let r=e[l+"X"],n=e[l+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==x||x(e)}}),L.current.render((0,em.jsx)(z,{children:(0,em.jsx)(yG,{set:O,children:(0,em.jsx)(ef.Suspense,{fallback:(0,em.jsx)(yU,{set:_}),children:null!=t?t:null})})}))}()}}),ef.useEffect(()=>{let e=T.current;if(e)return()=>xT(e)},[]);let D=s?"none":"auto";return(0,em.jsx)("div",{ref:B,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:D,...i},...C,children:(0,em.jsx)("div",{ref:E,style:{width:"100%",height:"100%"},children:(0,em.jsx)("canvas",{ref:T,style:{display:"block"},children:r})})})}function A1(e){return(0,em.jsx)(yI,{children:(0,em.jsx)(A0,{...e})})}let{slice:A2,forEach:A5}=[],A3=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,A4=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"},n=encodeURIComponent(t),i=`${e}=${n}`;if(r.maxAge>0){let e=r.maxAge-0;if(Number.isNaN(e))throw Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(e)}`}if(r.domain){if(!A3.test(r.domain))throw TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!A3.test(r.path))throw TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},A9={create(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*r*1e3)),n&&(i.domain=n),document.cookie=A4(e,t,i)},read(e){let t=`${e}=`,r=document.cookie.split(";");for(let e=0;e<r.length;e++){let n=r[e];for(;" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var A6={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return A9.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:i,cookieOptions:a}=t;r&&"undefined"!=typeof document&&A9.create(r,e,n,i,a)}},A8={name:"querystring",lookup(e){let t,{lookupQuerystring:r}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));let n=e.substring(1).split("&");for(let e=0;e<n.length;e++){let i=n[e].indexOf("=");i>0&&n[e].substring(0,i)===r&&(t=n[e].substring(i+1))}}return t}},A7={name:"hash",lookup(e){let t,{lookupHash:r,lookupFromHashIndex:n}=e;if("undefined"!=typeof window){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(r){let e=i.split("&");for(let n=0;n<e.length;n++){let i=e[n].indexOf("=");i>0&&e[n].substring(0,i)===r&&(t=e[n].substring(i+1))}}if(t)return t;if(!t&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;return t["number"==typeof n?n:0]?.replace("/","")}}}return t}};let Se=null,St=()=>{if(null!==Se)return Se;try{if(!(Se="undefined"!=typeof window&&null!==window.localStorage))return!1;let e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){Se=!1}return Se};var Sr={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&St())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&St()&&window.localStorage.setItem(r,e)}};let Sn=null,Si=()=>{if(null!==Sn)return Sn;try{if(!(Sn="undefined"!=typeof window&&null!==window.sessionStorage))return!1;let e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Sn=!1}return Sn};var Sa={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Si())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&Si()&&window.sessionStorage.setItem(r,e)}},So={name:"navigator",lookup(e){let t=[];if("undefined"!=typeof navigator){let{languages:e,userLanguage:r,language:n}=navigator;if(e)for(let r=0;r<e.length;r++)t.push(e[r]);r&&t.push(r),n&&t.push(n)}return t.length>0?t:void 0}},Ss={name:"htmlTag",lookup(e){let t,{htmlTag:r}=e,n=r||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},Sl={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;let r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(r))return r["number"==typeof t?t:0]?.replace("/","")}},Su={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e,r="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r["number"==typeof t?t+1:1]}};let Sc=!1;try{document.cookie,Sc=!0}catch(e){}let Sd=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Sc||Sd.splice(1,1);class Sf{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return A5.call(A2.call(arguments,1),t=>{if(t)for(let r in t)void 0===e[r]&&(e[r]=t[r])}),e}(t,this.options||{},{order:Sd,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(A6),this.addDetector(A8),this.addDetector(Sr),this.addDetector(Sa),this.addDetector(So),this.addDetector(Ss),this.addDetector(Sl),this.addDetector(Su),this.addDetector(A7)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return(e.forEach(e=>{if(this.detectors[e]){let r=this.detectors[e].lookup(this.options);r&&"string"==typeof r&&(r=[r]),r&&(t=t.concat(r))}}),t=t.filter(e=>null!=e&&!("string"==typeof e&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)))).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes)?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;!t||this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})}}Sf.type="languageDetector";let Sp=(0,ef.createContext)({theme:"system",setTheme:()=>null});function Sh({children:e,defaultTheme:t="system",storageKey:r="vizbl-theme",root:n=window.document.documentElement,enableStorage:i=!1,...a}){let[o,s]=(0,ef.useState)(()=>i&&localStorage.getItem(r)||t);return(0,ef.useEffect)(()=>{if(n.classList.remove("light","dark"),"system"===o){let e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";n.classList.add(e);return}n.classList.add(o)},[o,n]),(0,em.jsx)(Sp,{...a,value:{theme:o,setTheme:e=>{i&&localStorage.setItem(r,e),s(e)}},children:e})}function Sm(...e){return tQ(eZ(e))}function Sv(e){return(0,em.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,children:(0,em.jsx)("path",{d:"M8.21723 14.9975C8.10298 14.997 7.99004 14.9731 7.8854 14.9272C7.78077 14.8814 7.68665 14.8145 7.60889 14.7308L3.55889 10.4225C3.4075 10.2611 3.3264 10.0463 3.33343 9.82513C3.34046 9.604 3.43505 9.39471 3.59639 9.24332C3.75773 9.09192 3.97261 9.01082 4.19374 9.01785C4.41488 9.02489 4.62417 9.11948 4.77556 9.28082L8.20889 12.9392L15.2172 5.27248C15.2883 5.18392 15.3768 5.11083 15.4772 5.0577C15.5776 5.00458 15.6878 4.97254 15.8011 4.96355C15.9143 4.95456 16.0282 4.96882 16.1357 5.00544C16.2432 5.04207 16.3421 5.10029 16.4263 5.17652C16.5105 5.25276 16.5782 5.3454 16.6253 5.44877C16.6724 5.55213 16.6979 5.66403 16.7001 5.7776C16.7024 5.89116 16.6815 6.00399 16.6385 6.10916C16.5956 6.21433 16.5316 6.30961 16.4506 6.38915L8.83389 14.7225C8.75686 14.8077 8.66308 14.8761 8.55841 14.9234C8.45373 14.9707 8.34042 14.996 8.22556 14.9975H8.21723Z",fill:"currentColor"})})}function Sg(e){return(0,em.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:(0,em.jsx)("path",{d:"M12.0002 15.496C11.8686 15.4968 11.7381 15.4716 11.6163 15.4218C11.4944 15.372 11.3836 15.2987 11.2902 15.206L7.29019 11.206C7.10188 11.0177 6.99609 10.7623 6.99609 10.496C6.99609 10.2297 7.10188 9.97434 7.29019 9.78604C7.47849 9.59773 7.73388 9.49194 8.00019 9.49194C8.26649 9.49194 8.52188 9.59773 8.71019 9.78604L12.0002 13.096L15.3002 9.91604C15.3922 9.81375 15.5043 9.73154 15.6295 9.67455C15.7547 9.61756 15.8903 9.58703 16.0279 9.58485C16.1654 9.58267 16.302 9.60889 16.4289 9.66189C16.5559 9.71488 16.6705 9.79349 16.7657 9.89282C16.8609 9.99214 16.9346 10.11 16.9821 10.2391C17.0297 10.3682 17.0501 10.5057 17.042 10.6431C17.034 10.7804 16.9977 10.9146 16.9355 11.0373C16.8732 11.16 16.7863 11.2685 16.6802 11.356L12.6802 15.216C12.4973 15.3924 12.2542 15.4925 12.0002 15.496Z",fill:"currentColor"})})}function Sb(e){return(0,em.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:[(0,em.jsx)("path",{d:"M12 2C11.7348 2 11.4804 2.10536 11.2929 2.29289C11.1054 2.48043 11 2.73478 11 3V5C11 5.26522 11.1054 5.51957 11.2929 5.70711C11.4804 5.89464 11.7348 6 12 6C12.2652 6 12.5196 5.89464 12.7071 5.70711C12.8946 5.51957 13 5.26522 13 5V3C13 2.73478 12.8946 2.48043 12.7071 2.29289C12.5196 2.10536 12.2652 2 12 2Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M21.0002 11H19.0002C18.735 11 18.4806 11.1054 18.2931 11.2929C18.1055 11.4804 18.0002 11.7348 18.0002 12C18.0002 12.2652 18.1055 12.5196 18.2931 12.7071C18.4806 12.8946 18.735 13 19.0002 13H21.0002C21.2654 13 21.5197 12.8946 21.7073 12.7071C21.8948 12.5196 22.0002 12.2652 22.0002 12C22.0002 11.7348 21.8948 11.4804 21.7073 11.2929C21.5197 11.1054 21.2654 11 21.0002 11Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6 12C6 11.7348 5.89464 11.4804 5.70711 11.2929C5.51957 11.1054 5.26522 11 5 11H3C2.73478 11 2.48043 11.1054 2.29289 11.2929C2.10536 11.4804 2 11.7348 2 12C2 12.2652 2.10536 12.5196 2.29289 12.7071C2.48043 12.8946 2.73478 13 3 13H5C5.26522 13 5.51957 12.8946 5.70711 12.7071C5.89464 12.5196 6 12.2652 6 12Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6.22009 5.00298C6.02357 4.82786 5.76656 4.7362 5.50358 4.74744C5.2406 4.75869 4.99234 4.87196 4.8115 5.06322C4.63065 5.25447 4.53143 5.50867 4.5349 5.77187C4.53838 6.03507 4.64426 6.28656 4.83009 6.47298L6.27009 7.86298C6.36673 7.95629 6.48117 8.02917 6.60659 8.07728C6.73201 8.12538 6.86584 8.14773 7.00009 8.14298C7.1348 8.14246 7.26801 8.11474 7.39173 8.06147C7.51546 8.0082 7.62714 7.93048 7.72009 7.83298C7.90634 7.64561 8.01088 7.39216 8.01088 7.12798C8.01088 6.86379 7.90634 6.61034 7.72009 6.42298L6.22009 5.00298Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M17 8.14285C17.2575 8.14182 17.5047 8.04153 17.69 7.86285L19.13 6.47285C19.3057 6.2893 19.4049 6.04577 19.4075 5.79172C19.4102 5.53767 19.316 5.29214 19.1441 5.10502C18.9723 4.91789 18.7356 4.80319 18.4823 4.78421C18.2289 4.76524 17.9779 4.84341 17.78 5.00285L16.34 6.42285C16.1538 6.61021 16.0493 6.86366 16.0493 7.12785C16.0493 7.39203 16.1538 7.64548 16.34 7.83285C16.5132 8.01557 16.7489 8.12627 17 8.14285Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M12 17.9999C11.7348 17.9999 11.4804 18.1053 11.2929 18.2928C11.1054 18.4803 11 18.7347 11 18.9999V20.9999C11 21.2651 11.1054 21.5195 11.2929 21.707C11.4804 21.8946 11.7348 21.9999 12 21.9999C12.2652 21.9999 12.5196 21.8946 12.7071 21.707C12.8946 21.5195 13 21.2651 13 20.9999V18.9999C13 18.7347 12.8946 18.4803 12.7071 18.2928C12.5196 18.1053 12.2652 17.9999 12 17.9999Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M17.7302 16.1399C17.5392 15.9556 17.2829 15.8547 17.0175 15.8594C16.7521 15.864 16.4995 15.974 16.3152 16.1649C16.1309 16.3559 16.0299 16.6122 16.0346 16.8776C16.0393 17.143 16.1492 17.3956 16.3402 17.5799L17.7802 18.9999C17.9702 19.1835 18.2251 19.2845 18.4893 19.2808C18.7535 19.277 19.0055 19.1688 19.1902 18.9799C19.2837 18.8868 19.3579 18.7762 19.4085 18.6543C19.4591 18.5325 19.4851 18.4019 19.4851 18.2699C19.4851 18.138 19.4591 18.0073 19.4085 17.8855C19.3579 17.7637 19.2837 17.653 19.1902 17.5599L17.7302 16.1399Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6.27011 16.141L4.83011 17.531C4.73638 17.624 4.66198 17.7346 4.61121 17.8564C4.56045 17.9783 4.53431 18.109 4.53431 18.241C4.53431 18.373 4.56045 18.5037 4.61121 18.6256C4.66198 18.7474 4.73638 18.858 4.83011 18.951C4.9239 19.0467 5.03596 19.1226 5.15965 19.1741C5.28333 19.2256 5.41612 19.2518 5.55011 19.251C5.79662 19.2531 6.03522 19.1641 6.22011 19.001L7.66011 17.611C7.75466 17.5197 7.83031 17.4107 7.88273 17.2902C7.93516 17.1697 7.96334 17.0401 7.96566 16.9087C7.96798 16.7773 7.9444 16.6467 7.89626 16.5244C7.84813 16.4022 7.77637 16.2905 7.68511 16.196C7.59384 16.1014 7.48484 16.0258 7.36433 15.9734C7.24383 15.9209 7.11418 15.8928 6.98278 15.8904C6.85139 15.8881 6.72082 15.9117 6.59854 15.9598C6.47626 16.008 6.36466 16.0797 6.27011 16.171V16.141Z",fill:"currentColor"})]})}function Sw(e){return(0,em.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,em.jsx)("g",{clipPath:"url(#clip0_3784_10281)",children:(0,em.jsx)("path",{d:"M20.739 11.3791L18.039 8.67909C17.955 8.59517 17.8554 8.52861 17.7458 8.48319C17.6361 8.43778 17.5186 8.4144 17.4 8.4144C17.2813 8.4144 17.1638 8.43778 17.0541 8.48319C16.9445 8.52861 16.8449 8.59517 16.761 8.67909C16.6771 8.763 16.6105 8.86262 16.5651 8.97226C16.5197 9.0819 16.4963 9.19941 16.4963 9.31808C16.4963 9.43676 16.5197 9.55427 16.5651 9.66391C16.6105 9.77355 16.6771 9.87317 16.761 9.95708L17.922 11.1001H12.9V6.0691L14.061 7.23909C14.1451 7.32246 14.2448 7.38843 14.3545 7.43322C14.4641 7.478 14.5815 7.50073 14.7 7.50009C14.8787 7.50113 15.0538 7.44891 15.2027 7.35009C15.3517 7.25127 15.4679 7.11032 15.5364 6.94523C15.605 6.78013 15.6228 6.59835 15.5876 6.42308C15.5525 6.24781 15.4659 6.08698 15.339 5.9611L12.639 3.26111C12.4705 3.09326 12.2423 2.99902 12.0045 2.99902C11.7666 2.99902 11.5385 3.09326 11.37 3.26111L8.66999 5.9611C8.58608 6.04442 8.5194 6.14346 8.47376 6.25255C8.42812 6.36164 8.40441 6.47866 8.404 6.59691C8.40358 6.71517 8.42646 6.83235 8.47132 6.94176C8.51619 7.05117 8.58217 7.15068 8.66549 7.23459C8.74882 7.31851 8.84785 7.38519 8.95695 7.43083C9.06604 7.47647 9.18306 7.50017 9.30131 7.50059C9.54014 7.50144 9.76952 7.40737 9.93899 7.23909L11.1 6.0781V11.1001H6.069L7.239 9.93908C7.40847 9.76961 7.50368 9.53975 7.50368 9.30008C7.50368 9.06041 7.40847 8.83056 7.239 8.66109C7.06953 8.49161 6.83967 8.39641 6.6 8.39641C6.36033 8.39641 6.13048 8.49161 5.961 8.66109L3.26101 11.3611C3.17764 11.4452 3.11167 11.5449 3.06689 11.6546C3.0221 11.7642 2.99938 11.8816 3.00002 12.0001C2.99933 12.1185 3.02203 12.2359 3.06682 12.3456C3.11161 12.4552 3.1776 12.555 3.26101 12.6391L5.961 15.3391C6.0451 15.4225 6.14483 15.4885 6.25449 15.5333C6.36414 15.578 6.48156 15.6007 6.6 15.6001C6.77896 15.6015 6.95429 15.5496 7.10354 15.4508C7.25279 15.3521 7.36918 15.211 7.43781 15.0458C7.50643 14.8805 7.52417 14.6985 7.48876 14.5231C7.45334 14.3476 7.36638 14.1868 7.239 14.0611L6.078 12.9001H11.1V17.9311L9.93899 16.7611C9.76952 16.5916 9.53966 16.4964 9.29999 16.4964C9.06032 16.4964 8.83047 16.5916 8.661 16.7611C8.49152 16.9305 8.39631 17.1604 8.39631 17.4001C8.39631 17.6397 8.49152 17.8696 8.661 18.0391L11.361 20.739C11.5297 20.9065 11.7578 21.0004 11.9955 21.0004C12.2332 21.0004 12.4612 20.9065 12.63 20.739L15.33 18.0391C15.4139 17.9551 15.4805 17.8555 15.5259 17.7459C15.5713 17.6362 15.5947 17.5187 15.5947 17.4001C15.5947 17.2814 15.5713 17.1639 15.5259 17.0542C15.4805 16.9446 15.4139 16.845 15.33 16.7611C15.2461 16.6771 15.1464 16.6106 15.0368 16.5652C14.9272 16.5198 14.8096 16.4964 14.691 16.4964C14.5723 16.4964 14.4548 16.5198 14.3452 16.5652C14.2355 16.6106 14.1359 16.6771 14.052 16.7611L12.9 17.9221V12.9001H17.931L16.761 14.0611C16.6558 14.166 16.5781 14.2952 16.5349 14.4374C16.4917 14.5795 16.4843 14.7301 16.5134 14.8758C16.5424 15.0215 16.607 15.1578 16.7013 15.2725C16.7957 15.3873 16.917 15.4769 17.0544 15.5335C17.164 15.5784 17.2815 15.6011 17.4 15.6001C17.5184 15.6008 17.6359 15.5782 17.7455 15.5334C17.8552 15.4886 17.9549 15.4226 18.039 15.3391L20.739 12.6391C20.8224 12.555 20.8884 12.4552 20.9331 12.3456C20.9779 12.2359 21.0006 12.1185 21 12.0001C20.9966 11.7671 20.9031 11.5445 20.739 11.3791Z",fill:"currentColor"})}),(0,em.jsx)("defs",{children:(0,em.jsx)("clipPath",{id:"clip0_3784_10281",children:(0,em.jsx)("rect",{width:"24",height:"24",fill:"currentColor"})})})]})}function Sy(e){return(0,em.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,children:[(0,em.jsx)("path",{d:"M19.5398 5.08113C18.5372 4.08551 17.3458 3.30019 16.0356 2.77129C14.7253 2.24238 13.3226 1.98054 11.9098 2.00113C9.25763 1.9945 6.71146 3.04171 4.83141 4.91238C2.95135 6.78306 1.89143 9.32396 1.8848 11.9761C1.87817 14.6283 2.92538 17.1745 4.79605 19.0545C6.66673 20.9346 9.20763 21.9945 11.8598 22.0011C12.4313 22.0108 12.9898 21.8305 13.4477 21.4884C13.9057 21.1464 14.237 20.6619 14.3898 20.1111C14.4872 19.7134 14.4862 19.2979 14.3869 18.9006C14.2875 18.5033 14.0929 18.1362 13.8198 17.8311C13.7562 17.7594 13.7146 17.6709 13.7 17.5761C13.6854 17.4814 13.6984 17.3845 13.7374 17.2969C13.7765 17.2094 13.8399 17.1349 13.9201 17.0825C14.0003 17.03 14.0939 17.0018 14.1898 17.0011H15.8398C17.3927 17.0084 18.8909 16.4279 20.0336 15.3761C21.1762 14.3244 21.8786 12.8794 21.9998 11.3311C22.037 10.1767 21.838 9.02692 21.415 7.95218C20.992 6.87745 20.3539 5.90046 19.5398 5.08113ZM15.8798 15.0011H14.2298C13.7479 14.9984 13.2756 15.1355 12.8701 15.3959C12.4647 15.6563 12.1435 16.0288 11.9455 16.4681C11.7476 16.9075 11.6813 17.3948 11.7549 17.8711C11.8284 18.3473 12.0385 18.792 12.3598 19.1511C12.4224 19.2142 12.4666 19.2932 12.4877 19.3795C12.5088 19.4658 12.5061 19.5562 12.4798 19.6411C12.4298 19.8511 12.1998 19.9811 11.8898 20.0011C10.754 19.9869 9.63429 19.7309 8.60516 19.2502C7.57603 18.7695 6.66109 18.0751 5.92126 17.2132C5.18142 16.3513 4.63365 15.3417 4.31441 14.2516C3.99517 13.1615 3.91178 12.016 4.0698 10.8911C4.35496 9.00107 5.29935 7.27276 6.73593 6.01186C8.17251 4.75096 10.0087 4.03873 11.9198 4.00113H11.9998C13.1306 3.98632 14.253 4.19813 15.3007 4.62407C16.3483 5.05001 17.3001 5.68144 18.0998 6.48113C18.7238 7.10552 19.2141 7.85048 19.5407 8.67057C19.8674 9.49066 20.0236 10.3687 19.9998 11.2511C19.8963 12.2742 19.4184 13.2229 18.6579 13.9151C17.8974 14.6072 16.9081 14.994 15.8798 15.0011Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M11.9996 8.00025C12.3974 8.00025 12.7789 7.84222 13.0602 7.56091C13.3415 7.27961 13.4996 6.89808 13.4996 6.50025C13.4996 6.10243 13.3415 5.7209 13.0602 5.43959C12.7789 5.15829 12.3974 5.00025 11.9996 5.00025C11.6018 5.00025 11.2202 5.15829 10.9389 5.43959C10.6576 5.7209 10.4996 6.10243 10.4996 6.50025C10.4996 6.89808 10.6576 7.27961 10.9389 7.56091C11.2202 7.84222 11.6018 8.00025 11.9996 8.00025Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M15.2496 7.20116C15.079 7.29965 14.9294 7.43079 14.8094 7.58709C14.6895 7.74339 14.6014 7.92179 14.5504 8.1121C14.4994 8.30242 14.4864 8.50092 14.512 8.69627C14.5377 8.89162 14.6016 9.08 14.7001 9.25066C14.7986 9.42131 14.9298 9.57089 15.0861 9.69086C15.2424 9.81084 15.4208 9.89885 15.6111 9.94987C15.8014 10.0009 15.9999 10.0139 16.1952 9.98825C16.3906 9.96256 16.579 9.89865 16.7496 9.80016C17.0944 9.60125 17.3461 9.27352 17.4492 8.88907C17.5524 8.50462 17.4985 8.09494 17.2996 7.75016C17.1007 7.40538 16.773 7.15373 16.3885 7.05059C16.0041 6.94744 15.5944 7.00125 15.2496 7.20016V7.20116Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M8.74976 7.20016C8.57904 7.1018 8.39062 7.03803 8.19526 7.01249C7.99989 6.98695 7.80141 7.00014 7.61114 7.0513C7.42088 7.10247 7.24255 7.19061 7.08634 7.31069C6.93014 7.43077 6.79912 7.58045 6.70076 7.75116C6.6024 7.92188 6.53863 8.1103 6.51308 8.30567C6.48754 8.50103 6.50073 8.69951 6.5519 8.88978C6.60306 9.08005 6.6912 9.25837 6.81128 9.41458C6.93137 9.57078 7.08104 9.7018 7.25176 9.80016C7.59654 9.99881 8.00611 10.0524 8.39037 9.94903C8.77464 9.84569 9.10211 9.59394 9.30076 9.24916C9.4994 8.90438 9.55295 8.49481 9.44962 8.11055C9.34629 7.72629 9.09454 7.39881 8.74976 7.20016Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M6.15933 11.2603C5.9133 11.4264 5.7221 11.6618 5.60993 11.9366C5.49776 12.2115 5.46967 12.5135 5.52921 12.8043C5.58876 13.0951 5.73326 13.3617 5.94443 13.5704C6.1556 13.779 6.42393 13.9204 6.71546 13.9764C7.00698 14.0325 7.30858 14.0008 7.58208 13.8853C7.85557 13.7699 8.08866 13.5759 8.25183 13.3279C8.415 13.0799 8.50091 12.789 8.49868 12.4922C8.49646 12.1953 8.4062 11.9058 8.23933 11.6603C8.12971 11.4966 7.98873 11.3563 7.82454 11.2475C7.66035 11.1387 7.47622 11.0635 7.28279 11.0263C7.08936 10.9891 6.89047 10.9906 6.69763 11.0308C6.5048 11.0709 6.32183 11.1489 6.15933 11.2603Z",fill:"currentColor"})]})}function Sx(e){return(0,em.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,em.jsx)("path",{d:"M20 15.9998C20.5522 15.9998 20.9999 16.4476 21 16.9998V18.9998C20.9999 19.7952 20.6835 20.5584 20.1211 21.1209C19.5585 21.6833 18.7955 21.9998 18 21.9998H6C5.20446 21.9998 4.44149 21.6833 3.87891 21.1209C3.31646 20.5584 3.00012 19.7952 3 18.9998V16.9998C3.00009 16.4476 3.44777 15.9998 4 15.9998C4.55223 15.9998 4.99991 16.4476 5 16.9998V18.9998C5.00012 19.2648 5.1056 19.5194 5.29297 19.7068C5.48048 19.8942 5.7349 19.9998 6 19.9998H18C18.2651 19.9998 18.5195 19.8942 18.707 19.7068C18.8944 19.5194 18.9999 19.2648 19 18.9998V16.9998C19.0001 16.4476 19.4478 15.9998 20 15.9998Z",fill:"currentColor"}),(0,em.jsx)("path",{d:"M11.3691 3.22437C11.7619 2.90402 12.3409 2.92662 12.707 3.29273L17.707 8.29273C18.0973 8.68328 18.0975 9.31635 17.707 9.7068C17.3166 10.097 16.6834 10.097 16.293 9.7068L13 6.41383V15.9998C12.9997 16.5518 12.552 16.9997 12 16.9998C11.4479 16.9998 11.0003 16.5518 11 15.9998V6.41383L7.70703 9.7068C7.31657 10.097 6.68343 10.097 6.29297 9.7068C5.90252 9.31635 5.90268 8.68328 6.29297 8.29273L11.293 3.29273L11.3691 3.22437Z",fill:"currentColor"})]})}function SC({className:e,...t}){return(0,em.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:Sm("size-6",e),...t,children:[(0,em.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.0625 1.70412C12.1393 1.70359 12.2136 1.7151 12.2842 1.73439C12.6576 1.76978 13.0261 1.88527 13.3604 2.08303L19.7012 5.84084L19.7031 5.84181C20.1036 6.08032 20.4348 6.42322 20.665 6.83498C20.8952 7.24671 21.0168 7.71415 21.0166 8.19142V8.19338L20.998 15.7403C20.9979 16.1352 20.9124 16.526 20.751 16.8848C20.7319 16.9557 20.7049 17.026 20.667 17.0928C20.6355 17.1482 20.5983 17.1987 20.5576 17.2442C20.3296 17.6 20.023 17.8979 19.6631 18.1133L13.2998 21.9072C12.4738 22.3996 11.4611 22.4004 10.6436 21.917L10.6416 21.916L4.30078 18.1582L4.29883 18.1572C3.91023 17.9258 3.58764 17.5957 3.3584 17.2002C3.35105 17.1885 3.34181 17.1773 3.33496 17.1651C3.32803 17.1526 3.32268 17.1387 3.31641 17.126C3.09976 16.7236 2.98517 16.2703 2.98535 15.8076V15.8057L3.00391 8.25588C3.00603 7.28279 3.51293 6.37777 4.33984 5.88478L10.7021 2.09181C11.0682 1.87369 11.4708 1.75231 11.877 1.72658C11.9365 1.71245 11.999 1.70462 12.0625 1.70412ZM5.16895 7.36818C4.87108 7.54583 4.6844 7.87497 4.68359 8.23635L4.66602 15.3838L9.45801 12.5254C9.51085 12.7718 9.60256 13.0142 9.73535 13.2442C9.90127 13.5315 10.1161 13.7727 10.3633 13.9639L5.49512 16.8662L11.499 20.4248C11.8036 20.6044 12.1738 20.6008 12.4707 20.4238L18.5107 16.8233L13.4971 13.877C13.9543 13.482 14.2391 12.9423 14.3242 12.3672L19.3193 15.3037L19.3379 8.21291L19.3369 8.21388C19.3369 8.03517 19.2923 7.85955 19.2061 7.7051C19.1196 7.55056 18.9947 7.42151 18.8447 7.33205L12.8887 3.80275L12.8535 9.73439C12.3304 9.51037 11.7366 9.46806 11.1738 9.63576L11.21 3.76662L5.16895 7.36818Z",fill:"currentColor"}),(0,em.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.91641 8.60885C11.7928 7.52595 14.1912 8.16845 15.2748 10.0444C16.3582 11.9209 15.7156 14.3211 13.8393 15.4047C11.9627 16.4879 9.56339 15.8446 8.47989 13.9682C7.39671 12.0916 8.03987 9.69227 9.91641 8.60885ZM13.8031 10.894C13.189 9.83118 11.8293 9.46704 10.766 10.0805C9.7026 10.6945 9.33693 12.0551 9.95059 13.1186C10.5646 14.1821 11.9261 14.5469 12.9897 13.9331C14.0529 13.3189 14.4171 11.9575 13.8031 10.894Z",fill:"currentColor"})]})}let SA="var(--vizbl-borders-medium)";function SS({className:e,variant:t="default",size:r="default",state:n="loading",role:i,"aria-live":a,"aria-label":o,...s}){switch(t){case"logo":{let t="sm"===r?4:5;return(0,em.jsxs)("svg",{...s,role:i??"status","aria-live":a??"polite","aria-label":o??("success"===n?"Success":"error"===n?"Error":"Loading"),width:"93",height:"91",viewBox:"0 0 93 91",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-slot":"spinner","data-size":r,"data-state":n,className:Sm("spinner-logo shrink-0","sm"===r?"size-9":"size-22",e),children:[(0,em.jsx)("g",{className:"spinner-logo__intro-shell",children:(0,em.jsx)("path",{d:"M15.7495 62.7798L46.4936 45.0297M46.4936 45.0297L77.2661 62.5451M46.4936 45.0297L46.7111 9.62225M49.9213 79.4237L74.5719 65.1917C75.6436 64.5705 76.5344 63.6811 77.1541 62.6137C77.7738 61.5462 78.1003 60.3385 78.1007 59.1129L78.1729 30.7811C78.1734 29.5494 77.851 28.3427 77.2373 27.2798C76.6236 26.2169 75.7398 25.3343 74.6729 24.7189L50.1007 10.6155C47.926 9.3694 45.2455 9.37719 43.0689 10.6339L18.4183 24.8659C16.2385 26.1244 14.8946 28.4401 14.8895 30.9447L14.8173 59.2766C14.8168 60.5082 15.1392 61.7149 15.7529 62.7778C16.3666 63.8408 17.2504 64.7233 18.3173 65.3387L42.8895 79.4421C45.0642 80.6882 47.7447 80.6805 49.9213 79.4237Z",className:"spinner-logo__outline spinner-logo__outline--intro",vectorEffect:"sm"===r?void 0:"non-scaling-stroke"})}),(0,em.jsx)("circle",{className:"spinner-logo__intro-orb",cx:"46.27",cy:"45.8",r:"11.18",fill:"white",stroke:SA,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,em.jsx)("circle",{className:"spinner-logo__result-ring",cx:"46.5",cy:"45.5",r:"33.46",fill:"white",stroke:SA,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round"}),(0,em.jsx)("g",{transform:"translate(27.786 31.4489)",children:(0,em.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--success",children:(0,em.jsx)("path",{d:"M13.6758 28.1023C13.3559 28.101 13.0397 28.0341 12.7467 27.9057C12.4537 27.7772 12.1902 27.59 11.9725 27.3557L0.632479 15.2923C0.208575 14.8406 -0.0185097 14.2389 0.00118164 13.6198C0.020873 13.0006 0.285727 12.4146 0.737479 11.9907C1.18923 11.5668 1.79088 11.3397 2.41006 11.3594C3.02924 11.3791 3.61524 11.6439 4.03915 12.0957L13.6525 22.339L33.2758 0.87233C33.475 0.624349 33.7227 0.419696 34.0038 0.270944C34.2849 0.122191 34.5935 0.0324784 34.9105 0.00731496C35.2276 -0.0178485 35.5464 0.0220682 35.8475 0.124615C36.1485 0.227162 36.4254 0.390174 36.6612 0.603637C36.897 0.8171 37.0866 1.07651 37.2185 1.36593C37.3503 1.65535 37.4216 1.96867 37.428 2.28665C37.4344 2.60463 37.3756 2.92056 37.2555 3.21502C37.1353 3.50949 36.9562 3.77627 36.7291 3.999L15.4025 27.3323C15.1868 27.5709 14.9242 27.7625 14.6311 27.895C14.338 28.0275 14.0208 28.0981 13.6991 28.1023H13.6758Z",fill:SA})})}),(0,em.jsx)("g",{transform:"translate(32.4879 31.4885)",children:(0,em.jsx)("g",{className:"spinner-logo__result-glyph spinner-logo__result-glyph--error",children:(0,em.jsx)("path",{d:"M17.3045 14.0095L27.3378 3.99955C27.5554 3.78199 27.728 3.52371 27.8457 3.23946C27.9635 2.95521 28.0241 2.65055 28.0241 2.34288C28.0241 2.03521 27.9635 1.73055 27.8457 1.4463C27.728 1.16205 27.5554 0.903769 27.3378 0.686213C27.1203 0.468656 26.862 0.296082 26.5778 0.178341C26.2935 0.0606 25.9889 -4.58466e-09 25.6812 0C25.3735 4.58466e-09 25.0689 0.0606 24.7846 0.178341C24.5003 0.296082 24.2421 0.468656 24.0245 0.686213L14.0145 10.7195L4.00451 0.686213C3.56514 0.246838 2.96921 -4.62957e-09 2.34784 0C1.72647 4.62957e-09 1.13055 0.246838 0.691177 0.686213C0.251802 1.12559 0.0049634 1.72151 0.0049634 2.34288C0.00496339 2.96425 0.251802 3.56017 0.691177 3.99955L10.7245 14.0095L0.691177 24.0195C0.472196 24.2363 0.29836 24.4943 0.179723 24.7787C0.0610849 25.063 0 25.3681 0 25.6762C0 25.9843 0.0610849 26.2894 0.179723 26.5737C0.29836 26.8581 0.472196 27.1161 0.691177 27.3329C0.908091 27.5516 1.16616 27.7252 1.4505 27.8436C1.73484 27.9621 2.03982 28.0231 2.34784 28.0231C2.65587 28.0231 2.96085 27.9621 3.24519 27.8436C3.52953 27.7252 3.7876 27.5516 4.00451 27.3329L14.0145 17.2995L24.0245 27.3329C24.296 27.6078 24.6314 27.8111 25.0007 27.9245C25.3701 28.0379 25.7618 28.0579 26.1407 27.9828C26.5197 27.9077 26.8741 27.7397 27.1722 27.4939C27.4703 27.2481 27.7028 26.9322 27.8488 26.5745C28.0272 26.1459 28.0736 25.6738 27.9821 25.2187C27.8907 24.7636 27.6655 24.346 27.3355 24.0195L17.3045 14.0095Z",fill:SA})})})]})}case"default":return(0,em.jsx)(Sb,{...s,role:i??"status","aria-live":a??"polite","aria-label":o??"Loading","data-slot":"spinner",className:Sm("size-4 animate-spin",e)});default:return t}}function Sk({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return(0,em.jsx)(n9,{"data-slot":"separator",decorative:r,orientation:t,className:Sm("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}let Sz="undefined"==typeof window;function SE(e,{defaultValue:t=!1,initializeWithValue:r=!0}={}){let[n,i]=(0,ef.useState)(()=>{if(r)return Sz?t:window.matchMedia(e).matches;return t});return(0,ef.useEffect)(()=>{let t=window.matchMedia(e),r=()=>{i(t.matches)};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}},[e]),n}function SM(e){return cl.create({baseURL:e,timeout:3e4})}let ST=new Set(["common","delete","get","head","post","put","patch","options","purge","link","unlink"]);function SB(){return globalThis.process?.env?.NODE_ENV}function SP(e){if(void 0===e)return[];let t="function"==typeof e.toJSON?e.toJSON():e,r=[];return!function e(t,r){if(null!==t&&"object"==typeof t)for(let[n,i]of Object.entries(t)){if(null==i)continue;let t=n.toLowerCase();if("common"===t){e(i,r);continue}ST.has(t)||r.push([n,String(i)])}}(t,r),r}let SR=function({clientName:e,configureFunctionName:t,defaultBaseURL:r}){let n=SM(r),i=SM(r),a=null,o=null,s=null,l=null,u=null,c=null;async function d(e,t){let r=function(e,t){var r;let n;if(void 0===t.data||(r=t.data,"undefined"!=typeof FormData&&r instanceof FormData||null!==r&&"object"==typeof r&&(r.constructor?.name==="FormData"||"function"==typeof r.getBoundary)))return t;let i=cy.from(t.headers);return i.has("Content-Type")||void 0!==(n=e.defaults.headers.common)&&cy.from(n).has("Content-Type")||i.set("Content-Type","application/json"),t.headers=i,t}(e,function(e){let t=cy.from(e.headers);if(null!==s){let e=s()?.trim();e&&!t.has("Authorization")&&t.set("Authorization",`Bearer ${e}`)}if(null!==c)for(let[e,r]of Object.entries(c()))r&&!t.has(e)&&t.set(e,r);return e.headers=t,e}({...t}));try{return await e.request(r)}catch(e){throw e}}async function f(e){return d(e.skipUnauthorizedRecovery?i:n,function(e){let{skipUnauthorizedRecovery:t,...r}=e;return r}(e))}let p=async e=>f({...e,skipUnauthorizedRecovery:!0});function h(){return null!==a}return{configureClientRuntime:function(t){let r,o=(r=function(e){let t=SP(e);if(0===t.length)return;let r=new Map;for(let[e,n]of t)r.set(e.toLowerCase(),n);return Object.fromEntries(Array.from(r.entries()).sort(([e],[t])=>e.localeCompare(t)))}(t.headers),JSON.stringify({...void 0!==t.baseURL?{baseURL:t.baseURL}:{},...void 0!==t.timeout?{timeout:t.timeout}:{},...void 0!==r?{headers:r}:{}}));if("{}"!==o){if(null!==a){if(a===o)return;let t=`${e} already configured. Existing: ${a}. New: ${o}.`;if("production"===SB())return void console.warn(t);throw Error(t)}for(let e of[n,i])void 0!==t.baseURL&&(e.defaults.baseURL=t.baseURL),void 0!==t.timeout&&(e.defaults.timeout=t.timeout),void 0!==t.headers&&function(e,t){let r=e.defaults.headers,n=r.common,i=cy.from(n);for(let[e,r]of SP(t))i.set(e,r);r.common=i.toJSON(),e.defaults.headers=r}(e,t.headers);a=o}},configureAccessTokenResolverRuntime:function(e){s=e},configureUnauthorizedHandlerRuntime:function(e){if(l=e,null===e){null!==o&&(n.interceptors.response.eject(o),o=null),u=null;return}null===o&&(o=n.interceptors.response.use(e=>e,async e=>{let t=e.config;if(e.response?.status!==401||null===l||void 0===t||t._apiRetried)return Promise.reject(e);if(null===u){let t=l;if(null===t)return Promise.reject(e);u=Promise.resolve().then(()=>t(e,{requestWithoutUnauthorizedRecovery:p})).finally(()=>{u=null})}try{if(!await u)return Promise.reject(e);t._apiRetried=!0;let r=cy.from(t.headers);return r.delete("Authorization"),t.headers=r,d(n,t)}catch{return Promise.reject(e)}}))},configureHeadersResolverRuntime:function(e){c=e},isClientConfiguredRuntime:h,assertClientConfiguredRuntime:function(){if(!h())throw Error(`${e} is not configured. Call ${t}(...) before making requests.`)},resetClientForTestsRuntime:function(){let e;if("test"!==(e=SB())&&"testing"!==e)throw Error("resetApiClientForTests() can only be called in test environment.");n=SM(r),i=SM(r),a=null,o=null,s=null,l=null,u=null,c=null},requestRuntime:f,requestWithoutUnauthorizedRecovery:p,addResponseInterceptorRuntime:function(e,t){return n.interceptors.response.use(e,t)}}}({clientName:"@vizbl/api client",configureFunctionName:"configureApiClient",defaultBaseURL:"https://api.vizbl.us"});SR.configureClientRuntime,SR.configureAccessTokenResolverRuntime,SR.configureHeadersResolverRuntime,SR.configureUnauthorizedHandlerRuntime,SR.isClientConfiguredRuntime,SR.assertClientConfiguredRuntime,SR.resetClientForTestsRuntime;let S_=SR.requestRuntime;async function SI(e){return S_(e)}SR.requestWithoutUnauthorizedRecovery,SR.addResponseInterceptorRuntime;let SO=(e={})=>[{url:"/obj/Fetch"},...e?[e]:[]];async function SL(e,t={}){let{client:r=SI,...n}=t;return(await r({method:"POST",url:"/obj/Fetch",data:e,...n})).data}async function SF(e,t={}){let{client:r=SI,...n}=t;return(await r({method:"POST",url:"/obj/GetPublic",data:e,...n})).data}var SD=JSON.parse('{"camera":{"fov":45},"floor":{"z":95.5,"pitchDeg":-87.55,"rollDeg":-165.58},"walls":[{"id":"backWall","z":382.9,"pitchDeg":-1.89,"rollDeg":18.64},{"id":"rightWall","z":313.5,"pitchDeg":0.02,"rollDeg":-70.54}]}'),SN=JSON.parse('{"camera":{"fov":45},"floor":{"z":98.1,"pitchDeg":-86.84,"rollDeg":178.03},"walls":[{"id":"backWall","z":520.5,"pitchDeg":-2.08,"rollDeg":17.51},{"id":"rightWall","z":395.0,"pitchDeg":-1.93,"rollDeg":-70.18}]}'),Sj=JSON.parse('{"camera":{"fov":45},"floor":{"z":82.1,"pitchDeg":-87.1,"rollDeg":174.1},"walls":[{"id":"backWall","z":316.2,"pitchDeg":-1.96,"rollDeg":-25.61}]}'),SH=JSON.parse('{"camera":{"fov":45},"floor":{"z":115.7,"pitchDeg":-89.36,"rollDeg":-16.93},"walls":[{"id":"backWall","z":429.6,"pitchDeg":1.97,"rollDeg":3.45},{"id":"rightWall","z":229.3,"pitchDeg":0.37,"rollDeg":-89.13}]}'),SU=JSON.parse('{"camera":{"fov":45},"floor":{"z":146.2,"pitchDeg":-89.12,"rollDeg":-51.52},"walls":[{"id":"backWall","z":400.4,"pitchDeg":0.26,"rollDeg":34.77},{"id":"rightWall","z":421.7,"pitchDeg":0.85,"rollDeg":-55.93}]}'),SG=JSON.parse('{"camera":{"fov":45},"maskUrl":"https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/room-example-4-mask.png","floor":{"z":76.41371488571167,"pitchDeg":-88.08860421180725,"rollDeg":-1.1962583474814892},"walls":[]}'),Sq=JSON.parse('{"camera":{"fov":45},"maskUrl":"https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/room-example-5-mask.png","floor":{"z":86.81210279464722,"pitchDeg":-84.67234969139099,"rollDeg":-4.7433755826205015e-2},"walls":[]}'),S$=JSON.parse('{"camera":{"fov":45},"maskUrl":"https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/room-example-6-mask.png","floor":{"z":124.4072675704956,"pitchDeg":-70.20531892776489,"rollDeg":-0.7209355384111404},"walls":[]}');let SV=new F.Vector3(1,0,0),SJ=new F.Vector3(0,1,0),SK=new F.Vector3(0,0,1);function SQ(e,t,r,n){let i=SK.clone().applyAxisAngle(SV,F.MathUtils.degToRad(t)).applyAxisAngle(SJ,F.MathUtils.degToRad(r)).applyQuaternion(n.quaternion).normalize(),a=new F.Quaternion().setFromUnitVectors(SK,i);return{position:n.position.clone().addScaledVector(i,-(e*SZ)).toArray(),quaternion:a.toArray()}}function SW(e){return{camera:e.camera,maskUrl:e.maskUrl,surfaces:[{...e.floor,id:S0},...e.walls]}}let SX=0,SY="https://vizbl-2.s3.us-west-1.amazonaws.com/public/room-example/",SZ=.01,S0="floor",S1=[{id:"poster-room-example-1",name:"",image:`${SY}room-example-11.jpg`,config:SW(SD)},{id:"poster-room-example-2",name:"",image:`${SY}room-example-12.jpg`,config:SW(SN)},{id:"poster-room-example-3",name:"",image:`${SY}room-example-13.jpg`,config:SW(Sj)},{id:"poster-room-example-4",name:"",image:`${SY}room-example-14.jpg`,config:SW(SH)},{id:"poster-room-example-5",name:"",image:`${SY}room-example-15.jpg`,config:SW(SU)}],S2=[{id:"room-example-4",name:"Hallway",image:`${SY}room-example-4.png`,config:SW(SG)},{id:"room-example-5",name:"Dining room",image:`${SY}room-example-5.png`,config:SW(Sq)},{id:"room-example-6",name:"Office",image:`${SY}room-example-6.png`,config:SW(S$)}],S5=["RcSd3KphTyq_JQEjNCqKQA","gu0109ftQmS-UQkwcW010Q","nOfGLIZcRVeU93wOkHWSbg","ozzH5I2kQMW20ao-33C86A","DBA4wR-zT92vjtuOk9varg"],S3="97f6e38a-d092-41b4-ba62-1a870b54e964";function S4(){let{t:e}=nQ();return(0,ef.useMemo)(()=>[{value:0,label:e("mattingOptions.none")},{value:.05,label:`5 ${e("units.cm")}`}],[e])}let S9=(0,ef.createContext)(null);function S6({children:e,src:t,tinuuid:r,type:n,width:i,height:a,name:o}){let s=function(){let{t:e}=nQ();return(0,ef.useMemo)(()=>[{value:.025,label:`2.5 ${e("units.cm")}`},{value:.05,label:`5 ${e("units.cm")}`}],[e])}(),l=S4(),u="carpet"===n?S2:S1,[c,d]=(0,ef.useState)(u),[f,p]=(0,ef.useState)(u[0].id),h=(0,ef.useMemo)(()=>c.find(e=>e.id===f)??c[0],[c,f]),[m,v]=(0,ef.useState)(r),[g,b]=(0,ef.useState)(null),[w,y]=(0,ef.useState)(s[0].value),[x,C]=(0,ef.useState)(l[0].value),[A,S]=(0,ef.useState)(0),[k,z]=(0,ef.useState)(0),[E,M]=(0,ef.useState)(!1),[T,B]=(0,ef.useState)(null),[P,R]=(0,ef.useState)(()=>({layoutReady:!1,placementReady:!1,materialReady:!1,artifactsReady:"poster"===n,assetsReady:!1,prepareReady:"poster"===n})),_=(0,ef.useRef)(null),I="poster"!==n,O=rH({queryKey:SO({tinuuid:m??void 0}),enabled:I&&null===g&&!!m,retry:!1,queryFn:async()=>{if(!m)throw Error("Tinuuid is required.");return SL({tinuuid:m})}},rS,void 0).data??null,L=g?.native?.glbUrl??null,F=(0,ef.useCallback)(e=>{R(t=>Object.assign({},t,e))},[]);(0,ef.useEffect)(()=>{I&&(v(r),b(null))},[r,I]),(0,ef.useEffect)(()=>{I&&O&&null===g&&b(O.materials?.[0]??null)},[g,O,I]);let D=(0,ef.useMemo)(()=>({src:t,glbUrl:L,tinuuid:m,type:n,name:o,rooms:c,setRooms:d,room:h,setRoomId:p,material:g,setTinuuid:v,width:i,height:a,frameWidth:w,matting:x,angle:A,rotation:k,isDragging:E,containerRef:T,setMaterial:b,setFrameWidth:y,setMatting:C,setAngle:S,setRotation:z,setIsDragging:M,setContainerRef:B,resourceRef:_,sceneLoad:P,patchSceneLoad:F}),[t,L,m,n,o,c,h,g,i,a,w,x,A,k,T,E,P,F]);return(0,em.jsx)(S9,{value:D,children:e})}function S8(){let e=(0,ef.use)(S9);if(!e)throw Error("useRoomViewer must be used within a RoomViewerProvider");return e}function S7({className:e,...t}){return(0,em.jsx)(n6,{"data-slot":"label",className:Sm("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function ke({className:e,...t}){return(0,em.jsx)("div",{"data-slot":"field-group",className:Sm("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),...t})}let kt=cz("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function kr({className:e,orientation:t="vertical",...r}){return(0,em.jsx)("div",{role:"group","data-slot":"field","data-orientation":t,className:Sm(kt({orientation:t}),e),...r})}function kn({className:e,...t}){return(0,em.jsx)(S7,{"data-slot":"field-label",className:Sm("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e),...t})}function ki({className:e,...t}){return(0,em.jsx)("div",{"data-slot":"field-label",className:Sm("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",e),...t})}function ka({...e}){return(0,em.jsx)(o6,{"data-slot":"select",...e})}function ko({...e}){return(0,em.jsx)(st,{"data-slot":"select-value",...e})}function ks({className:e,size:t="default",children:r,...n}){return(0,em.jsxs)(o7,{"data-slot":"select-trigger","data-size":t,className:Sm("flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border bg-background-white shadow-sm outline-none transition-colors cursor-pointer","border-border-medium","text-text-dark","hover:border-border-dark","focus-visible:border-border-dark","aria-invalid:border-border-red","disabled:cursor-not-allowed disabled:border-border-medium disabled:bg-background-base disabled:opacity-40","data-[size=default]:h-11 data-[size=default]:px-2 data-[size=default]:py-2.5 data-[size=default]:typo-base-16","data-[size=md]:h-9 data-[size=md]:px-2 data-[size=md]:py-2 data-[size=md]:typo-base-14","data-[size=sm]:h-[1.875rem] data-[size=sm]:px-2 data-[size=sm]:typo-base-12","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6 [&_svg:not([class*='text-'])]:text-text-dark",e),...n,children:[r,(0,em.jsx)(sr,{asChild:!0,children:(0,em.jsx)(Sg,{className:"size-6"})})]})}function kl({className:e,children:t,position:r="item-aligned",align:n="center",portalContainer:i,...a}){return(0,em.jsx)(sn,{container:i,children:(0,em.jsxs)(sa,{"data-slot":"select-content",className:Sm("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border bg-background-white text-text-dark shadow-md","border-border-medium","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:n,...a,children:[(0,em.jsx)(kc,{}),(0,em.jsx)(sm,{className:Sm("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,em.jsx)(kd,{})]})})}function ku({className:e,children:t,...r}){return(0,em.jsxs)(sA,{"data-slot":"select-item",className:Sm("relative flex w-full cursor-pointer select-none items-center gap-2 rounded-md py-2.5 pr-8 pl-3 outline-hidden","typo-base-16 text-text-sub","focus:bg-background-base focus:text-text-dark","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6 [&_svg:not([class*='text-'])]:text-text-dark","*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[(0,em.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-6 items-center justify-center",children:(0,em.jsx)(sE,{children:(0,em.jsx)(Sv,{className:"size-5"})})}),(0,em.jsx)(sk,{children:t})]})}function kc({className:e,...t}){return(0,em.jsx)(sT,{"data-slot":"select-scroll-up-button",className:Sm("flex cursor-default items-center justify-center py-1",e),...t,children:(0,em.jsx)(cR,{className:"size-4"})})}function kd({className:e,...t}){return(0,em.jsx)(sP,{"data-slot":"select-scroll-down-button",className:Sm("flex cursor-default items-center justify-center py-1",e),...t,children:(0,em.jsx)(c_,{className:"size-4"})})}function kf({className:e,...t}){let{containerRef:r,material:n,setMaterial:i,setTinuuid:a}=S8(),{t:o}=nQ(),s=function({queries:e,...t},r){let n=rB(void 0),i=ef.useContext(rL),a=ef.useContext(rR),o=ef.useMemo(()=>e.map(e=>{let t=n.defaultQueryOptions(e);return t._optimisticResults=i?"isRestoring":"optimistic",t}),[e,n,i]);o.forEach(e=>{rF(e),r_(e,a)}),rI(a);let[s]=ef.useState(()=>new rG(n,o,t)),[l,u,c]=s.getOptimisticResult(o,t.combine),d=!i&&!1!==t.subscribed;ef.useSyncExternalStore(ef.useCallback(e=>d?s.subscribe(rf.batchCalls(e)):t0,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),ef.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=l.some((e,t)=>rN(o[t],e))?l.flatMap((e,t)=>{let r=o[t];if(r){let t=new rS(n,r);if(rN(r,e))return rj(r,t,a);rD(e,i)&&rj(r,t,a)}return[]}):[];if(f.length>0)throw Promise.all(f);let p=l.find((e,t)=>{let r=o[t];return r&&rO({result:e,errorResetBoundary:a,throwOnError:r.throwOnError,query:n.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(p?.error)throw p.error;return u(c())}({queries:S5.map(e=>({queryKey:SO({tinuuid:e}),queryFn:()=>SL({tinuuid:e})}))});return(0,ef.useEffect)(()=>{let e=s[0]?.data,t=e?.materials?.[0],r=e?.tinuuid;null===n&&t&&r&&(i(t),a(r))},[n,s,i,a]),(0,em.jsxs)(kr,{className:Sm("w-fit",e),...t,children:[(0,em.jsx)(kn,{className:"text-xs text-text-sub font-medium",children:o("material")}),(0,em.jsxs)(ka,{value:n?.hid??void 0,onValueChange:e=>{let t=s.find(t=>t.data?.materials?.[0]?.hid===e)?.data;if(!t?.materials?.[0]||!t.tinuuid)return;let r=t.materials[0],n=t.tinuuid;i(r),a(n)},children:[(0,em.jsx)(ks,{className:"w-[145px]",size:"md",children:(0,em.jsxs)(ko,{placeholder:o("chooseMaterial"),children:[(0,em.jsx)("div",{className:"size-5 rounded-full border border-border-light",style:{backgroundColor:`#${n?.miniature?.color?.hex}`}}),n?.miniature?.color?.name]})}),(0,em.jsx)(kl,{portalContainer:r,children:s.map(e=>{let t=e.data;if(!t?.materials?.[0]||!t.tinuuid)return null;let r=t.materials[0];return(0,em.jsxs)(ku,{value:r.hid,children:[(0,em.jsx)("div",{className:"size-5 rounded-full border border-border-light",style:{backgroundColor:`#${r?.miniature?.color?.hex}`}}),r.miniature?.color?.name]},`${t.tinuuid}-${r.hid}`)})})]})]})}function kp({className:e,...t}){return(0,em.jsx)(dc,{"data-slot":"radio-group",className:Sm("grid gap-3",e),...t})}function kh({checked:e,className:t,...r}){return(0,em.jsx)("div",{className:Sm("absolute top-1/2 left-1/2 size-6 -translate-x-1/2 -translate-y-1/2","flex items-center justify-center rounded-full",e?"bg-lime-400":"bg-background-base-2",t),...r,children:(0,em.jsx)(cI,{className:"text-constant-white size-3.5",strokeWidth:4})})}function km({className:e,variant:t="default",...r}){return(0,em.jsxs)(df,{"data-slot":"radio-group-item",className:Sm("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50","check"===t&&"size-6","inverted"===t&&"size-5 border-button-outline data-[state=checked]:border-border-red data-[state=checked]:border-4 data-[state=checked]:bg-constant-white cursor-pointer transition-all",e),...r,children:["check"===t&&(0,em.jsx)("div",{className:"relative",children:(0,em.jsx)(kh,{})}),"inverted"!==t&&(0,em.jsx)(dp,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:"check"===t?(0,em.jsx)(kh,{checked:!0}):(0,em.jsx)(cO,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})]})}let kv=cz("cursor-pointer inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-xl transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary--hover active:bg-primary--pressed disabled:bg-primary--disabled disabled:opacity-20",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary--hover active:bg-secondary--pressed disabled:bg-secondary--disabled disabled:opacity-20",outline:"border border-button-outline bg-transparent text-foreground hover:border-button-outline-hover active:bg-button-outline-pressed disabled:border-border-dark disabled:opacity-20",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent--pressed",contrast:"bg-contrast text-contrast-foreground hover:bg-contrast--hover active:bg-contrast--pressed disabled:bg-contrast--disabled disabled:opacity-30"},size:{default:"h-9 px-3.5 typo-button-normal [&_svg]:size-5",sm:"h-8 px-3 typo-button-small [&_svg]:size-4",lg:"h-11 px-4 typo-button-big [&_svg]:size-6",icon:"size-9 rounded-full [&_svg]:size-5","icon-sm":"size-8 rounded-full [&_svg]:size-4","icon-lg":"size-11 rounded-full [&_svg]:size-6"}},defaultVariants:{variant:"default",size:"default"}});function kg({className:e,variant:t,size:r,asChild:n=!1,...i}){return(0,em.jsx)(n?fc:"button",{"data-slot":"button",className:Sm(kv({variant:t,size:r,className:e})),...i})}function kb({className:e,children:t,...r}){let{className:n,onReachEnd:i,...a}=r.swiperOptions??{},{t:o}=nQ(),[s,l]=(0,ef.useState)(null),[u,c]=(0,ef.useState)(!0),[d,f]=(0,ef.useState)(!1),[p,h]=(0,ef.useState)(!1),m=(0,ef.useCallback)(e=>{c(e.isBeginning),f(e.isEnd),h(e.isLocked)},[]),v=(0,ef.useCallback)(e=>{l(e),m(e)},[m]),g=(0,ef.useCallback)(e=>{f(!0),i?.(e)},[i]);return(0,em.jsxs)("div",{className:Sm("relative w-full overflow-hidden",e),children:[(0,em.jsx)(fa,{className:Sm("w-full py-5",n),slidesPerView:"auto",slidesPerGroup:2,onSwiper:v,onReachBeginning:()=>c(!0),onReachEnd:g,onFromEdge:m,onLock:()=>h(!0),onUnlock:()=>h(!1),onResize:m,slidesOffsetBefore:24,slidesOffsetAfter:24,spaceBetween:12,...a,children:t}),(0,em.jsxs)(kg,{className:Sm("absolute top-1/2 left-8 -translate-y-1/2 z-1",{hidden:u||p}),variant:"contrast",size:"icon",onClick:()=>s?.slidePrev(),children:[(0,em.jsx)(cL,{}),(0,em.jsx)("span",{className:"sr-only",children:o("previousSlide")})]}),(0,em.jsxs)(kg,{className:Sm("absolute top-1/2 right-8 -translate-y-1/2 z-1",{hidden:d||p}),variant:"contrast",size:"icon",onClick:()=>s?.slideNext(),children:[(0,em.jsx)(cF,{}),(0,em.jsx)("span",{className:"sr-only",children:o("nextSlide")})]})]})}function kw(e){return e.hid??""}function ky({className:e,...t}){let{material:r,tinuuid:n,setMaterial:i,setTinuuid:a}=S8(),o=r?kw(r):"",s=SE("(max-width: 640px)"),{data:l,isFetchingNextPage:u,fetchNextPage:c,hasNextPage:d}=rH({queryKey:["room-viewer","carpet-materials",S3],queryFn:({pageParam:e})=>SF({page:e,owners:[S3]}),initialPageParam:1,getNextPageParam:(e,t,r)=>{if(e.objs?.length)return r+1},getPreviousPageParam:(e,t,r)=>{if(!(r<=1))return r-1}},rJ,void 0),f=(0,ef.useMemo)(()=>l?.pages.flatMap(e=>e.objs??[])??[],[l]),p=f.find(e=>e.tinuuid===n),h=f.find(e=>e.tinuuid&&e.materials?.[0]);(0,ef.useEffect)(()=>{if(null!==r)return;let e=p??h,t=e?.materials?.[0];e&&t&&e.tinuuid&&(i(t),a(e.tinuuid))},[h,p,r,i,a]);let m=(0,ef.useCallback)(()=>{d&&!u&&c()},[c,d,u]);return(0,em.jsx)("div",{className:Sm(e),...t,children:(0,em.jsx)(kp,{value:o||void 0,onValueChange:e=>{let t=f.find(t=>t.materials?.some(t=>kw(t)===e)),r=t?.materials?.find(t=>kw(t)===e);t&&r&&t.tinuuid&&(i(r),a(t.tinuuid))},children:(0,em.jsx)(kb,{swiperOptions:{onReachEnd:m,className:"py-2 sm:py-5"},children:f.flatMap(e=>e.materials?.map(t=>{let r=kw(t);return e.tinuuid?(0,em.jsx)(fo,{className:Sm("sm:w-25! w-18! transition-transform duration-200",r!==o&&"hover:scale-110"),children:(0,em.jsxs)(kn,{htmlFor:`material-${r}`,className:"size-full flex flex-col gap-1 has-data-[state=checked]:bg-transparent",children:[(0,em.jsxs)("div",{className:"size-full relative sm:h-19 h-13 rounded-[0.75rem] overflow-hidden grid place-items-center sm:block",children:[(0,em.jsx)("img",{src:t.previews?.[0]?.subRes?.small??t.previews?.[0]?.url,alt:t.name??"",className:"size-full object-cover"}),(0,em.jsx)(km,{value:r,id:`material-${r}`,variant:"check",className:Sm("absolute sm:top-1.75 sm:right-1.75",{"sr-only":r!==o})})]}),!s&&(0,em.jsx)("span",{className:Sm("block w-full text-xs text-left text-text-light truncate",{"text-text-dark":r===o}),children:t.name})]})},`${e.tinuuid}-${r}`):null})??[])})})})}let kx=(0,ef.createContext)(null),kC=(0,ef.createContext)(null);function kA({value:e,defaultValue:t,onValueChange:r,...n}){let[i,a]=(0,ef.useState)(t),o=e??i,s=(0,ef.useMemo)(()=>({value:o}),[o]),l=(0,ef.useCallback)(t=>{r?.(t),void 0===e&&a(t)},[r,e]);return(0,em.jsx)(kx,{value:s,children:(0,em.jsx)(f_,{"data-slot":"tabs",value:o,onValueChange:l,...n})})}let kS=cz("cursor-pointer group inline-flex items-center justify-center shrink-0 whitespace-nowrap outline-none transition-colors relative z-10 text-text-base [&_svg]:text-icons-normal [&_svg]:transition-colors hover:text-text-dark hover:[&_svg]:text-icons-dark active:bg-background-base-3 active:text-text-dark active:[&_svg]:text-icons-dark data-[state=active]:bg-background-white data-[state=active]:text-text-dark data-[state=active]:[&_svg]:text-icons-dark disabled:pointer-events-none disabled:opacity-50 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",{variants:{size:{default:"h-7 rounded-lg px-2 typo-button-normal active:rounded-lg data-[state=active]:rounded-lg [&_svg]:size-4",sm:"h-6 rounded-[4px] px-2 typo-button-small active:rounded-lg data-[state=active]:rounded-lg [&_svg]:size-4",lg:"h-9 rounded-lg px-3 typo-button-big active:rounded-lg data-[state=active]:rounded-lg [&_svg]:size-6"}},defaultVariants:{size:"default"}}),kk=cz("relative inline-flex items-center rounded-xl bg-background-base-2",{variants:{size:{default:"p-1",sm:"p-[3px]",lg:"p-1"}},defaultVariants:{size:"default"}});function kz({className:e,children:t,size:r="default",...n}){let i=(0,ef.use)(kx),a=(0,ef.useRef)(null),o=(0,ef.useRef)(new Map),s=(0,ef.useRef)(null),l=(0,ef.useRef)(i?.value),u=(0,ef.useRef)(null),c=(0,ef.useCallback)(()=>{u.current=null;let e=s.current;if(!e)return;let t=l.current;if(!t){e.style.opacity="0";return}let r=a.current,n=o.current.get(t);if(!r||!n){e.style.opacity="0";return}let i=Math.round(n.offsetLeft),c=Math.round(n.offsetTop),d=Math.round(n.offsetWidth),f=Math.round(n.offsetHeight);e.style.transform=`translate3d(${i}px, ${c}px, 0)`,e.style.width=`${d}px`,e.style.height=`${f}px`,e.style.opacity="1"},[]),d=(0,ef.useCallback)(()=>{null===u.current&&(u.current=requestAnimationFrame(()=>{c()}))},[c]),f=(0,ef.useCallback)((e,t)=>{t?o.current.set(e,t):o.current.delete(e),d()},[d]);(0,ef.useLayoutEffect)(()=>{l.current=i?.value,null!==u.current&&(cancelAnimationFrame(u.current),u.current=null),c()},[i?.value,c]),(0,ef.useEffect)(()=>{let e=a.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(()=>d());t.observe(e);let r=i?.value;if(r){let e=o.current.get(r);e&&t.observe(e)}return()=>{t.disconnect()}},[d,i?.value]),(0,ef.useEffect)(()=>()=>{null!==u.current&&cancelAnimationFrame(u.current)},[]);let p=(0,ef.useMemo)(()=>({registerTrigger:f,size:r}),[f,r]);return(0,em.jsx)(fO,{ref:a,"data-slot":"tabs-list",className:Sm(kk({size:r}),e),...n,children:(0,em.jsxs)(kC,{value:p,children:[(0,em.jsx)("div",{ref:s,"aria-hidden":!0,"data-slot":"tabs-indicator",className:"pointer-events-none absolute top-0 left-0 z-0 rounded-lg bg-background-white opacity-0 transition-[transform,width,height,opacity] duration-[250ms] ease-out motion-reduce:transition-none"}),t]})})}function kE({className:e,size:t,children:r,value:n,...i}){let a=(0,ef.use)(kC),o=(0,ef.useRef)(null),s=t??a?.size??"default",l=Sm("relative z-10 inline-flex items-center justify-center","lg"===s?"gap-1.5":"gap-1");return(0,ef.useLayoutEffect)(()=>{if(a&&n)return a.registerTrigger(n,o.current),()=>{a.registerTrigger(n,null)}},[a,n]),(0,em.jsx)(fF,{ref:o,"data-slot":"tabs-trigger",className:Sm(kS({size:s}),"data-[state=active]:bg-transparent",e),value:n,...i,children:(0,em.jsx)("span",{"data-slot":"tabs-trigger-content",className:l,children:r})})}function kM({className:e,...t}){let{matting:r,setMatting:n}=S8(),{t:i}=nQ(),a=S4();return(0,em.jsxs)(kr,{className:Sm("w-fit",e),...t,children:[(0,em.jsx)(kn,{className:"text-xs text-text-sub font-medium",children:i("matting")}),(0,em.jsx)(kA,{value:r.toString(),onValueChange:e=>n(Number(e)),children:(0,em.jsx)(kz,{children:a.map(e=>(0,em.jsx)(kE,{value:e.value.toString(),children:e.label},e.value))})})]})}function kT({className:e,...t}){let{t:r}=nQ(),{rooms:n,room:i,setRoomId:a,setRooms:o,type:s}=S8(),l=SE("(max-width: 640px)"),u=(0,ef.useId)(),c=(0,ef.useCallback)((e,t)=>r(`rooms.${t}`,{defaultValue:e}),[r]),d=(0,ef.useCallback)(e=>{let t=e.target.files?.[0];if(e.target.value="",!t)return;let r=URL.createObjectURL(t),n={id:(SX+=1,`room-custom-${SX}`),name:t.name,image:r,config:{camera:{fov:45},surfaces:[{id:S0,z:0,pitchDeg:-90,rollDeg:0}]}};o(e=>[n,...e]),a(n.id)},[a,o]);return(0,em.jsx)("div",{className:Sm(e),...t,children:(0,em.jsx)(kp,{value:i.id,onValueChange:a,children:(0,em.jsxs)(kb,{swiperOptions:{className:"py-2 sm:py-5 pb-3 sm:pb-5"},children:["carpet"===s&&(0,em.jsx)(fo,{className:"sm:w-25! w-21! h-auto",children:(0,em.jsxs)(kn,{htmlFor:u,className:Sm("flex size-full cursor-pointer items-center justify-center rounded-[0.75rem] border border-dashed border-muted-foreground/40 bg-transparent px-2 text-center text-xs leading-tight text-muted-foreground transition-colors hover:border-foreground/40 hover:text-foreground"),children:[r("uploadOwnPhoto"),(0,em.jsx)("input",{id:u,type:"file",accept:"image/*",className:"sr-only",onChange:d})]})}),n.map(e=>(0,em.jsx)(fo,{className:Sm("sm:w-25! w-21! transition-transform duration-200",e.id!==i.id&&"hover:scale-110"),children:(0,em.jsxs)(kn,{htmlFor:`room-${e.id}`,className:"size-full flex flex-col gap-1 has-data-[state=checked]:bg-transparent",children:[(0,em.jsxs)("div",{className:"size-full relative h-17 sm:h-19 rounded-[0.75rem] overflow-hidden",children:[(0,em.jsx)("img",{src:e.image,alt:c(e.name,e.id),className:"size-full object-cover",crossOrigin:"anonymous"}),(0,em.jsx)(km,{value:e.id,id:`room-${e.id}`,variant:"check",className:Sm("absolute top-1.75 right-1.75",{"sr-only":e.id!==i.id})})]}),"carpet"===s&&!l&&(0,em.jsx)("span",{className:Sm("block w-full text-xs text-left text-text-light truncate",{"text-text-dark":e.id===i.id}),children:c(e.name,e.id)})]})},e.id))]})})})}function kB({className:e,...t}){let{type:r}=S8(),n=SE("(max-width: 640px)");return(0,em.jsxs)("div",{className:Sm("flex sm:items-end pl-0 overflow-hidden sm:flex-row flex-col py-3 sm:py-0",e),...t,children:[(0,em.jsx)(kT,{className:Sm("shrink-0",{"sm:min-w-120.5 min-w-full":"carpet"===r,grow:"poster"===r})}),"poster"===r&&(0,em.jsxs)("div",{className:"hidden gap-5 pr-6 pb-5 md:flex",children:[(0,em.jsx)(kf,{}),(0,em.jsx)(kM,{})]}),"carpet"===r&&(0,em.jsxs)(em.Fragment,{children:[!n&&(0,em.jsx)(Sk,{orientation:"vertical"}),(0,em.jsx)(ky,{})]})]})}function kP({className:e,...t}){let{t:r}=nQ();return(0,em.jsxs)("div",{className:Sm("group inline-flex gap-2 text-sm text-muted-foreground","hover:text-text-dark","transition-colors duration-200 ease-in-out",e),...t,children:[(0,em.jsx)("div",{className:"size-5 flex items-center justify-center rounded-full bg-icons-light group-hover:bg-icons-red transition-colors duration-200 ease-in-out",children:(0,em.jsx)(SC,{className:"size-4.25 text-icons-white"})}),r("poweredBy")]})}function kR({className:e,...t}){let{name:r}=S8();return(0,em.jsxs)("div",{className:Sm("h-16 grid gap-5 items-center px-6 sm:grid-cols-3",e),...t,children:[(0,em.jsx)("div",{className:"truncate",children:r}),(0,em.jsx)("div",{className:"hidden justify-center sm:flex",children:(0,em.jsx)(kP,{})}),(0,em.jsx)("div",{className:"hidden sm:block"})]})}function k_({...e}){return(0,em.jsx)(sV,{"data-slot":"popover",...e})}function kI({...e}){return(0,em.jsx)(sQ,{"data-slot":"popover-trigger",...e})}function kO({className:e,align:t="center",sideOffset:r=4,portalContainer:n,...i}){return(0,em.jsx)(sZ,{container:n,children:(0,em.jsx)(s1,{"data-slot":"popover-content",align:t,sideOffset:r,className:Sm("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...i})})}function kL({className:e,defaultValue:t,value:r,min:n=0,max:i=100,variant:a="default","aria-label":o,"aria-labelledby":s,...l}){let u=(0,ef.useMemo)(()=>Array.isArray(r)?r:Array.isArray(t)?t:[n],[r,t,n]);return(0,em.jsxs)(lu,{"data-slot":"slider",defaultValue:t,value:r,min:n,max:i,"data-variant":a,"aria-label":o,"aria-labelledby":s,className:Sm("relative flex w-full touch-none cursor-pointer items-center select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...l,children:[(0,em.jsx)(lv,{"data-slot":"slider-track",className:Sm("relative grow overflow-hidden rounded-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5","editor"===a?"bg-border-light data-[orientation=horizontal]:h-0.5":"bg-muted data-[orientation=horizontal]:h-1.5"),children:(0,em.jsx)(lb,{"data-slot":"slider-range",className:Sm("absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full","editor"===a?"bg-background-blue":"bg-primary")})}),Array.from({length:u.length},(e,t)=>(0,em.jsx)(ly,{"data-slot":"slider-thumb","aria-label":o,"aria-labelledby":s,className:Sm("ring-ring/50 block shrink-0 rounded-full border bg-white transition-[color,box-shadow] focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50","editor"===a?"size-3 border-background-blue shadow-none hover:ring-2 focus-visible:ring-2":"size-4 border-primary shadow-sm hover:ring-4 focus-visible:ring-4")},t))]})}function kF({...e}){return(0,em.jsx)(pX,{"data-slot":"dialog",...e})}function kD({...e}){return(0,em.jsx)(p2,{"data-slot":"dialog-portal",...e})}function kN({...e}){return(0,em.jsx)(hs,{"data-slot":"dialog-close",...e})}function kj({className:e,...t}){return(0,em.jsx)(p3,{"data-slot":"dialog-overlay",className:Sm("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function kH({className:e,children:t,showCloseButton:r=!0,portalContainer:n,...i}){return(0,em.jsxs)(kD,{"data-slot":"dialog-portal",container:n,children:[(0,em.jsx)(kj,{}),(0,em.jsxs)(p8,{"data-slot":"dialog-content",className:Sm("bg-background-containers data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-6 rounded-3xl border-0 p-6 shadow-[var(--shadow-login)] duration-200 outline-none sm:max-w-120 sm:p-10",e),...i,children:[t,r&&(0,em.jsxs)(hs,{"data-slot":"dialog-close",className:"focus-visible:ring-ring/30 absolute top-4 right-4 inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-icons-light transition-colors hover:text-icons-normal focus-visible:text-icons-dark focus-visible:ring-2 focus-visible:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[(0,em.jsx)(cD,{className:"size-6"}),(0,em.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function kU({className:e,...t}){return(0,em.jsx)("div",{"data-slot":"dialog-header",className:Sm("flex flex-col gap-2 text-left",e),...t})}function kG({className:e,...t}){return(0,em.jsx)(hn,{"data-slot":"dialog-title",className:Sm("typo-base-18 text-text-dark",e),...t})}function kq({className:e,...t}){return(0,em.jsx)(ha,{"data-slot":"dialog-description",className:Sm("typo-base-16 text-text-light",e),...t})}kz.displayName=fO.displayName,kE.displayName=fF.displayName,fN.displayName;let k$=/oklch\(([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\)/;function kV(e,t){let r=e.match(k$);return r?{l:Number.parseFloat(r[1]),c:Number.parseFloat(r[2]),h:Number.parseFloat(r[3])}:{l:t[0],c:t[1],h:t[2]}}function kJ({data:e,foreground:t,background:r,robustness:n="M",className:i,...a}){let[o,s]=(0,ef.useState)(null);return((0,ef.useEffect)(()=>{(async()=>{try{let i=getComputedStyle(document.documentElement),a=t??i.getPropertyValue("--foreground"),o=r??i.getPropertyValue("--background"),l=kV(a,[.21,.006,285.885]),u=kV(o,[.985,0,0]),c=await vK.toString(e,{type:"svg",color:{dark:vV(vJ({mode:"oklch",...l})),light:vV(vJ({mode:"oklch",...u}))},width:200,errorCorrectionLevel:n,margin:0});s(c)}catch(e){console.error(e)}})()},[e,t,r,n]),o)?(0,em.jsx)("div",{className:Sm("size-full","[&_svg]:size-full",i),dangerouslySetInnerHTML:{__html:o},...a}):null}let kK=new wP,kQ=kK.getDevice(),kW=kK.getOS(),kX="iOS"===kW.name,kY="Android"===kW.name,kZ="mobile"===kQ.type;function k0({className:e,...t}){let{src:r,tinuuid:n,type:i,width:a,height:o,name:s,containerRef:l,resourceRef:u}=S8(),{t:c,i18n:d}=nQ(),[f,p]=(0,ef.useState)(""),[h,m]=(0,ef.useState)(""),[v,g]=(0,ef.useState)(!1),[b,w]=(0,ef.useState)(!1),y=(0,ef.useRef)(null),x=d.resolvedLanguage??d.language,C=(0,ef.useMemo)(()=>{if("carpet"===i&&n){let e=new URL("https://integrations.vizbl.com/room-viewer");return e.searchParams.set("type",i),e.searchParams.set("tinuuid",n),e.searchParams.set("name",s),e.searchParams.set("language",x),e.toString()}let e=new URL("https://viewer.vizbl.com/poster/app/index.html");return e.searchParams.set("texture",r),e.searchParams.set("texture_width",(100*a).toString()),e.searchParams.set("texture_height",(100*o).toString()),e.toString()},[r,n,i,a,o,s,x]),A=(0,ef.useMemo)(()=>{if(!n)return null;let e=new URL("https://appclip.apple.com/id");return e.searchParams.set("p","com.us.vizbl.Clip"),e.searchParams.set("tinuuid",n),e.toString()},[n]),S=async()=>{if("carpet"===i)return n?kX&&A?void window.location.assign(A):void g(!0):void 0;let e=y.current,t=u.current;if(e&&t)if(e.canActivateAR)try{w(!0);let e=t.clone(!0);if(e.position.set(0,0,0),kX){let t=new g_,r=await t.parseAsync(e),n=new File([r],"scene.usdz",{type:"model/vnd.usdz+zip"});p(URL.createObjectURL(n))}else{let t=new gG,r=await t.parseAsync(e,{binary:!0}),n=new File([r],"scene.glb",{type:"model/gltf-binary"});m(URL.createObjectURL(n))}}finally{w(!1)}else g(!0)};return((0,ef.useEffect)(()=>((""!==f||""!==h)&&y.current?.activateAR(),()=>{""!==f&&URL.revokeObjectURL(f),""!==h&&URL.revokeObjectURL(h)}),[f,h]),kY&&kZ||"carpet"===i&&!n)?null:(0,em.jsxs)("div",{className:Sm(e),...t,children:[(0,em.jsx)(kg,{variant:"contrast",disabled:b,onClick:S,children:c("ar.viewInPlace")}),(0,em.jsx)(kF,{open:v,onOpenChange:g,children:(0,em.jsxs)(kH,{className:"gap-6 sm:max-w-120",showCloseButton:!1,portalContainer:l,children:[(0,em.jsx)("div",{className:"flex items-center justify-center p-10 bg-constant-white rounded-2xl",children:(0,em.jsx)(kJ,{className:"size-48",robustness:"H",data:C})}),(0,em.jsx)("p",{className:"text-lg text-center text-text-sub font-medium",children:c("ar.scanQrCode")}),(0,em.jsx)(kN,{asChild:!0,children:(0,em.jsx)(kg,{variant:"contrast",size:"lg",children:c("close")})})]})}),(0,em.jsx)("model-viewer",{ref:y,className:"fixed w-px h-px opacity-0 pointer-events-none",src:h,iosSrc:f,reveal:"manual",ar:!0,cameraControls:!0,arPlacement:"wall",arModes:"webxr",arScale:"fixed",shadowIntensity:1,interactionPromptThreshold:100})]})}let k1={width:void 0,height:void 0};function k2(e,t,r){return e[t]?Array.isArray(e[t])?e[t][0][r]:e[t][r]:"contentBoxSize"===t?e.contentRect["inlineSize"===r?"width":"height"]:void 0}async function k5(e,t){return new Promise((r,n)=>{e.toBlob(e=>{e?r(e):n(Error(t))},"image/png")})}function k3({ref:e}){let{camera:t,gl:r,invalidate:n,scene:i}=xr();return(0,ef.useImperativeHandle)(e,()=>({capture:async()=>(n(),await new Promise(e=>requestAnimationFrame(()=>e())),r.render(i,t),k5(r.domElement,"Failed to create scene share image"))}),[t,r,n,i]),null}function k4(e){return 2===e||3===e}function k9(e,t,r){let n=SQ(e.z,e.pitchDeg,e.rollDeg,r),i=function(e){let t=0,r=0,n=0;for(let i=0;i<e.height;i++)for(let a=0;a<e.width;a++)k4(e.classes[i*e.width+a])&&(t+=a+.5,r+=i+.5,n+=1);return 0===n?null:{x:t/n,y:r/n}}(t);if(!i)return null;let a=new F.Quaternion(...n.quaternion),o=new F.Vector3(0,0,1).applyQuaternion(a).normalize(),s=new F.Vector3(...n.position),l=i.x/t.width*2-1,u=1-i.y/t.height*2,c=new F.Raycaster;c.setFromCamera(new F.Vector2(l,u),r);let d=new F.Plane().setFromNormalAndCoplanarPoint(o,s),f=c.ray.intersectPlane(d,new F.Vector3);return f?(f.addScaledVector(o,.05),{position:f.toArray(),quaternion:n.quaternion}):null}function k6(e){return new Promise((t,r)=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>t(n),n.onerror=()=>r(Error(`Failed to load image from ${e}`)),n.src=e})}function k8(e,t,r){let n=document.createElement("canvas");n.width=t,n.height=r;let i=n.getContext("2d");if(!i)throw Error("Failed to get 2D context for segmentation mask.");let a=i.createImageData(t,r),o=t*r;for(let t=0;t<o;t++){let r=k4(e[t]);a.data[4*t]=255,a.data[4*t+1]=255,a.data[4*t+2]=255,a.data[4*t+3]=255*!!r}return i.putImageData(a,0,0),n}async function k7(e){let t=await k6(e),r=document.createElement("canvas");r.width=t.naturalWidth||t.width,r.height=t.naturalHeight||t.height;let n=r.getContext("2d");if(!n)throw Error("Failed to get 2D context for segmentation mask.");n.drawImage(t,0,0);let{width:i,height:a}=r,o=n.getImageData(0,0,i,a),s=new Uint8Array(i*a);for(let e=0;e<s.length;e++){let t=o.data[4*e+3];s[e]=2*(t>127)}return{segmentationClasses:{classes:s,width:i,height:a}}}async function ze(e){let t=k8(e.classes,e.width,e.height),r=await k5(t,"Failed to serialize segmentation mask PNG.");return URL.createObjectURL(r)}async function zt(e){let t=await new Promise((t,r)=>{let n=new FileReader,i=new ArrayBuffer(e.byteLength);new Uint8Array(i).set(e),n.onerror=()=>{r(Error("Failed to encode carpet inference payload."))},n.onload=()=>{if("string"!=typeof n.result)return void r(Error("Failed to encode carpet inference payload."));let e=n.result.indexOf(",");t(e>=0?n.result.slice(e+1):n.result)},n.readAsDataURL(new Blob([i]))}),r=await fetch("https://api.vizbl.com/inference/carpet/run-raw",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!r.ok){let e=await r.text();throw Error(`Carpet inference request failed: ${r.status} ${r.statusText}${e?` - ${e}`:""}`)}return r.json()}async function zr(e){let t=function(e){let t=document.createElement("canvas");t.width=512,t.height=512;let r=t.getContext("2d");if(!r)throw Error("Failed to get 2D context for carpet inference input.");r.drawImage(e,0,0,512,512);let n=r.getImageData(0,0,512,512),i=function(e){let t={R:0,G:1,B:2},r="GBR".split("");if(3!==r.length||r.some(e=>!(e in t)))throw Error("Unsupported carpet inference input channel order: GBR");return r.map(e=>t[e])}(0),a=new Uint8Array(786432);for(let e=0,t=0;e<1048576;e+=4,t+=3)a[t]=n.data[e+i[0]],a[t+1]=n.data[e+i[1]],a[t+2]=n.data[e+i[2]];return a}(await k6(e)),r=await zt(t),n=function(e){let t=function(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}(e);if(262144!==t.length)throw Error(`Unsupported segmentation classes length: ${t.length}`);return{classes:t,width:512,height:512}}(r.segmentationClasses);return{segmentationClasses:n,floor:{z:400*Number(r.deltaZ??0),pitchDeg:-(90*Number(r.pitch??0)),rollDeg:45*Number(r.roll??0)}}}function zn(e){let t=e.getContext("2d");if(!t)throw Error("Failed to get 2D context for carpet lighting map.");return t}function zi(e,t){let r=document.createElement("canvas");return r.width=e,r.height=t,r}function za(e,t){let r=zi(e,t),n=zn(r),i=n.createImageData(e,t);for(let r=0;r<e*t;r++){let e=4*r;i.data[e]=128,i.data[e+1]=128,i.data[e+2]=128,i.data[e+3]=255}return n.putImageData(i,0,0),r}function zo(e){let t=new Uint8ClampedArray(e.width*e.height);for(let r=0;r<t.length;r++){let n=4*r,i=e.data[n],a=e.data[n+1],o=e.data[n+2];t[r]=Math.round(.299*i+.587*a+.114*o)}return t}function zs(e,t,r,n,i){let a=function(e,t,r){let n=zi(t,r),i=zn(n),a=i.createImageData(t,r);for(let n=0;n<t*r;n++){let t=Math.max(0,Math.min(255,Math.round(Number(e[n]??0)))),r=4*n;a.data[r]=t,a.data[r+1]=t,a.data[r+2]=t,a.data[r+3]=255}return i.putImageData(a,0,0),n}(e,t,r),o=zn(zi(n,i));return o.imageSmoothingEnabled=!0,o.drawImage(a,0,0,n,i),zo(o.getImageData(0,0,n,i))}function zl(e,t){let r=new Float32Array(e.length);for(let n=0;n<e.length;n++)r[n]=Number(e[n]??0)*(Number(t[n]??0)/255);return r}function zu(e,t){let r=new Uint8ClampedArray(e.length);for(let n=0;n<e.length;n++){let i=Number(t[n]??0)/255;if(i<=1e-4){r[n]=0;continue}let a=Number(e[n]??0)/i;r[n]=Math.max(0,Math.min(255,Math.round(a)))}return r}function zc(e){return 2===e||3===e}async function zd(e,t,r={}){let{width:n,height:i,classes:a}=t;if(n<=0||i<=0||0===a.length)return za(n,i);let o=await k6(e),s=zn(zi(n,i));s.drawImage(o,0,0,n,i);let l=zo(s.getImageData(0,0,n,i)),u=function(e){let t=new Uint8ClampedArray(e.length);for(let r=0;r<e.length;r++)t[r]=255*!!zc(e[r]);return t}(a),c=Math.max(1,Math.round(r.scaleDiv??8)),d=Math.max(1,Math.round(r.filterDiameter??4)),f=r.sigmaColor??70,p=r.sigmaSpace??70,h=Math.max(1,Math.round(n/c)),m=Math.max(1,Math.round(i/c)),v=zs(zl(l,u),n,i,h,m),g=zs(u,n,i,h,m),b=zs(zl(function(e,t,r,n,i,a,o){let s=new Uint8ClampedArray(e.length),l=Math.max(1,Math.floor(n/2)),u=Math.max(1,i),c=Math.max(1,a),d=2*u*u,f=2*c*c,p=new Float32Array((2*l+1)*(2*l+1)),h=0;for(let e=-l;e<=l;e++)for(let t=-l;t<=l;t++){let r=t*t+e*e;p[h]=Math.exp(-r/f),h+=1}for(let n=0;n<r;n++)for(let i=0;i<t;i++){let a=n*t+i;if(Number(o?.[a]??255)/255<=1e-4){s[a]=0;continue}let u=e[a],c=0,f=0,h=0;for(let a=-l;a<=l;a++){let s=Math.max(0,Math.min(r-1,n+a));for(let r=-l;r<=l;r++){let n=Math.max(0,Math.min(t-1,i+r)),a=s*t+n,l=Number(o?.[a]??255)/255;if(l<=1e-4){h+=1;continue}let m=e[a],v=m-u,g=Math.exp(-(v*v)/d),b=p[h]*g*l;c+=b,f+=m*b,h+=1}}s[a]=c>0?Math.round(f/c):u}return s}(zu(v,g),h,m,d,f,p,g),g),h,m,n,i),w=zu(b,zs(g,h,m,n,i)),y=0,x=0;for(let e=0;e<a.length;e++)zc(a[e])&&(x+=w[e],y+=1);if(0===y)return za(n,i);let C=x/y,A=function(e,t,r){let n=1/0,i=-1/0;for(let r=0;r<t.length;r++){if(!zc(t[r]))continue;let a=e[r];n=Math.min(n,a),i=Math.max(i,a)}return Number.isFinite(n)&&Number.isFinite(i)?{maxBrightnessDelta:Math.max(0,i-r),maxShadowDelta:Math.max(0,r-n)}:{maxBrightnessDelta:0,maxShadowDelta:0}}(w,a,C);if(A.maxBrightnessDelta<=0&&A.maxShadowDelta<=0)return za(n,i);let S=zi(n,i),k=zn(S),z=k.createImageData(n,i);for(let e=0;e<a.length;e++){let t=4*e,r=128;zc(a[e])&&(r=function(e,t){if(0===e)return 128;let r=e<0,n=r?t.maxShadowDelta:t.maxBrightnessDelta;return n<=0?128:Math.max(0,Math.min(255,Math.round(255*(.5+e/n*.5*(r?1.15:.8)))))}(w[e]-C,A)),z.data[t]=r,z.data[t+1]=r,z.data[t+2]=r,z.data[t+3]=255}return k.putImageData(z,0,0),S}let zf="uRoomMask",zp="uRoomLightingMap",zh="uRoomLightingStrength",zm="uRoomMaskResolution",zv="uRoomMaskTextureSize";function zg(e,t=F.LinearFilter,r=F.LinearFilter){let n=new F.CanvasTexture(e);return n.needsUpdate=!0,n.minFilter=t,n.magFilter=r,n.generateMipmaps=!1,n}async function zb(e,t,r,n){"function"==typeof e.compileAsync?await e.compileAsync(t,r,n):e.compile(t,r,n)}let zw=Math.PI/2;function zy({glbUrl:e,position:t,quaternion:r,maskCanvas:n,lightingCanvas:i}){let{resourceRef:a,rotation:o,setIsDragging:s,patchSceneLoad:l}=S8(),{gl:u,size:c,camera:d,scene:f,invalidate:p}=xr(),h=xJ(e),m=(0,ef.useRef)(null),v=(0,ef.useRef)(null),g=(0,ef.useRef)(null),b=(0,ef.useRef)(null),w=(0,ef.useRef)(null);null===m.current&&(m.current=new F.Vector2(1,1)),null===v.current&&(v.current=new F.Vector2(1,1));let y=m.current,x=v.current,C=(0,ef.useMemo)(()=>h.scene.clone(!0),[h]),A=(0,ef.useMemo)(()=>F.MathUtils.degToRad(o),[o]),S=(0,ef.useCallback)(()=>{s(!0)},[s]),k=(0,ef.useCallback)(()=>{s(!1)},[s]);return(0,ef.useLayoutEffect)(()=>{let e=zg(n,F.NearestFilter,F.NearestFilter);return g.current=e,x.set(Math.max(1,n.width),Math.max(1,n.height)),()=>{g.current===e&&(g.current=null),e.dispose()}},[n,x]),(0,ef.useLayoutEffect)(()=>{let e=zg(i);return b.current=e,()=>{b.current===e&&(b.current=null),e.dispose()}},[i]),(0,ef.useLayoutEffect)(()=>{let e,t=(e=new Set,C.traverse(t=>{if(!t.isMesh||!t.material)return;if(Array.isArray(t.material)){let r=t.material.map(t=>{let r=t.clone();return e.add(r),r});t.material=r;return}let r=t.material.clone();e.add(r),t.material=r}),Array.from(e));return w.current=t,()=>{w.current===t&&(w.current=null),t.forEach(e=>e.dispose())}},[C]),(0,ef.useLayoutEffect)(()=>{u.getDrawingBufferSize(y),y.set(Math.max(1,y.x),Math.max(1,y.y))},[u,y,c.width,c.height]),(0,ef.useLayoutEffect)(()=>{let e=g.current,t=b.current,r=w.current;if(!e||!t||!r)return;let n=r.map(r=>{let n,i,a;return n=r.onBeforeCompile,i=r.customProgramCacheKey.bind(r),a=r.transparent,r.onBeforeCompile=(i,a)=>{n?.call(r,i,a),i.uniforms[zf]={value:e},i.uniforms[zp]={value:t},i.uniforms[zh]={value:.18},i.uniforms[zm]={value:y},i.uniforms[zv]={value:x},i.fragmentShader=i.fragmentShader.replace("#include <common>",`
|
|
147
147
|
#include <common>
|
|
148
148
|
uniform sampler2D ${zf};
|
|
149
149
|
uniform sampler2D ${zp};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizbl/room-viewer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.24",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react": "^19.2.0",
|
|
19
19
|
"react-dom": "^19.2.0",
|
|
20
20
|
"selector-observer": "^2.1.6",
|
|
21
|
-
"@vizbl/react-room-viewer": "0.0.
|
|
21
|
+
"@vizbl/react-room-viewer": "0.0.16"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@google/model-viewer": "4.2.0",
|