PageSourceSearch

https://cellcog.ai/static/js/5227.7d7ae21e.chunk.js

js cellcog.ai collected 2026-10-02 15:39:48 UTC 4,439 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkcellcog_ui=self.webpackChunkcellcog_ui||[]).push([[5227],{15227:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var r=n(40164),o=n(15492),a=n(91686),s=n(65043),i=n(29408),c=n(84718),l=n(68463),d=n(17583),u=n(70579);const m=e=>{let{src:t,filename:n,fileSize:m,isDarkMode:p}=e;const h=(0,s.useRef)(null),f=(0,s.useRef)(null),w=(0,s.useRef)(null),g=(0,s.useRef)(null),v=(0,s.useRef)(null),x=(0,s.useRef)(null),[M,y]=(0,s.useState)(!0),[b,N]=(0,s.useState)(null),R=p?"dark":"light",j=(0,s.useCallback)(()=>{if(x.current&&(cancelAnimationFrame(x.current),x.current=null),v.current&&(v.current.dispose(),v.current=null),w.current&&(w.current.environment&&(w.current.environment.dispose(),w.current.environment=null),w.current.traverse(e=>{if(e.geometry&&e.geometry.dispose(),e.material){(Array.isArray(e.material)?e.material:[e.material]).forEach(e=>{["map","normalMap","roughnessMap","metalnessMap","aoMap","emissiveMap","envMap","alphaMap","bumpMap","displacementMap","lightMap"].forEach(t=>{e[t]&&e[t].dispose()}),e.dispose()})}}),w.current=null),f.current){f.current.dispose();const e=f.current.domElement;e&&e.parentNode&&e.parentNode.removeChild(e),f.current=null}},[]),k=(0,s.useCallback)((e,t,n)=>{const r=(new i.NRn).setFromObject(e),o=r.getCenter(new i.Pq0),a=r.getSize(new i.Pq0),s=Math.max(a.x,a.y,a.z),c=t.fov*(Math.PI/180),l=s/2/Math.tan(c/2)*1.5;t.position.set(o.x+.5*l,o.y+.3*l,o.z+l),t.lookAt(o),n.target.copy(o),n.minDistance=.1*s,n.maxDistance=10*s,n.update()},[]);return(0,s.useEffect)(()=>{if(!h.current||!t)return;const e=h.current;j();const n=new i.Z58;w.current=n;const r=new i.ubm(45,e.clientWidth/e.clientHeight,.01,1e3);g.current=r;const o=new i.JeP({antialias:!0,alpha:!0,preserveDrawingBuffer:!1});o.setSize(e.clientWidth,e.clientHeight),o.setPixelRatio(Math.min(window.devicePixelRatio,2)),o.outputColorSpace=i.er$,o.toneMapping=i.FV,o.toneMappingExposure=p?1.5:1.4,e.appendChild(o.domElement),f.current=o;const a=new d.N(r,o.domElement);a.enableDamping=!0,a.dampingFactor=.08,a.autoRotate=!0,a.autoRotateSpeed=1.5,a.enablePan=!0,a.minDistance=.1,a.maxDistance=100,v.current=a;const s=()=>{a.autoRotate=!1};o.domElement.addEventListener("pointerdown",s);const u=new i.dth(16777215,4473924,p?1.2:1);u.position.set(0,20,0),n.add(u);const m=new i.ZyN(16777215,p?1.8:1.5);m.position.set(5,10,7),n.add(m);const M=new i.ZyN(16777215,p?.8:.7);M.position.set(-5,0,-5),n.add(M);const b=new i.ZyN(16777215,p?.4:.3);b.position.set(0,5,-10),n.add(b),n.background=p?new i.Q1f(1710618):new i.Q1f(15790320),y(!0),N(null);const R=(E=t)&&E.toLowerCase().split("?")[0].split("#")[0].endsWith(".stl")?"stl":"glb";var E;const S=e=>{n.add(e);const t=new i.BdL(o);t.compileEquirectangularShader();const s=t.fromScene(n,0,.1,1e3).texture;n.environment=s,t.dispose(),k(e,r,a),y(!1)},C=e=>{console.error("Failed to load 3D model:",e),N("Failed to load 3D model. The file may be corrupted or unsupported."),y(!1)};if("stl"===R){(new l.t).load(t,e=>{e.computeVertexNormals();const t=new i._4j({color:p?11581632:9081241,metalness:.15,roughness:.6,flatShading:!1}),n=new i.eaF(e,t);S(n)},void 0,C)}else{(new c.B).load(t,e=>{S(e.scene)},void 0,C)}const D=()=>{x.current=requestAnimationFrame(D),a.update(),o.render(n,r)};D();const z=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect;e>0&&n>0&&(r.aspect=e/n,r.updateProjectionMatrix(),o.setSize(e,n))}});return z.observe(e),()=>{z.disconnect(),o.domElement.removeEventListener("pointerdown",s),j()}},[t,p,j,k]),b?(0,u.jsxs)("div",{className:"threed-error-container ".concat(R),children:[(0,u.jsx)("div",{className:"threed-error-icon",children:"\ud83e\uddca"}),(0,u.jsx)("p",{className:"threed-error-message",children:b}),t&&(0,u.jsx)(o.Ay,{type:"primary",onClick:()=>{const e=document.createElement("a");e.href=t,e.download=n||"model.glb",document.body.appendChild(e),e.click(),document.body.removeChild(e)},children:"Download Model"})]}):(0,u.jsxs)("div",{ref:h,className:"threed-viewer-container ".concat(R),children:[M&&(0,u.jsxs)("div",{className:"threed-loading-overlay ".concat(R),children:[(0,u.jsx)(a.A,{indicator:(0,u.jsx)(r.A,{style:{fontSize:48},spin:!0})}),(0,u.jsx)("span",{className:"threed-loading-text",children:"Loading 3D model..."})]}),(0,u.jsx)("div",{className:"threed-controls-hint ".concat(R),children:"Drag to rotate \xb7 Scroll to zoom \xb7 Right-click to pan"})]})}}}]);
2//# sourceMappingURL=5227.7d7ae21e.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.