@tscircuit/runframe 0.0.279 → 0.0.280
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.
|
@@ -13024,7 +13024,7 @@ ${l.join(`
|
|
|
13024
13024
|
`)!==-1&&(r=r.replace(/\r\n/g,`
|
|
13025
13025
|
`)),r.indexOf(`\\
|
|
13026
13026
|
`)!==-1&&(r=r.replace(/\\\n/g,""));const t=r.split(`
|
|
13027
|
-
`);let n="",i="",a=0,o=[];const s=typeof"".trimLeft=="function";for(let u=0,f=t.length;u<f;u++)if(n=t[u],n=s?n.trimLeft():n.trim(),a=n.length,a!==0&&(i=n.charAt(0),i!=="#"))if(i==="v"){const v=n.split(/\s+/);switch(v[0]){case"v":e.vertices.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])),v.length>=7?e.colors.push(parseFloat(v[4]),parseFloat(v[5]),parseFloat(v[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3]));break;case"vt":e.uvs.push(parseFloat(v[1]),parseFloat(v[2]));break}}else if(i==="f"){const _=n.substr(1).trim().split(/\s+/),x=[];for(let w=0,T=_.length;w<T;w++){const D=_[w];if(D.length>0){const O=D.split("/");x.push(O)}}const M=x[0];for(let w=1,T=x.length-1;w<T;w++){const D=x[w],O=x[w+1];e.addFace(M[0],D[0],O[0],M[1],D[1],O[1],M[2],D[2],O[2])}}else if(i==="l"){const v=n.substring(1).trim().split(" ");let _=[];const x=[];if(n.indexOf("/")===-1)_=v;else for(let M=0,w=v.length;M<w;M++){const T=v[M].split("/");T[0]!==""&&_.push(T[0]),T[1]!==""&&x.push(T[1])}e.addLineGeometry(_,x)}else if(i==="p"){const _=n.substr(1).trim().split(" ");e.addPointGeometry(_)}else if((o=zbt.exec(n))!==null){const v=(" "+o[0].substr(1).trim()).substr(1);e.startObject(v)}else if(Ibt.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(Ubt.test(n))e.materialLibraries.push(n.substring(7).trim());else if(kbt.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(i==="s"){if(o=n.split(" "),o.length>1){const _=o[1].trim().toLowerCase();e.object.smooth=_!=="0"&&_!=="off"}else e.object.smooth=!0;const v=e.object.currentMaterial();v&&(v.smooth=e.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}e.finalize();const l=new FE;if(l.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let u=0,f=e.objects.length;u<f;u++){const v=e.objects[u],_=v.geometry,x=v.materials,M=_.type==="Line",w=_.type==="Points";let T=!1;if(_.vertices.length===0)continue;const D=new Rh;D.setAttribute("position",new Rc(_.vertices,3)),_.normals.length>0&&D.setAttribute("normal",new Rc(_.normals,3)),_.colors.length>0&&(T=!0,D.setAttribute("color",new Rc(_.colors,3))),_.hasUVIndices===!0&&D.setAttribute("uv",new Rc(_.uvs,2));const O=[];for(let W=0,$=x.length;W<$;W++){const Z=x[W],J=Z.name+"_"+Z.smooth+"_"+T;let ae=e.materials[J];if(this.materials!==null){if(ae=this.materials.create(Z.name),M&&ae&&!(ae instanceof Sx)){const K=new Sx;a2.prototype.copy.call(K,ae),K.color.copy(ae.color),ae=K}else if(w&&ae&&!(ae instanceof qE)){const K=new qE({size:10,sizeAttenuation:!1});a2.prototype.copy.call(K,ae),K.color.copy(ae.color),K.map=ae.map,ae=K}}ae===void 0&&(M?ae=new Sx:w?ae=new qE({size:1,sizeAttenuation:!1}):ae=new QD,ae.name=Z.name,ae.flatShading=!Z.smooth,ae.vertexColors=T,e.materials[J]=ae),O.push(ae)}let B;if(O.length>1){for(let W=0,$=x.length;W<$;W++){const Z=x[W];D.addGroup(Z.groupStart,Z.groupCount,W)}M?B=new B3(D,O):w?B=new k6(D,O):B=new Xg(D,O)}else M?B=new B3(D,O[0]):w?B=new k6(D,O[0]):B=new Xg(D,O[0]);B.name=v.name,l.add(B)}else if(e.vertices.length>0){const u=new qE({size:1,sizeAttenuation:!1}),f=new Rh;f.setAttribute("position",new Rc(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(f.setAttribute("color",new Rc(e.colors,3)),u.vertexColors=!0);const v=new k6(f,u);l.add(v)}return l}};function Hbt({stlUrl:r,mtlUrl:e,color:t,opacity:n=1}){const i=AQ(Dbt,r),a=Et.useRef();return ft.jsxs("mesh",{ref:a,children:[ft.jsx("primitive",{object:i,attach:"geometry"}),ft.jsx("meshStandardMaterial",{color:t,transparent:n!==1,opacity:n})]})}var jbt={version:"0.0.
|
|
13027
|
+
`);let n="",i="",a=0,o=[];const s=typeof"".trimLeft=="function";for(let u=0,f=t.length;u<f;u++)if(n=t[u],n=s?n.trimLeft():n.trim(),a=n.length,a!==0&&(i=n.charAt(0),i!=="#"))if(i==="v"){const v=n.split(/\s+/);switch(v[0]){case"v":e.vertices.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3])),v.length>=7?e.colors.push(parseFloat(v[4]),parseFloat(v[5]),parseFloat(v[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(v[1]),parseFloat(v[2]),parseFloat(v[3]));break;case"vt":e.uvs.push(parseFloat(v[1]),parseFloat(v[2]));break}}else if(i==="f"){const _=n.substr(1).trim().split(/\s+/),x=[];for(let w=0,T=_.length;w<T;w++){const D=_[w];if(D.length>0){const O=D.split("/");x.push(O)}}const M=x[0];for(let w=1,T=x.length-1;w<T;w++){const D=x[w],O=x[w+1];e.addFace(M[0],D[0],O[0],M[1],D[1],O[1],M[2],D[2],O[2])}}else if(i==="l"){const v=n.substring(1).trim().split(" ");let _=[];const x=[];if(n.indexOf("/")===-1)_=v;else for(let M=0,w=v.length;M<w;M++){const T=v[M].split("/");T[0]!==""&&_.push(T[0]),T[1]!==""&&x.push(T[1])}e.addLineGeometry(_,x)}else if(i==="p"){const _=n.substr(1).trim().split(" ");e.addPointGeometry(_)}else if((o=zbt.exec(n))!==null){const v=(" "+o[0].substr(1).trim()).substr(1);e.startObject(v)}else if(Ibt.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(Ubt.test(n))e.materialLibraries.push(n.substring(7).trim());else if(kbt.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(i==="s"){if(o=n.split(" "),o.length>1){const _=o[1].trim().toLowerCase();e.object.smooth=_!=="0"&&_!=="off"}else e.object.smooth=!0;const v=e.object.currentMaterial();v&&(v.smooth=e.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}e.finalize();const l=new FE;if(l.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let u=0,f=e.objects.length;u<f;u++){const v=e.objects[u],_=v.geometry,x=v.materials,M=_.type==="Line",w=_.type==="Points";let T=!1;if(_.vertices.length===0)continue;const D=new Rh;D.setAttribute("position",new Rc(_.vertices,3)),_.normals.length>0&&D.setAttribute("normal",new Rc(_.normals,3)),_.colors.length>0&&(T=!0,D.setAttribute("color",new Rc(_.colors,3))),_.hasUVIndices===!0&&D.setAttribute("uv",new Rc(_.uvs,2));const O=[];for(let W=0,$=x.length;W<$;W++){const Z=x[W],J=Z.name+"_"+Z.smooth+"_"+T;let ae=e.materials[J];if(this.materials!==null){if(ae=this.materials.create(Z.name),M&&ae&&!(ae instanceof Sx)){const K=new Sx;a2.prototype.copy.call(K,ae),K.color.copy(ae.color),ae=K}else if(w&&ae&&!(ae instanceof qE)){const K=new qE({size:10,sizeAttenuation:!1});a2.prototype.copy.call(K,ae),K.color.copy(ae.color),K.map=ae.map,ae=K}}ae===void 0&&(M?ae=new Sx:w?ae=new qE({size:1,sizeAttenuation:!1}):ae=new QD,ae.name=Z.name,ae.flatShading=!Z.smooth,ae.vertexColors=T,e.materials[J]=ae),O.push(ae)}let B;if(O.length>1){for(let W=0,$=x.length;W<$;W++){const Z=x[W];D.addGroup(Z.groupStart,Z.groupCount,W)}M?B=new B3(D,O):w?B=new k6(D,O):B=new Xg(D,O)}else M?B=new B3(D,O[0]):w?B=new k6(D,O[0]):B=new Xg(D,O[0]);B.name=v.name,l.add(B)}else if(e.vertices.length>0){const u=new qE({size:1,sizeAttenuation:!1}),f=new Rh;f.setAttribute("position",new Rc(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(f.setAttribute("color",new Rc(e.colors,3)),u.vertexColors=!0);const v=new k6(f,u);l.add(v)}return l}};function Hbt({stlUrl:r,mtlUrl:e,color:t,opacity:n=1}){const i=AQ(Dbt,r),a=Et.useRef();return ft.jsxs("mesh",{ref:a,children:[ft.jsx("primitive",{object:i,attach:"geometry"}),ft.jsx("meshStandardMaterial",{color:t,transparent:n!==1,opacity:n})]})}var jbt={version:"0.0.178"};typeof window<"u"&&(window.TSCI_MAIN_CAMERA_ROTATION=new X5(0,0,0));function Vbt(r,e){const t=new A2().setFromEuler(new X5(r.x,r.y,r.z)),n=new Ln(0,0,1);return n.applyQuaternion(t),n.multiplyScalar(e)}var Gbt=({})=>{const r=Et.useRef();return Et.useRef({lastRotation:new X5}),iC((e,t)=>{if(!r.current)return;const n=window.TSCI_MAIN_CAMERA_ROTATION,i=Vbt(n,2);e.camera.position.copy(i),e.camera.lookAt(0,0,0)}),ft.jsxs("mesh",{ref:r,rotation:[Math.PI/2,0,0],children:[ft.jsx("boxGeometry",{args:[1,1,1]}),ft.jsx("meshStandardMaterial",{color:"white"}),ft.jsx(ow,{position:[0,0,.51],fontSize:.25,color:"black",children:"Front"}),ft.jsx(ow,{position:[0,0,-.51],fontSize:.25,color:"black",rotation:[0,Math.PI,0],children:"Back"}),ft.jsx(ow,{position:[.51,0,0],fontSize:.25,color:"black",rotation:[0,Math.PI/2,0],children:"Right"}),ft.jsx(ow,{position:[-.51,0,0],fontSize:.25,color:"black",rotation:[0,-Math.PI/2,0],children:"Left"}),ft.jsx(ow,{position:[0,.51,0],fontSize:.25,color:"black",rotation:[-Math.PI/2,0,0],children:"Top"}),ft.jsx(ow,{position:[0,-.51,0],fontSize:.25,color:"black",rotation:[Math.PI/2,0,0],children:"Bottom"}),ft.jsx("lineSegments",{args:[new qZ(new C4(1,1,1))],material:new Sx({color:0,linewidth:2})})]})},qbt=()=>(iC(({camera:r})=>{window.TSCI_MAIN_CAMERA_ROTATION=r.rotation}),ft.jsx(ft.Fragment,{})),Ybt=Et.forwardRef(({children:r,hoveredComponent:e,initialCameraPosition:t=[5,5,5],autoRotateDisabled:n},i)=>ft.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[ft.jsx("div",{style:{position:"absolute",top:0,left:0,width:120,height:120},children:ft.jsxs(x3e,{camera:{up:[0,0,1],position:[1,1,1]},style:{zIndex:10},children:[ft.jsx("ambientLight",{intensity:Math.PI/2}),ft.jsx(Gbt,{})]})}),ft.jsxs(x3e,{scene:{up:[0,0,1]},camera:{up:[0,0,1],position:t},children:[ft.jsx(qbt,{}),ft.jsx(f0t,{autoRotate:!n,autoRotateSpeed:1}),ft.jsx("ambientLight",{intensity:Math.PI/2}),ft.jsx("pointLight",{position:[-10,-10,10],decay:0,intensity:Math.PI/4}),ft.jsx(h0t,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:1,sectionSize:10}),ft.jsx("object3D",{ref:i,children:r}),e&&ft.jsx(opt,{position:e.mousePosition,style:{fontFamily:"sans-serif",transform:"translate3d(50%, 50%, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:e.name})]}),ft.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",jbt.version]})]})),Xbt=r=>ft.jsx("group",{...r}),Wbt=({children:r,isHovered:e,onHover:t,position:n})=>{const i=Et.useRef(null),a=Et.useCallback(s=>{s.stopPropagation();try{const l=s.point||(s.intersections&&s.intersections.length>0?s.intersections[0].point:null)||(n?new Ln(...n):null);l?(i.current=l,t({mousePosition:[l.x,l.y,l.z]})):t({})}catch(l){console.warn("Hover event error:",l),t({})}},[n]),o=Et.useCallback(s=>{s.stopPropagation(),i.current=null,t(null)},[t]);return ft.jsx(Xbt,{onPointerEnter:a,onPointerMove:a,onPointerLeave:o,children:r})},RO=Wbt;typeof window<"u"&&!window.TSCIRCUIT_OBJ_LOADER_CACHE&&(window.TSCIRCUIT_OBJ_LOADER_CACHE=new Map);function $bt(r){const[e,t]=Et.useState(null);return Et.useEffect(()=>{if(!r)return;const n=window.TSCIRCUIT_OBJ_LOADER_CACHE;let i=!1;async function a(){var s;try{const c=await(await fetch(r)).text(),u=(s=c.match(/newmtl[\s\S]*?endmtl/g))==null?void 0:s.join(`
|
|
13028
13028
|
`).replace(/d 0\./g,"d 1."),f=c.replace(/newmtl[\s\S]*?endmtl/g,""),v=new Lbt;v.setMaterialOptions({invertTrProperty:!0});const _=v.parse(u.replace(/Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,"Kd $2 $2 $2"),"test.mtl"),x=new Bbt;return x.setMaterials(_),x.parse(f)}catch(l){return l}}function o(){if(n.has(r)){const l=n.get(r);return l.result?Promise.resolve(l.result.clone()):l.promise.then(c=>c.clone())}const s=a().then(l=>(l instanceof Error||n.set(r,{...n.get(r),result:l}),l));return n.set(r,{promise:s,result:null}),s}return o().then(s=>{i||t(s)}).catch(s=>{console.error(s)}),()=>{i=!0}},[r]),e}function Zbt({url:r,position:e,rotation:t,onHover:n,isHovered:i}){const a=$bt(r);return a?a instanceof Error?ft.jsx(RO,{isHovered:i,onHover:n,children:ft.jsxs("mesh",{position:e,children:[ft.jsx("boxGeometry",{args:[.5,.5,.5]}),ft.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.5}),ft.jsx("meshBasicMaterial",{color:"red"})]})}):ft.jsx(RO,{isHovered:i,onHover:n,children:ft.jsx("primitive",{rotation:t,position:e,object:a})}):ft.jsx(RO,{isHovered:i,onHover:n,children:ft.jsxs("mesh",{position:e,children:[ft.jsx("boxGeometry",{args:[.5,.5,.5]}),ft.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.25})]})})}var Qbt=u5(gMe()),CMe=({jscadPlan:r,positionOffset:e,rotationOffset:t,onHover:n,isHovered:i})=>{const{threeGeom:a,material:o}=Et.useMemo(()=>{const s=obe.executeJscadOperations(Qbt.default,r),l=umt(s),c=new ZD({vertexColors:!0,side:h3});return{threeGeom:l,material:c}},[r]);return Et.useMemo(()=>{if(i){const s=new Cl(o.color.getHex());o.emissive.copy(s),o.emissive.setRGB(0,0,1),o.emissiveIntensity=.2}else o.emissiveIntensity=0},[i,o]),a?ft.jsx(RO,{isHovered:i,onHover:n,position:e,children:ft.jsx("mesh",{geometry:a,material:o,position:e,rotation:t})}):null},{createJSCADRoot:Kbt}=lmt(obe.jscadPlanner),Jbt=({positionOffset:r,footprint:e,rotationOffset:t,onHover:n,isHovered:i})=>{const a=Et.useMemo(()=>{if(!e)return null;const o=[];return Kbt(o).render(ft.jsx(A9t,{footprint:e})),o},[e]);return a?ft.jsx(ft.Fragment,{children:a.map((o,s)=>ft.jsx(CMe,{positionOffset:r,rotationOffset:t,jscadPlan:o,onHover:n,isHovered:i},s))}):null},eSt=(...r)=>r,tSt=({cad_component:r,onHover:e=()=>{},isHovered:t=!1})=>{const n=r.model_obj_url??r.model_stl_url,i=r.rotation?eSt(r.rotation.x*Math.PI/180,r.rotation.y*Math.PI/180,r.rotation.z*Math.PI/180):void 0;if(n)return ft.jsx(Zbt,{url:n,position:r.position?[r.position.x,r.position.y,r.position.z]:void 0,rotation:i,onHover:e,isHovered:t},r.cad_component_id);if(r.model_jscad)return ft.jsx(CMe,{jscadPlan:r.model_jscad,rotationOffset:i,onHover:e,isHovered:t},r.cad_component_id);if(r.footprinter_string)return ft.jsx(Jbt,{positionOffset:r.position?[r.position.x,r.position.y,r.position.z]:void 0,rotationOffset:i,footprint:r.footprinter_string,onHover:e,isHovered:t})},nSt=class extends wh.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){return this.state.hasError&&this.state.error?this.props.fallback({error:this.state.error}):this.props.children}},rSt=({error:r,cad_component:e})=>{let t=[0,0,0];return e!=null&&e.position&&(t=[e.position.x,e.position.y,e.position.z],t=t.map(n=>Number.isNaN(n)?0:n)),ft.jsxs("group",{position:t,children:[ft.jsxs("mesh",{renderOrder:-99999,rotation:[Math.PI/4,Math.PI/4,0],ref:n=>{n&&(n.renderOrder=999999)},children:[ft.jsx("boxGeometry",{args:[.5,.5,.5]}),ft.jsx("meshStandardMaterial",{depthTest:!1,transparent:!0,color:"red",opacity:.5})]}),ft.jsxs(ow,{scale:[.1,.1,.1],color:"red",anchorX:"center",anchorY:"middle",depthOffset:-99999,children:[r.toString().slice(0,50),"..."]})]})},iSt=Et.forwardRef(({soup:r,circuitJson:e,children:t,autoRotateDisabled:n},i)=>{e??(e=r);const[a,o]=Et.useState(null);e??(e=xbt(t));const s=Et.useMemo(()=>{if(!e)return[5,5,5];try{const f=uy(e).pcb_board.list()[0];if(!f)return[5,5,5];const{width:v,height:_}=f;if(!v&&!_)return[5,5,5];const x=5,M=Math.max(v,x),w=Math.max(_,x),T=Math.max(M,w);return[T/2,T/2,T]}catch(f){return console.error(f),[5,5,5]}},[e]),l=Et.useMemo(()=>!e||!e.some(f=>f.type==="pcb_board")?null:Rbt(e),[e]),{stls:c}=Pbt(l);if(!e)return null;const u=uy(e).cad_component.list();return ft.jsxs(Ybt,{ref:i,hoveredComponent:a,autoRotateDisabled:n,initialCameraPosition:s,children:[c.map(({stlUrl:f,color:v},_)=>ft.jsx(Hbt,{stlUrl:f,color:v,opacity:_===0?.95:1},f)),u.map(f=>ft.jsx(nSt,{fallback:({error:v})=>ft.jsx(rSt,{cad_component:f,error:v}),children:ft.jsx(tSt,{onHover:v=>{var x;if(v||o(null),!v.mousePosition)return;const _=(x=uy(e).source_component.getUsing({source_component_id:f.source_component_id}))==null?void 0:x.name;o({cad_component_id:f.cad_component_id,name:_??"<unknown>",mousePosition:v.mousePosition})},cad_component:f,isHovered:(a==null?void 0:a.cad_component_id)===f.cad_component_id},f.cad_component_id)},f.cad_component_id))]})}),aSt=u5(_bt());u5(gMe()),(0,aSt.default)("tscircuit:3d-viewer:convert-circuit-json-to-3d-svg");const s7=r=>typeof r=="number"&&!isNaN(r),xw=r=>typeof r=="string",_3=r=>typeof r=="function",AO=r=>xw(r)||_3(r)?r:null,uee=r=>Et.isValidElement(r)||xw(r)||_3(r)||s7(r);function oSt(r,e,t){t===void 0&&(t=300);const{scrollHeight:n,style:i}=r;requestAnimationFrame(()=>{i.minHeight="initial",i.height=n+"px",i.transition=`all ${t}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,t)})})}function PO(r){let{enter:e,exit:t,appendPosition:n=!1,collapse:i=!0,collapseDuration:a=300}=r;return function(o){let{children:s,position:l,preventExitTransition:c,done:u,nodeRef:f,isIn:v,playToast:_}=o;const x=n?`${e}--${l}`:e,M=n?`${t}--${l}`:t,w=Et.useRef(0);return Et.useLayoutEffect(()=>{const T=f.current,D=x.split(" "),O=B=>{B.target===f.current&&(_(),T.removeEventListener("animationend",O),T.removeEventListener("animationcancel",O),w.current===0&&B.type!=="animationcancel"&&T.classList.remove(...D))};T.classList.add(...D),T.addEventListener("animationend",O),T.addEventListener("animationcancel",O)},[]),Et.useEffect(()=>{const T=f.current,D=()=>{T.removeEventListener("animationend",D),i?oSt(T,u,a):u()};v||(c?D():(w.current=1,T.className+=` ${M}`,T.addEventListener("animationend",D)))},[v]),wh.createElement(wh.Fragment,null,s)}}function RMe(r,e){return r!=null?{content:r.content,containerId:r.props.containerId,id:r.props.toastId,theme:r.props.theme,type:r.props.type,data:r.props.data||{},isLoading:r.props.isLoading,icon:r.props.icon,status:e}:{}}const T5=new Map;let l7=[];const fee=new Set,sSt=r=>fee.forEach(e=>e(r)),AMe=()=>T5.size>0;function PMe(r,e){var t;if(e)return!((t=T5.get(e))==null||!t.isToastActive(r));let n=!1;return T5.forEach(i=>{i.isToastActive(r)&&(n=!0)}),n}function NMe(r,e){uee(r)&&(AMe()||l7.push({content:r,options:e}),T5.forEach(t=>{t.buildToast(r,e)}))}function DMe(r,e){T5.forEach(t=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===t.id&&t.toggle(r,e==null?void 0:e.id):t.toggle(r,e==null?void 0:e.id)})}function lSt(r){const{subscribe:e,getSnapshot:t,setProps:n}=Et.useRef(function(a){const o=a.containerId||1;return{subscribe(s){const l=function(u,f,v){let _=1,x=0,M=[],w=[],T=[],D=f;const O=new Map,B=new Set,W=()=>{T=Array.from(O.values()),B.forEach(J=>J())},$=J=>{w=J==null?[]:w.filter(ae=>ae!==J),W()},Z=J=>{const{toastId:ae,onOpen:K,updateId:de,children:me}=J.props,be=de==null;J.staleId&&O.delete(J.staleId),O.set(ae,J),w=[...w,J.props.toastId].filter(Ae=>Ae!==J.staleId),W(),v(RMe(J,be?"added":"updated")),be&&_3(K)&&K(Et.isValidElement(me)&&me.props)};return{id:u,props:D,observe:J=>(B.add(J),()=>B.delete(J)),toggle:(J,ae)=>{O.forEach(K=>{ae!=null&&ae!==K.props.toastId||_3(K.toggle)&&K.toggle(J)})},removeToast:$,toasts:O,clearQueue:()=>{x-=M.length,M=[]},buildToast:(J,ae)=>{if((ze=>{let{containerId:ot,toastId:nt,updateId:mt}=ze;const At=ot?ot!==u:u!==1,Ot=O.has(nt)&&mt==null;return At||Ot})(ae))return;const{toastId:K,updateId:de,data:me,staleId:be,delay:Ae}=ae,Le=()=>{$(K)},we=de==null;we&&x++;const Oe={...D,style:D.toastStyle,key:_++,...Object.fromEntries(Object.entries(ae).filter(ze=>{let[ot,nt]=ze;return nt!=null})),toastId:K,updateId:de,data:me,closeToast:Le,isIn:!1,className:AO(ae.className||D.toastClassName),bodyClassName:AO(ae.bodyClassName||D.bodyClassName),progressClassName:AO(ae.progressClassName||D.progressClassName),autoClose:!ae.isLoading&&(Te=ae.autoClose,Ve=D.autoClose,Te===!1||s7(Te)&&Te>0?Te:Ve),deleteToast(){const ze=O.get(K),{onClose:ot,children:nt}=ze.props;_3(ot)&&ot(Et.isValidElement(nt)&&nt.props),v(RMe(ze,"removed")),O.delete(K),x--,x<0&&(x=0),M.length>0?Z(M.shift()):W()}};var Te,Ve;Oe.closeButton=D.closeButton,ae.closeButton===!1||uee(ae.closeButton)?Oe.closeButton=ae.closeButton:ae.closeButton===!0&&(Oe.closeButton=!uee(D.closeButton)||D.closeButton);let Ue=J;Et.isValidElement(J)&&!xw(J.type)?Ue=Et.cloneElement(J,{closeToast:Le,toastProps:Oe,data:me}):_3(J)&&(Ue=J({closeToast:Le,toastProps:Oe,data:me}));const He={content:Ue,props:Oe,staleId:be};D.limit&&D.limit>0&&x>D.limit&&we?M.push(He):s7(Ae)?setTimeout(()=>{Z(He)},Ae):Z(He)},setProps(J){D=J},setToggle:(J,ae)=>{O.get(J).toggle=ae},isToastActive:J=>w.some(ae=>ae===J),getSnapshot:()=>T}}(o,a,sSt);T5.set(o,l);const c=l.observe(s);return l7.forEach(u=>NMe(u.content,u.options)),l7=[],()=>{c(),T5.delete(o)}},setProps(s){var l;(l=T5.get(o))==null||l.setProps(s)},getSnapshot(){var s;return(s=T5.get(o))==null?void 0:s.getSnapshot()}}}(r)).current;n(r);const i=Et.useSyncExternalStore(e,t,t);return{getToastToRender:function(a){if(!i)return[];const o=new Map;return r.newestOnTop&&i.reverse(),i.forEach(s=>{const{position:l}=s.props;o.has(l)||o.set(l,[]),o.get(l).push(s)}),Array.from(o,s=>a(s[0],s[1]))},isToastActive:PMe,count:i==null?void 0:i.length}}function cSt(r){const[e,t]=Et.useState(!1),[n,i]=Et.useState(!1),a=Et.useRef(null),o=Et.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:f}=r;var v,_;function x(){t(!0)}function M(){t(!1)}function w(O){const B=a.current;o.canDrag&&B&&(o.didMove=!0,e&&M(),o.delta=r.draggableDirection==="x"?O.clientX-o.start:O.clientY-o.start,o.start!==O.clientX&&(o.canCloseOnClick=!1),B.style.transform=`translate3d(${r.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,B.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function T(){document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",T);const O=a.current;if(o.canDrag&&o.didMove&&O){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),r.closeToast(),void r.collapseAll();O.style.transition="transform 0.2s, opacity 0.2s",O.style.removeProperty("transform"),O.style.removeProperty("opacity")}}(_=T5.get((v={id:r.toastId,containerId:r.containerId,fn:t}).containerId||1))==null||_.setToggle(v.id,v.fn),Et.useEffect(()=>{if(r.pauseOnFocusLoss)return document.hasFocus()||M(),window.addEventListener("focus",x),window.addEventListener("blur",M),()=>{window.removeEventListener("focus",x),window.removeEventListener("blur",M)}},[r.pauseOnFocusLoss]);const D={onPointerDown:function(O){if(r.draggable===!0||r.draggable===O.pointerType){o.didMove=!1,document.addEventListener("pointermove",w),document.addEventListener("pointerup",T);const B=a.current;o.canCloseOnClick=!0,o.canDrag=!0,B.style.transition="none",r.draggableDirection==="x"?(o.start=O.clientX,o.removalDistance=B.offsetWidth*(r.draggablePercent/100)):(o.start=O.clientY,o.removalDistance=B.offsetHeight*(r.draggablePercent===80?1.5*r.draggablePercent:r.draggablePercent)/100)}},onPointerUp:function(O){const{top:B,bottom:W,left:$,right:Z}=a.current.getBoundingClientRect();O.nativeEvent.type!=="touchend"&&r.pauseOnHover&&O.clientX>=$&&O.clientX<=Z&&O.clientY>=B&&O.clientY<=W?M():x()}};return s&&l&&(D.onMouseEnter=M,r.stacked||(D.onMouseLeave=x)),f&&(D.onClick=O=>{u&&u(O),o.canCloseOnClick&&c()}),{playToast:x,pauseToast:M,isRunning:e,preventExitTransition:n,toastRef:a,eventHandlers:D}}function uSt(r){let{delay:e,isRunning:t,closeToast:n,type:i="default",hide:a,className:o,style:s,controlledProgress:l,progress:c,rtl:u,isIn:f,theme:v}=r;const _=a||l&&c===0,x={...s,animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};l&&(x.transform=`scaleX(${c})`);const M=Db("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${v}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":u}),w=_3(o)?o({rtl:u,type:i,defaultClassName:M}):Db(M,o),T={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{f&&n()}};return wh.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":_},wh.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${v} Toastify__progress-bar--${i}`}),wh.createElement("div",{role:"progressbar","aria-hidden":_?"true":"false","aria-label":"notification timer",className:w,style:x,...T}))}let fSt=1;const LMe=()=>""+fSt++;function dSt(r){return r&&(xw(r.toastId)||s7(r.toastId))?r.toastId:LMe()}function c7(r,e){return NMe(r,e),e.toastId}function NO(r,e){return{...e,type:e&&e.type||r,toastId:dSt(e)}}function DO(r){return(e,t)=>c7(e,NO(r,t))}function By(r,e){return c7(r,NO("default",e))}By.loading=(r,e)=>c7(r,NO("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),By.promise=function(r,e,t){let n,{pending:i,error:a,success:o}=e;i&&(n=xw(i)?By.loading(i,t):By.loading(i.render,{...t,...i}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,f,v)=>{if(f==null)return void By.dismiss(n);const _={type:u,...s,...t,data:v},x=xw(f)?{render:f}:f;return n?By.update(n,{..._,...x}):By(x.render,{..._,...x}),v},c=_3(r)?r():r;return c.then(u=>l("success",o,u)).catch(u=>l("error",a,u)),c},By.success=DO("success"),By.info=DO("info"),By.error=DO("error"),By.warning=DO("warning"),By.warn=By.warning,By.dark=(r,e)=>c7(r,NO("default",{theme:"dark",...e})),By.dismiss=function(r){(function(e){var t;if(AMe()){if(e==null||xw(t=e)||s7(t))T5.forEach(n=>{n.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const n=T5.get(e.containerId);n?n.removeToast(e.id):T5.forEach(i=>{i.removeToast(e.id)})}}else l7=l7.filter(n=>e!=null&&n.options.toastId!==e)})(r)},By.clearWaitingQueue=function(r){r===void 0&&(r={}),T5.forEach(e=>{!e.props.limit||r.containerId&&e.id!==r.containerId||e.clearQueue()})},By.isActive=PMe,By.update=function(r,e){e===void 0&&(e={});const t=((n,i)=>{var a;let{containerId:o}=i;return(a=T5.get(o||1))==null?void 0:a.toasts.get(n)})(r,e);if(t){const{props:n,content:i}=t,a={delay:100,...n,...e,toastId:e.toastId||r,updateId:LMe()};a.toastId!==r&&(a.staleId=r);const o=a.render||i;delete a.render,c7(o,a)}},By.done=r=>{By.update(r,{progress:1})},By.onChange=function(r){return fee.add(r),()=>{fee.delete(r)}},By.play=r=>DMe(!0,r),By.pause=r=>DMe(!1,r);const hSt=typeof window<"u"?Et.useLayoutEffect:Et.useEffect,LO=r=>{let{theme:e,type:t,isLoading:n,...i}=r;return wh.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...i})},dee={info:function(r){return wh.createElement(LO,{...r},wh.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(r){return wh.createElement(LO,{...r},wh.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(r){return wh.createElement(LO,{...r},wh.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(r){return wh.createElement(LO,{...r},wh.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return wh.createElement("div",{className:"Toastify__spinner"})}},pSt=r=>{const{isRunning:e,preventExitTransition:t,toastRef:n,eventHandlers:i,playToast:a}=cSt(r),{closeButton:o,children:s,autoClose:l,onClick:c,type:u,hideProgressBar:f,closeToast:v,transition:_,position:x,className:M,style:w,bodyClassName:T,bodyStyle:D,progressClassName:O,progressStyle:B,updateId:W,role:$,progress:Z,rtl:J,toastId:ae,deleteToast:K,isIn:de,isLoading:me,closeOnClick:be,theme:Ae}=r,Le=Db("Toastify__toast",`Toastify__toast-theme--${Ae}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":J},{"Toastify__toast--close-on-click":be}),we=_3(M)?M({rtl:J,position:x,type:u,defaultClassName:Le}):Db(Le,M),Oe=function(He){let{theme:ze,type:ot,isLoading:nt,icon:mt}=He,At=null;const Ot={theme:ze,type:ot};return mt===!1||(_3(mt)?At=mt({...Ot,isLoading:nt}):Et.isValidElement(mt)?At=Et.cloneElement(mt,Ot):nt?At=dee.spinner():(Kt=>Kt in dee)(ot)&&(At=dee[ot](Ot))),At}(r),Te=!!Z||!l,Ve={closeToast:v,type:u,theme:Ae};let Ue=null;return o===!1||(Ue=_3(o)?o(Ve):Et.isValidElement(o)?Et.cloneElement(o,Ve):function(He){let{closeToast:ze,theme:ot,ariaLabel:nt="close"}=He;return wh.createElement("button",{className:`Toastify__close-button Toastify__close-button--${ot}`,type:"button",onClick:mt=>{mt.stopPropagation(),ze(mt)},"aria-label":nt},wh.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},wh.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Ve)),wh.createElement(_,{isIn:de,done:K,position:x,preventExitTransition:t,nodeRef:n,playToast:a},wh.createElement("div",{id:ae,onClick:c,"data-in":de,className:we,...i,style:w,ref:n},wh.createElement("div",{...de&&{role:$},className:_3(T)?T({type:u}):Db("Toastify__toast-body",T),style:D},Oe!=null&&wh.createElement("div",{className:Db("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!me})},Oe),wh.createElement("div",null,s)),Ue,wh.createElement(uSt,{...W&&!Te?{key:`pb-${W}`}:{},rtl:J,theme:Ae,delay:l,isRunning:e,isIn:de,closeToast:v,hide:f,type:u,style:B,className:O,controlledProgress:Te,progress:Z||0})))},OO=function(r,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${r}-enter`,exit:`Toastify--animate Toastify__${r}-exit`,appendPosition:e}},mSt=PO(OO("bounce",!0));PO(OO("slide",!0)),PO(OO("zoom")),PO(OO("flip"));const vSt={position:"top-right",transition:mSt,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function ySt(r){let e={...vSt,...r};const t=r.stacked,[n,i]=Et.useState(!0),a=Et.useRef(null),{getToastToRender:o,isToastActive:s,count:l}=lSt(e),{className:c,style:u,rtl:f,containerId:v}=e;function _(M){const w=Db("Toastify__toast-container",`Toastify__toast-container--${M}`,{"Toastify__toast-container--rtl":f});return _3(c)?c({position:M,rtl:f,defaultClassName:w}):Db(w,AO(c))}function x(){t&&(i(!0),By.play())}return hSt(()=>{if(t){var M;const w=a.current.querySelectorAll('[data-in="true"]'),T=12,D=(M=e.position)==null?void 0:M.includes("top");let O=0,B=0;Array.from(w).reverse().forEach((W,$)=>{const Z=W;Z.classList.add("Toastify__toast--stacked"),$>0&&(Z.dataset.collapsed=`${n}`),Z.dataset.pos||(Z.dataset.pos=D?"top":"bot");const J=O*(n?.2:1)+(n?0:T*$);Z.style.setProperty("--y",`${D?J:-1*J}px`),Z.style.setProperty("--g",`${T}`),Z.style.setProperty("--s",""+(1-(n?B:0))),O+=Z.offsetHeight,B+=.025})}},[n,l,t]),wh.createElement("div",{ref:a,className:"Toastify",id:v,onMouseEnter:()=>{t&&(i(!1),By.pause())},onMouseLeave:x},o((M,w)=>{const T=w.length?{...u}:{...u,pointerEvents:"none"};return wh.createElement("div",{className:_(M),style:T,key:`container-${M}`},w.map(D=>{let{content:O,props:B}=D;return wh.createElement(pSt,{...B,stacked:t,collapseAll:x,isIn:s(B.toastId,B.containerId),style:B.style,key:`toast-${B.key}`},O)}))}))}function gSt(){var r=':root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-offset:16px;--toastify-toast-top:max(var(--toastify-toast-offset),env(safe-area-inset-top));--toastify-toast-right:max(var(--toastify-toast-offset),env(safe-area-inset-right));--toastify-toast-left:max(var(--toastify-toast-offset),env(safe-area-inset-left));--toastify-toast-bottom:max(var(--toastify-toast-offset),env(safe-area-inset-bottom));--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-toast-bd-radius:6px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error);--toastify-color-progress-bgo:0.2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translateX(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:auto}}.Toastify__toast{--y:0;position:relative;-ms-touch-action:none;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__close-button,.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right;border-bottom-left-radius:0;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}',e=document.createElement("style");e.innerText=r,document.head.appendChild(e)}function _St(r){const e=new Map;let t=0;function n(i){for(const[,o]of e)if(o.has(i))return o;const a=new Set;return e.set(`connectivity_net${t++}`,a),a}for(const i of r){let a=null;for(const o of i){if(!a)a=n(o);else if(!a.has(o)){const s=n(o);if(s!==a){for(const l of s)a.add(l);e.delete(Array.from(e.entries()).find(([,l])=>l===s)[0])}}a.add(o)}}return Object.fromEntries(Array.from(e.entries()).map(([i,a])=>[i,Array.from(a)]))}var xSt=class{constructor(r){Ht(this,"netMap");Ht(this,"idToNetMap");this.netMap=r,this.idToNetMap={};for(const[e,t]of Object.entries(r))for(const n of t)this.idToNetMap[n]=e}addConnections(r){for(const e of r){const t=new Set;for(const i of e){const a=this.idToNetMap[i];a&&t.add(a)}let n;if(t.size===0)n=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[n]=[];else if(t.size===1)n=t.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{n=t.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(const i of t)if(i!==n){this.netMap[n].push(...this.netMap[i]),this.netMap[i]=this.netMap[n];for(const a of this.netMap[n])this.idToNetMap[a]=n}}for(const i of e)this.netMap[n].includes(i)||this.netMap[n].push(i),this.idToNetMap[i]=n}}getIdsConnectedToNet(r){return this.netMap[r]||[]}getNetConnectedToId(r){return this.idToNetMap[r]}areIdsConnected(r,e){if(r===e)return!0;const t=this.getNetConnectedToId(r);if(!t)return!1;const n=this.getNetConnectedToId(e);return n?t===n||n===r||n===r:!1}areAllIdsConnected(r){const e=this.getNetConnectedToId(r[0]);for(const t of r){const n=this.getNetConnectedToId(t);if(n===void 0||n!==e)return!1}return!0}},OMe=r=>{const e=[];for(const n of r)if(n.type==="source_trace")e.push([n.source_trace_id,...n.connected_source_port_ids??[],...n.connected_source_net_ids??[]].filter(Boolean));else if(n.type==="pcb_port"){const{pcb_port_id:i,source_port_id:a}=n;a&&i&&e.push([a,i])}else if(n.type==="pcb_smtpad"){const{pcb_smtpad_id:i,pcb_port_id:a}=n;a&&i&&e.push([i,a])}else if(n.type==="pcb_plated_hole"){const{pcb_plated_hole_id:i,pcb_port_id:a}=n;a&&i&&e.push([i,a])}else if(n.type==="pcb_trace"){const{pcb_trace_id:i,source_trace_id:a}=n;a&&i&&e.push([i,a])}const t=_St(e);return new xSt(t)};const bSt=Iw(RVe);var hee,zMe;function SSt(){if(zMe)return hee;zMe=1;var r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(w,T)=>{for(var D in T)r(w,D,{get:T[D],enumerable:!0})},a=(w,T,D,O)=>{if(T&&typeof T=="object"||typeof T=="function")for(let B of t(T))!n.call(w,B)&&B!==D&&r(w,B,{get:()=>T[B],enumerable:!(O=e(T,B))||O.enumerable});return w},o=w=>a(r({},"__esModule",{value:!0}),w),s={};i(s,{SuperGrid:()=>M,toMMSI:()=>x,toMeterSI:()=>_}),hee=o(s);var l=n2(),c=bSt,u=eae(),f=(w,T,D)=>{const O=[];if(T<w)for(let B=w;B>=T;B-=Math.abs(D))O.push(B);else for(let B=w;B<=T;B+=Math.abs(D))O.push(B);return O};function v(w,T){return{x:Math.round(T.x/w)*w,y:Math.round(T.y/w)*w}}function _(w,T=1){return w<0?"-"+_(-w):w<1e-6?"0m":w>1e3?Math.floor(w/1e3)+"km":w>1&&T>1?Math.round(w)+"m":w>1&&T<=1?w.toFixed(Math.ceil(-Math.log10(T)))+"m":w<1&&T>=1/1e3?Math.round(w*1e3)+"mm":w<1&&T<1/1e3?(w*1e3).toFixed(Math.ceil(-Math.log10(T*1e3)))+"mm":""}function x(w,T=1){return _(w/1e3,T/1e3)}var M=w=>{var T;const D=(0,l.useRef)(null),[O,B]=(0,l.useState)({x:0,y:0}),{majorColor:W="rgba(0,0,0,0.2)",minorColor:$="rgba(0,0,0,0.1)",textColor:Z=(T=w.majorColor)!=null?T:"rgba(0,0,0,0.5)",width:J,height:ae,screenSpaceCellSize:K=200,stringifyCoord:de=(Le,we,Oe)=>`${_(Le,Oe)}, ${_(we,Oe)}`}=w,me=Math.ceil(J/K)+2,be=Math.ceil(ae/K)+2;(0,l.useEffect)(()=>{if(!D.current)return;const Le=D.current.getContext("2d");if(!Le)return;const we=K/10**Math.floor(Math.log10(w.transform.a)),Oe=w.transform.d<0?-1:1,Ve=K/10**Math.log10(w.transform.a)/we;function Ue(Hn,_n,dn){const Tn=Hn;let Wt,gr,Jn;for(Wt=_n.x;Wt<=dn.x;Wt+=Tn)gr=(0,c.applyToPoint)(w.transform,{x:Wt,y:_n.y}),Jn=(0,c.applyToPoint)(w.transform,{x:Wt,y:dn.y}),Le.beginPath(),Le.moveTo(gr.x,gr.y),Le.lineTo(Jn.x,Jn.y),Le.stroke();const sn=f(_n.y,dn.y,Tn*Oe);for(const lr of sn)gr=(0,c.applyToPoint)(w.transform,{x:_n.x,y:lr}),Jn=(0,c.applyToPoint)(w.transform,{x:dn.x,y:lr}),Le.beginPath(),Le.moveTo(gr.x,gr.y),Le.lineTo(Jn.x,Jn.y),Le.stroke()}function He(Hn,_n,dn){const Tn=Hn;let Wt;for(Wt=_n.x;Wt<=dn.x;Wt+=Tn)for(const gr of f(_n.y,dn.y,Tn*Oe)){const Jn=(0,c.applyToPoint)(w.transform,{x:Wt,y:gr});Le.fillStyle=Z,Le.font="12px sans-serif",Le.fillText(de(Wt,gr,Hn),Jn.x+2,Jn.y-2)}}Le.clearRect(0,0,J,ae);const ze=(0,c.applyToPoint)((0,c.inverse)(w.transform),{x:0,y:0}),ot={x:Math.floor((ze.x-we)/we)*we,y:Math.floor((ze.y-we)/we+(Oe==-1?2:0))*we},nt={x:ot.x+we*me,y:ot.y+we*be*Oe},At=we*5,Ot={x:Math.floor((ze.x-At)/At)*At,y:Math.floor((ze.y-At)/At+(Oe==-1?2:0))*At},Kt={x:Ot.x+At*me,y:Ot.y+At*be*Oe};Le.globalAlpha=1,Le.strokeStyle=W,Ue(we,ot,nt),He(At,Ot,Kt),Le.globalAlpha=1-Ve,Ue(At/10,Ot,Kt),Le.globalAlpha=1-Ve,Le.strokeStyle=$,Ue(we/10,ot,nt),Le.globalAlpha=Math.max(((1-Ve)*10-5)/5,0),He(At/10,Ot,Kt),Le.globalAlpha=1;const rn=(0,c.applyToPoint)(w.transform,O);Le.font="12px sans-serif",Le.fillStyle=Z,Le.fillText(de(O.x,O.y,we),rn.x+2,rn.y-2),Le.strokeStyle=W,Le.strokeRect(rn.x-5,rn.y-5,10,10)},[D,w.transform,O,J,ae]);const Ae=Le=>{if(!D.current)return;const we=K/10/10**Math.floor(Math.log10(w.transform.a)),Oe=D.current.getBoundingClientRect(),Te=(0,c.applyToPoint)((0,c.inverse)(w.transform),{x:Le.clientX-Oe.left,y:Le.clientY-Oe.top}),Ve=v(we,Te);B(Ve)};return(0,u.jsx)("canvas",{onMouseUp:Le=>{Le.button===1&&Ae(Le)},onDoubleClick:Ae,ref:D,width:w.width,height:w.height})};return hee}var pee=SSt();/*!
|
|
13029
13029
|
* Determine if an object is a Buffer
|
|
13030
13030
|
*
|
package/dist/standalone.min.js
CHANGED
|
@@ -13028,7 +13028,7 @@ ${l.join(`
|
|
|
13028
13028
|
`)!==-1&&(r=r.replace(/\r\n/g,`
|
|
13029
13029
|
`)),r.indexOf(`\\
|
|
13030
13030
|
`)!==-1&&(r=r.replace(/\\\n/g,""));const t=r.split(`
|
|
13031
|
-
`);let n="",i="",a=0,o=[];const s=typeof"".trimLeft=="function";for(let u=0,f=t.length;u<f;u++)if(n=t[u],n=s?n.trimLeft():n.trim(),a=n.length,a!==0&&(i=n.charAt(0),i!=="#"))if(i==="v"){const m=n.split(/\s+/);switch(m[0]){case"v":e.vertices.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3])),m.length>=7?e.colors.push(parseFloat(m[4]),parseFloat(m[5]),parseFloat(m[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3]));break;case"vt":e.uvs.push(parseFloat(m[1]),parseFloat(m[2]));break}}else if(i==="f"){const _=n.substr(1).trim().split(/\s+/),x=[];for(let T=0,w=_.length;T<w;T++){const P=_[T];if(P.length>0){const O=P.split("/");x.push(O)}}const M=x[0];for(let T=1,w=x.length-1;T<w;T++){const P=x[T],O=x[T+1];e.addFace(M[0],P[0],O[0],M[1],P[1],O[1],M[2],P[2],O[2])}}else if(i==="l"){const m=n.substring(1).trim().split(" ");let _=[];const x=[];if(n.indexOf("/")===-1)_=m;else for(let M=0,T=m.length;M<T;M++){const w=m[M].split("/");w[0]!==""&&_.push(w[0]),w[1]!==""&&x.push(w[1])}e.addLineGeometry(_,x)}else if(i==="p"){const _=n.substr(1).trim().split(" ");e.addPointGeometry(_)}else if((o=aEt.exec(n))!==null){const m=(" "+o[0].substr(1).trim()).substr(1);e.startObject(m)}else if(sEt.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(oEt.test(n))e.materialLibraries.push(n.substring(7).trim());else if(lEt.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(i==="s"){if(o=n.split(" "),o.length>1){const _=o[1].trim().toLowerCase();e.object.smooth=_!=="0"&&_!=="off"}else e.object.smooth=!0;const m=e.object.currentMaterial();m&&(m.smooth=e.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}e.finalize();const l=new KE;if(l.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let u=0,f=e.objects.length;u<f;u++){const m=e.objects[u],_=m.geometry,x=m.materials,M=_.type==="Line",T=_.type==="Points";let w=!1;if(_.vertices.length===0)continue;const P=new Rh;P.setAttribute("position",new Rc(_.vertices,3)),_.normals.length>0&&P.setAttribute("normal",new Rc(_.normals,3)),_.colors.length>0&&(w=!0,P.setAttribute("color",new Rc(_.colors,3))),_.hasUVIndices===!0&&P.setAttribute("uv",new Rc(_.uvs,2));const O=[];for(let W=0,$=x.length;W<$;W++){const Z=x[W],J=Z.name+"_"+Z.smooth+"_"+w;let ae=e.materials[J];if(this.materials!==null){if(ae=this.materials.create(Z.name),M&&ae&&!(ae instanceof wx)){const K=new wx;s2.prototype.copy.call(K,ae),K.color.copy(ae.color),ae=K}else if(T&&ae&&!(ae instanceof iw)){const K=new iw({size:10,sizeAttenuation:!1});s2.prototype.copy.call(K,ae),K.color.copy(ae.color),K.map=ae.map,ae=K}}ae===void 0&&(M?ae=new wx:T?ae=new iw({size:1,sizeAttenuation:!1}):ae=new vL,ae.name=Z.name,ae.flatShading=!Z.smooth,ae.vertexColors=w,e.materials[J]=ae),O.push(ae)}let B;if(O.length>1){for(let W=0,$=x.length;W<$;W++){const Z=x[W];P.addGroup(Z.groupStart,Z.groupCount,W)}M?B=new V3(P,O):T?B=new Q6(P,O):B=new Wg(P,O)}else M?B=new V3(P,O[0]):T?B=new Q6(P,O[0]):B=new Wg(P,O[0]);B.name=m.name,l.add(B)}else if(e.vertices.length>0){const u=new iw({size:1,sizeAttenuation:!1}),f=new Rh;f.setAttribute("position",new Rc(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(f.setAttribute("color",new Rc(e.colors,3)),u.vertexColors=!0);const m=new Q6(f,u);l.add(m)}return l}};function fEt({stlUrl:r,mtlUrl:e,color:t,opacity:n=1}){const i=tK(nEt,r),a=ot.useRef();return $e.jsxs("mesh",{ref:a,children:[$e.jsx("primitive",{object:i,attach:"geometry"}),$e.jsx("meshStandardMaterial",{color:t,transparent:n!==1,opacity:n})]})}var dEt={version:"0.0.
|
|
13031
|
+
`);let n="",i="",a=0,o=[];const s=typeof"".trimLeft=="function";for(let u=0,f=t.length;u<f;u++)if(n=t[u],n=s?n.trimLeft():n.trim(),a=n.length,a!==0&&(i=n.charAt(0),i!=="#"))if(i==="v"){const m=n.split(/\s+/);switch(m[0]){case"v":e.vertices.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3])),m.length>=7?e.colors.push(parseFloat(m[4]),parseFloat(m[5]),parseFloat(m[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3]));break;case"vt":e.uvs.push(parseFloat(m[1]),parseFloat(m[2]));break}}else if(i==="f"){const _=n.substr(1).trim().split(/\s+/),x=[];for(let T=0,w=_.length;T<w;T++){const P=_[T];if(P.length>0){const O=P.split("/");x.push(O)}}const M=x[0];for(let T=1,w=x.length-1;T<w;T++){const P=x[T],O=x[T+1];e.addFace(M[0],P[0],O[0],M[1],P[1],O[1],M[2],P[2],O[2])}}else if(i==="l"){const m=n.substring(1).trim().split(" ");let _=[];const x=[];if(n.indexOf("/")===-1)_=m;else for(let M=0,T=m.length;M<T;M++){const w=m[M].split("/");w[0]!==""&&_.push(w[0]),w[1]!==""&&x.push(w[1])}e.addLineGeometry(_,x)}else if(i==="p"){const _=n.substr(1).trim().split(" ");e.addPointGeometry(_)}else if((o=aEt.exec(n))!==null){const m=(" "+o[0].substr(1).trim()).substr(1);e.startObject(m)}else if(sEt.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(oEt.test(n))e.materialLibraries.push(n.substring(7).trim());else if(lEt.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(i==="s"){if(o=n.split(" "),o.length>1){const _=o[1].trim().toLowerCase();e.object.smooth=_!=="0"&&_!=="off"}else e.object.smooth=!0;const m=e.object.currentMaterial();m&&(m.smooth=e.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}e.finalize();const l=new KE;if(l.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let u=0,f=e.objects.length;u<f;u++){const m=e.objects[u],_=m.geometry,x=m.materials,M=_.type==="Line",T=_.type==="Points";let w=!1;if(_.vertices.length===0)continue;const P=new Rh;P.setAttribute("position",new Rc(_.vertices,3)),_.normals.length>0&&P.setAttribute("normal",new Rc(_.normals,3)),_.colors.length>0&&(w=!0,P.setAttribute("color",new Rc(_.colors,3))),_.hasUVIndices===!0&&P.setAttribute("uv",new Rc(_.uvs,2));const O=[];for(let W=0,$=x.length;W<$;W++){const Z=x[W],J=Z.name+"_"+Z.smooth+"_"+w;let ae=e.materials[J];if(this.materials!==null){if(ae=this.materials.create(Z.name),M&&ae&&!(ae instanceof wx)){const K=new wx;s2.prototype.copy.call(K,ae),K.color.copy(ae.color),ae=K}else if(T&&ae&&!(ae instanceof iw)){const K=new iw({size:10,sizeAttenuation:!1});s2.prototype.copy.call(K,ae),K.color.copy(ae.color),K.map=ae.map,ae=K}}ae===void 0&&(M?ae=new wx:T?ae=new iw({size:1,sizeAttenuation:!1}):ae=new vL,ae.name=Z.name,ae.flatShading=!Z.smooth,ae.vertexColors=w,e.materials[J]=ae),O.push(ae)}let B;if(O.length>1){for(let W=0,$=x.length;W<$;W++){const Z=x[W];P.addGroup(Z.groupStart,Z.groupCount,W)}M?B=new V3(P,O):T?B=new Q6(P,O):B=new Wg(P,O)}else M?B=new V3(P,O[0]):T?B=new Q6(P,O[0]):B=new Wg(P,O[0]);B.name=m.name,l.add(B)}else if(e.vertices.length>0){const u=new iw({size:1,sizeAttenuation:!1}),f=new Rh;f.setAttribute("position",new Rc(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(f.setAttribute("color",new Rc(e.colors,3)),u.vertexColors=!0);const m=new Q6(f,u);l.add(m)}return l}};function fEt({stlUrl:r,mtlUrl:e,color:t,opacity:n=1}){const i=tK(nEt,r),a=ot.useRef();return $e.jsxs("mesh",{ref:a,children:[$e.jsx("primitive",{object:i,attach:"geometry"}),$e.jsx("meshStandardMaterial",{color:t,transparent:n!==1,opacity:n})]})}var dEt={version:"0.0.178"};typeof window<"u"&&(window.TSCI_MAIN_CAMERA_ROTATION=new W5(0,0,0));function hEt(r,e){const t=new P2().setFromEuler(new W5(r.x,r.y,r.z)),n=new Ln(0,0,1);return n.applyQuaternion(t),n.multiplyScalar(e)}var pEt=({})=>{const r=ot.useRef();return ot.useRef({lastRotation:new W5}),yC((e,t)=>{if(!r.current)return;const n=window.TSCI_MAIN_CAMERA_ROTATION,i=hEt(n,2);e.camera.position.copy(i),e.camera.lookAt(0,0,0)}),$e.jsxs("mesh",{ref:r,rotation:[Math.PI/2,0,0],children:[$e.jsx("boxGeometry",{args:[1,1,1]}),$e.jsx("meshStandardMaterial",{color:"white"}),$e.jsx(_w,{position:[0,0,.51],fontSize:.25,color:"black",children:"Front"}),$e.jsx(_w,{position:[0,0,-.51],fontSize:.25,color:"black",rotation:[0,Math.PI,0],children:"Back"}),$e.jsx(_w,{position:[.51,0,0],fontSize:.25,color:"black",rotation:[0,Math.PI/2,0],children:"Right"}),$e.jsx(_w,{position:[-.51,0,0],fontSize:.25,color:"black",rotation:[0,-Math.PI/2,0],children:"Left"}),$e.jsx(_w,{position:[0,.51,0],fontSize:.25,color:"black",rotation:[-Math.PI/2,0,0],children:"Top"}),$e.jsx(_w,{position:[0,-.51,0],fontSize:.25,color:"black",rotation:[Math.PI/2,0,0],children:"Bottom"}),$e.jsx("lineSegments",{args:[new yQ(new z4(1,1,1))],material:new wx({color:0,linewidth:2})})]})},mEt=()=>(yC(({camera:r})=>{window.TSCI_MAIN_CAMERA_ROTATION=r.rotation}),$e.jsx($e.Fragment,{})),vEt=ot.forwardRef(({children:r,hoveredComponent:e,initialCameraPosition:t=[5,5,5],autoRotateDisabled:n},i)=>$e.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[$e.jsx("div",{style:{position:"absolute",top:0,left:0,width:120,height:120},children:$e.jsxs(Rbe,{camera:{up:[0,0,1],position:[1,1,1]},style:{zIndex:10},children:[$e.jsx("ambientLight",{intensity:Math.PI/2}),$e.jsx(pEt,{})]})}),$e.jsxs(Rbe,{scene:{up:[0,0,1]},camera:{up:[0,0,1],position:t},children:[$e.jsx(mEt,{}),$e.jsx(Uvt,{autoRotate:!n,autoRotateSpeed:1}),$e.jsx("ambientLight",{intensity:Math.PI/2}),$e.jsx("pointLight",{position:[-10,-10,10],decay:0,intensity:Math.PI/4}),$e.jsx(kvt,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:1,sectionSize:10}),$e.jsx("object3D",{ref:i,children:r}),e&&$e.jsx(Pmt,{position:e.mousePosition,style:{fontFamily:"sans-serif",transform:"translate3d(50%, 50%, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:e.name})]}),$e.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",dEt.version]})]})),yEt=r=>$e.jsx("group",{...r}),gEt=({children:r,isHovered:e,onHover:t,position:n})=>{const i=ot.useRef(null),a=ot.useCallback(s=>{s.stopPropagation();try{const l=s.point||(s.intersections&&s.intersections.length>0?s.intersections[0].point:null)||(n?new Ln(...n):null);l?(i.current=l,t({mousePosition:[l.x,l.y,l.z]})):t({})}catch(l){console.warn("Hover event error:",l),t({})}},[n]),o=ot.useCallback(s=>{s.stopPropagation(),i.current=null,t(null)},[t]);return $e.jsx(yEt,{onPointerEnter:a,onPointerMove:a,onPointerLeave:o,children:r})},XO=gEt;typeof window<"u"&&!window.TSCIRCUIT_OBJ_LOADER_CACHE&&(window.TSCIRCUIT_OBJ_LOADER_CACHE=new Map);function _Et(r){const[e,t]=ot.useState(null);return ot.useEffect(()=>{if(!r)return;const n=window.TSCIRCUIT_OBJ_LOADER_CACHE;let i=!1;async function a(){var s;try{const c=await(await fetch(r)).text(),u=(s=c.match(/newmtl[\s\S]*?endmtl/g))==null?void 0:s.join(`
|
|
13032
13032
|
`).replace(/d 0\./g,"d 1."),f=c.replace(/newmtl[\s\S]*?endmtl/g,""),m=new rEt;m.setMaterialOptions({invertTrProperty:!0});const _=m.parse(u.replace(/Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,"Kd $2 $2 $2"),"test.mtl"),x=new uEt;return x.setMaterials(_),x.parse(f)}catch(l){return l}}function o(){if(n.has(r)){const l=n.get(r);return l.result?Promise.resolve(l.result.clone()):l.promise.then(c=>c.clone())}const s=a().then(l=>(l instanceof Error||n.set(r,{...n.get(r),result:l}),l));return n.set(r,{promise:s,result:null}),s}return o().then(s=>{i||t(s)}).catch(s=>{console.error(s)}),()=>{i=!0}},[r]),e}function xEt({url:r,position:e,rotation:t,onHover:n,isHovered:i}){const a=_Et(r);return a?a instanceof Error?$e.jsx(XO,{isHovered:i,onHover:n,children:$e.jsxs("mesh",{position:e,children:[$e.jsx("boxGeometry",{args:[.5,.5,.5]}),$e.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.5}),$e.jsx("meshBasicMaterial",{color:"red"})]})}):$e.jsx(XO,{isHovered:i,onHover:n,children:$e.jsx("primitive",{rotation:t,position:e,object:a})}):$e.jsx(XO,{isHovered:i,onHover:n,children:$e.jsxs("mesh",{position:e,children:[$e.jsx("boxGeometry",{args:[.5,.5,.5]}),$e.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.25})]})})}var bEt=f5(P6e()),B6e=({jscadPlan:r,positionOffset:e,rotationOffset:t,onHover:n,isHovered:i})=>{const{threeGeom:a,material:o}=ot.useMemo(()=>{const s=_Se.executeJscadOperations(bEt.default,r),l=O1t(s),c=new mL({vertexColors:!0,side:v3});return{threeGeom:l,material:c}},[r]);return ot.useMemo(()=>{if(i){const s=new Cl(o.color.getHex());o.emissive.copy(s),o.emissive.setRGB(0,0,1),o.emissiveIntensity=.2}else o.emissiveIntensity=0},[i,o]),a?$e.jsx(XO,{isHovered:i,onHover:n,position:e,children:$e.jsx("mesh",{geometry:a,material:o,position:e,rotation:t})}):null},{createJSCADRoot:SEt}=D1t(_Se.jscadPlanner),EEt=({positionOffset:r,footprint:e,rotationOffset:t,onHover:n,isHovered:i})=>{const a=ot.useMemo(()=>{if(!e)return null;const o=[];return SEt(o).render($e.jsx(J2t,{footprint:e})),o},[e]);return a?$e.jsx($e.Fragment,{children:a.map((o,s)=>$e.jsx(B6e,{positionOffset:r,rotationOffset:t,jscadPlan:o,onHover:n,isHovered:i},s))}):null},wEt=(...r)=>r,TEt=({cad_component:r,onHover:e=()=>{},isHovered:t=!1})=>{const n=r.model_obj_url??r.model_stl_url,i=r.rotation?wEt(r.rotation.x*Math.PI/180,r.rotation.y*Math.PI/180,r.rotation.z*Math.PI/180):void 0;if(n)return $e.jsx(xEt,{url:n,position:r.position?[r.position.x,r.position.y,r.position.z]:void 0,rotation:i,onHover:e,isHovered:t},r.cad_component_id);if(r.model_jscad)return $e.jsx(B6e,{jscadPlan:r.model_jscad,rotationOffset:i,onHover:e,isHovered:t},r.cad_component_id);if(r.footprinter_string)return $e.jsx(EEt,{positionOffset:r.position?[r.position.x,r.position.y,r.position.z]:void 0,rotationOffset:i,footprint:r.footprinter_string,onHover:e,isHovered:t})},MEt=class extends wh.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){return this.state.hasError&&this.state.error?this.props.fallback({error:this.state.error}):this.props.children}},CEt=({error:r,cad_component:e})=>{let t=[0,0,0];return e!=null&&e.position&&(t=[e.position.x,e.position.y,e.position.z],t=t.map(n=>Number.isNaN(n)?0:n)),$e.jsxs("group",{position:t,children:[$e.jsxs("mesh",{renderOrder:-99999,rotation:[Math.PI/4,Math.PI/4,0],ref:n=>{n&&(n.renderOrder=999999)},children:[$e.jsx("boxGeometry",{args:[.5,.5,.5]}),$e.jsx("meshStandardMaterial",{depthTest:!1,transparent:!0,color:"red",opacity:.5})]}),$e.jsxs(_w,{scale:[.1,.1,.1],color:"red",anchorX:"center",anchorY:"middle",depthOffset:-99999,children:[r.toString().slice(0,50),"..."]})]})},REt=ot.forwardRef(({soup:r,circuitJson:e,children:t,autoRotateDisabled:n},i)=>{e??(e=r);const[a,o]=ot.useState(null);e??(e=G4t(t));const s=ot.useMemo(()=>{if(!e)return[5,5,5];try{const f=qv(e).pcb_board.list()[0];if(!f)return[5,5,5];const{width:m,height:_}=f;if(!m&&!_)return[5,5,5];const x=5,M=Math.max(m,x),T=Math.max(_,x),w=Math.max(M,T);return[w/2,w/2,w]}catch(f){return console.error(f),[5,5,5]}},[e]),l=ot.useMemo(()=>!e||!e.some(f=>f.type==="pcb_board")?null:K4t(e),[e]),{stls:c}=eEt(l);if(!e)return null;const u=qv(e).cad_component.list();return $e.jsxs(vEt,{ref:i,hoveredComponent:a,autoRotateDisabled:n,initialCameraPosition:s,children:[c.map(({stlUrl:f,color:m},_)=>$e.jsx(fEt,{stlUrl:f,color:m,opacity:_===0?.95:1},f)),u.map(f=>$e.jsx(MEt,{fallback:({error:m})=>$e.jsx(CEt,{cad_component:f,error:m}),children:$e.jsx(TEt,{onHover:m=>{var x;if(m||o(null),!m.mousePosition)return;const _=(x=qv(e).source_component.getUsing({source_component_id:f.source_component_id}))==null?void 0:x.name;o({cad_component_id:f.cad_component_id,name:_??"<unknown>",mousePosition:m.mousePosition})},cad_component:f,isHovered:(a==null?void 0:a.cad_component_id)===f.cad_component_id},f.cad_component_id)},f.cad_component_id))]})}),AEt=f5(V4t());f5(P6e()),(0,AEt.default)("tscircuit:3d-viewer:convert-circuit-json-to-3d-svg");const x7=r=>typeof r=="number"&&!isNaN(r),Lw=r=>typeof r=="string",S3=r=>typeof r=="function",WO=r=>Lw(r)||S3(r)?r:null,Uee=r=>ot.isValidElement(r)||Lw(r)||S3(r)||x7(r);function NEt(r,e,t){t===void 0&&(t=300);const{scrollHeight:n,style:i}=r;requestAnimationFrame(()=>{i.minHeight="initial",i.height=n+"px",i.transition=`all ${t}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,t)})})}function $O(r){let{enter:e,exit:t,appendPosition:n=!1,collapse:i=!0,collapseDuration:a=300}=r;return function(o){let{children:s,position:l,preventExitTransition:c,done:u,nodeRef:f,isIn:m,playToast:_}=o;const x=n?`${e}--${l}`:e,M=n?`${t}--${l}`:t,T=ot.useRef(0);return ot.useLayoutEffect(()=>{const w=f.current,P=x.split(" "),O=B=>{B.target===f.current&&(_(),w.removeEventListener("animationend",O),w.removeEventListener("animationcancel",O),T.current===0&&B.type!=="animationcancel"&&w.classList.remove(...P))};w.classList.add(...P),w.addEventListener("animationend",O),w.addEventListener("animationcancel",O)},[]),ot.useEffect(()=>{const w=f.current,P=()=>{w.removeEventListener("animationend",P),i?NEt(w,u,a):u()};m||(c?P():(T.current=1,w.className+=` ${M}`,w.addEventListener("animationend",P)))},[m]),wh.createElement(wh.Fragment,null,s)}}function j6e(r,e){return r!=null?{content:r.content,containerId:r.props.containerId,id:r.props.toastId,theme:r.props.theme,type:r.props.type,data:r.props.data||{},isLoading:r.props.isLoading,icon:r.props.icon,status:e}:{}}const R5=new Map;let b7=[];const Iee=new Set,PEt=r=>Iee.forEach(e=>e(r)),H6e=()=>R5.size>0;function V6e(r,e){var t;if(e)return!((t=R5.get(e))==null||!t.isToastActive(r));let n=!1;return R5.forEach(i=>{i.isToastActive(r)&&(n=!0)}),n}function G6e(r,e){Uee(r)&&(H6e()||b7.push({content:r,options:e}),R5.forEach(t=>{t.buildToast(r,e)}))}function q6e(r,e){R5.forEach(t=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===t.id&&t.toggle(r,e==null?void 0:e.id):t.toggle(r,e==null?void 0:e.id)})}function DEt(r){const{subscribe:e,getSnapshot:t,setProps:n}=ot.useRef(function(a){const o=a.containerId||1;return{subscribe(s){const l=function(u,f,m){let _=1,x=0,M=[],T=[],w=[],P=f;const O=new Map,B=new Set,W=()=>{w=Array.from(O.values()),B.forEach(J=>J())},$=J=>{T=J==null?[]:T.filter(ae=>ae!==J),W()},Z=J=>{const{toastId:ae,onOpen:K,updateId:fe,children:pe}=J.props,be=fe==null;J.staleId&&O.delete(J.staleId),O.set(ae,J),T=[...T,J.props.toastId].filter(Me=>Me!==J.staleId),W(),m(j6e(J,be?"added":"updated")),be&&S3(K)&&K(ot.isValidElement(pe)&&pe.props)};return{id:u,props:P,observe:J=>(B.add(J),()=>B.delete(J)),toggle:(J,ae)=>{O.forEach(K=>{ae!=null&&ae!==K.props.toastId||S3(K.toggle)&&K.toggle(J)})},removeToast:$,toasts:O,clearQueue:()=>{x-=M.length,M=[]},buildToast:(J,ae)=>{if((ze=>{let{containerId:st,toastId:rt,updateId:pt}=ze;const Tt=st?st!==u:u!==1,Lt=O.has(rt)&&pt==null;return Tt||Lt})(ae))return;const{toastId:K,updateId:fe,data:pe,staleId:be,delay:Me}=ae,Le=()=>{$(K)},Ee=fe==null;Ee&&x++;const Oe={...P,style:P.toastStyle,key:_++,...Object.fromEntries(Object.entries(ae).filter(ze=>{let[st,rt]=ze;return rt!=null})),toastId:K,updateId:fe,data:pe,closeToast:Le,isIn:!1,className:WO(ae.className||P.toastClassName),bodyClassName:WO(ae.bodyClassName||P.bodyClassName),progressClassName:WO(ae.progressClassName||P.progressClassName),autoClose:!ae.isLoading&&(Te=ae.autoClose,Ve=P.autoClose,Te===!1||x7(Te)&&Te>0?Te:Ve),deleteToast(){const ze=O.get(K),{onClose:st,children:rt}=ze.props;S3(st)&&st(ot.isValidElement(rt)&&rt.props),m(j6e(ze,"removed")),O.delete(K),x--,x<0&&(x=0),M.length>0?Z(M.shift()):W()}};var Te,Ve;Oe.closeButton=P.closeButton,ae.closeButton===!1||Uee(ae.closeButton)?Oe.closeButton=ae.closeButton:ae.closeButton===!0&&(Oe.closeButton=!Uee(P.closeButton)||P.closeButton);let Ue=J;ot.isValidElement(J)&&!Lw(J.type)?Ue=ot.cloneElement(J,{closeToast:Le,toastProps:Oe,data:pe}):S3(J)&&(Ue=J({closeToast:Le,toastProps:Oe,data:pe}));const je={content:Ue,props:Oe,staleId:be};P.limit&&P.limit>0&&x>P.limit&&Ee?M.push(je):x7(Me)?setTimeout(()=>{Z(je)},Me):Z(je)},setProps(J){P=J},setToggle:(J,ae)=>{O.get(J).toggle=ae},isToastActive:J=>T.some(ae=>ae===J),getSnapshot:()=>w}}(o,a,PEt);R5.set(o,l);const c=l.observe(s);return b7.forEach(u=>G6e(u.content,u.options)),b7=[],()=>{c(),R5.delete(o)}},setProps(s){var l;(l=R5.get(o))==null||l.setProps(s)},getSnapshot(){var s;return(s=R5.get(o))==null?void 0:s.getSnapshot()}}}(r)).current;n(r);const i=ot.useSyncExternalStore(e,t,t);return{getToastToRender:function(a){if(!i)return[];const o=new Map;return r.newestOnTop&&i.reverse(),i.forEach(s=>{const{position:l}=s.props;o.has(l)||o.set(l,[]),o.get(l).push(s)}),Array.from(o,s=>a(s[0],s[1]))},isToastActive:V6e,count:i==null?void 0:i.length}}function LEt(r){const[e,t]=ot.useState(!1),[n,i]=ot.useState(!1),a=ot.useRef(null),o=ot.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:f}=r;var m,_;function x(){t(!0)}function M(){t(!1)}function T(O){const B=a.current;o.canDrag&&B&&(o.didMove=!0,e&&M(),o.delta=r.draggableDirection==="x"?O.clientX-o.start:O.clientY-o.start,o.start!==O.clientX&&(o.canCloseOnClick=!1),B.style.transform=`translate3d(${r.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,B.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function w(){document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",w);const O=a.current;if(o.canDrag&&o.didMove&&O){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),r.closeToast(),void r.collapseAll();O.style.transition="transform 0.2s, opacity 0.2s",O.style.removeProperty("transform"),O.style.removeProperty("opacity")}}(_=R5.get((m={id:r.toastId,containerId:r.containerId,fn:t}).containerId||1))==null||_.setToggle(m.id,m.fn),ot.useEffect(()=>{if(r.pauseOnFocusLoss)return document.hasFocus()||M(),window.addEventListener("focus",x),window.addEventListener("blur",M),()=>{window.removeEventListener("focus",x),window.removeEventListener("blur",M)}},[r.pauseOnFocusLoss]);const P={onPointerDown:function(O){if(r.draggable===!0||r.draggable===O.pointerType){o.didMove=!1,document.addEventListener("pointermove",T),document.addEventListener("pointerup",w);const B=a.current;o.canCloseOnClick=!0,o.canDrag=!0,B.style.transition="none",r.draggableDirection==="x"?(o.start=O.clientX,o.removalDistance=B.offsetWidth*(r.draggablePercent/100)):(o.start=O.clientY,o.removalDistance=B.offsetHeight*(r.draggablePercent===80?1.5*r.draggablePercent:r.draggablePercent)/100)}},onPointerUp:function(O){const{top:B,bottom:W,left:$,right:Z}=a.current.getBoundingClientRect();O.nativeEvent.type!=="touchend"&&r.pauseOnHover&&O.clientX>=$&&O.clientX<=Z&&O.clientY>=B&&O.clientY<=W?M():x()}};return s&&l&&(P.onMouseEnter=M,r.stacked||(P.onMouseLeave=x)),f&&(P.onClick=O=>{u&&u(O),o.canCloseOnClick&&c()}),{playToast:x,pauseToast:M,isRunning:e,preventExitTransition:n,toastRef:a,eventHandlers:P}}function OEt(r){let{delay:e,isRunning:t,closeToast:n,type:i="default",hide:a,className:o,style:s,controlledProgress:l,progress:c,rtl:u,isIn:f,theme:m}=r;const _=a||l&&c===0,x={...s,animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};l&&(x.transform=`scaleX(${c})`);const M=zb("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${m}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":u}),T=S3(o)?o({rtl:u,type:i,defaultClassName:M}):zb(M,o),w={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{f&&n()}};return wh.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":_},wh.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${m} Toastify__progress-bar--${i}`}),wh.createElement("div",{role:"progressbar","aria-hidden":_?"true":"false","aria-label":"notification timer",className:T,style:x,...w}))}let zEt=1;const Y6e=()=>""+zEt++;function UEt(r){return r&&(Lw(r.toastId)||x7(r.toastId))?r.toastId:Y6e()}function S7(r,e){return G6e(r,e),e.toastId}function ZO(r,e){return{...e,type:e&&e.type||r,toastId:UEt(e)}}function QO(r){return(e,t)=>S7(e,ZO(r,t))}function jy(r,e){return S7(r,ZO("default",e))}jy.loading=(r,e)=>S7(r,ZO("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),jy.promise=function(r,e,t){let n,{pending:i,error:a,success:o}=e;i&&(n=Lw(i)?jy.loading(i,t):jy.loading(i.render,{...t,...i}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,f,m)=>{if(f==null)return void jy.dismiss(n);const _={type:u,...s,...t,data:m},x=Lw(f)?{render:f}:f;return n?jy.update(n,{..._,...x}):jy(x.render,{..._,...x}),m},c=S3(r)?r():r;return c.then(u=>l("success",o,u)).catch(u=>l("error",a,u)),c},jy.success=QO("success"),jy.info=QO("info"),jy.error=QO("error"),jy.warning=QO("warning"),jy.warn=jy.warning,jy.dark=(r,e)=>S7(r,ZO("default",{theme:"dark",...e})),jy.dismiss=function(r){(function(e){var t;if(H6e()){if(e==null||Lw(t=e)||x7(t))R5.forEach(n=>{n.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const n=R5.get(e.containerId);n?n.removeToast(e.id):R5.forEach(i=>{i.removeToast(e.id)})}}else b7=b7.filter(n=>e!=null&&n.options.toastId!==e)})(r)},jy.clearWaitingQueue=function(r){r===void 0&&(r={}),R5.forEach(e=>{!e.props.limit||r.containerId&&e.id!==r.containerId||e.clearQueue()})},jy.isActive=V6e,jy.update=function(r,e){e===void 0&&(e={});const t=((n,i)=>{var a;let{containerId:o}=i;return(a=R5.get(o||1))==null?void 0:a.toasts.get(n)})(r,e);if(t){const{props:n,content:i}=t,a={delay:100,...n,...e,toastId:e.toastId||r,updateId:Y6e()};a.toastId!==r&&(a.staleId=r);const o=a.render||i;delete a.render,S7(o,a)}},jy.done=r=>{jy.update(r,{progress:1})},jy.onChange=function(r){return Iee.add(r),()=>{Iee.delete(r)}},jy.play=r=>q6e(!0,r),jy.pause=r=>q6e(!1,r);const IEt=typeof window<"u"?ot.useLayoutEffect:ot.useEffect,KO=r=>{let{theme:e,type:t,isLoading:n,...i}=r;return wh.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...i})},kee={info:function(r){return wh.createElement(KO,{...r},wh.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(r){return wh.createElement(KO,{...r},wh.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(r){return wh.createElement(KO,{...r},wh.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(r){return wh.createElement(KO,{...r},wh.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return wh.createElement("div",{className:"Toastify__spinner"})}},kEt=r=>{const{isRunning:e,preventExitTransition:t,toastRef:n,eventHandlers:i,playToast:a}=LEt(r),{closeButton:o,children:s,autoClose:l,onClick:c,type:u,hideProgressBar:f,closeToast:m,transition:_,position:x,className:M,style:T,bodyClassName:w,bodyStyle:P,progressClassName:O,progressStyle:B,updateId:W,role:$,progress:Z,rtl:J,toastId:ae,deleteToast:K,isIn:fe,isLoading:pe,closeOnClick:be,theme:Me}=r,Le=zb("Toastify__toast",`Toastify__toast-theme--${Me}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":J},{"Toastify__toast--close-on-click":be}),Ee=S3(M)?M({rtl:J,position:x,type:u,defaultClassName:Le}):zb(Le,M),Oe=function(je){let{theme:ze,type:st,isLoading:rt,icon:pt}=je,Tt=null;const Lt={theme:ze,type:st};return pt===!1||(S3(pt)?Tt=pt({...Lt,isLoading:rt}):ot.isValidElement(pt)?Tt=ot.cloneElement(pt,Lt):rt?Tt=kee.spinner():(Kt=>Kt in kee)(st)&&(Tt=kee[st](Lt))),Tt}(r),Te=!!Z||!l,Ve={closeToast:m,type:u,theme:Me};let Ue=null;return o===!1||(Ue=S3(o)?o(Ve):ot.isValidElement(o)?ot.cloneElement(o,Ve):function(je){let{closeToast:ze,theme:st,ariaLabel:rt="close"}=je;return wh.createElement("button",{className:`Toastify__close-button Toastify__close-button--${st}`,type:"button",onClick:pt=>{pt.stopPropagation(),ze(pt)},"aria-label":rt},wh.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},wh.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Ve)),wh.createElement(_,{isIn:fe,done:K,position:x,preventExitTransition:t,nodeRef:n,playToast:a},wh.createElement("div",{id:ae,onClick:c,"data-in":fe,className:Ee,...i,style:T,ref:n},wh.createElement("div",{...fe&&{role:$},className:S3(w)?w({type:u}):zb("Toastify__toast-body",w),style:P},Oe!=null&&wh.createElement("div",{className:zb("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!pe})},Oe),wh.createElement("div",null,s)),Ue,wh.createElement(OEt,{...W&&!Te?{key:`pb-${W}`}:{},rtl:J,theme:Me,delay:l,isRunning:e,isIn:fe,closeToast:m,hide:f,type:u,style:B,className:O,controlledProgress:Te,progress:Z||0})))},JO=function(r,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${r}-enter`,exit:`Toastify--animate Toastify__${r}-exit`,appendPosition:e}},FEt=$O(JO("bounce",!0));$O(JO("slide",!0)),$O(JO("zoom")),$O(JO("flip"));const BEt={position:"top-right",transition:FEt,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function jEt(r){let e={...BEt,...r};const t=r.stacked,[n,i]=ot.useState(!0),a=ot.useRef(null),{getToastToRender:o,isToastActive:s,count:l}=DEt(e),{className:c,style:u,rtl:f,containerId:m}=e;function _(M){const T=zb("Toastify__toast-container",`Toastify__toast-container--${M}`,{"Toastify__toast-container--rtl":f});return S3(c)?c({position:M,rtl:f,defaultClassName:T}):zb(T,WO(c))}function x(){t&&(i(!0),jy.play())}return IEt(()=>{if(t){var M;const T=a.current.querySelectorAll('[data-in="true"]'),w=12,P=(M=e.position)==null?void 0:M.includes("top");let O=0,B=0;Array.from(T).reverse().forEach((W,$)=>{const Z=W;Z.classList.add("Toastify__toast--stacked"),$>0&&(Z.dataset.collapsed=`${n}`),Z.dataset.pos||(Z.dataset.pos=P?"top":"bot");const J=O*(n?.2:1)+(n?0:w*$);Z.style.setProperty("--y",`${P?J:-1*J}px`),Z.style.setProperty("--g",`${w}`),Z.style.setProperty("--s",""+(1-(n?B:0))),O+=Z.offsetHeight,B+=.025})}},[n,l,t]),wh.createElement("div",{ref:a,className:"Toastify",id:m,onMouseEnter:()=>{t&&(i(!1),jy.pause())},onMouseLeave:x},o((M,T)=>{const w=T.length?{...u}:{...u,pointerEvents:"none"};return wh.createElement("div",{className:_(M),style:w,key:`container-${M}`},T.map(P=>{let{content:O,props:B}=P;return wh.createElement(kEt,{...B,stacked:t,collapseAll:x,isIn:s(B.toastId,B.containerId),style:B.style,key:`toast-${B.key}`},O)}))}))}function HEt(){var r=':root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-offset:16px;--toastify-toast-top:max(var(--toastify-toast-offset),env(safe-area-inset-top));--toastify-toast-right:max(var(--toastify-toast-offset),env(safe-area-inset-right));--toastify-toast-left:max(var(--toastify-toast-offset),env(safe-area-inset-left));--toastify-toast-bottom:max(var(--toastify-toast-offset),env(safe-area-inset-bottom));--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-toast-bd-radius:6px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error);--toastify-color-progress-bgo:0.2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translateX(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:auto}}.Toastify__toast{--y:0;position:relative;-ms-touch-action:none;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__close-button,.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right;border-bottom-left-radius:0;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}',e=document.createElement("style");e.innerText=r,document.head.appendChild(e)}function VEt(r){const e=new Map;let t=0;function n(i){for(const[,o]of e)if(o.has(i))return o;const a=new Set;return e.set(`connectivity_net${t++}`,a),a}for(const i of r){let a=null;for(const o of i){if(!a)a=n(o);else if(!a.has(o)){const s=n(o);if(s!==a){for(const l of s)a.add(l);e.delete(Array.from(e.entries()).find(([,l])=>l===s)[0])}}a.add(o)}}return Object.fromEntries(Array.from(e.entries()).map(([i,a])=>[i,Array.from(a)]))}var GEt=class{constructor(r){jt(this,"netMap");jt(this,"idToNetMap");this.netMap=r,this.idToNetMap={};for(const[e,t]of Object.entries(r))for(const n of t)this.idToNetMap[n]=e}addConnections(r){for(const e of r){const t=new Set;for(const i of e){const a=this.idToNetMap[i];a&&t.add(a)}let n;if(t.size===0)n=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[n]=[];else if(t.size===1)n=t.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{n=t.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(const i of t)if(i!==n){this.netMap[n].push(...this.netMap[i]),this.netMap[i]=this.netMap[n];for(const a of this.netMap[n])this.idToNetMap[a]=n}}for(const i of e)this.netMap[n].includes(i)||this.netMap[n].push(i),this.idToNetMap[i]=n}}getIdsConnectedToNet(r){return this.netMap[r]||[]}getNetConnectedToId(r){return this.idToNetMap[r]}areIdsConnected(r,e){if(r===e)return!0;const t=this.getNetConnectedToId(r);if(!t)return!1;const n=this.getNetConnectedToId(e);return n?t===n||n===r||n===r:!1}areAllIdsConnected(r){const e=this.getNetConnectedToId(r[0]);for(const t of r){const n=this.getNetConnectedToId(t);if(n===void 0||n!==e)return!1}return!0}},X6e=r=>{const e=[];for(const n of r)if(n.type==="source_trace")e.push([n.source_trace_id,...n.connected_source_port_ids??[],...n.connected_source_net_ids??[]].filter(Boolean));else if(n.type==="pcb_port"){const{pcb_port_id:i,source_port_id:a}=n;a&&i&&e.push([a,i])}else if(n.type==="pcb_smtpad"){const{pcb_smtpad_id:i,pcb_port_id:a}=n;a&&i&&e.push([i,a])}else if(n.type==="pcb_plated_hole"){const{pcb_plated_hole_id:i,pcb_port_id:a}=n;a&&i&&e.push([i,a])}else if(n.type==="pcb_trace"){const{pcb_trace_id:i,source_trace_id:a}=n;a&&i&&e.push([i,a])}const t=VEt(e);return new GEt(t)};const qEt=Qw(Qqe);var Fee,W6e;function YEt(){if(W6e)return Fee;W6e=1;var r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(T,w)=>{for(var P in w)r(T,P,{get:w[P],enumerable:!0})},a=(T,w,P,O)=>{if(w&&typeof w=="object"||typeof w=="function")for(let B of t(w))!n.call(T,B)&&B!==P&&r(T,B,{get:()=>w[B],enumerable:!(O=e(w,B))||O.enumerable});return T},o=T=>a(r({},"__esModule",{value:!0}),T),s={};i(s,{SuperGrid:()=>M,toMMSI:()=>x,toMeterSI:()=>_}),Fee=o(s);var l=i2(),c=qEt,u=Zae(),f=(T,w,P)=>{const O=[];if(w<T)for(let B=T;B>=w;B-=Math.abs(P))O.push(B);else for(let B=T;B<=w;B+=Math.abs(P))O.push(B);return O};function m(T,w){return{x:Math.round(w.x/T)*T,y:Math.round(w.y/T)*T}}function _(T,w=1){return T<0?"-"+_(-T):T<1e-6?"0m":T>1e3?Math.floor(T/1e3)+"km":T>1&&w>1?Math.round(T)+"m":T>1&&w<=1?T.toFixed(Math.ceil(-Math.log10(w)))+"m":T<1&&w>=1/1e3?Math.round(T*1e3)+"mm":T<1&&w<1/1e3?(T*1e3).toFixed(Math.ceil(-Math.log10(w*1e3)))+"mm":""}function x(T,w=1){return _(T/1e3,w/1e3)}var M=T=>{var w;const P=(0,l.useRef)(null),[O,B]=(0,l.useState)({x:0,y:0}),{majorColor:W="rgba(0,0,0,0.2)",minorColor:$="rgba(0,0,0,0.1)",textColor:Z=(w=T.majorColor)!=null?w:"rgba(0,0,0,0.5)",width:J,height:ae,screenSpaceCellSize:K=200,stringifyCoord:fe=(Le,Ee,Oe)=>`${_(Le,Oe)}, ${_(Ee,Oe)}`}=T,pe=Math.ceil(J/K)+2,be=Math.ceil(ae/K)+2;(0,l.useEffect)(()=>{if(!P.current)return;const Le=P.current.getContext("2d");if(!Le)return;const Ee=K/10**Math.floor(Math.log10(T.transform.a)),Oe=T.transform.d<0?-1:1,Ve=K/10**Math.log10(T.transform.a)/Ee;function Ue(kn,gn,dn){const Tn=kn;let Wt,gr,Jn;for(Wt=gn.x;Wt<=dn.x;Wt+=Tn)gr=(0,c.applyToPoint)(T.transform,{x:Wt,y:gn.y}),Jn=(0,c.applyToPoint)(T.transform,{x:Wt,y:dn.y}),Le.beginPath(),Le.moveTo(gr.x,gr.y),Le.lineTo(Jn.x,Jn.y),Le.stroke();const sn=f(gn.y,dn.y,Tn*Oe);for(const lr of sn)gr=(0,c.applyToPoint)(T.transform,{x:gn.x,y:lr}),Jn=(0,c.applyToPoint)(T.transform,{x:dn.x,y:lr}),Le.beginPath(),Le.moveTo(gr.x,gr.y),Le.lineTo(Jn.x,Jn.y),Le.stroke()}function je(kn,gn,dn){const Tn=kn;let Wt;for(Wt=gn.x;Wt<=dn.x;Wt+=Tn)for(const gr of f(gn.y,dn.y,Tn*Oe)){const Jn=(0,c.applyToPoint)(T.transform,{x:Wt,y:gr});Le.fillStyle=Z,Le.font="12px sans-serif",Le.fillText(fe(Wt,gr,kn),Jn.x+2,Jn.y-2)}}Le.clearRect(0,0,J,ae);const ze=(0,c.applyToPoint)((0,c.inverse)(T.transform),{x:0,y:0}),st={x:Math.floor((ze.x-Ee)/Ee)*Ee,y:Math.floor((ze.y-Ee)/Ee+(Oe==-1?2:0))*Ee},rt={x:st.x+Ee*pe,y:st.y+Ee*be*Oe},Tt=Ee*5,Lt={x:Math.floor((ze.x-Tt)/Tt)*Tt,y:Math.floor((ze.y-Tt)/Tt+(Oe==-1?2:0))*Tt},Kt={x:Lt.x+Tt*pe,y:Lt.y+Tt*be*Oe};Le.globalAlpha=1,Le.strokeStyle=W,Ue(Ee,st,rt),je(Tt,Lt,Kt),Le.globalAlpha=1-Ve,Ue(Tt/10,Lt,Kt),Le.globalAlpha=1-Ve,Le.strokeStyle=$,Ue(Ee/10,st,rt),Le.globalAlpha=Math.max(((1-Ve)*10-5)/5,0),je(Tt/10,Lt,Kt),Le.globalAlpha=1;const Jt=(0,c.applyToPoint)(T.transform,O);Le.font="12px sans-serif",Le.fillStyle=Z,Le.fillText(fe(O.x,O.y,Ee),Jt.x+2,Jt.y-2),Le.strokeStyle=W,Le.strokeRect(Jt.x-5,Jt.y-5,10,10)},[P,T.transform,O,J,ae]);const Me=Le=>{if(!P.current)return;const Ee=K/10/10**Math.floor(Math.log10(T.transform.a)),Oe=P.current.getBoundingClientRect(),Te=(0,c.applyToPoint)((0,c.inverse)(T.transform),{x:Le.clientX-Oe.left,y:Le.clientY-Oe.top}),Ve=m(Ee,Te);B(Ve)};return(0,u.jsx)("canvas",{onMouseUp:Le=>{Le.button===1&&Me(Le)},onDoubleClick:Me,ref:P,width:T.width,height:T.height})};return Fee}var Bee=YEt();/*!
|
|
13033
13033
|
* Determine if an object is a Buffer
|
|
13034
13034
|
*
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tscircuit/runframe",
|
|
3
3
|
"main": "dist/preview.js",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.280",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/preview.js",
|
|
8
8
|
"./preview": "./dist/preview.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@radix-ui/react-icons": "^1.3.2",
|
|
68
68
|
"@radix-ui/react-slot": "^1.1.1",
|
|
69
69
|
"@radix-ui/react-tabs": "^1.1.2",
|
|
70
|
-
"@tscircuit/3d-viewer": "^0.0.
|
|
70
|
+
"@tscircuit/3d-viewer": "^0.0.179",
|
|
71
71
|
"@tscircuit/assembly-viewer": "^0.0.1",
|
|
72
72
|
"@tscircuit/core": "^0.0.357",
|
|
73
73
|
"@tscircuit/create-snippet-url": "^0.0.8",
|