makearmy-app/.next/static/chunks/app/laser-toolkit/beam-spot-size/page-5ca72ec2ff7fa5fd.js
2025-09-22 10:37:53 -04:00

1 line
No EOL
5.2 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7542],{1046:(e,s,t)=>{"use strict";t.d(s,{A:()=>d});var r=t(5155),a=t(6874),l=t.n(a);function d(e){let{title:s,subtitle:t,children:a}=e;return(0,r.jsxs)("div",{className:"mx-auto max-w-4xl px-4 py-8 space-y-6",children:[(0,r.jsxs)("header",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold",children:s}),t&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:t})]}),(0,r.jsx)(l(),{href:"https://makearmy.io",className:"rounded-lg px-3 py-2 border hover:bg-muted transition-colors text-sm",children:"Back to Main Menu"})]}),a]})}},1135:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>x});var r=t(5155),a=t(2115),l=t(1046),d=t(8482),n=t(9852);function i(e){let s=parseFloat(e);return Number.isFinite(s)?s:0}function x(){let[e,s]=(0,a.useState)("1064"),[t,x]=(0,a.useState)("160"),[c,m]=(0,a.useState)("6"),[o,u]=(0,a.useState)("1.3"),f=(0,a.useMemo)(()=>{let s=i(e)/1e3,r=i(t),a=i(c),l=Math.max(1,i(o));return s<=0||r<=0||a<=0?0:1.27*l*s*(r/a)},[e,t,c,o]),p=f/1e3;return(0,r.jsxs)(l.A,{title:"Beam Spot Size",children:[(0,r.jsxs)(d.Zp,{children:[(0,r.jsx)(d.aR,{children:(0,r.jsx)(d.ZB,{className:"text-base",children:"Inputs"})}),(0,r.jsxs)(d.Wu,{className:"grid gap-3 sm:grid-cols-4",children:[(0,r.jsxs)("label",{className:"text-[11px] sm:text-xs",children:[(0,r.jsx)("div",{className:"mb-1 text-muted-foreground",children:"Wavelength (nm)"}),(0,r.jsx)(n.p,{value:e,onChange:e=>s(e.target.value)}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-muted-foreground space-x-2",children:[(0,r.jsx)("button",{type:"button",className:"underline",onClick:()=>s("1064"),children:"Fiber (1064 nm)"}),(0,r.jsx)("button",{type:"button",className:"underline",onClick:()=>s("10600"),children:"CO₂ (10600 nm)"})]})]}),(0,r.jsxs)("label",{className:"text-[11px] sm:text-xs",children:[(0,r.jsx)("div",{className:"mb-1 text-muted-foreground",children:"Focal length (mm)"}),(0,r.jsx)(n.p,{value:t,onChange:e=>x(e.target.value)})]}),(0,r.jsxs)("label",{className:"text-[11px] sm:text-xs",children:[(0,r.jsx)("div",{className:"mb-1 text-muted-foreground",children:"Beam \xd8 @ lens (mm)"}),(0,r.jsx)(n.p,{value:c,onChange:e=>m(e.target.value)})]}),(0,r.jsxs)("label",{className:"text-[11px] sm:text-xs",children:[(0,r.jsx)("div",{className:"mb-1 text-muted-foreground",children:"M\xb2"}),(0,r.jsx)(n.p,{value:o,onChange:e=>u(e.target.value)})]})]})]}),(0,r.jsxs)(d.Zp,{className:"mt-4",children:[(0,r.jsx)(d.aR,{children:(0,r.jsx)(d.ZB,{className:"text-base",children:"Result"})}),(0,r.jsxs)(d.Wu,{className:"grid gap-3 sm:grid-cols-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:"Spot diameter"}),(0,r.jsxs)("div",{className:"text-lg",children:[p.toFixed(4)," mm"]}),(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:[f.toFixed(2)," \xb5m"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:"Spot radius"}),(0,r.jsxs)("div",{className:"text-lg",children:[(p/2).toFixed(4)," mm"]}),(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(f/2).toFixed(2)," \xb5m"]})]})]})]})]})}},3999:(e,s,t)=>{"use strict";t.d(s,{cn:()=>l});var r=t(2596),a=t(9688);function l(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return(0,a.QP)((0,r.$)(s))}},8482:(e,s,t)=>{"use strict";t.d(s,{Wu:()=>x,ZB:()=>i,Zp:()=>d,aR:()=>n});var r=t(5155),a=t(2115),l=t(3999);let d=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...a})});d.displayName="Card";let n=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",t),...a})});n.displayName="CardHeader";let i=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",t),...a})});i.displayName="CardTitle",a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,l.cn)("text-sm text-muted-foreground",t),...a})}).displayName="CardDescription";let x=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,l.cn)("p-6 pt-0",t),...a})});x.displayName="CardContent",a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,l.cn)("flex items-center p-6 pt-0",t),...a})}).displayName="CardFooter"},9283:(e,s,t)=>{Promise.resolve().then(t.bind(t,1135))},9852:(e,s,t)=>{"use strict";t.d(s,{p:()=>d});var r=t(5155),a=t(2115),l=t(3999);let d=a.forwardRef((e,s)=>{let{className:t,type:a="text",...d}=e;return(0,r.jsx)("input",{type:a,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm","shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...d})});d.displayName="Input"}},e=>{var s=s=>e(e.s=s);e.O(0,[6874,4277,8441,1684,7358],()=>s(9283)),_N_E=e.O()}]);