@mapcomponents/three 1.8.11 → 1.8.19-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`maplibre-gl`),u=require(`three`);u=c(u,1);let d=require(`react`),f=c(d,1);d=c(d);let p=require(`@mapcomponents/react-maplibre`),m=require(`react/jsx-runtime`),h=require(`@mui/system`),g=require(`@emotion/styled`);g=c(g,1),require(`@emotion/react`);var _=Math.PI/180,v=180/Math.PI,y=class{static updateWorldMatrix(e,t=null){if(!e)return new u.Matrix4;let n=t??e.getCenter(),r=l.MercatorCoordinate.fromLngLat(n),i=r.meterInMercatorCoordinateUnits();return new u.Matrix4().compose(new u.Vector3(r.x,r.y,r.z),new u.Quaternion,new u.Vector3(i,-i,i))}static toScenePositionMercator(e,t){return new u.Vector3(t.x,t.y,t.z).applyMatrix4(e)}static toMapPositionMercator(e,t){let n=t.clone().applyMatrix4(e);return new l.MercatorCoordinate(n.x,n.y,n.z)}static toScenePosition(e,t,n){return this.toScenePositionMercator(e,l.MercatorCoordinate.fromLngLat(t,n))}static toMapPosition(e,t){let n=this.toMapPositionMercator(e,t),r=n.toLngLat();return[r.lng,r.lat,n.toAltitude()]}static degToRad(e){return e*_}static radToDeg(e){return e*v}},b=class extends u.DataTextureLoader{constructor(e){super(e),this.type=u.HalfFloatType}parse(e){let t=function(e,t){switch(e){case 1:throw Error(`THREE.HDRLoader: Read Error: `+(t||``));case 2:throw Error(`THREE.HDRLoader: Write Error: `+(t||``));case 3:throw Error(`THREE.HDRLoader: Bad File Format: `+(t||``));default:case 4:throw Error(`THREE.HDRLoader: Memory Error: `+(t||``))}},n=function(e,t,n){t||=1024;let r=e.pos,i=-1,a=0,o=``,s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=s.indexOf(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require("maplibre-gl"),u=require("three");u=c(u,1);let d=require("react"),f=c(d,1);d=c(d);let p=require("@mapcomponents/react-maplibre"),m=require("react/jsx-runtime"),h=require("@mui/system"),g=require("@emotion/styled");g=c(g,1),require("@emotion/react");var _=Math.PI/180,v=180/Math.PI,y=class{static updateWorldMatrix(e,t=null){if(!e)return new u.Matrix4;let n=t??e.getCenter(),r=l.MercatorCoordinate.fromLngLat(n),i=r.meterInMercatorCoordinateUnits();return new u.Matrix4().compose(new u.Vector3(r.x,r.y,r.z),new u.Quaternion,new u.Vector3(i,-i,i))}static toScenePositionMercator(e,t){return new u.Vector3(t.x,t.y,t.z).applyMatrix4(e)}static toMapPositionMercator(e,t){let n=t.clone().applyMatrix4(e);return new l.MercatorCoordinate(n.x,n.y,n.z)}static toScenePosition(e,t,n){return this.toScenePositionMercator(e,l.MercatorCoordinate.fromLngLat(t,n))}static toMapPosition(e,t){let n=this.toMapPositionMercator(e,t),r=n.toLngLat();return[r.lng,r.lat,n.toAltitude()]}static degToRad(e){return e*_}static radToDeg(e){return e*v}},b=class extends u.DataTextureLoader{constructor(e){super(e),this.type=u.HalfFloatType}parse(e){let t=function(e,t){switch(e){case 1:throw Error(`THREE.HDRLoader: Read Error: `+(t||``));case 2:throw Error(`THREE.HDRLoader: Write Error: `+(t||``));case 3:throw Error(`THREE.HDRLoader: Bad File Format: `+(t||``));default:case 4:throw Error(`THREE.HDRLoader: Memory Error: `+(t||``))}},n=function(e,t,n){t||=1024;let r=e.pos,i=-1,a=0,o=``,s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=s.indexOf(`
2
2
  `))&&a<t&&r<e.byteLength;)o+=s,a+=s.length,r+=128,s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<i?(!1!==n&&(e.pos+=a+i+1),o+s.slice(0,i)):!1},r=function(e){let r=/^#\?(\S+)/,i=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,s=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,c={valid:0,string:``,comments:``,programtype:`RGBE`,format:``,gamma:1,exposure:1,width:0,height:0},l,u;for((e.pos>=e.byteLength||!(l=n(e)))&&t(1,`no header found`),(u=l.match(r))||t(3,`bad initial token`),c.valid|=1,c.programtype=u[1],c.string+=l+`
3
3
  `;l=n(e),!1!==l;){if(c.string+=l+`
4
4
  `,l.charAt(0)===`#`){c.comments+=l+`
5
- `;continue}if((u=l.match(i))&&(c.gamma=parseFloat(u[1])),(u=l.match(a))&&(c.exposure=parseFloat(u[1])),(u=l.match(o))&&(c.valid|=2,c.format=u[1]),(u=l.match(s))&&(c.valid|=4,c.height=parseInt(u[1],10),c.width=parseInt(u[2],10)),c.valid&2&&c.valid&4)break}return c.valid&2||t(3,`missing format specifier`),c.valid&4||t(3,`missing image size specifier`),c},i=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&s<e.byteLength;){s+4>e.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n<c&&s<e.byteLength;){r=e[s++];let i=r>128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e<r;e++)u[n++]=t}else u.set(e.subarray(s,s+r),n),n+=r,s+=r}let f=i;for(let e=0;e<f;e++){let t=0;a[o]=u[e+t],t+=i,a[o+1]=u[e+t],t+=i,a[o+2]=u[e+t],t+=i,a[o+3]=u[e+t],o+=4}d--}return a},a=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=e[t+0]*i,n[r+1]=e[t+1]*i,n[r+2]=e[t+2]*i,n[r+3]=1},o=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=u.DataUtils.toHalfFloat(Math.min(e[t+0]*i,65504)),n[r+1]=u.DataUtils.toHalfFloat(Math.min(e[t+1]*i,65504)),n[r+2]=u.DataUtils.toHalfFloat(Math.min(e[t+2]*i,65504)),n[r+3]=u.DataUtils.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;let c=r(s),l=c.width,d=c.height,f=i(s.subarray(s.pos),l,d),p,m,h;switch(this.type){case u.FloatType:h=f.length/4;let e=new Float32Array(h*4);for(let t=0;t<h;t++)a(f,t*4,e,t*4);p=e,m=u.FloatType;break;case u.HalfFloatType:h=f.length/4;let t=new Uint16Array(h*4);for(let e=0;e<h;e++)o(f,e*4,t,e*4);p=t,m=u.HalfFloatType;break;default:throw Error(`THREE.HDRLoader: Unsupported type: `+this.type)}return{width:l,height:d,data:p,header:c.string,gamma:c.gamma,exposure:c.exposure,type:m}}setDataType(e){return this.type=e,this}load(e,t,n,r){function i(e,n){switch(e.type){case u.FloatType:case u.HalfFloatType:e.colorSpace=u.LinearSRGBColorSpace,e.minFilter=u.LinearFilter,e.magFilter=u.LinearFilter,e.generateMipmaps=!1,e.flipY=!0;break}t&&t(e,n)}return super.load(e,i,n,r)}},x=class{createScene(e=!0){let t=new u.Scene;if(e){let e=new u.DirectionalLight(16777215,4);e.position.set(1,2,3),t.add(e);let n=new u.AmbientLight(16777215,.2);t.add(n)}return t}createGroup(e,t){let n=new u.Group;return n.name=t,e.add(n),n}createCamera(e,t){let n=new u.PerspectiveCamera;n.name=t;let r=new u.Group;return r.name=`${t}-parent`,r.add(n),e.add(r),n}buildPerspectiveMatrix(e,t,n,r){let i=1/Math.tan(e/2),a=1/(n-r);return new Float64Array([i/t,0,0,0,0,i,0,0,0,0,(r+n)*a,-1,0,0,2*r*n*a,0])}buildOrthographicMatrix(e,t,n,r,i,a){let o=1/(e-t),s=1/(n-r),c=1/(i-a);return new Float64Array([-2*o,0,0,0,0,-2*s,0,0,0,0,2*c,0,(e+t)*o,(r+n)*s,(a+i)*c,1])}calcProjectionMatrix(e,t,n,r){let i=e.centerOffset,a=e.width/e.height,o=this.buildPerspectiveMatrix(t,a,n,r);if(o[8]=-i.x*2/e.width,o[9]=i.y*2/e.height,!e.isOrthographic)return new u.Matrix4().fromArray(o);let s=.5*e.height/Math.tan(t/2)*Math.tan(t*.5),c=s*a,l=this.buildOrthographicMatrix(-c-i.x,c-i.x,-s+i.y,s+i.y,n,r),d=Math.min(e.pitch/15,1),f=d*d*d*d*d,p=new Float64Array(16);for(let e=0;e<16;e++)p[e]=(1-f)*l[e]+f*o[e];return new u.Matrix4().fromArray(p)}updateCameraForRender(e,t,n,r,i){let a=t.transform,{fov:o,nearZ:s,farZ:c,aspect:l}=this.extractCameraParams(n,a);e.fov=y.radToDeg(o),e.aspect=l,e.near=s,e.far=c,e._cleanProjectionMatrix=this.buildPerspectiveMatrix(o,l,s,c);let d=this.extractMVPMatrix(n,r),f=this.calcProjectionMatrix(a,o,s,c);e.projectionMatrix.copy(f),e.projectionMatrixInverse.copy(f).invert();let p=new u.Matrix4().multiplyMatrices(e.projectionMatrixInverse,d);e.matrixWorld.copy(p).invert(),e.matrixWorldInverse.copy(p),e.matrixAutoUpdate=!1,e.matrixWorldAutoUpdate=!1,this.updateCameraTransform(e)}extractCameraParams(e,t){let n=t.width/t.height;if(e.fov!==void 0)return{fov:e.fov,nearZ:e.nearZ,farZ:e.farZ,aspect:n};let r=t.cameraToCenterDistance;return{fov:r&&t.height?2*Math.atan(t.height/2/r):.6435,nearZ:t.nearZ||.1,farZ:t.farZ||1e4,aspect:n}}extractMVPMatrix(e,t){let n;if(e.defaultProjectionData?.mainMatrix)n=new u.Matrix4().fromArray(Object.values(e.defaultProjectionData.mainMatrix));else if(e.modelViewProjectionMatrix)n=new u.Matrix4().fromArray(e.modelViewProjectionMatrix);else{let t=Array.isArray(e)?e:Array.from(e);n=new u.Matrix4().fromArray(t)}return new u.Matrix4().multiplyMatrices(n,t)}updateCameraTransform(e){let t=new u.Vector3,n=new u.Quaternion,r=new u.Vector3;e.matrixWorld.decompose(t,n,r),e.position.copy(t),e.rotation.copy(new u.Euler().setFromQuaternion(n,`YXZ`))}createEnvTexture(e,t){e?.endsWith(`.hdr`)&&new b().load(e,e=>{e.mapping=u.EquirectangularReflectionMapping,t.environment=e,t.environmentRotation.x=Math.PI/2})}},S=new u.Vector3,C=new u.Matrix4,ee=new u.Matrix4,w=new u.Vector3,T=new u.Vector3,te=class{constructor(e={}){let t=this,n,r,i,a,o={objects:new WeakMap},s=e.element===void 0?document.createElement(`div`):e.element;s.style.overflow=`hidden`,this.domElement=s,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),C.copy(t.matrixWorldInverse),ee.multiplyMatrices(t.projectionMatrix,C),l(e,e,t),this.sortObjects&&f(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,a=r/2,s.style.width=e+`px`,s.style.height=t+`px`};function c(e){e.isCSS2DObject&&(e.element.style.display=`none`);for(let t=0,n=e.children.length;t<n;t++)c(e.children[t])}function l(e,n,r){if(e.visible===!1){c(e);return}if(e.isCSS2DObject){S.setFromMatrixPosition(e.matrixWorld),S.applyMatrix4(ee);let c=S.z>=-1&&S.z<=1&&e.layers.test(r.layers)===!0,l=e.element;l.style.display=c===!0?``:`none`,c===!0&&(e.onBeforeRender(t,n,r),l.style.transform=`translate(`+-100*e.center.x+`%,`+-100*e.center.y+`%)translate(`+(S.x*i+i)+`px,`+(-S.y*a+a)+`px)`,l.parentNode!==s&&s.appendChild(l),e.onAfterRender(t,n,r));let d={distanceToCameraSquared:u(r,e)};o.objects.set(e,d)}for(let t=0,i=e.children.length;t<i;t++)l(e.children[t],n,r)}function u(e,t){return w.setFromMatrixPosition(e.matrixWorld),T.setFromMatrixPosition(t.matrixWorld),w.distanceToSquared(T)}function d(e){let t=[];return e.traverseVisible(function(e){e.isCSS2DObject&&t.push(e)}),t}function f(e){let t=d(e).sort(function(e,t){return e.renderOrder===t.renderOrder?o.objects.get(e).distanceToCameraSquared-o.objects.get(t).distanceToCameraSquared:t.renderOrder-e.renderOrder}),n=t.length;for(let e=0,r=t.length;e<r;e++)t[e].element.style.zIndex=n-e}}},E=class{renderer;labelRenderer;constructor(e,t){if(!t||t.isContextLost())throw Error(`WebGL context is lost or invalid`);this.renderer=new u.WebGLRenderer({alpha:!0,antialias:!0,canvas:e.getCanvas(),context:t}),this.renderer.autoClear=!1,this.renderer.shadowMap.enabled=!0,this.labelRenderer=this.createLabelRenderer(e)}createLabelRenderer(e){let t=e.getContainer(),n=new te;return n.setSize(t.clientWidth,t.clientHeight),n.domElement.style.position=`absolute`,n.domElement.style.top=`0px`,n.domElement.style.pointerEvents=`none`,e._container.appendChild(n.domElement),e.on(`resize`,()=>{let{clientWidth:t,clientHeight:r}=e.getContainer();n.setSize(t,r)}),n}getRenderer(){return this.renderer}render(e,t){this.renderer.resetState(),this.renderer.render(e,t),this.labelRenderer.render(e,t)}dispose(){this.labelRenderer.domElement?.parentNode?.removeChild(this.labelRenderer.domElement),this.renderer?.dispose()}},D=(0,d.createContext)({scene:void 0,camera:void 0,renderer:void 0,map:void 0,sceneRoot:void 0,worldMatrix:void 0,worldMatrixInv:void 0}),O=()=>(0,d.useContext)(D),ne=({mapId:e,id:t,refCenter:n,envTexture:r,envIntensity:i=1,createLight:a=!0,children:o,beforeId:s})=>{let{map:c}=(0,p.useMap)({mapId:e,waitForLayer:s}),[l,f]=(0,d.useState)(),[h,g]=(0,d.useState)(),[_,v]=(0,d.useState)(),[b,S]=(0,d.useState)(),[C,ee]=(0,d.useState)(),[w,T]=(0,d.useState)(),te=(0,d.useRef)(new x),O=(0,d.useRef)(new u.Matrix4),ne=(0,d.useRef)(new u.Matrix4),k=(0,d.useRef)(void 0);return(0,d.useEffect)(()=>{if(!c)return;let e=te.current,o=e.createScene(a),l=e.createGroup(o,`scene-root`),u=e.createCamera(l,`camera-for-render`),d={id:t,type:`custom`,renderingMode:`3d`,onAdd:(t,a)=>{let s=new E(t,a);k.current=s,v(s);let c=n||t.getCenter();O.current=y.updateWorldMatrix(t,c),ne.current=O.current.clone().invert(),ee(O.current),T(ne.current),r&&e.createEnvTexture(r,o),o.environmentIntensity=i,t.triggerRepaint()},render:(t,n)=>{!k.current||!o||!u||(e.updateCameraForRender(u,c.map,n,O.current,ne.current),k.current.render(o,u),c.triggerRepaint())},onRemove:()=>{k.current&&=(k.current.dispose(),void 0),v(void 0)}};return c.getLayer(t)||c.addLayer(d,s),f(o),g(u),S(l),()=>{c.getLayer(t)&&c.removeLayer(t)}},[c,t]),(0,d.useEffect)(()=>{l&&r&&te.current.createEnvTexture(r,l)},[l,r]),(0,d.useEffect)(()=>{l&&(l.environmentIntensity=i)},[l,i]),(0,d.useEffect)(()=>{c&&n&&(O.current=y.updateWorldMatrix(c.map,n),ne.current=O.current.clone().invert(),ee(O.current),T(ne.current),c.triggerRepaint())},[c,n]),(0,m.jsx)(D.Provider,{value:{scene:l,camera:h,renderer:_,map:c?.map,sceneRoot:b,worldMatrix:C,worldMatrixInv:w},children:o})};function k(e,t){if(t===u.TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===u.TriangleFanDrawMode||t===u.TriangleStripDrawMode){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}let r=n.count-2,i=[];if(t===u.TriangleFanDrawMode)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);let a=e.clone();return a.setIndex(i),a.clearGroups(),a}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:`,t),e}function A(e){let t=new Map,n=new Map,r=e.clone();return j(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function j(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)j(e.children[r],t.children[r],n)}var M=class extends u.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new oe(e)}),this.register(function(e){return new I(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new ae(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new L(e)}),this.register(function(e){return new z(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new he(e,P.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new he(e,P.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new ge(e)})}load(e,t,n,r){let i=this,a;if(this.resourcePath!==``)a=this.resourcePath;else if(this.path!==``){let t=u.LoaderUtils.extractUrlBase(e);a=u.LoaderUtils.resolveURL(t,this.path)}else a=u.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new u.FileLoader(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){try{i.parse(n,a,function(n){t(n),i.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i,a={},o={},s=new TextDecoder;if(typeof e==`string`)i=JSON.parse(e);else if(e instanceof ArrayBuffer)if(s.decode(new Uint8Array(e,0,4))===_e){try{a[P.KHR_BINARY_GLTF]=new be(e)}catch(e){r&&r(e);return}i=JSON.parse(a[P.KHR_BINARY_GLTF].content)}else i=JSON.parse(s.decode(e));else i=e;if(i.asset===void 0||i.asset.version[0]<2){r&&r(Error(`THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.`));return}let c=new Ke(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name||console.error(`THREE.GLTFLoader: Invalid plugin found: missing name`),o[t.name]=t,a[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],n=i.extensionsRequired||[];switch(t){case P.KHR_MATERIALS_UNLIT:a[t]=new F;break;case P.KHR_DRACO_MESH_COMPRESSION:a[t]=new xe(i,this.dracoLoader);break;case P.KHR_TEXTURE_TRANSFORM:a[t]=new Se;break;case P.KHR_MESH_QUANTIZATION:a[t]=new Ce;break;default:n.indexOf(t)>=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function re(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function N(e,t,n){let r=e.json.materials[t];return r.extensions&&r.extensions[n]?r.extensions[n]:null}var P={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,KHR_MESHOPT_COMPRESSION:`KHR_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},ie=class{constructor(e){this.parser=e,this.name=P.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n=`light:`+e,r=t.cache.get(n);if(r)return r;let i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e],o,s=new u.Color(16777215);a.color!==void 0&&s.setRGB(a.color[0],a.color[1],a.color[2],u.LinearSRGBColorSpace);let c=a.range===void 0?0:a.range;switch(a.type){case`directional`:o=new u.DirectionalLight(s),o.target.position.set(0,0,-1),o.add(o.target);break;case`point`:o=new u.PointLight(s),o.distance=c;break;case`spot`:o=new u.SpotLight(s),o.distance=c,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle===void 0?0:a.spot.innerConeAngle,a.spot.outerConeAngle=a.spot.outerConeAngle===void 0?Math.PI/4:a.spot.outerConeAngle,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw Error(`THREE.GLTFLoader: Unexpected light type: `+a.type)}return o.position.set(0,0,0),Re(o,a),a.intensity!==void 0&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||`light_`+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if(e===`light`)return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(e){return n._getNodeRef(t.cache,i,e)})}},F=class{constructor(){this.name=P.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(e,t,n){let r=[];e.color=new u.Color(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],u.LinearSRGBColorSpace),e.opacity=t[3]}i.baseColorTexture!==void 0&&r.push(n.assignTexture(e,`map`,i.baseColorTexture,u.SRGBColorSpace))}return Promise.all(r)}},ae=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);return n===null||n.emissiveStrength!==void 0&&(t.emissiveIntensity=n.emissiveStrength),Promise.resolve()}},oe=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(n.clearcoatFactor!==void 0&&(t.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatMap`,n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatRoughnessMap`,n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(r.push(this.parser.assignTexture(t,`clearcoatNormalMap`,n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){let e=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new u.Vector2(e,e)}return Promise.all(r)}},I=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_DISPERSION}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);return n===null||(t.dispersion=n.dispersion===void 0?0:n.dispersion),Promise.resolve()}},L=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.iridescenceFactor!==void 0&&(t.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceMap`,n.iridescenceTexture)),n.iridescenceIor!==void 0&&(t.iridescenceIOR=n.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceThicknessMap`,n.iridescenceThicknessTexture)),Promise.all(r)}},se=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_SHEEN}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(t.sheenColor=new u.Color(0,0,0),t.sheenRoughness=0,t.sheen=1,n.sheenColorFactor!==void 0){let e=n.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],u.LinearSRGBColorSpace)}return n.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenColorMap`,n.sheenColorTexture,u.SRGBColorSpace)),n.sheenRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenRoughnessMap`,n.sheenRoughnessTexture)),Promise.all(r)}},ce=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.transmissionFactor!==void 0&&(t.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&r.push(this.parser.assignTexture(t,`transmissionMap`,n.transmissionTexture)),Promise.all(r)}},R=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_VOLUME}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.thickness=n.thicknessFactor===void 0?0:n.thicknessFactor,n.thicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`thicknessMap`,n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;let i=n.attenuationColor||[1,1,1];return t.attenuationColor=new u.Color().setRGB(i[0],i[1],i[2],u.LinearSRGBColorSpace),Promise.all(r)}},le=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_IOR}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);return n===null?Promise.resolve():(t.ior=n.ior===void 0?1.5:n.ior,t.ior===0&&(t.ior=1e3),Promise.resolve())}},ue=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_SPECULAR}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.specularIntensity=n.specularFactor===void 0?1:n.specularFactor,n.specularTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularIntensityMap`,n.specularTexture));let i=n.specularColorFactor||[1,1,1];return t.specularColor=new u.Color().setRGB(i[0],i[1],i[2],u.LinearSRGBColorSpace),n.specularColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularColorMap`,n.specularColorTexture,u.SRGBColorSpace)),Promise.all(r)}},de=class{constructor(e){this.parser=e,this.name=P.EXT_MATERIALS_BUMP}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return t.bumpScale=n.bumpFactor===void 0?1:n.bumpFactor,n.bumpTexture!==void 0&&r.push(this.parser.assignTexture(t,`bumpMap`,n.bumpTexture)),Promise.all(r)}},z=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.anisotropyStrength!==void 0&&(t.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(t.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&r.push(this.parser.assignTexture(t,`anisotropyMap`,n.anisotropyTexture)),Promise.all(r)}},fe=class{constructor(e){this.parser=e,this.name=P.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},pe=class{constructor(e){this.parser=e,this.name=P.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},me=class{constructor(e){this.parser=e,this.name=P.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},he=class{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}else return null}},ge=class{constructor(e){this.name=P.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==De.TRIANGLES&&e.mode!==De.TRIANGLE_STRIP&&e.mode!==De.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new u.Matrix4,n=new u.Vector3,a=new u.Quaternion,s=new u.Vector3(1,1,1),c=new u.InstancedMesh(e.geometry,e.material,r);for(let e=0;e<r;e++)o.TRANSLATION&&n.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&a.fromBufferAttribute(o.ROTATION,e),o.SCALE&&s.fromBufferAttribute(o.SCALE,e),c.setMatrixAt(e,t.compose(n,a,s));for(let t in o)if(t===`_COLOR_0`){let e=o[t];c.instanceColor=new u.InstancedBufferAttribute(e.array,e.itemSize,e.normalized)}else t!==`TRANSLATION`&&t!==`ROTATION`&&t!==`SCALE`&&e.geometry.setAttribute(t,o[t]);u.Object3D.prototype.copy.call(c,e),this.parser.assignFinalMaterial(c),i.push(c)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}},_e=`glTF`,ve=12,ye={JSON:1313821514,BIN:5130562},be=class{constructor(e){this.name=P.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,ve),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==_e)throw Error(`THREE.GLTFLoader: Unsupported glTF-Binary header.`);if(this.header.version<2)throw Error(`THREE.GLTFLoader: Legacy binary file detected.`);let r=this.header.length-ve,i=new DataView(e,ve),a=0;for(;a<r;){let t=i.getUint32(a,!0);a+=4;let r=i.getUint32(a,!0);if(a+=4,r===ye.JSON){let r=new Uint8Array(e,ve+a,t);this.content=n.decode(r)}else if(r===ye.BIN){let n=ve+a;this.body=e.slice(n,n+t)}a+=t}if(this.content===null)throw Error(`THREE.GLTFLoader: JSON content not found.`)}},xe=class{constructor(e,t){if(!t)throw Error(`THREE.GLTFLoader: No DRACOLoader instance provided.`);this.name=P.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},c={};for(let e in a){let t=Me[e]||e.toLowerCase();o[t]=a[e]}for(let t in e.attributes){let r=Me[t]||t.toLowerCase();if(a[t]!==void 0){let i=n.accessors[e.attributes[t]];c[r]=Oe[i.componentType].name,s[r]=i.normalized===!0}}return t.getDependency(`bufferView`,i).then(function(e){return new Promise(function(t,n){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let n=e.attributes[t],r=s[t];r!==void 0&&(n.normalized=r)}t(e)},o,c,u.LinearSRGBColorSpace,n)})})}},Se=class{constructor(){this.name=P.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0?e:(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e)}},Ce=class{constructor(){this.name=P.KHR_MESH_QUANTIZATION}},we=class extends u.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=o*2,c=o*3,l=r-t,u=(n-t)/l,d=u*u,f=d*u,p=e*c,m=p-c,h=-2*f+3*d,g=f-d,_=1-h,v=g-d+u;for(let e=0;e!==o;e++){let t=a[m+e+o],n=a[m+e+s]*l,r=a[p+e+o],c=a[p+e]*l;i[e]=_*t+v*n+h*r+g*c}return i}},Te=new u.Quaternion,Ee=class extends we{interpolate_(e,t,n,r){let i=super.interpolate_(e,t,n,r);return Te.fromArray(i).normalize().toArray(i),i}},De={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Oe={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ke={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},Ae={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},je={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Me={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`,COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},Ne={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},Pe={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},Fe={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`};function Ie(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),e.DefaultMaterial}function Le(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Re(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function ze(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.POSITION!==void 0&&(r=!0),n.NORMAL!==void 0&&(i=!0),n.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);let o=[],s=[],c=[];for(let l=0,u=t.length;l<u;l++){let u=t[l];if(r){let t=u.POSITION===void 0?e.attributes.position:n.getDependency(`accessor`,u.POSITION);o.push(t)}if(i){let t=u.NORMAL===void 0?e.attributes.normal:n.getDependency(`accessor`,u.NORMAL);s.push(t)}if(a){let t=u.COLOR_0===void 0?e.attributes.color:n.getDependency(`accessor`,u.COLOR_0);c.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(c)]).then(function(t){let n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}function Be(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn(`THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.`)}}function Ve(e){let t,n=e.extensions&&e.extensions[P.KHR_DRACO_MESH_COMPRESSION];if(t=n?`draco:`+n.bufferView+`:`+n.indices+`:`+He(n.attributes):e.indices+`:`+He(e.attributes)+`:`+e.mode,e.targets!==void 0)for(let n=0,r=e.targets.length;n<r;n++)t+=`:`+He(e.targets[n]);return t}function He(e){let t=``,n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+`:`+e[n[r]]+`;`;return t}function Ue(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error(`THREE.GLTFLoader: Unsupported normalized accessor component type.`)}}function We(e){return e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}var Ge=new u.Matrix4,Ke=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new re,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,i=!1,a=-1;if(typeof navigator<`u`&&navigator.userAgent!==void 0){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\/(\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||n&&r<17||i&&a<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return Le(i,a,r),Re(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(n[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let r=n.clone(),i=(e,t)=>{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+ e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let r=e(t[n]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){let n=e+`:`+t,r=this.cache.get(n);if(!r){switch(e){case`scene`:r=this.loadScene(t);break;case`node`:r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case`mesh`:r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case`accessor`:r=this.loadAccessor(t);break;case`bufferView`:r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case`buffer`:r=this.loadBuffer(t);break;case`material`:r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case`texture`:r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case`skin`:r=this.loadSkin(t);break;case`animation`:r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case`camera`:r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw Error(`Unknown type: `+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,r=this.json[e+(e===`mesh`?`es`:`s`)]||[];t=Promise.all(r.map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!==`arraybuffer`)throw Error(`THREE.GLTFLoader: `+t.type+` buffer type is not supported.`);if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[P.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,i){n.load(u.LoaderUtils.resolveURL(t.uri,r.path),e,void 0,function(){i(Error(`THREE.GLTFLoader: Failed to load buffer "`+t.uri+`".`))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency(`buffer`,t.buffer).then(function(e){let n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})}loadAccessor(e){let t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let e=je[r.type],t=Oe[r.componentType],n=r.normalized===!0,i=new t(r.count*e);return Promise.resolve(new u.BufferAttribute(i,e,n))}let i=[];return r.bufferView===void 0?i.push(null):i.push(this.getDependency(`bufferView`,r.bufferView)),r.sparse!==void 0&&(i.push(this.getDependency(`bufferView`,r.sparse.indices.bufferView)),i.push(this.getDependency(`bufferView`,r.sparse.values.bufferView))),Promise.all(i).then(function(e){let i=e[0],a=je[r.type],o=Oe[r.componentType],s=o.BYTES_PER_ELEMENT,c=s*a,l=r.byteOffset||0,d=r.bufferView===void 0?void 0:n.bufferViews[r.bufferView].byteStride,f=r.normalized===!0,p,m;if(d&&d!==c){let e=Math.floor(l/d),n=`InterleavedBuffer:`+r.bufferView+`:`+r.componentType+`:`+e+`:`+r.count,c=t.cache.get(n);c||(p=new o(i,e*d,r.count*d/s),c=new u.InterleavedBuffer(p,d/s),t.cache.add(n,c)),m=new u.InterleavedBufferAttribute(c,a,l%d/s,f)}else p=i===null?new o(r.count*a):new o(i,l,r.count*a),m=new u.BufferAttribute(p,a,f);if(r.sparse!==void 0){let t=je.SCALAR,n=Oe[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,l=new n(e[1],s,r.sparse.count*t),d=new o(e[2],c,r.sparse.count*a);i!==null&&(m=new u.BufferAttribute(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let e=0,t=l.length;e<t;e++){let t=l[e];if(m.setX(t,d[e*a]),a>=2&&m.setY(t,d[e*a+1]),a>=3&&m.setZ(t,d[e*a+2]),a>=4&&m.setW(t,d[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}m.normalized=f}return m})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=ke[n.magFilter]||u.LinearFilter,t.minFilter=ke[n.minFilter]||u.LinearMipmapLinearFilter,t.wrapS=Ae[n.wrapS]||u.RepeatWrapping,t.wrapT=Ae[n.wrapT]||u.RepeatWrapping,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==u.NearestFilter&&t.minFilter!==u.LinearFilter,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new u.Texture(e);t.needsUpdate=!0,n(t)}),t.load(u.LoaderUtils.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),Re(e,a),e.userData.mimeType=a.mimeType||We(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[P.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[P.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[P.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new u.PointsMaterial,u.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new u.LineBasicMaterial,u.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[P.KHR_MATERIALS_UNLIT]){let e=r[P.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new u.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],u.LinearSRGBColorSpace),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,u.SRGBColorSpace)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=u.DoubleSide);let l=i.alphaMode||Fe.OPAQUE;if(l===Fe.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===Fe.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==u.MeshBasicMaterial&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new u.Vector2(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==u.MeshBasicMaterial&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==u.MeshBasicMaterial){let e=i.emissiveFactor;o.emissive=new u.Color().setRGB(e[0],e[1],e[2],u.LinearSRGBColorSpace)}return i.emissiveTexture!==void 0&&a!==u.MeshBasicMaterial&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),Re(n,i),t.associations.set(n,{materials:e}),i.extensions&&Le(r,n,i),n})}createUniqueName(e){let t=u.PropertyBinding.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[P.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return Je(n,e,t)})}let a=[];for(let n=0,o=e.length;n<o;n++){let o=e[n],s=Ve(o),c=r[s];if(c)a.push(c.promise);else{let e;e=o.extensions&&o.extensions[P.KHR_DRACO_MESH_COMPRESSION]?i(o):Je(new u.BufferGeometry,o,t),r[s]={primitive:o,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){let t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){let t=a[e].material===void 0?Ie(this.cache):this.getDependency(`material`,a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(n){let o=n.slice(0,n.length-1),s=n[n.length-1],c=[];for(let n=0,l=s.length;n<l;n++){let l=s[n],d=a[n],f,p=o[n];if(d.mode===De.TRIANGLES||d.mode===De.TRIANGLE_STRIP||d.mode===De.TRIANGLE_FAN||d.mode===void 0)f=i.isSkinnedMesh===!0?new u.SkinnedMesh(l,p):new u.Mesh(l,p),f.isSkinnedMesh===!0&&f.normalizeSkinWeights(),d.mode===De.TRIANGLE_STRIP?f.geometry=k(f.geometry,u.TriangleStripDrawMode):d.mode===De.TRIANGLE_FAN&&(f.geometry=k(f.geometry,u.TriangleFanDrawMode));else if(d.mode===De.LINES)f=new u.LineSegments(l,p);else if(d.mode===De.LINE_STRIP)f=new u.Line(l,p);else if(d.mode===De.LINE_LOOP)f=new u.LineLoop(l,p);else if(d.mode===De.POINTS)f=new u.Points(l,p);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+d.mode);Object.keys(f.geometry.morphAttributes).length>0&&Be(f,i),f.name=t.createUniqueName(i.name||`mesh_`+e),Re(f,i),d.extensions&&Le(r,f,d),t.assignFinalMaterial(f),c.push(f)}for(let n=0,r=c.length;n<r;n++)t.associations.set(c[n],{meshes:e,primitives:n});if(c.length===1)return i.extensions&&Le(r,c[0],i),c[0];let l=new u.Group;i.extensions&&Le(r,l,i),t.associations.set(l,{meshes:e});for(let e=0,t=c.length;e<t;e++)l.add(c[e]);return l})}loadCamera(e){let t,n=this.json.cameras[e],r=n[n.type];if(!r){console.warn(`THREE.GLTFLoader: Missing camera parameters.`);return}return n.type===`perspective`?t=new u.PerspectiveCamera(u.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type===`orthographic`&&(t=new u.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Re(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let e=0,r=t.joints.length;e<r;e++)n.push(this._loadNodeShallow(t.joints[e]));return t.inverseBindMatrices===void 0?n.push(null):n.push(this.getDependency(`accessor`,t.inverseBindMatrices)),Promise.all(n).then(function(e){let n=e.pop(),r=e,i=[],a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e];if(o){i.push(o);let t=new u.Matrix4;n!==null&&t.fromArray(n.array,e*16),a.push(t)}else console.warn(`THREE.GLTFLoader: Joint "%s" could not be found.`,t.joints[e])}return new u.Skeleton(i,a)})}loadAnimation(e){let t=this.json,n=this,r=t.animations[e],i=r.name?r.name:`animation_`+e,a=[],o=[],s=[],c=[],l=[];for(let e=0,t=r.channels.length;e<t;e++){let t=r.channels[e],n=r.samplers[t.sampler],i=t.target,u=i.node,d=r.parameters===void 0?n.input:r.parameters[n.input],f=r.parameters===void 0?n.output:r.parameters[n.output];i.node!==void 0&&(a.push(this.getDependency(`node`,u)),o.push(this.getDependency(`accessor`,d)),s.push(this.getDependency(`accessor`,f)),c.push(n),l.push(i))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(c),Promise.all(l)]).then(function(e){let t=e[0],a=e[1],o=e[2],s=e[3],c=e[4],l=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=a[e],u=o[e],d=s[e],f=c[e];if(r===void 0)continue;r.updateMatrix&&r.updateMatrix();let p=n._createAnimationTracks(r,i,u,d,f);if(p)for(let e=0;e<p.length;e++)l.push(p[e])}let d=new u.AnimationClip(i,void 0,l);return Re(d,r),d})}createNodeMesh(e){let t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency(`mesh`,r.mesh).then(function(e){let t=n._getNodeRef(n.meshCache,r.mesh,e);return r.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json,n=this,r=t.nodes[e],i=n._loadNodeShallow(e),a=[],o=r.children||[];for(let e=0,t=o.length;e<t;e++)a.push(n.getDependency(`node`,o[e]));let s=r.skin===void 0?Promise.resolve(null):n.getDependency(`skin`,r.skin);return Promise.all([i,Promise.all(a),s]).then(function(e){let t=e[0],n=e[1],r=e[2];r!==null&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,Ge)});for(let e=0,r=n.length;e<r;e++)t.add(n[e]);if(t.userData.pivot!==void 0&&n.length>0){let e=t.userData.pivot,r=n[0];t.pivot=new u.Vector3().fromArray(e),t.position.x-=e[0],t.position.y-=e[1],t.position.z-=e[2],r.position.set(0,0,0),delete t.userData.pivot}return t})}_loadNodeShallow(e){let t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let i=t.nodes[e],a=i.name?r.createUniqueName(i.name):``,o=[],s=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return s&&o.push(s),i.camera!==void 0&&o.push(r.getDependency(`camera`,i.camera).then(function(e){return r._getNodeRef(r.cameraCache,i.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if(o=i.isBone===!0?new u.Bone:t.length>1?new u.Group:t.length===1?t[0]:new u.Object3D,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),Re(o,i),i.extensions&&Le(n,o,i),i.matrix!==void 0){let e=new u.Matrix4;e.fromArray(i.matrix),o.applyMatrix4(e)}else i.translation!==void 0&&o.position.fromArray(i.translation),i.rotation!==void 0&&o.quaternion.fromArray(i.rotation),i.scale!==void 0&&o.scale.fromArray(i.scale);if(!r.associations.has(o))r.associations.set(o,{});else if(i.mesh!==void 0&&r.meshCache.refs[i.mesh]>1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new u.Group;n.name&&(i.name=r.createUniqueName(n.name)),Re(i,n),n.extensions&&Le(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency(`node`,a[e]));return Promise.all(o).then(function(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];n.parent===null?i.add(n):i.add(A(n))}return r.associations=(e=>{let t=new Map;for(let[e,n]of r.associations)(e instanceof u.Material||e instanceof u.Texture)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];function c(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}Ne[i.path]===Ne.weights?(c(e),e.isGroup&&e.children.forEach(c)):s.push(o);let l;switch(Ne[i.path]){case Ne.weights:l=u.NumberKeyframeTrack;break;case Ne.rotation:l=u.QuaternionKeyframeTrack;break;case Ne.translation:case Ne.scale:l=u.VectorKeyframeTrack;break;default:switch(n.itemSize){case 1:l=u.NumberKeyframeTrack;break;default:l=u.VectorKeyframeTrack;break}break}let d=r.interpolation===void 0?u.InterpolateLinear:Pe[r.interpolation],f=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e<n;e++){let n=new l(s[e]+`.`+Ne[i.path],t.array,f,d);r.interpolation===`CUBICSPLINE`&&this._createCubicSplineTrackInterpolant(n),a.push(n)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=Ue(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof u.QuaternionKeyframeTrack?Ee:we)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};function qe(e,t,n){let r=t.attributes,i=new u.Box3;if(r.POSITION!==void 0){let e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(t!==void 0&&a!==void 0){if(i.set(new u.Vector3(t[0],t[1],t[2]),new u.Vector3(a[0],a[1],a[2])),e.normalized){let t=Ue(Oe[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;let a=t.targets;if(a!==void 0){let e=new u.Vector3,t=new u.Vector3;for(let r=0,i=a.length;r<i;r++){let i=a[r];if(i.POSITION!==void 0){let r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(a!==void 0&&o!==void 0){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){let e=Ue(Oe[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}i.expandByVector(e)}e.boundingBox=i;let o=new u.Sphere;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}function Je(e,t,n){let r=t.attributes,i=[];function a(t,r){return n.getDependency(`accessor`,t).then(function(t){e.setAttribute(r,t)})}for(let t in r){let n=Me[t]||t.toLowerCase();n in e.attributes||i.push(a(r[t],n))}if(t.indices!==void 0&&!e.index){let r=n.getDependency(`accessor`,t.indices).then(function(t){e.setIndex(t)});i.push(r)}return u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&`COLOR_0`in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),Re(e,t),qe(e,t,n),Promise.all(i).then(function(){return t.targets===void 0?e:ze(e,t.targets,n)})}var Ye=/^[og]\s*(.+)?/,Xe=/^mtllib /,Ze=/^usemtl /,Qe=/^usemap /,$e=/\s+/,et=new u.Vector3,tt=new u.Vector3,nt=new u.Vector3,rt=new u.Vector3,it=new u.Vector3,at=new u.Color;function ot(){let e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let n=this.object&&typeof this.object.currentMaterial==`function`?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize==`function`&&this.object._finalize(!0),this.object={name:e||``,fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){let n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);let r={index:this.materials.length,name:e||``,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:``,smooth:n===void 0?this.smooth:n.smooth,groupStart:n===void 0?0:n.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){let t={index:typeof e==`number`?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){let t=this.currentMaterial();if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&this.materials.length===0&&this.materials.push({name:``,smooth:this.smooth}),t}},n&&n.name&&typeof n.clone==`function`){let e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize==`function`&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){let r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){let r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){let r=this.vertices,i=this.object.geometry.normals;et.fromArray(r,e),tt.fromArray(r,t),nt.fromArray(r,n),it.subVectors(nt,tt),rt.subVectors(et,tt),it.cross(rt),it.normalize(),i.push(it.x,it.y,it.z),i.push(it.x,it.y,it.z),i.push(it.x,it.y,it.z)},addColor:function(e,t,n){let r=this.colors,i=this.object.geometry.colors;r[e]!==void 0&&i.push(r[e+0],r[e+1],r[e+2]),r[t]!==void 0&&i.push(r[t+0],r[t+1],r[t+2]),r[n]!==void 0&&i.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){let r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,i,a,o,s,c){let l=this.vertices.length,u=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),f=this.parseVertexIndex(n,l);if(this.addVertex(u,d,f),this.addColor(u,d,f),o!==void 0&&o!==``){let e=this.normals.length;u=this.parseNormalIndex(o,e),d=this.parseNormalIndex(s,e),f=this.parseNormalIndex(c,e),this.addNormal(u,d,f)}else this.addFaceNormal(u,d,f);if(r!==void 0&&r!==``){let e=this.uvs.length;u=this.parseUVIndex(r,e),d=this.parseUVIndex(i,e),f=this.parseUVIndex(a,e),this.addUV(u,d,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type=`Points`;let t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){let r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type=`Line`;let n=this.vertices.length,r=this.uvs.length;for(let t=0,r=e.length;t<r;t++)this.addVertexLine(this.parseVertexIndex(e[t],n));for(let e=0,n=t.length;e<n;e++)this.addUVLine(this.parseUVIndex(t[e],r))}};return e.startObject(``,!1),e}var st=class extends u.Loader{constructor(e){super(e),this.materials=null}load(e,t,n,r){let i=this,a=new u.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}setMaterials(e){return this.materials=e,this}parse(e){let t=new ot;e.indexOf(`\r
5
+ `;continue}if((u=l.match(i))&&(c.gamma=parseFloat(u[1])),(u=l.match(a))&&(c.exposure=parseFloat(u[1])),(u=l.match(o))&&(c.valid|=2,c.format=u[1]),(u=l.match(s))&&(c.valid|=4,c.height=parseInt(u[1],10),c.width=parseInt(u[2],10)),c.valid&2&&c.valid&4)break}return c.valid&2||t(3,`missing format specifier`),c.valid&4||t(3,`missing image size specifier`),c},i=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&s<e.byteLength;){s+4>e.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n<c&&s<e.byteLength;){r=e[s++];let i=r>128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e<r;e++)u[n++]=t}else u.set(e.subarray(s,s+r),n),n+=r,s+=r}let f=i;for(let e=0;e<f;e++){let t=0;a[o]=u[e+t],t+=i,a[o+1]=u[e+t],t+=i,a[o+2]=u[e+t],t+=i,a[o+3]=u[e+t],o+=4}d--}return a},a=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=e[t+0]*i,n[r+1]=e[t+1]*i,n[r+2]=e[t+2]*i,n[r+3]=1},o=function(e,t,n,r){let i=2**(e[t+3]-128)/255;n[r+0]=u.DataUtils.toHalfFloat(Math.min(e[t+0]*i,65504)),n[r+1]=u.DataUtils.toHalfFloat(Math.min(e[t+1]*i,65504)),n[r+2]=u.DataUtils.toHalfFloat(Math.min(e[t+2]*i,65504)),n[r+3]=u.DataUtils.toHalfFloat(1)},s=new Uint8Array(e);s.pos=0;let c=r(s),l=c.width,d=c.height,f=i(s.subarray(s.pos),l,d),p,m,h;switch(this.type){case u.FloatType:h=f.length/4;let e=new Float32Array(h*4);for(let t=0;t<h;t++)a(f,t*4,e,t*4);p=e,m=u.FloatType;break;case u.HalfFloatType:h=f.length/4;let t=new Uint16Array(h*4);for(let e=0;e<h;e++)o(f,e*4,t,e*4);p=t,m=u.HalfFloatType;break;default:throw Error(`THREE.HDRLoader: Unsupported type: `+this.type)}return{width:l,height:d,data:p,header:c.string,gamma:c.gamma,exposure:c.exposure,type:m}}setDataType(e){return this.type=e,this}load(e,t,n,r){function i(e,n){switch(e.type){case u.FloatType:case u.HalfFloatType:e.colorSpace=u.LinearSRGBColorSpace,e.minFilter=u.LinearFilter,e.magFilter=u.LinearFilter,e.generateMipmaps=!1,e.flipY=!0;break}t&&t(e,n)}return super.load(e,i,n,r)}},x=class{createScene(e=!0){let t=new u.Scene;if(e){let e=new u.DirectionalLight(16777215,4);e.position.set(1,2,3),t.add(e);let n=new u.AmbientLight(16777215,.2);t.add(n)}return t}createGroup(e,t){let n=new u.Group;return n.name=t,e.add(n),n}createCamera(e,t){let n=new u.PerspectiveCamera;n.name=t;let r=new u.Group;return r.name=`${t}-parent`,r.add(n),e.add(r),n}buildPerspectiveMatrix(e,t,n,r){let i=1/Math.tan(e/2),a=1/(n-r);return new Float64Array([i/t,0,0,0,0,i,0,0,0,0,(r+n)*a,-1,0,0,2*r*n*a,0])}buildOrthographicMatrix(e,t,n,r,i,a){let o=1/(e-t),s=1/(n-r),c=1/(i-a);return new Float64Array([-2*o,0,0,0,0,-2*s,0,0,0,0,2*c,0,(e+t)*o,(r+n)*s,(a+i)*c,1])}calcProjectionMatrix(e,t,n,r){let i=e.centerOffset,a=e.width/e.height,o=this.buildPerspectiveMatrix(t,a,n,r);if(o[8]=-i.x*2/e.width,o[9]=i.y*2/e.height,!e.isOrthographic)return new u.Matrix4().fromArray(o);let s=.5*e.height/Math.tan(t/2)*Math.tan(t*.5),c=s*a,l=this.buildOrthographicMatrix(-c-i.x,c-i.x,-s+i.y,s+i.y,n,r),d=Math.min(e.pitch/15,1),f=d*d*d*d*d,p=new Float64Array(16);for(let e=0;e<16;e++)p[e]=(1-f)*l[e]+f*o[e];return new u.Matrix4().fromArray(p)}updateCameraForRender(e,t,n,r,i){let a=t.transform,{fov:o,nearZ:s,farZ:c,aspect:l}=this.extractCameraParams(n,a);e.fov=y.radToDeg(o),e.aspect=l,e.near=s,e.far=c,e._cleanProjectionMatrix=this.buildPerspectiveMatrix(o,l,s,c);let d=this.extractMVPMatrix(n,r),f=this.calcProjectionMatrix(a,o,s,c);e.projectionMatrix.copy(f),e.projectionMatrixInverse.copy(f).invert();let p=new u.Matrix4().multiplyMatrices(e.projectionMatrixInverse,d);e.matrixWorld.copy(p).invert(),e.matrixWorldInverse.copy(p),e.matrixAutoUpdate=!1,e.matrixWorldAutoUpdate=!1,this.updateCameraTransform(e)}extractCameraParams(e,t){let n=t.width/t.height;if(e.fov!==void 0)return{fov:e.fov,nearZ:e.nearZ,farZ:e.farZ,aspect:n};let r=t.cameraToCenterDistance;return{fov:r&&t.height?2*Math.atan(t.height/2/r):.6435,nearZ:t.nearZ||.1,farZ:t.farZ||1e4,aspect:n}}extractMVPMatrix(e,t){let n;if(e.defaultProjectionData?.mainMatrix)n=new u.Matrix4().fromArray(Object.values(e.defaultProjectionData.mainMatrix));else if(e.modelViewProjectionMatrix)n=new u.Matrix4().fromArray(e.modelViewProjectionMatrix);else{let t=Array.isArray(e)?e:Array.from(e);n=new u.Matrix4().fromArray(t)}return new u.Matrix4().multiplyMatrices(n,t)}updateCameraTransform(e){let t=new u.Vector3,n=new u.Quaternion,r=new u.Vector3;e.matrixWorld.decompose(t,n,r),e.position.copy(t),e.rotation.copy(new u.Euler().setFromQuaternion(n,`YXZ`))}createEnvTexture(e,t){e?.endsWith(`.hdr`)&&new b().load(e,e=>{e.mapping=u.EquirectangularReflectionMapping,t.environment=e,t.environmentRotation.x=Math.PI/2})}},S=new u.Vector3,C=new u.Matrix4,ee=new u.Matrix4,w=new u.Vector3,T=new u.Vector3,te=class{constructor(e={}){let t=this,n,r,i,a,o={objects:new WeakMap},s=e.element===void 0?document.createElement(`div`):e.element;s.style.overflow=`hidden`,this.domElement=s,this.sortObjects=!0,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),C.copy(t.matrixWorldInverse),ee.multiplyMatrices(t.projectionMatrix,C),l(e,e,t),this.sortObjects&&f(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,a=r/2,s.style.width=e+`px`,s.style.height=t+`px`};function c(e){e.isCSS2DObject&&(e.element.style.display=`none`);for(let t=0,n=e.children.length;t<n;t++)c(e.children[t])}function l(e,n,r){if(e.visible===!1){c(e);return}if(e.isCSS2DObject){S.setFromMatrixPosition(e.matrixWorld),S.applyMatrix4(ee);let c=S.z>=-1&&S.z<=1&&e.layers.test(r.layers)===!0,l=e.element;l.style.display=c===!0?``:`none`,c===!0&&(e.onBeforeRender(t,n,r),l.style.transform=`translate(`+-100*e.center.x+`%,`+-100*e.center.y+`%)translate(`+(S.x*i+i)+`px,`+(-S.y*a+a)+`px)`,l.parentNode!==s&&s.appendChild(l),e.onAfterRender(t,n,r));let d={distanceToCameraSquared:u(r,e)};o.objects.set(e,d)}for(let t=0,i=e.children.length;t<i;t++)l(e.children[t],n,r)}function u(e,t){return w.setFromMatrixPosition(e.matrixWorld),T.setFromMatrixPosition(t.matrixWorld),w.distanceToSquared(T)}function d(e){let t=[];return e.traverseVisible(function(e){e.isCSS2DObject&&t.push(e)}),t}function f(e){let t=d(e).sort(function(e,t){return e.renderOrder===t.renderOrder?o.objects.get(e).distanceToCameraSquared-o.objects.get(t).distanceToCameraSquared:t.renderOrder-e.renderOrder}),n=t.length;for(let e=0,r=t.length;e<r;e++)t[e].element.style.zIndex=n-e}}},E=class{renderer;labelRenderer;constructor(e,t){if(!t||t.isContextLost())throw Error(`WebGL context is lost or invalid`);this.renderer=new u.WebGLRenderer({alpha:!0,antialias:!0,canvas:e.getCanvas(),context:t}),this.renderer.autoClear=!1,this.renderer.shadowMap.enabled=!0,this.labelRenderer=this.createLabelRenderer(e)}createLabelRenderer(e){let t=e.getContainer(),n=new te;return n.setSize(t.clientWidth,t.clientHeight),n.domElement.style.position=`absolute`,n.domElement.style.top=`0px`,n.domElement.style.pointerEvents=`none`,e._container.appendChild(n.domElement),e.on(`resize`,()=>{let{clientWidth:t,clientHeight:r}=e.getContainer();n.setSize(t,r)}),n}getRenderer(){return this.renderer}render(e,t){this.renderer.resetState(),this.renderer.render(e,t),this.labelRenderer.render(e,t)}dispose(){this.labelRenderer.domElement?.parentNode?.removeChild(this.labelRenderer.domElement),this.renderer?.dispose()}},D=(0,d.createContext)({scene:void 0,camera:void 0,renderer:void 0,map:void 0,sceneRoot:void 0,worldMatrix:void 0,worldMatrixInv:void 0}),O=()=>(0,d.useContext)(D),ne=({mapId:e,id:t,refCenter:n,envTexture:r,envIntensity:i=1,createLight:a=!0,children:o,beforeId:s})=>{let{map:c}=(0,p.useMap)({mapId:e,waitForLayer:s}),[l,f]=(0,d.useState)(),[h,g]=(0,d.useState)(),[_,v]=(0,d.useState)(),[b,S]=(0,d.useState)(),[C,ee]=(0,d.useState)(),[w,T]=(0,d.useState)(),te=(0,d.useRef)(new x),O=(0,d.useRef)(new u.Matrix4),ne=(0,d.useRef)(new u.Matrix4),k=(0,d.useRef)(void 0);return(0,d.useEffect)(()=>{if(!c)return;let e=te.current,o=e.createScene(a),l=e.createGroup(o,`scene-root`),u=e.createCamera(l,`camera-for-render`),d={id:t,type:`custom`,renderingMode:`3d`,onAdd:(t,a)=>{let s=new E(t,a);k.current=s,v(s);let c=n||t.getCenter();O.current=y.updateWorldMatrix(t,c),ne.current=O.current.clone().invert(),ee(O.current),T(ne.current),r&&e.createEnvTexture(r,o),o.environmentIntensity=i,t.triggerRepaint()},render:(t,n)=>{!k.current||!o||!u||(e.updateCameraForRender(u,c.map,n,O.current,ne.current),k.current.render(o,u),c.triggerRepaint())},onRemove:()=>{k.current&&=(k.current.dispose(),void 0),v(void 0)}};return c.getLayer(t)||c.addLayer(d,s),f(o),g(u),S(l),()=>{c.getLayer(t)&&c.removeLayer(t)}},[c,t]),(0,d.useEffect)(()=>{l&&r&&te.current.createEnvTexture(r,l)},[l,r]),(0,d.useEffect)(()=>{l&&(l.environmentIntensity=i)},[l,i]),(0,d.useEffect)(()=>{c&&n&&(O.current=y.updateWorldMatrix(c.map,n),ne.current=O.current.clone().invert(),ee(O.current),T(ne.current),c.triggerRepaint())},[c,n]),(0,m.jsx)(D.Provider,{value:{scene:l,camera:h,renderer:_,map:c?.map,sceneRoot:b,worldMatrix:C,worldMatrixInv:w},children:o})};function k(e,t){if(t===u.TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),e;if(t===u.TriangleFanDrawMode||t===u.TriangleStripDrawMode){let n=e.getIndex();if(n===null){let t=[],r=e.getAttribute(`position`);if(r!==void 0){for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.`),e}let r=n.count-2,i=[];if(t===u.TriangleFanDrawMode)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.`);let a=e.clone();return a.setIndex(i),a.clearGroups(),a}else return console.error(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:`,t),e}function A(e){let t=new Map,n=new Map,r=e.clone();return j(e,r,function(e,r){t.set(r,e),n.set(e,r)}),r.traverse(function(e){if(!e.isSkinnedMesh)return;let r=e,i=t.get(e),a=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=a.map(function(e){return n.get(e)}),r.bind(r.skeleton,r.bindMatrix)}),r}function j(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)j(e.children[r],t.children[r],n)}var M=class extends u.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new oe(e)}),this.register(function(e){return new I(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new pe(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new ae(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new L(e)}),this.register(function(e){return new z(e)}),this.register(function(e){return new de(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new he(e,P.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new he(e,P.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new ge(e)})}load(e,t,n,r){let i=this,a;if(this.resourcePath!==``)a=this.resourcePath;else if(this.path!==``){let t=u.LoaderUtils.extractUrlBase(e);a=u.LoaderUtils.resolveURL(t,this.path)}else a=u.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},s=new u.FileLoader(this.manager);s.setPath(this.path),s.setResponseType(`arraybuffer`),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){try{i.parse(n,a,function(n){t(n),i.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i,a={},o={},s=new TextDecoder;if(typeof e==`string`)i=JSON.parse(e);else if(e instanceof ArrayBuffer)if(s.decode(new Uint8Array(e,0,4))===_e){try{a[P.KHR_BINARY_GLTF]=new be(e)}catch(e){r&&r(e);return}i=JSON.parse(a[P.KHR_BINARY_GLTF].content)}else i=JSON.parse(s.decode(e));else i=e;if(i.asset===void 0||i.asset.version[0]<2){r&&r(Error(`THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.`));return}let c=new Ge(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name||console.error(`THREE.GLTFLoader: Invalid plugin found: missing name`),o[t.name]=t,a[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],n=i.extensionsRequired||[];switch(t){case P.KHR_MATERIALS_UNLIT:a[t]=new F;break;case P.KHR_DRACO_MESH_COMPRESSION:a[t]=new xe(i,this.dracoLoader);break;case P.KHR_TEXTURE_TRANSFORM:a[t]=new Se;break;case P.KHR_MESH_QUANTIZATION:a[t]=new Ce;break;default:n.indexOf(t)>=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function re(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}function N(e,t,n){let r=e.json.materials[t];return r.extensions&&r.extensions[n]?r.extensions[n]:null}var P={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,KHR_MESHOPT_COMPRESSION:`KHR_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`},ie=class{constructor(e){this.parser=e,this.name=P.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t=this.parser,n=`light:`+e,r=t.cache.get(n);if(r)return r;let i=t.json,a=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e],o,s=new u.Color(16777215);a.color!==void 0&&s.setRGB(a.color[0],a.color[1],a.color[2],u.LinearSRGBColorSpace);let c=a.range===void 0?0:a.range;switch(a.type){case`directional`:o=new u.DirectionalLight(s),o.target.position.set(0,0,-1),o.add(o.target);break;case`point`:o=new u.PointLight(s),o.distance=c;break;case`spot`:o=new u.SpotLight(s),o.distance=c,a.spot=a.spot||{},a.spot.innerConeAngle=a.spot.innerConeAngle===void 0?0:a.spot.innerConeAngle,a.spot.outerConeAngle=a.spot.outerConeAngle===void 0?Math.PI/4:a.spot.outerConeAngle,o.angle=a.spot.outerConeAngle,o.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw Error(`THREE.GLTFLoader: Unexpected light type: `+a.type)}return o.position.set(0,0,0),Le(o,a),a.intensity!==void 0&&(o.intensity=a.intensity),o.name=t.createUniqueName(a.name||`light_`+e),r=Promise.resolve(o),t.cache.add(n,r),r}getDependency(e,t){if(e===`light`)return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return i===void 0?null:this._loadLight(i).then(function(e){return n._getNodeRef(t.cache,i,e)})}},F=class{constructor(){this.name=P.KHR_MATERIALS_UNLIT}getMaterialType(){return u.MeshBasicMaterial}extendParams(e,t,n){let r=[];e.color=new u.Color(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],u.LinearSRGBColorSpace),e.opacity=t[3]}i.baseColorTexture!==void 0&&r.push(n.assignTexture(e,`map`,i.baseColorTexture,u.SRGBColorSpace))}return Promise.all(r)}},ae=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);return n===null||n.emissiveStrength!==void 0&&(t.emissiveIntensity=n.emissiveStrength),Promise.resolve()}},oe=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(n.clearcoatFactor!==void 0&&(t.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatMap`,n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`clearcoatRoughnessMap`,n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(r.push(this.parser.assignTexture(t,`clearcoatNormalMap`,n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){let e=n.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new u.Vector2(e,e)}return Promise.all(r)}},I=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_DISPERSION}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);return n===null||(t.dispersion=n.dispersion===void 0?0:n.dispersion),Promise.resolve()}},L=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.iridescenceFactor!==void 0&&(t.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceMap`,n.iridescenceTexture)),n.iridescenceIor!==void 0&&(t.iridescenceIOR=n.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`iridescenceThicknessMap`,n.iridescenceThicknessTexture)),Promise.all(r)}},se=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_SHEEN}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];if(t.sheenColor=new u.Color(0,0,0),t.sheenRoughness=0,t.sheen=1,n.sheenColorFactor!==void 0){let e=n.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],u.LinearSRGBColorSpace)}return n.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenColorMap`,n.sheenColorTexture,u.SRGBColorSpace)),n.sheenRoughnessTexture!==void 0&&r.push(this.parser.assignTexture(t,`sheenRoughnessMap`,n.sheenRoughnessTexture)),Promise.all(r)}},ce=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.transmissionFactor!==void 0&&(t.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&r.push(this.parser.assignTexture(t,`transmissionMap`,n.transmissionTexture)),Promise.all(r)}},R=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_VOLUME}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.thickness=n.thicknessFactor===void 0?0:n.thicknessFactor,n.thicknessTexture!==void 0&&r.push(this.parser.assignTexture(t,`thicknessMap`,n.thicknessTexture)),t.attenuationDistance=n.attenuationDistance||1/0;let i=n.attenuationColor||[1,1,1];return t.attenuationColor=new u.Color().setRGB(i[0],i[1],i[2],u.LinearSRGBColorSpace),Promise.all(r)}},le=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_IOR}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);return n===null?Promise.resolve():(t.ior=n.ior===void 0?1.5:n.ior,t.ior===0&&(t.ior=1e3),Promise.resolve())}},ue=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_SPECULAR}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];t.specularIntensity=n.specularFactor===void 0?1:n.specularFactor,n.specularTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularIntensityMap`,n.specularTexture));let i=n.specularColorFactor||[1,1,1];return t.specularColor=new u.Color().setRGB(i[0],i[1],i[2],u.LinearSRGBColorSpace),n.specularColorTexture!==void 0&&r.push(this.parser.assignTexture(t,`specularColorMap`,n.specularColorTexture,u.SRGBColorSpace)),Promise.all(r)}},de=class{constructor(e){this.parser=e,this.name=P.EXT_MATERIALS_BUMP}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return t.bumpScale=n.bumpFactor===void 0?1:n.bumpFactor,n.bumpTexture!==void 0&&r.push(this.parser.assignTexture(t,`bumpMap`,n.bumpTexture)),Promise.all(r)}},z=class{constructor(e){this.parser=e,this.name=P.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){return N(this.parser,e,this.name)===null?null:u.MeshPhysicalMaterial}extendMaterialParams(e,t){let n=N(this.parser,e,this.name);if(n===null)return Promise.resolve();let r=[];return n.anisotropyStrength!==void 0&&(t.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(t.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&r.push(this.parser.assignTexture(t,`anisotropyMap`,n.anisotropyTexture)),Promise.all(r)}},fe=class{constructor(e){this.parser=e,this.name=P.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},pe=class{constructor(e){this.parser=e,this.name=P.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},me=class{constructor(e){this.parser=e,this.name=P.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},he=class{constructor(e,t){this.name=t,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}else return null}},ge=class{constructor(e){this.name=P.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==B.TRIANGLES&&e.mode!==B.TRIANGLE_STRIP&&e.mode!==B.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new u.Matrix4,n=new u.Vector3,a=new u.Quaternion,s=new u.Vector3(1,1,1),c=new u.InstancedMesh(e.geometry,e.material,r);for(let e=0;e<r;e++)o.TRANSLATION&&n.fromBufferAttribute(o.TRANSLATION,e),o.ROTATION&&a.fromBufferAttribute(o.ROTATION,e),o.SCALE&&s.fromBufferAttribute(o.SCALE,e),c.setMatrixAt(e,t.compose(n,a,s));for(let t in o)if(t===`_COLOR_0`){let e=o[t];c.instanceColor=new u.InstancedBufferAttribute(e.array,e.itemSize,e.normalized)}else t!==`TRANSLATION`&&t!==`ROTATION`&&t!==`SCALE`&&e.geometry.setAttribute(t,o[t]);u.Object3D.prototype.copy.call(c,e),this.parser.assignFinalMaterial(c),i.push(c)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}},_e=`glTF`,ve=12,ye={JSON:1313821514,BIN:5130562},be=class{constructor(e){this.name=P.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,ve),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==_e)throw Error(`THREE.GLTFLoader: Unsupported glTF-Binary header.`);if(this.header.version<2)throw Error(`THREE.GLTFLoader: Legacy binary file detected.`);let r=this.header.length-ve,i=new DataView(e,ve),a=0;for(;a<r;){let t=i.getUint32(a,!0);a+=4;let r=i.getUint32(a,!0);if(a+=4,r===ye.JSON){let r=new Uint8Array(e,ve+a,t);this.content=n.decode(r)}else if(r===ye.BIN){let n=ve+a;this.body=e.slice(n,n+t)}a+=t}if(this.content===null)throw Error(`THREE.GLTFLoader: JSON content not found.`)}},xe=class{constructor(e,t){if(!t)throw Error(`THREE.GLTFLoader: No DRACOLoader instance provided.`);this.name=P.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},c={};for(let e in a){let t=je[e]||e.toLowerCase();o[t]=a[e]}for(let t in e.attributes){let r=je[t]||t.toLowerCase();if(a[t]!==void 0){let i=n.accessors[e.attributes[t]];c[r]=De[i.componentType].name,s[r]=i.normalized===!0}}return t.getDependency(`bufferView`,i).then(function(e){return new Promise(function(t,n){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let n=e.attributes[t],r=s[t];r!==void 0&&(n.normalized=r)}t(e)},o,c,u.LinearSRGBColorSpace,n)})})}},Se=class{constructor(){this.name=P.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0?e:(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e)}},Ce=class{constructor(){this.name=P.KHR_MESH_QUANTIZATION}},we=class extends u.Interpolant{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=o*2,c=o*3,l=r-t,u=(n-t)/l,d=u*u,f=d*u,p=e*c,m=p-c,h=-2*f+3*d,g=f-d,_=1-h,v=g-d+u;for(let e=0;e!==o;e++){let t=a[m+e+o],n=a[m+e+s]*l,r=a[p+e+o],c=a[p+e]*l;i[e]=_*t+v*n+h*r+g*c}return i}},Te=new u.Quaternion,Ee=class extends we{interpolate_(e,t,n,r){let i=super.interpolate_(e,t,n,r);return Te.fromArray(i).normalize().toArray(i),i}},B={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},De={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Oe={9728:u.NearestFilter,9729:u.LinearFilter,9984:u.NearestMipmapNearestFilter,9985:u.LinearMipmapNearestFilter,9986:u.NearestMipmapLinearFilter,9987:u.LinearMipmapLinearFilter},ke={33071:u.ClampToEdgeWrapping,33648:u.MirroredRepeatWrapping,10497:u.RepeatWrapping},Ae={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},je={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`,COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},Me={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},Ne={CUBICSPLINE:void 0,LINEAR:u.InterpolateLinear,STEP:u.InterpolateDiscrete},Pe={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`};function Fe(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new u.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:u.FrontSide})),e.DefaultMaterial}function Ie(e,t,n){for(let r in n.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Le(e,t){t.extras!==void 0&&(typeof t.extras==`object`?Object.assign(e.userData,t.extras):console.warn(`THREE.GLTFLoader: Ignoring primitive type .extras, `+t.extras))}function Re(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.POSITION!==void 0&&(r=!0),n.NORMAL!==void 0&&(i=!0),n.COLOR_0!==void 0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);let o=[],s=[],c=[];for(let l=0,u=t.length;l<u;l++){let u=t[l];if(r){let t=u.POSITION===void 0?e.attributes.position:n.getDependency(`accessor`,u.POSITION);o.push(t)}if(i){let t=u.NORMAL===void 0?e.attributes.normal:n.getDependency(`accessor`,u.NORMAL);s.push(t)}if(a){let t=u.COLOR_0===void 0?e.attributes.color:n.getDependency(`accessor`,u.COLOR_0);c.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(c)]).then(function(t){let n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}function ze(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn(`THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.`)}}function Be(e){let t,n=e.extensions&&e.extensions[P.KHR_DRACO_MESH_COMPRESSION];if(t=n?`draco:`+n.bufferView+`:`+n.indices+`:`+Ve(n.attributes):e.indices+`:`+Ve(e.attributes)+`:`+e.mode,e.targets!==void 0)for(let n=0,r=e.targets.length;n<r;n++)t+=`:`+Ve(e.targets[n]);return t}function Ve(e){let t=``,n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+`:`+e[n[r]]+`;`;return t}function He(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error(`THREE.GLTFLoader: Unsupported normalized accessor component type.`)}}function Ue(e){return e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}var We=new u.Matrix4,Ge=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new re,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=-1,i=!1,a=-1;if(typeof navigator<`u`&&navigator.userAgent!==void 0){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\/(\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||n&&r<17||i&&a<98?this.textureLoader=new u.TextureLoader(this.options.manager):this.textureLoader=new u.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new u.FileLoader(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return Ie(i,a,r),Le(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(n[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let r=n.clone(),i=(e,t)=>{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+ e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let r=e(t[n]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){let n=e+`:`+t,r=this.cache.get(n);if(!r){switch(e){case`scene`:r=this.loadScene(t);break;case`node`:r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case`mesh`:r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case`accessor`:r=this.loadAccessor(t);break;case`bufferView`:r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case`buffer`:r=this.loadBuffer(t);break;case`material`:r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case`texture`:r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case`skin`:r=this.loadSkin(t);break;case`animation`:r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case`camera`:r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw Error(`Unknown type: `+e);break}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this,r=this.json[e+(e===`mesh`?`es`:`s`)]||[];t=Promise.all(r.map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!==`arraybuffer`)throw Error(`THREE.GLTFLoader: `+t.type+` buffer type is not supported.`);if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[P.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,i){n.load(u.LoaderUtils.resolveURL(t.uri,r.path),e,void 0,function(){i(Error(`THREE.GLTFLoader: Failed to load buffer "`+t.uri+`".`))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency(`buffer`,t.buffer).then(function(e){let n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})}loadAccessor(e){let t=this,n=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let e=Ae[r.type],t=De[r.componentType],n=r.normalized===!0,i=new t(r.count*e);return Promise.resolve(new u.BufferAttribute(i,e,n))}let i=[];return r.bufferView===void 0?i.push(null):i.push(this.getDependency(`bufferView`,r.bufferView)),r.sparse!==void 0&&(i.push(this.getDependency(`bufferView`,r.sparse.indices.bufferView)),i.push(this.getDependency(`bufferView`,r.sparse.values.bufferView))),Promise.all(i).then(function(e){let i=e[0],a=Ae[r.type],o=De[r.componentType],s=o.BYTES_PER_ELEMENT,c=s*a,l=r.byteOffset||0,d=r.bufferView===void 0?void 0:n.bufferViews[r.bufferView].byteStride,f=r.normalized===!0,p,m;if(d&&d!==c){let e=Math.floor(l/d),n=`InterleavedBuffer:`+r.bufferView+`:`+r.componentType+`:`+e+`:`+r.count,c=t.cache.get(n);c||(p=new o(i,e*d,r.count*d/s),c=new u.InterleavedBuffer(p,d/s),t.cache.add(n,c)),m=new u.InterleavedBufferAttribute(c,a,l%d/s,f)}else p=i===null?new o(r.count*a):new o(i,l,r.count*a),m=new u.BufferAttribute(p,a,f);if(r.sparse!==void 0){let t=Ae.SCALAR,n=De[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,l=new n(e[1],s,r.sparse.count*t),d=new o(e[2],c,r.sparse.count*a);i!==null&&(m=new u.BufferAttribute(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let e=0,t=l.length;e<t;e++){let t=l[e];if(m.setX(t,d[e*a]),a>=2&&m.setY(t,d[e*a+1]),a>=3&&m.setZ(t,d[e*a+2]),a>=4&&m.setW(t,d[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}m.normalized=f}return m})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=Oe[n.magFilter]||u.LinearFilter,t.minFilter=Oe[n.minFilter]||u.LinearMipmapLinearFilter,t.wrapS=ke[n.wrapS]||u.RepeatWrapping,t.wrapT=ke[n.wrapT]||u.RepeatWrapping,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==u.NearestFilter&&t.minFilter!==u.LinearFilter,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new u.Texture(e);t.needsUpdate=!0,n(t)}),t.load(u.LoaderUtils.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),Le(e,a),e.userData.mimeType=a.mimeType||Ue(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[P.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[P.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[P.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new u.PointsMaterial,u.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new u.LineBasicMaterial,u.Material.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return u.MeshStandardMaterial}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[P.KHR_MATERIALS_UNLIT]){let e=r[P.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new u.Color(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],u.LinearSRGBColorSpace),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,u.SRGBColorSpace)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=u.DoubleSide);let l=i.alphaMode||Pe.OPAQUE;if(l===Pe.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===Pe.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==u.MeshBasicMaterial&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new u.Vector2(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==u.MeshBasicMaterial&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==u.MeshBasicMaterial){let e=i.emissiveFactor;o.emissive=new u.Color().setRGB(e[0],e[1],e[2],u.LinearSRGBColorSpace)}return i.emissiveTexture!==void 0&&a!==u.MeshBasicMaterial&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,u.SRGBColorSpace)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),Le(n,i),t.associations.set(n,{materials:e}),i.extensions&&Ie(r,n,i),n})}createUniqueName(e){let t=u.PropertyBinding.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[P.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return qe(n,e,t)})}let a=[];for(let n=0,o=e.length;n<o;n++){let o=e[n],s=Be(o),c=r[s];if(c)a.push(c.promise);else{let e;e=o.extensions&&o.extensions[P.KHR_DRACO_MESH_COMPRESSION]?i(o):qe(new u.BufferGeometry,o,t),r[s]={primitive:o,promise:e},a.push(e)}}return Promise.all(a)}loadMesh(e){let t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){let t=a[e].material===void 0?Fe(this.cache):this.getDependency(`material`,a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(n){let o=n.slice(0,n.length-1),s=n[n.length-1],c=[];for(let n=0,l=s.length;n<l;n++){let l=s[n],d=a[n],f,p=o[n];if(d.mode===B.TRIANGLES||d.mode===B.TRIANGLE_STRIP||d.mode===B.TRIANGLE_FAN||d.mode===void 0)f=i.isSkinnedMesh===!0?new u.SkinnedMesh(l,p):new u.Mesh(l,p),f.isSkinnedMesh===!0&&f.normalizeSkinWeights(),d.mode===B.TRIANGLE_STRIP?f.geometry=k(f.geometry,u.TriangleStripDrawMode):d.mode===B.TRIANGLE_FAN&&(f.geometry=k(f.geometry,u.TriangleFanDrawMode));else if(d.mode===B.LINES)f=new u.LineSegments(l,p);else if(d.mode===B.LINE_STRIP)f=new u.Line(l,p);else if(d.mode===B.LINE_LOOP)f=new u.LineLoop(l,p);else if(d.mode===B.POINTS)f=new u.Points(l,p);else throw Error(`THREE.GLTFLoader: Primitive mode unsupported: `+d.mode);Object.keys(f.geometry.morphAttributes).length>0&&ze(f,i),f.name=t.createUniqueName(i.name||`mesh_`+e),Le(f,i),d.extensions&&Ie(r,f,d),t.assignFinalMaterial(f),c.push(f)}for(let n=0,r=c.length;n<r;n++)t.associations.set(c[n],{meshes:e,primitives:n});if(c.length===1)return i.extensions&&Ie(r,c[0],i),c[0];let l=new u.Group;i.extensions&&Ie(r,l,i),t.associations.set(l,{meshes:e});for(let e=0,t=c.length;e<t;e++)l.add(c[e]);return l})}loadCamera(e){let t,n=this.json.cameras[e],r=n[n.type];if(!r){console.warn(`THREE.GLTFLoader: Missing camera parameters.`);return}return n.type===`perspective`?t=new u.PerspectiveCamera(u.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):n.type===`orthographic`&&(t=new u.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Le(t,n),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],n=[];for(let e=0,r=t.joints.length;e<r;e++)n.push(this._loadNodeShallow(t.joints[e]));return t.inverseBindMatrices===void 0?n.push(null):n.push(this.getDependency(`accessor`,t.inverseBindMatrices)),Promise.all(n).then(function(e){let n=e.pop(),r=e,i=[],a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e];if(o){i.push(o);let t=new u.Matrix4;n!==null&&t.fromArray(n.array,e*16),a.push(t)}else console.warn(`THREE.GLTFLoader: Joint "%s" could not be found.`,t.joints[e])}return new u.Skeleton(i,a)})}loadAnimation(e){let t=this.json,n=this,r=t.animations[e],i=r.name?r.name:`animation_`+e,a=[],o=[],s=[],c=[],l=[];for(let e=0,t=r.channels.length;e<t;e++){let t=r.channels[e],n=r.samplers[t.sampler],i=t.target,u=i.node,d=r.parameters===void 0?n.input:r.parameters[n.input],f=r.parameters===void 0?n.output:r.parameters[n.output];i.node!==void 0&&(a.push(this.getDependency(`node`,u)),o.push(this.getDependency(`accessor`,d)),s.push(this.getDependency(`accessor`,f)),c.push(n),l.push(i))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(c),Promise.all(l)]).then(function(e){let t=e[0],a=e[1],o=e[2],s=e[3],c=e[4],l=[];for(let e=0,r=t.length;e<r;e++){let r=t[e],i=a[e],u=o[e],d=s[e],f=c[e];if(r===void 0)continue;r.updateMatrix&&r.updateMatrix();let p=n._createAnimationTracks(r,i,u,d,f);if(p)for(let e=0;e<p.length;e++)l.push(p[e])}let d=new u.AnimationClip(i,void 0,l);return Le(d,r),d})}createNodeMesh(e){let t=this.json,n=this,r=t.nodes[e];return r.mesh===void 0?null:n.getDependency(`mesh`,r.mesh).then(function(e){let t=n._getNodeRef(n.meshCache,r.mesh,e);return r.weights!==void 0&&t.traverse(function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json,n=this,r=t.nodes[e],i=n._loadNodeShallow(e),a=[],o=r.children||[];for(let e=0,t=o.length;e<t;e++)a.push(n.getDependency(`node`,o[e]));let s=r.skin===void 0?Promise.resolve(null):n.getDependency(`skin`,r.skin);return Promise.all([i,Promise.all(a),s]).then(function(e){let t=e[0],n=e[1],r=e[2];r!==null&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,We)});for(let e=0,r=n.length;e<r;e++)t.add(n[e]);if(t.userData.pivot!==void 0&&n.length>0){let e=t.userData.pivot,r=n[0];t.pivot=new u.Vector3().fromArray(e),t.position.x-=e[0],t.position.y-=e[1],t.position.z-=e[2],r.position.set(0,0,0),delete t.userData.pivot}return t})}_loadNodeShallow(e){let t=this.json,n=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let i=t.nodes[e],a=i.name?r.createUniqueName(i.name):``,o=[],s=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return s&&o.push(s),i.camera!==void 0&&o.push(r.getDependency(`camera`,i.camera).then(function(e){return r._getNodeRef(r.cameraCache,i.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if(o=i.isBone===!0?new u.Bone:t.length>1?new u.Group:t.length===1?t[0]:new u.Object3D,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),Le(o,i),i.extensions&&Ie(n,o,i),i.matrix!==void 0){let e=new u.Matrix4;e.fromArray(i.matrix),o.applyMatrix4(e)}else i.translation!==void 0&&o.position.fromArray(i.translation),i.rotation!==void 0&&o.quaternion.fromArray(i.rotation),i.scale!==void 0&&o.scale.fromArray(i.scale);if(!r.associations.has(o))r.associations.set(o,{});else if(i.mesh!==void 0&&r.meshCache.refs[i.mesh]>1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new u.Group;n.name&&(i.name=r.createUniqueName(n.name)),Le(i,n),n.extensions&&Ie(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency(`node`,a[e]));return Promise.all(o).then(function(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];n.parent===null?i.add(n):i.add(A(n))}return r.associations=(e=>{let t=new Map;for(let[e,n]of r.associations)(e instanceof u.Material||e instanceof u.Texture)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];function c(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}Me[i.path]===Me.weights?(c(e),e.isGroup&&e.children.forEach(c)):s.push(o);let l;switch(Me[i.path]){case Me.weights:l=u.NumberKeyframeTrack;break;case Me.rotation:l=u.QuaternionKeyframeTrack;break;case Me.translation:case Me.scale:l=u.VectorKeyframeTrack;break;default:switch(n.itemSize){case 1:l=u.NumberKeyframeTrack;break;default:l=u.VectorKeyframeTrack;break}break}let d=r.interpolation===void 0?u.InterpolateLinear:Ne[r.interpolation],f=this._getArrayFromAccessor(n);for(let e=0,n=s.length;e<n;e++){let n=new l(s[e]+`.`+Me[i.path],t.array,f,d);r.interpolation===`CUBICSPLINE`&&this._createCubicSplineTrackInterpolant(n),a.push(n)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=He(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof u.QuaternionKeyframeTrack?Ee:we)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};function Ke(e,t,n){let r=t.attributes,i=new u.Box3;if(r.POSITION!==void 0){let e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(t!==void 0&&a!==void 0){if(i.set(new u.Vector3(t[0],t[1],t[2]),new u.Vector3(a[0],a[1],a[2])),e.normalized){let t=He(De[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}else{console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`);return}}else return;let a=t.targets;if(a!==void 0){let e=new u.Vector3,t=new u.Vector3;for(let r=0,i=a.length;r<i;r++){let i=a[r];if(i.POSITION!==void 0){let r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(a!==void 0&&o!==void 0){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){let e=He(De[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn(`THREE.GLTFLoader: Missing min/max properties for accessor POSITION.`)}}i.expandByVector(e)}e.boundingBox=i;let o=new u.Sphere;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}function qe(e,t,n){let r=t.attributes,i=[];function a(t,r){return n.getDependency(`accessor`,t).then(function(t){e.setAttribute(r,t)})}for(let t in r){let n=je[t]||t.toLowerCase();n in e.attributes||i.push(a(r[t],n))}if(t.indices!==void 0&&!e.index){let r=n.getDependency(`accessor`,t.indices).then(function(t){e.setIndex(t)});i.push(r)}return u.ColorManagement.workingColorSpace!==u.LinearSRGBColorSpace&&`COLOR_0`in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${u.ColorManagement.workingColorSpace}" not supported.`),Le(e,t),Ke(e,t,n),Promise.all(i).then(function(){return t.targets===void 0?e:Re(e,t.targets,n)})}var Je=/^[og]\s*(.+)?/,Ye=/^mtllib /,Xe=/^usemtl /,Ze=/^usemap /,Qe=/\s+/,$e=new u.Vector3,et=new u.Vector3,tt=new u.Vector3,nt=new u.Vector3,rt=new u.Vector3,it=new u.Color;function at(){let e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let n=this.object&&typeof this.object.currentMaterial==`function`?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize==`function`&&this.object._finalize(!0),this.object={name:e||``,fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){let n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);let r={index:this.materials.length,name:e||``,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:``,smooth:n===void 0?this.smooth:n.smooth,groupStart:n===void 0?0:n.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){let t={index:typeof e==`number`?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){let t=this.currentMaterial();if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&this.materials.length===0&&this.materials.push({name:``,smooth:this.smooth}),t}},n&&n.name&&typeof n.clone==`function`){let e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize==`function`&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){let n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){let r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){let r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){let r=this.vertices,i=this.object.geometry.normals;$e.fromArray(r,e),et.fromArray(r,t),tt.fromArray(r,n),rt.subVectors(tt,et),nt.subVectors($e,et),rt.cross(nt),rt.normalize(),i.push(rt.x,rt.y,rt.z),i.push(rt.x,rt.y,rt.z),i.push(rt.x,rt.y,rt.z)},addColor:function(e,t,n){let r=this.colors,i=this.object.geometry.colors;r[e]!==void 0&&i.push(r[e+0],r[e+1],r[e+2]),r[t]!==void 0&&i.push(r[t+0],r[t+1],r[t+2]),r[n]!==void 0&&i.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){let r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,i,a,o,s,c){let l=this.vertices.length,u=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),f=this.parseVertexIndex(n,l);if(this.addVertex(u,d,f),this.addColor(u,d,f),o!==void 0&&o!==``){let e=this.normals.length;u=this.parseNormalIndex(o,e),d=this.parseNormalIndex(s,e),f=this.parseNormalIndex(c,e),this.addNormal(u,d,f)}else this.addFaceNormal(u,d,f);if(r!==void 0&&r!==``){let e=this.uvs.length;u=this.parseUVIndex(r,e),d=this.parseUVIndex(i,e),f=this.parseUVIndex(a,e),this.addUV(u,d,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type=`Points`;let t=this.vertices.length;for(let n=0,r=e.length;n<r;n++){let r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type=`Line`;let n=this.vertices.length,r=this.uvs.length;for(let t=0,r=e.length;t<r;t++)this.addVertexLine(this.parseVertexIndex(e[t],n));for(let e=0,n=t.length;e<n;e++)this.addUVLine(this.parseUVIndex(t[e],r))}};return e.startObject(``,!1),e}var ot=class extends u.Loader{constructor(e){super(e),this.materials=null}load(e,t,n,r){let i=this,a=new u.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}},n,r)}setMaterials(e){return this.materials=e,this}parse(e){let t=new at;e.indexOf(`\r
6
6
  `)!==-1&&(e=e.replace(/\r\n/g,`
7
7
  `)),e.indexOf(`\\
8
8
  `)!==-1&&(e=e.replace(/\\\n/g,``));let n=e.split(`
9
- `),r=[];for(let e=0,i=n.length;e<i;e++){let i=n[e].trimStart();if(i.length===0)continue;let a=i.charAt(0);if(a!==`#`)if(a===`v`){let e=i.split($e);switch(e[0]){case`v`:t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),e.length>=7?(at.setRGB(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),u.SRGBColorSpace),t.colors.push(at.r,at.g,at.b)):t.colors.push(void 0,void 0,void 0);break;case`vn`:t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case`vt`:t.uvs.push(parseFloat(e[1]),parseFloat(e[2]));break}}else if(a===`f`){let e=i.slice(1).trim().split($e),n=[];for(let t=0,r=e.length;t<r;t++){let r=e[t];if(r.length>0){let e=r.split(`/`);n.push(e)}}let r=n[0];for(let e=1,i=n.length-1;e<i;e++){let i=n[e],a=n[e+1];t.addFace(r[0],i[0],a[0],r[1],i[1],a[1],r[2],i[2],a[2])}}else if(a===`l`){let e=i.substring(1).trim().split(` `),n=[],r=[];if(i.indexOf(`/`)===-1)n=e;else for(let t=0,i=e.length;t<i;t++){let i=e[t].split(`/`);i[0]!==``&&n.push(i[0]),i[1]!==``&&r.push(i[1])}t.addLineGeometry(n,r)}else if(a===`p`){let e=i.slice(1).trim().split(` `);t.addPointGeometry(e)}else if((r=Ye.exec(i))!==null){let e=(` `+r[0].slice(1).trim()).slice(1);t.startObject(e)}else if(Ze.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(Xe.test(i))t.materialLibraries.push(i.substring(7).trim());else if(Qe.test(i))console.warn(`THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.`);else if(a===`s`){if(r=i.split(` `),r.length>1){let e=r[1].trim().toLowerCase();t.object.smooth=e!==`0`&&e!==`off`}else t.object.smooth=!0;let e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if(i===`\0`)continue;console.warn(`THREE.OBJLoader: Unexpected line: "`+i+`"`)}}t.finalize();let i=new u.Group;if(i.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0))for(let e=0,n=t.objects.length;e<n;e++){let n=t.objects[e],r=n.geometry,a=n.materials,o=r.type===`Line`,s=r.type===`Points`,c=!1;if(r.vertices.length===0)continue;let l=new u.BufferGeometry;l.setAttribute(`position`,new u.Float32BufferAttribute(r.vertices,3)),r.normals.length>0&&l.setAttribute(`normal`,new u.Float32BufferAttribute(r.normals,3)),r.colors.length>0&&(c=!0,l.setAttribute(`color`,new u.Float32BufferAttribute(r.colors,3))),r.hasUVIndices===!0&&l.setAttribute(`uv`,new u.Float32BufferAttribute(r.uvs,2));let d=[];for(let e=0,n=a.length;e<n;e++){let n=a[e],r=n.name+`_`+n.smooth+`_`+c,i=t.materials[r];if(this.materials!==null){if(i=this.materials.create(n.name),o&&i&&!(i instanceof u.LineBasicMaterial)){let e=new u.LineBasicMaterial;u.Material.prototype.copy.call(e,i),e.color.copy(i.color),i=e}else if(s&&i&&!(i instanceof u.PointsMaterial)){let e=new u.PointsMaterial({size:10,sizeAttenuation:!1});u.Material.prototype.copy.call(e,i),e.color.copy(i.color),e.map=i.map,i=e}}i===void 0&&(i=o?new u.LineBasicMaterial:s?new u.PointsMaterial({size:1,sizeAttenuation:!1}):new u.MeshPhongMaterial,i.name=n.name,i.flatShading=!n.smooth,i.vertexColors=c,t.materials[r]=i),d.push(i)}let f;if(d.length>1){for(let e=0,t=a.length;e<t;e++){let t=a[e];l.addGroup(t.groupStart,t.groupCount,e)}f=o?new u.LineSegments(l,d):s?new u.Points(l,d):new u.Mesh(l,d)}else f=o?new u.LineSegments(l,d[0]):s?new u.Points(l,d[0]):new u.Mesh(l,d[0]);f.name=n.name,i.add(f)}else if(t.vertices.length>0){let e=new u.PointsMaterial({size:1,sizeAttenuation:!1}),n=new u.BufferGeometry;n.setAttribute(`position`,new u.Float32BufferAttribute(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(n.setAttribute(`color`,new u.Float32BufferAttribute(t.colors,3)),e.vertexColors=!0);let r=new u.Points(n,e);i.add(r)}return i}},ct=e=>{if(e.geometry&&e.geometry.dispose(),e.material){let t=e.material;Array.isArray(t)?t.forEach(e=>e.dispose()):t.dispose()}`dispose`in e&&typeof e.dispose==`function`&&e.dispose()},lt=e=>{let{url:t,position:n,transform:r,init:i,onDone:a,loaders:o,customLoaders:s}=e,{scene:c,worldMatrixInv:l}=O(),[u,f]=(0,d.useState)(void 0),p=(0,d.useRef)(void 0),m=(0,d.useRef)(i),h=(0,d.useRef)(a);m.current=i,h.current=a;let g=(0,d.useRef)({position:n,transform:r});g.current={position:n,transform:r};let _=(0,d.useRef)(l);_.current=l;let v=(0,d.useMemo)(()=>({...o,...s}),[o,s]),b=(0,d.useCallback)((e,t)=>{let{position:n,transform:r}=g.current;if(n&&t){let i=y.toScenePosition(t,n,0);e.position.set(i.x,i.y,i.z),r?.position&&(e.position.x+=r.position.x,e.position.y+=r.position.y,e.position.z+=r.position.z)}r?.rotation&&e.rotation.set(r.rotation.x,r.rotation.y,r.rotation.z),r?.scale&&(typeof r.scale==`number`?e.scale.set(r.scale,r.scale,r.scale):e.scale.set(r.scale.x,r.scale.y,r.scale.z)),e.updateMatrixWorld(!0)},[]),x=(0,d.useCallback)(()=>{p.current&&c&&(c.remove(p.current),p.current.traverse(ct),ct(p.current),p.current=void 0,f(void 0))},[c]);return(0,d.useEffect)(()=>{if(!c)return;typeof m.current==`function`&&m.current();let e=``;try{e=new URL(t,window.location.origin).pathname.split(`.`).pop()?.toLowerCase()||``}catch{e=t.split(`.`).pop()?.toLowerCase()||``}let n=v[e];if(!n){console.warn(`useThreeModel: No loader found for file extension "${e}". Supported extensions: ${Object.keys(v).join(`, `)}`);return}let r=!1;return n(t,e=>{if(r){e.traverse(ct),ct(e);return}p.current&&x(),p.current=e,b(e,_.current),c.add(e),f(e),typeof h.current==`function`&&h.current()}),()=>{r=!0,x()}},[t,c,v,x,b]),(0,d.useEffect)(()=>{u&&b(u,l)},[u,n,r,l,b]),u},ut=e=>{let{url:t,position:n,transform:r,init:i,onDone:a,customLoaders:o}=e;return lt({url:t,position:n,transform:r,init:i,onDone:a,loaders:(0,d.useMemo)(()=>({gltf:(e,t)=>{new M().load(e,e=>t(e.scene))},glb:(e,t)=>{new M().load(e,e=>t(e.scene))},obj:(e,t)=>{new st().load(e,e=>t(e))}}),[]),customLoaders:o}),null};function dt(e,t,n){try{let r=e.next();r.done||!r.value?t(r):r.value.then(()=>t({done:r.done,value:void 0}),n)}catch(e){n(e)}}function ft(e=25){let t;return(n,r,i)=>{let a=performance.now();t===void 0||a-t>e?(t=a,setTimeout(()=>dt(n,r,i),0)):dt(n,r,i)}}function pt(e,t,n,r,i){let a=()=>{let o,s=e=>{e.done?n(e.value):o===void 0?o=!0:a()};do{if(o=void 0,i?.aborted){r(new DOMException(`Aborted`,`AbortError`));return}t(e,s,r),o===void 0&&(o=!1)}while(o)};a()}function mt(e,t){let n;return pt(e,dt,e=>{n=e},e=>{throw e},t),n}function ht(e,t,n){return new Promise((r,i)=>{pt(e,t,r,i,n)})}var gt=`
9
+ `),r=[];for(let e=0,i=n.length;e<i;e++){let i=n[e].trimStart();if(i.length===0)continue;let a=i.charAt(0);if(a!==`#`)if(a===`v`){let e=i.split(Qe);switch(e[0]){case`v`:t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),e.length>=7?(it.setRGB(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),u.SRGBColorSpace),t.colors.push(it.r,it.g,it.b)):t.colors.push(void 0,void 0,void 0);break;case`vn`:t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case`vt`:t.uvs.push(parseFloat(e[1]),parseFloat(e[2]));break}}else if(a===`f`){let e=i.slice(1).trim().split(Qe),n=[];for(let t=0,r=e.length;t<r;t++){let r=e[t];if(r.length>0){let e=r.split(`/`);n.push(e)}}let r=n[0];for(let e=1,i=n.length-1;e<i;e++){let i=n[e],a=n[e+1];t.addFace(r[0],i[0],a[0],r[1],i[1],a[1],r[2],i[2],a[2])}}else if(a===`l`){let e=i.substring(1).trim().split(` `),n=[],r=[];if(i.indexOf(`/`)===-1)n=e;else for(let t=0,i=e.length;t<i;t++){let i=e[t].split(`/`);i[0]!==``&&n.push(i[0]),i[1]!==``&&r.push(i[1])}t.addLineGeometry(n,r)}else if(a===`p`){let e=i.slice(1).trim().split(` `);t.addPointGeometry(e)}else if((r=Je.exec(i))!==null){let e=(` `+r[0].slice(1).trim()).slice(1);t.startObject(e)}else if(Xe.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(Ye.test(i))t.materialLibraries.push(i.substring(7).trim());else if(Ze.test(i))console.warn(`THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.`);else if(a===`s`){if(r=i.split(` `),r.length>1){let e=r[1].trim().toLowerCase();t.object.smooth=e!==`0`&&e!==`off`}else t.object.smooth=!0;let e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if(i===`\0`)continue;console.warn(`THREE.OBJLoader: Unexpected line: "`+i+`"`)}}t.finalize();let i=new u.Group;if(i.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0))for(let e=0,n=t.objects.length;e<n;e++){let n=t.objects[e],r=n.geometry,a=n.materials,o=r.type===`Line`,s=r.type===`Points`,c=!1;if(r.vertices.length===0)continue;let l=new u.BufferGeometry;l.setAttribute(`position`,new u.Float32BufferAttribute(r.vertices,3)),r.normals.length>0&&l.setAttribute(`normal`,new u.Float32BufferAttribute(r.normals,3)),r.colors.length>0&&(c=!0,l.setAttribute(`color`,new u.Float32BufferAttribute(r.colors,3))),r.hasUVIndices===!0&&l.setAttribute(`uv`,new u.Float32BufferAttribute(r.uvs,2));let d=[];for(let e=0,n=a.length;e<n;e++){let n=a[e],r=n.name+`_`+n.smooth+`_`+c,i=t.materials[r];if(this.materials!==null){if(i=this.materials.create(n.name),o&&i&&!(i instanceof u.LineBasicMaterial)){let e=new u.LineBasicMaterial;u.Material.prototype.copy.call(e,i),e.color.copy(i.color),i=e}else if(s&&i&&!(i instanceof u.PointsMaterial)){let e=new u.PointsMaterial({size:10,sizeAttenuation:!1});u.Material.prototype.copy.call(e,i),e.color.copy(i.color),e.map=i.map,i=e}}i===void 0&&(i=o?new u.LineBasicMaterial:s?new u.PointsMaterial({size:1,sizeAttenuation:!1}):new u.MeshPhongMaterial,i.name=n.name,i.flatShading=!n.smooth,i.vertexColors=c,t.materials[r]=i),d.push(i)}let f;if(d.length>1){for(let e=0,t=a.length;e<t;e++){let t=a[e];l.addGroup(t.groupStart,t.groupCount,e)}f=o?new u.LineSegments(l,d):s?new u.Points(l,d):new u.Mesh(l,d)}else f=o?new u.LineSegments(l,d[0]):s?new u.Points(l,d[0]):new u.Mesh(l,d[0]);f.name=n.name,i.add(f)}else if(t.vertices.length>0){let e=new u.PointsMaterial({size:1,sizeAttenuation:!1}),n=new u.BufferGeometry;n.setAttribute(`position`,new u.Float32BufferAttribute(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(n.setAttribute(`color`,new u.Float32BufferAttribute(t.colors,3)),e.vertexColors=!0);let r=new u.Points(n,e);i.add(r)}return i}},st=e=>{if(e.geometry&&e.geometry.dispose(),e.material){let t=e.material;Array.isArray(t)?t.forEach(e=>e.dispose()):t.dispose()}`dispose`in e&&typeof e.dispose==`function`&&e.dispose()},ct=e=>{let{url:t,position:n,transform:r,init:i,onDone:a,loaders:o,customLoaders:s}=e,{scene:c,worldMatrixInv:l}=O(),[u,f]=(0,d.useState)(void 0),p=(0,d.useRef)(void 0),m=(0,d.useRef)(i),h=(0,d.useRef)(a);m.current=i,h.current=a;let g=(0,d.useRef)({position:n,transform:r});g.current={position:n,transform:r};let _=(0,d.useRef)(l);_.current=l;let v=(0,d.useMemo)(()=>({...o,...s}),[o,s]),b=(0,d.useCallback)((e,t)=>{let{position:n,transform:r}=g.current;if(n&&t){let i=y.toScenePosition(t,n,0);e.position.set(i.x,i.y,i.z),r?.position&&(e.position.x+=r.position.x,e.position.y+=r.position.y,e.position.z+=r.position.z)}r?.rotation&&e.rotation.set(r.rotation.x,r.rotation.y,r.rotation.z),r?.scale&&(typeof r.scale==`number`?e.scale.set(r.scale,r.scale,r.scale):e.scale.set(r.scale.x,r.scale.y,r.scale.z)),e.updateMatrixWorld(!0)},[]),x=(0,d.useCallback)(()=>{p.current&&c&&(c.remove(p.current),p.current.traverse(st),st(p.current),p.current=void 0,f(void 0))},[c]);return(0,d.useEffect)(()=>{if(!c)return;typeof m.current==`function`&&m.current();let e=``;try{e=new URL(t,window.location.origin).pathname.split(`.`).pop()?.toLowerCase()||``}catch{e=t.split(`.`).pop()?.toLowerCase()||``}let n=v[e];if(!n){console.warn(`useThreeModel: No loader found for file extension "${e}". Supported extensions: ${Object.keys(v).join(`, `)}`);return}let r=!1;return n(t,e=>{if(r){e.traverse(st),st(e);return}p.current&&x(),p.current=e,b(e,_.current),c.add(e),f(e),typeof h.current==`function`&&h.current()}),()=>{r=!0,x()}},[t,c,v,x,b]),(0,d.useEffect)(()=>{u&&b(u,l)},[u,n,r,l,b]),u},lt=e=>{let{url:t,position:n,transform:r,init:i,onDone:a,customLoaders:o}=e;return ct({url:t,position:n,transform:r,init:i,onDone:a,loaders:(0,d.useMemo)(()=>({gltf:(e,t)=>{new M().load(e,e=>t(e.scene))},glb:(e,t)=>{new M().load(e,e=>t(e.scene))},obj:(e,t)=>{new ot().load(e,e=>t(e))}}),[]),customLoaders:o}),null};function ut(e,t,n){try{let r=e.next();r.done||!r.value?t(r):r.value.then(()=>t({done:r.done,value:void 0}),n)}catch(e){n(e)}}function dt(e=25){let t;return(n,r,i)=>{let a=performance.now();t===void 0||a-t>e?(t=a,setTimeout(()=>ut(n,r,i),0)):ut(n,r,i)}}function ft(e,t,n,r,i){let a=()=>{let o,s=e=>{e.done?n(e.value):o===void 0?o=!0:a()};do{if(o=void 0,i?.aborted){r(new DOMException(`Aborted`,`AbortError`));return}t(e,s,r),o===void 0&&(o=!1)}while(o)};a()}function pt(e,t){let n;return ft(e,ut,e=>{n=e},e=>{throw e},t),n}function mt(e,t,n){return new Promise((r,i)=>{ft(e,t,r,i,n)})}var ht=`
10
10
  precision highp float;
11
11
  #include <common>
12
12
 
@@ -243,7 +243,7 @@ void main() {
243
243
 
244
244
  gl_Position = gaussianSplatting(vPosition, worldPos.xyz, vec2(1.0, 1.0), covA, covB, modelMatrix, viewMatrix, projectionMatrix);
245
245
  }
246
- `,_t=`
246
+ `,gt=`
247
247
  precision highp float;
248
248
  #include <common>
249
249
 
@@ -260,15 +260,15 @@ vec4 gaussianColor(vec4 inColor) {
260
260
  void main() {
261
261
  gl_FragColor = gaussianColor(vColor);
262
262
  }
263
- `,vt=e=>u.DataUtils.toHalfFloat(e),yt=class{static build(e=1){let t=new u.BufferGeometry;t.setIndex([0,1,2]);let n=new u.BufferAttribute(new Float32Array([-3,-2,0,3,-2,0,0,4,0]),3);t.setAttribute(`position`,n);let r=new u.InstancedBufferGeometry;r.setIndex(t.getIndex()),r.setAttribute(`position`,t.getAttribute(`position`));let i=new u.InstancedBufferAttribute(new Float32Array(e),1,!1);return i.setUsage(u.DynamicDrawUsage),r.setAttribute(`splatIndex`,i),r.instanceCount=0,r}},bt=class e{static BATCH_SIZE=327680;static workCount=0;vertexCount=0;positions=null;hasInit=!1;splatIndex=null;depthValues=null;tempDepths=null;tempIndices=null;abortController=null;onmessage=null;terminate(){this.abortController?.abort(),this.abortController=null,this.vertexCount=0,this.positions=null,this.splatIndex=null,this.onmessage=null}initSortData(){if(this.hasInit||this.vertexCount<0)return;let e=this.vertexCount;this.depthValues=new Int32Array(e),this.splatIndex=new Uint32Array(e),this.tempDepths=new Int32Array(e),this.tempIndices=new Uint32Array(e),this.hasInit=!0}*sortData(t,n){this.hasInit||this.initSortData();let{positions:r,vertexCount:i,depthValues:a,splatIndex:o,tempDepths:s,tempIndices:c}=this;if(!r||!a||!o||!s||!c)return;let l=-1/0,u=1/0;for(let e=0;e<i;e++){o[e]=e;let n=t[2]*r[4*e]+t[6]*r[4*e+1]+t[10]*r[4*e+2],i=Math.floor(n*4096);a[e]=i,l=Math.max(l,i),u=Math.min(u,i)}n&&(e.workCount+=i,e.workCount>e.BATCH_SIZE&&(e.workCount=0,yield));let d=-u;for(let e=0;e<i;e++)a[e]+=d;let f=new Uint32Array(256);for(let t=0;t<32;t+=8){f.fill(0);for(let e=0;e<i;e++)f[a[e]>>t&255]++;let r=0;for(let e=0;e<f.length;e++){let t=f[e];f[e]=r,r+=t}for(let e=0;e<i;e++){let n=a[e]>>t&255,r=f[n]++;s[r]=a[e],c[r]=o[e]}a.set(s),o.set(c),n&&(e.workCount+=i,e.workCount>e.BATCH_SIZE&&(e.workCount=0,yield))}}init(e,t){this.positions=e,this.vertexCount=t,this.initSortData()}async sortDataAsync(e){this.abortController?.abort(),this.abortController=new AbortController;let t=this.abortController.signal;try{await ht(this.sortData(e,!0),ft(),t),this.onmessage&&this.splatIndex&&this.onmessage(this.splatIndex)}catch(e){e instanceof Error&&e.name!==`AbortError`&&console.error(`Splat sort error:`,e)}finally{this.abortController=null}}},xt=class{static build(e=0){return new u.ShaderMaterial({uniforms:{invViewport:{value:new u.Vector2},dataTextureSize:{value:new u.Vector2},focal:{value:new u.Vector2},covariancesATexture:{value:null},covariancesBTexture:{value:null},centersTexture:{value:null},colorsTexture:{value:null},shTexture0:{value:null},shTexture1:{value:null},shTexture2:{value:null}},defines:{SH_DEGREE:e},vertexShader:gt,fragmentShader:_t,transparent:!0,alphaTest:1,blending:u.NormalBlending,depthTest:!0,depthWrite:!0,side:u.DoubleSide})}static updateUniforms(e,t,n){let r=n.material;if(!r?.uniforms)return;let{uniforms:i}=r,a=e.getSize(new u.Vector2);if(i.invViewport.value.set(1/a.x,1/a.y),t){let e=t._cleanProjectionMatrix,n=e?.elements??e??t.projectionMatrix.elements;i.focal.value.set(n[0]*.5*a.x,n[5]*.5*a.y)}if(n.covariancesATexture){let{width:e,height:t}=n.covariancesATexture.image;i.dataTextureSize.value.set(e,t),i.covariancesATexture.value=n.covariancesATexture,i.covariancesBTexture.value=n.covariancesBTexture,i.centersTexture.value=n.centersTexture,i.colorsTexture.value=n.colorsTexture,n.shTextures?.forEach((e,t)=>{i[`shTexture${t}`].value=e})}r.uniformsNeedUpdate=!0}},St=class e extends u.Mesh{static ROW_OUTPUT_LENGTH=32;static SPLAT_BATCH_SIZE=327680;vertexCount=0;worker=null;frameIdLastUpdate=-1;frameIdThisUpdate=0;cameraMatrix=null;internalModelViewMatrix=null;canPostToWorker=!1;covariancesATextureInternal=null;covariancesBTextureInternal=null;centersTextureInternal=null;colorsTextureInternal=null;splatPositions=null;splatPositions2=null;splatIndex=null;shTexturesInternal=null;splatsDataInternal=null;keepInRam=!1;oldDirection=new u.Vector3;useRGBACovariants=!0;tmpCovariances=[0,0,0,0,0,0];sortIsDirty=!1;lastSortTime=0;sortThrottleMs=200;shDegreeValue=0;tempQuaternion=new u.Quaternion;tempPosition=new u.Vector3;tempScale=new u.Vector3;tempColor=new Uint8Array(4);tempMatrix=new u.Matrix4;isGaussianSplattingMesh=!0;readyToDisplay=!1;type=`GaussianSplattingMesh`;get shDegree(){return this.shDegreeValue}get splatsData(){return this.splatsDataInternal}get covariancesATexture(){return this.covariancesATextureInternal}get covariancesBTexture(){return this.covariancesBTextureInternal}get centersTexture(){return this.centersTextureInternal}get colorsTexture(){return this.colorsTextureInternal}get shTextures(){return this.shTexturesInternal}constructor(){super(),this.geometry=yt.build(),this.material=xt.build(),this.setEnabled(!1)}setEnabled(e){this.visible=e}postToWorker(e=!1){let t=this.frameIdThisUpdate;if((e||t!==this.frameIdLastUpdate)&&this.worker&&this.cameraMatrix&&this.canPostToWorker){this.internalModelViewMatrix=new u.Matrix4().multiplyMatrices(this.cameraMatrix,this.matrixWorld);let n=this.cameraMatrix.clone().invert(),r=new u.Matrix4().multiplyMatrices(n,this.matrixWorld),i=new u.Vector3(0,0,1).transformDirection(r),a=i.dot(this.oldDirection);if(e||Math.abs(a-1)>=.01)return this.oldDirection.copy(i),this.frameIdLastUpdate=t,this.canPostToWorker=!1,this.worker.sortDataAsync(this.internalModelViewMatrix.elements)}}onBeforeRender(e,t,n,r,i,a){this.frameIdThisUpdate=e.info.render.frame;let o=performance.now();o-this.lastSortTime>this.sortThrottleMs&&(this.lastSortTime=o,this.sortDataAsync(n).catch(e=>{e.name!==`AbortError`&&console.warn(`Splat sorting error:`,e)})),xt.updateUniforms(e,n,this),super.onBeforeRender(e,t,n,r,i,a)}loadDataAsync(e){return this.updateDataAsync(e)}dispose(){this.covariancesATextureInternal?.dispose(),this.covariancesBTextureInternal?.dispose(),this.centersTextureInternal?.dispose(),this.colorsTextureInternal?.dispose(),this.shTexturesInternal?.forEach(e=>e.dispose()),this.covariancesATextureInternal=null,this.covariancesBTextureInternal=null,this.centersTextureInternal=null,this.colorsTextureInternal=null,this.shTexturesInternal=null,this.worker?.terminate(),this.worker=null}copyTextures(e){this.covariancesATextureInternal=e.covariancesATexture?.clone()??null,this.covariancesBTextureInternal=e.covariancesBTexture?.clone()??null,this.centersTextureInternal=e.centersTexture?.clone()??null,this.colorsTextureInternal=e.colorsTexture?.clone()??null,e.shTexturesInternal&&(this.shTexturesInternal=e.shTexturesInternal.map(e=>e.clone()))}clone(){let t=new e;return t.geometry=this.geometry.clone(),t.material=this.material.clone(),t.vertexCount=this.vertexCount,t.copyTextures(this),t.splatPositions=this.splatPositions,t.readyToDisplay=!1,t.instantiateWorker(),t}makeSplatFromComponents(e,t,n,r,i,a,o,s,c,l,u){i.w=-i.w,r=r.multiplyScalar(2);let d=this.tempMatrix.elements,f=this.useRGBACovariants?4:2;this.splatPositions[4*e+0]=n.x,this.splatPositions[4*e+1]=n.y,this.splatPositions[4*e+2]=n.z,this.splatPositions2[4*e+0]=n.x,this.splatPositions2[4*e+1]=n.y,this.splatPositions2[4*e+2]=n.z,l.min(n),u.max(n);let{x:p,y:m,z:h,w:g}=i,_=p+p,v=m+m,y=h+h,b=p*_,x=p*v,S=p*y,C=m*v,ee=m*y,w=h*y,T=g*_,te=g*v,E=g*y,{x:D,y:O,z:ne}=r;d[0]=(1-(C+w))*D,d[1]=(x+E)*O,d[2]=(S-te)*ne,d[4]=(x-E)*D,d[5]=(1-(b+w))*O,d[6]=(ee+T)*ne,d[8]=(S+te)*D,d[9]=(ee-T)*O,d[10]=(1-(b+C))*ne;let k=this.tmpCovariances;k[0]=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],k[1]=d[0]*d[4]+d[1]*d[5]+d[2]*d[6],k[2]=d[0]*d[8]+d[1]*d[9]+d[2]*d[10],k[3]=d[4]*d[4]+d[5]*d[5]+d[6]*d[6],k[4]=d[4]*d[8]+d[5]*d[9]+d[6]*d[10],k[5]=d[8]*d[8]+d[9]*d[9]+d[10]*d[10];let A=-1e4;for(let e=0;e<6;e++)A=Math.max(A,Math.abs(k[e]));this.splatPositions[4*e+3]=A,this.splatPositions2[4*e+3]=A,o[t*4+0]=vt(k[0]/A),o[t*4+1]=vt(k[1]/A),o[t*4+2]=vt(k[2]/A),o[t*4+3]=vt(k[3]/A),s[t*f+0]=vt(k[4]/A),s[t*f+1]=vt(k[5]/A),c[t*4+0]=a[0],c[t*4+1]=a[1],c[t*4+2]=a[2],c[t*4+3]=a[3]}makeSplatFromBuffer(e,t,n,r,i,a,o,s,c){let l=8*e,u=32*e;this.tempPosition.set(n[l],n[l+1],n[l+2]),this.tempScale.set(n[l+3],n[l+4],n[l+5]),this.tempQuaternion.set((r[u+29]-127.5)/127.5,(r[u+30]-127.5)/127.5,(r[u+31]-127.5)/127.5,(r[u+28]-127.5)/127.5).normalize(),this.tempColor[0]=r[u+24],this.tempColor[1]=r[u+25],this.tempColor[2]=r[u+26],this.tempColor[3]=r[u+27],this.makeSplatFromComponents(e,t,this.tempPosition,this.tempScale,this.tempQuaternion,this.tempColor,i,a,o,s,c)}updateTextures(e,t,n,r){let i=this.getTextureSize(this.vertexCount),a=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.FloatType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i},o=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.UnsignedByteType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i},s=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.UnsignedIntType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i},c=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.HalfFloatType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i};this.covariancesATextureInternal=c(e,i.x,i.y,u.RGBAFormat),this.covariancesBTextureInternal=c(t,i.x,i.y,this.useRGBACovariants?u.RGBAFormat:u.RGFormat),this.centersTextureInternal=a(this.splatPositions,i.x,i.y,u.RGBAFormat),this.colorsTextureInternal=o(n,i.x,i.y,u.RGBAFormat),r&&(this.shTexturesInternal=r.map(e=>{let t=s(new Uint32Array(e.buffer),i.x,i.y,u.RGBAIntegerFormat);return t.wrapS=u.ClampToEdgeWrapping,t.wrapT=u.ClampToEdgeWrapping,t})),this.instantiateWorker()}updateBoundingInfo(e,t){this.boundingBox=new u.Box3(e,t),this.boundingSphere=this.boundingBox.getBoundingSphere(new u.Sphere)}*updateDataCoroutine(t,n,r){this.covariancesATextureInternal||(this.readyToDisplay=!1);let i=new Uint8Array(t),a=new Float32Array(i.buffer);this.keepInRam&&(this.splatsDataInternal=t),this.shDegreeValue=r?r.length:0;let o=i.length/e.ROW_OUTPUT_LENGTH;o!==this.vertexCount&&(this.vertexCount=o,this.geometry=yt.build(this.vertexCount),this.material=xt.build(this.shDegreeValue),this.updateSplatIndexBuffer(this.vertexCount));let s=this.getTextureSize(o),c=s.x*s.y;this.splatPositions=new Float32Array(4*c),this.splatPositions2=new Float32Array(4*o);let l=new Uint16Array(c*4),d=new Uint16Array((this.useRGBACovariants?4:2)*c),f=new Uint8Array(c*4),p=new u.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),m=new u.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let t=0;t<o;t++)this.makeSplatFromBuffer(t,t,a,i,l,d,f,p,m),n&&t%e.SPLAT_BATCH_SIZE===0&&(yield);this.updateTextures(l,d,f,r),this.updateBoundingInfo(p,m),this.setEnabled(!0),this.postToWorker(!0)}async updateDataAsync(e,t){return ht(this.updateDataCoroutine(e,!0,t),ft())}updateData(e,t){mt(this.updateDataCoroutine(e,!1,t))}sortDataAsync(e,t=!1){return!this.worker||!e?Promise.resolve():(this.cameraMatrix=e.matrixWorldInverse,this.postToWorker(t)??Promise.resolve())}updateSplatIndexBuffer(e){if(!this.splatIndex||e>this.splatIndex.length){this.splatIndex=new Float32Array(e);for(let t=0;t<e;t++)this.splatIndex[t]=t;this.geometry.attributes.splatIndex.set(this.splatIndex),this.geometry.attributes.splatIndex.needsUpdate=!0}this.geometry.instanceCount=e}instantiateWorker(){this.vertexCount&&(this.updateSplatIndexBuffer(this.vertexCount),this.worker?.terminate(),this.worker=new bt,this.worker.init(this.splatPositions2,this.vertexCount),this.canPostToWorker=!0,this.worker.onmessage=e=>{if(this.splatIndex&&e){for(let t=0;t<this.vertexCount;t++)this.splatIndex[t]=e[t];this.geometry.attributes.splatIndex.set(this.splatIndex)}this.geometry.attributes.splatIndex.needsUpdate=!0,this.canPostToWorker=!0,this.readyToDisplay=!0,this.sortIsDirty&&=(this.postToWorker(!0),!1)})}getTextureSize(e){let t=4096,n=1;for(;t*n<e;)n*=2;return n>t&&(console.error(`GaussianSplatting texture size: (${t}, ${n}), maxTextureSize: ${t}`),n=t),new u.Vector2(t,n)}},Ct=class extends u.Loader{load(e,t,n,r){let i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>this.parse(e,t,r),n,r)}parse(e,t,n){let r=new St;r.loadDataAsync(e).then(()=>t(r)).catch(e=>{n?n(e):console.error(e)})}},wt=(e,t)=>{let n=(1<<t)-1;return(e&n)/n},Tt=(e,t)=>{t.x=wt(e>>>21,11),t.y=wt(e>>>11,10),t.z=wt(e,11)},Et=(e,t)=>{t[0]=wt(e>>>24,8)*255,t[1]=wt(e>>>16,8)*255,t[2]=wt(e>>>8,8)*255,t[3]=wt(e,8)*255},Dt=(e,t)=>{let n=1/(Math.sqrt(2)*.5),r=(wt(e>>>20,10)-.5)*n,i=(wt(e>>>10,10)-.5)*n,a=(wt(e,10)-.5)*n,o=Math.sqrt(1-(r*r+i*i+a*a));switch(e>>>30){case 0:t.set(o,r,i,a);break;case 1:t.set(r,o,i,a);break;case 2:t.set(r,i,o,a);break;case 3:t.set(r,i,a,o);break}},Ot=function(e){return e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`,e[e.DOUBLE=3]=`DOUBLE`,e[e.UCHAR=4]=`UCHAR`,e[e.UNDEFINED=5]=`UNDEFINED`,e}(Ot||{}),B=function(e){return e[e.MIN_X=0]=`MIN_X`,e[e.MIN_Y=1]=`MIN_Y`,e[e.MIN_Z=2]=`MIN_Z`,e[e.MAX_X=3]=`MAX_X`,e[e.MAX_Y=4]=`MAX_Y`,e[e.MAX_Z=5]=`MAX_Z`,e[e.MIN_SCALE_X=6]=`MIN_SCALE_X`,e[e.MIN_SCALE_Y=7]=`MIN_SCALE_Y`,e[e.MIN_SCALE_Z=8]=`MIN_SCALE_Z`,e[e.MAX_SCALE_X=9]=`MAX_SCALE_X`,e[e.MAX_SCALE_Y=10]=`MAX_SCALE_Y`,e[e.MAX_SCALE_Z=11]=`MAX_SCALE_Z`,e[e.PACKED_POSITION=12]=`PACKED_POSITION`,e[e.PACKED_ROTATION=13]=`PACKED_ROTATION`,e[e.PACKED_SCALE=14]=`PACKED_SCALE`,e[e.PACKED_COLOR=15]=`PACKED_COLOR`,e[e.X=16]=`X`,e[e.Y=17]=`Y`,e[e.Z=18]=`Z`,e[e.SCALE_0=19]=`SCALE_0`,e[e.SCALE_1=20]=`SCALE_1`,e[e.SCALE_2=21]=`SCALE_2`,e[e.DIFFUSE_RED=22]=`DIFFUSE_RED`,e[e.DIFFUSE_GREEN=23]=`DIFFUSE_GREEN`,e[e.DIFFUSE_BLUE=24]=`DIFFUSE_BLUE`,e[e.OPACITY=25]=`OPACITY`,e[e.F_DC_0=26]=`F_DC_0`,e[e.F_DC_1=27]=`F_DC_1`,e[e.F_DC_2=28]=`F_DC_2`,e[e.F_DC_3=29]=`F_DC_3`,e[e.ROT_0=30]=`ROT_0`,e[e.ROT_1=31]=`ROT_1`,e[e.ROT_2=32]=`ROT_2`,e[e.ROT_3=33]=`ROT_3`,e[e.UNDEFINED=34]=`UNDEFINED`,e}(B||{}),kt=class e extends u.Loader{static ROW_OUTPUT_LENGTH=32;static SH_C0=.28209479177387814;static PLY_CONVERSION_BATCH_SIZE=32768;load(e,t,n,r){let i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>this.parse(e,t,r),n,r)}parse(t,n,r){e.ConvertPLYToSplatAsync(t).then(e=>{let t=new St;return t.loadDataAsync(e).then(()=>n(t))}).catch(e=>{r?r(e):console.error(e)})}static async ConvertPLYToSplatAsync(t){return ht(e.ConvertPLYToSplat(t,!0),ft())}static*ConvertPLYToSplat(t,n=!1){let r=e.ParseHeader(t);if(!r)return t;let i={value:0},a=e.getCompressedChunks(r,i);for(let t=0;t<r.vertexCount;t++)e.getSplat(r,t,a,i),n&&t%e.PLY_CONVERSION_BATCH_SIZE===0&&(yield);return r.buffer}static getCompressedChunks(e,t){if(!e.chunkCount)return null;let{dataView:n,chunkProperties:r,rowChunkLength:i,chunkCount:a}=e,o=[];for(let e=0;e<a;e++){let e={min:new u.Vector3,max:new u.Vector3,minScale:new u.Vector3,maxScale:new u.Vector3};for(let i of r){if(i.type!==Ot.FLOAT)continue;let r=n.getFloat32(i.offset+t.value,!0);switch(i.value){case B.MIN_X:e.min.x=r;break;case B.MIN_Y:e.min.y=r;break;case B.MIN_Z:e.min.z=r;break;case B.MAX_X:e.max.x=r;break;case B.MAX_Y:e.max.y=r;break;case B.MAX_Z:e.max.z=r;break;case B.MIN_SCALE_X:e.minScale.x=r;break;case B.MIN_SCALE_Y:e.minScale.y=r;break;case B.MIN_SCALE_Z:e.minScale.z=r;break;case B.MAX_SCALE_X:e.maxScale.x=r;break;case B.MAX_SCALE_Y:e.maxScale.y=r;break;case B.MAX_SCALE_Z:e.maxScale.z=r;break}}o.push(e),t.value+=i}return o}static getSplat(t,n,r,i){let a=new u.Quaternion,o=new u.Vector3,{buffer:s,dataView:c,vertexProperties:l,rowVertexLength:d}=t,f=e.ROW_OUTPUT_LENGTH,p=new Float32Array(s,n*f,3),m=new Float32Array(s,n*f+12,3),h=new Uint8ClampedArray(s,n*f+24,4),g=new Uint8ClampedArray(s,n*f+28,4),_=n>>8,v=255,y=0,b=0,x=0;for(let t of l){let n;switch(t.type){case Ot.FLOAT:n=c.getFloat32(i.value+t.offset,!0);break;case Ot.INT:n=c.getInt32(i.value+t.offset,!0);break;case Ot.UINT:n=c.getUint32(i.value+t.offset,!0);break;case Ot.DOUBLE:n=c.getFloat64(i.value+t.offset,!0);break;case Ot.UCHAR:n=c.getUint8(i.value+t.offset);break;default:continue}let s=r?.[_];switch(t.value){case B.PACKED_POSITION:Tt(n,o),p[0]=u.MathUtils.lerp(s.min.x,s.max.x,o.x),p[1]=-u.MathUtils.lerp(s.min.y,s.max.y,o.y),p[2]=u.MathUtils.lerp(s.min.z,s.max.z,o.z);break;case B.PACKED_ROTATION:Dt(n,a),v=a.w,y=a.z,b=a.y,x=a.x;break;case B.PACKED_SCALE:Tt(n,o),m[0]=Math.exp(u.MathUtils.lerp(s.minScale.x,s.maxScale.x,o.x)),m[1]=Math.exp(u.MathUtils.lerp(s.minScale.y,s.maxScale.y,o.y)),m[2]=Math.exp(u.MathUtils.lerp(s.minScale.z,s.maxScale.z,o.z));break;case B.PACKED_COLOR:Et(n,h);break;case B.X:p[0]=n;break;case B.Y:p[1]=n;break;case B.Z:p[2]=n;break;case B.SCALE_0:m[0]=Math.exp(n);break;case B.SCALE_1:m[1]=Math.exp(n);break;case B.SCALE_2:m[2]=Math.exp(n);break;case B.DIFFUSE_RED:h[0]=n;break;case B.DIFFUSE_GREEN:h[1]=n;break;case B.DIFFUSE_BLUE:h[2]=n;break;case B.F_DC_0:h[0]=(.5+e.SH_C0*n)*255;break;case B.F_DC_1:h[1]=(.5+e.SH_C0*n)*255;break;case B.F_DC_2:h[2]=(.5+e.SH_C0*n)*255;break;case B.F_DC_3:h[3]=(.5+e.SH_C0*n)*255;break;case B.OPACITY:h[3]=1/(1+Math.exp(-n))*255;break;case B.ROT_0:v=n;break;case B.ROT_1:y=n;break;case B.ROT_2:b=n;break;case B.ROT_3:x=n;break}}a.set(y,b,x,v).normalize(),g[0]=a.w*128+128,g[1]=a.x*128+128,g[2]=a.y*128+128,g[3]=a.z*128+128,i.value+=d}static typeNameToEnum(e){switch(e){case`float`:return Ot.FLOAT;case`int`:return Ot.INT;case`uint`:return Ot.UINT;case`double`:return Ot.DOUBLE;case`uchar`:return Ot.UCHAR;default:return Ot.UNDEFINED}}static valueNameToEnum(e){return{min_x:B.MIN_X,min_y:B.MIN_Y,min_z:B.MIN_Z,max_x:B.MAX_X,max_y:B.MAX_Y,max_z:B.MAX_Z,min_scale_x:B.MIN_SCALE_X,min_scale_y:B.MIN_SCALE_Y,min_scale_z:B.MIN_SCALE_Z,max_scale_x:B.MAX_SCALE_X,max_scale_y:B.MAX_SCALE_Y,max_scale_z:B.MAX_SCALE_Z,packed_position:B.PACKED_POSITION,packed_rotation:B.PACKED_ROTATION,packed_scale:B.PACKED_SCALE,packed_color:B.PACKED_COLOR,x:B.X,y:B.Y,z:B.Z,scale_0:B.SCALE_0,scale_1:B.SCALE_1,scale_2:B.SCALE_2,diffuse_red:B.DIFFUSE_RED,red:B.DIFFUSE_RED,diffuse_green:B.DIFFUSE_GREEN,green:B.DIFFUSE_GREEN,diffuse_blue:B.DIFFUSE_BLUE,blue:B.DIFFUSE_BLUE,f_dc_0:B.F_DC_0,f_dc_1:B.F_DC_1,f_dc_2:B.F_DC_2,f_dc_3:B.F_DC_3,opacity:B.OPACITY,rot_0:B.ROT_0,rot_1:B.ROT_1,rot_2:B.ROT_2,rot_3:B.ROT_3}[e]??B.UNDEFINED}static ParseHeader(t){let n=new Uint8Array(t),r=new TextDecoder().decode(n.slice(0,1024*10)),i=r.indexOf(`end_header
264
- `);if(i<0)return null;let a=/element vertex (\d+)\n/.exec(r);if(!a)return null;let o=parseInt(a[1]),s=/element chunk (\d+)\n/.exec(r),c=s?parseInt(s[1]):0,l={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0},u=function(e){return e[e.Vertex=0]=`Vertex`,e[e.Chunk=1]=`Chunk`,e}({}),d=u.Chunk,f=0,p=0,m=[],h=[];for(let t of r.slice(0,i).split(`
265
- `))if(t.startsWith(`property `)){let[,n,r]=t.split(` `),i={value:e.valueNameToEnum(r),type:e.typeNameToEnum(n),offset:d===u.Chunk?p:f};d===u.Chunk?(h.push(i),p+=l[n]??0):(m.push(i),f+=l[n]??0)}else if(t.startsWith(`element `)){let[,e]=t.split(` `);d=e===`chunk`?u.Chunk:u.Vertex}return{vertexCount:o,chunkCount:c,rowVertexLength:f,rowChunkLength:p,vertexProperties:m,chunkProperties:h,dataView:new DataView(t,i+11),buffer:new ArrayBuffer(e.ROW_OUTPUT_LENGTH*o)}}},At=e=>{let{url:t,position:n,transform:r,init:i,onDone:a,customLoaders:o}=e;return lt({url:t,position:n,transform:r,init:i,onDone:a,loaders:(0,d.useMemo)(()=>({splat:(e,t)=>{new Ct().load(e,e=>t(e))},ply:(e,t)=>{new kt().load(e,e=>t(e))}}),[]),customLoaders:o}),null},jt=new u.Raycaster,Mt=new u.Vector3,Nt=new u.Vector3,V=new u.Quaternion,Pt={X:new u.Vector3(1,0,0),Y:new u.Vector3(0,1,0),Z:new u.Vector3(0,0,1)},Ft={type:`change`},It={type:`mouseDown`,mode:null},Lt={type:`mouseUp`,mode:null},Rt={type:`objectChange`},zt=class extends u.Controls{constructor(e,t=null){super(void 0,t);let n=new on(this);this._root=n;let r=new sn;this._gizmo=r,n.add(r);let i=new cn;this._plane=i,n.add(i);let a=this;function o(e,t){let n=t;Object.defineProperty(a,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,i[e]=t,r[e]=t,a.dispatchEvent({type:e+`-changed`,value:t}),a.dispatchEvent(Ft))}}),a[e]=t,i[e]=t,r[e]=t}o(`camera`,e),o(`object`,void 0),o(`enabled`,!0),o(`axis`,null),o(`mode`,`translate`),o(`translationSnap`,null),o(`rotationSnap`,null),o(`scaleSnap`,null),o(`space`,`world`),o(`size`,1),o(`dragging`,!1),o(`showX`,!0),o(`showY`,!0),o(`showZ`,!0),o(`showXY`,!0),o(`showYZ`,!0),o(`showXZ`,!0),o(`minX`,-1/0),o(`maxX`,1/0),o(`minY`,-1/0),o(`maxY`,1/0),o(`minZ`,-1/0),o(`maxZ`,1/0);let s=new u.Vector3,c=new u.Vector3,l=new u.Quaternion,d=new u.Quaternion,f=new u.Vector3,p=new u.Quaternion,m=new u.Vector3,h=new u.Vector3,g=new u.Vector3,_=new u.Vector3;o(`worldPosition`,s),o(`worldPositionStart`,c),o(`worldQuaternion`,l),o(`worldQuaternionStart`,d),o(`cameraPosition`,f),o(`cameraQuaternion`,p),o(`pointStart`,m),o(`pointEnd`,h),o(`rotationAxis`,g),o(`rotationAngle`,0),o(`eye`,_),this._offset=new u.Vector3,this._startNorm=new u.Vector3,this._endNorm=new u.Vector3,this._cameraScale=new u.Vector3,this._parentPosition=new u.Vector3,this._parentQuaternion=new u.Quaternion,this._parentQuaternionInv=new u.Quaternion,this._parentScale=new u.Vector3,this._worldScaleStart=new u.Vector3,this._worldQuaternionInv=new u.Quaternion,this._worldScale=new u.Vector3,this._positionStart=new u.Vector3,this._quaternionStart=new u.Quaternion,this._scaleStart=new u.Vector3,this._getPointer=Bt.bind(this),this._onPointerDown=Ht.bind(this),this._onPointerHover=Vt.bind(this),this._onPointerMove=Ut.bind(this),this._onPointerUp=Wt.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointermove`,this._onPointerHover),this.domElement.addEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerHover),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=``}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&jt.setFromCamera(e,this.camera);let t=Gt(this._gizmo.picker[this.mode],jt);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&jt.setFromCamera(e,this.camera);let t=Gt(this._plane,jt,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,It.mode=this.mode,this.dispatchEvent(It)}}pointerMove(e){let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&jt.setFromCamera(e,this.camera);let a=Gt(this._plane,jt,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this._offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf(`X`)===-1&&(this._offset.x=0),t.indexOf(`Y`)===-1&&(this._offset.y=0),t.indexOf(`Z`)===-1&&(this._offset.z=0),i===`local`&&t!==`XYZ`?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(V.copy(this._quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),i===`world`&&(r.parent&&r.position.add(Mt.setFromMatrixPosition(r.parent.matrixWorld)),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(Mt.setFromMatrixPosition(r.parent.matrixWorld)))),r.position.x=Math.max(this.minX,Math.min(this.maxX,r.position.x)),r.position.y=Math.max(this.minY,Math.min(this.maxY,r.position.y)),r.position.z=Math.max(this.minZ,Math.min(this.maxZ,r.position.z));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),Nt.set(e,e,e)}else Mt.copy(this.pointStart),Nt.copy(this.pointEnd),Mt.applyQuaternion(this._worldQuaternionInv),Nt.applyQuaternion(this._worldQuaternionInv),Nt.divide(Mt),t.search(`X`)===-1&&(Nt.x=1),t.search(`Y`)===-1&&(Nt.y=1),t.search(`Z`)===-1&&(Nt.z=1);r.scale.copy(this._scaleStart).multiply(Nt),this.scaleSnap&&(t.search(`X`)!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this._offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(Mt.setFromMatrixPosition(this.camera.matrixWorld)),n=!1;t===`XYZE`?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Mt.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(Pt[t]),Mt.copy(Pt[t]),i===`local`&&Mt.applyQuaternion(this.worldQuaternion),Mt.cross(this.eye),Mt.length()===0?n=!0:this.rotationAngle=this._offset.dot(Mt.normalize())*e),(t===`E`||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(V.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(V.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Ft),this.dispatchEvent(Rt)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Lt.mode=this.mode,this.dispatchEvent(Lt)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Ft),this.dispatchEvent(Rt),this.pointStart.copy(this.pointEnd))}getRaycaster(){return jt}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,n,r){let i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(n),i.active.color.set(r),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(n),i.activeTransparent.color.set(r),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(n),i.active._color&&i.active._color.set(r),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(n),i.activeTransparent._color&&i.activeTransparent._color.set(r)}};function Bt(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{let t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function Vt(e){if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this._getPointer(e));break}}function Ht(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener(`pointermove`,this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function Ut(e){this.enabled&&this.pointerMove(this._getPointer(e))}function Wt(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.pointerUp(this._getPointer(e)))}function Gt(e,t,n){let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}var Kt=new u.Euler,H=new u.Vector3(0,1,0),qt=new u.Vector3(0,0,0),Jt=new u.Matrix4,Yt=new u.Quaternion,Xt=new u.Quaternion,Zt=new u.Vector3,Qt=new u.Matrix4,$t=new u.Vector3(1,0,0),en=new u.Vector3(0,1,0),tn=new u.Vector3(0,0,1),nn=new u.Vector3,rn=new u.Vector3,an=new u.Vector3,on=class extends u.Object3D{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){let t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}},sn=class extends u.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type=`TransformControlsGizmo`;let e=new u.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new u.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;let r=t.clone();r.opacity=.5;let i=e.clone();i.color.setHex(16711680);let a=e.clone();a.color.setHex(65280);let o=e.clone();o.color.setHex(255);let s=e.clone();s.color.setHex(16711680),s.opacity=.5;let c=e.clone();c.color.setHex(65280),c.opacity=.5;let l=e.clone();l.color.setHex(255),l.opacity=.5;let d=e.clone();d.opacity=.25;let f=e.clone();f.color.setHex(16776960),f.opacity=.25;let p=e.clone();p.color.setHex(16776960);let m=e.clone();m.color.setHex(7895160),this.materialLib={xAxis:i,yAxis:a,zAxis:o,active:p,xAxisTransparent:s,yAxisTransparent:c,zAxisTransparent:l,activeTransparent:f};let h=new u.CylinderGeometry(0,.04,.1,12);h.translate(0,.05,0);let g=new u.BoxGeometry(.08,.08,.08);g.translate(0,.04,0);let _=new u.BufferGeometry;_.setAttribute(`position`,new u.Float32BufferAttribute([0,0,0,1,0,0],3));let v=new u.CylinderGeometry(.0075,.0075,.5,3);v.translate(0,.25,0);function y(e,t){let n=new u.TorusGeometry(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}function b(){let e=new u.BufferGeometry;return e.setAttribute(`position`,new u.Float32BufferAttribute([0,0,0,1,1,1],3)),e}let x={X:[[new u.Mesh(h,i),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(h,i),[-.5,0,0],[0,0,Math.PI/2]],[new u.Mesh(v,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new u.Mesh(h,a),[0,.5,0]],[new u.Mesh(h,a),[0,-.5,0],[Math.PI,0,0]],[new u.Mesh(v,a)]],Z:[[new u.Mesh(h,o),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(h,o),[0,0,-.5],[-Math.PI/2,0,0]],[new u.Mesh(v,o),null,[Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.1,0),d),[0,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]]},S={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.2,0),n)]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},C={START:[[new u.Mesh(new u.OctahedronGeometry(.01,2),r),null,null,null,`helper`]],END:[[new u.Mesh(new u.OctahedronGeometry(.01,2),r),null,null,null,`helper`]],DELTA:[[new u.Line(b(),r),null,null,null,`helper`]],X:[[new u.Line(_,r),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new u.Line(_,r),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new u.Line(_,r),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ee={XYZE:[[new u.Mesh(y(.5,1),m),null,[0,Math.PI/2,0]]],X:[[new u.Mesh(y(.5,.5),i)]],Y:[[new u.Mesh(y(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new u.Mesh(y(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new u.Mesh(y(.75,1),f),null,[0,Math.PI/2,0]]]},w={AXIS:[[new u.Line(_,r),[-1e3,0,0],null,[1e6,1,1],`helper`]]},T={XYZE:[[new u.Mesh(new u.SphereGeometry(.25,10,8),n)]],X:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new u.Mesh(new u.TorusGeometry(.75,.1,2,24),n)]]},te={X:[[new u.Mesh(g,i),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(v,i),[0,0,0],[0,0,-Math.PI/2]],[new u.Mesh(g,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(g,a),[0,.5,0]],[new u.Mesh(v,a)],[new u.Mesh(g,a),[0,-.5,0],[0,0,Math.PI]]],Z:[[new u.Mesh(g,o),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(v,o),[0,0,0],[Math.PI/2,0,0]],[new u.Mesh(g,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.1,.1,.1),d)]]},E={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.2),n),[0,0,0]]]},D={X:[[new u.Line(_,r),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new u.Line(_,r),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new u.Line(_,r),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]};function O(e){let t=new u.Object3D;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=O(x)),this.add(this.gizmo.rotate=O(ee)),this.add(this.gizmo.scale=O(te)),this.add(this.picker.translate=O(S)),this.add(this.picker.rotate=O(T)),this.add(this.picker.scale=O(E)),this.add(this.helper.translate=O(C)),this.add(this.helper.rotate=O(w)),this.add(this.helper.scale=O(D)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){let t=(this.mode===`scale`?`local`:this.space)===`local`?this.worldQuaternion:Xt;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r=n[e];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let i;if(i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),r.tag===`helper`){r.visible=!1,r.name===`AXIS`?(r.visible=!!this.axis,this.axis===`X`&&(V.setFromEuler(Kt.set(0,0,0)),r.quaternion.copy(t).multiply(V),Math.abs(H.copy($t).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Y`&&(V.setFromEuler(Kt.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(V),Math.abs(H.copy(en).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(V.setFromEuler(Kt.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(V),Math.abs(H.copy(tn).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(V.setFromEuler(Kt.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Jt.lookAt(qt,H,en)),r.quaternion.multiply(V),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),Mt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Mt.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Mt),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(H.copy($t).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(H.copy(en).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(H.copy(tn).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(H.copy(tn).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(H.copy($t).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(H.copy(en).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else this.mode===`rotate`&&(Yt.copy(t),H.copy(this.eye).applyQuaternion(V.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(Jt.lookAt(this.eye,qt,en)),r.name===`X`&&(V.setFromAxisAngle($t,Math.atan2(-H.y,H.z)),V.multiplyQuaternions(Yt,V),r.quaternion.copy(V)),r.name===`Y`&&(V.setFromAxisAngle(en,Math.atan2(H.x,H.z)),V.multiplyQuaternions(Yt,V),r.quaternion.copy(V)),r.name===`Z`&&(V.setFromAxisAngle(tn,Math.atan2(H.y,H.x)),V.multiplyQuaternions(Yt,V),r.quaternion.copy(V)));r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.visible=r.visible&&(r.name.indexOf(`XY`)===-1||this.showXY),r.visible=r.visible&&(r.name.indexOf(`YZ`)===-1||this.showYZ),r.visible=r.visible&&(r.name.indexOf(`XZ`)===-1||this.showXZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e}))&&(r.material.color.copy(this.materialLib.active.color),r.material.opacity=1)}super.updateMatrixWorld(e)}},cn=class extends u.Mesh{constructor(){super(new u.PlaneGeometry(1e5,1e5,2,2),new u.MeshBasicMaterial({visible:!1,wireframe:!0,side:u.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type=`TransformControlsPlane`}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(t=`local`),nn.copy($t).applyQuaternion(t===`local`?this.worldQuaternion:Xt),rn.copy(en).applyQuaternion(t===`local`?this.worldQuaternion:Xt),an.copy(tn).applyQuaternion(t===`local`?this.worldQuaternion:Xt),H.copy(rn),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:H.copy(this.eye).cross(nn),Zt.copy(nn).cross(H);break;case`Y`:H.copy(this.eye).cross(rn),Zt.copy(rn).cross(H);break;case`Z`:H.copy(this.eye).cross(an),Zt.copy(an).cross(H);break;case`XY`:Zt.copy(an);break;case`YZ`:Zt.copy(nn);break;case`XZ`:H.copy(an),Zt.copy(rn);break;case`XYZ`:case`E`:Zt.set(0,0,0);break}break;default:Zt.set(0,0,0)}Zt.length()===0?this.quaternion.copy(this.cameraQuaternion):(Qt.lookAt(Mt.set(0,0,0),Zt,H),this.quaternion.setFromRotationMatrix(Qt)),super.updateMatrixWorld(e)}},ln=e=>{let{target:t,mode:n,enabled:r,space:i,size:a,onObjectChange:o}=e,{scene:s,camera:c,renderer:l,map:u,sceneRoot:f}=O(),p=(0,d.useRef)(null);return(0,d.useEffect)(()=>{if(!s||!c||!l||!u||!f)return;let e=l.getRenderer().domElement,t=new zt(c,e);p.current=t,t.setMode(n||`translate`),t.setSpace(i||`world`),a&&t.setSize(a),f.add(t._root);let r=e=>{e.value?(u.dragPan.disable(),u.scrollZoom.disable()):(u.dragPan.enable(),u.scrollZoom.enable())};return t.addEventListener(`dragging-changed`,r),o&&t.addEventListener(`objectChange`,()=>{t.object&&o(t.object)}),()=>{t.removeEventListener(`dragging-changed`,r),t.detach(),f.remove(t._root),t.dispose(),p.current=null}},[s,c,l,u,f]),(0,d.useEffect)(()=>{p.current&&(t?p.current.attach(t):p.current.detach())},[t]),(0,d.useEffect)(()=>{p.current&&(p.current.mode=n||`translate`)},[n]),(0,d.useEffect)(()=>{p.current&&(p.current.enabled=r!==!1)},[r]),(0,d.useEffect)(()=>{p.current&&p.current.setSpace(i||`world`)},[i]),(0,d.useEffect)(()=>{!p.current||!a||p.current.setSize(a)},[a]),null},un=o((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),dn=o((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)}function x(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case l:case u:case i:case o:case a:case f:return p;default:var g=p&&p.$$typeof;switch(g){case c:case d:case h:case m:case s:return g;default:return t}}case r:return t}}}var S=l,C=u,ee=c,w=s,T=n,te=d,E=i,D=h,O=m,ne=r,k=o,A=a,j=f,M=!1;function re(e){return M||(M=!0,console.warn(`The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.`)),N(e)||x(e)===l}function N(e){return x(e)===u}function P(e){return x(e)===c}function ie(e){return x(e)===s}function F(e){return typeof e==`object`&&!!e&&e.$$typeof===n}function ae(e){return x(e)===d}function oe(e){return x(e)===i}function I(e){return x(e)===h}function L(e){return x(e)===m}function se(e){return x(e)===r}function ce(e){return x(e)===o}function R(e){return x(e)===a}function le(e){return x(e)===f}e.AsyncMode=S,e.ConcurrentMode=C,e.ContextConsumer=ee,e.ContextProvider=w,e.Element=T,e.ForwardRef=te,e.Fragment=E,e.Lazy=D,e.Memo=O,e.Portal=ne,e.Profiler=k,e.StrictMode=A,e.Suspense=j,e.isAsyncMode=re,e.isConcurrentMode=N,e.isContextConsumer=P,e.isContextProvider=ie,e.isElement=F,e.isForwardRef=ae,e.isFragment=oe,e.isLazy=I,e.isMemo=L,e.isPortal=se,e.isProfiler=ce,e.isStrictMode=R,e.isSuspense=le,e.isValidElementType=b,e.typeOf=x})()})),fn=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=un():t.exports=dn()})),pn=o(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),mn=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),hn=o(((e,t)=>{t.exports=Function.call.bind(Object.prototype.hasOwnProperty)})),gn=o(((e,t)=>{var n=function(){};if(process.env.NODE_ENV!==`production`){var r=mn(),i={},a=hn();n=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}}}function o(e,t,o,s,c){if(process.env.NODE_ENV!==`production`){for(var l in e)if(a(e,l)){var u;try{if(typeof e[l]!=`function`){var d=Error((s||`React class`)+`: `+o+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name=`Invariant Violation`,d}u=e[l](t,l,s,o,null,r)}catch(e){u=e}if(u&&!(u instanceof Error)&&n((s||`React class`)+`: type specification of `+o+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+`. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).`),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var f=c?c():``;n(`Failed `+o+` type: `+u.message+(f??``))}}}}o.resetWarningCache=function(){process.env.NODE_ENV!==`production`&&(i={})},t.exports=o})),_n=o(((e,t)=>{var n=fn(),r=pn(),i=mn(),a=hn(),o=gn(),s=function(){};process.env.NODE_ENV!==`production`&&(s=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}});function c(){return null}t.exports=function(e,t){var l=typeof Symbol==`function`&&Symbol.iterator,u=`@@iterator`;function d(e){var t=e&&(l&&e[l]||e[u]);if(typeof t==`function`)return t}var f=`<<anonymous>>`,p={array:_(`array`),bigint:_(`bigint`),bool:_(`boolean`),func:_(`function`),number:_(`number`),object:_(`object`),string:_(`string`),symbol:_(`symbol`),any:v(),arrayOf:y,element:b(),elementType:x(),instanceOf:S,node:T(),objectOf:ee,oneOf:C,oneOfType:w,shape:E,exact:D};function m(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function h(e,t){this.message=e,this.data=t&&typeof t==`object`?t:{},this.stack=``}h.prototype=Error.prototype;function g(e){if(process.env.NODE_ENV!==`production`)var n={},r=0;function a(a,o,c,l,u,d,p){if(l||=f,d||=c,p!==i){if(t){var m=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name=`Invariant Violation`,m}else if(process.env.NODE_ENV!==`production`&&typeof console<`u`){var g=l+`:`+c;!n[g]&&r<3&&(s("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[g]=!0,r++)}}return o[c]==null?a?o[c]===null?new h(`The `+u+" `"+d+"` is marked as required "+("in `"+l+"`, but its value is `null`.")):new h(`The `+u+" `"+d+"` is marked as required in "+("`"+l+"`, but its value is `undefined`.")):null:e(o,c,l,u,d)}var o=a.bind(null,!1);return o.isRequired=a.bind(null,!0),o}function _(e){function t(t,n,r,i,a,o){var s=t[n];if(k(s)!==e){var c=A(s);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."),{expectedType:e})}return null}return g(t)}function v(){return g(c)}function y(e){function t(t,n,r,a,o){if(typeof e!=`function`)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var c=k(s);return new h(`Invalid `+a+" `"+o+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<s.length;l++){var u=e(s,l,r,a,o+`[`+l+`]`,i);if(u instanceof Error)return u}return null}return g(t)}function b(){function t(t,n,r,i,a){var o=t[n];if(!e(o)){var s=k(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return g(t)}function x(){function e(e,t,r,i,a){var o=e[t];if(!n.isValidElementType(o)){var s=k(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement type."))}return null}return g(e)}function S(e){function t(t,n,r,i,a){if(!(t[n]instanceof e)){var o=e.name||f,s=M(t[n]);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+o+"`."))}return null}return g(t)}function C(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&(arguments.length>1?s(`Invalid arguments supplied to oneOf, expected an array, got `+arguments.length+` arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).`):s(`Invalid argument supplied to oneOf, expected an array.`)),c;function t(t,n,r,i,a){for(var o=t[n],s=0;s<e.length;s++)if(m(o,e[s]))return null;var c=JSON.stringify(e,function(e,t){return A(t)===`symbol`?String(t):t});return new h(`Invalid `+i+" `"+a+"` of value `"+String(o)+"` "+("supplied to `"+r+"`, expected one of "+c+`.`))}return g(t)}function ee(e){function t(t,n,r,o,s){if(typeof e!=`function`)return new h("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],l=k(c);if(l!==`object`)return new h(`Invalid `+o+" `"+s+"` of type "+("`"+l+"` supplied to `"+r+"`, expected an object."));for(var u in c)if(a(c,u)){var d=e(c,u,r,o,s+`.`+u,i);if(d instanceof Error)return d}return null}return g(t)}function w(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&s(`Invalid argument supplied to oneOfType, expected an instance of array.`),c;for(var t=0;t<e.length;t++){var n=e[t];if(typeof n!=`function`)return s(`Invalid argument supplied to oneOfType. Expected an array of check functions, but received `+j(n)+` at index `+t+`.`),c}function r(t,n,r,o,s){for(var c=[],l=0;l<e.length;l++){var u=e[l],d=u(t,n,r,o,s,i);if(d==null)return null;d.data&&a(d.data,`expectedType`)&&c.push(d.data.expectedType)}var f=c.length>0?`, expected one of type [`+c.join(`, `)+`]`:``;return new h(`Invalid `+o+" `"+s+"` supplied to "+("`"+r+"`"+f+`.`))}return g(r)}function T(){function e(e,t,n,r,i){return O(e[t])?null:new h(`Invalid `+r+" `"+i+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return g(e)}function te(e,t,n,r,i){return new h((e||`React class`)+`: `+t+" type `"+n+`.`+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function E(e){function t(t,n,r,a,o){var s=t[n],c=k(s);if(c!==`object`)return new h(`Invalid `+a+" `"+o+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var l in e){var u=e[l];if(typeof u!=`function`)return te(r,a,o,l,A(u));var d=u(s,l,r,a,o+`.`+l,i);if(d)return d}return null}return g(t)}function D(e){function t(t,n,o,s,c){var l=t[n],u=k(l);if(u!==`object`)return new h(`Invalid `+s+" `"+c+"` of type `"+u+"` "+("supplied to `"+o+"`, expected `object`."));for(var d in r({},t[n],e)){var f=e[d];if(a(e,d)&&typeof f!=`function`)return te(o,s,c,d,A(f));if(!f)return new h(`Invalid `+s+" `"+c+"` key `"+d+"` supplied to `"+o+`\`.
263
+ `,_t=e=>u.DataUtils.toHalfFloat(e),vt=class{static build(e=1){let t=new u.BufferGeometry;t.setIndex([0,1,2]);let n=new u.BufferAttribute(new Float32Array([-3,-2,0,3,-2,0,0,4,0]),3);t.setAttribute(`position`,n);let r=new u.InstancedBufferGeometry;r.setIndex(t.getIndex()),r.setAttribute(`position`,t.getAttribute(`position`));let i=new u.InstancedBufferAttribute(new Float32Array(e),1,!1);return i.setUsage(u.DynamicDrawUsage),r.setAttribute(`splatIndex`,i),r.instanceCount=0,r}},yt=class e{static BATCH_SIZE=327680;static workCount=0;vertexCount=0;positions=null;hasInit=!1;splatIndex=null;depthValues=null;tempDepths=null;tempIndices=null;abortController=null;onmessage=null;terminate(){this.abortController?.abort(),this.abortController=null,this.vertexCount=0,this.positions=null,this.splatIndex=null,this.onmessage=null}initSortData(){if(this.hasInit||this.vertexCount<0)return;let e=this.vertexCount;this.depthValues=new Int32Array(e),this.splatIndex=new Uint32Array(e),this.tempDepths=new Int32Array(e),this.tempIndices=new Uint32Array(e),this.hasInit=!0}*sortData(t,n){this.hasInit||this.initSortData();let{positions:r,vertexCount:i,depthValues:a,splatIndex:o,tempDepths:s,tempIndices:c}=this;if(!r||!a||!o||!s||!c)return;let l=-1/0,u=1/0;for(let e=0;e<i;e++){o[e]=e;let n=t[2]*r[4*e]+t[6]*r[4*e+1]+t[10]*r[4*e+2],i=Math.floor(n*4096);a[e]=i,l=Math.max(l,i),u=Math.min(u,i)}n&&(e.workCount+=i,e.workCount>e.BATCH_SIZE&&(e.workCount=0,yield));let d=-u;for(let e=0;e<i;e++)a[e]+=d;let f=new Uint32Array(256);for(let t=0;t<32;t+=8){f.fill(0);for(let e=0;e<i;e++)f[a[e]>>t&255]++;let r=0;for(let e=0;e<f.length;e++){let t=f[e];f[e]=r,r+=t}for(let e=0;e<i;e++){let n=a[e]>>t&255,r=f[n]++;s[r]=a[e],c[r]=o[e]}a.set(s),o.set(c),n&&(e.workCount+=i,e.workCount>e.BATCH_SIZE&&(e.workCount=0,yield))}}init(e,t){this.positions=e,this.vertexCount=t,this.initSortData()}async sortDataAsync(e){this.abortController?.abort(),this.abortController=new AbortController;let t=this.abortController.signal;try{await mt(this.sortData(e,!0),dt(),t),this.onmessage&&this.splatIndex&&this.onmessage(this.splatIndex)}catch(e){e instanceof Error&&e.name!==`AbortError`&&console.error(`Splat sort error:`,e)}finally{this.abortController=null}}},bt=class{static build(e=0){return new u.ShaderMaterial({uniforms:{invViewport:{value:new u.Vector2},dataTextureSize:{value:new u.Vector2},focal:{value:new u.Vector2},covariancesATexture:{value:null},covariancesBTexture:{value:null},centersTexture:{value:null},colorsTexture:{value:null},shTexture0:{value:null},shTexture1:{value:null},shTexture2:{value:null}},defines:{SH_DEGREE:e},vertexShader:ht,fragmentShader:gt,transparent:!0,alphaTest:1,blending:u.NormalBlending,depthTest:!0,depthWrite:!0,side:u.DoubleSide})}static updateUniforms(e,t,n){let r=n.material;if(!r?.uniforms)return;let{uniforms:i}=r,a=e.getSize(new u.Vector2);if(i.invViewport.value.set(1/a.x,1/a.y),t){let e=t._cleanProjectionMatrix,n=e?.elements??e??t.projectionMatrix.elements;i.focal.value.set(n[0]*.5*a.x,n[5]*.5*a.y)}if(n.covariancesATexture){let{width:e,height:t}=n.covariancesATexture.image;i.dataTextureSize.value.set(e,t),i.covariancesATexture.value=n.covariancesATexture,i.covariancesBTexture.value=n.covariancesBTexture,i.centersTexture.value=n.centersTexture,i.colorsTexture.value=n.colorsTexture,n.shTextures?.forEach((e,t)=>{i[`shTexture${t}`].value=e})}r.uniformsNeedUpdate=!0}},xt=class e extends u.Mesh{static ROW_OUTPUT_LENGTH=32;static SPLAT_BATCH_SIZE=327680;vertexCount=0;worker=null;frameIdLastUpdate=-1;frameIdThisUpdate=0;cameraMatrix=null;internalModelViewMatrix=null;canPostToWorker=!1;covariancesATextureInternal=null;covariancesBTextureInternal=null;centersTextureInternal=null;colorsTextureInternal=null;splatPositions=null;splatPositions2=null;splatIndex=null;shTexturesInternal=null;splatsDataInternal=null;keepInRam=!1;oldDirection=new u.Vector3;useRGBACovariants=!0;tmpCovariances=[0,0,0,0,0,0];sortIsDirty=!1;lastSortTime=0;sortThrottleMs=200;shDegreeValue=0;tempQuaternion=new u.Quaternion;tempPosition=new u.Vector3;tempScale=new u.Vector3;tempColor=new Uint8Array(4);tempMatrix=new u.Matrix4;isGaussianSplattingMesh=!0;readyToDisplay=!1;type=`GaussianSplattingMesh`;get shDegree(){return this.shDegreeValue}get splatsData(){return this.splatsDataInternal}get covariancesATexture(){return this.covariancesATextureInternal}get covariancesBTexture(){return this.covariancesBTextureInternal}get centersTexture(){return this.centersTextureInternal}get colorsTexture(){return this.colorsTextureInternal}get shTextures(){return this.shTexturesInternal}constructor(){super(),this.geometry=vt.build(),this.material=bt.build(),this.setEnabled(!1)}setEnabled(e){this.visible=e}postToWorker(e=!1){let t=this.frameIdThisUpdate;if((e||t!==this.frameIdLastUpdate)&&this.worker&&this.cameraMatrix&&this.canPostToWorker){this.internalModelViewMatrix=new u.Matrix4().multiplyMatrices(this.cameraMatrix,this.matrixWorld);let n=this.cameraMatrix.clone().invert(),r=new u.Matrix4().multiplyMatrices(n,this.matrixWorld),i=new u.Vector3(0,0,1).transformDirection(r),a=i.dot(this.oldDirection);if(e||Math.abs(a-1)>=.01)return this.oldDirection.copy(i),this.frameIdLastUpdate=t,this.canPostToWorker=!1,this.worker.sortDataAsync(this.internalModelViewMatrix.elements)}}onBeforeRender(e,t,n,r,i,a){this.frameIdThisUpdate=e.info.render.frame;let o=performance.now();o-this.lastSortTime>this.sortThrottleMs&&(this.lastSortTime=o,this.sortDataAsync(n).catch(e=>{e.name!==`AbortError`&&console.warn(`Splat sorting error:`,e)})),bt.updateUniforms(e,n,this),super.onBeforeRender(e,t,n,r,i,a)}loadDataAsync(e){return this.updateDataAsync(e)}dispose(){this.covariancesATextureInternal?.dispose(),this.covariancesBTextureInternal?.dispose(),this.centersTextureInternal?.dispose(),this.colorsTextureInternal?.dispose(),this.shTexturesInternal?.forEach(e=>e.dispose()),this.covariancesATextureInternal=null,this.covariancesBTextureInternal=null,this.centersTextureInternal=null,this.colorsTextureInternal=null,this.shTexturesInternal=null,this.worker?.terminate(),this.worker=null}copyTextures(e){this.covariancesATextureInternal=e.covariancesATexture?.clone()??null,this.covariancesBTextureInternal=e.covariancesBTexture?.clone()??null,this.centersTextureInternal=e.centersTexture?.clone()??null,this.colorsTextureInternal=e.colorsTexture?.clone()??null,e.shTexturesInternal&&(this.shTexturesInternal=e.shTexturesInternal.map(e=>e.clone()))}clone(){let t=new e;return t.geometry=this.geometry.clone(),t.material=this.material.clone(),t.vertexCount=this.vertexCount,t.copyTextures(this),t.splatPositions=this.splatPositions,t.readyToDisplay=!1,t.instantiateWorker(),t}makeSplatFromComponents(e,t,n,r,i,a,o,s,c,l,u){i.w=-i.w,r=r.multiplyScalar(2);let d=this.tempMatrix.elements,f=this.useRGBACovariants?4:2;this.splatPositions[4*e+0]=n.x,this.splatPositions[4*e+1]=n.y,this.splatPositions[4*e+2]=n.z,this.splatPositions2[4*e+0]=n.x,this.splatPositions2[4*e+1]=n.y,this.splatPositions2[4*e+2]=n.z,l.min(n),u.max(n);let{x:p,y:m,z:h,w:g}=i,_=p+p,v=m+m,y=h+h,b=p*_,x=p*v,S=p*y,C=m*v,ee=m*y,w=h*y,T=g*_,te=g*v,E=g*y,{x:D,y:O,z:ne}=r;d[0]=(1-(C+w))*D,d[1]=(x+E)*O,d[2]=(S-te)*ne,d[4]=(x-E)*D,d[5]=(1-(b+w))*O,d[6]=(ee+T)*ne,d[8]=(S+te)*D,d[9]=(ee-T)*O,d[10]=(1-(b+C))*ne;let k=this.tmpCovariances;k[0]=d[0]*d[0]+d[1]*d[1]+d[2]*d[2],k[1]=d[0]*d[4]+d[1]*d[5]+d[2]*d[6],k[2]=d[0]*d[8]+d[1]*d[9]+d[2]*d[10],k[3]=d[4]*d[4]+d[5]*d[5]+d[6]*d[6],k[4]=d[4]*d[8]+d[5]*d[9]+d[6]*d[10],k[5]=d[8]*d[8]+d[9]*d[9]+d[10]*d[10];let A=-1e4;for(let e=0;e<6;e++)A=Math.max(A,Math.abs(k[e]));this.splatPositions[4*e+3]=A,this.splatPositions2[4*e+3]=A,o[t*4+0]=_t(k[0]/A),o[t*4+1]=_t(k[1]/A),o[t*4+2]=_t(k[2]/A),o[t*4+3]=_t(k[3]/A),s[t*f+0]=_t(k[4]/A),s[t*f+1]=_t(k[5]/A),c[t*4+0]=a[0],c[t*4+1]=a[1],c[t*4+2]=a[2],c[t*4+3]=a[3]}makeSplatFromBuffer(e,t,n,r,i,a,o,s,c){let l=8*e,u=32*e;this.tempPosition.set(n[l],n[l+1],n[l+2]),this.tempScale.set(n[l+3],n[l+4],n[l+5]),this.tempQuaternion.set((r[u+29]-127.5)/127.5,(r[u+30]-127.5)/127.5,(r[u+31]-127.5)/127.5,(r[u+28]-127.5)/127.5).normalize(),this.tempColor[0]=r[u+24],this.tempColor[1]=r[u+25],this.tempColor[2]=r[u+26],this.tempColor[3]=r[u+27],this.makeSplatFromComponents(e,t,this.tempPosition,this.tempScale,this.tempQuaternion,this.tempColor,i,a,o,s,c)}updateTextures(e,t,n,r){let i=this.getTextureSize(this.vertexCount),a=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.FloatType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i},o=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.UnsignedByteType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i},s=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.UnsignedIntType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i},c=(e,t,n,r)=>{let i=new u.DataTexture(e,t,n,r,u.HalfFloatType,u.UVMapping,u.ClampToEdgeWrapping,u.ClampToEdgeWrapping,u.NearestFilter,u.NearestFilter);return i.generateMipmaps=!1,i.needsUpdate=!0,i};this.covariancesATextureInternal=c(e,i.x,i.y,u.RGBAFormat),this.covariancesBTextureInternal=c(t,i.x,i.y,this.useRGBACovariants?u.RGBAFormat:u.RGFormat),this.centersTextureInternal=a(this.splatPositions,i.x,i.y,u.RGBAFormat),this.colorsTextureInternal=o(n,i.x,i.y,u.RGBAFormat),r&&(this.shTexturesInternal=r.map(e=>{let t=s(new Uint32Array(e.buffer),i.x,i.y,u.RGBAIntegerFormat);return t.wrapS=u.ClampToEdgeWrapping,t.wrapT=u.ClampToEdgeWrapping,t})),this.instantiateWorker()}updateBoundingInfo(e,t){this.boundingBox=new u.Box3(e,t),this.boundingSphere=this.boundingBox.getBoundingSphere(new u.Sphere)}*updateDataCoroutine(t,n,r){this.covariancesATextureInternal||(this.readyToDisplay=!1);let i=new Uint8Array(t),a=new Float32Array(i.buffer);this.keepInRam&&(this.splatsDataInternal=t),this.shDegreeValue=r?r.length:0;let o=i.length/e.ROW_OUTPUT_LENGTH;o!==this.vertexCount&&(this.vertexCount=o,this.geometry=vt.build(this.vertexCount),this.material=bt.build(this.shDegreeValue),this.updateSplatIndexBuffer(this.vertexCount));let s=this.getTextureSize(o),c=s.x*s.y;this.splatPositions=new Float32Array(4*c),this.splatPositions2=new Float32Array(4*o);let l=new Uint16Array(c*4),d=new Uint16Array((this.useRGBACovariants?4:2)*c),f=new Uint8Array(c*4),p=new u.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),m=new u.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let t=0;t<o;t++)this.makeSplatFromBuffer(t,t,a,i,l,d,f,p,m),n&&t%e.SPLAT_BATCH_SIZE===0&&(yield);this.updateTextures(l,d,f,r),this.updateBoundingInfo(p,m),this.setEnabled(!0),this.postToWorker(!0)}async updateDataAsync(e,t){return mt(this.updateDataCoroutine(e,!0,t),dt())}updateData(e,t){pt(this.updateDataCoroutine(e,!1,t))}sortDataAsync(e,t=!1){return!this.worker||!e?Promise.resolve():(this.cameraMatrix=e.matrixWorldInverse,this.postToWorker(t)??Promise.resolve())}updateSplatIndexBuffer(e){if(!this.splatIndex||e>this.splatIndex.length){this.splatIndex=new Float32Array(e);for(let t=0;t<e;t++)this.splatIndex[t]=t;this.geometry.attributes.splatIndex.set(this.splatIndex),this.geometry.attributes.splatIndex.needsUpdate=!0}this.geometry.instanceCount=e}instantiateWorker(){this.vertexCount&&(this.updateSplatIndexBuffer(this.vertexCount),this.worker?.terminate(),this.worker=new yt,this.worker.init(this.splatPositions2,this.vertexCount),this.canPostToWorker=!0,this.worker.onmessage=e=>{if(this.splatIndex&&e){for(let t=0;t<this.vertexCount;t++)this.splatIndex[t]=e[t];this.geometry.attributes.splatIndex.set(this.splatIndex)}this.geometry.attributes.splatIndex.needsUpdate=!0,this.canPostToWorker=!0,this.readyToDisplay=!0,this.sortIsDirty&&=(this.postToWorker(!0),!1)})}getTextureSize(e){let t=4096,n=1;for(;t*n<e;)n*=2;return n>t&&(console.error(`GaussianSplatting texture size: (${t}, ${n}), maxTextureSize: ${t}`),n=t),new u.Vector2(t,n)}},St=class extends u.Loader{load(e,t,n,r){let i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>this.parse(e,t,r),n,r)}parse(e,t,n){let r=new xt;r.loadDataAsync(e).then(()=>t(r)).catch(e=>{n?n(e):console.error(e)})}},Ct=(e,t)=>{let n=(1<<t)-1;return(e&n)/n},wt=(e,t)=>{t.x=Ct(e>>>21,11),t.y=Ct(e>>>11,10),t.z=Ct(e,11)},Tt=(e,t)=>{t[0]=Ct(e>>>24,8)*255,t[1]=Ct(e>>>16,8)*255,t[2]=Ct(e>>>8,8)*255,t[3]=Ct(e,8)*255},Et=(e,t)=>{let n=1/(Math.sqrt(2)*.5),r=(Ct(e>>>20,10)-.5)*n,i=(Ct(e>>>10,10)-.5)*n,a=(Ct(e,10)-.5)*n,o=Math.sqrt(1-(r*r+i*i+a*a));switch(e>>>30){case 0:t.set(o,r,i,a);break;case 1:t.set(r,o,i,a);break;case 2:t.set(r,i,o,a);break;case 3:t.set(r,i,a,o);break}},Dt=class e extends u.Loader{static ROW_OUTPUT_LENGTH=32;static SH_C0=.28209479177387814;static PLY_CONVERSION_BATCH_SIZE=32768;load(e,t,n,r){let i=new u.FileLoader(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>this.parse(e,t,r),n,r)}parse(t,n,r){e.ConvertPLYToSplatAsync(t).then(e=>{let t=new xt;return t.loadDataAsync(e).then(()=>n(t))}).catch(e=>{r?r(e):console.error(e)})}static async ConvertPLYToSplatAsync(t){return mt(e.ConvertPLYToSplat(t,!0),dt())}static*ConvertPLYToSplat(t,n=!1){let r=e.ParseHeader(t);if(!r)return t;let i={value:0},a=e.getCompressedChunks(r,i);for(let t=0;t<r.vertexCount;t++)e.getSplat(r,t,a,i),n&&t%e.PLY_CONVERSION_BATCH_SIZE===0&&(yield);return r.buffer}static getCompressedChunks(e,t){if(!e.chunkCount)return null;let{dataView:n,chunkProperties:r,rowChunkLength:i,chunkCount:a}=e,o=[];for(let e=0;e<a;e++){let e={min:new u.Vector3,max:new u.Vector3,minScale:new u.Vector3,maxScale:new u.Vector3};for(let i of r){if(i.type!==0)continue;let r=n.getFloat32(i.offset+t.value,!0);switch(i.value){case 0:e.min.x=r;break;case 1:e.min.y=r;break;case 2:e.min.z=r;break;case 3:e.max.x=r;break;case 4:e.max.y=r;break;case 5:e.max.z=r;break;case 6:e.minScale.x=r;break;case 7:e.minScale.y=r;break;case 8:e.minScale.z=r;break;case 9:e.maxScale.x=r;break;case 10:e.maxScale.y=r;break;case 11:e.maxScale.z=r;break}}o.push(e),t.value+=i}return o}static getSplat(t,n,r,i){let a=new u.Quaternion,o=new u.Vector3,{buffer:s,dataView:c,vertexProperties:l,rowVertexLength:d}=t,f=e.ROW_OUTPUT_LENGTH,p=new Float32Array(s,n*f,3),m=new Float32Array(s,n*f+12,3),h=new Uint8ClampedArray(s,n*f+24,4),g=new Uint8ClampedArray(s,n*f+28,4),_=n>>8,v=255,y=0,b=0,x=0;for(let t of l){let n;switch(t.type){case 0:n=c.getFloat32(i.value+t.offset,!0);break;case 1:n=c.getInt32(i.value+t.offset,!0);break;case 2:n=c.getUint32(i.value+t.offset,!0);break;case 3:n=c.getFloat64(i.value+t.offset,!0);break;case 4:n=c.getUint8(i.value+t.offset);break;default:continue}let s=r?.[_];switch(t.value){case 12:wt(n,o),p[0]=u.MathUtils.lerp(s.min.x,s.max.x,o.x),p[1]=-u.MathUtils.lerp(s.min.y,s.max.y,o.y),p[2]=u.MathUtils.lerp(s.min.z,s.max.z,o.z);break;case 13:Et(n,a),v=a.w,y=a.z,b=a.y,x=a.x;break;case 14:wt(n,o),m[0]=Math.exp(u.MathUtils.lerp(s.minScale.x,s.maxScale.x,o.x)),m[1]=Math.exp(u.MathUtils.lerp(s.minScale.y,s.maxScale.y,o.y)),m[2]=Math.exp(u.MathUtils.lerp(s.minScale.z,s.maxScale.z,o.z));break;case 15:Tt(n,h);break;case 16:p[0]=n;break;case 17:p[1]=n;break;case 18:p[2]=n;break;case 19:m[0]=Math.exp(n);break;case 20:m[1]=Math.exp(n);break;case 21:m[2]=Math.exp(n);break;case 22:h[0]=n;break;case 23:h[1]=n;break;case 24:h[2]=n;break;case 26:h[0]=(.5+e.SH_C0*n)*255;break;case 27:h[1]=(.5+e.SH_C0*n)*255;break;case 28:h[2]=(.5+e.SH_C0*n)*255;break;case 29:h[3]=(.5+e.SH_C0*n)*255;break;case 25:h[3]=1/(1+Math.exp(-n))*255;break;case 30:v=n;break;case 31:y=n;break;case 32:b=n;break;case 33:x=n;break}}a.set(y,b,x,v).normalize(),g[0]=a.w*128+128,g[1]=a.x*128+128,g[2]=a.y*128+128,g[3]=a.z*128+128,i.value+=d}static typeNameToEnum(e){switch(e){case`float`:return 0;case`int`:return 1;case`uint`:return 2;case`double`:return 3;case`uchar`:return 4;default:return 5}}static valueNameToEnum(e){return{min_x:0,min_y:1,min_z:2,max_x:3,max_y:4,max_z:5,min_scale_x:6,min_scale_y:7,min_scale_z:8,max_scale_x:9,max_scale_y:10,max_scale_z:11,packed_position:12,packed_rotation:13,packed_scale:14,packed_color:15,x:16,y:17,z:18,scale_0:19,scale_1:20,scale_2:21,diffuse_red:22,red:22,diffuse_green:23,green:23,diffuse_blue:24,blue:24,f_dc_0:26,f_dc_1:27,f_dc_2:28,f_dc_3:29,opacity:25,rot_0:30,rot_1:31,rot_2:32,rot_3:33}[e]??34}static ParseHeader(t){let n=new Uint8Array(t),r=new TextDecoder().decode(n.slice(0,1024*10)),i=r.indexOf(`end_header
264
+ `);if(i<0)return null;let a=/element vertex (\d+)\n/.exec(r);if(!a)return null;let o=parseInt(a[1]),s=/element chunk (\d+)\n/.exec(r),c=s?parseInt(s[1]):0,l={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0},u=1,d=0,f=0,p=[],m=[];for(let t of r.slice(0,i).split(`
265
+ `))if(t.startsWith(`property `)){let[,n,r]=t.split(` `),i={value:e.valueNameToEnum(r),type:e.typeNameToEnum(n),offset:u===1?f:d};u===1?(m.push(i),f+=l[n]??0):(p.push(i),d+=l[n]??0)}else if(t.startsWith(`element `)){let[,e]=t.split(` `);u=+(e===`chunk`)}return{vertexCount:o,chunkCount:c,rowVertexLength:d,rowChunkLength:f,vertexProperties:p,chunkProperties:m,dataView:new DataView(t,i+11),buffer:new ArrayBuffer(e.ROW_OUTPUT_LENGTH*o)}}},Ot=e=>{let{url:t,position:n,transform:r,init:i,onDone:a,customLoaders:o}=e;return ct({url:t,position:n,transform:r,init:i,onDone:a,loaders:(0,d.useMemo)(()=>({splat:(e,t)=>{new St().load(e,e=>t(e))},ply:(e,t)=>{new Dt().load(e,e=>t(e))}}),[]),customLoaders:o}),null},kt=new u.Raycaster,At=new u.Vector3,jt=new u.Vector3,V=new u.Quaternion,Mt={X:new u.Vector3(1,0,0),Y:new u.Vector3(0,1,0),Z:new u.Vector3(0,0,1)},Nt={type:`change`},Pt={type:`mouseDown`,mode:null},Ft={type:`mouseUp`,mode:null},It={type:`objectChange`},Lt=class extends u.Controls{constructor(e,t=null){super(void 0,t);let n=new rn(this);this._root=n;let r=new an;this._gizmo=r,n.add(r);let i=new on;this._plane=i,n.add(i);let a=this;function o(e,t){let n=t;Object.defineProperty(a,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,i[e]=t,r[e]=t,a.dispatchEvent({type:e+`-changed`,value:t}),a.dispatchEvent(Nt))}}),a[e]=t,i[e]=t,r[e]=t}o(`camera`,e),o(`object`,void 0),o(`enabled`,!0),o(`axis`,null),o(`mode`,`translate`),o(`translationSnap`,null),o(`rotationSnap`,null),o(`scaleSnap`,null),o(`space`,`world`),o(`size`,1),o(`dragging`,!1),o(`showX`,!0),o(`showY`,!0),o(`showZ`,!0),o(`showXY`,!0),o(`showYZ`,!0),o(`showXZ`,!0),o(`minX`,-1/0),o(`maxX`,1/0),o(`minY`,-1/0),o(`maxY`,1/0),o(`minZ`,-1/0),o(`maxZ`,1/0);let s=new u.Vector3,c=new u.Vector3,l=new u.Quaternion,d=new u.Quaternion,f=new u.Vector3,p=new u.Quaternion,m=new u.Vector3,h=new u.Vector3,g=new u.Vector3,_=new u.Vector3;o(`worldPosition`,s),o(`worldPositionStart`,c),o(`worldQuaternion`,l),o(`worldQuaternionStart`,d),o(`cameraPosition`,f),o(`cameraQuaternion`,p),o(`pointStart`,m),o(`pointEnd`,h),o(`rotationAxis`,g),o(`rotationAngle`,0),o(`eye`,_),this._offset=new u.Vector3,this._startNorm=new u.Vector3,this._endNorm=new u.Vector3,this._cameraScale=new u.Vector3,this._parentPosition=new u.Vector3,this._parentQuaternion=new u.Quaternion,this._parentQuaternionInv=new u.Quaternion,this._parentScale=new u.Vector3,this._worldScaleStart=new u.Vector3,this._worldQuaternionInv=new u.Quaternion,this._worldScale=new u.Vector3,this._positionStart=new u.Vector3,this._quaternionStart=new u.Quaternion,this._scaleStart=new u.Vector3,this._getPointer=Rt.bind(this),this._onPointerDown=Bt.bind(this),this._onPointerHover=zt.bind(this),this._onPointerMove=Vt.bind(this),this._onPointerUp=Ht.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointermove`,this._onPointerHover),this.domElement.addEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerHover),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=``}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&kt.setFromCamera(e,this.camera);let t=Ut(this._gizmo.picker[this.mode],kt);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&kt.setFromCamera(e,this.camera);let t=Ut(this._plane,kt,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Pt.mode=this.mode,this.dispatchEvent(Pt)}}pointerMove(e){let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&kt.setFromCamera(e,this.camera);let a=Ut(this._plane,kt,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this._offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf(`X`)===-1&&(this._offset.x=0),t.indexOf(`Y`)===-1&&(this._offset.y=0),t.indexOf(`Z`)===-1&&(this._offset.z=0),i===`local`&&t!==`XYZ`?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(V.copy(this._quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),i===`world`&&(r.parent&&r.position.add(At.setFromMatrixPosition(r.parent.matrixWorld)),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(At.setFromMatrixPosition(r.parent.matrixWorld)))),r.position.x=Math.max(this.minX,Math.min(this.maxX,r.position.x)),r.position.y=Math.max(this.minY,Math.min(this.maxY,r.position.y)),r.position.z=Math.max(this.minZ,Math.min(this.maxZ,r.position.z));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),jt.set(e,e,e)}else At.copy(this.pointStart),jt.copy(this.pointEnd),At.applyQuaternion(this._worldQuaternionInv),jt.applyQuaternion(this._worldQuaternionInv),jt.divide(At),t.search(`X`)===-1&&(jt.x=1),t.search(`Y`)===-1&&(jt.y=1),t.search(`Z`)===-1&&(jt.z=1);r.scale.copy(this._scaleStart).multiply(jt),this.scaleSnap&&(t.search(`X`)!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this._offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(At.setFromMatrixPosition(this.camera.matrixWorld)),n=!1;t===`XYZE`?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(At.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(Mt[t]),At.copy(Mt[t]),i===`local`&&At.applyQuaternion(this.worldQuaternion),At.cross(this.eye),At.length()===0?n=!0:this.rotationAngle=this._offset.dot(At.normalize())*e),(t===`E`||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(V.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(V.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Nt),this.dispatchEvent(It)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Ft.mode=this.mode,this.dispatchEvent(Ft)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Nt),this.dispatchEvent(It),this.pointStart.copy(this.pointEnd))}getRaycaster(){return kt}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,n,r){let i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(n),i.active.color.set(r),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(n),i.activeTransparent.color.set(r),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(n),i.active._color&&i.active._color.set(r),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(n),i.activeTransparent._color&&i.activeTransparent._color.set(r)}};function Rt(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{let t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function zt(e){if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this._getPointer(e));break}}function Bt(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener(`pointermove`,this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function Vt(e){this.enabled&&this.pointerMove(this._getPointer(e))}function Ht(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.pointerUp(this._getPointer(e)))}function Ut(e,t,n){let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}var Wt=new u.Euler,H=new u.Vector3(0,1,0),Gt=new u.Vector3(0,0,0),Kt=new u.Matrix4,qt=new u.Quaternion,Jt=new u.Quaternion,Yt=new u.Vector3,Xt=new u.Matrix4,Zt=new u.Vector3(1,0,0),Qt=new u.Vector3(0,1,0),$t=new u.Vector3(0,0,1),en=new u.Vector3,tn=new u.Vector3,nn=new u.Vector3,rn=class extends u.Object3D{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){let t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}},an=class extends u.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type=`TransformControlsGizmo`;let e=new u.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new u.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;let r=t.clone();r.opacity=.5;let i=e.clone();i.color.setHex(16711680);let a=e.clone();a.color.setHex(65280);let o=e.clone();o.color.setHex(255);let s=e.clone();s.color.setHex(16711680),s.opacity=.5;let c=e.clone();c.color.setHex(65280),c.opacity=.5;let l=e.clone();l.color.setHex(255),l.opacity=.5;let d=e.clone();d.opacity=.25;let f=e.clone();f.color.setHex(16776960),f.opacity=.25;let p=e.clone();p.color.setHex(16776960);let m=e.clone();m.color.setHex(7895160),this.materialLib={xAxis:i,yAxis:a,zAxis:o,active:p,xAxisTransparent:s,yAxisTransparent:c,zAxisTransparent:l,activeTransparent:f};let h=new u.CylinderGeometry(0,.04,.1,12);h.translate(0,.05,0);let g=new u.BoxGeometry(.08,.08,.08);g.translate(0,.04,0);let _=new u.BufferGeometry;_.setAttribute(`position`,new u.Float32BufferAttribute([0,0,0,1,0,0],3));let v=new u.CylinderGeometry(.0075,.0075,.5,3);v.translate(0,.25,0);function y(e,t){let n=new u.TorusGeometry(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}function b(){let e=new u.BufferGeometry;return e.setAttribute(`position`,new u.Float32BufferAttribute([0,0,0,1,1,1],3)),e}let x={X:[[new u.Mesh(h,i),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(h,i),[-.5,0,0],[0,0,Math.PI/2]],[new u.Mesh(v,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new u.Mesh(h,a),[0,.5,0]],[new u.Mesh(h,a),[0,-.5,0],[Math.PI,0,0]],[new u.Mesh(v,a)]],Z:[[new u.Mesh(h,o),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(h,o),[0,0,-.5],[-Math.PI/2,0,0]],[new u.Mesh(v,o),null,[Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.1,0),d),[0,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]]},S={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.2,0),n)]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},C={START:[[new u.Mesh(new u.OctahedronGeometry(.01,2),r),null,null,null,`helper`]],END:[[new u.Mesh(new u.OctahedronGeometry(.01,2),r),null,null,null,`helper`]],DELTA:[[new u.Line(b(),r),null,null,null,`helper`]],X:[[new u.Line(_,r),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new u.Line(_,r),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new u.Line(_,r),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ee={XYZE:[[new u.Mesh(y(.5,1),m),null,[0,Math.PI/2,0]]],X:[[new u.Mesh(y(.5,.5),i)]],Y:[[new u.Mesh(y(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new u.Mesh(y(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new u.Mesh(y(.75,1),f),null,[0,Math.PI/2,0]]]},w={AXIS:[[new u.Line(_,r),[-1e3,0,0],null,[1e6,1,1],`helper`]]},T={XYZE:[[new u.Mesh(new u.SphereGeometry(.25,10,8),n)]],X:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new u.Mesh(new u.TorusGeometry(.75,.1,2,24),n)]]},te={X:[[new u.Mesh(g,i),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(v,i),[0,0,0],[0,0,-Math.PI/2]],[new u.Mesh(g,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(g,a),[0,.5,0]],[new u.Mesh(v,a)],[new u.Mesh(g,a),[0,-.5,0],[0,0,Math.PI]]],Z:[[new u.Mesh(g,o),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(v,o),[0,0,0],[Math.PI/2,0,0]],[new u.Mesh(g,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.1,.1,.1),d)]]},E={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.2),n),[0,0,0]]]},D={X:[[new u.Line(_,r),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new u.Line(_,r),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new u.Line(_,r),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]};function O(e){let t=new u.Object3D;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=O(x)),this.add(this.gizmo.rotate=O(ee)),this.add(this.gizmo.scale=O(te)),this.add(this.picker.translate=O(S)),this.add(this.picker.rotate=O(T)),this.add(this.picker.scale=O(E)),this.add(this.helper.translate=O(C)),this.add(this.helper.rotate=O(w)),this.add(this.helper.scale=O(D)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){let t=(this.mode===`scale`?`local`:this.space)===`local`?this.worldQuaternion:Jt;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r=n[e];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let i;if(i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),r.tag===`helper`){r.visible=!1,r.name===`AXIS`?(r.visible=!!this.axis,this.axis===`X`&&(V.setFromEuler(Wt.set(0,0,0)),r.quaternion.copy(t).multiply(V),Math.abs(H.copy(Zt).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Y`&&(V.setFromEuler(Wt.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(V),Math.abs(H.copy(Qt).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(V.setFromEuler(Wt.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(V),Math.abs(H.copy($t).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(V.setFromEuler(Wt.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Kt.lookAt(Gt,H,Qt)),r.quaternion.multiply(V),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),At.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),At.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(At),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(H.copy(Zt).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(H.copy(Qt).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(H.copy($t).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(H.copy($t).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(H.copy(Zt).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(H.copy(Qt).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else this.mode===`rotate`&&(qt.copy(t),H.copy(this.eye).applyQuaternion(V.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(Kt.lookAt(this.eye,Gt,Qt)),r.name===`X`&&(V.setFromAxisAngle(Zt,Math.atan2(-H.y,H.z)),V.multiplyQuaternions(qt,V),r.quaternion.copy(V)),r.name===`Y`&&(V.setFromAxisAngle(Qt,Math.atan2(H.x,H.z)),V.multiplyQuaternions(qt,V),r.quaternion.copy(V)),r.name===`Z`&&(V.setFromAxisAngle($t,Math.atan2(H.y,H.x)),V.multiplyQuaternions(qt,V),r.quaternion.copy(V)));r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.visible=r.visible&&(r.name.indexOf(`XY`)===-1||this.showXY),r.visible=r.visible&&(r.name.indexOf(`YZ`)===-1||this.showYZ),r.visible=r.visible&&(r.name.indexOf(`XZ`)===-1||this.showXZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e}))&&(r.material.color.copy(this.materialLib.active.color),r.material.opacity=1)}super.updateMatrixWorld(e)}},on=class extends u.Mesh{constructor(){super(new u.PlaneGeometry(1e5,1e5,2,2),new u.MeshBasicMaterial({visible:!1,wireframe:!0,side:u.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type=`TransformControlsPlane`}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(t=`local`),en.copy(Zt).applyQuaternion(t===`local`?this.worldQuaternion:Jt),tn.copy(Qt).applyQuaternion(t===`local`?this.worldQuaternion:Jt),nn.copy($t).applyQuaternion(t===`local`?this.worldQuaternion:Jt),H.copy(tn),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:H.copy(this.eye).cross(en),Yt.copy(en).cross(H);break;case`Y`:H.copy(this.eye).cross(tn),Yt.copy(tn).cross(H);break;case`Z`:H.copy(this.eye).cross(nn),Yt.copy(nn).cross(H);break;case`XY`:Yt.copy(nn);break;case`YZ`:Yt.copy(en);break;case`XZ`:H.copy(nn),Yt.copy(tn);break;case`XYZ`:case`E`:Yt.set(0,0,0);break}break;default:Yt.set(0,0,0)}Yt.length()===0?this.quaternion.copy(this.cameraQuaternion):(Xt.lookAt(At.set(0,0,0),Yt,H),this.quaternion.setFromRotationMatrix(Xt)),super.updateMatrixWorld(e)}},sn=e=>{let{target:t,mode:n,enabled:r,space:i,size:a,onObjectChange:o}=e,{scene:s,camera:c,renderer:l,map:u,sceneRoot:f}=O(),p=(0,d.useRef)(null);return(0,d.useEffect)(()=>{if(!s||!c||!l||!u||!f)return;let e=l.getRenderer().domElement,t=new Lt(c,e);p.current=t,t.setMode(n||`translate`),t.setSpace(i||`world`),a&&t.setSize(a),f.add(t._root);let r=e=>{e.value?(u.dragPan.disable(),u.scrollZoom.disable()):(u.dragPan.enable(),u.scrollZoom.enable())};return t.addEventListener(`dragging-changed`,r),o&&t.addEventListener(`objectChange`,()=>{t.object&&o(t.object)}),()=>{t.removeEventListener(`dragging-changed`,r),t.detach(),f.remove(t._root),t.dispose(),p.current=null}},[s,c,l,u,f]),(0,d.useEffect)(()=>{p.current&&(t?p.current.attach(t):p.current.detach())},[t]),(0,d.useEffect)(()=>{p.current&&(p.current.mode=n||`translate`)},[n]),(0,d.useEffect)(()=>{p.current&&(p.current.enabled=r!==!1)},[r]),(0,d.useEffect)(()=>{p.current&&p.current.setSpace(i||`world`)},[i]),(0,d.useEffect)(()=>{!p.current||!a||p.current.setSize(a)},[a]),null},cn=o((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),ln=o((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)}function x(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case l:case u:case i:case o:case a:case f:return p;default:var g=p&&p.$$typeof;switch(g){case c:case d:case h:case m:case s:return g;default:return t}}case r:return t}}}var S=l,C=u,ee=c,w=s,T=n,te=d,E=i,D=h,O=m,ne=r,k=o,A=a,j=f,M=!1;function re(e){return M||(M=!0,console.warn(`The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.`)),N(e)||x(e)===l}function N(e){return x(e)===u}function P(e){return x(e)===c}function ie(e){return x(e)===s}function F(e){return typeof e==`object`&&!!e&&e.$$typeof===n}function ae(e){return x(e)===d}function oe(e){return x(e)===i}function I(e){return x(e)===h}function L(e){return x(e)===m}function se(e){return x(e)===r}function ce(e){return x(e)===o}function R(e){return x(e)===a}function le(e){return x(e)===f}e.AsyncMode=S,e.ConcurrentMode=C,e.ContextConsumer=ee,e.ContextProvider=w,e.Element=T,e.ForwardRef=te,e.Fragment=E,e.Lazy=D,e.Memo=O,e.Portal=ne,e.Profiler=k,e.StrictMode=A,e.Suspense=j,e.isAsyncMode=re,e.isConcurrentMode=N,e.isContextConsumer=P,e.isContextProvider=ie,e.isElement=F,e.isForwardRef=ae,e.isFragment=oe,e.isLazy=I,e.isMemo=L,e.isPortal=se,e.isProfiler=ce,e.isStrictMode=R,e.isSuspense=le,e.isValidElementType=b,e.typeOf=x})()})),un=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=cn():t.exports=ln()})),dn=o(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),fn=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),pn=o(((e,t)=>{t.exports=Function.call.bind(Object.prototype.hasOwnProperty)})),mn=o(((e,t)=>{var n=function(){};if(process.env.NODE_ENV!==`production`){var r=fn(),i={},a=pn();n=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}}}function o(e,t,o,s,c){if(process.env.NODE_ENV!==`production`){for(var l in e)if(a(e,l)){var u;try{if(typeof e[l]!=`function`){var d=Error((s||`React class`)+`: `+o+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name=`Invariant Violation`,d}u=e[l](t,l,s,o,null,r)}catch(e){u=e}if(u&&!(u instanceof Error)&&n((s||`React class`)+`: type specification of `+o+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+`. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).`),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var f=c?c():``;n(`Failed `+o+` type: `+u.message+(f??``))}}}}o.resetWarningCache=function(){process.env.NODE_ENV!==`production`&&(i={})},t.exports=o})),hn=o(((e,t)=>{var n=un(),r=dn(),i=fn(),a=pn(),o=mn(),s=function(){};process.env.NODE_ENV!==`production`&&(s=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}});function c(){return null}t.exports=function(e,t){var l=typeof Symbol==`function`&&Symbol.iterator,u=`@@iterator`;function d(e){var t=e&&(l&&e[l]||e[u]);if(typeof t==`function`)return t}var f=`<<anonymous>>`,p={array:_(`array`),bigint:_(`bigint`),bool:_(`boolean`),func:_(`function`),number:_(`number`),object:_(`object`),string:_(`string`),symbol:_(`symbol`),any:v(),arrayOf:y,element:b(),elementType:x(),instanceOf:S,node:T(),objectOf:ee,oneOf:C,oneOfType:w,shape:E,exact:D};function m(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function h(e,t){this.message=e,this.data=t&&typeof t==`object`?t:{},this.stack=``}h.prototype=Error.prototype;function g(e){if(process.env.NODE_ENV!==`production`)var n={},r=0;function a(a,o,c,l,u,d,p){if(l||=f,d||=c,p!==i){if(t){var m=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name=`Invariant Violation`,m}else if(process.env.NODE_ENV!==`production`&&typeof console<`u`){var g=l+`:`+c;!n[g]&&r<3&&(s("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[g]=!0,r++)}}return o[c]==null?a?o[c]===null?new h(`The `+u+" `"+d+"` is marked as required "+("in `"+l+"`, but its value is `null`.")):new h(`The `+u+" `"+d+"` is marked as required in "+("`"+l+"`, but its value is `undefined`.")):null:e(o,c,l,u,d)}var o=a.bind(null,!1);return o.isRequired=a.bind(null,!0),o}function _(e){function t(t,n,r,i,a,o){var s=t[n];if(k(s)!==e){var c=A(s);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."),{expectedType:e})}return null}return g(t)}function v(){return g(c)}function y(e){function t(t,n,r,a,o){if(typeof e!=`function`)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var c=k(s);return new h(`Invalid `+a+" `"+o+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<s.length;l++){var u=e(s,l,r,a,o+`[`+l+`]`,i);if(u instanceof Error)return u}return null}return g(t)}function b(){function t(t,n,r,i,a){var o=t[n];if(!e(o)){var s=k(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return g(t)}function x(){function e(e,t,r,i,a){var o=e[t];if(!n.isValidElementType(o)){var s=k(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement type."))}return null}return g(e)}function S(e){function t(t,n,r,i,a){if(!(t[n]instanceof e)){var o=e.name||f,s=M(t[n]);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+o+"`."))}return null}return g(t)}function C(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&(arguments.length>1?s(`Invalid arguments supplied to oneOf, expected an array, got `+arguments.length+` arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).`):s(`Invalid argument supplied to oneOf, expected an array.`)),c;function t(t,n,r,i,a){for(var o=t[n],s=0;s<e.length;s++)if(m(o,e[s]))return null;var c=JSON.stringify(e,function(e,t){return A(t)===`symbol`?String(t):t});return new h(`Invalid `+i+" `"+a+"` of value `"+String(o)+"` "+("supplied to `"+r+"`, expected one of "+c+`.`))}return g(t)}function ee(e){function t(t,n,r,o,s){if(typeof e!=`function`)return new h("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],l=k(c);if(l!==`object`)return new h(`Invalid `+o+" `"+s+"` of type "+("`"+l+"` supplied to `"+r+"`, expected an object."));for(var u in c)if(a(c,u)){var d=e(c,u,r,o,s+`.`+u,i);if(d instanceof Error)return d}return null}return g(t)}function w(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&s(`Invalid argument supplied to oneOfType, expected an instance of array.`),c;for(var t=0;t<e.length;t++){var n=e[t];if(typeof n!=`function`)return s(`Invalid argument supplied to oneOfType. Expected an array of check functions, but received `+j(n)+` at index `+t+`.`),c}function r(t,n,r,o,s){for(var c=[],l=0;l<e.length;l++){var u=e[l],d=u(t,n,r,o,s,i);if(d==null)return null;d.data&&a(d.data,`expectedType`)&&c.push(d.data.expectedType)}var f=c.length>0?`, expected one of type [`+c.join(`, `)+`]`:``;return new h(`Invalid `+o+" `"+s+"` supplied to "+("`"+r+"`"+f+`.`))}return g(r)}function T(){function e(e,t,n,r,i){return O(e[t])?null:new h(`Invalid `+r+" `"+i+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return g(e)}function te(e,t,n,r,i){return new h((e||`React class`)+`: `+t+" type `"+n+`.`+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function E(e){function t(t,n,r,a,o){var s=t[n],c=k(s);if(c!==`object`)return new h(`Invalid `+a+" `"+o+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var l in e){var u=e[l];if(typeof u!=`function`)return te(r,a,o,l,A(u));var d=u(s,l,r,a,o+`.`+l,i);if(d)return d}return null}return g(t)}function D(e){function t(t,n,o,s,c){var l=t[n],u=k(l);if(u!==`object`)return new h(`Invalid `+s+" `"+c+"` of type `"+u+"` "+("supplied to `"+o+"`, expected `object`."));for(var d in r({},t[n],e)){var f=e[d];if(a(e,d)&&typeof f!=`function`)return te(o,s,c,d,A(f));if(!f)return new h(`Invalid `+s+" `"+c+"` key `"+d+"` supplied to `"+o+`\`.
266
266
  Bad object: `+JSON.stringify(t[n],null,` `)+`
267
- Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var p=f(l,d,o,s,c+`.`+d,i);if(p)return p}return null}return g(t)}function O(t){switch(typeof t){case`number`:case`string`:case`undefined`:return!0;case`boolean`:return!t;case`object`:if(Array.isArray(t))return t.every(O);if(t===null||e(t))return!0;var n=d(t);if(n){var r=n.call(t),i;if(n!==t.entries){for(;!(i=r.next()).done;)if(!O(i.value))return!1}else for(;!(i=r.next()).done;){var a=i.value;if(a&&!O(a[1]))return!1}}else return!1;return!0;default:return!1}}function ne(e,t){return e===`symbol`?!0:t?t[`@@toStringTag`]===`Symbol`||typeof Symbol==`function`&&t instanceof Symbol:!1}function k(e){var t=typeof e;return Array.isArray(e)?`array`:e instanceof RegExp?`object`:ne(t,e)?`symbol`:t}function A(e){if(e==null)return``+e;var t=k(e);if(t===`object`){if(e instanceof Date)return`date`;if(e instanceof RegExp)return`regexp`}return t}function j(e){var t=A(e);switch(t){case`array`:case`object`:return`an `+t;case`boolean`:case`date`:case`regexp`:return`a `+t;default:return t}}function M(e){return!e.constructor||!e.constructor.name?f:e.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p}})),vn=o(((e,t)=>{var n=mn();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),yn=o(((e,t)=>{if(process.env.NODE_ENV!==`production`){var n=fn();t.exports=_n()(n.isElement,!0)}else t.exports=vn()()}));function bn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=bn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function U(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bn(e))&&(r&&(r+=` `),r+=t);return r}function xn(e,t,n=!1){let r={...t};for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let a=i;if(a===`components`||a===`slots`)r[a]={...e[a],...r[a]};else if(a===`componentsProps`||a===`slotProps`){let i=e[a],o=t[a];if(!o)r[a]=i||{};else if(!i)r[a]=o;else{r[a]={...o};for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let t=e;r[a][t]=xn(i[t],o[t],n)}}}else a===`className`&&n&&t.className!==void 0?r.className=U(e?.className,t?.className):a===`style`&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}function Sn(e,t,n=void 0){let r={};for(let i in e){let a=e[i],o=``,s=!0;for(let e=0;e<a.length;e+=1){let r=a[e];r&&(o+=(s===!0?``:` `)+t(r),s=!1,n&&n[r]&&(o+=` `+n[r]))}r[i]=o}return r}var Cn=e=>e,wn=(()=>{let e=Cn;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Cn}}})();function Tn(e,...t){let n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Minified MUI error #${e}; visit ${n} for the full message.`}function En(e){if(typeof e!=`string`)throw Error(process.env.NODE_ENV===`production`?Tn(7):"MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}var Dn=En;function On(e,t){let n=Array.isArray(t),r=Array.isArray(e);return Nn(t)?t:Pn(e)?Fn(t):n&&r?jn(e,t):n===r?In(e,t):Fn(t)}function kn(e){let t=0,n=e.length,r=Array(n);for(t=0;t<n;t+=1)r[t]=Fn(e[t]);return r}function An(e){let t={};for(let n in e)t[n]=Fn(e[n]);return t}function jn(e,t){let n=e.length;for(let r=0;r<t.length;r+=1)e[n+r]=Fn(t[r]);return e}function Mn(e){return typeof e==`object`&&!!e&&!(e instanceof RegExp)&&!(e instanceof Date)}function Nn(e){return typeof e!=`object`||!e}function Pn(e){return typeof e!=`object`||!e||e instanceof RegExp||e instanceof Date}function Fn(e){return Mn(e)?Array.isArray(e)?kn(e):An(e):e}function In(e,t){for(let n in t)n in e?e[n]=On(e[n],t[n]):e[n]=Fn(t[n]);return e}var W=c(yn(),1),Ln=process.env.NODE_ENV===`production`?{}:W.default.oneOfType([W.default.number,W.default.string,W.default.object,W.default.array]);function Rn(e){if(e==null)return!0;for(let t in e)return!1;return!0}var zn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`),m=Symbol.for(`react.client.reference`);function h(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.ContextConsumer=o,e.ContextProvider=s,e.Element=t,e.ForwardRef=c,e.Fragment=r,e.Lazy=f,e.Memo=d,e.Portal=n,e.Profiler=a,e.StrictMode=i,e.Suspense=l,e.SuspenseList=u,e.isContextConsumer=function(e){return h(e)===o},e.isContextProvider=function(e){return h(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===t},e.isForwardRef=function(e){return h(e)===c},e.isFragment=function(e){return h(e)===r},e.isLazy=function(e){return h(e)===f},e.isMemo=function(e){return h(e)===d},e.isPortal=function(e){return h(e)===n},e.isProfiler=function(e){return h(e)===a},e.isStrictMode=function(e){return h(e)===i},e.isSuspense=function(e){return h(e)===l},e.isSuspenseList=function(e){return h(e)===u},e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===r||e===a||e===i||e===l||e===u||typeof e==`object`&&e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===s||e.$$typeof===o||e.$$typeof===c||e.$$typeof===m||e.getModuleId!==void 0))},e.typeOf=h})),Bn=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case i:case o:case a:case u:case d:case m:return e;default:switch(e&&=e.$$typeof,e){case c:case l:case p:case f:return e;case s:return e;default:return t}}case r:return t}}}var n=Symbol.for(`react.transitional.element`),r=Symbol.for(`react.portal`),i=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.consumer`),c=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`),m=Symbol.for(`react.view_transition`),h=Symbol.for(`react.client.reference`);e.ContextConsumer=s,e.ContextProvider=c,e.Element=n,e.ForwardRef=l,e.Fragment=i,e.Lazy=p,e.Memo=f,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=u,e.SuspenseList=d,e.isContextConsumer=function(e){return t(e)===s},e.isContextProvider=function(e){return t(e)===c},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return t(e)===l},e.isFragment=function(e){return t(e)===i},e.isLazy=function(e){return t(e)===p},e.isMemo=function(e){return t(e)===f},e.isPortal=function(e){return t(e)===r},e.isProfiler=function(e){return t(e)===o},e.isStrictMode=function(e){return t(e)===a},e.isSuspense=function(e){return t(e)===u},e.isSuspenseList=function(e){return t(e)===d},e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===i||e===o||e===a||e===u||e===d||typeof e==`object`&&e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===c||e.$$typeof===s||e.$$typeof===l||e.$$typeof===h||e.getModuleId!==void 0))},e.typeOf=t})()})),Vn=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=zn():t.exports=Bn()}))();function Hn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Un(e){if(f.isValidElement(e)||(0,Vn.isValidElementType)(e)||!Hn(e))return e;let t={};return Object.keys(e).forEach(n=>{t[n]=Un(e[n])}),t}function Wn(e,t,n={clone:!0}){let r=n.clone?{...e}:e;return Hn(e)&&Hn(t)&&Object.keys(t).forEach(i=>{f.isValidElement(t[i])||(0,Vn.isValidElementType)(t[i])?r[i]=t[i]:Hn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Hn(e[i])?r[i]=Wn(e[i],t[i],n):n.clone?r[i]=Hn(t[i])?Un(t[i]):t[i]:r[i]=t[i]}),r}var Gn=/min-width:\s*([0-9.]+)/;function Kn(e,t){if(!e.containerQueries||!qn(t))return t;let n=[];for(let e in t)e.startsWith(`@container`)&&n.push(e);n.sort((e,t)=>(e.match(Gn)?.[1]||0)-+(t.match(Gn)?.[1]||0));let r=t;for(let e=0;e<n.length;e+=1){let t=n[e],i=r[t];delete r[t],r[t]=i}return r}function qn(e){for(let t in e)if(t.startsWith(`@container`))return!0;return!1}function Jn(e,t){return t===`@`||t.startsWith(`@`)&&(e.some(e=>t.startsWith(`@${e}`))||!!t.match(/^@\d/))}function Yn(e,t){let n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!==`production`)throw Error(`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.\nFor example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);return null}let[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function Xn(e){let t=(e,t)=>e.replace(`@media`,t?`@container ${t}`:`@container`);function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{let i=t(e.breakpoints.not(...n),r);return i.includes(`not all and`)?i.replace(`not all and `,``).replace(`min-width:`,`width<`).replace(`max-width:`,`width>`).replace(`and`,`or`):i}}let r={},i=e=>(n(r,e),r);return n(i),{...e,containerQueries:i}}var Zn=e=>{let t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})};function Qn(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n=`px`,step:r=5,...i}=e,a=Zn(t),o=Object.keys(a);function s(e){return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n})`}function c(e){return`@media (max-width:${(typeof t[e]==`number`?t[e]:e)-r/100}${n})`}function l(e,i){let a=o.indexOf(i);return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n}) and (max-width:${(a!==-1&&typeof t[o[a]]==`number`?t[o[a]]:i)-r/100}${n})`}function u(e){return o.indexOf(e)+1<o.length?l(e,o[o.indexOf(e)+1]):s(e)}function d(e){let t=o.indexOf(e);return t===0?s(o[1]):t===o.length-1?c(o[t]):l(e,o[o.indexOf(e)+1]).replace(`@media`,`@media not all and`)}let f=[];for(let e=0;e<o.length;e+=1)f.push(s(o[e]));return{keys:o,values:a,up:s,down:c,between:l,only:u,not:d,unit:n,internal_mediaKeys:f,...i}}var $n={},er={xs:0,sm:600,md:900,lg:1200,xl:1536},tr=Qn({values:er}),nr={containerQueries:e=>({up:t=>{let n=typeof t==`number`?t:er[t]||t;return typeof n==`number`&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function rr(e,t,n){let r={};return ir(r,e.theme,t,(e,t,i)=>{let a=n(t,i);e?r[e]=a:On(r,a)})}function ir(e,t,n,r){if(t??=$n,Array.isArray(n)){let i=t.breakpoints??tr;for(let t=0;t<n.length;t+=1)ar(e,i.up(i.keys[t]),n[t],void 0,r);return e}if(typeof n==`object`){let i=t.breakpoints??tr,a=i.values??er;for(let o in n)if(Jn(i.keys,o)){let i=Yn(t.containerQueries?t:nr,o);i&&ar(e,i,n[o],o,r)}else if(o in a)ar(e,i.up(o),n[o],o,r);else{let t=o;e[t]=n[t]}return e}return r(void 0,n),e}function ar(e,t,n,r,i){e[t]??={},i(t,n,r)}function or(e=tr){let{internal_mediaKeys:t}=e,n={};for(let e=0;e<t.length;e+=1)n[t[e]]={};return n}function sr(e,t){let n=e.internal_mediaKeys;for(let e=0;e<n.length;e+=1){let r=n[e];Rn(t[r])&&delete t[r]}return t}function cr(e,t){if(Array.isArray(t))return!0;if(typeof t==`object`&&t){for(let n=0;n<e.keys.length;n+=1)if(e.keys[n]in t)return!0;let n=Object.keys(t);for(let t=0;t<n.length;t+=1)if(Jn(e.keys,n[t]))return!0}return!1}function lr(e,t,n,r){let i;return i=typeof e==`function`?e(n):Array.isArray(e)?e[n]||n:typeof n==`string`&&ur(e,n,!0,r)||n,t&&(i=t(i,n,e)),i}function ur(e,t,n=!0,r=void 0){if(!e||!t)return null;let i=t.split(`.`);if(e.vars&&n){let t=dr(e.vars,i,r);if(t!=null)return t}return dr(e,i,r)}function dr(e,t,n=void 0){let r,i=e,a=0;for(;a<t.length;){if(i==null)return i;r=i,i=i[t[a]],a+=1}if(n&&i===void 0){let e=t[t.length-1],i=`${n}${e===`default`?``:En(e)}`;return r?.[i]}return i}function G(e){let{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,a=e=>{if(e[t]==null)return null;let a=e[t],o=e.theme,s=ur(o,r)||{};return rr(e,a,e=>{let r=lr(s,i,e,t);return n===!1?r:{[n]:r}})};return a.propTypes=process.env.NODE_ENV===`production`?{}:{[t]:Ln},a.filterProps=[t],a}var fr={internal_cache:{}},pr={m:`margin`,p:`padding`},mr={t:`Top`,r:`Right`,b:`Bottom`,l:`Left`,x:[`Left`,`Right`],y:[`Top`,`Bottom`]},hr={marginX:`mx`,marginY:`my`,paddingX:`px`,paddingY:`py`},gr={};for(let e in pr)gr[e]=[pr[e]];for(let e in pr)for(let t in mr){let n=pr[e],r=mr[t],i=Array.isArray(r)?r.map(e=>n+e):[n+r];gr[e+t]=i}for(let e in hr)gr[e]=gr[hr[e]];var _r=new Set([`m`,`mt`,`mr`,`mb`,`ml`,`mx`,`my`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginX`,`marginY`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`]),vr=new Set([`p`,`pt`,`pr`,`pb`,`pl`,`px`,`py`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingX`,`paddingY`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`]),yr=new Set([..._r,...vr]);function br(e,t,n,r){let i=ur(e,t,!0)??n;return typeof i==`number`||typeof i==`string`?e=>typeof e==`string`?e:(process.env.NODE_ENV!==`production`&&typeof e!=`number`&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${e}.`),typeof i==`string`?i.startsWith(`var(`)&&e===0?0:i.startsWith(`var(`)&&e===1?i:`calc(${e} * ${i})`:i*e):Array.isArray(i)?e=>{if(typeof e==`string`)return e;let n=Math.abs(e);process.env.NODE_ENV!==`production`&&(Number.isInteger(n)?n>i.length-1&&console.error([`MUI: The value provided (${n}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${n} > ${i.length-1}, you need to add the missing values.`].join(`
267
+ Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var p=f(l,d,o,s,c+`.`+d,i);if(p)return p}return null}return g(t)}function O(t){switch(typeof t){case`number`:case`string`:case`undefined`:return!0;case`boolean`:return!t;case`object`:if(Array.isArray(t))return t.every(O);if(t===null||e(t))return!0;var n=d(t);if(n){var r=n.call(t),i;if(n!==t.entries){for(;!(i=r.next()).done;)if(!O(i.value))return!1}else for(;!(i=r.next()).done;){var a=i.value;if(a&&!O(a[1]))return!1}}else return!1;return!0;default:return!1}}function ne(e,t){return e===`symbol`?!0:t?t[`@@toStringTag`]===`Symbol`||typeof Symbol==`function`&&t instanceof Symbol:!1}function k(e){var t=typeof e;return Array.isArray(e)?`array`:e instanceof RegExp?`object`:ne(t,e)?`symbol`:t}function A(e){if(e==null)return``+e;var t=k(e);if(t===`object`){if(e instanceof Date)return`date`;if(e instanceof RegExp)return`regexp`}return t}function j(e){var t=A(e);switch(t){case`array`:case`object`:return`an `+t;case`boolean`:case`date`:case`regexp`:return`a `+t;default:return t}}function M(e){return!e.constructor||!e.constructor.name?f:e.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p}})),gn=o(((e,t)=>{var n=fn();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),_n=o(((e,t)=>{if(process.env.NODE_ENV!==`production`){var n=un();t.exports=hn()(n.isElement,!0)}else t.exports=gn()()}));function vn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function U(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vn(e))&&(r&&(r+=` `),r+=t);return r}function yn(e,t,n=!1){let r={...t};for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let a=i;if(a===`components`||a===`slots`)r[a]={...e[a],...r[a]};else if(a===`componentsProps`||a===`slotProps`){let i=e[a],o=t[a];if(!o)r[a]=i||{};else if(!i)r[a]=o;else{r[a]={...o};for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let t=e;r[a][t]=yn(i[t],o[t],n)}}}else a===`className`&&n&&t.className!==void 0?r.className=U(e?.className,t?.className):a===`style`&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}function bn(e,t,n=void 0){let r={};for(let i in e){let a=e[i],o=``,s=!0;for(let e=0;e<a.length;e+=1){let r=a[e];r&&(o+=(s===!0?``:` `)+t(r),s=!1,n&&n[r]&&(o+=` `+n[r]))}r[i]=o}return r}var xn=e=>e,Sn=(()=>{let e=xn;return{configure(t){e=t},generate(t){return e(t)},reset(){e=xn}}})();function Cn(e,...t){let n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Minified MUI error #${e}; visit ${n} for the full message.`}function wn(e){if(typeof e!=`string`)throw Error(process.env.NODE_ENV===`production`?Cn(7):"MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}var Tn=wn;function En(e,t){let n=Array.isArray(t),r=Array.isArray(e);return jn(t)?t:Mn(e)?Nn(t):n&&r?kn(e,t):n===r?Pn(e,t):Nn(t)}function Dn(e){let t=0,n=e.length,r=Array(n);for(t=0;t<n;t+=1)r[t]=Nn(e[t]);return r}function On(e){let t={};for(let n in e)t[n]=Nn(e[n]);return t}function kn(e,t){let n=e.length;for(let r=0;r<t.length;r+=1)e[n+r]=Nn(t[r]);return e}function An(e){return typeof e==`object`&&!!e&&!(e instanceof RegExp)&&!(e instanceof Date)}function jn(e){return typeof e!=`object`||!e}function Mn(e){return typeof e!=`object`||!e||e instanceof RegExp||e instanceof Date}function Nn(e){return An(e)?Array.isArray(e)?Dn(e):On(e):e}function Pn(e,t){for(let n in t)n in e?e[n]=En(e[n],t[n]):e[n]=Nn(t[n]);return e}var W=c(_n(),1),Fn=process.env.NODE_ENV===`production`?{}:W.default.oneOfType([W.default.number,W.default.string,W.default.object,W.default.array]);function In(e){if(e==null)return!0;for(let t in e)return!1;return!0}var Ln=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`),m=Symbol.for(`react.client.reference`);function h(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.ContextConsumer=o,e.ContextProvider=s,e.Element=t,e.ForwardRef=c,e.Fragment=r,e.Lazy=f,e.Memo=d,e.Portal=n,e.Profiler=a,e.StrictMode=i,e.Suspense=l,e.SuspenseList=u,e.isContextConsumer=function(e){return h(e)===o},e.isContextProvider=function(e){return h(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===t},e.isForwardRef=function(e){return h(e)===c},e.isFragment=function(e){return h(e)===r},e.isLazy=function(e){return h(e)===f},e.isMemo=function(e){return h(e)===d},e.isPortal=function(e){return h(e)===n},e.isProfiler=function(e){return h(e)===a},e.isStrictMode=function(e){return h(e)===i},e.isSuspense=function(e){return h(e)===l},e.isSuspenseList=function(e){return h(e)===u},e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===r||e===a||e===i||e===l||e===u||typeof e==`object`&&e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===s||e.$$typeof===o||e.$$typeof===c||e.$$typeof===m||e.getModuleId!==void 0))},e.typeOf=h})),Rn=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case i:case o:case a:case u:case d:case m:return e;default:switch(e&&=e.$$typeof,e){case c:case l:case p:case f:return e;case s:return e;default:return t}}case r:return t}}}var n=Symbol.for(`react.transitional.element`),r=Symbol.for(`react.portal`),i=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.consumer`),c=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`),m=Symbol.for(`react.view_transition`),h=Symbol.for(`react.client.reference`);e.ContextConsumer=s,e.ContextProvider=c,e.Element=n,e.ForwardRef=l,e.Fragment=i,e.Lazy=p,e.Memo=f,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=u,e.SuspenseList=d,e.isContextConsumer=function(e){return t(e)===s},e.isContextProvider=function(e){return t(e)===c},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return t(e)===l},e.isFragment=function(e){return t(e)===i},e.isLazy=function(e){return t(e)===p},e.isMemo=function(e){return t(e)===f},e.isPortal=function(e){return t(e)===r},e.isProfiler=function(e){return t(e)===o},e.isStrictMode=function(e){return t(e)===a},e.isSuspense=function(e){return t(e)===u},e.isSuspenseList=function(e){return t(e)===d},e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===i||e===o||e===a||e===u||e===d||typeof e==`object`&&e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===c||e.$$typeof===s||e.$$typeof===l||e.$$typeof===h||e.getModuleId!==void 0))},e.typeOf=t})()})),zn=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Ln():t.exports=Rn()}))();function Bn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Vn(e){if(f.isValidElement(e)||(0,zn.isValidElementType)(e)||!Bn(e))return e;let t={};return Object.keys(e).forEach(n=>{t[n]=Vn(e[n])}),t}function Hn(e,t,n={clone:!0}){let r=n.clone?{...e}:e;return Bn(e)&&Bn(t)&&Object.keys(t).forEach(i=>{f.isValidElement(t[i])||(0,zn.isValidElementType)(t[i])?r[i]=t[i]:Bn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Bn(e[i])?r[i]=Hn(e[i],t[i],n):n.clone?r[i]=Bn(t[i])?Vn(t[i]):t[i]:r[i]=t[i]}),r}var Un=/min-width:\s*([0-9.]+)/;function Wn(e,t){if(!e.containerQueries||!Gn(t))return t;let n=[];for(let e in t)e.startsWith(`@container`)&&n.push(e);n.sort((e,t)=>(e.match(Un)?.[1]||0)-+(t.match(Un)?.[1]||0));let r=t;for(let e=0;e<n.length;e+=1){let t=n[e],i=r[t];delete r[t],r[t]=i}return r}function Gn(e){for(let t in e)if(t.startsWith(`@container`))return!0;return!1}function Kn(e,t){return t===`@`||t.startsWith(`@`)&&(e.some(e=>t.startsWith(`@${e}`))||!!t.match(/^@\d/))}function qn(e,t){let n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!==`production`)throw Error(`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.\nFor example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);return null}let[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function Jn(e){let t=(e,t)=>e.replace(`@media`,t?`@container ${t}`:`@container`);function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{let i=t(e.breakpoints.not(...n),r);return i.includes(`not all and`)?i.replace(`not all and `,``).replace(`min-width:`,`width<`).replace(`max-width:`,`width>`).replace(`and`,`or`):i}}let r={},i=e=>(n(r,e),r);return n(i),{...e,containerQueries:i}}var Yn=e=>{let t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})};function Xn(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n=`px`,step:r=5,...i}=e,a=Yn(t),o=Object.keys(a);function s(e){return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n})`}function c(e){return`@media (max-width:${(typeof t[e]==`number`?t[e]:e)-r/100}${n})`}function l(e,i){let a=o.indexOf(i);return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n}) and (max-width:${(a!==-1&&typeof t[o[a]]==`number`?t[o[a]]:i)-r/100}${n})`}function u(e){return o.indexOf(e)+1<o.length?l(e,o[o.indexOf(e)+1]):s(e)}function d(e){let t=o.indexOf(e);return t===0?s(o[1]):t===o.length-1?c(o[t]):l(e,o[o.indexOf(e)+1]).replace(`@media`,`@media not all and`)}let f=[];for(let e=0;e<o.length;e+=1)f.push(s(o[e]));return{keys:o,values:a,up:s,down:c,between:l,only:u,not:d,unit:n,internal_mediaKeys:f,...i}}var Zn={},Qn={xs:0,sm:600,md:900,lg:1200,xl:1536},$n=Xn({values:Qn}),er={containerQueries:e=>({up:t=>{let n=typeof t==`number`?t:Qn[t]||t;return typeof n==`number`&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function tr(e,t,n){let r={};return nr(r,e.theme,t,(e,t,i)=>{let a=n(t,i);e?r[e]=a:En(r,a)})}function nr(e,t,n,r){if(t??=Zn,Array.isArray(n)){let i=t.breakpoints??$n;for(let t=0;t<n.length;t+=1)rr(e,i.up(i.keys[t]),n[t],void 0,r);return e}if(typeof n==`object`){let i=t.breakpoints??$n,a=i.values??Qn;for(let o in n)if(Kn(i.keys,o)){let i=qn(t.containerQueries?t:er,o);i&&rr(e,i,n[o],o,r)}else if(o in a)rr(e,i.up(o),n[o],o,r);else{let t=o;e[t]=n[t]}return e}return r(void 0,n),e}function rr(e,t,n,r,i){e[t]??={},i(t,n,r)}function ir(e=$n){let{internal_mediaKeys:t}=e,n={};for(let e=0;e<t.length;e+=1)n[t[e]]={};return n}function ar(e,t){let n=e.internal_mediaKeys;for(let e=0;e<n.length;e+=1){let r=n[e];In(t[r])&&delete t[r]}return t}function or(e,t){if(Array.isArray(t))return!0;if(typeof t==`object`&&t){for(let n=0;n<e.keys.length;n+=1)if(e.keys[n]in t)return!0;let n=Object.keys(t);for(let t=0;t<n.length;t+=1)if(Kn(e.keys,n[t]))return!0}return!1}function sr(e,t,n,r){let i;return i=typeof e==`function`?e(n):Array.isArray(e)?e[n]||n:typeof n==`string`&&cr(e,n,!0,r)||n,t&&(i=t(i,n,e)),i}function cr(e,t,n=!0,r=void 0){if(!e||!t)return null;let i=t.split(`.`);if(e.vars&&n){let t=lr(e.vars,i,r);if(t!=null)return t}return lr(e,i,r)}function lr(e,t,n=void 0){let r,i=e,a=0;for(;a<t.length;){if(i==null)return i;r=i,i=i[t[a]],a+=1}if(n&&i===void 0){let e=t[t.length-1],i=`${n}${e===`default`?``:wn(e)}`;return r?.[i]}return i}function G(e){let{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,a=e=>{if(e[t]==null)return null;let a=e[t],o=e.theme,s=cr(o,r)||{};return tr(e,a,e=>{let r=sr(s,i,e,t);return n===!1?r:{[n]:r}})};return a.propTypes=process.env.NODE_ENV===`production`?{}:{[t]:Fn},a.filterProps=[t],a}var ur={internal_cache:{}},dr={m:`margin`,p:`padding`},fr={t:`Top`,r:`Right`,b:`Bottom`,l:`Left`,x:[`Left`,`Right`],y:[`Top`,`Bottom`]},pr={marginX:`mx`,marginY:`my`,paddingX:`px`,paddingY:`py`},mr={};for(let e in dr)mr[e]=[dr[e]];for(let e in dr)for(let t in fr){let n=dr[e],r=fr[t],i=Array.isArray(r)?r.map(e=>n+e):[n+r];mr[e+t]=i}for(let e in pr)mr[e]=mr[pr[e]];var hr=new Set([`m`,`mt`,`mr`,`mb`,`ml`,`mx`,`my`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginX`,`marginY`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`]),gr=new Set([`p`,`pt`,`pr`,`pb`,`pl`,`px`,`py`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingX`,`paddingY`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`]),_r=new Set([...hr,...gr]);function vr(e,t,n,r){let i=cr(e,t,!0)??n;return typeof i==`number`||typeof i==`string`?e=>typeof e==`string`?e:(process.env.NODE_ENV!==`production`&&typeof e!=`number`&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${e}.`),typeof i==`string`?i.startsWith(`var(`)&&e===0?0:i.startsWith(`var(`)&&e===1?i:`calc(${e} * ${i})`:i*e):Array.isArray(i)?e=>{if(typeof e==`string`)return e;let n=Math.abs(e);process.env.NODE_ENV!==`production`&&(Number.isInteger(n)?n>i.length-1&&console.error([`MUI: The value provided (${n}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${n} > ${i.length-1}, you need to add the missing values.`].join(`
268
268
  `)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
269
269
  `)));let r=i[n];return e>=0?r:typeof r==`number`?-r:typeof r==`string`&&r.startsWith(`var(`)?`calc(-1 * ${r})`:`-${r}`}:typeof i==`function`?i:(process.env.NODE_ENV!==`production`&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,`It should be a number, an array or a function.`].join(`
270
- `)),()=>void 0)}function xr(e){return br(e,`spacing`,8,`spacing`)}function Sr(e,t){return typeof t==`string`||t==null?t:e(t)}var Cr=[``];function wr(e,t){let n=e.theme??fr,r=n?.internal_cache?.unarySpacing??xr(n),i={};for(let n in e){if(!t.has(n))continue;let a=gr[n]??(Cr[0]=n,Cr),o=e[n];ir(i,e.theme,o,(e,t)=>{let n=e?i[e]:i;for(let e=0;e<a.length;e+=1)n[a[e]]=Sr(r,t)})}return i}function K(e){return wr(e,_r)}K.propTypes=process.env.NODE_ENV===`production`?{}:Array.from(_r).reduce((e,t)=>(e[t]=Ln,e),{}),K.filterProps=_r;function q(e){return wr(e,vr)}q.propTypes=process.env.NODE_ENV===`production`?{}:Array.from(vr).reduce((e,t)=>(e[t]=Ln,e),{}),q.filterProps=vr;function Tr(e){return wr(e,yr)}Tr.propTypes=process.env.NODE_ENV===`production`?{}:Array.from(yr).reduce((e,t)=>(e[t]=Ln,e),{}),Tr.filterProps=yr;function Er(...e){let t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>{let n={};for(let r in e)t[r]&&On(n,t[r](e));return n};return n.propTypes=process.env.NODE_ENV===`production`?{}:e.reduce((e,t)=>Object.assign(e,t.propTypes),{}),n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function Dr(e){return typeof e==`number`?`${e}px solid`:e}function Or(e,t){return G({prop:e,themeKey:`borders`,transform:t})}var kr=Or(`border`,Dr),Ar=Or(`borderTop`,Dr),jr=Or(`borderRight`,Dr),Mr=Or(`borderBottom`,Dr),Nr=Or(`borderLeft`,Dr),Pr=Or(`borderColor`),Fr=Or(`borderTopColor`),Ir=Or(`borderRightColor`),Lr=Or(`borderBottomColor`),Rr=Or(`borderLeftColor`),zr=Or(`outline`,Dr),Br=Or(`outlineColor`),Vr=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){let t=br(e.theme,`shape.borderRadius`,4,`borderRadius`);return rr(e,e.borderRadius,e=>({borderRadius:Sr(t,e)}))}return null};Vr.propTypes=process.env.NODE_ENV===`production`?{}:{borderRadius:Ln},Vr.filterProps=[`borderRadius`],Er(kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,Vr,zr,Br);var Hr=e=>{if(e.gap!==void 0&&e.gap!==null){let t=br(e.theme,`spacing`,8,`gap`);return rr(e,e.gap,e=>({gap:Sr(t,e)}))}return null};Hr.propTypes=process.env.NODE_ENV===`production`?{}:{gap:Ln},Hr.filterProps=[`gap`];var Ur=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){let t=br(e.theme,`spacing`,8,`columnGap`);return rr(e,e.columnGap,e=>({columnGap:Sr(t,e)}))}return null};Ur.propTypes=process.env.NODE_ENV===`production`?{}:{columnGap:Ln},Ur.filterProps=[`columnGap`];var Wr=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){let t=br(e.theme,`spacing`,8,`rowGap`);return rr(e,e.rowGap,e=>({rowGap:Sr(t,e)}))}return null};Wr.propTypes=process.env.NODE_ENV===`production`?{}:{rowGap:Ln},Wr.filterProps=[`rowGap`],Er(Hr,Ur,Wr,G({prop:`gridColumn`}),G({prop:`gridRow`}),G({prop:`gridAutoFlow`}),G({prop:`gridAutoColumns`}),G({prop:`gridAutoRows`}),G({prop:`gridTemplateColumns`}),G({prop:`gridTemplateRows`}),G({prop:`gridTemplateAreas`}),G({prop:`gridArea`}));function Gr(e,t){return t===`grey`?t:e}Er(G({prop:`color`,themeKey:`palette`,transform:Gr}),G({prop:`bgcolor`,cssProperty:`backgroundColor`,themeKey:`palette`,transform:Gr}),G({prop:`backgroundColor`,themeKey:`palette`,transform:Gr}));function Kr(e){return e<=1&&e!==0?`${e*100}%`:e}var qr=G({prop:`width`,transform:Kr}),Jr=e=>e.maxWidth!==void 0&&e.maxWidth!==null?rr(e,e.maxWidth,t=>{let n=e.theme?.breakpoints?.values?.[t]||er[t];return n?e.theme?.breakpoints?.unit===`px`?{maxWidth:n}:{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:Kr(t)}}):null;Jr.filterProps=[`maxWidth`];var Yr=G({prop:`minWidth`,transform:Kr}),Xr=G({prop:`height`,transform:Kr}),Zr=G({prop:`maxHeight`,transform:Kr}),Qr=G({prop:`minHeight`,transform:Kr});G({prop:`size`,cssProperty:`width`,transform:Kr}),G({prop:`size`,cssProperty:`height`,transform:Kr}),Er(qr,Jr,Yr,Xr,Zr,Qr,G({prop:`boxSizing`}));var $r={border:{themeKey:`borders`,transform:Dr},borderTop:{themeKey:`borders`,transform:Dr},borderRight:{themeKey:`borders`,transform:Dr},borderBottom:{themeKey:`borders`,transform:Dr},borderLeft:{themeKey:`borders`,transform:Dr},borderColor:{themeKey:`palette`},borderTopColor:{themeKey:`palette`},borderRightColor:{themeKey:`palette`},borderBottomColor:{themeKey:`palette`},borderLeftColor:{themeKey:`palette`},outline:{themeKey:`borders`,transform:Dr},outlineColor:{themeKey:`palette`},borderRadius:{themeKey:`shape.borderRadius`,style:Vr},color:{themeKey:`palette`,transform:Gr},bgcolor:{themeKey:`palette`,cssProperty:`backgroundColor`,transform:Gr},backgroundColor:{themeKey:`palette`,transform:Gr},p:{style:q},pt:{style:q},pr:{style:q},pb:{style:q},pl:{style:q},px:{style:q},py:{style:q},padding:{style:q},paddingTop:{style:q},paddingRight:{style:q},paddingBottom:{style:q},paddingLeft:{style:q},paddingX:{style:q},paddingY:{style:q},paddingInline:{style:q},paddingInlineStart:{style:q},paddingInlineEnd:{style:q},paddingBlock:{style:q},paddingBlockStart:{style:q},paddingBlockEnd:{style:q},m:{style:K},mt:{style:K},mr:{style:K},mb:{style:K},ml:{style:K},mx:{style:K},my:{style:K},margin:{style:K},marginTop:{style:K},marginRight:{style:K},marginBottom:{style:K},marginLeft:{style:K},marginX:{style:K},marginY:{style:K},marginInline:{style:K},marginInlineStart:{style:K},marginInlineEnd:{style:K},marginBlock:{style:K},marginBlockStart:{style:K},marginBlockEnd:{style:K},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Hr},rowGap:{style:Wr},columnGap:{style:Ur},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:`zIndex`},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:`shadows`},width:{transform:Kr},maxWidth:{style:Jr},minWidth:{transform:Kr},height:{transform:Kr},maxHeight:{transform:Kr},minHeight:{transform:Kr},boxSizing:{},font:{themeKey:`font`},fontFamily:{themeKey:`typography`},fontSize:{themeKey:`typography`},fontStyle:{themeKey:`typography`},fontWeight:{themeKey:`typography`},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:`typography`}},ei={};function ti(){function e(t){if(!t.sx)return null;let{sx:n,theme:r=ei,nested:i}=t,a=r.unstable_sxConfig??$r,o={sx:null,theme:r,nested:!0};function s(n){let s=n;if(typeof n==`function`)s=n(r);else if(typeof n!=`object`)return n;if(!s)return null;let c=r.breakpoints??tr,l=or(c);for(let n in s){let i=ii(s[n],r);if(i!=null){if(typeof i!=`object`){ri(l,n,i,r,a);continue}if(a[n]){ri(l,n,i,r,a);continue}cr(c,i)?ir(l,t.theme,i,(e,t)=>{l[e][n]=t}):(o.sx=i,l[n]=e(o))}}return!i&&r.modularCssLayers?{"@layer sx":Kn(r,sr(c,l))}:Kn(r,sr(c,l))}return Array.isArray(n)?n.map(s):s(n)}return e.filterProps=[`sx`],e}var ni=ti();function ri(e,t,n,r,i){let a=i[t];if(!a){e[t]=n;return}if(n==null)return;let{themeKey:o}=a;if(o===`typography`&&n===`inherit`){e[t]=n;return}let{style:s}=a;if(s){On(e,s({[t]:n,theme:r}));return}let{cssProperty:c=t,transform:l}=a,u=ur(r,o);ir(e,r,n,(n,r)=>{let i=lr(u,l,r,t);c===!1?On(n?e[n]:e,i):n?e[n][c]=i:e[c]=i})}function ii(e,t){return typeof e==`function`?e(t):e}function ai(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function oi(e,t=0,n=1){return process.env.NODE_ENV!==`production`&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),ai(e,t,n)}function si(e){e=e.slice(1);let t=RegExp(`.{1,${e.length>=6?2:1}}`,`g`),n=e.match(t);return n&&n[0].length===1&&(n=n.map(e=>e+e)),process.env.NODE_ENV!==`production`&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?`a`:``}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(`, `)})`:``}function ci(e){if(e.type)return e;if(e.charAt(0)===`#`)return ci(si(e));let t=e.indexOf(`(`),n=e.substring(0,t);if(![`rgb`,`rgba`,`hsl`,`hsla`,`color`].includes(n))throw Error(process.env.NODE_ENV===`production`?Tn(9,e):`MUI: Unsupported \`${e}\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`);let r=e.substring(t+1,e.length-1),i;if(n===`color`){if(r=r.split(` `),i=r.shift(),r.length===4&&r[3].charAt(0)===`/`&&(r[3]=r[3].slice(1)),![`srgb`,`display-p3`,`a98-rgb`,`prophoto-rgb`,`rec-2020`].includes(i))throw Error(process.env.NODE_ENV===`production`?Tn(10,i):`MUI: unsupported \`${i}\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`)}else r=r.split(`,`);return r=r.map(e=>parseFloat(e)),{type:n,values:r,colorSpace:i}}var li=e=>{let t=ci(e);return t.values.slice(0,3).map((e,n)=>t.type.includes(`hsl`)&&n!==0?`${e}%`:e).join(` `)},ui=(e,t)=>{try{return li(e)}catch{return t&&process.env.NODE_ENV!==`production`&&console.warn(t),e}};function di(e){let{type:t,colorSpace:n}=e,{values:r}=e;return t.includes(`rgb`)?r=r.map((e,t)=>t<3?parseInt(e,10):e):t.includes(`hsl`)&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=t.includes(`color`)?`${n} ${r.join(` `)}`:`${r.join(`, `)}`,`${t}(${r})`}function fi(e){e=ci(e);let{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1),s=`rgb`,c=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type===`hsla`&&(s+=`a`,c.push(t[3])),di({type:s,values:c})}function pi(e){e=ci(e);let t=e.type===`hsl`||e.type===`hsla`?ci(fi(e)).values:e.values;return t=t.map(t=>(e.type!==`color`&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function mi(e,t){let n=pi(e),r=pi(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function hi(e,t){return e=ci(e),t=oi(t),(e.type===`rgb`||e.type===`hsl`)&&(e.type+=`a`),e.type===`color`?e.values[3]=`/${t}`:e.values[3]=t,di(e)}function gi(e,t,n){try{return hi(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function _i(e,t){if(e=ci(e),t=oi(t),e.type.includes(`hsl`))e.values[2]*=1-t;else if(e.type.includes(`rgb`)||e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return di(e)}function J(e,t,n){try{return _i(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function vi(e,t){if(e=ci(e),t=oi(t),e.type.includes(`hsl`))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes(`rgb`))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return di(e)}function Y(e,t,n){try{return vi(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function yi(e,t=.15){return pi(e)>.5?_i(e,t):vi(e,t)}function bi(e,t,n){try{return yi(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}var xi={black:`#000`,white:`#fff`},Si={50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`,A100:`#f5f5f5`,A200:`#eeeeee`,A400:`#bdbdbd`,A700:`#616161`},Ci={50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`,A100:`#ea80fc`,A200:`#e040fb`,A400:`#d500f9`,A700:`#aa00ff`},wi={50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`,A100:`#ff8a80`,A200:`#ff5252`,A400:`#ff1744`,A700:`#d50000`},Ti={50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`,A100:`#ffd180`,A200:`#ffab40`,A400:`#ff9100`,A700:`#ff6d00`},Ei={50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`,A100:`#82b1ff`,A200:`#448aff`,A400:`#2979ff`,A700:`#2962ff`},Di={50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`,A100:`#80d8ff`,A200:`#40c4ff`,A400:`#00b0ff`,A700:`#0091ea`},Oi={50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`,A100:`#b9f6ca`,A200:`#69f0ae`,A400:`#00e676`,A700:`#00c853`};function ki(){return{text:{primary:`rgba(0, 0, 0, 0.87)`,secondary:`rgba(0, 0, 0, 0.6)`,disabled:`rgba(0, 0, 0, 0.38)`},divider:`rgba(0, 0, 0, 0.12)`,background:{paper:xi.white,default:xi.white},action:{active:`rgba(0, 0, 0, 0.54)`,hover:`rgba(0, 0, 0, 0.04)`,hoverOpacity:.04,selected:`rgba(0, 0, 0, 0.08)`,selectedOpacity:.08,disabled:`rgba(0, 0, 0, 0.26)`,disabledBackground:`rgba(0, 0, 0, 0.12)`,disabledOpacity:.38,focus:`rgba(0, 0, 0, 0.12)`,focusOpacity:.12,activatedOpacity:.12}}}var Ai=ki();function ji(){return{text:{primary:xi.white,secondary:`rgba(255, 255, 255, 0.7)`,disabled:`rgba(255, 255, 255, 0.5)`,icon:`rgba(255, 255, 255, 0.5)`},divider:`rgba(255, 255, 255, 0.12)`,background:{paper:`#121212`,default:`#121212`},action:{active:xi.white,hover:`rgba(255, 255, 255, 0.08)`,hoverOpacity:.08,selected:`rgba(255, 255, 255, 0.16)`,selectedOpacity:.16,disabled:`rgba(255, 255, 255, 0.3)`,disabledBackground:`rgba(255, 255, 255, 0.12)`,disabledOpacity:.38,focus:`rgba(255, 255, 255, 0.12)`,focusOpacity:.12,activatedOpacity:.24}}}var Mi=ji();function Ni(e,t,n,r){let i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t===`light`?e.light=vi(e.main,i):t===`dark`&&(e.dark=_i(e.main,a)))}function Pi(e,t,n,r,i){let a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n===`light`?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n===`dark`&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function Fi(e=`light`){return e===`dark`?{main:Ei[200],light:Ei[50],dark:Ei[400]}:{main:Ei[700],light:Ei[400],dark:Ei[800]}}function Ii(e=`light`){return e===`dark`?{main:Ci[200],light:Ci[50],dark:Ci[400]}:{main:Ci[500],light:Ci[300],dark:Ci[700]}}function Li(e=`light`){return e===`dark`?{main:wi[500],light:wi[300],dark:wi[700]}:{main:wi[700],light:wi[400],dark:wi[800]}}function Ri(e=`light`){return e===`dark`?{main:Di[400],light:Di[300],dark:Di[700]}:{main:Di[700],light:Di[500],dark:Di[900]}}function zi(e=`light`){return e===`dark`?{main:Oi[400],light:Oi[300],dark:Oi[700]}:{main:Oi[800],light:Oi[500],dark:Oi[900]}}function Bi(e=`light`){return e===`dark`?{main:Ti[400],light:Ti[300],dark:Ti[700]}:{main:`#ed6c02`,light:Ti[500],dark:Ti[900]}}function Vi(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Hi(e){let{mode:t=`light`,contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||Fi(t),s=e.secondary||Ii(t),c=e.error||Li(t),l=e.info||Ri(t),u=e.success||zi(t),d=e.warning||Bi(t);function f(e){if(i)return Vi(e);let t=mi(e,Mi.text.primary)>=n?Mi.text.primary:Ai.text.primary;if(process.env.NODE_ENV!==`production`){let n=mi(e,t);n<3&&console.error([`MUI: The contrast ratio of ${n}:1 for ${t} on ${e}`,`falls below the WCAG recommended absolute minimum contrast ratio of 3:1.`,`https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast`].join(`
271
- `))}return t}let p=({color:e,name:t,mainShade:n=500,lightShade:a=300,darkShade:o=700})=>{if(e={...e},!e.main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty(`main`))throw Error(process.env.NODE_ENV===`production`?Tn(11,t?` (${t})`:``,n):`MUI: The color${t?` (${t})`:``} provided to augmentColor(color) is invalid.\nThe color object needs to have a \`main\` property or a \`${n}\` property.`);if(typeof e.main!=`string`)throw Error(process.env.NODE_ENV===`production`?Tn(12,t?` (${t})`:``,JSON.stringify(e.main)):`MUI: The color${t?` (${t})`:``} provided to augmentColor(color) is invalid.\n\`color.main\` should be a string, but \`${JSON.stringify(e.main)}\` was provided instead.\n
270
+ `)),()=>void 0)}function yr(e){return vr(e,`spacing`,8,`spacing`)}function br(e,t){return typeof t==`string`||t==null?t:e(t)}var xr=[``];function Sr(e,t){let n=e.theme??ur,r=n?.internal_cache?.unarySpacing??yr(n),i={};for(let n in e){if(!t.has(n))continue;let a=mr[n]??(xr[0]=n,xr),o=e[n];nr(i,e.theme,o,(e,t)=>{let n=e?i[e]:i;for(let e=0;e<a.length;e+=1)n[a[e]]=br(r,t)})}return i}function K(e){return Sr(e,hr)}K.propTypes=process.env.NODE_ENV===`production`?{}:Array.from(hr).reduce((e,t)=>(e[t]=Fn,e),{}),K.filterProps=hr;function q(e){return Sr(e,gr)}q.propTypes=process.env.NODE_ENV===`production`?{}:Array.from(gr).reduce((e,t)=>(e[t]=Fn,e),{}),q.filterProps=gr;function Cr(e){return Sr(e,_r)}Cr.propTypes=process.env.NODE_ENV===`production`?{}:Array.from(_r).reduce((e,t)=>(e[t]=Fn,e),{}),Cr.filterProps=_r;function wr(...e){let t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>{let n={};for(let r in e)t[r]&&En(n,t[r](e));return n};return n.propTypes=process.env.NODE_ENV===`production`?{}:e.reduce((e,t)=>Object.assign(e,t.propTypes),{}),n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function Tr(e){return typeof e==`number`?`${e}px solid`:e}function Er(e,t){return G({prop:e,themeKey:`borders`,transform:t})}var Dr=Er(`border`,Tr),Or=Er(`borderTop`,Tr),kr=Er(`borderRight`,Tr),Ar=Er(`borderBottom`,Tr),jr=Er(`borderLeft`,Tr),Mr=Er(`borderColor`),Nr=Er(`borderTopColor`),Pr=Er(`borderRightColor`),Fr=Er(`borderBottomColor`),Ir=Er(`borderLeftColor`),Lr=Er(`outline`,Tr),Rr=Er(`outlineColor`),zr=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){let t=vr(e.theme,`shape.borderRadius`,4,`borderRadius`);return tr(e,e.borderRadius,e=>({borderRadius:br(t,e)}))}return null};zr.propTypes=process.env.NODE_ENV===`production`?{}:{borderRadius:Fn},zr.filterProps=[`borderRadius`],wr(Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,zr,Lr,Rr);var Br=e=>{if(e.gap!==void 0&&e.gap!==null){let t=vr(e.theme,`spacing`,8,`gap`);return tr(e,e.gap,e=>({gap:br(t,e)}))}return null};Br.propTypes=process.env.NODE_ENV===`production`?{}:{gap:Fn},Br.filterProps=[`gap`];var Vr=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){let t=vr(e.theme,`spacing`,8,`columnGap`);return tr(e,e.columnGap,e=>({columnGap:br(t,e)}))}return null};Vr.propTypes=process.env.NODE_ENV===`production`?{}:{columnGap:Fn},Vr.filterProps=[`columnGap`];var Hr=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){let t=vr(e.theme,`spacing`,8,`rowGap`);return tr(e,e.rowGap,e=>({rowGap:br(t,e)}))}return null};Hr.propTypes=process.env.NODE_ENV===`production`?{}:{rowGap:Fn},Hr.filterProps=[`rowGap`],wr(Br,Vr,Hr,G({prop:`gridColumn`}),G({prop:`gridRow`}),G({prop:`gridAutoFlow`}),G({prop:`gridAutoColumns`}),G({prop:`gridAutoRows`}),G({prop:`gridTemplateColumns`}),G({prop:`gridTemplateRows`}),G({prop:`gridTemplateAreas`}),G({prop:`gridArea`}));function Ur(e,t){return t===`grey`?t:e}wr(G({prop:`color`,themeKey:`palette`,transform:Ur}),G({prop:`bgcolor`,cssProperty:`backgroundColor`,themeKey:`palette`,transform:Ur}),G({prop:`backgroundColor`,themeKey:`palette`,transform:Ur}));function Wr(e){return e<=1&&e!==0?`${e*100}%`:e}var Gr=G({prop:`width`,transform:Wr}),Kr=e=>e.maxWidth!==void 0&&e.maxWidth!==null?tr(e,e.maxWidth,t=>{let n=e.theme?.breakpoints?.values?.[t]||Qn[t];return n?e.theme?.breakpoints?.unit===`px`?{maxWidth:n}:{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:Wr(t)}}):null;Kr.filterProps=[`maxWidth`];var qr=G({prop:`minWidth`,transform:Wr}),Jr=G({prop:`height`,transform:Wr}),Yr=G({prop:`maxHeight`,transform:Wr}),Xr=G({prop:`minHeight`,transform:Wr});G({prop:`size`,cssProperty:`width`,transform:Wr}),G({prop:`size`,cssProperty:`height`,transform:Wr}),wr(Gr,Kr,qr,Jr,Yr,Xr,G({prop:`boxSizing`}));var Zr={border:{themeKey:`borders`,transform:Tr},borderTop:{themeKey:`borders`,transform:Tr},borderRight:{themeKey:`borders`,transform:Tr},borderBottom:{themeKey:`borders`,transform:Tr},borderLeft:{themeKey:`borders`,transform:Tr},borderColor:{themeKey:`palette`},borderTopColor:{themeKey:`palette`},borderRightColor:{themeKey:`palette`},borderBottomColor:{themeKey:`palette`},borderLeftColor:{themeKey:`palette`},outline:{themeKey:`borders`,transform:Tr},outlineColor:{themeKey:`palette`},borderRadius:{themeKey:`shape.borderRadius`,style:zr},color:{themeKey:`palette`,transform:Ur},bgcolor:{themeKey:`palette`,cssProperty:`backgroundColor`,transform:Ur},backgroundColor:{themeKey:`palette`,transform:Ur},p:{style:q},pt:{style:q},pr:{style:q},pb:{style:q},pl:{style:q},px:{style:q},py:{style:q},padding:{style:q},paddingTop:{style:q},paddingRight:{style:q},paddingBottom:{style:q},paddingLeft:{style:q},paddingX:{style:q},paddingY:{style:q},paddingInline:{style:q},paddingInlineStart:{style:q},paddingInlineEnd:{style:q},paddingBlock:{style:q},paddingBlockStart:{style:q},paddingBlockEnd:{style:q},m:{style:K},mt:{style:K},mr:{style:K},mb:{style:K},ml:{style:K},mx:{style:K},my:{style:K},margin:{style:K},marginTop:{style:K},marginRight:{style:K},marginBottom:{style:K},marginLeft:{style:K},marginX:{style:K},marginY:{style:K},marginInline:{style:K},marginInlineStart:{style:K},marginInlineEnd:{style:K},marginBlock:{style:K},marginBlockStart:{style:K},marginBlockEnd:{style:K},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Br},rowGap:{style:Hr},columnGap:{style:Vr},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:`zIndex`},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:`shadows`},width:{transform:Wr},maxWidth:{style:Kr},minWidth:{transform:Wr},height:{transform:Wr},maxHeight:{transform:Wr},minHeight:{transform:Wr},boxSizing:{},font:{themeKey:`font`},fontFamily:{themeKey:`typography`},fontSize:{themeKey:`typography`},fontStyle:{themeKey:`typography`},fontWeight:{themeKey:`typography`},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:`typography`}},Qr={};function $r(){function e(t){if(!t.sx)return null;let{sx:n,theme:r=Qr,nested:i}=t,a=r.unstable_sxConfig??Zr,o={sx:null,theme:r,nested:!0};function s(n){let s=n;if(typeof n==`function`)s=n(r);else if(typeof n!=`object`)return n;if(!s)return null;let c=r.breakpoints??$n,l=ir(c);for(let n in s){let i=ni(s[n],r);if(i!=null){if(typeof i!=`object`){ti(l,n,i,r,a);continue}if(a[n]){ti(l,n,i,r,a);continue}or(c,i)?nr(l,t.theme,i,(e,t)=>{l[e][n]=t}):(o.sx=i,l[n]=e(o))}}return!i&&r.modularCssLayers?{"@layer sx":Wn(r,ar(c,l))}:Wn(r,ar(c,l))}return Array.isArray(n)?n.map(s):s(n)}return e.filterProps=[`sx`],e}var ei=$r();function ti(e,t,n,r,i){let a=i[t];if(!a){e[t]=n;return}if(n==null)return;let{themeKey:o}=a;if(o===`typography`&&n===`inherit`){e[t]=n;return}let{style:s}=a;if(s){En(e,s({[t]:n,theme:r}));return}let{cssProperty:c=t,transform:l}=a,u=cr(r,o);nr(e,r,n,(n,r)=>{let i=sr(u,l,r,t);c===!1?En(n?e[n]:e,i):n?e[n][c]=i:e[c]=i})}function ni(e,t){return typeof e==`function`?e(t):e}function ri(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function ii(e,t=0,n=1){return process.env.NODE_ENV!==`production`&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),ri(e,t,n)}function ai(e){e=e.slice(1);let t=RegExp(`.{1,${e.length>=6?2:1}}`,`g`),n=e.match(t);return n&&n[0].length===1&&(n=n.map(e=>e+e)),process.env.NODE_ENV!==`production`&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?`a`:``}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(`, `)})`:``}function oi(e){if(e.type)return e;if(e.charAt(0)===`#`)return oi(ai(e));let t=e.indexOf(`(`),n=e.substring(0,t);if(![`rgb`,`rgba`,`hsl`,`hsla`,`color`].includes(n))throw Error(process.env.NODE_ENV===`production`?Cn(9,e):`MUI: Unsupported \`${e}\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`);let r=e.substring(t+1,e.length-1),i;if(n===`color`){if(r=r.split(` `),i=r.shift(),r.length===4&&r[3].charAt(0)===`/`&&(r[3]=r[3].slice(1)),![`srgb`,`display-p3`,`a98-rgb`,`prophoto-rgb`,`rec-2020`].includes(i))throw Error(process.env.NODE_ENV===`production`?Cn(10,i):`MUI: unsupported \`${i}\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`)}else r=r.split(`,`);return r=r.map(e=>parseFloat(e)),{type:n,values:r,colorSpace:i}}var si=e=>{let t=oi(e);return t.values.slice(0,3).map((e,n)=>t.type.includes(`hsl`)&&n!==0?`${e}%`:e).join(` `)},ci=(e,t)=>{try{return si(e)}catch{return t&&process.env.NODE_ENV!==`production`&&console.warn(t),e}};function li(e){let{type:t,colorSpace:n}=e,{values:r}=e;return t.includes(`rgb`)?r=r.map((e,t)=>t<3?parseInt(e,10):e):t.includes(`hsl`)&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=t.includes(`color`)?`${n} ${r.join(` `)}`:`${r.join(`, `)}`,`${t}(${r})`}function ui(e){e=oi(e);let{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1),s=`rgb`,c=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type===`hsla`&&(s+=`a`,c.push(t[3])),li({type:s,values:c})}function di(e){e=oi(e);let t=e.type===`hsl`||e.type===`hsla`?oi(ui(e)).values:e.values;return t=t.map(t=>(e.type!==`color`&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function fi(e,t){let n=di(e),r=di(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function pi(e,t){return e=oi(e),t=ii(t),(e.type===`rgb`||e.type===`hsl`)&&(e.type+=`a`),e.type===`color`?e.values[3]=`/${t}`:e.values[3]=t,li(e)}function mi(e,t,n){try{return pi(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function hi(e,t){if(e=oi(e),t=ii(t),e.type.includes(`hsl`))e.values[2]*=1-t;else if(e.type.includes(`rgb`)||e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return li(e)}function J(e,t,n){try{return hi(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function gi(e,t){if(e=oi(e),t=ii(t),e.type.includes(`hsl`))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes(`rgb`))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return li(e)}function Y(e,t,n){try{return gi(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function _i(e,t=.15){return di(e)>.5?hi(e,t):gi(e,t)}function vi(e,t,n){try{return _i(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}var yi={black:`#000`,white:`#fff`},bi={50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`,A100:`#f5f5f5`,A200:`#eeeeee`,A400:`#bdbdbd`,A700:`#616161`},xi={50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`,A100:`#ea80fc`,A200:`#e040fb`,A400:`#d500f9`,A700:`#aa00ff`},Si={50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`,A100:`#ff8a80`,A200:`#ff5252`,A400:`#ff1744`,A700:`#d50000`},Ci={50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`,A100:`#ffd180`,A200:`#ffab40`,A400:`#ff9100`,A700:`#ff6d00`},wi={50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`,A100:`#82b1ff`,A200:`#448aff`,A400:`#2979ff`,A700:`#2962ff`},Ti={50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`,A100:`#80d8ff`,A200:`#40c4ff`,A400:`#00b0ff`,A700:`#0091ea`},Ei={50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`,A100:`#b9f6ca`,A200:`#69f0ae`,A400:`#00e676`,A700:`#00c853`};function Di(){return{text:{primary:`rgba(0, 0, 0, 0.87)`,secondary:`rgba(0, 0, 0, 0.6)`,disabled:`rgba(0, 0, 0, 0.38)`},divider:`rgba(0, 0, 0, 0.12)`,background:{paper:yi.white,default:yi.white},action:{active:`rgba(0, 0, 0, 0.54)`,hover:`rgba(0, 0, 0, 0.04)`,hoverOpacity:.04,selected:`rgba(0, 0, 0, 0.08)`,selectedOpacity:.08,disabled:`rgba(0, 0, 0, 0.26)`,disabledBackground:`rgba(0, 0, 0, 0.12)`,disabledOpacity:.38,focus:`rgba(0, 0, 0, 0.12)`,focusOpacity:.12,activatedOpacity:.12}}}var Oi=Di();function ki(){return{text:{primary:yi.white,secondary:`rgba(255, 255, 255, 0.7)`,disabled:`rgba(255, 255, 255, 0.5)`,icon:`rgba(255, 255, 255, 0.5)`},divider:`rgba(255, 255, 255, 0.12)`,background:{paper:`#121212`,default:`#121212`},action:{active:yi.white,hover:`rgba(255, 255, 255, 0.08)`,hoverOpacity:.08,selected:`rgba(255, 255, 255, 0.16)`,selectedOpacity:.16,disabled:`rgba(255, 255, 255, 0.3)`,disabledBackground:`rgba(255, 255, 255, 0.12)`,disabledOpacity:.38,focus:`rgba(255, 255, 255, 0.12)`,focusOpacity:.12,activatedOpacity:.24}}}var Ai=ki();function ji(e,t,n,r){let i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t===`light`?e.light=gi(e.main,i):t===`dark`&&(e.dark=hi(e.main,a)))}function Mi(e,t,n,r,i){let a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n===`light`?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n===`dark`&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function Ni(e=`light`){return e===`dark`?{main:wi[200],light:wi[50],dark:wi[400]}:{main:wi[700],light:wi[400],dark:wi[800]}}function Pi(e=`light`){return e===`dark`?{main:xi[200],light:xi[50],dark:xi[400]}:{main:xi[500],light:xi[300],dark:xi[700]}}function Fi(e=`light`){return e===`dark`?{main:Si[500],light:Si[300],dark:Si[700]}:{main:Si[700],light:Si[400],dark:Si[800]}}function Ii(e=`light`){return e===`dark`?{main:Ti[400],light:Ti[300],dark:Ti[700]}:{main:Ti[700],light:Ti[500],dark:Ti[900]}}function Li(e=`light`){return e===`dark`?{main:Ei[400],light:Ei[300],dark:Ei[700]}:{main:Ei[800],light:Ei[500],dark:Ei[900]}}function Ri(e=`light`){return e===`dark`?{main:Ci[400],light:Ci[300],dark:Ci[700]}:{main:`#ed6c02`,light:Ci[500],dark:Ci[900]}}function zi(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Bi(e){let{mode:t=`light`,contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||Ni(t),s=e.secondary||Pi(t),c=e.error||Fi(t),l=e.info||Ii(t),u=e.success||Li(t),d=e.warning||Ri(t);function f(e){if(i)return zi(e);let t=fi(e,Ai.text.primary)>=n?Ai.text.primary:Oi.text.primary;if(process.env.NODE_ENV!==`production`){let n=fi(e,t);n<3&&console.error([`MUI: The contrast ratio of ${n}:1 for ${t} on ${e}`,`falls below the WCAG recommended absolute minimum contrast ratio of 3:1.`,`https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast`].join(`
271
+ `))}return t}let p=({color:e,name:t,mainShade:n=500,lightShade:a=300,darkShade:o=700})=>{if(e={...e},!e.main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty(`main`))throw Error(process.env.NODE_ENV===`production`?Cn(11,t?` (${t})`:``,n):`MUI: The color${t?` (${t})`:``} provided to augmentColor(color) is invalid.\nThe color object needs to have a \`main\` property or a \`${n}\` property.`);if(typeof e.main!=`string`)throw Error(process.env.NODE_ENV===`production`?Cn(12,t?` (${t})`:``,JSON.stringify(e.main)):`MUI: The color${t?` (${t})`:``} provided to augmentColor(color) is invalid.\n\`color.main\` should be a string, but \`${JSON.stringify(e.main)}\` was provided instead.\n
272
272
  Did you intend to use one of the following approaches?
273
273
 
274
274
  import { green } from "@mui/material/colors";
@@ -279,21 +279,21 @@ const theme1 = createTheme({ palette: {
279
279
 
280
280
  const theme2 = createTheme({ palette: {
281
281
  primary: { main: green[500] },
282
- } });`);return i?(Pi(i,e,`light`,a,r),Pi(i,e,`dark`,o,r)):(Ni(e,`light`,a,r),Ni(e,`dark`,o,r)),e.contrastText||=f(e.main),e},m;return t===`light`?m=ki():t===`dark`&&(m=ji()),process.env.NODE_ENV!==`production`&&(m||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Wn({common:{...xi},mode:t,primary:p({color:o,name:`primary`}),secondary:p({color:s,name:`secondary`,mainShade:`A400`,lightShade:`A200`,darkShade:`A700`}),error:p({color:c,name:`error`}),warning:p({color:d,name:`warning`}),info:p({color:l,name:`info`}),success:p({color:u,name:`success`}),grey:Si,contrastThreshold:n,getContrastText:f,augmentColor:p,tonalOffset:r,...m},a)}function Ui(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Wi={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Gi(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Ki=!1,qi=/[A-Z]|^ms/g,Ji=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Yi=function(e){return e.charCodeAt(1)===45},Xi=function(e){return e!=null&&typeof e!=`boolean`},Zi=Gi(function(e){return Yi(e)?e:e.replace(qi,`-$&`).toLowerCase()}),Qi=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(Ji,function(e,t,n){return ra={name:t,styles:n,next:ra},t})}return Wi[e]!==1&&!Yi(e)&&typeof t==`number`&&t!==0?t+`px`:t},$i=`Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.`;function ea(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return ra={name:i.name,styles:i.styles,next:ra},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)ra={name:o.name,styles:o.styles,next:ra},o=o.next;return a.styles+`;`}return ta(e,t,n);case`function`:if(e!==void 0){var s=ra,c=n(e);return ra=s,ea(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function ta(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=ea(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:Xi(s)&&(r+=Zi(a)+`:`+Qi(a,s)+`;`)}else{if(a===`NO_COMPONENT_SELECTOR`&&Ki)throw Error($i);if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)Xi(o[c])&&(r+=Zi(a)+`:`+Qi(a,o[c])+`;`);else{var l=ea(e,t,o);switch(a){case`animation`:case`animationName`:r+=Zi(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}}return r}var na=/label:\s*([^\s;{]+)\s*(;|$)/g,ra;function ia(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;ra=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=ea(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=ea(n,t,e[o]),r&&(i+=a[o]);na.lastIndex=0;for(var s=``,c;(c=na.exec(i))!==null;)s+=`-`+c[1];return{name:Ui(i)+s,styles:i,next:ra}}function aa(e,t){let n=(0,g.default)(e,t);return process.env.NODE_ENV===`production`?n:(...t)=>{let r=typeof e==`string`?`"${e}"`:`component`;return t.length===0?console.error([`MUI: Seems like you called \`styled(${r})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
283
- `)):t.some(e=>e===void 0)&&console.error(`MUI: the styled(${r})(...args) API requires all its args to be defined.`),n(...t)}}function oa(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}var sa=[];function ca(e){return sa[0]=e,ia(sa)}var la=typeof window<`u`?f.useLayoutEffect:f.useEffect,ua=f.createContext();function da({value:e,...t}){return(0,m.jsx)(ua.Provider,{value:e??!0,...t})}process.env.NODE_ENV!==`production`&&(da.propTypes={children:W.default.node,value:W.default.bool});var fa=()=>f.useContext(ua)??!1,pa=f.createContext(void 0);function ma({value:e,children:t}){return(0,m.jsx)(pa.Provider,{value:e,children:t})}process.env.NODE_ENV!==`production`&&(ma.propTypes={children:W.default.node,value:W.default.object});function ha(e){let{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;let i=t.components[n];return i.defaultProps?xn(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?xn(i,r,t.components.mergeClassNameAndStyle):r}function ga({props:e,name:t}){return ha({props:e,name:t,theme:{components:f.useContext(pa)}})}var _a=0;function va(e){let[t,n]=f.useState(e),r=e||t;return f.useEffect(()=>{t??(_a+=1,n(`mui-${_a}`))},[t]),r}var ya={...f}.useId;function ba(e){if(ya!==void 0){let t=ya();return e??t}return va(e)}var xa={borderRadius:4};function Sa(e=8,t=xr({spacing:e})){if(e.mui)return e;let n=(...e)=>(process.env.NODE_ENV!==`production`&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(e.length===0?[1]:e).map(e=>{let n=t(e);return typeof n==`number`?`${n}px`:n}).join(` `));return n.mui=!0,n}function Ca(e,t){let n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!=`function`)return{};let r=n.getColorSchemeSelector(e);return r===`&`?t:((r.includes(`data-`)||r.includes(`.`))&&(r=`*:where(${r.replace(/\s*&$/,``)}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function wa(e={},...t){let{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,s=Qn(n),c=Sa(i),l=Wn({breakpoints:s,direction:`ltr`,components:{},palette:{mode:`light`,...r},spacing:c,shape:{...xa,...a}},o);return l=Xn(l),l.applyStyles=Ca,l=t.reduce((e,t)=>Wn(e,t),l),l.unstable_sxConfig={...$r,...o?.unstable_sxConfig},l.unstable_sx=function(e){return ni({sx:e,theme:this})},l.internal_cache={},l}var Ta=(e,t,n,r=[])=>{let i=e;t.forEach((e,a)=>{a===t.length-1?Array.isArray(i)?i[Number(e)]=n:i&&typeof i==`object`&&(i[e]=n):i&&typeof i==`object`&&(i[e]||(i[e]=r.includes(e)?[]:{}),i=i[e])})},Ea=(e,t,n)=>{function r(e,i=[],a=[]){Object.entries(e).forEach(([e,o])=>{(!n||n&&!n([...i,e]))&&o!=null&&(typeof o==`object`&&Object.keys(o).length>0?r(o,[...i,e],Array.isArray(o)?[...a,e]:a):t([...i,e],o,a))})}r(e)},Da=(e,t)=>typeof t==`number`?[`lineHeight`,`fontWeight`,`opacity`,`zIndex`].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes(`opacity`)?t:`${t}px`:t;function Oa(e,t){let{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return Ea(e,(e,t,s)=>{if((typeof t==`string`||typeof t==`number`)&&(!r||!r(e,t))){let r=`--${n?`${n}-`:``}${e.join(`-`)}`,c=Da(e,t);Object.assign(i,{[r]:c}),Ta(a,e,`var(${r})`,s),Ta(o,e,`var(${r}, ${c})`,s)}},e=>e[0]===`vars`),{css:i,vars:a,varsWithDefaults:o}}function ka(e,t={}){let{getSelector:n=_,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:s,defaultColorScheme:c=`light`,...l}=e,{vars:u,css:d,varsWithDefaults:f}=Oa(l,t),p=f,m={},{[c]:h,...g}=o;if(Object.entries(g||{}).forEach(([e,n])=>{let{vars:r,css:i,varsWithDefaults:a}=Oa(n,t);p=Wn(p,a),m[e]={css:i,vars:r}}),h){let{css:e,vars:n,varsWithDefaults:r}=Oa(h,t);p=Wn(p,r),m[c]={css:e,vars:n}}function _(t,n){let r=i;if(i===`class`&&(r=`.%s`),i===`data`&&(r=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(r=`[${i}="%s"]`),t){if(r===`media`)return e.defaultColorScheme===t?`:root`:{[`@media (prefers-color-scheme: ${o[t]?.palette?.mode||t})`]:{":root":n}};if(r)return e.defaultColorScheme===t?`:root, ${r.replace(`%s`,String(t))}`:r.replace(`%s`,String(t))}return`:root`}return{vars:p,generateThemeVars:()=>{let e={...u};return Object.entries(m).forEach(([,{vars:t}])=>{e=Wn(e,t)}),e},generateStyleSheets:()=>{let t=[],i=e.defaultColorScheme||`light`;function s(e,n){Object.keys(n).length&&t.push(typeof e==`string`?{[e]:{...n}}:e)}s(n(void 0,{...d}),d);let{[i]:c,...l}=m;if(c){let{css:e}=c,t=o[i]?.palette?.mode,a=!r&&t?{colorScheme:t,...e}:{...e};s(n(i,{...a}),a)}return Object.entries(l).forEach(([e,{css:t}])=>{let i=o[e]?.palette?.mode,a=!r&&i?{colorScheme:i,...t}:{...t};s(n(e,{...a}),a)}),a&&t.push({":root":{"--__l-threshold":`0.7`,"--__l":`clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)`,"--__a":`clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)`}}),t}}}function Aa(e){let t={};return Object.entries(e).forEach(e=>{let[n,r]=e;typeof r==`object`&&(t[n]=`${r.fontStyle?`${r.fontStyle} `:``}${r.fontVariant?`${r.fontVariant} `:``}${r.fontWeight?`${r.fontWeight} `:``}${r.fontStretch?`${r.fontStretch} `:``}${r.fontSize||``}${r.lineHeight?`/${r.lineHeight} `:``}${r.fontFamily||``}`)}),t}function ja(e){return function(t){return e===`media`?(process.env.NODE_ENV!==`production`&&t!==`light`&&t!==`dark`&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${t}'.`),`@media (prefers-color-scheme: ${t})`):e?e.startsWith(`data-`)&&!e.includes(`%s`)?`[${e}="${t}"] &`:e===`class`?`.${t} &`:e===`data`?`[data-${t}] &`:`${e.replace(`%s`,t)} &`:`&`}}var Ma={active:`active`,checked:`checked`,completed:`completed`,disabled:`disabled`,error:`error`,expanded:`expanded`,focused:`focused`,focusVisible:`focusVisible`,open:`open`,readOnly:`readOnly`,required:`required`,selected:`selected`};function Na(e,t,n=`Mui`){let r=Ma[t];return r?`${n}-${r}`:`${wn.generate(e)}-${t}`}function Pa(e,t){return{toolbar:{minHeight:56,[e.up(`xs`)]:{"@media (orientation: landscape)":{minHeight:48}},[e.up(`sm`)]:{minHeight:64}},...t}}function Fa(e){return Math.round(e*1e5)/1e5}var Ia={textTransform:`uppercase`},La=`"Roboto", "Helvetica", "Arial", sans-serif`;function Ra(e,t){let{fontFamily:n=La,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:c=16,allVariants:l,pxToRem:u,...d}=typeof t==`function`?t(e):t;process.env.NODE_ENV!==`production`&&(typeof r!=`number`&&console.error("MUI: `fontSize` is required to be a number."),typeof c!=`number`&&console.error("MUI: `htmlFontSize` is required to be a number."));let f=r/14,p=u||(e=>`${e/c*f}rem`),m=(e,t,r,i,a)=>({fontFamily:n,fontWeight:e,fontSize:p(t),lineHeight:r,...n===La?{letterSpacing:`${Fa(i/t)}em`}:{},...a,...l});return Wn({htmlFontSize:c,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(o,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(o,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(o,14,1.75,.4,Ia),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,Ia),inherit:{fontFamily:`inherit`,fontWeight:`inherit`,fontSize:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},d,{clone:!1})}var za=.2,Ba=.14,Va=.12;function X(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${za})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Ba})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Va})`].join(`,`)}var Ha=[`none`,X(0,2,1,-1,0,1,1,0,0,1,3,0),X(0,3,1,-2,0,2,2,0,0,1,5,0),X(0,3,3,-2,0,3,4,0,0,1,8,0),X(0,2,4,-1,0,4,5,0,0,1,10,0),X(0,3,5,-1,0,5,8,0,0,1,14,0),X(0,3,5,-1,0,6,10,0,0,1,18,0),X(0,4,5,-2,0,7,10,1,0,2,16,1),X(0,5,5,-3,0,8,10,1,0,3,14,2),X(0,5,6,-3,0,9,12,1,0,3,16,2),X(0,6,6,-3,0,10,14,1,0,4,18,3),X(0,6,7,-4,0,11,15,1,0,4,20,3),X(0,7,8,-4,0,12,17,2,0,5,22,4),X(0,7,8,-4,0,13,19,2,0,5,24,4),X(0,7,9,-4,0,14,21,2,0,5,26,4),X(0,8,9,-5,0,15,22,2,0,6,28,5),X(0,8,10,-5,0,16,24,2,0,6,30,5),X(0,8,11,-5,0,17,26,2,0,6,32,5),X(0,9,11,-5,0,18,28,2,0,7,34,6),X(0,9,12,-6,0,19,29,2,0,7,36,6),X(0,10,13,-6,0,20,31,3,0,8,38,7),X(0,10,13,-6,0,21,33,3,0,8,40,7),X(0,10,14,-6,0,22,35,3,0,8,42,7),X(0,11,14,-7,0,23,36,3,0,9,44,8),X(0,11,15,-7,0,24,38,3,0,9,46,8)],Ua={easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`,easeOut:`cubic-bezier(0.0, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,sharp:`cubic-bezier(0.4, 0, 0.6, 1)`},Wa={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Ga(e){return`${Math.round(e)}ms`}function Ka(e){if(!e)return 0;let t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function qa(e){let t={...Ua,...e.easing},n={...Wa,...e.duration};return{getAutoHeightDuration:Ka,create:(e=[`all`],r={})=>{let{duration:i=n.standard,easing:a=t.easeInOut,delay:o=0,...s}=r;if(process.env.NODE_ENV!==`production`){let t=e=>typeof e==`string`,n=e=>!Number.isNaN(parseFloat(e));!t(e)&&!Array.isArray(e)&&console.error(`MUI: Argument "props" must be a string or Array.`),!n(i)&&!t(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),t(a)||console.error(`MUI: Argument "easing" must be a string.`),!n(o)&&!t(o)&&console.error(`MUI: Argument "delay" must be a number or a string.`),typeof r!=`object`&&console.error([`MUI: Secong argument of transition.create must be an object.`,"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
284
- `)),Object.keys(s).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(s).join(`,`)}].`)}return(Array.isArray(e)?e:[e]).map(e=>`${e} ${typeof i==`string`?i:Ga(i)} ${a} ${typeof o==`string`?o:Ga(o)}`).join(`,`)},...e,easing:t,duration:n}}var Ja={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Ya(e){return Hn(e)||e===void 0||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||Array.isArray(e)}function Xa(e={}){let t={...e};function n(e){let t=Object.entries(e);for(let r=0;r<t.length;r++){let[i,a]=t[r];!Ya(a)||i.startsWith(`unstable_`)||i.startsWith(`internal_`)?delete e[i]:Hn(a)&&(e[i]={...a},n(e[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
282
+ } });`);return i?(Mi(i,e,`light`,a,r),Mi(i,e,`dark`,o,r)):(ji(e,`light`,a,r),ji(e,`dark`,o,r)),e.contrastText||=f(e.main),e},m;return t===`light`?m=Di():t===`dark`&&(m=ki()),process.env.NODE_ENV!==`production`&&(m||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Hn({common:{...yi},mode:t,primary:p({color:o,name:`primary`}),secondary:p({color:s,name:`secondary`,mainShade:`A400`,lightShade:`A200`,darkShade:`A700`}),error:p({color:c,name:`error`}),warning:p({color:d,name:`warning`}),info:p({color:l,name:`info`}),success:p({color:u,name:`success`}),grey:bi,contrastThreshold:n,getContrastText:f,augmentColor:p,tonalOffset:r,...m},a)}function Vi(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Hi={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Ui(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Wi=!1,Gi=/[A-Z]|^ms/g,Ki=/_EMO_([^_]+?)_([^]*?)_EMO_/g,qi=function(e){return e.charCodeAt(1)===45},Ji=function(e){return e!=null&&typeof e!=`boolean`},Yi=Ui(function(e){return qi(e)?e:e.replace(Gi,`-$&`).toLowerCase()}),Xi=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(Ki,function(e,t,n){return ta={name:t,styles:n,next:ta},t})}return Hi[e]!==1&&!qi(e)&&typeof t==`number`&&t!==0?t+`px`:t},Zi=`Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.`;function Qi(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return ta={name:i.name,styles:i.styles,next:ta},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)ta={name:o.name,styles:o.styles,next:ta},o=o.next;return a.styles+`;`}return $i(e,t,n);case`function`:if(e!==void 0){var s=ta,c=n(e);return ta=s,Qi(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function $i(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Qi(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:Ji(s)&&(r+=Yi(a)+`:`+Xi(a,s)+`;`)}else{if(a===`NO_COMPONENT_SELECTOR`&&Wi)throw Error(Zi);if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)Ji(o[c])&&(r+=Yi(a)+`:`+Xi(a,o[c])+`;`);else{var l=Qi(e,t,o);switch(a){case`animation`:case`animationName`:r+=Yi(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}}return r}var ea=/label:\s*([^\s;{]+)\s*(;|$)/g,ta;function na(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;ta=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=Qi(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=Qi(n,t,e[o]),r&&(i+=a[o]);ea.lastIndex=0;for(var s=``,c;(c=ea.exec(i))!==null;)s+=`-`+c[1];return{name:Vi(i)+s,styles:i,next:ta}}function ra(e,t){let n=(0,g.default)(e,t);return process.env.NODE_ENV===`production`?n:(...t)=>{let r=typeof e==`string`?`"${e}"`:`component`;return t.length===0?console.error([`MUI: Seems like you called \`styled(${r})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
283
+ `)):t.some(e=>e===void 0)&&console.error(`MUI: the styled(${r})(...args) API requires all its args to be defined.`),n(...t)}}function ia(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}var aa=[];function oa(e){return aa[0]=e,na(aa)}var sa=typeof window<`u`?f.useLayoutEffect:f.useEffect,ca=f.createContext();function la({value:e,...t}){return(0,m.jsx)(ca.Provider,{value:e??!0,...t})}process.env.NODE_ENV!==`production`&&(la.propTypes={children:W.default.node,value:W.default.bool});var ua=()=>f.useContext(ca)??!1,da=f.createContext(void 0);function fa({value:e,children:t}){return(0,m.jsx)(da.Provider,{value:e,children:t})}process.env.NODE_ENV!==`production`&&(fa.propTypes={children:W.default.node,value:W.default.object});function pa(e){let{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;let i=t.components[n];return i.defaultProps?yn(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?yn(i,r,t.components.mergeClassNameAndStyle):r}function ma({props:e,name:t}){return pa({props:e,name:t,theme:{components:f.useContext(da)}})}var ha=0;function ga(e){let[t,n]=f.useState(e),r=e||t;return f.useEffect(()=>{t??(ha+=1,n(`mui-${ha}`))},[t]),r}var _a={...f}.useId;function va(e){if(_a!==void 0){let t=_a();return e??t}return ga(e)}var ya={borderRadius:4};function ba(e=8,t=yr({spacing:e})){if(e.mui)return e;let n=(...e)=>(process.env.NODE_ENV!==`production`&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(e.length===0?[1]:e).map(e=>{let n=t(e);return typeof n==`number`?`${n}px`:n}).join(` `));return n.mui=!0,n}function xa(e,t){let n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!=`function`)return{};let r=n.getColorSchemeSelector(e);return r===`&`?t:((r.includes(`data-`)||r.includes(`.`))&&(r=`*:where(${r.replace(/\s*&$/,``)}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Sa(e={},...t){let{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,s=Xn(n),c=ba(i),l=Hn({breakpoints:s,direction:`ltr`,components:{},palette:{mode:`light`,...r},spacing:c,shape:{...ya,...a}},o);return l=Jn(l),l.applyStyles=xa,l=t.reduce((e,t)=>Hn(e,t),l),l.unstable_sxConfig={...Zr,...o?.unstable_sxConfig},l.unstable_sx=function(e){return ei({sx:e,theme:this})},l.internal_cache={},l}var Ca=(e,t,n,r=[])=>{let i=e;t.forEach((e,a)=>{a===t.length-1?Array.isArray(i)?i[Number(e)]=n:i&&typeof i==`object`&&(i[e]=n):i&&typeof i==`object`&&(i[e]||(i[e]=r.includes(e)?[]:{}),i=i[e])})},wa=(e,t,n)=>{function r(e,i=[],a=[]){Object.entries(e).forEach(([e,o])=>{(!n||n&&!n([...i,e]))&&o!=null&&(typeof o==`object`&&Object.keys(o).length>0?r(o,[...i,e],Array.isArray(o)?[...a,e]:a):t([...i,e],o,a))})}r(e)},Ta=(e,t)=>typeof t==`number`?[`lineHeight`,`fontWeight`,`opacity`,`zIndex`].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes(`opacity`)?t:`${t}px`:t;function Ea(e,t){let{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return wa(e,(e,t,s)=>{if((typeof t==`string`||typeof t==`number`)&&(!r||!r(e,t))){let r=`--${n?`${n}-`:``}${e.join(`-`)}`,c=Ta(e,t);Object.assign(i,{[r]:c}),Ca(a,e,`var(${r})`,s),Ca(o,e,`var(${r}, ${c})`,s)}},e=>e[0]===`vars`),{css:i,vars:a,varsWithDefaults:o}}function Da(e,t={}){let{getSelector:n=_,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:s,defaultColorScheme:c=`light`,...l}=e,{vars:u,css:d,varsWithDefaults:f}=Ea(l,t),p=f,m={},{[c]:h,...g}=o;if(Object.entries(g||{}).forEach(([e,n])=>{let{vars:r,css:i,varsWithDefaults:a}=Ea(n,t);p=Hn(p,a),m[e]={css:i,vars:r}}),h){let{css:e,vars:n,varsWithDefaults:r}=Ea(h,t);p=Hn(p,r),m[c]={css:e,vars:n}}function _(t,n){let r=i;if(i===`class`&&(r=`.%s`),i===`data`&&(r=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(r=`[${i}="%s"]`),t){if(r===`media`)return e.defaultColorScheme===t?`:root`:{[`@media (prefers-color-scheme: ${o[t]?.palette?.mode||t})`]:{":root":n}};if(r)return e.defaultColorScheme===t?`:root, ${r.replace(`%s`,String(t))}`:r.replace(`%s`,String(t))}return`:root`}return{vars:p,generateThemeVars:()=>{let e={...u};return Object.entries(m).forEach(([,{vars:t}])=>{e=Hn(e,t)}),e},generateStyleSheets:()=>{let t=[],i=e.defaultColorScheme||`light`;function s(e,n){Object.keys(n).length&&t.push(typeof e==`string`?{[e]:{...n}}:e)}s(n(void 0,{...d}),d);let{[i]:c,...l}=m;if(c){let{css:e}=c,t=o[i]?.palette?.mode,a=!r&&t?{colorScheme:t,...e}:{...e};s(n(i,{...a}),a)}return Object.entries(l).forEach(([e,{css:t}])=>{let i=o[e]?.palette?.mode,a=!r&&i?{colorScheme:i,...t}:{...t};s(n(e,{...a}),a)}),a&&t.push({":root":{"--__l-threshold":`0.7`,"--__l":`clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)`,"--__a":`clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)`}}),t}}}function Oa(e){let t={};return Object.entries(e).forEach(e=>{let[n,r]=e;typeof r==`object`&&(t[n]=`${r.fontStyle?`${r.fontStyle} `:``}${r.fontVariant?`${r.fontVariant} `:``}${r.fontWeight?`${r.fontWeight} `:``}${r.fontStretch?`${r.fontStretch} `:``}${r.fontSize||``}${r.lineHeight?`/${r.lineHeight} `:``}${r.fontFamily||``}`)}),t}function ka(e){return function(t){return e===`media`?(process.env.NODE_ENV!==`production`&&t!==`light`&&t!==`dark`&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${t}'.`),`@media (prefers-color-scheme: ${t})`):e?e.startsWith(`data-`)&&!e.includes(`%s`)?`[${e}="${t}"] &`:e===`class`?`.${t} &`:e===`data`?`[data-${t}] &`:`${e.replace(`%s`,t)} &`:`&`}}var Aa={active:`active`,checked:`checked`,completed:`completed`,disabled:`disabled`,error:`error`,expanded:`expanded`,focused:`focused`,focusVisible:`focusVisible`,open:`open`,readOnly:`readOnly`,required:`required`,selected:`selected`};function ja(e,t,n=`Mui`){let r=Aa[t];return r?`${n}-${r}`:`${Sn.generate(e)}-${t}`}function Ma(e,t){return{toolbar:{minHeight:56,[e.up(`xs`)]:{"@media (orientation: landscape)":{minHeight:48}},[e.up(`sm`)]:{minHeight:64}},...t}}function Na(e){return Math.round(e*1e5)/1e5}var Pa={textTransform:`uppercase`},Fa=`"Roboto", "Helvetica", "Arial", sans-serif`;function Ia(e,t){let{fontFamily:n=Fa,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:c=16,allVariants:l,pxToRem:u,...d}=typeof t==`function`?t(e):t;process.env.NODE_ENV!==`production`&&(typeof r!=`number`&&console.error("MUI: `fontSize` is required to be a number."),typeof c!=`number`&&console.error("MUI: `htmlFontSize` is required to be a number."));let f=r/14,p=u||(e=>`${e/c*f}rem`),m=(e,t,r,i,a)=>({fontFamily:n,fontWeight:e,fontSize:p(t),lineHeight:r,...n===Fa?{letterSpacing:`${Na(i/t)}em`}:{},...a,...l});return Hn({htmlFontSize:c,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(o,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(o,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(o,14,1.75,.4,Pa),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,Pa),inherit:{fontFamily:`inherit`,fontWeight:`inherit`,fontSize:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},d,{clone:!1})}var La=.2,Ra=.14,za=.12;function X(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${La})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Ra})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${za})`].join(`,`)}var Ba=[`none`,X(0,2,1,-1,0,1,1,0,0,1,3,0),X(0,3,1,-2,0,2,2,0,0,1,5,0),X(0,3,3,-2,0,3,4,0,0,1,8,0),X(0,2,4,-1,0,4,5,0,0,1,10,0),X(0,3,5,-1,0,5,8,0,0,1,14,0),X(0,3,5,-1,0,6,10,0,0,1,18,0),X(0,4,5,-2,0,7,10,1,0,2,16,1),X(0,5,5,-3,0,8,10,1,0,3,14,2),X(0,5,6,-3,0,9,12,1,0,3,16,2),X(0,6,6,-3,0,10,14,1,0,4,18,3),X(0,6,7,-4,0,11,15,1,0,4,20,3),X(0,7,8,-4,0,12,17,2,0,5,22,4),X(0,7,8,-4,0,13,19,2,0,5,24,4),X(0,7,9,-4,0,14,21,2,0,5,26,4),X(0,8,9,-5,0,15,22,2,0,6,28,5),X(0,8,10,-5,0,16,24,2,0,6,30,5),X(0,8,11,-5,0,17,26,2,0,6,32,5),X(0,9,11,-5,0,18,28,2,0,7,34,6),X(0,9,12,-6,0,19,29,2,0,7,36,6),X(0,10,13,-6,0,20,31,3,0,8,38,7),X(0,10,13,-6,0,21,33,3,0,8,40,7),X(0,10,14,-6,0,22,35,3,0,8,42,7),X(0,11,14,-7,0,23,36,3,0,9,44,8),X(0,11,15,-7,0,24,38,3,0,9,46,8)],Va={easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`,easeOut:`cubic-bezier(0.0, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,sharp:`cubic-bezier(0.4, 0, 0.6, 1)`},Ha={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Ua(e){return`${Math.round(e)}ms`}function Wa(e){if(!e)return 0;let t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Ga(e){let t={...Va,...e.easing},n={...Ha,...e.duration};return{getAutoHeightDuration:Wa,create:(e=[`all`],r={})=>{let{duration:i=n.standard,easing:a=t.easeInOut,delay:o=0,...s}=r;if(process.env.NODE_ENV!==`production`){let t=e=>typeof e==`string`,n=e=>!Number.isNaN(parseFloat(e));!t(e)&&!Array.isArray(e)&&console.error(`MUI: Argument "props" must be a string or Array.`),!n(i)&&!t(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),t(a)||console.error(`MUI: Argument "easing" must be a string.`),!n(o)&&!t(o)&&console.error(`MUI: Argument "delay" must be a number or a string.`),typeof r!=`object`&&console.error([`MUI: Secong argument of transition.create must be an object.`,"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
284
+ `)),Object.keys(s).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(s).join(`,`)}].`)}return(Array.isArray(e)?e:[e]).map(e=>`${e} ${typeof i==`string`?i:Ua(i)} ${a} ${typeof o==`string`?o:Ua(o)}`).join(`,`)},...e,easing:t,duration:n}}var Ka={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function qa(e){return Bn(e)||e===void 0||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||Array.isArray(e)}function Ja(e={}){let t={...e};function n(e){let t=Object.entries(e);for(let r=0;r<t.length;r++){let[i,a]=t[r];!qa(a)||i.startsWith(`unstable_`)||i.startsWith(`internal_`)?delete e[i]:Bn(a)&&(e[i]={...a},n(e[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
285
285
 
286
286
  const theme = ${JSON.stringify(t,null,2)};
287
287
 
288
288
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
289
289
  theme.transitions = createTransitions(theme.transitions || {});
290
290
 
291
- export default theme;`}function Za(e){return typeof e==`number`?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}var Qa=e=>{if(!Number.isNaN(+e))return+e;let t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let e=0;e<t.length;e+=1)n+=+t[e];return n};function $a(e){Object.assign(e,{alpha(t,n){let r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n==`string`?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,`var(--$1Channel)`)} / ${typeof n==`string`?`calc(${n})`:n})`:hi(t,Qa(n))},lighten(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${Za(n)})`:vi(t,n)},darken(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${Za(n)})`:_i(t,n)}})}function eo(e={},...t){let{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:s={},shape:c,colorSpace:l,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw Error(process.env.NODE_ENV===`production`?Tn(22):"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.");let d=Hi({...a,colorSpace:l}),f=wa(e),p=Wn(f,{mixins:Pa(f.breakpoints,r),palette:d,shadows:Ha.slice(),typography:Ra(d,s),transitions:qa(o),zIndex:{...Ja}});if(p=Wn(p,u),p=t.reduce((e,t)=>Wn(e,t),p),process.env.NODE_ENV!==`production`){let e=[`active`,`checked`,`completed`,`disabled`,`error`,`expanded`,`focused`,`focusVisible`,`required`,`selected`],t=(t,n)=>{let r;for(r in t){let i=t[r];if(e.includes(r)&&Object.keys(i).length>0){if(process.env.NODE_ENV!==`production`){let e=Na(``,r);console.error([`MUI: The \`${n}\` component increases the CSS specificity of the \`${r}\` internal state.`,`You can not override it like this: `,JSON.stringify(t,null,2),``,`Instead, you need to use the '&.${e}' syntax:`,JSON.stringify({root:{[`&.${e}`]:i}},null,2),``,`https://mui.com/r/state-classes-guide`].join(`
292
- `))}t[r]={}}}};Object.keys(p.components).forEach(e=>{let n=p.components[e].styleOverrides;n&&e.startsWith(`Mui`)&&t(n,e)})}return p.unstable_sxConfig={...$r,...u?.unstable_sxConfig},p.unstable_sx=function(e){return ni({sx:e,theme:this})},p.toRuntimeSource=Xa,$a(p),p}function to(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}var no=[...Array(25)].map((e,t)=>{if(t===0)return`none`;let n=to(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function ro(e){return{inputPlaceholder:e===`dark`?.5:.42,inputUnderline:e===`dark`?.7:.42,switchTrackDisabled:e===`dark`?.2:.12,switchTrack:e===`dark`?.3:.38}}function io(e){return e===`dark`?no:[]}function ao(e){let{palette:t={mode:`light`},opacity:n,overlays:r,colorSpace:i,...a}=e,o=Hi({...t,colorSpace:i});return{palette:o,opacity:{...ro(o.mode),...n},overlays:r||io(o.mode),...a}}function oo(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]===`palette`&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}var so=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:``}overlays-${n}`),`--${e?`${e}-`:``}palette-AppBar-darkBg`,`--${e?`${e}-`:``}palette-AppBar-darkColor`],co=e=>(t,n)=>{let r=e.rootSelector||`:root`,i=e.colorSchemeSelector,a=i;if(i===`class`&&(a=`.%s`),i===`data`&&(a=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t===`dark`){let i={};return so(e.cssVarPrefix).forEach(e=>{i[e]=n[e],delete n[e]}),a===`media`?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace(`%s`,t)]:i,[`${r}, ${a.replace(`%s`,t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!==`media`)return`${r}, ${a.replace(`%s`,String(t))}`}else if(t){if(a===`media`)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace(`%s`,String(t))}return r};function lo(e,t){t.forEach(t=>{e[t]||(e[t]={})})}function Z(e,t,n){!e[t]&&n&&(e[t]=n)}function uo(e){return typeof e!=`string`||!e.startsWith(`hsl`)?e:fi(e)}function fo(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ui(uo(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
293
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function po(e){return typeof e==`number`?`${e}px`:typeof e==`string`||typeof e==`function`||Array.isArray(e)?e:`8px`}var mo=e=>{try{return e()}catch{}},ho=(e=`mui`)=>(0,h.unstable_createGetCssVar)(e);function go(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;let a=i===`dark`?`dark`:`light`;if(!r){t[i]=ao({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}let{palette:o,...s}=eo({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...ro(a),...n?.opacity},overlays:n?.overlays||io(a)},s}function _o(e={},...t){let{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a=`mui`,nativeColor:o=!1,shouldSkipGeneratingVar:s=oo,colorSchemeSelector:c=n.light&&n.dark?`media`:void 0,rootSelector:l=`:root`,...u}=e,d=Object.keys(n)[0],f=r||(n.light&&d!==`light`?`light`:d),p=ho(a),{[f]:m,light:g,dark:_,...v}=n,y={...v},b=m;if((f===`dark`&&!(`dark`in n)||f===`light`&&!(`light`in n))&&(b=!0),!b)throw Error(process.env.NODE_ENV===`production`?Tn(21,f):`MUI: The \`colorSchemes.${f}\` option is either missing or invalid.`);let x;o&&(x=`oklch`);let S=go(x,y,b,u,f);g&&!y.light&&go(x,y,g,void 0,`light`),_&&!y.dark&&go(x,y,_,void 0,`dark`);let C={defaultColorScheme:f,...S,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:l,getCssVar:p,colorSchemes:y,font:{...Aa(S.typography),...S.font},spacing:po(u.spacing)};Object.keys(C.colorSchemes).forEach(e=>{let t=C.colorSchemes[e].palette,n=e=>{let n=e.split(`-`),r=n[1],i=n[2];return p(e,t[r][i])};t.mode===`light`&&(Z(t.common,`background`,`#fff`),Z(t.common,`onBackground`,`#000`)),t.mode===`dark`&&(Z(t.common,`background`,`#000`),Z(t.common,`onBackground`,`#fff`));function r(e,t,n){if(x){let r;return e===gi&&(r=`transparent ${((1-n)*100).toFixed(0)}%`),e===J&&(r=`#000 ${(n*100).toFixed(0)}%`),e===Y&&(r=`#fff ${(n*100).toFixed(0)}%`),`color-mix(in ${x}, ${t}, ${r})`}return e(t,n)}if(lo(t,[`Alert`,`AppBar`,`Avatar`,`Button`,`Chip`,`FilledInput`,`LinearProgress`,`Skeleton`,`Slider`,`SnackbarContent`,`SpeedDialAction`,`StepConnector`,`StepContent`,`Switch`,`TableCell`,`Tooltip`]),t.mode===`light`){Z(t.Alert,`errorColor`,r(J,o?p(`palette-error-light`):t.error.light,.6)),Z(t.Alert,`infoColor`,r(J,o?p(`palette-info-light`):t.info.light,.6)),Z(t.Alert,`successColor`,r(J,o?p(`palette-success-light`):t.success.light,.6)),Z(t.Alert,`warningColor`,r(J,o?p(`palette-warning-light`):t.warning.light,.6)),Z(t.Alert,`errorFilledBg`,n(`palette-error-main`)),Z(t.Alert,`infoFilledBg`,n(`palette-info-main`)),Z(t.Alert,`successFilledBg`,n(`palette-success-main`)),Z(t.Alert,`warningFilledBg`,n(`palette-warning-main`)),Z(t.Alert,`errorFilledColor`,mo(()=>t.getContrastText(t.error.main))),Z(t.Alert,`infoFilledColor`,mo(()=>t.getContrastText(t.info.main))),Z(t.Alert,`successFilledColor`,mo(()=>t.getContrastText(t.success.main))),Z(t.Alert,`warningFilledColor`,mo(()=>t.getContrastText(t.warning.main))),Z(t.Alert,`errorStandardBg`,r(Y,o?p(`palette-error-light`):t.error.light,.9)),Z(t.Alert,`infoStandardBg`,r(Y,o?p(`palette-info-light`):t.info.light,.9)),Z(t.Alert,`successStandardBg`,r(Y,o?p(`palette-success-light`):t.success.light,.9)),Z(t.Alert,`warningStandardBg`,r(Y,o?p(`palette-warning-light`):t.warning.light,.9)),Z(t.Alert,`errorIconColor`,n(`palette-error-main`)),Z(t.Alert,`infoIconColor`,n(`palette-info-main`)),Z(t.Alert,`successIconColor`,n(`palette-success-main`)),Z(t.Alert,`warningIconColor`,n(`palette-warning-main`)),Z(t.AppBar,`defaultBg`,n(`palette-grey-100`)),Z(t.Avatar,`defaultBg`,n(`palette-grey-400`)),Z(t.Button,`inheritContainedBg`,n(`palette-grey-300`)),Z(t.Button,`inheritContainedHoverBg`,n(`palette-grey-A100`)),Z(t.Chip,`defaultBorder`,n(`palette-grey-400`)),Z(t.Chip,`defaultAvatarColor`,n(`palette-grey-700`)),Z(t.Chip,`defaultIconColor`,n(`palette-grey-700`)),Z(t.FilledInput,`bg`,`rgba(0, 0, 0, 0.06)`),Z(t.FilledInput,`hoverBg`,`rgba(0, 0, 0, 0.09)`),Z(t.FilledInput,`disabledBg`,`rgba(0, 0, 0, 0.12)`),Z(t.LinearProgress,`primaryBg`,r(Y,o?p(`palette-primary-main`):t.primary.main,.62)),Z(t.LinearProgress,`secondaryBg`,r(Y,o?p(`palette-secondary-main`):t.secondary.main,.62)),Z(t.LinearProgress,`errorBg`,r(Y,o?p(`palette-error-main`):t.error.main,.62)),Z(t.LinearProgress,`infoBg`,r(Y,o?p(`palette-info-main`):t.info.main,.62)),Z(t.LinearProgress,`successBg`,r(Y,o?p(`palette-success-main`):t.success.main,.62)),Z(t.LinearProgress,`warningBg`,r(Y,o?p(`palette-warning-light`):t.warning.main,.62)),Z(t.Skeleton,`bg`,x?r(gi,o?p(`palette-text-primary`):t.text.primary,.11):`rgba(${n(`palette-text-primaryChannel`)} / 0.11)`),Z(t.Slider,`primaryTrack`,r(Y,o?p(`palette-primary-main`):t.primary.main,.62)),Z(t.Slider,`secondaryTrack`,r(Y,o?p(`palette-secondary-main`):t.secondary.main,.62)),Z(t.Slider,`errorTrack`,r(Y,o?p(`palette-error-main`):t.error.main,.62)),Z(t.Slider,`infoTrack`,r(Y,o?p(`palette-info-main`):t.info.main,.62)),Z(t.Slider,`successTrack`,r(Y,o?p(`palette-success-main`):t.success.main,.62)),Z(t.Slider,`warningTrack`,r(Y,o?p(`palette-warning-main`):t.warning.main,.62));let e=x?r(J,o?p(`palette-background-default`):t.background.default,.6825):bi(t.background.default,.8);Z(t.SnackbarContent,`bg`,e),Z(t.SnackbarContent,`color`,mo(()=>x?Mi.text.primary:t.getContrastText(e))),Z(t.SpeedDialAction,`fabHoverBg`,bi(t.background.paper,.15)),Z(t.StepConnector,`border`,n(`palette-grey-400`)),Z(t.StepContent,`border`,n(`palette-grey-400`)),Z(t.Switch,`defaultColor`,n(`palette-common-white`)),Z(t.Switch,`defaultDisabledColor`,n(`palette-grey-100`)),Z(t.Switch,`primaryDisabledColor`,r(Y,o?p(`palette-primary-main`):t.primary.main,.62)),Z(t.Switch,`secondaryDisabledColor`,r(Y,o?p(`palette-secondary-main`):t.secondary.main,.62)),Z(t.Switch,`errorDisabledColor`,r(Y,o?p(`palette-error-main`):t.error.main,.62)),Z(t.Switch,`infoDisabledColor`,r(Y,o?p(`palette-info-main`):t.info.main,.62)),Z(t.Switch,`successDisabledColor`,r(Y,o?p(`palette-success-main`):t.success.main,.62)),Z(t.Switch,`warningDisabledColor`,r(Y,o?p(`palette-warning-main`):t.warning.main,.62)),Z(t.TableCell,`border`,r(Y,gi(o?p(`palette-divider`):t.divider,1),.88)),Z(t.Tooltip,`bg`,r(gi,o?p(`palette-grey-700`):t.grey[700],.92))}if(t.mode===`dark`){Z(t.Alert,`errorColor`,r(Y,o?p(`palette-error-light`):t.error.light,.6)),Z(t.Alert,`infoColor`,r(Y,o?p(`palette-info-light`):t.info.light,.6)),Z(t.Alert,`successColor`,r(Y,o?p(`palette-success-light`):t.success.light,.6)),Z(t.Alert,`warningColor`,r(Y,o?p(`palette-warning-light`):t.warning.light,.6)),Z(t.Alert,`errorFilledBg`,n(`palette-error-dark`)),Z(t.Alert,`infoFilledBg`,n(`palette-info-dark`)),Z(t.Alert,`successFilledBg`,n(`palette-success-dark`)),Z(t.Alert,`warningFilledBg`,n(`palette-warning-dark`)),Z(t.Alert,`errorFilledColor`,mo(()=>t.getContrastText(t.error.dark))),Z(t.Alert,`infoFilledColor`,mo(()=>t.getContrastText(t.info.dark))),Z(t.Alert,`successFilledColor`,mo(()=>t.getContrastText(t.success.dark))),Z(t.Alert,`warningFilledColor`,mo(()=>t.getContrastText(t.warning.dark))),Z(t.Alert,`errorStandardBg`,r(J,o?p(`palette-error-light`):t.error.light,.9)),Z(t.Alert,`infoStandardBg`,r(J,o?p(`palette-info-light`):t.info.light,.9)),Z(t.Alert,`successStandardBg`,r(J,o?p(`palette-success-light`):t.success.light,.9)),Z(t.Alert,`warningStandardBg`,r(J,o?p(`palette-warning-light`):t.warning.light,.9)),Z(t.Alert,`errorIconColor`,n(`palette-error-main`)),Z(t.Alert,`infoIconColor`,n(`palette-info-main`)),Z(t.Alert,`successIconColor`,n(`palette-success-main`)),Z(t.Alert,`warningIconColor`,n(`palette-warning-main`)),Z(t.AppBar,`defaultBg`,n(`palette-grey-900`)),Z(t.AppBar,`darkBg`,n(`palette-background-paper`)),Z(t.AppBar,`darkColor`,n(`palette-text-primary`)),Z(t.Avatar,`defaultBg`,n(`palette-grey-600`)),Z(t.Button,`inheritContainedBg`,n(`palette-grey-800`)),Z(t.Button,`inheritContainedHoverBg`,n(`palette-grey-700`)),Z(t.Chip,`defaultBorder`,n(`palette-grey-700`)),Z(t.Chip,`defaultAvatarColor`,n(`palette-grey-300`)),Z(t.Chip,`defaultIconColor`,n(`palette-grey-300`)),Z(t.FilledInput,`bg`,`rgba(255, 255, 255, 0.09)`),Z(t.FilledInput,`hoverBg`,`rgba(255, 255, 255, 0.13)`),Z(t.FilledInput,`disabledBg`,`rgba(255, 255, 255, 0.12)`),Z(t.LinearProgress,`primaryBg`,r(J,o?p(`palette-primary-main`):t.primary.main,.5)),Z(t.LinearProgress,`secondaryBg`,r(J,o?p(`palette-secondary-main`):t.secondary.main,.5)),Z(t.LinearProgress,`errorBg`,r(J,o?p(`palette-error-main`):t.error.main,.5)),Z(t.LinearProgress,`infoBg`,r(J,o?p(`palette-info-main`):t.info.main,.5)),Z(t.LinearProgress,`successBg`,r(J,o?p(`palette-success-main`):t.success.main,.5)),Z(t.LinearProgress,`warningBg`,r(J,o?p(`palette-warning-main`):t.warning.main,.5)),Z(t.Skeleton,`bg`,x?r(gi,o?p(`palette-text-primary`):t.text.primary,.13):`rgba(${n(`palette-text-primaryChannel`)} / 0.13)`),Z(t.Slider,`primaryTrack`,r(J,o?p(`palette-primary-main`):t.primary.main,.5)),Z(t.Slider,`secondaryTrack`,r(J,o?p(`palette-secondary-main`):t.secondary.main,.5)),Z(t.Slider,`errorTrack`,r(J,o?p(`palette-error-main`):t.error.main,.5)),Z(t.Slider,`infoTrack`,r(J,o?p(`palette-info-main`):t.info.main,.5)),Z(t.Slider,`successTrack`,r(J,o?p(`palette-success-main`):t.success.main,.5)),Z(t.Slider,`warningTrack`,r(J,o?p(`palette-warning-light`):t.warning.main,.5));let e=x?r(Y,o?p(`palette-background-default`):t.background.default,.985):bi(t.background.default,.98);Z(t.SnackbarContent,`bg`,e),Z(t.SnackbarContent,`color`,mo(()=>x?Ai.text.primary:t.getContrastText(e))),Z(t.SpeedDialAction,`fabHoverBg`,bi(t.background.paper,.15)),Z(t.StepConnector,`border`,n(`palette-grey-600`)),Z(t.StepContent,`border`,n(`palette-grey-600`)),Z(t.Switch,`defaultColor`,n(`palette-grey-300`)),Z(t.Switch,`defaultDisabledColor`,n(`palette-grey-600`)),Z(t.Switch,`primaryDisabledColor`,r(J,o?p(`palette-primary-main`):t.primary.main,.55)),Z(t.Switch,`secondaryDisabledColor`,r(J,o?p(`palette-secondary-main`):t.secondary.main,.55)),Z(t.Switch,`errorDisabledColor`,r(J,o?p(`palette-error-main`):t.error.main,.55)),Z(t.Switch,`infoDisabledColor`,r(J,o?p(`palette-info-main`):t.info.main,.55)),Z(t.Switch,`successDisabledColor`,r(J,o?p(`palette-success-main`):t.success.main,.55)),Z(t.Switch,`warningDisabledColor`,r(J,o?p(`palette-warning-light`):t.warning.main,.55)),Z(t.TableCell,`border`,r(J,gi(o?p(`palette-divider`):t.divider,1),.68)),Z(t.Tooltip,`bg`,r(gi,o?p(`palette-grey-700`):t.grey[700],.92))}o||(fo(t.background,`default`),fo(t.background,`paper`),fo(t.common,`background`),fo(t.common,`onBackground`),fo(t,`divider`)),Object.keys(t).forEach(e=>{let n=t[e];e!==`tonalOffset`&&!o&&n&&typeof n==`object`&&(n.main&&Z(t[e],`mainChannel`,ui(uo(n.main))),n.light&&Z(t[e],`lightChannel`,ui(uo(n.light))),n.dark&&Z(t[e],`darkChannel`,ui(uo(n.dark))),n.contrastText&&Z(t[e],`contrastTextChannel`,ui(uo(n.contrastText))),e===`text`&&(fo(t[e],`primary`),fo(t[e],`secondary`)),e===`action`&&(n.active&&fo(t[e],`active`),n.selected&&fo(t[e],`selected`)))})}),C=t.reduce((e,t)=>Wn(e,t),C);let ee={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:co(C),enableContrastVars:o},{vars:w,generateThemeVars:T,generateStyleSheets:te}=ka(C,ee);return C.vars=w,Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([e,t])=>{C[e]=t}),C.generateThemeVars=T,C.generateStyleSheets=te,C.generateSpacing=function(){return(0,h.createSpacing)(u.spacing,xr(this))},C.getColorSchemeSelector=ja(c),C.spacing=C.generateSpacing(),C.shouldSkipGeneratingVar=s,C.unstable_sxConfig={...$r,...u?.unstable_sxConfig},C.unstable_sx=function(e){return ni({sx:e,theme:this})},C.internal_cache={},C.toRuntimeSource=Xa,C}function vo(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Hi({...n===!0?{}:n.palette,mode:t})})}function yo(e={},...t){let{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,s=a||`light`,c=i?.[s],l={...i,...n?{[s]:{...typeof c!=`boolean`&&c,palette:n}}:void 0};if(r===!1){if(!(`colorSchemes`in e))return eo(e,...t);let r=n;`palette`in e||l[s]&&(l[s]===!0?s===`dark`&&(r={mode:`dark`}):r=l[s].palette);let i=eo({...e,palette:r},...t);return i.defaultColorScheme=s,i.colorSchemes=l,i.palette.mode===`light`&&(i.colorSchemes.light={...l.light!==!0&&l.light,palette:i.palette},vo(i,`dark`,l.dark)),i.palette.mode===`dark`&&(i.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:i.palette},vo(i,`light`,l.light)),i}return!n&&!(`light`in l)&&s===`light`&&(l.light=!0),_o({...o,colorSchemes:l,defaultColorScheme:s,...typeof r!=`boolean`&&r},...t)}var bo=yo(),xo=`$$material`;function So(e,t=``){return e.displayName||e.name||t}function Co(e,t,n){let r=So(t);return e.displayName||(r===``?n:`${n}(${r})`)}function wo(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`function`)return So(e,`Component`);if(typeof e==`object`)switch(e.$$typeof){case Vn.ForwardRef:return Co(e,e.render,`ForwardRef`);case Vn.Memo:return Co(e,e.type,`memo`);default:return}}}function To(e){let{variants:t,...n}=e,r={variants:t,style:ca(n),isProcessed:!0};return r.style===n||t&&t.forEach(e=>{typeof e.style!=`function`&&(e.style=ca(e.style))}),r}var Eo=wa();function Do(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}function Oo(e,t){return t&&e&&typeof e==`object`&&e.styles&&!e.styles.startsWith(`@layer`)&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function ko(e){return e?(t,n)=>n[e]:null}function Ao(e,t,n){e.theme=Rn(e.theme)?n:e.theme[t]||e.theme}function jo(e,t,n){let r=typeof t==`function`?t(e):t;if(Array.isArray(r))return r.flatMap(t=>jo(e,t,n));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=n?Oo(r.style,n):r.style;else{let{variants:e,...i}=r;t=n?Oo(ca(i),n):i}return Mo(e,r.variants,[t],n)}return r?.isProcessed?n?Oo(ca(r.style),n):r.style:n?Oo(ca(r),n):r}function Mo(e,t,n=[],r=void 0){let i;variantLoop:for(let a=0;a<t.length;a+=1){let o=t[a];if(typeof o.props==`function`){if(i??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(i))continue}else for(let t in o.props)if(e[t]!==o.props[t]&&e.ownerState?.[t]!==o.props[t])continue variantLoop;typeof o.style==`function`?(i??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?Oo(ca(o.style(i)),r):o.style(i))):n.push(r?Oo(ca(o.style),r):o.style)}return n}function No(e={}){let{themeId:t,defaultTheme:n=Eo,rootShouldForwardProp:r=Do,slotShouldForwardProp:i=Do}=e;function a(e){Ao(e,t,n)}return(e,t={})=>{oa(e,e=>e.filter(e=>e!==ni));let{name:n,slot:o,skipVariantsResolver:s,skipSx:c,overridesResolver:l=ko(Lo(o)),...u}=t,d=n&&n.startsWith(`Mui`)||o?`components`:`custom`,f=s===void 0?o&&o!==`Root`&&o!==`root`||!1:s,p=c||!1,m=Do;o===`Root`||o===`root`?m=r:o?m=i:Io(e)&&(m=void 0);let h=aa(e,{shouldForwardProp:m,label:Fo(n,o),...u}),g=e=>{if(e.__emotion_real===e)return e;if(typeof e==`function`)return function(t){return jo(t,e,t.theme.modularCssLayers?d:void 0)};if(Hn(e)){let t=To(e);return function(e){return t.variants?jo(e,t,e.theme.modularCssLayers?d:void 0):e.theme.modularCssLayers?Oo(t.style,d):t.style}}return e},_=(...t)=>{let r=[],i=t.map(g),s=[];if(r.push(a),n&&l&&s.push(function(e){let t=e.theme.components?.[n]?.styleOverrides;if(!t)return null;let r={};for(let n in t)r[n]=jo(e,t[n],e.theme.modularCssLayers?`theme`:void 0);return l(e,r)}),n&&!f&&s.push(function(e){let t=e.theme?.components?.[n]?.variants;return t?Mo(e,t,[],e.theme.modularCssLayers?`theme`:void 0):null}),p||s.push(ni),Array.isArray(i[0])){let e=i.shift(),t=Array(r.length).fill(``),n=Array(s.length).fill(``),a;a=[...t,...e,...n],a.raw=[...t,...e.raw,...n],r.unshift(a)}let c=h(...r,...i,...s);return e.muiName&&(c.muiName=e.muiName),process.env.NODE_ENV!==`production`&&(c.displayName=Po(n,o,e)),c};return h.withConfig&&(_.withConfig=h.withConfig),_}}function Po(e,t,n){return e?`${e}${En(t||``)}`:`Styled(${wo(n)})`}function Fo(e,t){let n;return process.env.NODE_ENV!==`production`&&e&&(n=`${e}-${Lo(t||`Root`)}`),n}function Io(e){return typeof e==`string`&&e.charCodeAt(0)>96}function Lo(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Ro(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}var zo=e=>Ro(e)&&e!==`classes`,Q=No({themeId:xo,defaultTheme:bo,rootShouldForwardProp:zo}),Bo=h.unstable_memoTheme;function Vo(e){return(0,m.jsx)(ma,{...e})}process.env.NODE_ENV!==`production`&&(Vo.propTypes={children:W.default.node,value:W.default.object.isRequired});function Ho(e){return ga(e)}function Uo(e,t,n=`Mui`){let r={};return t.forEach(t=>{r[t]=Na(e,t,n)}),r}function Wo(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var Go=Wo;function Ko(e){return e&&e.ownerDocument||document}var qo=ba;function Jo(e){let{controlled:t,default:n,name:r,state:i=`value`}=e,{current:a}=f.useRef(t!==void 0),[o,s]=f.useState(n),c=a?t:o;if(process.env.NODE_ENV!==`production`){f.useEffect(()=>{a!==(t!==void 0)&&console.error([`MUI: A component is changing the ${a?``:`un`}controlled ${i} state of ${r} to be ${a?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
291
+ export default theme;`}function Ya(e){return typeof e==`number`?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}var Xa=e=>{if(!Number.isNaN(+e))return+e;let t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let e=0;e<t.length;e+=1)n+=+t[e];return n};function Za(e){Object.assign(e,{alpha(t,n){let r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n==`string`?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,`var(--$1Channel)`)} / ${typeof n==`string`?`calc(${n})`:n})`:pi(t,Xa(n))},lighten(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${Ya(n)})`:gi(t,n)},darken(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${Ya(n)})`:hi(t,n)}})}function Qa(e={},...t){let{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:s={},shape:c,colorSpace:l,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw Error(process.env.NODE_ENV===`production`?Cn(22):"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.");let d=Bi({...a,colorSpace:l}),f=Sa(e),p=Hn(f,{mixins:Ma(f.breakpoints,r),palette:d,shadows:Ba.slice(),typography:Ia(d,s),transitions:Ga(o),zIndex:{...Ka}});if(p=Hn(p,u),p=t.reduce((e,t)=>Hn(e,t),p),process.env.NODE_ENV!==`production`){let e=[`active`,`checked`,`completed`,`disabled`,`error`,`expanded`,`focused`,`focusVisible`,`required`,`selected`],t=(t,n)=>{let r;for(r in t){let i=t[r];if(e.includes(r)&&Object.keys(i).length>0){if(process.env.NODE_ENV!==`production`){let e=ja(``,r);console.error([`MUI: The \`${n}\` component increases the CSS specificity of the \`${r}\` internal state.`,`You can not override it like this: `,JSON.stringify(t,null,2),``,`Instead, you need to use the '&.${e}' syntax:`,JSON.stringify({root:{[`&.${e}`]:i}},null,2),``,`https://mui.com/r/state-classes-guide`].join(`
292
+ `))}t[r]={}}}};Object.keys(p.components).forEach(e=>{let n=p.components[e].styleOverrides;n&&e.startsWith(`Mui`)&&t(n,e)})}return p.unstable_sxConfig={...Zr,...u?.unstable_sxConfig},p.unstable_sx=function(e){return ei({sx:e,theme:this})},p.toRuntimeSource=Ja,Za(p),p}function $a(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}var eo=[...Array(25)].map((e,t)=>{if(t===0)return`none`;let n=$a(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function to(e){return{inputPlaceholder:e===`dark`?.5:.42,inputUnderline:e===`dark`?.7:.42,switchTrackDisabled:e===`dark`?.2:.12,switchTrack:e===`dark`?.3:.38}}function no(e){return e===`dark`?eo:[]}function ro(e){let{palette:t={mode:`light`},opacity:n,overlays:r,colorSpace:i,...a}=e,o=Bi({...t,colorSpace:i});return{palette:o,opacity:{...to(o.mode),...n},overlays:r||no(o.mode),...a}}function io(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]===`palette`&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}var ao=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:``}overlays-${n}`),`--${e?`${e}-`:``}palette-AppBar-darkBg`,`--${e?`${e}-`:``}palette-AppBar-darkColor`],oo=e=>(t,n)=>{let r=e.rootSelector||`:root`,i=e.colorSchemeSelector,a=i;if(i===`class`&&(a=`.%s`),i===`data`&&(a=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t===`dark`){let i={};return ao(e.cssVarPrefix).forEach(e=>{i[e]=n[e],delete n[e]}),a===`media`?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace(`%s`,t)]:i,[`${r}, ${a.replace(`%s`,t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!==`media`)return`${r}, ${a.replace(`%s`,String(t))}`}else if(t){if(a===`media`)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace(`%s`,String(t))}return r};function so(e,t){t.forEach(t=>{e[t]||(e[t]={})})}function Z(e,t,n){!e[t]&&n&&(e[t]=n)}function co(e){return typeof e!=`string`||!e.startsWith(`hsl`)?e:ui(e)}function lo(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ci(co(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
293
+ To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function uo(e){return typeof e==`number`?`${e}px`:typeof e==`string`||typeof e==`function`||Array.isArray(e)?e:`8px`}var fo=e=>{try{return e()}catch{}},po=(e=`mui`)=>(0,h.unstable_createGetCssVar)(e);function mo(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;let a=i===`dark`?`dark`:`light`;if(!r){t[i]=ro({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}let{palette:o,...s}=Qa({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...to(a),...n?.opacity},overlays:n?.overlays||no(a)},s}function ho(e={},...t){let{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a=`mui`,nativeColor:o=!1,shouldSkipGeneratingVar:s=io,colorSchemeSelector:c=n.light&&n.dark?`media`:void 0,rootSelector:l=`:root`,...u}=e,d=Object.keys(n)[0],f=r||(n.light&&d!==`light`?`light`:d),p=po(a),{[f]:m,light:g,dark:_,...v}=n,y={...v},b=m;if((f===`dark`&&!(`dark`in n)||f===`light`&&!(`light`in n))&&(b=!0),!b)throw Error(process.env.NODE_ENV===`production`?Cn(21,f):`MUI: The \`colorSchemes.${f}\` option is either missing or invalid.`);let x;o&&(x=`oklch`);let S=mo(x,y,b,u,f);g&&!y.light&&mo(x,y,g,void 0,`light`),_&&!y.dark&&mo(x,y,_,void 0,`dark`);let C={defaultColorScheme:f,...S,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:l,getCssVar:p,colorSchemes:y,font:{...Oa(S.typography),...S.font},spacing:uo(u.spacing)};Object.keys(C.colorSchemes).forEach(e=>{let t=C.colorSchemes[e].palette,n=e=>{let n=e.split(`-`),r=n[1],i=n[2];return p(e,t[r][i])};t.mode===`light`&&(Z(t.common,`background`,`#fff`),Z(t.common,`onBackground`,`#000`)),t.mode===`dark`&&(Z(t.common,`background`,`#000`),Z(t.common,`onBackground`,`#fff`));function r(e,t,n){if(x){let r;return e===mi&&(r=`transparent ${((1-n)*100).toFixed(0)}%`),e===J&&(r=`#000 ${(n*100).toFixed(0)}%`),e===Y&&(r=`#fff ${(n*100).toFixed(0)}%`),`color-mix(in ${x}, ${t}, ${r})`}return e(t,n)}if(so(t,[`Alert`,`AppBar`,`Avatar`,`Button`,`Chip`,`FilledInput`,`LinearProgress`,`Skeleton`,`Slider`,`SnackbarContent`,`SpeedDialAction`,`StepConnector`,`StepContent`,`Switch`,`TableCell`,`Tooltip`]),t.mode===`light`){Z(t.Alert,`errorColor`,r(J,o?p(`palette-error-light`):t.error.light,.6)),Z(t.Alert,`infoColor`,r(J,o?p(`palette-info-light`):t.info.light,.6)),Z(t.Alert,`successColor`,r(J,o?p(`palette-success-light`):t.success.light,.6)),Z(t.Alert,`warningColor`,r(J,o?p(`palette-warning-light`):t.warning.light,.6)),Z(t.Alert,`errorFilledBg`,n(`palette-error-main`)),Z(t.Alert,`infoFilledBg`,n(`palette-info-main`)),Z(t.Alert,`successFilledBg`,n(`palette-success-main`)),Z(t.Alert,`warningFilledBg`,n(`palette-warning-main`)),Z(t.Alert,`errorFilledColor`,fo(()=>t.getContrastText(t.error.main))),Z(t.Alert,`infoFilledColor`,fo(()=>t.getContrastText(t.info.main))),Z(t.Alert,`successFilledColor`,fo(()=>t.getContrastText(t.success.main))),Z(t.Alert,`warningFilledColor`,fo(()=>t.getContrastText(t.warning.main))),Z(t.Alert,`errorStandardBg`,r(Y,o?p(`palette-error-light`):t.error.light,.9)),Z(t.Alert,`infoStandardBg`,r(Y,o?p(`palette-info-light`):t.info.light,.9)),Z(t.Alert,`successStandardBg`,r(Y,o?p(`palette-success-light`):t.success.light,.9)),Z(t.Alert,`warningStandardBg`,r(Y,o?p(`palette-warning-light`):t.warning.light,.9)),Z(t.Alert,`errorIconColor`,n(`palette-error-main`)),Z(t.Alert,`infoIconColor`,n(`palette-info-main`)),Z(t.Alert,`successIconColor`,n(`palette-success-main`)),Z(t.Alert,`warningIconColor`,n(`palette-warning-main`)),Z(t.AppBar,`defaultBg`,n(`palette-grey-100`)),Z(t.Avatar,`defaultBg`,n(`palette-grey-400`)),Z(t.Button,`inheritContainedBg`,n(`palette-grey-300`)),Z(t.Button,`inheritContainedHoverBg`,n(`palette-grey-A100`)),Z(t.Chip,`defaultBorder`,n(`palette-grey-400`)),Z(t.Chip,`defaultAvatarColor`,n(`palette-grey-700`)),Z(t.Chip,`defaultIconColor`,n(`palette-grey-700`)),Z(t.FilledInput,`bg`,`rgba(0, 0, 0, 0.06)`),Z(t.FilledInput,`hoverBg`,`rgba(0, 0, 0, 0.09)`),Z(t.FilledInput,`disabledBg`,`rgba(0, 0, 0, 0.12)`),Z(t.LinearProgress,`primaryBg`,r(Y,o?p(`palette-primary-main`):t.primary.main,.62)),Z(t.LinearProgress,`secondaryBg`,r(Y,o?p(`palette-secondary-main`):t.secondary.main,.62)),Z(t.LinearProgress,`errorBg`,r(Y,o?p(`palette-error-main`):t.error.main,.62)),Z(t.LinearProgress,`infoBg`,r(Y,o?p(`palette-info-main`):t.info.main,.62)),Z(t.LinearProgress,`successBg`,r(Y,o?p(`palette-success-main`):t.success.main,.62)),Z(t.LinearProgress,`warningBg`,r(Y,o?p(`palette-warning-light`):t.warning.main,.62)),Z(t.Skeleton,`bg`,x?r(mi,o?p(`palette-text-primary`):t.text.primary,.11):`rgba(${n(`palette-text-primaryChannel`)} / 0.11)`),Z(t.Slider,`primaryTrack`,r(Y,o?p(`palette-primary-main`):t.primary.main,.62)),Z(t.Slider,`secondaryTrack`,r(Y,o?p(`palette-secondary-main`):t.secondary.main,.62)),Z(t.Slider,`errorTrack`,r(Y,o?p(`palette-error-main`):t.error.main,.62)),Z(t.Slider,`infoTrack`,r(Y,o?p(`palette-info-main`):t.info.main,.62)),Z(t.Slider,`successTrack`,r(Y,o?p(`palette-success-main`):t.success.main,.62)),Z(t.Slider,`warningTrack`,r(Y,o?p(`palette-warning-main`):t.warning.main,.62));let e=x?r(J,o?p(`palette-background-default`):t.background.default,.6825):vi(t.background.default,.8);Z(t.SnackbarContent,`bg`,e),Z(t.SnackbarContent,`color`,fo(()=>x?Ai.text.primary:t.getContrastText(e))),Z(t.SpeedDialAction,`fabHoverBg`,vi(t.background.paper,.15)),Z(t.StepConnector,`border`,n(`palette-grey-400`)),Z(t.StepContent,`border`,n(`palette-grey-400`)),Z(t.Switch,`defaultColor`,n(`palette-common-white`)),Z(t.Switch,`defaultDisabledColor`,n(`palette-grey-100`)),Z(t.Switch,`primaryDisabledColor`,r(Y,o?p(`palette-primary-main`):t.primary.main,.62)),Z(t.Switch,`secondaryDisabledColor`,r(Y,o?p(`palette-secondary-main`):t.secondary.main,.62)),Z(t.Switch,`errorDisabledColor`,r(Y,o?p(`palette-error-main`):t.error.main,.62)),Z(t.Switch,`infoDisabledColor`,r(Y,o?p(`palette-info-main`):t.info.main,.62)),Z(t.Switch,`successDisabledColor`,r(Y,o?p(`palette-success-main`):t.success.main,.62)),Z(t.Switch,`warningDisabledColor`,r(Y,o?p(`palette-warning-main`):t.warning.main,.62)),Z(t.TableCell,`border`,r(Y,mi(o?p(`palette-divider`):t.divider,1),.88)),Z(t.Tooltip,`bg`,r(mi,o?p(`palette-grey-700`):t.grey[700],.92))}if(t.mode===`dark`){Z(t.Alert,`errorColor`,r(Y,o?p(`palette-error-light`):t.error.light,.6)),Z(t.Alert,`infoColor`,r(Y,o?p(`palette-info-light`):t.info.light,.6)),Z(t.Alert,`successColor`,r(Y,o?p(`palette-success-light`):t.success.light,.6)),Z(t.Alert,`warningColor`,r(Y,o?p(`palette-warning-light`):t.warning.light,.6)),Z(t.Alert,`errorFilledBg`,n(`palette-error-dark`)),Z(t.Alert,`infoFilledBg`,n(`palette-info-dark`)),Z(t.Alert,`successFilledBg`,n(`palette-success-dark`)),Z(t.Alert,`warningFilledBg`,n(`palette-warning-dark`)),Z(t.Alert,`errorFilledColor`,fo(()=>t.getContrastText(t.error.dark))),Z(t.Alert,`infoFilledColor`,fo(()=>t.getContrastText(t.info.dark))),Z(t.Alert,`successFilledColor`,fo(()=>t.getContrastText(t.success.dark))),Z(t.Alert,`warningFilledColor`,fo(()=>t.getContrastText(t.warning.dark))),Z(t.Alert,`errorStandardBg`,r(J,o?p(`palette-error-light`):t.error.light,.9)),Z(t.Alert,`infoStandardBg`,r(J,o?p(`palette-info-light`):t.info.light,.9)),Z(t.Alert,`successStandardBg`,r(J,o?p(`palette-success-light`):t.success.light,.9)),Z(t.Alert,`warningStandardBg`,r(J,o?p(`palette-warning-light`):t.warning.light,.9)),Z(t.Alert,`errorIconColor`,n(`palette-error-main`)),Z(t.Alert,`infoIconColor`,n(`palette-info-main`)),Z(t.Alert,`successIconColor`,n(`palette-success-main`)),Z(t.Alert,`warningIconColor`,n(`palette-warning-main`)),Z(t.AppBar,`defaultBg`,n(`palette-grey-900`)),Z(t.AppBar,`darkBg`,n(`palette-background-paper`)),Z(t.AppBar,`darkColor`,n(`palette-text-primary`)),Z(t.Avatar,`defaultBg`,n(`palette-grey-600`)),Z(t.Button,`inheritContainedBg`,n(`palette-grey-800`)),Z(t.Button,`inheritContainedHoverBg`,n(`palette-grey-700`)),Z(t.Chip,`defaultBorder`,n(`palette-grey-700`)),Z(t.Chip,`defaultAvatarColor`,n(`palette-grey-300`)),Z(t.Chip,`defaultIconColor`,n(`palette-grey-300`)),Z(t.FilledInput,`bg`,`rgba(255, 255, 255, 0.09)`),Z(t.FilledInput,`hoverBg`,`rgba(255, 255, 255, 0.13)`),Z(t.FilledInput,`disabledBg`,`rgba(255, 255, 255, 0.12)`),Z(t.LinearProgress,`primaryBg`,r(J,o?p(`palette-primary-main`):t.primary.main,.5)),Z(t.LinearProgress,`secondaryBg`,r(J,o?p(`palette-secondary-main`):t.secondary.main,.5)),Z(t.LinearProgress,`errorBg`,r(J,o?p(`palette-error-main`):t.error.main,.5)),Z(t.LinearProgress,`infoBg`,r(J,o?p(`palette-info-main`):t.info.main,.5)),Z(t.LinearProgress,`successBg`,r(J,o?p(`palette-success-main`):t.success.main,.5)),Z(t.LinearProgress,`warningBg`,r(J,o?p(`palette-warning-main`):t.warning.main,.5)),Z(t.Skeleton,`bg`,x?r(mi,o?p(`palette-text-primary`):t.text.primary,.13):`rgba(${n(`palette-text-primaryChannel`)} / 0.13)`),Z(t.Slider,`primaryTrack`,r(J,o?p(`palette-primary-main`):t.primary.main,.5)),Z(t.Slider,`secondaryTrack`,r(J,o?p(`palette-secondary-main`):t.secondary.main,.5)),Z(t.Slider,`errorTrack`,r(J,o?p(`palette-error-main`):t.error.main,.5)),Z(t.Slider,`infoTrack`,r(J,o?p(`palette-info-main`):t.info.main,.5)),Z(t.Slider,`successTrack`,r(J,o?p(`palette-success-main`):t.success.main,.5)),Z(t.Slider,`warningTrack`,r(J,o?p(`palette-warning-light`):t.warning.main,.5));let e=x?r(Y,o?p(`palette-background-default`):t.background.default,.985):vi(t.background.default,.98);Z(t.SnackbarContent,`bg`,e),Z(t.SnackbarContent,`color`,fo(()=>x?Oi.text.primary:t.getContrastText(e))),Z(t.SpeedDialAction,`fabHoverBg`,vi(t.background.paper,.15)),Z(t.StepConnector,`border`,n(`palette-grey-600`)),Z(t.StepContent,`border`,n(`palette-grey-600`)),Z(t.Switch,`defaultColor`,n(`palette-grey-300`)),Z(t.Switch,`defaultDisabledColor`,n(`palette-grey-600`)),Z(t.Switch,`primaryDisabledColor`,r(J,o?p(`palette-primary-main`):t.primary.main,.55)),Z(t.Switch,`secondaryDisabledColor`,r(J,o?p(`palette-secondary-main`):t.secondary.main,.55)),Z(t.Switch,`errorDisabledColor`,r(J,o?p(`palette-error-main`):t.error.main,.55)),Z(t.Switch,`infoDisabledColor`,r(J,o?p(`palette-info-main`):t.info.main,.55)),Z(t.Switch,`successDisabledColor`,r(J,o?p(`palette-success-main`):t.success.main,.55)),Z(t.Switch,`warningDisabledColor`,r(J,o?p(`palette-warning-light`):t.warning.main,.55)),Z(t.TableCell,`border`,r(J,mi(o?p(`palette-divider`):t.divider,1),.68)),Z(t.Tooltip,`bg`,r(mi,o?p(`palette-grey-700`):t.grey[700],.92))}o||(lo(t.background,`default`),lo(t.background,`paper`),lo(t.common,`background`),lo(t.common,`onBackground`),lo(t,`divider`)),Object.keys(t).forEach(e=>{let n=t[e];e!==`tonalOffset`&&!o&&n&&typeof n==`object`&&(n.main&&Z(t[e],`mainChannel`,ci(co(n.main))),n.light&&Z(t[e],`lightChannel`,ci(co(n.light))),n.dark&&Z(t[e],`darkChannel`,ci(co(n.dark))),n.contrastText&&Z(t[e],`contrastTextChannel`,ci(co(n.contrastText))),e===`text`&&(lo(t[e],`primary`),lo(t[e],`secondary`)),e===`action`&&(n.active&&lo(t[e],`active`),n.selected&&lo(t[e],`selected`)))})}),C=t.reduce((e,t)=>Hn(e,t),C);let ee={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:oo(C),enableContrastVars:o},{vars:w,generateThemeVars:T,generateStyleSheets:te}=Da(C,ee);return C.vars=w,Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([e,t])=>{C[e]=t}),C.generateThemeVars=T,C.generateStyleSheets=te,C.generateSpacing=function(){return(0,h.createSpacing)(u.spacing,yr(this))},C.getColorSchemeSelector=ka(c),C.spacing=C.generateSpacing(),C.shouldSkipGeneratingVar=s,C.unstable_sxConfig={...Zr,...u?.unstable_sxConfig},C.unstable_sx=function(e){return ei({sx:e,theme:this})},C.internal_cache={},C.toRuntimeSource=Ja,C}function go(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Bi({...n===!0?{}:n.palette,mode:t})})}function _o(e={},...t){let{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,s=a||`light`,c=i?.[s],l={...i,...n?{[s]:{...typeof c!=`boolean`&&c,palette:n}}:void 0};if(r===!1){if(!(`colorSchemes`in e))return Qa(e,...t);let r=n;`palette`in e||l[s]&&(l[s]===!0?s===`dark`&&(r={mode:`dark`}):r=l[s].palette);let i=Qa({...e,palette:r},...t);return i.defaultColorScheme=s,i.colorSchemes=l,i.palette.mode===`light`&&(i.colorSchemes.light={...l.light!==!0&&l.light,palette:i.palette},go(i,`dark`,l.dark)),i.palette.mode===`dark`&&(i.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:i.palette},go(i,`light`,l.light)),i}return!n&&!(`light`in l)&&s===`light`&&(l.light=!0),ho({...o,colorSchemes:l,defaultColorScheme:s,...typeof r!=`boolean`&&r},...t)}var vo=_o(),yo=`$$material`;function bo(e,t=``){return e.displayName||e.name||t}function xo(e,t,n){let r=bo(t);return e.displayName||(r===``?n:`${n}(${r})`)}function So(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`function`)return bo(e,`Component`);if(typeof e==`object`)switch(e.$$typeof){case zn.ForwardRef:return xo(e,e.render,`ForwardRef`);case zn.Memo:return xo(e,e.type,`memo`);default:return}}}function Co(e){let{variants:t,...n}=e,r={variants:t,style:oa(n),isProcessed:!0};return r.style===n||t&&t.forEach(e=>{typeof e.style!=`function`&&(e.style=oa(e.style))}),r}var wo=Sa();function To(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}function Eo(e,t){return t&&e&&typeof e==`object`&&e.styles&&!e.styles.startsWith(`@layer`)&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Do(e){return e?(t,n)=>n[e]:null}function Oo(e,t,n){e.theme=In(e.theme)?n:e.theme[t]||e.theme}function ko(e,t,n){let r=typeof t==`function`?t(e):t;if(Array.isArray(r))return r.flatMap(t=>ko(e,t,n));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=n?Eo(r.style,n):r.style;else{let{variants:e,...i}=r;t=n?Eo(oa(i),n):i}return Ao(e,r.variants,[t],n)}return r?.isProcessed?n?Eo(oa(r.style),n):r.style:n?Eo(oa(r),n):r}function Ao(e,t,n=[],r=void 0){let i;variantLoop:for(let a=0;a<t.length;a+=1){let o=t[a];if(typeof o.props==`function`){if(i??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(i))continue}else for(let t in o.props)if(e[t]!==o.props[t]&&e.ownerState?.[t]!==o.props[t])continue variantLoop;typeof o.style==`function`?(i??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?Eo(oa(o.style(i)),r):o.style(i))):n.push(r?Eo(oa(o.style),r):o.style)}return n}function jo(e={}){let{themeId:t,defaultTheme:n=wo,rootShouldForwardProp:r=To,slotShouldForwardProp:i=To}=e;function a(e){Oo(e,t,n)}return(e,t={})=>{ia(e,e=>e.filter(e=>e!==ei));let{name:n,slot:o,skipVariantsResolver:s,skipSx:c,overridesResolver:l=Do(Fo(o)),...u}=t,d=n&&n.startsWith(`Mui`)||o?`components`:`custom`,f=s===void 0?o&&o!==`Root`&&o!==`root`||!1:s,p=c||!1,m=To;o===`Root`||o===`root`?m=r:o?m=i:Po(e)&&(m=void 0);let h=ra(e,{shouldForwardProp:m,label:No(n,o),...u}),g=e=>{if(e.__emotion_real===e)return e;if(typeof e==`function`)return function(t){return ko(t,e,t.theme.modularCssLayers?d:void 0)};if(Bn(e)){let t=Co(e);return function(e){return t.variants?ko(e,t,e.theme.modularCssLayers?d:void 0):e.theme.modularCssLayers?Eo(t.style,d):t.style}}return e},_=(...t)=>{let r=[],i=t.map(g),s=[];if(r.push(a),n&&l&&s.push(function(e){let t=e.theme.components?.[n]?.styleOverrides;if(!t)return null;let r={};for(let n in t)r[n]=ko(e,t[n],e.theme.modularCssLayers?`theme`:void 0);return l(e,r)}),n&&!f&&s.push(function(e){let t=e.theme?.components?.[n]?.variants;return t?Ao(e,t,[],e.theme.modularCssLayers?`theme`:void 0):null}),p||s.push(ei),Array.isArray(i[0])){let e=i.shift(),t=Array(r.length).fill(``),n=Array(s.length).fill(``),a;a=[...t,...e,...n],a.raw=[...t,...e.raw,...n],r.unshift(a)}let c=h(...r,...i,...s);return e.muiName&&(c.muiName=e.muiName),process.env.NODE_ENV!==`production`&&(c.displayName=Mo(n,o,e)),c};return h.withConfig&&(_.withConfig=h.withConfig),_}}function Mo(e,t,n){return e?`${e}${wn(t||``)}`:`Styled(${So(n)})`}function No(e,t){let n;return process.env.NODE_ENV!==`production`&&e&&(n=`${e}-${Fo(t||`Root`)}`),n}function Po(e){return typeof e==`string`&&e.charCodeAt(0)>96}function Fo(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Io(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}var Lo=e=>Io(e)&&e!==`classes`,Q=jo({themeId:yo,defaultTheme:vo,rootShouldForwardProp:Lo}),Ro=h.unstable_memoTheme;function zo(e){return(0,m.jsx)(fa,{...e})}process.env.NODE_ENV!==`production`&&(zo.propTypes={children:W.default.node,value:W.default.object.isRequired});function Bo(e){return ma(e)}function Vo(e,t,n=`Mui`){let r={};return t.forEach(t=>{r[t]=ja(e,t,n)}),r}function Ho(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var Uo=Ho;function Wo(e){return e&&e.ownerDocument||document}var Go=va;function Ko(e){let{controlled:t,default:n,name:r,state:i=`value`}=e,{current:a}=f.useRef(t!==void 0),[o,s]=f.useState(n),c=a?t:o;if(process.env.NODE_ENV!==`production`){f.useEffect(()=>{a!==(t!==void 0)&&console.error([`MUI: A component is changing the ${a?``:`un`}controlled ${i} state of ${r} to be ${a?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
294
294
  `))},[i,r,t]);let{current:e}=f.useRef(n);f.useEffect(()=>{!a&&JSON.stringify(n)!==JSON.stringify(e)&&console.error([`MUI: A component is changing the default ${i} state of an uncontrolled ${r} after being initialized. To suppress this warning opt to use a controlled ${r}.`].join(`
295
- `))},[JSON.stringify(n)])}return[c,f.useCallback(e=>{a||s(e)},[])]}function Yo(e){let t=f.useRef(e);return la(()=>{t.current=e}),f.useRef((...e)=>(0,t.current)(...e)).current}var Xo=Yo;function Zo(...e){let t=f.useRef(void 0),n=f.useCallback(t=>{let n=e.map(e=>{if(e==null)return null;if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}});return()=>{n.forEach(e=>e?.())}},e);return f.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Qo=Zo;function $o(e,t){let n=e.charCodeAt(2);return e[0]===`o`&&e[1]===`n`&&n>=65&&n<=90&&typeof t==`function`}var es=W.default.oneOfType([W.default.func,W.default.object]);function ts(e,t){return process.env.NODE_ENV===`production`?()=>null:function(...n){return e(...n)||t(...n)}}function ns(e){let{prototype:t={}}=e;return!!t.isReactComponent}function rs(e,t,n,r,i){let a=e[t],o=i||t;if(a==null||typeof window>`u`)return null;let s;return typeof a==`function`&&!ns(a)&&(s=`Did you accidentally provide a plain function component instead?`),a===f.Fragment&&(s=`Did you accidentally provide a React.Fragment instead?`),s===void 0?null:Error(`Invalid ${r} \`${o}\` supplied to \`${n}\`. Expected an element type that can hold a ref. ${s} For more information see https://mui.com/r/caveat-with-refs-guide`)}var is=ts(W.default.elementType,rs);function as(e){try{return e.matches(`:focus-visible`)}catch{process.env.NODE_ENV!==`production`&&!window.navigator.userAgent.includes(`jsdom`)&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.",`Some components rely on this feature to work properly.`].join(`
296
- `))}return!1}function os(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return f.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}var ss={};function cs(e){let{nativeButton:t,nativeButtonProp:n,internalNativeButton:r=t,allowInferredHostMismatch:i=!1,disabled:a,type:o,hasFormAction:s=!1,tabIndex:c=0,focusableWhenDisabled:l,stopEventPropagation:u=!1,onBeforeKeyDown:d,onBeforeKeyUp:p}=e,m=f.useRef(null),h=l===!0,g=os({focusableWhenDisabled:h,disabled:a,isNativeButton:t,tabIndex:c});process.env.NODE_ENV!==`production`&&f.useEffect(()=>{let e=m.current;if(e==null)return;let t=e.tagName===`BUTTON`;if(n!==void 0){n&&!t&&console.error("MUI: A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Render a real <button> or set `nativeButton` to `false`."),!n&&t&&console.error("MUI: A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while additionally applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Render a non-<button> such as <div>, or set `nativeButton` to `true`.");return}i||(r&&!t&&console.error("MUI: A component rendering a native <button> resolved to a non-<button> element, but `nativeButton={false}` was not specified and the resolved root is a non-<button>. When rendering a custom component, set `nativeButton={false}` explicitly or render a <button> element."),!r&&t&&console.error("MUI: A component that acts as a non-native button resolved to a native <button> element, but `nativeButton={true}` was not specified. When rendering a custom component, set `nativeButton={true}` explicitly or render a non-<button> element."))},[i,r,n]);let _=f.useCallback(()=>{let e=m.current;return e==null?t:e.tagName===`BUTTON`?!0:!!(e.tagName===`A`&&e.href)},[t]),v=f.useMemo(()=>{let e=h?{}:{tabIndex:a?-1:c};return t?(e.type=o===void 0&&!s?`button`:o,h||(e.disabled=a)):(e.role=`button`,!h&&a&&(e[`aria-disabled`]=a)),h?{...e,...g}:e},[a,h,g,s,t,c,o]);return{getButtonProps:f.useCallback((e=ss)=>{let{onClick:t,onKeyDown:n,onKeyUp:r,...i}=e,o=e=>{if(u&&e.stopPropagation(),a){e.preventDefault();return}t?.(e)},s=e=>{if(h&&g.onKeyDown(e),!a&&(d?.(e),n?.(e),!(e.target!==e.currentTarget||_()))){if(e.key===` `){e.preventDefault();return}e.key===`Enter`&&(e.preventDefault(),e.currentTarget.click())}},c=e=>{a||(p?.(e),r?.(e),e.target===e.currentTarget&&!_()&&e.key===` `&&!e.defaultPrevented&&e.currentTarget.click())};return{...v,...i,onClick:o,onKeyDown:s,onKeyUp:c}},[v,a,h,g,_,d,p,u]),rootRef:m}}var ls={};function us(e,t){let n=f.useRef(ls);return n.current===ls&&(n.current=e(t)),n}var ds=class e{static create(){return new e}static use(){let t=us(e.create).current,[n,r]=f.useState(!1);return t.shouldMount=n,t.setShouldMount=r,f.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=ps(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function fs(){return ds.use()}function ps(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function ms(){return ms=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ms.apply(null,arguments)}function hs(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gs(e,t){return gs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gs(e,t)}function _s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gs(e,t)}var vs=d.default.createContext(null);function ys(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function bs(e,t){var n=function(e){return t&&(0,d.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&d.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function xs(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function Ss(e,t,n){return n[t]==null?e.props[t]:n[t]}function Cs(e,t){return bs(e.children,function(n){return(0,d.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:Ss(n,`appear`,e),enter:Ss(n,`enter`,e),exit:Ss(n,`exit`,e)})})}function ws(e,t,n){var r=bs(e.children),i=xs(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,d.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,d.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,d.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:Ss(o,`exit`,e),enter:Ss(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,d.cloneElement)(o,{in:!1}):c&&s&&(0,d.isValidElement)(l)&&(i[a]=(0,d.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:Ss(o,`exit`,e),enter:Ss(o,`enter`,e)}))}}),i}var Ts=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Es={component:`div`,childFactory:function(e){return e}},Ds=function(e){_s(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(ys(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?Cs(e,r):ws(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=bs(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=ms({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=hs(e,[`component`,`childFactory`]),i=this.state.contextValue,a=Ts(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?d.default.createElement(vs.Provider,{value:i},a):d.default.createElement(vs.Provider,{value:i},d.default.createElement(t,r,a))},t}(d.default.Component);Ds.propTypes=process.env.NODE_ENV===`production`?{}:{component:W.default.any,children:W.default.node,appear:W.default.bool,enter:W.default.bool,exit:W.default.bool,childFactory:W.default.func},Ds.defaultProps=Es;var Os=[];function ks(e){f.useEffect(e,Os)}var As=class e{static create(){return new e}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear};function js(){let e=us(As.create).current;return ks(e.disposeEffect),e}function Ms(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=f.useState(!1),p=U(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},g=U(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),f.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,m.jsx)(`span`,{className:p,style:h,children:(0,m.jsx)(`span`,{className:g})})}process.env.NODE_ENV!==`production`&&(Ms.propTypes={classes:W.default.object.isRequired,className:W.default.string,in:W.default.bool,onExited:W.default.func,pulsate:W.default.bool,rippleSize:W.default.number,rippleX:W.default.number,rippleY:W.default.number,timeout:W.default.number.isRequired});var Ns=Uo(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),Ps=550,Fs=h.keyframes`
295
+ `))},[JSON.stringify(n)])}return[c,f.useCallback(e=>{a||s(e)},[])]}function qo(e){let t=f.useRef(e);return sa(()=>{t.current=e}),f.useRef((...e)=>(0,t.current)(...e)).current}var Jo=qo;function Yo(...e){let t=f.useRef(void 0),n=f.useCallback(t=>{let n=e.map(e=>{if(e==null)return null;if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}});return()=>{n.forEach(e=>e?.())}},e);return f.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Xo=Yo;function Zo(e,t){let n=e.charCodeAt(2);return e[0]===`o`&&e[1]===`n`&&n>=65&&n<=90&&typeof t==`function`}var Qo=W.default.oneOfType([W.default.func,W.default.object]);function $o(e,t){return process.env.NODE_ENV===`production`?()=>null:function(...n){return e(...n)||t(...n)}}function es(e){let{prototype:t={}}=e;return!!t.isReactComponent}function ts(e,t,n,r,i){let a=e[t],o=i||t;if(a==null||typeof window>`u`)return null;let s;return typeof a==`function`&&!es(a)&&(s=`Did you accidentally provide a plain function component instead?`),a===f.Fragment&&(s=`Did you accidentally provide a React.Fragment instead?`),s===void 0?null:Error(`Invalid ${r} \`${o}\` supplied to \`${n}\`. Expected an element type that can hold a ref. ${s} For more information see https://mui.com/r/caveat-with-refs-guide`)}var ns=$o(W.default.elementType,ts);function rs(e){try{return e.matches(`:focus-visible`)}catch{process.env.NODE_ENV!==`production`&&!window.navigator.userAgent.includes(`jsdom`)&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.",`Some components rely on this feature to work properly.`].join(`
296
+ `))}return!1}function is(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return f.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}var as={};function os(e){let{nativeButton:t,nativeButtonProp:n,internalNativeButton:r=t,allowInferredHostMismatch:i=!1,disabled:a,type:o,hasFormAction:s=!1,tabIndex:c=0,focusableWhenDisabled:l,stopEventPropagation:u=!1,onBeforeKeyDown:d,onBeforeKeyUp:p}=e,m=f.useRef(null),h=l===!0,g=is({focusableWhenDisabled:h,disabled:a,isNativeButton:t,tabIndex:c});process.env.NODE_ENV!==`production`&&f.useEffect(()=>{let e=m.current;if(e==null)return;let t=e.tagName===`BUTTON`;if(n!==void 0){n&&!t&&console.error("MUI: A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Render a real <button> or set `nativeButton` to `false`."),!n&&t&&console.error("MUI: A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while additionally applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Render a non-<button> such as <div>, or set `nativeButton` to `true`.");return}i||(r&&!t&&console.error("MUI: A component rendering a native <button> resolved to a non-<button> element, but `nativeButton={false}` was not specified and the resolved root is a non-<button>. When rendering a custom component, set `nativeButton={false}` explicitly or render a <button> element."),!r&&t&&console.error("MUI: A component that acts as a non-native button resolved to a native <button> element, but `nativeButton={true}` was not specified. When rendering a custom component, set `nativeButton={true}` explicitly or render a non-<button> element."))},[i,r,n]);let _=f.useCallback(()=>{let e=m.current;return e==null?t:e.tagName===`BUTTON`?!0:!!(e.tagName===`A`&&e.href)},[t]),v=f.useMemo(()=>{let e=h?{}:{tabIndex:a?-1:c};return t?(e.type=o===void 0&&!s?`button`:o,h||(e.disabled=a)):(e.role=`button`,!h&&a&&(e[`aria-disabled`]=a)),h?{...e,...g}:e},[a,h,g,s,t,c,o]);return{getButtonProps:f.useCallback((e=as)=>{let{onClick:t,onKeyDown:n,onKeyUp:r,...i}=e,o=e=>{if(u&&e.stopPropagation(),a){e.preventDefault();return}t?.(e)},s=e=>{if(h&&g.onKeyDown(e),!a&&(d?.(e),n?.(e),!(e.target!==e.currentTarget||_()))){if(e.key===` `){e.preventDefault();return}e.key===`Enter`&&(e.preventDefault(),e.currentTarget.click())}},c=e=>{a||(p?.(e),r?.(e),e.target===e.currentTarget&&!_()&&e.key===` `&&!e.defaultPrevented&&e.currentTarget.click())};return{...v,...i,onClick:o,onKeyDown:s,onKeyUp:c}},[v,a,h,g,_,d,p,u]),rootRef:m}}var ss={};function cs(e,t){let n=f.useRef(ss);return n.current===ss&&(n.current=e(t)),n}var ls=class e{static create(){return new e}static use(){let t=cs(e.create).current,[n,r]=f.useState(!1);return t.shouldMount=n,t.setShouldMount=r,f.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=ds(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function us(){return ls.use()}function ds(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fs.apply(null,arguments)}function ps(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ms(e,t){return ms=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ms(e,t)}function hs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ms(e,t)}var gs=d.default.createContext(null);function _s(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function vs(e,t){var n=function(e){return t&&(0,d.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&d.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function ys(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function bs(e,t,n){return n[t]==null?e.props[t]:n[t]}function xs(e,t){return vs(e.children,function(n){return(0,d.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:bs(n,`appear`,e),enter:bs(n,`enter`,e),exit:bs(n,`exit`,e)})})}function Ss(e,t,n){var r=vs(e.children),i=ys(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,d.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,d.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,d.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:bs(o,`exit`,e),enter:bs(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,d.cloneElement)(o,{in:!1}):c&&s&&(0,d.isValidElement)(l)&&(i[a]=(0,d.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:bs(o,`exit`,e),enter:bs(o,`enter`,e)}))}}),i}var Cs=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},ws={component:`div`,childFactory:function(e){return e}},Ts=function(e){hs(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(_s(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?xs(e,r):Ss(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=vs(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=fs({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=ps(e,[`component`,`childFactory`]),i=this.state.contextValue,a=Cs(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?d.default.createElement(gs.Provider,{value:i},a):d.default.createElement(gs.Provider,{value:i},d.default.createElement(t,r,a))},t}(d.default.Component);Ts.propTypes=process.env.NODE_ENV===`production`?{}:{component:W.default.any,children:W.default.node,appear:W.default.bool,enter:W.default.bool,exit:W.default.bool,childFactory:W.default.func},Ts.defaultProps=ws;var Es=[];function Ds(e){f.useEffect(e,Es)}var Os=class e{static create(){return new e}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear};function ks(){let e=cs(Os.create).current;return Ds(e.disposeEffect),e}function As(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=f.useState(!1),p=U(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},g=U(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),f.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,m.jsx)(`span`,{className:p,style:h,children:(0,m.jsx)(`span`,{className:g})})}process.env.NODE_ENV!==`production`&&(As.propTypes={classes:W.default.object.isRequired,className:W.default.string,in:W.default.bool,onExited:W.default.func,pulsate:W.default.bool,rippleSize:W.default.number,rippleX:W.default.number,rippleY:W.default.number,timeout:W.default.number.isRequired});var js=Vo(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),Ms=550,Ns=h.keyframes`
297
297
  0% {
298
298
  transform: scale(0);
299
299
  opacity: 0.1;
@@ -303,7 +303,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
303
303
  transform: scale(1);
304
304
  opacity: 0.3;
305
305
  }
306
- `,Is=h.keyframes`
306
+ `,Ps=h.keyframes`
307
307
  0% {
308
308
  opacity: 1;
309
309
  }
@@ -311,7 +311,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
311
311
  100% {
312
312
  opacity: 0;
313
313
  }
314
- `,Ls=h.keyframes`
314
+ `,Fs=h.keyframes`
315
315
  0% {
316
316
  transform: scale(1);
317
317
  }
@@ -323,23 +323,23 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
323
323
  100% {
324
324
  transform: scale(1);
325
325
  }
326
- `,Rs=Q(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),zs=Q(Ms,{name:`MuiTouchRipple`,slot:`Ripple`})`
326
+ `,Is=Q(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),Ls=Q(As,{name:`MuiTouchRipple`,slot:`Ripple`})`
327
327
  opacity: 0;
328
328
  position: absolute;
329
329
 
330
- &.${Ns.rippleVisible} {
330
+ &.${js.rippleVisible} {
331
331
  opacity: 0.3;
332
332
  transform: scale(1);
333
- animation-name: ${Fs};
334
- animation-duration: ${Ps}ms;
333
+ animation-name: ${Ns};
334
+ animation-duration: ${Ms}ms;
335
335
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
336
336
  }
337
337
 
338
- &.${Ns.ripplePulsate} {
338
+ &.${js.ripplePulsate} {
339
339
  animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
340
340
  }
341
341
 
342
- & .${Ns.child} {
342
+ & .${js.child} {
343
343
  opacity: 1;
344
344
  display: block;
345
345
  width: 100%;
@@ -348,25 +348,25 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
348
348
  background-color: currentColor;
349
349
  }
350
350
 
351
- & .${Ns.childLeaving} {
351
+ & .${js.childLeaving} {
352
352
  opacity: 0;
353
- animation-name: ${Is};
354
- animation-duration: ${Ps}ms;
353
+ animation-name: ${Ps};
354
+ animation-duration: ${Ms}ms;
355
355
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
356
356
  }
357
357
 
358
- & .${Ns.childPulsate} {
358
+ & .${js.childPulsate} {
359
359
  position: absolute;
360
360
  /* @noflip */
361
361
  left: 0px;
362
362
  top: 0;
363
- animation-name: ${Ls};
363
+ animation-name: ${Fs};
364
364
  animation-duration: 2500ms;
365
365
  animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
366
366
  animation-iteration-count: infinite;
367
367
  animation-delay: 200ms;
368
368
  }
369
- `,Bs=f.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=Ho({props:e,name:`MuiTouchRipple`}),[o,s]=f.useState([]),c=f.useRef(0),l=f.useRef(null);f.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=f.useRef(!1),d=js(),p=f.useRef(null),h=f.useRef(null),g=f.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,m.jsx)(zs,{classes:{ripple:U(r.ripple,Ns.ripple),rippleVisible:U(r.rippleVisible,Ns.rippleVisible),ripplePulsate:U(r.ripplePulsate,Ns.ripplePulsate),child:U(r.child,Ns.child),childLeaving:U(r.childLeaving,Ns.childLeaving),childPulsate:U(r.childPulsate,Ns.childPulsate)},timeout:Ps,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),_=f.useCallback((e={},t={},r=()=>{})=>{let{pulsate:i=!1,center:a=n||t.pulsate,fakeElement:o=!1}=t;if(e?.type===`mousedown`&&u.current){u.current=!1;return}e?.type===`touchstart`&&(u.current=!0);let s=o?null:h.current,c=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0},l,f,m;if(a||e===void 0||e.clientX===0&&e.clientY===0||!e.clientX&&!e.touches)l=Math.round(c.width/2),f=Math.round(c.height/2);else{let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-c.left),f=Math.round(n-c.top)}if(a)m=Math.sqrt((2*c.width**2+c.height**2)/3),m%2==0&&(m+=1);else{let e=Math.max(Math.abs((s?s.clientWidth:0)-l),l)*2+2,t=Math.max(Math.abs((s?s.clientHeight:0)-f),f)*2+2;m=Math.sqrt(e**2+t**2)}e?.touches?p.current===null&&(p.current=()=>{g({pulsate:i,rippleX:l,rippleY:f,rippleSize:m,cb:r})},d.start(80,()=>{p.current&&=(p.current(),null)})):g({pulsate:i,rippleX:l,rippleY:f,rippleSize:m,cb:r})},[n,g,d]),v=f.useCallback(()=>{_({},{pulsate:!0})},[_]),y=f.useCallback((e,t)=>{if(d.clear(),e?.type===`touchend`&&p.current){p.current(),p.current=null,d.start(0,()=>{y(e,t)});return}p.current=null,s(e=>e.length>0?e.slice(1):e),l.current=t},[d]);return f.useImperativeHandle(t,()=>({pulsate:v,start:_,stop:y}),[v,_,y]),(0,m.jsx)(Rs,{className:U(Ns.root,r.root,i),ref:h,...a,children:(0,m.jsx)(Ds,{component:null,exit:!0,children:o})})});process.env.NODE_ENV!==`production`&&(Bs.propTypes={center:W.default.bool,classes:W.default.object,className:W.default.string});function Vs(e){return Na(`MuiButtonBase`,e)}var Hs=Uo(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]),Us=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,suppressFocusVisible:i,classes:a}=e,o=Sn({root:[`root`,t&&`disabled`,n&&!i&&`focusVisible`]},Vs,a);return n&&!i&&r&&(o.root+=` ${r}`),o},Ws=Q(`button`,{name:`MuiButtonBase`,slot:`Root`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,boxSizing:`border-box`,WebkitTapHighlightColor:`transparent`,backgroundColor:`transparent`,outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:`pointer`,userSelect:`none`,verticalAlign:`middle`,MozAppearance:`none`,WebkitAppearance:`none`,textDecoration:`none`,color:`inherit`,"&::-moz-focus-inner":{borderStyle:`none`},[`&.${Hs.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),Gs=f.forwardRef(function(e,t){let n=Ho({props:e,name:`MuiButtonBase`}),{action:r,centerRipple:i=!1,children:a,className:o,component:s=`button`,disabled:c=!1,disableRipple:l=!1,disableTouchRipple:u=!1,focusRipple:d=!1,focusVisibleClassName:p,focusableWhenDisabled:h,suppressFocusVisible:g=!1,internalNativeButton:_,LinkComponent:v=`a`,nativeButton:y,onBlur:b,onClick:x,onContextMenu:S,onDragLeave:C,onFocus:ee,onFocusVisible:w,onKeyDown:T,onKeyUp:te,onMouseDown:E,onMouseLeave:D,onMouseUp:O,onTouchEnd:ne,onTouchMove:k,onTouchStart:A,tabIndex:j=0,TouchRippleProps:M,touchRippleRef:re,type:N,...P}=n,ie=!!(P.href||P.to),F=!!P.formAction,ae=s;ae===`button`&&ie&&(ae=v);let oe=typeof ae==`string`?ae===`button`:_??!1,I=y??oe,L=fs(),se=Qo(L.ref,re),[ce,R]=f.useState(!1);(c||g)&&ce&&R(!1);let le=Xo(e=>{d&&!e.repeat&&ce&&e.key===` `&&L.stop(e,()=>{L.start(e)})}),ue=Xo(e=>{d&&e.key===` `&&ce&&!e.defaultPrevented&&L.stop(e,()=>{L.pulsate(e)})}),{getButtonProps:de,rootRef:z}=cs({nativeButton:I,nativeButtonProp:y,internalNativeButton:oe,allowInferredHostMismatch:ie||typeof ae==`string`,disabled:c,type:N,hasFormAction:F,tabIndex:j,onBeforeKeyDown:le,onBeforeKeyUp:ue}),{onClick:fe,onKeyDown:pe,onKeyUp:me,...he}=de({onClick:x,onKeyDown:T,onKeyUp:te});f.useImperativeHandle(r,()=>({focusVisible:()=>{R(!0),z.current.focus()}}),[z]);let ge=L.shouldMount&&!l&&!c;f.useEffect(()=>{ce&&d&&!l&&L.pulsate()},[l,d,ce,L]);let _e=Ks(L,`start`,E,u),ve=Ks(L,`stop`,S,u),ye=Ks(L,`stop`,C,u),be=Ks(L,`stop`,O,u),xe=Ks(L,`stop`,e=>{ce&&e.preventDefault(),D&&D(e)},u),Se=Ks(L,`start`,A,u),Ce=Ks(L,`stop`,ne,u),we=Ks(L,`stop`,k,u),Te=Ks(L,`stop`,e=>{as(e.target)||R(!1),b&&b(e)},!1),Ee=Xo(e=>{z.current||=e.currentTarget,!g&&as(e.target)&&(R(!0),w&&w(e)),ee&&ee(e)}),De={};ie&&(De.tabIndex=c?-1:j,c&&(De[`aria-disabled`]=c),De.type=N);let Oe=Qo(t,z),ke={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,suppressFocusVisible:g,tabIndex:j,focusVisible:ce},Ae=Us(ke);return(0,m.jsxs)(Ws,{as:ae,className:U(Ae.root,o),ownerState:ke,onBlur:Te,onClick:fe,onContextMenu:ve,onFocus:Ee,onKeyDown:pe,onKeyUp:me,onMouseDown:_e,onMouseLeave:xe,onMouseUp:be,onDragLeave:ye,onTouchEnd:Ce,onTouchMove:we,onTouchStart:Se,ref:Oe,...ie?De:he,...P,children:[a,ge?(0,m.jsx)(Bs,{ref:se,center:i,...M}):null]})});function Ks(e,t,n,r=!1){return Xo(i=>(n&&n(i),r||e[t](i),!0))}process.env.NODE_ENV!==`production`&&(Gs.propTypes={action:es,centerRipple:W.default.bool,children:W.default.node,classes:W.default.object,className:W.default.string,component:is,disabled:W.default.bool,disableRipple:W.default.bool,disableTouchRipple:W.default.bool,focusRipple:W.default.bool,focusVisibleClassName:W.default.string,formAction:W.default.oneOfType([W.default.func,W.default.string]),href:W.default.any,LinkComponent:W.default.elementType,nativeButton:W.default.bool,onBlur:W.default.func,onClick:W.default.func,onContextMenu:W.default.func,onDragLeave:W.default.func,onFocus:W.default.func,onFocusVisible:W.default.func,onKeyDown:W.default.func,onKeyUp:W.default.func,onMouseDown:W.default.func,onMouseLeave:W.default.func,onMouseUp:W.default.func,onTouchEnd:W.default.func,onTouchMove:W.default.func,onTouchStart:W.default.func,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),tabIndex:W.default.number,TouchRippleProps:W.default.object,touchRippleRef:W.default.oneOfType([W.default.func,W.default.shape({current:W.default.shape({pulsate:W.default.func.isRequired,start:W.default.func.isRequired,stop:W.default.func.isRequired})})]),type:W.default.string});function qs(e){return typeof e.main==`string`}function Js(e,t=[]){if(!qs(e))return!1;for(let n of t)if(!e.hasOwnProperty(n)||typeof e[n]!=`string`)return!1;return!0}function Ys(e=[]){return([,t])=>t&&Js(t,e)}function Xs(e){return Na(`MuiCircularProgress`,e)}Uo(`MuiCircularProgress`,[`root`,`determinate`,`indeterminate`,`colorPrimary`,`colorSecondary`,`svg`,`track`,`circle`,`circleDisableShrink`]);var Zs=44,Qs=h.keyframes`
369
+ `,Rs=f.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=Bo({props:e,name:`MuiTouchRipple`}),[o,s]=f.useState([]),c=f.useRef(0),l=f.useRef(null);f.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=f.useRef(!1),d=ks(),p=f.useRef(null),h=f.useRef(null),g=f.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,m.jsx)(Ls,{classes:{ripple:U(r.ripple,js.ripple),rippleVisible:U(r.rippleVisible,js.rippleVisible),ripplePulsate:U(r.ripplePulsate,js.ripplePulsate),child:U(r.child,js.child),childLeaving:U(r.childLeaving,js.childLeaving),childPulsate:U(r.childPulsate,js.childPulsate)},timeout:Ms,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),_=f.useCallback((e={},t={},r=()=>{})=>{let{pulsate:i=!1,center:a=n||t.pulsate,fakeElement:o=!1}=t;if(e?.type===`mousedown`&&u.current){u.current=!1;return}e?.type===`touchstart`&&(u.current=!0);let s=o?null:h.current,c=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0},l,f,m;if(a||e===void 0||e.clientX===0&&e.clientY===0||!e.clientX&&!e.touches)l=Math.round(c.width/2),f=Math.round(c.height/2);else{let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-c.left),f=Math.round(n-c.top)}if(a)m=Math.sqrt((2*c.width**2+c.height**2)/3),m%2==0&&(m+=1);else{let e=Math.max(Math.abs((s?s.clientWidth:0)-l),l)*2+2,t=Math.max(Math.abs((s?s.clientHeight:0)-f),f)*2+2;m=Math.sqrt(e**2+t**2)}e?.touches?p.current===null&&(p.current=()=>{g({pulsate:i,rippleX:l,rippleY:f,rippleSize:m,cb:r})},d.start(80,()=>{p.current&&=(p.current(),null)})):g({pulsate:i,rippleX:l,rippleY:f,rippleSize:m,cb:r})},[n,g,d]),v=f.useCallback(()=>{_({},{pulsate:!0})},[_]),y=f.useCallback((e,t)=>{if(d.clear(),e?.type===`touchend`&&p.current){p.current(),p.current=null,d.start(0,()=>{y(e,t)});return}p.current=null,s(e=>e.length>0?e.slice(1):e),l.current=t},[d]);return f.useImperativeHandle(t,()=>({pulsate:v,start:_,stop:y}),[v,_,y]),(0,m.jsx)(Is,{className:U(js.root,r.root,i),ref:h,...a,children:(0,m.jsx)(Ts,{component:null,exit:!0,children:o})})});process.env.NODE_ENV!==`production`&&(Rs.propTypes={center:W.default.bool,classes:W.default.object,className:W.default.string});function zs(e){return ja(`MuiButtonBase`,e)}var Bs=Vo(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]),Vs=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,suppressFocusVisible:i,classes:a}=e,o=bn({root:[`root`,t&&`disabled`,n&&!i&&`focusVisible`]},zs,a);return n&&!i&&r&&(o.root+=` ${r}`),o},Hs=Q(`button`,{name:`MuiButtonBase`,slot:`Root`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,boxSizing:`border-box`,WebkitTapHighlightColor:`transparent`,backgroundColor:`transparent`,outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:`pointer`,userSelect:`none`,verticalAlign:`middle`,MozAppearance:`none`,WebkitAppearance:`none`,textDecoration:`none`,color:`inherit`,"&::-moz-focus-inner":{borderStyle:`none`},[`&.${Bs.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),Us=f.forwardRef(function(e,t){let n=Bo({props:e,name:`MuiButtonBase`}),{action:r,centerRipple:i=!1,children:a,className:o,component:s=`button`,disabled:c=!1,disableRipple:l=!1,disableTouchRipple:u=!1,focusRipple:d=!1,focusVisibleClassName:p,focusableWhenDisabled:h,suppressFocusVisible:g=!1,internalNativeButton:_,LinkComponent:v=`a`,nativeButton:y,onBlur:b,onClick:x,onContextMenu:S,onDragLeave:C,onFocus:ee,onFocusVisible:w,onKeyDown:T,onKeyUp:te,onMouseDown:E,onMouseLeave:D,onMouseUp:O,onTouchEnd:ne,onTouchMove:k,onTouchStart:A,tabIndex:j=0,TouchRippleProps:M,touchRippleRef:re,type:N,...P}=n,ie=!!(P.href||P.to),F=!!P.formAction,ae=s;ae===`button`&&ie&&(ae=v);let oe=typeof ae==`string`?ae===`button`:_??!1,I=y??oe,L=us(),se=Xo(L.ref,re),[ce,R]=f.useState(!1);(c||g)&&ce&&R(!1);let le=Jo(e=>{d&&!e.repeat&&ce&&e.key===` `&&L.stop(e,()=>{L.start(e)})}),ue=Jo(e=>{d&&e.key===` `&&ce&&!e.defaultPrevented&&L.stop(e,()=>{L.pulsate(e)})}),{getButtonProps:de,rootRef:z}=os({nativeButton:I,nativeButtonProp:y,internalNativeButton:oe,allowInferredHostMismatch:ie||typeof ae==`string`,disabled:c,type:N,hasFormAction:F,tabIndex:j,onBeforeKeyDown:le,onBeforeKeyUp:ue}),{onClick:fe,onKeyDown:pe,onKeyUp:me,...he}=de({onClick:x,onKeyDown:T,onKeyUp:te});f.useImperativeHandle(r,()=>({focusVisible:()=>{R(!0),z.current.focus()}}),[z]);let ge=L.shouldMount&&!l&&!c;f.useEffect(()=>{ce&&d&&!l&&L.pulsate()},[l,d,ce,L]);let _e=Ws(L,`start`,E,u),ve=Ws(L,`stop`,S,u),ye=Ws(L,`stop`,C,u),be=Ws(L,`stop`,O,u),xe=Ws(L,`stop`,e=>{ce&&e.preventDefault(),D&&D(e)},u),Se=Ws(L,`start`,A,u),Ce=Ws(L,`stop`,ne,u),we=Ws(L,`stop`,k,u),Te=Ws(L,`stop`,e=>{rs(e.target)||R(!1),b&&b(e)},!1),Ee=Jo(e=>{z.current||=e.currentTarget,!g&&rs(e.target)&&(R(!0),w&&w(e)),ee&&ee(e)}),B={};ie&&(B.tabIndex=c?-1:j,c&&(B[`aria-disabled`]=c),B.type=N);let De=Xo(t,z),Oe={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,suppressFocusVisible:g,tabIndex:j,focusVisible:ce},ke=Vs(Oe);return(0,m.jsxs)(Hs,{as:ae,className:U(ke.root,o),ownerState:Oe,onBlur:Te,onClick:fe,onContextMenu:ve,onFocus:Ee,onKeyDown:pe,onKeyUp:me,onMouseDown:_e,onMouseLeave:xe,onMouseUp:be,onDragLeave:ye,onTouchEnd:Ce,onTouchMove:we,onTouchStart:Se,ref:De,...ie?B:he,...P,children:[a,ge?(0,m.jsx)(Rs,{ref:se,center:i,...M}):null]})});function Ws(e,t,n,r=!1){return Jo(i=>(n&&n(i),r||e[t](i),!0))}process.env.NODE_ENV!==`production`&&(Us.propTypes={action:Qo,centerRipple:W.default.bool,children:W.default.node,classes:W.default.object,className:W.default.string,component:ns,disabled:W.default.bool,disableRipple:W.default.bool,disableTouchRipple:W.default.bool,focusRipple:W.default.bool,focusVisibleClassName:W.default.string,formAction:W.default.oneOfType([W.default.func,W.default.string]),href:W.default.any,LinkComponent:W.default.elementType,nativeButton:W.default.bool,onBlur:W.default.func,onClick:W.default.func,onContextMenu:W.default.func,onDragLeave:W.default.func,onFocus:W.default.func,onFocusVisible:W.default.func,onKeyDown:W.default.func,onKeyUp:W.default.func,onMouseDown:W.default.func,onMouseLeave:W.default.func,onMouseUp:W.default.func,onTouchEnd:W.default.func,onTouchMove:W.default.func,onTouchStart:W.default.func,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),tabIndex:W.default.number,TouchRippleProps:W.default.object,touchRippleRef:W.default.oneOfType([W.default.func,W.default.shape({current:W.default.shape({pulsate:W.default.func.isRequired,start:W.default.func.isRequired,stop:W.default.func.isRequired})})]),type:W.default.string});function Gs(e){return typeof e.main==`string`}function Ks(e,t=[]){if(!Gs(e))return!1;for(let n of t)if(!e.hasOwnProperty(n)||typeof e[n]!=`string`)return!1;return!0}function qs(e=[]){return([,t])=>t&&Ks(t,e)}function Js(e){return ja(`MuiCircularProgress`,e)}Vo(`MuiCircularProgress`,[`root`,`determinate`,`indeterminate`,`colorPrimary`,`colorSecondary`,`svg`,`track`,`circle`,`circleDisableShrink`]);var Ys=44,Xs=h.keyframes`
370
370
  0% {
371
371
  transform: rotate(0deg);
372
372
  }
@@ -374,7 +374,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
374
374
  100% {
375
375
  transform: rotate(360deg);
376
376
  }
377
- `,$s=h.keyframes`
377
+ `,Zs=h.keyframes`
378
378
  0% {
379
379
  stroke-dasharray: 1px, 200px;
380
380
  stroke-dashoffset: 0;
@@ -389,8 +389,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
389
389
  stroke-dasharray: 1px, 200px;
390
390
  stroke-dashoffset: -126px;
391
391
  }
392
- `,ec=typeof Qs==`string`?null:h.css`
393
- animation: ${Qs} 1.4s linear infinite;
394
- `,tc=typeof $s==`string`?null:h.css`
395
- animation: ${$s} 1.4s ease-in-out infinite;
396
- `,nc=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return Sn({root:[`root`,n,`color${Dn(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,i&&`circleDisableShrink`]},Xs,t)},rc=Q(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Dn(n.color)}`]]}})(Bo(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:ec||{animation:`${Qs} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Ys()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),ic=Q(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),ac=Q(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,n.disableShrink&&t.circleDisableShrink]}})(Bo(({theme:e})=>({stroke:`currentColor`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`stroke-dashoffset`)}},{props:{variant:`indeterminate`},style:{strokeDasharray:`80px, 200px`,strokeDashoffset:0}},{props:({ownerState:e})=>e.variant===`indeterminate`&&!e.disableShrink,style:tc||{animation:`${$s} 1.4s ease-in-out infinite`}}]}))),oc=Q(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(Bo(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),sc=f.forwardRef(function(e,t){let n=Ho({props:e,name:`MuiCircularProgress`}),{className:r,color:i=`primary`,disableShrink:a=!1,enableTrackSlot:o=!1,min:s,max:c,size:l=40,style:u,thickness:d=3.6,value:f=n.min??0,variant:p=`indeterminate`,...h}=n;process.env.NODE_ENV!==`production`&&p===`indeterminate`&&(s!==void 0||c!==void 0)&&console.warn("MUI: You have provided the `min` or `max` props with an 'indeterminate' variant. These props will have no effect.");let g=s??0,_=c??100,v={...n,color:i,disableShrink:a,size:l,thickness:d,value:f,variant:p,enableTrackSlot:o},y=nc(v),b={},x={},S={};if(p===`determinate`){let e=2*Math.PI*((Zs-d)/2);process.env.NODE_ENV!==`production`&&(f<g||f>_||g>=_)&&console.error(`MUI: The min, max, and value props in CircularProgress should be numbers where min < max and min <= value <= max. Received min=${g}, max=${_}, value=${f}.`);let t=_-g;b.strokeDasharray=e.toFixed(3),b.strokeDashoffset=t>0?`${((_-f)/t*e).toFixed(3)}px`:`${e.toFixed(3)}px`,x.transform=`rotate(-90deg)`,S[`aria-valuenow`]=f,S[`aria-valuemin`]=g,S[`aria-valuemax`]=_}return(0,m.jsx)(rc,{className:U(y.root,r),style:{width:l,height:l,...x,...u},ownerState:v,ref:t,role:`progressbar`,...S,...h,children:(0,m.jsxs)(ic,{className:y.svg,ownerState:v,viewBox:`${Zs/2} ${Zs/2} ${Zs} ${Zs}`,children:[o?(0,m.jsx)(oc,{className:y.track,ownerState:v,cx:Zs,cy:Zs,r:(Zs-d)/2,fill:`none`,strokeWidth:d,"aria-hidden":`true`}):null,(0,m.jsx)(ac,{className:y.circle,style:b,ownerState:v,cx:Zs,cy:Zs,r:(Zs-d)/2,fill:`none`,strokeWidth:d})]})})});process.env.NODE_ENV!==`production`&&(sc.propTypes={classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`inherit`,`primary`,`secondary`,`error`,`info`,`success`,`warning`]),W.default.string]),disableShrink:ts(W.default.bool,e=>e.disableShrink&&e.variant&&e.variant!==`indeterminate`?Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),enableTrackSlot:W.default.bool,max:W.default.number,min:W.default.number,size:W.default.oneOfType([W.default.number,W.default.string]),style:W.default.object,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),thickness:W.default.number,value:W.default.number,variant:W.default.oneOf([`determinate`,`indeterminate`])});function cc(e){return Na(`MuiButton`,e)}var lc=Uo(`MuiButton`,`root.text.outlined.contained.disableElevation.focusVisible.disabled.colorInherit.colorPrimary.colorSecondary.colorSuccess.colorError.colorInfo.colorWarning.sizeMedium.sizeSmall.sizeLarge.fullWidth.startIcon.endIcon.icon.loading.loadingWrapper.loadingIconPlaceholder.loadingIndicator.loadingPositionCenter.loadingPositionStart.loadingPositionEnd`.split(`.`)),uc=f.createContext({});process.env.NODE_ENV!==`production`&&(uc.displayName=`ButtonGroupContext`);var dc=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(dc.displayName=`ButtonGroupButtonContext`);var fc=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:a,loading:o,loadingPosition:s,classes:c}=e,l=Sn({root:[`root`,o&&`loading`,a,`size${Dn(i)}`,`color${Dn(t)}`,n&&`disableElevation`,r&&`fullWidth`,o&&`loadingPosition${Dn(s)}`],startIcon:[`icon`,`startIcon`],endIcon:[`icon`,`endIcon`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},cc,c);return{...c,...l}},pc=[{props:{size:`small`},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:`medium`},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:`large`},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],mc=Q(Gs,{shouldForwardProp:e=>zo(e)||e===`classes`,name:`MuiButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Dn(n.size)}`],n.color===`inherit`&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Bo(({theme:e})=>{let t=e.palette.mode===`light`?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode===`light`?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:`6px 16px`,border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`,`color`],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:`none`},[`&.${lc.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.startIcon||e.loading&&e.loadingPosition===`start`,style:{"&::before":{content:`"\\200b"`,width:0,overflow:`hidden`}}},{props:{variant:`contained`},style:{color:`var(--variant-containedColor)`,backgroundColor:`var(--variant-containedBg)`,boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${lc.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${lc.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:`outlined`},style:{padding:`5px 15px`,border:`1px solid currentColor`,borderColor:`var(--variant-outlinedBorder, currentColor)`,backgroundColor:`var(--variant-outlinedBg)`,color:`var(--variant-outlinedColor)`,[`&.${lc.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:`text`},style:{padding:`6px 8px`,color:`var(--variant-textColor)`,backgroundColor:`var(--variant-textBg)`}},...Object.entries(e.palette).filter(Ys()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:`inherit`},style:{color:`inherit`,borderColor:`currentColor`,"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:`small`,variant:`text`},style:{padding:`4px 5px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`text`},style:{padding:`8px 11px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`outlined`},style:{padding:`3px 9px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`outlined`},style:{padding:`7px 21px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`contained`},style:{padding:`4px 10px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`contained`},style:{padding:`8px 22px`,fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:`none`,"&:hover":{boxShadow:`none`},[`&.${lc.focusVisible}`]:{boxShadow:`none`},"&:active":{boxShadow:`none`},[`&.${lc.disabled}`]:{boxShadow:`none`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{loadingPosition:`center`},style:{transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`],{duration:e.transitions.duration.short}),[`&.${lc.loading}`]:{color:`transparent`}}}]}})),hc=Q(`span`,{name:`MuiButton`,slot:`StartIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart]}})(({theme:e})=>({display:`inherit`,marginRight:8,marginLeft:-4,variants:[{props:{size:`small`},style:{marginLeft:-2}},{props:{loadingPosition:`start`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`start`,loading:!0,fullWidth:!0},style:{marginRight:-8}},...pc]})),gc=Q(`span`,{name:`MuiButton`,slot:`EndIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd]}})(({theme:e})=>({display:`inherit`,marginRight:-4,marginLeft:8,variants:[{props:{size:`small`},style:{marginRight:-2}},{props:{loadingPosition:`end`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`end`,loading:!0,fullWidth:!0},style:{marginLeft:-8}},...pc]})),_c=Q(`span`,{name:`MuiButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,variants:[{props:{loading:!0},style:{display:`flex`}},{props:{loadingPosition:`start`},style:{left:14}},{props:{loadingPosition:`start`,size:`small`},style:{left:10}},{props:{variant:`text`,loadingPosition:`start`},style:{left:6}},{props:{loadingPosition:`center`},style:{left:`50%`,transform:`translate(-50%)`,color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:`end`},style:{right:14}},{props:{loadingPosition:`end`,size:`small`},style:{right:10}},{props:{variant:`text`,loadingPosition:`end`},style:{right:6}},{props:{loadingPosition:`start`,fullWidth:!0},style:{position:`relative`,left:-10}},{props:{loadingPosition:`end`,fullWidth:!0},style:{position:`relative`,right:-10}}]})),vc=Q(`span`,{name:`MuiButton`,slot:`LoadingIconPlaceholder`})({display:`inline-block`,width:`1em`,height:`1em`}),yc=f.forwardRef(function(e,t){let n=f.useContext(uc),r=f.useContext(dc),i=Ho({props:xn(n,e),name:`MuiButton`}),{children:a,color:o=`primary`,component:s=`button`,className:c,disabled:l=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:p,focusVisibleClassName:h,fullWidth:g=!1,id:_,loading:v=null,loadingIndicator:y,loadingPosition:b=`center`,size:x=`medium`,startIcon:S,type:C,variant:ee=`text`,...w}=i,T=qo(_),te=y??(0,m.jsx)(sc,{"aria-labelledby":T,color:`inherit`,size:16}),E={...i,color:o,component:s,disabled:l,disableElevation:u,disableFocusRipple:d,fullWidth:g,loading:v,loadingIndicator:te,loadingPosition:b,size:x,type:C,variant:ee},D=fc(E),O=(S||v&&b===`start`)&&(0,m.jsx)(hc,{className:D.startIcon,ownerState:E,children:S||(0,m.jsx)(vc,{className:D.loadingIconPlaceholder,ownerState:E})}),ne=(p||v&&b===`end`)&&(0,m.jsx)(gc,{className:D.endIcon,ownerState:E,children:p||(0,m.jsx)(vc,{className:D.loadingIconPlaceholder,ownerState:E})}),k=r||``,A=typeof v==`boolean`?(0,m.jsx)(`span`,{className:D.loadingWrapper,style:{display:`contents`},children:v&&(0,m.jsx)(_c,{className:D.loadingIndicator,ownerState:E,children:te})}):null,{root:j,...M}=D;return(0,m.jsxs)(mc,{ownerState:E,className:U(n.className,D.root,c,k),component:s,disabled:l||v,focusRipple:!d,focusVisibleClassName:U(D.focusVisible,h),ref:t,internalNativeButton:!0,type:C,id:v?T:_,...w,classes:M,children:[O,b!==`end`&&A,a,b===`end`&&A,ne]})});process.env.NODE_ENV!==`production`&&(yc.propTypes={children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`inherit`,`primary`,`secondary`,`success`,`error`,`info`,`warning`]),W.default.string]),component:W.default.elementType,disabled:W.default.bool,disableElevation:W.default.bool,disableFocusRipple:W.default.bool,disableRipple:W.default.bool,endIcon:W.default.node,focusVisibleClassName:W.default.string,fullWidth:W.default.bool,href:W.default.string,id:W.default.string,loading:W.default.bool,loadingIndicator:W.default.node,loadingPosition:W.default.oneOf([`center`,`end`,`start`]),size:W.default.oneOfType([W.default.oneOf([`small`,`medium`,`large`]),W.default.string]),startIcon:W.default.node,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),type:W.default.string,variant:W.default.oneOfType([W.default.oneOf([`contained`,`outlined`,`text`]),W.default.string])});function bc(e){return f.Children.toArray(e).filter(e=>f.isValidElement(e))}function xc(e){return Na(`MuiButtonGroup`,e)}var $=Uo(`MuiButtonGroup`,[`root`,`contained`,`outlined`,`text`,`disableElevation`,`disabled`,`firstButton`,`fullWidth`,`horizontal`,`vertical`,`colorPrimary`,`colorSecondary`,`grouped`,`lastButton`,`middleButton`]),Sc=(e,t)=>{let{ownerState:n}=e;return[{[`& .${$.grouped}`]:t.grouped},{[`& .${$.firstButton}`]:t.firstButton},{[`& .${$.lastButton}`]:t.lastButton},{[`& .${$.middleButton}`]:t.middleButton},t.root,t[n.variant],n.disableElevation===!0&&t.disableElevation,n.fullWidth&&t.fullWidth,n.orientation===`vertical`&&t.vertical]},Cc=e=>{let{classes:t,color:n,disabled:r,disableElevation:i,fullWidth:a,orientation:o,variant:s}=e;return Sn({root:[`root`,s,o,a&&`fullWidth`,i&&`disableElevation`,`color${Dn(n)}`],grouped:[`grouped`,r&&`disabled`],firstButton:[`firstButton`],lastButton:[`lastButton`],middleButton:[`middleButton`]},xc,t)},wc=Q(`div`,{name:`MuiButtonGroup`,slot:`Root`,overridesResolver:Sc})(Bo(({theme:e})=>({display:`inline-flex`,borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:`contained`},style:{boxShadow:(e.vars||e).shadows[2],[`& .${$.grouped}`]:{boxShadow:`none`,"&:hover":{boxShadow:`none`}}}},{props:{disableElevation:!0},style:{boxShadow:`none`}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{orientation:`vertical`},style:{flexDirection:`column`,[`& .${$.lastButton},& .${$.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${$.lastButton},& .${$.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:`text`,orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRight:e.vars?`1px solid ${e.alpha(e.vars.palette.common.onBackground,.23)}`:`1px solid ${e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`}`,[`&.${$.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:`text`,orientation:`vertical`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottom:e.vars?`1px solid ${e.alpha(e.vars.palette.common.onBackground,.23)}`:`1px solid ${e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`}`,[`&.${$.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter(Ys()).flatMap(([t])=>[{props:{variant:`text`,color:t},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderColor:e.alpha((e.vars||e).palette[t].main,.5)}}}]),{props:{variant:`outlined`,orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRightColor:`transparent`,"&:hover":{borderRightColor:`currentColor`}},[`& .${$.lastButton},& .${$.middleButton}`]:{marginLeft:-1}}},{props:{variant:`outlined`,orientation:`vertical`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottomColor:`transparent`,"&:hover":{borderBottomColor:`currentColor`}},[`& .${$.lastButton},& .${$.middleButton}`]:{marginTop:-1}}},{props:{variant:`contained`,orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${$.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:`contained`,orientation:`vertical`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${$.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter(Ys([`dark`])).map(([t])=>({props:{variant:`contained`,color:t},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${$.grouped}`]:{minWidth:40}}))),Tc=f.forwardRef(function(e,t){let n=Ho({props:e,name:`MuiButtonGroup`}),{children:r,className:i,color:a=`primary`,component:o=`div`,disabled:s=!1,disableElevation:c=!1,disableFocusRipple:l=!1,disableRipple:u=!1,fullWidth:d=!1,orientation:p=`horizontal`,size:h=`medium`,variant:g=`outlined`,..._}=n,v={...n,color:a,component:o,disabled:s,disableElevation:c,disableFocusRipple:l,disableRipple:u,fullWidth:d,orientation:p,size:h,variant:g},y=Cc(v),b=f.useMemo(()=>({className:y.grouped,color:a,disabled:s,disableElevation:c,disableFocusRipple:l,disableRipple:u,fullWidth:d,size:h,variant:g}),[a,s,c,l,u,d,h,g,y.grouped]),x=bc(r),S=x.length,C=e=>{let t=e===0,n=e===S-1;return t&&n?``:t?y.firstButton:n?y.lastButton:y.middleButton};return(0,m.jsx)(wc,{as:o,role:`group`,className:U(y.root,i),ref:t,ownerState:v,..._,children:(0,m.jsx)(uc.Provider,{value:b,children:x.map((e,t)=>(0,m.jsx)(dc.Provider,{value:C(t),children:e},t))})})});process.env.NODE_ENV!==`production`&&(Tc.propTypes={children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`inherit`,`primary`,`secondary`,`error`,`info`,`success`,`warning`]),W.default.string]),component:W.default.elementType,disabled:W.default.bool,disableElevation:W.default.bool,disableFocusRipple:W.default.bool,disableRipple:W.default.bool,fullWidth:W.default.bool,orientation:W.default.oneOf([`horizontal`,`vertical`]),size:W.default.oneOfType([W.default.oneOf([`small`,`medium`,`large`]),W.default.string]),sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),variant:W.default.oneOfType([W.default.oneOf([`contained`,`outlined`,`text`]),W.default.string])});function Ec(e){return typeof e==`string`}var Dc={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`};function Oc(e){if(e===void 0)return{};let t={};for(let n of Object.keys(e))$o(n,e[n])&&(t[n]=e[n]);return t}function kc(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Ac(e,t){if(!e||!t)return!1;if(e.contains(t))return!0;let n=t.getRootNode?.();if(n&&n instanceof ShadowRoot){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode??n.host??null}}return!1}var jc=Ac,Mc=2,Nc=[],Pc={};function Fc(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Ic(e,t){return e-t}function Lc(e,t,n=-1){let{index:r}=e.reduce((e,n,r)=>{let i=Math.abs(t-n);return e==null||i<=e.distance?{distance:i,index:r}:e},null)??Pc;return r==null?r:n>=0&&e[n]===e[r]?n:r}function Rc(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function zc(e,t,n){return(e-t)*100/(n-t)}function Bc(e,t,n){return(n-t)*e+t}function Vc(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function Hc(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Vc(t)))}function Uc(e,t,n){let r=e.slice();return r[n]=t,r.sort(Ic)}function Wc(e,t,n,r){let i=Go(Ko(e.current));if(!jc(e.current,i)||Number(i?.getAttribute(`data-index`))!==t){let n=e.current?.querySelector(`[type="range"][data-index="${t}"]`);n!=null&&(r==null?n.focus({preventScroll:!0}):n.focus({preventScroll:!0,focusVisible:r}))}n&&n(t)}function Gc(e,t){return typeof e==`number`&&typeof t==`number`?e===t:typeof e==`object`&&typeof t==`object`?kc(e,t):!1}var Kc={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},qc=e=>e;function Jc(e){let{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:a=!1,marks:o=!1,max:s=100,min:c=0,name:l,onChange:u,onChangeCommitted:d,orientation:p=`horizontal`,rootRef:m,scale:h=qc,step:g=1,shiftStep:_=10,tabIndex:v,value:y}=e,b=f.useRef(void 0),x=f.useRef(null),[S,C]=f.useState(-1),[ee,w]=f.useState(-1),[T,te]=f.useState(!1),E=f.useRef(0),D=f.useRef(-1),O=f.useRef(!1),ne=f.useRef(-1),k=Yo(()=>{x.current!=null&&(cancelAnimationFrame(x.current),x.current=null)}),A=f.useRef(null),[j,M]=Jo({controlled:y,default:n??c,name:`Slider`}),re=Yo((e,t,n)=>{let r=`nativeEvent`in e?e.nativeEvent:e,i=new r.constructor(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:t,name:l}}),A.current=t,u?.(i,t,n)}),N=Array.isArray(j),P=f.useMemo(()=>{if(typeof j==`number`)return[ai(j,c,s)];if(j==null)return[c];let e=j.slice().sort(Ic);for(let t=0;t<e.length;t+=1){let n=e[t];e[t]=n==null?c:ai(n,c,s)}return e},[j,c,s]),ie=f.useMemo(()=>{if(o===!0&&g!=null){let e=Array(Math.floor((s-c)/g)+1);for(let t=0;t<e.length;t+=1)e[t]={value:c+g*t};return e}return Array.isArray(o)?o:Nc},[o,g,c,s]),F=f.useMemo(()=>{let e=Array(ie.length);for(let t=0;t<ie.length;t+=1)e[t]=ie[t].value;return e},[ie]),[ae,oe]=f.useState(-1),I=f.useRef(null),L=Zo(m,I),se=e=>t=>{let n=Number(t.currentTarget.getAttribute(`data-index`));as(t.target)&&oe(n),w(n),e?.onFocus?.(t)},ce=e=>t=>{as(t.target)||oe(-1),w(-1),e?.onBlur?.(t)},R=(e,t)=>{let n=Number(e.currentTarget.getAttribute(`data-index`)),r=P[n],a=F.indexOf(r),o=t;if(ie&&g==null){let e=F[F.length-1];o=o>=e?e:o<=F[0]?F[0]:o<r?F[a-1]:F[a+1]}if(o=ai(o,c,s),N){i&&(o=ai(o,P[n-1]||-1/0,P[n+1]||1/0));let e=o;o=Uc(P,o,n);let t=n;i||(t=o.indexOf(e)),Wc(I,t)}M(o),oe(n),u&&!Gc(o,j)&&re(e,o,n),d&&d(e,A.current??o)},le=e=>t=>{if([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`].includes(t.key)){t.preventDefault();let e=P[Number(t.currentTarget.getAttribute(`data-index`))],n=null;if(g!=null){let r=t.shiftKey?_:g;switch(t.key){case`ArrowUp`:n=Fc(e,r,1,c,s);break;case`ArrowRight`:n=Fc(e,r,a?-1:1,c,s);break;case`ArrowDown`:n=Fc(e,r,-1,c,s);break;case`ArrowLeft`:n=Fc(e,r,a?1:-1,c,s);break;case`PageUp`:n=Fc(e,_,1,c,s);break;case`PageDown`:n=Fc(e,_,-1,c,s);break;case`Home`:n=c;break;case`End`:n=s;break;default:break}}else if(ie){let r=F[F.length-1],i=F.indexOf(e),o=[a?`ArrowRight`:`ArrowLeft`,`ArrowDown`,`PageDown`,`Home`],s=[a?`ArrowLeft`:`ArrowRight`,`ArrowUp`,`PageUp`,`End`];o.includes(t.key)?n=i===0?F[0]:F[i-1]:s.includes(t.key)&&(n=i===F.length-1?r:F[i+1])}n!=null&&R(t,n)}e?.onKeyDown?.(t)};la(()=>{let e=Go(Ko(I.current));r&&jc(I.current,e)&&e!=null&&`blur`in e&&e.blur()},[r]),r&&S!==-1&&C(-1),r&&ae!==-1&&oe(-1);let ue=e=>t=>{e.onChange?.(t),R(t,t.currentTarget.valueAsNumber)},de=f.useRef(void 0),z=p;a&&p===`horizontal`&&(z+=`-reverse`);let fe=e=>{let{current:t}=I;if(!t)return null;let{width:n,height:r,bottom:a,left:o}=t.getBoundingClientRect(),l;l=z.startsWith(`vertical`)?(a-e.y)/r:(e.x-o)/n,z.includes(`-reverse`)&&(l=1-l);let u;u=Bc(l,c,s),u=g?Hc(u,g,c):F[Lc(F,u)],u=ai(u,c,s);let d=0;if(N){let e=de.current!==-1;d=e?de.current:Lc(P,u,D.current),i&&(u=ai(u,P[d-1]||-1/0,P[d+1]||1/0));let t=u;u=Uc(P,u,d),i&&e||(d=u.indexOf(t),de.current=d)}return{newValue:u,activeIndex:d}},pe=Yo(e=>{if(`pointerId`in e&&e.pointerId!==ne.current)return;let t=Rc(e,b);if(!t)return;if(E.current+=1,e.type===`pointermove`&&e.buttons===0){me(e);return}let n=fe(t);n&&(Wc(I,n.activeIndex,C,!1),D.current=n.activeIndex,M(n.newValue),!T&&E.current>Mc&&te(!0),u&&!Gc(n.newValue,j)&&re(e,n.newValue,n.activeIndex))}),me=Yo(e=>{if(`pointerId`in e&&e.pointerId!==ne.current)return;let t=Rc(e,b);if(te(!1),!t)return;let n=fe(t);C(-1),e.type===`touchend`&&w(-1),n&&d&&d(e,A.current??n.newValue),`pointerType`in e&&I.current?.hasPointerCapture(e.pointerId)&&I.current.releasePointerCapture(e.pointerId),b.current=void 0,ne.current=-1,ge()}),he=Yo(e=>{if(r)return;if(O.current){O.current=!1;let t=e.changedTouches[0];t!=null&&(b.current=t.identifier);return}let t=e.changedTouches[0];t!=null&&(b.current=t.identifier);let n=Rc(e,b);if(n!==!1){de.current=-1;let t=fe(n);t&&(Wc(I,t.activeIndex,C,!1),D.current=t.activeIndex,M(t.newValue),u&&!Gc(t.newValue,j)&&re(e,t.newValue,t.activeIndex))}E.current=0;let i=Ko(I.current);i.addEventListener(`touchmove`,pe,{passive:!0}),i.addEventListener(`touchend`,me,{passive:!0})}),ge=f.useCallback(()=>{let e=Ko(I.current);e.removeEventListener(`pointermove`,pe),e.removeEventListener(`pointerup`,me),e.removeEventListener(`touchmove`,pe),e.removeEventListener(`touchend`,me)},[me,pe]);f.useEffect(()=>{let e=I.current;if(e)return e.addEventListener(`touchstart`,he,{passive:!0}),()=>{e.removeEventListener(`touchstart`,he),k(),ge()}},[ge,he,k]),f.useEffect(()=>{r&&(ge(),k())},[r,ge,k]);let _e=e=>t=>{if(e.onPointerDown?.(t),t.pointerType===`touch`&&(O.current=!0),r||t.defaultPrevented||t.button!==0)return;let n=Rc(t,b);if(n!==!1){de.current=-1;let e=fe(n);if(e){let n=I.current?.querySelector(`input[type="range"][data-index="${e.activeIndex}"]`),r=Ko(I.current),i=n!=null&&n===Go(r);C(e.activeIndex),D.current=e.activeIndex,i?t.preventDefault():(k(),x.current=requestAnimationFrame(()=>{x.current=null,Wc(I,e.activeIndex,void 0,!1)})),M(e.newValue),u&&!Gc(e.newValue,j)&&re(t,e.newValue,e.activeIndex)}}E.current=0,ne.current=t.pointerId;let i=Ko(I.current);try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}i.addEventListener(`pointermove`,pe,{passive:!0}),i.addEventListener(`pointerup`,me)},ve=zc(N?P[0]:c,c,s),ye=zc(P[P.length-1],c,s)-ve,be=(e=Pc)=>{let t=Oc(e),n={onPointerDown:_e(t)},r={...t,...n};return{...e,ref:L,...r}},xe=e=>t=>{e.onMouseOver?.(t),w(Number(t.currentTarget.getAttribute(`data-index`)))},Se=e=>t=>{e.onMouseLeave?.(t),w(-1)},Ce=(e=Pc)=>{let t=Oc(e),n={onMouseOver:xe(t),onMouseLeave:Se(t)};return{...e,...t,...n}},we=e=>{let t;return N?S===e?t=2:D.current===e&&(t=1):S===e&&(t=1),{pointerEvents:S!==-1&&S!==e?`none`:void 0,zIndex:t}},Te;return p===`vertical`&&(Te=a?`vertical-rl`:`vertical-lr`),{active:S,axis:z,axisProps:Kc,dragging:T,focusedThumbIndex:ae,getHiddenInputProps:(n=Pc)=>{let i=Oc(n),o={onChange:ue(i),onFocus:se(i),onBlur:ce(i),onKeyDown:le(i)},u={...i,...o};return{tabIndex:v,"aria-labelledby":t,"aria-orientation":p,"aria-valuemax":h(s),"aria-valuemin":h(c),name:l,type:`range`,min:e.min,max:e.max,step:e.step===null&&e.marks?`any`:e.step??void 0,disabled:r,...n,...u,style:{...Dc,direction:a?`rtl`:`ltr`,width:`100%`,height:`100%`,writingMode:Te}}},getRootProps:be,getThumbProps:Ce,marks:ie,open:ee,range:N,rootRef:L,trackLeap:ye,trackOffset:ve,values:P,getThumbStyle:we}}function Yc(e,t,n){return e===void 0||Ec(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Xc(e,t,n){return typeof e==`function`?e(t,n):e}function Zc(e){if(e===void 0)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&typeof e[t]==`function`)).forEach(n=>{t[n]=e[n]}),t}function Qc(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=U(n?.className,a,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},o={...n,...i,...r};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}let o=Oc({...i,...r}),s=Zc(r),c=Zc(i),l=t(o),u=U(l?.className,n?.className,a,i?.className,r?.className),d={...l?.style,...n?.style,...i?.style,...r?.style},f={...l,...n,...c,...s};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}function $c(e,t){let{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...c}=t,{component:l,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=a,p=u[e]||r,m=Xc(d[e],i),{props:{component:h,...g},internalRef:_}=Qc({className:n,...c,externalForwardedProps:e===`root`?f:void 0,externalSlotProps:m}),v=Zo(_,m?.ref,t.ref),y=e===`root`?h||l:h;return[p,Yc(p,{...e===`root`&&!l&&!u[e]&&o,...e!==`root`&&!u[e]&&o,...g,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},i)]}function el(e){return Na(`MuiSlider`,e)}var tl=Uo(`MuiSlider`,`root.active.colorPrimary.colorSecondary.colorError.colorInfo.colorSuccess.colorWarning.disabled.dragging.focusVisible.mark.markActive.marked.markLabel.markLabelActive.rail.sizeSmall.thumb.track.trackInverted.trackFalse.valueLabel.valueLabelOpen.valueLabelCircle.valueLabelLabel.vertical`.split(`.`)),nl=e=>{let{open:t}=e;return{offset:U(t&&tl.valueLabelOpen),circle:tl.valueLabelCircle,label:tl.valueLabelLabel}};function rl(e){let{children:t,className:n,value:r}=e,i=nl(e);return t?f.cloneElement(t,{className:t.props.className},(0,m.jsxs)(f.Fragment,{children:[t.props.children,(0,m.jsx)(`span`,{className:U(i.offset,n),"aria-hidden":!0,children:(0,m.jsx)(`span`,{className:i.circle,children:(0,m.jsx)(`span`,{className:i.label,children:r})})})]})):null}process.env.NODE_ENV!==`production`&&(rl.propTypes={children:W.default.element.isRequired,className:W.default.string,value:W.default.node});function il(e){return e}var al=Q(`span`,{name:`MuiSlider`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${Dn(n.color)}`],n.size!==`medium`&&t[`size${Dn(n.size)}`],n.marked&&t.marked,n.orientation===`vertical`&&t.vertical,n.track===`inverted`&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Bo(({theme:e})=>({borderRadius:12,boxSizing:`content-box`,display:`inline-block`,position:`relative`,cursor:`pointer`,touchAction:`none`,WebkitTapHighlightColor:`transparent`,"@media print":{colorAdjust:`exact`},[`&.${tl.disabled}`]:{pointerEvents:`none`,cursor:`default`,color:(e.vars||e).palette.grey[400]},[`&.${tl.dragging}`]:{[`& .${tl.thumb}, & .${tl.track}`]:{transition:`none`}},variants:[...Object.entries(e.palette).filter(Ys()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:`horizontal`},style:{height:4,width:`100%`,padding:`13px 0`,"@media (pointer: coarse)":{padding:`20px 0`}}},{props:{orientation:`horizontal`,size:`small`},style:{height:2}},{props:{orientation:`horizontal`,marked:!0},style:{marginBottom:20}},{props:{orientation:`vertical`},style:{height:`100%`,width:4,padding:`0 13px`,"@media (pointer: coarse)":{padding:`0 20px`}}},{props:{orientation:`vertical`,size:`small`},style:{width:2}},{props:{orientation:`vertical`,marked:!0},style:{marginRight:44}}]}))),ol=Q(`span`,{name:`MuiSlider`,slot:`Rail`})({display:`block`,position:`absolute`,borderRadius:`inherit`,backgroundColor:`currentColor`,opacity:.38,"@media (forced-colors: active)":{border:`1px solid transparent`,boxSizing:`border-box`},variants:[{props:{orientation:`horizontal`},style:{width:`100%`,height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{height:`100%`,width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:`inverted`},style:{opacity:1}}]}),sl=Q(`span`,{name:`MuiSlider`,slot:`Track`})(Bo(({theme:e})=>({display:`block`,position:`absolute`,borderRadius:`inherit`,border:`1px solid currentColor`,backgroundColor:`currentColor`,transition:e.transitions.create([`left`,`width`,`bottom`,`height`],{duration:e.transitions.duration.shortest}),variants:[{props:{size:`small`},style:{"@media (forced-colors: none)":{border:`none`}}},{props:{orientation:`horizontal`},style:{height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:!1},style:{display:`none`}},...Object.entries(e.palette).filter(Ys()).map(([t])=>({props:{color:t,track:`inverted`},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles(`dark`,{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles(`dark`,{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),cl=Q(`span`,{name:`MuiSlider`,slot:`Thumb`})(Bo(({theme:e})=>({position:`absolute`,width:20,height:20,boxSizing:`border-box`,borderRadius:`50%`,outline:0,backgroundColor:`currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:e.transitions.create([`box-shadow`,`left`,`bottom`],{duration:e.transitions.duration.shortest}),"@media (forced-colors: active)":{border:`1px solid ButtonBorder`},"&::before":{position:`absolute`,content:`""`,borderRadius:`inherit`,width:`100%`,height:`100%`,boxShadow:(e.vars||e).shadows[2]},"&::after":{position:`absolute`,content:`""`,borderRadius:`50%`,width:42,height:42,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`},[`&.${tl.disabled}`]:{"&:hover":{boxShadow:`none`}},variants:[{props:{size:`small`},style:{width:12,height:12,"&::before":{boxShadow:`none`}}},{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-50%, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 50%)`}},...Object.entries(e.palette).filter(Ys()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${tl.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:`none`}},[`&.${tl.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),ll=Q(rl,{name:`MuiSlider`,slot:`ValueLabel`})(Bo(({theme:e})=>({zIndex:1,whiteSpace:`nowrap`,...e.typography.body2,fontWeight:500,transition:e.transitions.create([`transform`],{duration:e.transitions.duration.shortest}),position:`absolute`,backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0.25rem 0.75rem`,variants:[{props:{orientation:`horizontal`},style:{transform:`translateY(-100%) scale(0)`,top:`-10px`,transformOrigin:`bottom center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, 50%) rotate(45deg)`,backgroundColor:`inherit`,bottom:0,left:`50%`},[`&.${tl.valueLabelOpen}`]:{transform:`translateY(-100%) scale(1)`}}},{props:{orientation:`vertical`},style:{transform:`translateY(-50%) scale(0)`,right:`30px`,top:`50%`,transformOrigin:`right center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, -50%) rotate(45deg)`,backgroundColor:`inherit`,right:-8,top:`50%`},[`&.${tl.valueLabelOpen}`]:{transform:`translateY(-50%) scale(1)`}}},{props:{size:`small`},style:{fontSize:e.typography.pxToRem(12),padding:`0.25rem 0.5rem`}},{props:{orientation:`vertical`,size:`small`},style:{right:`20px`}}]})));process.env.NODE_ENV!==`production`&&(ll.propTypes={children:W.default.element.isRequired,index:W.default.number.isRequired,open:W.default.bool.isRequired,value:W.default.node});var ul=Q(`span`,{name:`MuiSlider`,slot:`Mark`,shouldForwardProp:e=>Ro(e)&&e!==`markActive`,overridesResolver:(e,t)=>{let{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Bo(({theme:e})=>({position:`absolute`,width:2,height:2,borderRadius:1,backgroundColor:`currentColor`,variants:[{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-1px, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 1px)`}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),dl=Q(`span`,{name:`MuiSlider`,slot:`MarkLabel`,shouldForwardProp:e=>Ro(e)&&e!==`markLabelActive`})(Bo(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:`absolute`,whiteSpace:`nowrap`,variants:[{props:{orientation:`horizontal`},style:{top:30,transform:`translateX(-50%)`,"@media (pointer: coarse)":{top:40}}},{props:{orientation:`vertical`},style:{left:36,transform:`translateY(50%)`,"@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),fl=e=>{let{disabled:t,dragging:n,marked:r,orientation:i,track:a,classes:o,color:s,size:c}=e;return Sn({root:[`root`,t&&`disabled`,n&&`dragging`,r&&`marked`,i===`vertical`&&`vertical`,a===`inverted`&&`trackInverted`,a===!1&&`trackFalse`,s&&`color${Dn(s)}`,c&&`size${Dn(c)}`],rail:[`rail`],track:[`track`],mark:[`mark`],markActive:[`markActive`],markLabel:[`markLabel`],markLabelActive:[`markLabelActive`],valueLabel:[`valueLabel`],thumb:[`thumb`,t&&`disabled`],active:[`active`],disabled:[`disabled`],focusVisible:[`focusVisible`]},el,o)},pl=({children:e})=>e,ml=f.forwardRef(function(e,t){let n=Ho({props:e,name:`MuiSlider`}),r=fa(),{"aria-label":i,"aria-valuetext":a,"aria-labelledby":o,color:s=`primary`,classes:c,className:l,disableSwap:u=!1,disabled:d=!1,getAriaLabel:p,getAriaValueText:h,marks:g=!1,max:_=100,min:v=0,name:y,onChange:b,onChangeCommitted:x,orientation:S=`horizontal`,shiftStep:C=10,size:ee=`medium`,step:w=1,scale:T=il,slotProps:te={},slots:E={},tabIndex:D,track:O=`normal`,value:ne,valueLabelDisplay:k=`off`,valueLabelFormat:A=il,...j}=n,M={...n,isRtl:r,max:_,min:v,classes:c,disabled:d,disableSwap:u,orientation:S,marks:g,color:s,size:ee,step:w,shiftStep:C,scale:T,track:O,valueLabelDisplay:k,valueLabelFormat:A},{axisProps:re,getRootProps:N,getHiddenInputProps:P,getThumbProps:ie,open:F,active:ae,axis:oe,focusedThumbIndex:I,range:L,dragging:se,marks:ce,values:R,trackOffset:le,trackLeap:ue,getThumbStyle:de}=Jc({...M,rootRef:t});M.marked=ce.length>0&&ce.some(e=>e.label),M.dragging=se,M.focusedThumbIndex=I;let z=fl(M),fe={slots:E,slotProps:te},[pe,me]=$c(`root`,{elementType:al,getSlotProps:N,externalForwardedProps:{...fe,...j},ownerState:M,className:[z.root,l]}),[he,ge]=$c(`rail`,{elementType:ol,externalForwardedProps:fe,ownerState:M,className:z.rail}),[_e,ve]=$c(`track`,{elementType:sl,externalForwardedProps:fe,additionalProps:{style:{...re[oe].offset(le),...re[oe].leap(ue)}},ownerState:M,className:z.track}),[ye,be]=$c(`thumb`,{elementType:cl,getSlotProps:ie,externalForwardedProps:fe,ownerState:M,className:z.thumb}),[xe,Se]=$c(`valueLabel`,{elementType:ll,externalForwardedProps:fe,ownerState:M,className:z.valueLabel}),[Ce,we]=$c(`mark`,{elementType:ul,externalForwardedProps:fe,ownerState:M,className:z.mark}),[Te,Ee]=$c(`markLabel`,{elementType:dl,externalForwardedProps:fe,ownerState:M,className:z.markLabel}),[De,Oe]=$c(`input`,{elementType:`input`,getSlotProps:P,externalForwardedProps:fe,ownerState:M});return(0,m.jsxs)(pe,{...me,children:[(0,m.jsx)(he,{...ge}),(0,m.jsx)(_e,{...ve}),ce.filter(e=>e.value>=v&&e.value<=_).map((e,t)=>{let n=zc(e.value,v,_),r=re[oe].offset(n),i;return i=O===!1?R.includes(e.value):O===`normal`&&(L?e.value>=R[0]&&e.value<=R[R.length-1]:e.value<=R[0])||O===`inverted`&&(L?e.value<=R[0]||e.value>=R[R.length-1]:e.value>=R[0]),(0,m.jsxs)(f.Fragment,{children:[(0,m.jsx)(Ce,{"data-index":t,...we,...!Ec(Ce)&&{markActive:i},style:{...r,...we.style},className:U(we.className,i&&z.markActive)}),e.label==null?null:(0,m.jsx)(Te,{"aria-hidden":!0,"data-index":t,...Ee,...!Ec(Te)&&{markLabelActive:i},style:{...r,...Ee.style},className:U(z.markLabel,Ee.className,i&&z.markLabelActive),children:e.label})]},t)}),R.map((e,t)=>{let n=zc(e,v,_),r=re[oe].offset(n),s=k===`off`?pl:xe;return(0,m.jsx)(s,{...!Ec(s)&&{valueLabelFormat:A,valueLabelDisplay:k,value:typeof A==`function`?A(T(e),t):A,index:t,open:F===t||ae===t||k===`on`,disabled:d},...Se,children:(0,m.jsx)(ye,{"data-index":t,...be,className:U(z.thumb,be.className,ae===t&&z.active,I===t&&z.focusVisible),style:{...r,...de(t),...be.style},children:(0,m.jsx)(De,{"data-index":t,"aria-label":p?p(t):i,"aria-valuenow":T(e),"aria-labelledby":o,"aria-valuetext":h?h(T(e),t):a,value:R[t],...Oe})})},t)})]})});process.env.NODE_ENV!==`production`&&(ml.propTypes={"aria-label":ts(W.default.string,e=>Array.isArray(e.value||e.defaultValue)&&e[`aria-label`]!=null?Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":W.default.string,"aria-valuetext":ts(W.default.string,e=>Array.isArray(e.value||e.defaultValue)&&e[`aria-valuetext`]!=null?Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`primary`,`secondary`,`error`,`info`,`success`,`warning`]),W.default.string]),defaultValue:W.default.oneOfType([W.default.arrayOf(W.default.number),W.default.number]),disabled:W.default.bool,disableSwap:W.default.bool,getAriaLabel:W.default.func,getAriaValueText:W.default.func,marks:W.default.oneOfType([W.default.arrayOf(W.default.shape({label:W.default.node,value:W.default.number.isRequired})),W.default.bool]),max:W.default.number,min:W.default.number,name:W.default.string,onChange:W.default.func,onChangeCommitted:W.default.func,orientation:W.default.oneOf([`horizontal`,`vertical`]),scale:W.default.func,shiftStep:W.default.number,size:W.default.oneOfType([W.default.oneOf([`small`,`medium`]),W.default.string]),slotProps:W.default.shape({input:W.default.oneOfType([W.default.func,W.default.object]),mark:W.default.oneOfType([W.default.func,W.default.object]),markLabel:W.default.oneOfType([W.default.func,W.default.object]),rail:W.default.oneOfType([W.default.func,W.default.object]),root:W.default.oneOfType([W.default.func,W.default.object]),thumb:W.default.oneOfType([W.default.func,W.default.object]),track:W.default.oneOfType([W.default.func,W.default.object]),valueLabel:W.default.oneOfType([W.default.func,W.default.shape({children:W.default.element,className:W.default.string,open:W.default.bool,style:W.default.object,value:W.default.node,valueLabelDisplay:W.default.oneOf([`auto`,`off`,`on`])})])}),slots:W.default.shape({input:W.default.elementType,mark:W.default.elementType,markLabel:W.default.elementType,rail:W.default.elementType,root:W.default.elementType,thumb:W.default.elementType,track:W.default.elementType,valueLabel:W.default.elementType}),step:W.default.number,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),tabIndex:W.default.number,track:W.default.oneOf([`inverted`,`normal`,!1]),value:W.default.oneOfType([W.default.arrayOf(W.default.number),W.default.number]),valueLabelDisplay:W.default.oneOf([`auto`,`off`,`on`]),valueLabelFormat:W.default.oneOfType([W.default.func,W.default.string])});function hl(e){return Na(`MuiTypography`,e)}Uo(`MuiTypography`,[`root`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`subtitle1`,`subtitle2`,`body1`,`body2`,`inherit`,`button`,`caption`,`overline`,`alignLeft`,`alignRight`,`alignCenter`,`alignJustify`,`noWrap`,`gutterBottom`]);var gl=e=>{let{align:t,gutterBottom:n,noWrap:r,variant:i,classes:a}=e;return Sn({root:[`root`,i,e.align!==`inherit`&&`align${Dn(t)}`,n&&`gutterBottom`,r&&`noWrap`]},hl,a)},_l=Q(`span`,{name:`MuiTypography`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!==`inherit`&&t[`align${Dn(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom]}})(Bo(({theme:e})=>({margin:0,variants:[{props:{variant:`inherit`},style:{font:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},...Object.entries(e.typography).filter(([e,t])=>e!==`inherit`&&t&&typeof t==`object`).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(Ys()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>typeof e==`string`).map(([t])=>({props:{color:`text${Dn(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>e.align!==`inherit`,style:{textAlign:`var(--Typography-textAlign)`}},{props:({ownerState:e})=>e.noWrap,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:`0.35em`}}]}))),vl={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,subtitle1:`h6`,subtitle2:`h6`,body1:`p`,body2:`p`,inherit:`p`},yl=f.forwardRef(function(e,t){let n=Ho({props:e,name:`MuiTypography`}),{color:r,align:i=`inherit`,className:a,component:o,gutterBottom:s=!1,noWrap:c=!1,variant:l=`body1`,variantMapping:u=vl,...d}=n,f={...n,align:i,color:r,className:a,component:o,gutterBottom:s,noWrap:c,variant:l,variantMapping:u};return(0,m.jsx)(_l,{as:o||u[l]||vl[l]||`span`,ref:t,className:U(gl(f).root,a),...d,ownerState:f,style:{...i!==`inherit`&&{"--Typography-textAlign":i},...d.style}})});process.env.NODE_ENV!==`production`&&(yl.propTypes={align:W.default.oneOf([`center`,`inherit`,`justify`,`left`,`right`]),children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`primary`,`secondary`,`success`,`error`,`info`,`warning`,`textPrimary`,`textSecondary`,`textDisabled`]),W.default.string]),component:W.default.elementType,gutterBottom:W.default.bool,noWrap:W.default.bool,style:W.default.object,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),variant:W.default.oneOfType([W.default.oneOf([`body1`,`body2`,`button`,`caption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`inherit`,`overline`,`subtitle1`,`subtitle2`]),W.default.string]),variantMapping:W.default.object});var bl=Uo(`MuiBox`,[`root`]),xl=(0,h.createBox)({themeId:xo,defaultTheme:yo(),defaultClassName:bl.root,generateClassName:wn.generate});process.env.NODE_ENV!==`production`&&(xl.propTypes={children:W.default.node,component:W.default.elementType,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object])});var Sl=({showLayer:e,setShowLayer:t,scale:n,setScale:r,rotation:i,setRotation:a,mapPosition:o,setMapPosition:s,position:c,setPosition:l,enableTransformControls:f,setEnableTransformControls:p,transformMode:h,setTransformMode:g,layerName:_=`Layer`})=>{let{scene:v,worldMatrixInv:b}=O(),x=(0,d.useRef)(void 0),[S,C]=(0,d.useState)(!1);return(0,d.useLayoutEffect)(()=>{if(!v||!b||!f){x.current&&(v?.remove(x.current),x.current.geometry.dispose(),x.current.material.dispose(),x.current=void 0,C(!1));return}let e=new u.BoxGeometry(1,1,1),t=new u.MeshBasicMaterial({visible:!1}),r=new u.Mesh(e,t),a=y.toScenePosition(b,[o.lng,o.lat],0);return r.position.set(a.x+c.x,a.y+c.y,a.z+c.z),r.rotation.set(i.x*Math.PI/180,i.y*Math.PI/180,i.z*Math.PI/180),r.scale.set(n,n,n),v.add(r),x.current=r,C(!0),()=>{x.current&&(v.remove(x.current),x.current.geometry.dispose(),x.current.material.dispose(),x.current=void 0,C(!1))}},[v,b,f]),(0,d.useLayoutEffect)(()=>{if(!x.current||!b)return;let e=y.toScenePosition(b,[o.lng,o.lat],0);x.current.position.set(e.x+c.x,e.y+c.y,e.z+c.z),x.current.rotation.set(i.x*Math.PI/180,i.y*Math.PI/180,i.z*Math.PI/180),x.current.scale.set(n,n,n),x.current.updateMatrixWorld(!0)},[c,i,n,o,b]),(0,m.jsxs)(m.Fragment,{children:[S&&x.current&&f&&(0,m.jsx)(ln,{target:x.current,mode:h||`translate`,enabled:f,onObjectChange:e=>{if(!b)return;let t=y.toScenePosition(b,[o.lng,o.lat],0);l({x:e.position.x-t.x,y:e.position.y-t.y,z:e.position.z-t.z}),a({x:e.rotation.x*180/Math.PI,y:e.rotation.y*180/Math.PI,z:e.rotation.z*180/Math.PI}),r(e.scale.x)}}),(0,m.jsxs)(xl,{sx:{padding:`10px`},children:[(0,m.jsxs)(xl,{sx:{display:`flex`,gap:1,flexWrap:`wrap`,marginBottom:2},children:[(0,m.jsxs)(yc,{color:`primary`,variant:e?`contained`:`outlined`,onClick:()=>t(!e),size:`small`,children:[e?`Hide`:`Show`,` `,_]}),p&&(0,m.jsx)(yc,{color:`info`,variant:f?`contained`:`outlined`,onClick:()=>p(!f),size:`small`,children:`3D Gizmo`})]}),g&&f&&(0,m.jsx)(xl,{sx:{marginBottom:2},children:(0,m.jsxs)(Tc,{variant:`outlined`,size:`small`,fullWidth:!0,"aria-label":`transform mode`,children:[(0,m.jsx)(yc,{variant:h===`translate`?`contained`:`outlined`,onClick:()=>g(`translate`),children:`Move`}),(0,m.jsx)(yc,{variant:h===`rotate`?`contained`:`outlined`,onClick:()=>g(`rotate`),children:`Rotate`}),(0,m.jsx)(yc,{variant:h===`scale`?`contained`:`outlined`,onClick:()=>g(`scale`),children:`Scale`})]})}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Scale: `,n.toFixed(2)]}),(0,m.jsx)(ml,{value:n,onChange:(e,t)=>r(t),min:.01,max:150,step:.01,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Rotation X: `,i.x,`°`]}),(0,m.jsx)(ml,{value:i.x,onChange:(e,t)=>a({...i,x:t}),min:0,max:360,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Rotation Y: `,i.y,`°`]}),(0,m.jsx)(ml,{value:i.y,onChange:(e,t)=>a({...i,y:t}),min:0,max:360,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Rotation Z: `,i.z,`°`]}),(0,m.jsx)(ml,{value:i.z,onChange:(e,t)=>a({...i,z:t}),min:0,max:360,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Longitude: `,o.lng.toFixed(6)]}),(0,m.jsx)(ml,{value:o.lng,onChange:(e,t)=>s({...o,lng:t}),min:7.09,max:7.11,step:1e-4,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Latitude: `,o.lat.toFixed(6)]}),(0,m.jsx)(ml,{value:o.lat,onChange:(e,t)=>s({...o,lat:t}),min:50.73,max:50.74,step:1e-4,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Position X: `,c.x]}),(0,m.jsx)(ml,{value:c.x,onChange:(e,t)=>l({...c,x:t}),min:-100,max:100,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Position Y: `,c.y]}),(0,m.jsx)(ml,{value:c.y,onChange:(e,t)=>l({...c,y:t}),min:-100,max:100,valueLabelDisplay:`auto`}),(0,m.jsxs)(yl,{gutterBottom:!0,children:[`Position Z: `,c.z]}),(0,m.jsx)(ml,{value:c.z,onChange:(e,t)=>l({...c,z:t}),min:-500,max:100,valueLabelDisplay:`auto`})]})]})};exports.MlThreeGizmo=ln,exports.MlThreeModelLayer=ut,exports.MlThreeObjectControls=Sl,exports.MlThreeSplatLayer=At,exports.ThreeContext=D,exports.ThreeProvider=ne,exports.useThree=O;
392
+ `,Qs=typeof Xs==`string`?null:h.css`
393
+ animation: ${Xs} 1.4s linear infinite;
394
+ `,$s=typeof Zs==`string`?null:h.css`
395
+ animation: ${Zs} 1.4s ease-in-out infinite;
396
+ `,ec=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return bn({root:[`root`,n,`color${Tn(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,i&&`circleDisableShrink`]},Js,t)},tc=Q(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Tn(n.color)}`]]}})(Ro(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:Qs||{animation:`${Xs} 1.4s linear infinite`}},...Object.entries(e.palette).filter(qs()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),nc=Q(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),rc=Q(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,n.disableShrink&&t.circleDisableShrink]}})(Ro(({theme:e})=>({stroke:`currentColor`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`stroke-dashoffset`)}},{props:{variant:`indeterminate`},style:{strokeDasharray:`80px, 200px`,strokeDashoffset:0}},{props:({ownerState:e})=>e.variant===`indeterminate`&&!e.disableShrink,style:$s||{animation:`${Zs} 1.4s ease-in-out infinite`}}]}))),ic=Q(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(Ro(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),ac=f.forwardRef(function(e,t){let n=Bo({props:e,name:`MuiCircularProgress`}),{className:r,color:i=`primary`,disableShrink:a=!1,enableTrackSlot:o=!1,min:s,max:c,size:l=40,style:u,thickness:d=3.6,value:f=n.min??0,variant:p=`indeterminate`,...h}=n;process.env.NODE_ENV!==`production`&&p===`indeterminate`&&(s!==void 0||c!==void 0)&&console.warn("MUI: You have provided the `min` or `max` props with an 'indeterminate' variant. These props will have no effect.");let g=s??0,_=c??100,v={...n,color:i,disableShrink:a,size:l,thickness:d,value:f,variant:p,enableTrackSlot:o},y=ec(v),b={},x={},S={};if(p===`determinate`){let e=2*Math.PI*((Ys-d)/2);process.env.NODE_ENV!==`production`&&(f<g||f>_||g>=_)&&console.error(`MUI: The min, max, and value props in CircularProgress should be numbers where min < max and min <= value <= max. Received min=${g}, max=${_}, value=${f}.`);let t=_-g;b.strokeDasharray=e.toFixed(3),b.strokeDashoffset=t>0?`${((_-f)/t*e).toFixed(3)}px`:`${e.toFixed(3)}px`,x.transform=`rotate(-90deg)`,S[`aria-valuenow`]=f,S[`aria-valuemin`]=g,S[`aria-valuemax`]=_}return(0,m.jsx)(tc,{className:U(y.root,r),style:{width:l,height:l,...x,...u},ownerState:v,ref:t,role:`progressbar`,...S,...h,children:(0,m.jsxs)(nc,{className:y.svg,ownerState:v,viewBox:`${Ys/2} ${Ys/2} ${Ys} ${Ys}`,children:[o?(0,m.jsx)(ic,{className:y.track,ownerState:v,cx:Ys,cy:Ys,r:(Ys-d)/2,fill:`none`,strokeWidth:d,"aria-hidden":`true`}):null,(0,m.jsx)(rc,{className:y.circle,style:b,ownerState:v,cx:Ys,cy:Ys,r:(Ys-d)/2,fill:`none`,strokeWidth:d})]})})});process.env.NODE_ENV!==`production`&&(ac.propTypes={classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`inherit`,`primary`,`secondary`,`error`,`info`,`success`,`warning`]),W.default.string]),disableShrink:$o(W.default.bool,e=>e.disableShrink&&e.variant&&e.variant!==`indeterminate`?Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),enableTrackSlot:W.default.bool,max:W.default.number,min:W.default.number,size:W.default.oneOfType([W.default.number,W.default.string]),style:W.default.object,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),thickness:W.default.number,value:W.default.number,variant:W.default.oneOf([`determinate`,`indeterminate`])});function oc(e){return ja(`MuiButton`,e)}var sc=Vo(`MuiButton`,`root.text.outlined.contained.disableElevation.focusVisible.disabled.colorInherit.colorPrimary.colorSecondary.colorSuccess.colorError.colorInfo.colorWarning.sizeMedium.sizeSmall.sizeLarge.fullWidth.startIcon.endIcon.icon.loading.loadingWrapper.loadingIconPlaceholder.loadingIndicator.loadingPositionCenter.loadingPositionStart.loadingPositionEnd`.split(`.`)),cc=f.createContext({});process.env.NODE_ENV!==`production`&&(cc.displayName=`ButtonGroupContext`);var lc=f.createContext(void 0);process.env.NODE_ENV!==`production`&&(lc.displayName=`ButtonGroupButtonContext`);var uc=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:a,loading:o,loadingPosition:s,classes:c}=e,l=bn({root:[`root`,o&&`loading`,a,`size${Tn(i)}`,`color${Tn(t)}`,n&&`disableElevation`,r&&`fullWidth`,o&&`loadingPosition${Tn(s)}`],startIcon:[`icon`,`startIcon`],endIcon:[`icon`,`endIcon`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},oc,c);return{...c,...l}},dc=[{props:{size:`small`},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:`medium`},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:`large`},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],fc=Q(Us,{shouldForwardProp:e=>Lo(e)||e===`classes`,name:`MuiButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`size${Tn(n.size)}`],n.color===`inherit`&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Ro(({theme:e})=>{let t=e.palette.mode===`light`?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode===`light`?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:`6px 16px`,border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`,`color`],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:`none`},[`&.${sc.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.startIcon||e.loading&&e.loadingPosition===`start`,style:{"&::before":{content:`"\\200b"`,width:0,overflow:`hidden`}}},{props:{variant:`contained`},style:{color:`var(--variant-containedColor)`,backgroundColor:`var(--variant-containedBg)`,boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${sc.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${sc.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:`outlined`},style:{padding:`5px 15px`,border:`1px solid currentColor`,borderColor:`var(--variant-outlinedBorder, currentColor)`,backgroundColor:`var(--variant-outlinedBg)`,color:`var(--variant-outlinedColor)`,[`&.${sc.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:`text`},style:{padding:`6px 8px`,color:`var(--variant-textColor)`,backgroundColor:`var(--variant-textBg)`}},...Object.entries(e.palette).filter(qs()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:`inherit`},style:{color:`inherit`,borderColor:`currentColor`,"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:`small`,variant:`text`},style:{padding:`4px 5px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`text`},style:{padding:`8px 11px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`outlined`},style:{padding:`3px 9px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`outlined`},style:{padding:`7px 21px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`contained`},style:{padding:`4px 10px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`contained`},style:{padding:`8px 22px`,fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:`none`,"&:hover":{boxShadow:`none`},[`&.${sc.focusVisible}`]:{boxShadow:`none`},"&:active":{boxShadow:`none`},[`&.${sc.disabled}`]:{boxShadow:`none`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{loadingPosition:`center`},style:{transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`],{duration:e.transitions.duration.short}),[`&.${sc.loading}`]:{color:`transparent`}}}]}})),pc=Q(`span`,{name:`MuiButton`,slot:`StartIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart]}})(({theme:e})=>({display:`inherit`,marginRight:8,marginLeft:-4,variants:[{props:{size:`small`},style:{marginLeft:-2}},{props:{loadingPosition:`start`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`start`,loading:!0,fullWidth:!0},style:{marginRight:-8}},...dc]})),mc=Q(`span`,{name:`MuiButton`,slot:`EndIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd]}})(({theme:e})=>({display:`inherit`,marginRight:-4,marginLeft:8,variants:[{props:{size:`small`},style:{marginRight:-2}},{props:{loadingPosition:`end`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`end`,loading:!0,fullWidth:!0},style:{marginLeft:-8}},...dc]})),hc=Q(`span`,{name:`MuiButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,variants:[{props:{loading:!0},style:{display:`flex`}},{props:{loadingPosition:`start`},style:{left:14}},{props:{loadingPosition:`start`,size:`small`},style:{left:10}},{props:{variant:`text`,loadingPosition:`start`},style:{left:6}},{props:{loadingPosition:`center`},style:{left:`50%`,transform:`translate(-50%)`,color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:`end`},style:{right:14}},{props:{loadingPosition:`end`,size:`small`},style:{right:10}},{props:{variant:`text`,loadingPosition:`end`},style:{right:6}},{props:{loadingPosition:`start`,fullWidth:!0},style:{position:`relative`,left:-10}},{props:{loadingPosition:`end`,fullWidth:!0},style:{position:`relative`,right:-10}}]})),gc=Q(`span`,{name:`MuiButton`,slot:`LoadingIconPlaceholder`})({display:`inline-block`,width:`1em`,height:`1em`}),_c=f.forwardRef(function(e,t){let n=f.useContext(cc),r=f.useContext(lc),i=Bo({props:yn(n,e),name:`MuiButton`}),{children:a,color:o=`primary`,component:s=`button`,className:c,disabled:l=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:p,focusVisibleClassName:h,fullWidth:g=!1,id:_,loading:v=null,loadingIndicator:y,loadingPosition:b=`center`,size:x=`medium`,startIcon:S,type:C,variant:ee=`text`,...w}=i,T=Go(_),te=y??(0,m.jsx)(ac,{"aria-labelledby":T,color:`inherit`,size:16}),E={...i,color:o,component:s,disabled:l,disableElevation:u,disableFocusRipple:d,fullWidth:g,loading:v,loadingIndicator:te,loadingPosition:b,size:x,type:C,variant:ee},D=uc(E),O=(S||v&&b===`start`)&&(0,m.jsx)(pc,{className:D.startIcon,ownerState:E,children:S||(0,m.jsx)(gc,{className:D.loadingIconPlaceholder,ownerState:E})}),ne=(p||v&&b===`end`)&&(0,m.jsx)(mc,{className:D.endIcon,ownerState:E,children:p||(0,m.jsx)(gc,{className:D.loadingIconPlaceholder,ownerState:E})}),k=r||``,A=typeof v==`boolean`?(0,m.jsx)(`span`,{className:D.loadingWrapper,style:{display:`contents`},children:v&&(0,m.jsx)(hc,{className:D.loadingIndicator,ownerState:E,children:te})}):null,{root:j,...M}=D;return(0,m.jsxs)(fc,{ownerState:E,className:U(n.className,D.root,c,k),component:s,disabled:l||v,focusRipple:!d,focusVisibleClassName:U(D.focusVisible,h),ref:t,internalNativeButton:!0,type:C,id:v?T:_,...w,classes:M,children:[O,b!==`end`&&A,a,b===`end`&&A,ne]})});process.env.NODE_ENV!==`production`&&(_c.propTypes={children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`inherit`,`primary`,`secondary`,`success`,`error`,`info`,`warning`]),W.default.string]),component:W.default.elementType,disabled:W.default.bool,disableElevation:W.default.bool,disableFocusRipple:W.default.bool,disableRipple:W.default.bool,endIcon:W.default.node,focusVisibleClassName:W.default.string,fullWidth:W.default.bool,href:W.default.string,id:W.default.string,loading:W.default.bool,loadingIndicator:W.default.node,loadingPosition:W.default.oneOf([`center`,`end`,`start`]),size:W.default.oneOfType([W.default.oneOf([`small`,`medium`,`large`]),W.default.string]),startIcon:W.default.node,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),type:W.default.string,variant:W.default.oneOfType([W.default.oneOf([`contained`,`outlined`,`text`]),W.default.string])});function vc(e){return f.Children.toArray(e).filter(e=>f.isValidElement(e))}function yc(e){return ja(`MuiButtonGroup`,e)}var $=Vo(`MuiButtonGroup`,[`root`,`contained`,`outlined`,`text`,`disableElevation`,`disabled`,`firstButton`,`fullWidth`,`horizontal`,`vertical`,`colorPrimary`,`colorSecondary`,`grouped`,`lastButton`,`middleButton`]),bc=(e,t)=>{let{ownerState:n}=e;return[{[`& .${$.grouped}`]:t.grouped},{[`& .${$.firstButton}`]:t.firstButton},{[`& .${$.lastButton}`]:t.lastButton},{[`& .${$.middleButton}`]:t.middleButton},t.root,t[n.variant],n.disableElevation===!0&&t.disableElevation,n.fullWidth&&t.fullWidth,n.orientation===`vertical`&&t.vertical]},xc=e=>{let{classes:t,color:n,disabled:r,disableElevation:i,fullWidth:a,orientation:o,variant:s}=e;return bn({root:[`root`,s,o,a&&`fullWidth`,i&&`disableElevation`,`color${Tn(n)}`],grouped:[`grouped`,r&&`disabled`],firstButton:[`firstButton`],lastButton:[`lastButton`],middleButton:[`middleButton`]},yc,t)},Sc=Q(`div`,{name:`MuiButtonGroup`,slot:`Root`,overridesResolver:bc})(Ro(({theme:e})=>({display:`inline-flex`,borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:`contained`},style:{boxShadow:(e.vars||e).shadows[2],[`& .${$.grouped}`]:{boxShadow:`none`,"&:hover":{boxShadow:`none`}}}},{props:{disableElevation:!0},style:{boxShadow:`none`}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{orientation:`vertical`},style:{flexDirection:`column`,[`& .${$.lastButton},& .${$.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${$.lastButton},& .${$.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:`text`,orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRight:e.vars?`1px solid ${e.alpha(e.vars.palette.common.onBackground,.23)}`:`1px solid ${e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`}`,[`&.${$.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:`text`,orientation:`vertical`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottom:e.vars?`1px solid ${e.alpha(e.vars.palette.common.onBackground,.23)}`:`1px solid ${e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`}`,[`&.${$.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter(qs()).flatMap(([t])=>[{props:{variant:`text`,color:t},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderColor:e.alpha((e.vars||e).palette[t].main,.5)}}}]),{props:{variant:`outlined`,orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRightColor:`transparent`,"&:hover":{borderRightColor:`currentColor`}},[`& .${$.lastButton},& .${$.middleButton}`]:{marginLeft:-1}}},{props:{variant:`outlined`,orientation:`vertical`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottomColor:`transparent`,"&:hover":{borderBottomColor:`currentColor`}},[`& .${$.lastButton},& .${$.middleButton}`]:{marginTop:-1}}},{props:{variant:`contained`,orientation:`horizontal`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${$.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:`contained`,orientation:`vertical`},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${$.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter(qs([`dark`])).map(([t])=>({props:{variant:`contained`,color:t},style:{[`& .${$.firstButton},& .${$.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${$.grouped}`]:{minWidth:40}}))),Cc=f.forwardRef(function(e,t){let n=Bo({props:e,name:`MuiButtonGroup`}),{children:r,className:i,color:a=`primary`,component:o=`div`,disabled:s=!1,disableElevation:c=!1,disableFocusRipple:l=!1,disableRipple:u=!1,fullWidth:d=!1,orientation:p=`horizontal`,size:h=`medium`,variant:g=`outlined`,..._}=n,v={...n,color:a,component:o,disabled:s,disableElevation:c,disableFocusRipple:l,disableRipple:u,fullWidth:d,orientation:p,size:h,variant:g},y=xc(v),b=f.useMemo(()=>({className:y.grouped,color:a,disabled:s,disableElevation:c,disableFocusRipple:l,disableRipple:u,fullWidth:d,size:h,variant:g}),[a,s,c,l,u,d,h,g,y.grouped]),x=vc(r),S=x.length,C=e=>{let t=e===0,n=e===S-1;return t&&n?``:t?y.firstButton:n?y.lastButton:y.middleButton};return(0,m.jsx)(Sc,{as:o,role:`group`,className:U(y.root,i),ref:t,ownerState:v,..._,children:(0,m.jsx)(cc.Provider,{value:b,children:x.map((e,t)=>(0,m.jsx)(lc.Provider,{value:C(t),children:e},t))})})});process.env.NODE_ENV!==`production`&&(Cc.propTypes={children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`inherit`,`primary`,`secondary`,`error`,`info`,`success`,`warning`]),W.default.string]),component:W.default.elementType,disabled:W.default.bool,disableElevation:W.default.bool,disableFocusRipple:W.default.bool,disableRipple:W.default.bool,fullWidth:W.default.bool,orientation:W.default.oneOf([`horizontal`,`vertical`]),size:W.default.oneOfType([W.default.oneOf([`small`,`medium`,`large`]),W.default.string]),sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),variant:W.default.oneOfType([W.default.oneOf([`contained`,`outlined`,`text`]),W.default.string])});function wc(e){return typeof e==`string`}var Tc={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`};function Ec(e){if(e===void 0)return{};let t={};for(let n of Object.keys(e))Zo(n,e[n])&&(t[n]=e[n]);return t}function Dc(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Oc(e,t){if(!e||!t)return!1;if(e.contains(t))return!0;let n=t.getRootNode?.();if(n&&n instanceof ShadowRoot){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode??n.host??null}}return!1}var kc=Oc,Ac=2,jc=[],Mc={};function Nc(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function Pc(e,t){return e-t}function Fc(e,t,n=-1){let{index:r}=e.reduce((e,n,r)=>{let i=Math.abs(t-n);return e==null||i<=e.distance?{distance:i,index:r}:e},null)??Mc;return r==null?r:n>=0&&e[n]===e[r]?n:r}function Ic(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Lc(e,t,n){return(e-t)*100/(n-t)}function Rc(e,t,n){return(n-t)*e+t}function zc(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function Bc(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(zc(t)))}function Vc(e,t,n){let r=e.slice();return r[n]=t,r.sort(Pc)}function Hc(e,t,n,r){let i=Uo(Wo(e.current));if(!kc(e.current,i)||Number(i?.getAttribute(`data-index`))!==t){let n=e.current?.querySelector(`[type="range"][data-index="${t}"]`);n!=null&&(r==null?n.focus({preventScroll:!0}):n.focus({preventScroll:!0,focusVisible:r}))}n&&n(t)}function Uc(e,t){return typeof e==`number`&&typeof t==`number`?e===t:typeof e==`object`&&typeof t==`object`?Dc(e,t):!1}var Wc={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},Gc=e=>e;function Kc(e){let{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:a=!1,marks:o=!1,max:s=100,min:c=0,name:l,onChange:u,onChangeCommitted:d,orientation:p=`horizontal`,rootRef:m,scale:h=Gc,step:g=1,shiftStep:_=10,tabIndex:v,value:y}=e,b=f.useRef(void 0),x=f.useRef(null),[S,C]=f.useState(-1),[ee,w]=f.useState(-1),[T,te]=f.useState(!1),E=f.useRef(0),D=f.useRef(-1),O=f.useRef(!1),ne=f.useRef(-1),k=qo(()=>{x.current!=null&&(cancelAnimationFrame(x.current),x.current=null)}),A=f.useRef(null),[j,M]=Ko({controlled:y,default:n??c,name:`Slider`}),re=qo((e,t,n)=>{let r=`nativeEvent`in e?e.nativeEvent:e,i=new r.constructor(r.type,r);Object.defineProperty(i,"target",{writable:!0,value:{value:t,name:l}}),A.current=t,u?.(i,t,n)}),N=Array.isArray(j),P=f.useMemo(()=>{if(typeof j==`number`)return[ri(j,c,s)];if(j==null)return[c];let e=j.slice().sort(Pc);for(let t=0;t<e.length;t+=1){let n=e[t];e[t]=n==null?c:ri(n,c,s)}return e},[j,c,s]),ie=f.useMemo(()=>{if(o===!0&&g!=null){let e=Array(Math.floor((s-c)/g)+1);for(let t=0;t<e.length;t+=1)e[t]={value:c+g*t};return e}return Array.isArray(o)?o:jc},[o,g,c,s]),F=f.useMemo(()=>{let e=Array(ie.length);for(let t=0;t<ie.length;t+=1)e[t]=ie[t].value;return e},[ie]),[ae,oe]=f.useState(-1),I=f.useRef(null),L=Yo(m,I),se=e=>t=>{let n=Number(t.currentTarget.getAttribute(`data-index`));rs(t.target)&&oe(n),w(n),e?.onFocus?.(t)},ce=e=>t=>{rs(t.target)||oe(-1),w(-1),e?.onBlur?.(t)},R=(e,t)=>{let n=Number(e.currentTarget.getAttribute(`data-index`)),r=P[n],a=F.indexOf(r),o=t;if(ie&&g==null){let e=F[F.length-1];o=o>=e?e:o<=F[0]?F[0]:o<r?F[a-1]:F[a+1]}if(o=ri(o,c,s),N){i&&(o=ri(o,P[n-1]||-1/0,P[n+1]||1/0));let e=o;o=Vc(P,o,n);let t=n;i||(t=o.indexOf(e)),Hc(I,t)}M(o),oe(n),u&&!Uc(o,j)&&re(e,o,n),d&&d(e,A.current??o)},le=e=>t=>{if([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`].includes(t.key)){t.preventDefault();let e=P[Number(t.currentTarget.getAttribute(`data-index`))],n=null;if(g!=null){let r=t.shiftKey?_:g;switch(t.key){case`ArrowUp`:n=Nc(e,r,1,c,s);break;case`ArrowRight`:n=Nc(e,r,a?-1:1,c,s);break;case`ArrowDown`:n=Nc(e,r,-1,c,s);break;case`ArrowLeft`:n=Nc(e,r,a?1:-1,c,s);break;case`PageUp`:n=Nc(e,_,1,c,s);break;case`PageDown`:n=Nc(e,_,-1,c,s);break;case`Home`:n=c;break;case`End`:n=s;break;default:break}}else if(ie){let r=F[F.length-1],i=F.indexOf(e),o=[a?`ArrowRight`:`ArrowLeft`,`ArrowDown`,`PageDown`,`Home`],s=[a?`ArrowLeft`:`ArrowRight`,`ArrowUp`,`PageUp`,`End`];o.includes(t.key)?n=i===0?F[0]:F[i-1]:s.includes(t.key)&&(n=i===F.length-1?r:F[i+1])}n!=null&&R(t,n)}e?.onKeyDown?.(t)};sa(()=>{let e=Uo(Wo(I.current));r&&kc(I.current,e)&&e!=null&&`blur`in e&&e.blur()},[r]),r&&S!==-1&&C(-1),r&&ae!==-1&&oe(-1);let ue=e=>t=>{e.onChange?.(t),R(t,t.currentTarget.valueAsNumber)},de=f.useRef(void 0),z=p;a&&p===`horizontal`&&(z+=`-reverse`);let fe=e=>{let{current:t}=I;if(!t)return null;let{width:n,height:r,bottom:a,left:o}=t.getBoundingClientRect(),l;l=z.startsWith(`vertical`)?(a-e.y)/r:(e.x-o)/n,z.includes(`-reverse`)&&(l=1-l);let u;u=Rc(l,c,s),u=g?Bc(u,g,c):F[Fc(F,u)],u=ri(u,c,s);let d=0;if(N){let e=de.current!==-1;d=e?de.current:Fc(P,u,D.current),i&&(u=ri(u,P[d-1]||-1/0,P[d+1]||1/0));let t=u;u=Vc(P,u,d),i&&e||(d=u.indexOf(t),de.current=d)}return{newValue:u,activeIndex:d}},pe=qo(e=>{if(`pointerId`in e&&e.pointerId!==ne.current)return;let t=Ic(e,b);if(!t)return;if(E.current+=1,e.type===`pointermove`&&e.buttons===0){me(e);return}let n=fe(t);n&&(Hc(I,n.activeIndex,C,!1),D.current=n.activeIndex,M(n.newValue),!T&&E.current>Ac&&te(!0),u&&!Uc(n.newValue,j)&&re(e,n.newValue,n.activeIndex))}),me=qo(e=>{if(`pointerId`in e&&e.pointerId!==ne.current)return;let t=Ic(e,b);if(te(!1),!t)return;let n=fe(t);C(-1),e.type===`touchend`&&w(-1),n&&d&&d(e,A.current??n.newValue),`pointerType`in e&&I.current?.hasPointerCapture(e.pointerId)&&I.current.releasePointerCapture(e.pointerId),b.current=void 0,ne.current=-1,ge()}),he=qo(e=>{if(r)return;if(O.current){O.current=!1;let t=e.changedTouches[0];t!=null&&(b.current=t.identifier);return}let t=e.changedTouches[0];t!=null&&(b.current=t.identifier);let n=Ic(e,b);if(n!==!1){de.current=-1;let t=fe(n);t&&(Hc(I,t.activeIndex,C,!1),D.current=t.activeIndex,M(t.newValue),u&&!Uc(t.newValue,j)&&re(e,t.newValue,t.activeIndex))}E.current=0;let i=Wo(I.current);i.addEventListener(`touchmove`,pe,{passive:!0}),i.addEventListener(`touchend`,me,{passive:!0})}),ge=f.useCallback(()=>{let e=Wo(I.current);e.removeEventListener(`pointermove`,pe),e.removeEventListener(`pointerup`,me),e.removeEventListener(`touchmove`,pe),e.removeEventListener(`touchend`,me)},[me,pe]);f.useEffect(()=>{let e=I.current;if(e)return e.addEventListener(`touchstart`,he,{passive:!0}),()=>{e.removeEventListener(`touchstart`,he),k(),ge()}},[ge,he,k]),f.useEffect(()=>{r&&(ge(),k())},[r,ge,k]);let _e=e=>t=>{if(e.onPointerDown?.(t),t.pointerType===`touch`&&(O.current=!0),r||t.defaultPrevented||t.button!==0)return;let n=Ic(t,b);if(n!==!1){de.current=-1;let e=fe(n);if(e){let n=I.current?.querySelector(`input[type="range"][data-index="${e.activeIndex}"]`),r=Wo(I.current),i=n!=null&&n===Uo(r);C(e.activeIndex),D.current=e.activeIndex,i?t.preventDefault():(k(),x.current=requestAnimationFrame(()=>{x.current=null,Hc(I,e.activeIndex,void 0,!1)})),M(e.newValue),u&&!Uc(e.newValue,j)&&re(t,e.newValue,e.activeIndex)}}E.current=0,ne.current=t.pointerId;let i=Wo(I.current);try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}i.addEventListener(`pointermove`,pe,{passive:!0}),i.addEventListener(`pointerup`,me)},ve=Lc(N?P[0]:c,c,s),ye=Lc(P[P.length-1],c,s)-ve,be=(e=Mc)=>{let t=Ec(e),n={onPointerDown:_e(t)},r={...t,...n};return{...e,ref:L,...r}},xe=e=>t=>{e.onMouseOver?.(t),w(Number(t.currentTarget.getAttribute(`data-index`)))},Se=e=>t=>{e.onMouseLeave?.(t),w(-1)},Ce=(e=Mc)=>{let t=Ec(e),n={onMouseOver:xe(t),onMouseLeave:Se(t)};return{...e,...t,...n}},we=e=>{let t;return N?S===e?t=2:D.current===e&&(t=1):S===e&&(t=1),{pointerEvents:S!==-1&&S!==e?`none`:void 0,zIndex:t}},Te;return p===`vertical`&&(Te=a?`vertical-rl`:`vertical-lr`),{active:S,axis:z,axisProps:Wc,dragging:T,focusedThumbIndex:ae,getHiddenInputProps:(n=Mc)=>{let i=Ec(n),o={onChange:ue(i),onFocus:se(i),onBlur:ce(i),onKeyDown:le(i)},u={...i,...o};return{tabIndex:v,"aria-labelledby":t,"aria-orientation":p,"aria-valuemax":h(s),"aria-valuemin":h(c),name:l,type:`range`,min:e.min,max:e.max,step:e.step===null&&e.marks?`any`:e.step??void 0,disabled:r,...n,...u,style:{...Tc,direction:a?`rtl`:`ltr`,width:`100%`,height:`100%`,writingMode:Te}}},getRootProps:be,getThumbProps:Ce,marks:ie,open:ee,range:N,rootRef:L,trackLeap:ye,trackOffset:ve,values:P,getThumbStyle:we}}function qc(e,t,n){return e===void 0||wc(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Jc(e,t,n){return typeof e==`function`?e(t,n):e}function Yc(e){if(e===void 0)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&typeof e[t]==`function`)).forEach(n=>{t[n]=e[n]}),t}function Xc(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=U(n?.className,a,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},o={...n,...i,...r};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}let o=Ec({...i,...r}),s=Yc(r),c=Yc(i),l=t(o),u=U(l?.className,n?.className,a,i?.className,r?.className),d={...l?.style,...n?.style,...i?.style,...r?.style},f={...l,...n,...c,...s};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}function Zc(e,t){let{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...c}=t,{component:l,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=a,p=u[e]||r,m=Jc(d[e],i),{props:{component:h,...g},internalRef:_}=Xc({className:n,...c,externalForwardedProps:e===`root`?f:void 0,externalSlotProps:m}),v=Yo(_,m?.ref,t.ref),y=e===`root`?h||l:h;return[p,qc(p,{...e===`root`&&!l&&!u[e]&&o,...e!==`root`&&!u[e]&&o,...g,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},i)]}function Qc(e){return ja(`MuiSlider`,e)}var $c=Vo(`MuiSlider`,`root.active.colorPrimary.colorSecondary.colorError.colorInfo.colorSuccess.colorWarning.disabled.dragging.focusVisible.mark.markActive.marked.markLabel.markLabelActive.rail.sizeSmall.thumb.track.trackInverted.trackFalse.valueLabel.valueLabelOpen.valueLabelCircle.valueLabelLabel.vertical`.split(`.`)),el=e=>{let{open:t}=e;return{offset:U(t&&$c.valueLabelOpen),circle:$c.valueLabelCircle,label:$c.valueLabelLabel}};function tl(e){let{children:t,className:n,value:r}=e,i=el(e);return t?f.cloneElement(t,{className:t.props.className},(0,m.jsxs)(f.Fragment,{children:[t.props.children,(0,m.jsx)(`span`,{className:U(i.offset,n),"aria-hidden":!0,children:(0,m.jsx)(`span`,{className:i.circle,children:(0,m.jsx)(`span`,{className:i.label,children:r})})})]})):null}process.env.NODE_ENV!==`production`&&(tl.propTypes={children:W.default.element.isRequired,className:W.default.string,value:W.default.node});function nl(e){return e}var rl=Q(`span`,{name:`MuiSlider`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${Tn(n.color)}`],n.size!==`medium`&&t[`size${Tn(n.size)}`],n.marked&&t.marked,n.orientation===`vertical`&&t.vertical,n.track===`inverted`&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Ro(({theme:e})=>({borderRadius:12,boxSizing:`content-box`,display:`inline-block`,position:`relative`,cursor:`pointer`,touchAction:`none`,WebkitTapHighlightColor:`transparent`,"@media print":{colorAdjust:`exact`},[`&.${$c.disabled}`]:{pointerEvents:`none`,cursor:`default`,color:(e.vars||e).palette.grey[400]},[`&.${$c.dragging}`]:{[`& .${$c.thumb}, & .${$c.track}`]:{transition:`none`}},variants:[...Object.entries(e.palette).filter(qs()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:`horizontal`},style:{height:4,width:`100%`,padding:`13px 0`,"@media (pointer: coarse)":{padding:`20px 0`}}},{props:{orientation:`horizontal`,size:`small`},style:{height:2}},{props:{orientation:`horizontal`,marked:!0},style:{marginBottom:20}},{props:{orientation:`vertical`},style:{height:`100%`,width:4,padding:`0 13px`,"@media (pointer: coarse)":{padding:`0 20px`}}},{props:{orientation:`vertical`,size:`small`},style:{width:2}},{props:{orientation:`vertical`,marked:!0},style:{marginRight:44}}]}))),il=Q(`span`,{name:`MuiSlider`,slot:`Rail`})({display:`block`,position:`absolute`,borderRadius:`inherit`,backgroundColor:`currentColor`,opacity:.38,"@media (forced-colors: active)":{border:`1px solid transparent`,boxSizing:`border-box`},variants:[{props:{orientation:`horizontal`},style:{width:`100%`,height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{height:`100%`,width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:`inverted`},style:{opacity:1}}]}),al=Q(`span`,{name:`MuiSlider`,slot:`Track`})(Ro(({theme:e})=>({display:`block`,position:`absolute`,borderRadius:`inherit`,border:`1px solid currentColor`,backgroundColor:`currentColor`,transition:e.transitions.create([`left`,`width`,`bottom`,`height`],{duration:e.transitions.duration.shortest}),variants:[{props:{size:`small`},style:{"@media (forced-colors: none)":{border:`none`}}},{props:{orientation:`horizontal`},style:{height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:!1},style:{display:`none`}},...Object.entries(e.palette).filter(qs()).map(([t])=>({props:{color:t,track:`inverted`},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles(`dark`,{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles(`dark`,{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),ol=Q(`span`,{name:`MuiSlider`,slot:`Thumb`})(Ro(({theme:e})=>({position:`absolute`,width:20,height:20,boxSizing:`border-box`,borderRadius:`50%`,outline:0,backgroundColor:`currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:e.transitions.create([`box-shadow`,`left`,`bottom`],{duration:e.transitions.duration.shortest}),"@media (forced-colors: active)":{border:`1px solid ButtonBorder`},"&::before":{position:`absolute`,content:`""`,borderRadius:`inherit`,width:`100%`,height:`100%`,boxShadow:(e.vars||e).shadows[2]},"&::after":{position:`absolute`,content:`""`,borderRadius:`50%`,width:42,height:42,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`},[`&.${$c.disabled}`]:{"&:hover":{boxShadow:`none`}},variants:[{props:{size:`small`},style:{width:12,height:12,"&::before":{boxShadow:`none`}}},{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-50%, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 50%)`}},...Object.entries(e.palette).filter(qs()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${$c.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:`none`}},[`&.${$c.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),sl=Q(tl,{name:`MuiSlider`,slot:`ValueLabel`})(Ro(({theme:e})=>({zIndex:1,whiteSpace:`nowrap`,...e.typography.body2,fontWeight:500,transition:e.transitions.create([`transform`],{duration:e.transitions.duration.shortest}),position:`absolute`,backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0.25rem 0.75rem`,variants:[{props:{orientation:`horizontal`},style:{transform:`translateY(-100%) scale(0)`,top:`-10px`,transformOrigin:`bottom center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, 50%) rotate(45deg)`,backgroundColor:`inherit`,bottom:0,left:`50%`},[`&.${$c.valueLabelOpen}`]:{transform:`translateY(-100%) scale(1)`}}},{props:{orientation:`vertical`},style:{transform:`translateY(-50%) scale(0)`,right:`30px`,top:`50%`,transformOrigin:`right center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, -50%) rotate(45deg)`,backgroundColor:`inherit`,right:-8,top:`50%`},[`&.${$c.valueLabelOpen}`]:{transform:`translateY(-50%) scale(1)`}}},{props:{size:`small`},style:{fontSize:e.typography.pxToRem(12),padding:`0.25rem 0.5rem`}},{props:{orientation:`vertical`,size:`small`},style:{right:`20px`}}]})));process.env.NODE_ENV!==`production`&&(sl.propTypes={children:W.default.element.isRequired,index:W.default.number.isRequired,open:W.default.bool.isRequired,value:W.default.node});var cl=Q(`span`,{name:`MuiSlider`,slot:`Mark`,shouldForwardProp:e=>Io(e)&&e!==`markActive`,overridesResolver:(e,t)=>{let{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Ro(({theme:e})=>({position:`absolute`,width:2,height:2,borderRadius:1,backgroundColor:`currentColor`,variants:[{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-1px, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 1px)`}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),ll=Q(`span`,{name:`MuiSlider`,slot:`MarkLabel`,shouldForwardProp:e=>Io(e)&&e!==`markLabelActive`})(Ro(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:`absolute`,whiteSpace:`nowrap`,variants:[{props:{orientation:`horizontal`},style:{top:30,transform:`translateX(-50%)`,"@media (pointer: coarse)":{top:40}}},{props:{orientation:`vertical`},style:{left:36,transform:`translateY(50%)`,"@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),ul=e=>{let{disabled:t,dragging:n,marked:r,orientation:i,track:a,classes:o,color:s,size:c}=e;return bn({root:[`root`,t&&`disabled`,n&&`dragging`,r&&`marked`,i===`vertical`&&`vertical`,a===`inverted`&&`trackInverted`,a===!1&&`trackFalse`,s&&`color${Tn(s)}`,c&&`size${Tn(c)}`],rail:[`rail`],track:[`track`],mark:[`mark`],markActive:[`markActive`],markLabel:[`markLabel`],markLabelActive:[`markLabelActive`],valueLabel:[`valueLabel`],thumb:[`thumb`,t&&`disabled`],active:[`active`],disabled:[`disabled`],focusVisible:[`focusVisible`]},Qc,o)},dl=({children:e})=>e,fl=f.forwardRef(function(e,t){let n=Bo({props:e,name:`MuiSlider`}),r=ua(),{"aria-label":i,"aria-valuetext":a,"aria-labelledby":o,color:s=`primary`,classes:c,className:l,disableSwap:u=!1,disabled:d=!1,getAriaLabel:p,getAriaValueText:h,marks:g=!1,max:_=100,min:v=0,name:y,onChange:b,onChangeCommitted:x,orientation:S=`horizontal`,shiftStep:C=10,size:ee=`medium`,step:w=1,scale:T=nl,slotProps:te={},slots:E={},tabIndex:D,track:O=`normal`,value:ne,valueLabelDisplay:k=`off`,valueLabelFormat:A=nl,...j}=n,M={...n,isRtl:r,max:_,min:v,classes:c,disabled:d,disableSwap:u,orientation:S,marks:g,color:s,size:ee,step:w,shiftStep:C,scale:T,track:O,valueLabelDisplay:k,valueLabelFormat:A},{axisProps:re,getRootProps:N,getHiddenInputProps:P,getThumbProps:ie,open:F,active:ae,axis:oe,focusedThumbIndex:I,range:L,dragging:se,marks:ce,values:R,trackOffset:le,trackLeap:ue,getThumbStyle:de}=Kc({...M,rootRef:t});M.marked=ce.length>0&&ce.some(e=>e.label),M.dragging=se,M.focusedThumbIndex=I;let z=ul(M),fe={slots:E,slotProps:te},[pe,me]=Zc(`root`,{elementType:rl,getSlotProps:N,externalForwardedProps:{...fe,...j},ownerState:M,className:[z.root,l]}),[he,ge]=Zc(`rail`,{elementType:il,externalForwardedProps:fe,ownerState:M,className:z.rail}),[_e,ve]=Zc(`track`,{elementType:al,externalForwardedProps:fe,additionalProps:{style:{...re[oe].offset(le),...re[oe].leap(ue)}},ownerState:M,className:z.track}),[ye,be]=Zc(`thumb`,{elementType:ol,getSlotProps:ie,externalForwardedProps:fe,ownerState:M,className:z.thumb}),[xe,Se]=Zc(`valueLabel`,{elementType:sl,externalForwardedProps:fe,ownerState:M,className:z.valueLabel}),[Ce,we]=Zc(`mark`,{elementType:cl,externalForwardedProps:fe,ownerState:M,className:z.mark}),[Te,Ee]=Zc(`markLabel`,{elementType:ll,externalForwardedProps:fe,ownerState:M,className:z.markLabel}),[B,De]=Zc(`input`,{elementType:`input`,getSlotProps:P,externalForwardedProps:fe,ownerState:M});return(0,m.jsxs)(pe,{...me,children:[(0,m.jsx)(he,{...ge}),(0,m.jsx)(_e,{...ve}),ce.filter(e=>e.value>=v&&e.value<=_).map((e,t)=>{let n=Lc(e.value,v,_),r=re[oe].offset(n),i;return i=O===!1?R.includes(e.value):O===`normal`&&(L?e.value>=R[0]&&e.value<=R[R.length-1]:e.value<=R[0])||O===`inverted`&&(L?e.value<=R[0]||e.value>=R[R.length-1]:e.value>=R[0]),(0,m.jsxs)(f.Fragment,{children:[(0,m.jsx)(Ce,{"data-index":t,...we,...!wc(Ce)&&{markActive:i},style:{...r,...we.style},className:U(we.className,i&&z.markActive)}),e.label==null?null:(0,m.jsx)(Te,{"aria-hidden":!0,"data-index":t,...Ee,...!wc(Te)&&{markLabelActive:i},style:{...r,...Ee.style},className:U(z.markLabel,Ee.className,i&&z.markLabelActive),children:e.label})]},t)}),R.map((e,t)=>{let n=Lc(e,v,_),r=re[oe].offset(n),s=k===`off`?dl:xe;return(0,m.jsx)(s,{...!wc(s)&&{valueLabelFormat:A,valueLabelDisplay:k,value:typeof A==`function`?A(T(e),t):A,index:t,open:F===t||ae===t||k===`on`,disabled:d},...Se,children:(0,m.jsx)(ye,{"data-index":t,...be,className:U(z.thumb,be.className,ae===t&&z.active,I===t&&z.focusVisible),style:{...r,...de(t),...be.style},children:(0,m.jsx)(B,{"data-index":t,"aria-label":p?p(t):i,"aria-valuenow":T(e),"aria-labelledby":o,"aria-valuetext":h?h(T(e),t):a,value:R[t],...De})})},t)})]})});process.env.NODE_ENV!==`production`&&(fl.propTypes={"aria-label":$o(W.default.string,e=>Array.isArray(e.value||e.defaultValue)&&e[`aria-label`]!=null?Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":W.default.string,"aria-valuetext":$o(W.default.string,e=>Array.isArray(e.value||e.defaultValue)&&e[`aria-valuetext`]!=null?Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`primary`,`secondary`,`error`,`info`,`success`,`warning`]),W.default.string]),defaultValue:W.default.oneOfType([W.default.arrayOf(W.default.number),W.default.number]),disabled:W.default.bool,disableSwap:W.default.bool,getAriaLabel:W.default.func,getAriaValueText:W.default.func,marks:W.default.oneOfType([W.default.arrayOf(W.default.shape({label:W.default.node,value:W.default.number.isRequired})),W.default.bool]),max:W.default.number,min:W.default.number,name:W.default.string,onChange:W.default.func,onChangeCommitted:W.default.func,orientation:W.default.oneOf([`horizontal`,`vertical`]),scale:W.default.func,shiftStep:W.default.number,size:W.default.oneOfType([W.default.oneOf([`small`,`medium`]),W.default.string]),slotProps:W.default.shape({input:W.default.oneOfType([W.default.func,W.default.object]),mark:W.default.oneOfType([W.default.func,W.default.object]),markLabel:W.default.oneOfType([W.default.func,W.default.object]),rail:W.default.oneOfType([W.default.func,W.default.object]),root:W.default.oneOfType([W.default.func,W.default.object]),thumb:W.default.oneOfType([W.default.func,W.default.object]),track:W.default.oneOfType([W.default.func,W.default.object]),valueLabel:W.default.oneOfType([W.default.func,W.default.shape({children:W.default.element,className:W.default.string,open:W.default.bool,style:W.default.object,value:W.default.node,valueLabelDisplay:W.default.oneOf([`auto`,`off`,`on`])})])}),slots:W.default.shape({input:W.default.elementType,mark:W.default.elementType,markLabel:W.default.elementType,rail:W.default.elementType,root:W.default.elementType,thumb:W.default.elementType,track:W.default.elementType,valueLabel:W.default.elementType}),step:W.default.number,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),tabIndex:W.default.number,track:W.default.oneOf([`inverted`,`normal`,!1]),value:W.default.oneOfType([W.default.arrayOf(W.default.number),W.default.number]),valueLabelDisplay:W.default.oneOf([`auto`,`off`,`on`]),valueLabelFormat:W.default.oneOfType([W.default.func,W.default.string])});function pl(e){return ja(`MuiTypography`,e)}Vo(`MuiTypography`,[`root`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`subtitle1`,`subtitle2`,`body1`,`body2`,`inherit`,`button`,`caption`,`overline`,`alignLeft`,`alignRight`,`alignCenter`,`alignJustify`,`noWrap`,`gutterBottom`]);var ml=e=>{let{align:t,gutterBottom:n,noWrap:r,variant:i,classes:a}=e;return bn({root:[`root`,i,e.align!==`inherit`&&`align${Tn(t)}`,n&&`gutterBottom`,r&&`noWrap`]},pl,a)},hl=Q(`span`,{name:`MuiTypography`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!==`inherit`&&t[`align${Tn(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom]}})(Ro(({theme:e})=>({margin:0,variants:[{props:{variant:`inherit`},style:{font:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},...Object.entries(e.typography).filter(([e,t])=>e!==`inherit`&&t&&typeof t==`object`).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(qs()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>typeof e==`string`).map(([t])=>({props:{color:`text${Tn(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>e.align!==`inherit`,style:{textAlign:`var(--Typography-textAlign)`}},{props:({ownerState:e})=>e.noWrap,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:`0.35em`}}]}))),gl={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,subtitle1:`h6`,subtitle2:`h6`,body1:`p`,body2:`p`,inherit:`p`},_l=f.forwardRef(function(e,t){let n=Bo({props:e,name:`MuiTypography`}),{color:r,align:i=`inherit`,className:a,component:o,gutterBottom:s=!1,noWrap:c=!1,variant:l=`body1`,variantMapping:u=gl,...d}=n,f={...n,align:i,color:r,className:a,component:o,gutterBottom:s,noWrap:c,variant:l,variantMapping:u};return(0,m.jsx)(hl,{as:o||u[l]||gl[l]||`span`,ref:t,className:U(ml(f).root,a),...d,ownerState:f,style:{...i!==`inherit`&&{"--Typography-textAlign":i},...d.style}})});process.env.NODE_ENV!==`production`&&(_l.propTypes={align:W.default.oneOf([`center`,`inherit`,`justify`,`left`,`right`]),children:W.default.node,classes:W.default.object,className:W.default.string,color:W.default.oneOfType([W.default.oneOf([`primary`,`secondary`,`success`,`error`,`info`,`warning`,`textPrimary`,`textSecondary`,`textDisabled`]),W.default.string]),component:W.default.elementType,gutterBottom:W.default.bool,noWrap:W.default.bool,style:W.default.object,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object]),variant:W.default.oneOfType([W.default.oneOf([`body1`,`body2`,`button`,`caption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`inherit`,`overline`,`subtitle1`,`subtitle2`]),W.default.string]),variantMapping:W.default.object});var vl=Vo(`MuiBox`,[`root`]),yl=(0,h.createBox)({themeId:yo,defaultTheme:_o(),defaultClassName:vl.root,generateClassName:Sn.generate});process.env.NODE_ENV!==`production`&&(yl.propTypes={children:W.default.node,component:W.default.elementType,sx:W.default.oneOfType([W.default.arrayOf(W.default.oneOfType([W.default.func,W.default.object,W.default.bool])),W.default.func,W.default.object])});var bl=({showLayer:e,setShowLayer:t,scale:n,setScale:r,rotation:i,setRotation:a,mapPosition:o,setMapPosition:s,position:c,setPosition:l,enableTransformControls:f,setEnableTransformControls:p,transformMode:h,setTransformMode:g,layerName:_=`Layer`})=>{let{scene:v,worldMatrixInv:b}=O(),x=(0,d.useRef)(void 0),[S,C]=(0,d.useState)(!1);return(0,d.useLayoutEffect)(()=>{if(!v||!b||!f){x.current&&(v?.remove(x.current),x.current.geometry.dispose(),x.current.material.dispose(),x.current=void 0,C(!1));return}let e=new u.BoxGeometry(1,1,1),t=new u.MeshBasicMaterial({visible:!1}),r=new u.Mesh(e,t),a=y.toScenePosition(b,[o.lng,o.lat],0);return r.position.set(a.x+c.x,a.y+c.y,a.z+c.z),r.rotation.set(i.x*Math.PI/180,i.y*Math.PI/180,i.z*Math.PI/180),r.scale.set(n,n,n),v.add(r),x.current=r,C(!0),()=>{x.current&&(v.remove(x.current),x.current.geometry.dispose(),x.current.material.dispose(),x.current=void 0,C(!1))}},[v,b,f]),(0,d.useLayoutEffect)(()=>{if(!x.current||!b)return;let e=y.toScenePosition(b,[o.lng,o.lat],0);x.current.position.set(e.x+c.x,e.y+c.y,e.z+c.z),x.current.rotation.set(i.x*Math.PI/180,i.y*Math.PI/180,i.z*Math.PI/180),x.current.scale.set(n,n,n),x.current.updateMatrixWorld(!0)},[c,i,n,o,b]),(0,m.jsxs)(m.Fragment,{children:[S&&x.current&&f&&(0,m.jsx)(sn,{target:x.current,mode:h||`translate`,enabled:f,onObjectChange:e=>{if(!b)return;let t=y.toScenePosition(b,[o.lng,o.lat],0);l({x:e.position.x-t.x,y:e.position.y-t.y,z:e.position.z-t.z}),a({x:e.rotation.x*180/Math.PI,y:e.rotation.y*180/Math.PI,z:e.rotation.z*180/Math.PI}),r(e.scale.x)}}),(0,m.jsxs)(yl,{sx:{padding:`10px`},children:[(0,m.jsxs)(yl,{sx:{display:`flex`,gap:1,flexWrap:`wrap`,marginBottom:2},children:[(0,m.jsxs)(_c,{color:`primary`,variant:e?`contained`:`outlined`,onClick:()=>t(!e),size:`small`,children:[e?`Hide`:`Show`,` `,_]}),p&&(0,m.jsx)(_c,{color:`info`,variant:f?`contained`:`outlined`,onClick:()=>p(!f),size:`small`,children:`3D Gizmo`})]}),g&&f&&(0,m.jsx)(yl,{sx:{marginBottom:2},children:(0,m.jsxs)(Cc,{variant:`outlined`,size:`small`,fullWidth:!0,"aria-label":`transform mode`,children:[(0,m.jsx)(_c,{variant:h===`translate`?`contained`:`outlined`,onClick:()=>g(`translate`),children:`Move`}),(0,m.jsx)(_c,{variant:h===`rotate`?`contained`:`outlined`,onClick:()=>g(`rotate`),children:`Rotate`}),(0,m.jsx)(_c,{variant:h===`scale`?`contained`:`outlined`,onClick:()=>g(`scale`),children:`Scale`})]})}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Scale: `,n.toFixed(2)]}),(0,m.jsx)(fl,{value:n,onChange:(e,t)=>r(t),min:.01,max:150,step:.01,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Rotation X: `,i.x,`°`]}),(0,m.jsx)(fl,{value:i.x,onChange:(e,t)=>a({...i,x:t}),min:0,max:360,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Rotation Y: `,i.y,`°`]}),(0,m.jsx)(fl,{value:i.y,onChange:(e,t)=>a({...i,y:t}),min:0,max:360,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Rotation Z: `,i.z,`°`]}),(0,m.jsx)(fl,{value:i.z,onChange:(e,t)=>a({...i,z:t}),min:0,max:360,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Longitude: `,o.lng.toFixed(6)]}),(0,m.jsx)(fl,{value:o.lng,onChange:(e,t)=>s({...o,lng:t}),min:7.09,max:7.11,step:1e-4,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Latitude: `,o.lat.toFixed(6)]}),(0,m.jsx)(fl,{value:o.lat,onChange:(e,t)=>s({...o,lat:t}),min:50.73,max:50.74,step:1e-4,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Position X: `,c.x]}),(0,m.jsx)(fl,{value:c.x,onChange:(e,t)=>l({...c,x:t}),min:-100,max:100,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Position Y: `,c.y]}),(0,m.jsx)(fl,{value:c.y,onChange:(e,t)=>l({...c,y:t}),min:-100,max:100,valueLabelDisplay:`auto`}),(0,m.jsxs)(_l,{gutterBottom:!0,children:[`Position Z: `,c.z]}),(0,m.jsx)(fl,{value:c.z,onChange:(e,t)=>l({...c,z:t}),min:-500,max:100,valueLabelDisplay:`auto`})]})]})};exports.MlThreeGizmo=sn,exports.MlThreeModelLayer=lt,exports.MlThreeObjectControls=bl,exports.MlThreeSplatLayer=Ot,exports.ThreeContext=D,exports.ThreeProvider=ne,exports.useThree=O;