| 1 |
- import{i as e}from"./chunk-aKtaBQYM.js";import{C as t,O as n,S as r,T as i,a,l as o,w as s}from"./client-D5sDHQfN.js";import{n as c}from"./QueryClientProvider-RTEea2Mk.js";import{t as l}from"./useMutation-Kl2cmi_r.js";import{t as u}from"./useQueries-Ryq2rPkY.js";import{r as d,t as f}from"./info-hj_2aNUa.js";import{n as p}from"./ToastContext-DKTQgyG5.js";import{t as m}from"./loader-circle-D_tGybHN.js";import{t as h}from"./triangle-alert-B24VGTa4.js";import{t as g}from"./x-CUdw628F.js";import{o as _}from"./date-G9KUauqz.js";import{Mn as v,Mt as y,Xt as b,zt as x}from"./index-nsyp3RII.js";import{n as S,t as C}from"./useCameraViewerId-Bac-Mm1t.js";var w=t(`video-off`,[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),T=e(n(),1),E=[`s`,`m`,`l`,`xl`];function D(e){switch(e){case 1:return`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5`;case 3:return`grid-cols-1 lg:grid-cols-2`;case 4:return`grid-cols-1`;default:return`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`}}var O=s(),k=8,ee=6e4,te=200,ne=5e3,A=15e3;function re(e,t){if(t>0)return`error`;switch(e){case`RUNNING`:return`printing`;case`PAUSE`:return`paused`;case`FINISH`:case`FAILED`:return`finished`;default:return`idle`}}var ie={printing:`bg-bambu-green/85 text-black`,paused:`bg-amber-500/85 text-black`,finished:`bg-sky-500/80 text-white`,error:`bg-red-500/85 text-white`,idle:`bg-bambu-dark-tertiary/80 text-bambu-gray`};function j({printerId:e,printerName:t,cameraRotation:n=0,mode:a,snapshotIntervalMs:s,connected:c,onClick:l,statusMode:u=`off`,printerState:d=null,progress:f=null,remainingMin:p=null,layerNum:m=null,totalLayers:g=null,printName:v=null,hmsErrorCount:b=0}){let{t:x}=i(),[E,D]=(0,T.useState)(0),[j,M]=(0,T.useState)(!1),[N,P]=(0,T.useState)(!1),F=(0,T.useRef)(a),I=(0,T.useRef)(null),L=C(),R=S(I),z=(0,T.useRef)(`none`),B=(0,T.useRef)(!1),V=(0,T.useRef)(null),H=(0,T.useRef)(null);(0,T.useEffect)(()=>{let t=F.current===`live`,n=a===`live`;if(F.current=a,t&&!n){let t={},n=o();n&&(t.Authorization=`Bearer ${n}`),fetch(`/api/v1/printers/${e}/camera/stop?viewer=${L}`,{method:`POST`,keepalive:!0,headers:t}).catch(()=>{})}M(!1),B.current=!1,D(e=>e+1)},[a,e,L]),(0,T.useEffect)(()=>()=>{if(F.current===`live`){let t={},n=o();n&&(t.Authorization=`Bearer ${n}`),fetch(`/api/v1/printers/${e}/camera/stop?viewer=${L}`,{method:`POST`,keepalive:!0,headers:t}).catch(()=>{})}},[e,L]),(0,T.useEffect)(()=>{if(a!==`snapshot`)return;let e=setInterval(()=>D(e=>e+1),s);return()=>clearInterval(e)},[a,s]);let{clearFirstFrameTimer:U,streamFailed:W,reopenAfter:G}=(0,T.useMemo)(()=>{let e=()=>{H.current!==null&&clearTimeout(H.current),H.current=null},t=()=>{if(e(),z.current===`renewed`){z.current=`retried`,n(ne);return}z.current=`none`,M(!0)},n=n=>{I.current?.removeAttribute(`src`),P(!0),V.current!==null&&clearTimeout(V.current),V.current=setTimeout(()=>{V.current=null,P(!1),D(e=>e+1),e();let n=()=>{if(document.hidden){H.current=setTimeout(n,A);return}t()};H.current=setTimeout(n,A)},n)};return{clearFirstFrameTimer:e,streamFailed:t,reopenAfter:n}},[]);(0,T.useEffect)(()=>{if(z.current=`none`,a!==`live`||!c)return;let e=setInterval(()=>{document.hidden||!I.current||V.current!==null||(z.current=`renewed`,G(te))},ee);return()=>{clearInterval(e),V.current!==null&&clearTimeout(V.current),V.current=null,U(),P(!1)}},[a,c,G,U]);let K=r(`/api/v1/printers/${e}/camera/stream?fps=${k}&t=${E}&viewer=${L}`),q=r(`/api/v1/printers/${e}/camera/snapshot?t=${E}`),J=l!=null,ae=n?`rotate(${n}deg)`:void 0,Y=re(d,b),oe=c&&u!==`off`&&Y!==`idle`,se=c&&u===`full`&&(Y===`printing`||Y===`paused`),X=v??null,Z=f==null?null:Math.round(f),ce=m!=null&&g!=null&&g>0,le=p!=null&&p>0,Q=`group relative aspect-video w-full overflow-hidden rounded-lg border border-bambu-dark-tertiary bg-black text-left ${J?`focus:outline-none focus:ring-2 focus:ring-bambu-green`:`cursor-default`}`,$=(0,O.jsxs)(O.Fragment,{children:[!c||a===`paused`?(0,O.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-bambu-dark/60`,children:c?(0,O.jsx)(w,{className:`h-8 w-8 text-bambu-gray/70`,"aria-hidden":`true`}):(0,O.jsx)(y,{className:`h-8 w-8 text-bambu-gray/70`,"aria-hidden":`true`})}):j?(0,O.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-1 bg-black/80 text-bambu-gray`,children:[(0,O.jsx)(w,{className:`h-7 w-7`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`text-xs`,children:x(`printers.camWall.noSignal`)})]}):(0,O.jsx)(`img`,{ref:R,src:N?void 0:a===`live`?K:q,alt:t,draggable:!1,loading:`lazy`,className:`h-full w-full select-none object-contain`,style:{transform:ae},onLoad:()=>{U(),z.current=`none`,B.current=!1},onError:e=>{if(e.currentTarget.getAttribute(`src`)){if(a===`snapshot`&&!B.current){B.current=!0;return}W()}}},`${a}-${E}`),oe&&(0,O.jsxs)(`span`,{className:`absolute left-2 top-2 flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${ie[Y]}`,children:[b>0&&(0,O.jsx)(h,{className:`h-3 w-3`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{children:x(`printers.status.${Y}`)})]}),(0,O.jsx)(`span`,{className:`absolute right-2 top-2 rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${a===`live`?`bg-red-500/80 text-white`:a===`snapshot`?`bg-amber-500/70 text-black`:`bg-bambu-dark-tertiary/70 text-bambu-gray`}`,children:x(a===`live`?`printers.camWall.live`:a===`snapshot`?`printers.camWall.snap`:`printers.camWall.off`)}),(0,O.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/85 via-black/55 to-transparent px-2 pb-1.5 pt-3 text-white`,children:[se&&(0,O.jsxs)(`div`,{className:`mb-0.5 space-y-0.5 text-[11px] leading-tight text-white/90`,children:[X&&(0,O.jsx)(`div`,{className:`truncate`,title:X,children:X}),(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-bambu-gray`,children:[Z!=null&&(0,O.jsxs)(`span`,{className:`font-semibold text-white`,children:[Z,`%`]}),ce&&(0,O.jsx)(`span`,{children:x(`printers.camWall.layer`,{cur:m,total:g})}),le&&(0,O.jsx)(`span`,{children:x(`printers.camWall.timeLeft`,{time:_((p??0)*60)})})]})]}),(0,O.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:t})]})]});return J?(0,O.jsx)(`button`,{type:`button`,onClick:l,className:Q,title:t,children:$}):(0,O.jsx)(`div`,{className:Q,title:t,children:$})}var M=new Set([`0700_8011`,`0701_8011`,`0702_8011`,`0703_8011`,`0704_8011`,`0705_8011`,`0706_8011`,`0707_8011`,`07FF_8011`]),N=`0500050000010007`;function P(e){switch(e){case 1:return{labelKey:`hmsErrors.severityError`,color:`text-red-600 dark:text-red-400`,bgColor:`bg-red-100 dark:bg-red-500/20`,Icon:h};case 2:return{labelKey:`hmsErrors.severityWarning`,color:`text-orange-700 dark:text-orange-400`,bgColor:`bg-orange-100 dark:bg-orange-500/20`,Icon:h};case 3:return{labelKey:`hmsErrors.severityNotice`,color:`text-blue-700 dark:text-blue-400`,bgColor:`bg-blue-100 dark:bg-blue-500/20`,Icon:f};default:return{labelKey:`hmsErrors.severityUnknown`,color:`text-bambu-gray`,bgColor:`bg-bambu-dark-tertiary`,Icon:d}}}function F(e){return e.severity===1||e.severity===2}function I(e,t){let n=e>>16&65535||(e>>8&255)<<8|e&255,r=t&65535;return`${n.toString(16).padStart(4,`0`).toUpperCase()}_${r.toString(16).padStart(4,`0`).toUpperCase()}`}function L(e){if(e.full_code&&e.full_code.length===16)return e.full_code.match(/.{4}/g).join(`-`);let t=parseInt(e.code.replace(`0x`,``),16)||0;return I(e.attr,t).replace(`_`,`-`)}function R(e){if(!(e.severity>=1))return!1;if((e.actions?.length??0)>0)return!0;let t=e.full_code?.length===16&&e.severity===3;return!!e.description&&!t}function z(e){return e.filter(R)}function B(e){return e.filter(e=>!R(e))}function V(){return`https://wiki.bambulab.com/en/hms/home`}function H({printerName:e,errors:t,onClose:n,printerId:r,hasPermission:o,runoutGuidance:s}){let{t:u}=i(),{showToast:f}=p(),_=c(),y=l({mutationFn:()=>a.clearHMSErrors(r),onSuccess:()=>{f(u(`hmsErrors.clearSuccess`),`success`),n()},onError:()=>{f(u(`hmsErrors.clearFailed`),`error`)}}),b=z(t),S=B(t);(0,T.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let C=l({mutationFn:e=>a.executeHMSAction(r,{action:e.action,print_error:e.print_error,job_id:e.job_id}),onSuccess:()=>{_.invalidateQueries({queryKey:[`printerStatus`,r]}),f(u(`hmsErrors.actionSuccess`,`Action sent to printer`),`success`),n()},onError:e=>{f(`${u(`hmsErrors.actionFailed`,`Failed to send action`)}: ${e.message}`,`error`)}});return(0,O.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,children:(0,O.jsxs)(`div`,{className:`bg-bambu-dark-secondary rounded-lg shadow-xl max-w-lg w-full max-h-[80vh] flex flex-col`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b border-bambu-dark-tertiary`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(h,{className:`w-5 h-5 text-orange-600 dark:text-orange-400`}),(0,O.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:u(`hmsErrors.title`,{name:e})})]}),(0,O.jsx)(`button`,{onClick:n,className:`p-1 hover:bg-bambu-dark-tertiary rounded-lg transition-colors`,children:(0,O.jsx)(g,{className:`w-5 h-5 text-bambu-gray`})})]}),(0,O.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:b.length===0&&S.length===0?(0,O.jsxs)(`div`,{className:`text-center py-8 text-bambu-gray`,children:[(0,O.jsx)(d,{className:`w-12 h-12 mx-auto mb-3 opacity-30`}),(0,O.jsx)(`p`,{children:u(`hmsErrors.noErrors`)})]}):(0,O.jsxs)(`div`,{className:`space-y-3`,children:[b.map((e,t)=>{let{labelKey:n,color:r,bgColor:i,Icon:a}=P(e.severity),c=parseInt(e.code.replace(`0x`,``),16)||0,l=I(e.attr,c),d=e.description||u(`hmsErrors.unknownCode`),f=e.full_code===N;f&&(d=u(`hmsErrors.mqttVerifyFailedDescription`));let p=f?u(`hmsErrors.mqttVerifyFailedRemedy`):null;s&&M.has(l)&&(d=s.expectedSlotLabel&&s.ranOutSlotLabel?u(`hmsErrors.runoutExpectedSlot`,{expected:s.expectedSlotLabel,ranOut:s.ranOutSlotLabel}):s.expectedSlotLabel?u(`hmsErrors.runoutExpectedSlotOnly`,{expected:s.expectedSlotLabel}):u(`hmsErrors.runoutSlotUnknown`));let h=V(),g=L(e);return(0,O.jsx)(`div`,{className:`p-4 rounded-lg ${i} border border-white/10`,children:(0,O.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,O.jsx)(a,{className:`w-5 h-5 ${r} flex-shrink-0 mt-0.5`}),(0,O.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,O.jsxs)(`span`,{className:`font-mono text-sm ${r}`,children:[`[`,g,`]`]}),(0,O.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full ${i} ${r}`,children:u(n)})]}),(0,O.jsx)(`p`,{className:`text-sm text-bambu-gray mb-2`,children:d}),p&&(0,O.jsx)(`p`,{className:`text-sm text-bambu-gray mb-2`,children:p}),e.actions&&e.actions.length>0&&(0,O.jsx)(`div`,{className:`flex flex-wrap gap-2 my-2`,children:e.actions.map(t=>{let n=C.variables,r=C.isPending&&n?.action===t&&n?.print_error===(e.full_code||l.replace(`_`,``));return(0,O.jsxs)(`button`,{onClick:()=>{C.mutate({action:t,print_error:e.full_code||l.replace(`_`,``),job_id:e.job_id??null})},disabled:!o(`printers:control`)||C.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg bg-white/10 hover:bg-white/20 active:bg-white/30 text-white border border-white/20 hover:border-white/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0`,children:[r&&(0,O.jsx)(m,{className:`w-4 h-4 animate-spin`}),u(`hmsErrors.actions.${t}`,t)]},t)})}),(0,O.jsxs)(`a`,{href:h,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-bambu-green hover:underline`,children:[(0,O.jsx)(v,{className:`w-3 h-3`}),u(`hmsErrors.viewOnWiki`)]})]})]})},`${e.code}-${t}`)}),S.length>0&&(0,O.jsxs)(`details`,{className:`rounded-lg border border-white/10 p-3`,"data-testid":`hms-uncounted`,children:[(0,O.jsx)(`summary`,{className:`cursor-pointer text-sm text-bambu-gray`,children:u(`hmsErrors.uncountedSummary`,{n:S.length})}),(0,O.jsx)(`p`,{className:`mt-2 text-xs text-bambu-gray`,children:u(`hmsErrors.uncountedHint`)}),(0,O.jsx)(`ul`,{className:`mt-2 space-y-2`,children:S.map((e,t)=>(0,O.jsxs)(`li`,{className:`text-xs`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:`font-mono text-bambu-gray`,children:[`[`,L(e),`]`]}),(0,O.jsx)(`span`,{className:`text-bambu-gray`,children:u(P(e.severity).labelKey)})]}),e.description&&(0,O.jsx)(`p`,{className:`mt-0.5 text-bambu-gray`,children:e.description})]},`${e.full_code||e.code}-${t}`))})]})]})}),(0,O.jsxs)(`div`,{className:`p-4 border-t border-bambu-dark-tertiary flex items-center justify-between gap-3`,children:[(0,O.jsx)(`p`,{className:`text-xs text-bambu-gray`,children:u(`hmsErrors.clearInstructions`)}),t.length>0&&(0,O.jsxs)(`button`,{onClick:()=>y.mutate(),disabled:!o(`printers:control`)||y.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-500/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0`,children:[y.isPending?(0,O.jsx)(m,{className:`w-4 h-4 animate-spin`}):(0,O.jsx)(x,{className:`w-4 h-4`}),u(`hmsErrors.clearErrors`)]})]})]})})}var U=1,W=16,G=2,K=60,q=[`off`,`compact`,`full`];function J({printers:e,maxLive:t,snapshotIntervalSec:n,statusMode:r,onTileClick:o,onChangeMaxLive:s,onChangeSnapshotIntervalSec:c,onChangeStatusMode:l,statuses:d,showSettings:f=!0,tileSize:p=2}){let{t:m}=i(),h=(0,T.useRef)(new Map),g=d?[]:e,_=u({queries:g.map(e=>({queryKey:[`printerStatus`,e.id],queryFn:()=>a.getPrinterStatus(e.id),staleTime:5e3}))}),v=(0,T.useMemo)(()=>{let e=new Map;return g.forEach((t,n)=>{e.set(t.id,_[n]?.data)}),e},[e,_,d]),y=d??v,[x,S]=(0,T.useState)(()=>new Set),[C,w]=(0,T.useState)(!1),E=(0,T.useRef)(null);(0,T.useEffect)(()=>{if(!C)return;let e=e=>{E.current&&!E.current.contains(e.target)&&w(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[C]),(0,T.useEffect)(()=>{let e=new IntersectionObserver(e=>{S(t=>{let n=new Set(t);for(let t of e){let e=Number(t.target.dataset.printerId);Number.isFinite(e)&&(t.isIntersecting?n.add(e):n.delete(e))}return n})},{threshold:.4});for(let[,t]of h.current)t&&e.observe(t);return()=>e.disconnect()},[e]);let k=(0,T.useMemo)(()=>{let n=new Map,r=Math.max(0,t);for(let t of e){let e=y.get(t.id)?.connected??!1;if(!x.has(t.id)||!e){n.set(t.id,`paused`);continue}r>0?(n.set(t.id,`live`),--r):n.set(t.id,`snapshot`)}return n},[e,x,t,y]);return e.length===0?(0,O.jsx)(`div`,{className:`rounded-lg border border-bambu-dark-tertiary bg-bambu-dark p-6 text-center text-bambu-gray`,children:m(`printers.camWall.noPrinters`)}):(0,O.jsxs)(`div`,{className:`space-y-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-bambu-gray`,children:[(0,O.jsx)(`span`,{children:m(`printers.camWall.summary`,{live:Array.from(k.values()).filter(e=>e===`live`).length,snap:Array.from(k.values()).filter(e=>e===`snapshot`).length,total:e.length})}),f&&(0,O.jsxs)(`div`,{className:`relative`,ref:E,children:[(0,O.jsxs)(`button`,{type:`button`,onClick:()=>w(e=>!e),className:`flex h-7 items-center gap-1 rounded-md border border-bambu-dark-tertiary bg-bambu-dark px-2 text-white hover:bg-bambu-dark-tertiary`,title:m(`printers.camWall.settings.title`),children:[(0,O.jsx)(b,{className:`h-3.5 w-3.5`}),(0,O.jsx)(`span`,{children:m(`printers.camWall.settings.title`)})]}),C&&(0,O.jsxs)(`div`,{className:`absolute right-0 top-9 z-30 w-72 space-y-3 rounded-lg border border-bambu-dark-tertiary bg-bambu-dark-secondary p-3 shadow-xl`,children:[(0,O.jsxs)(`label`,{className:`block space-y-1`,children:[(0,O.jsx)(`span`,{className:`text-xs font-medium text-white`,children:m(`printers.camWall.settings.maxLive`)}),(0,O.jsx)(`input`,{type:`number`,min:U,max:W,value:t,onChange:e=>{s(Math.min(W,Math.max(U,Number(e.target.value)||U)))},className:`w-full rounded-md border border-bambu-dark-tertiary bg-bambu-dark px-2 py-1 text-sm text-white`}),(0,O.jsx)(`span`,{className:`block text-[11px] text-bambu-gray`,children:m(`printers.camWall.settings.maxLiveHint`)})]}),(0,O.jsxs)(`label`,{className:`block space-y-1`,children:[(0,O.jsx)(`span`,{className:`text-xs font-medium text-white`,children:m(`printers.camWall.settings.snapshotInterval`)}),(0,O.jsx)(`input`,{type:`number`,min:G,max:K,value:n,onChange:e=>{c(Math.min(K,Math.max(G,Number(e.target.value)||G)))},className:`w-full rounded-md border border-bambu-dark-tertiary bg-bambu-dark px-2 py-1 text-sm text-white`}),(0,O.jsx)(`span`,{className:`block text-[11px] text-bambu-gray`,children:m(`printers.camWall.settings.snapshotIntervalHint`)})]}),(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(`span`,{className:`block text-xs font-medium text-white`,children:m(`printers.camWall.settings.statusOverlay`)}),(0,O.jsx)(`div`,{role:`radiogroup`,"aria-label":m(`printers.camWall.settings.statusOverlay`),className:`flex overflow-hidden rounded-md border border-bambu-dark-tertiary`,children:q.map(e=>(0,O.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r===e,onClick:()=>l(e),className:`flex-1 px-2 py-1 text-xs ${r===e?`bg-bambu-green text-black font-semibold`:`bg-bambu-dark text-white hover:bg-bambu-dark-tertiary`}`,children:m(`printers.camWall.statusMode.${e}`)},e))}),(0,O.jsx)(`span`,{className:`block text-[11px] text-bambu-gray`,children:m(`printers.camWall.settings.statusOverlayHint`)})]})]})]})]}),(0,O.jsx)(`div`,{className:`grid gap-3 ${D(p)}`,"data-testid":`camwall-grid`,children:e.map(e=>{let t=k.get(e.id)??`paused`;return(0,O.jsx)(`div`,{ref:t=>{h.current.set(e.id,t)},"data-printer-id":e.id,children:(0,O.jsx)(j,{printerId:e.id,printerName:e.name,cameraRotation:e.camera_rotation,mode:t,snapshotIntervalMs:n*1e3,connected:y.get(e.id)?.connected??!1,statusMode:r,printerState:y.get(e.id)?.state??null,progress:y.get(e.id)?.progress??null,remainingMin:y.get(e.id)?.remaining_time??null,layerNum:y.get(e.id)?.layer_num??null,totalLayers:y.get(e.id)?.total_layers??null,printName:y.get(e.id)?.subtask_name??y.get(e.id)?.gcode_file??null,hmsErrorCount:z(y.get(e.id)?.hms_errors??[]).length,onClick:o?()=>o(e.id,e.name):void 0})},e.id)})})]})}export{E as a,F as i,H as n,z as r,J as t};
|