From a0abeba3941fa5eb941c6b39c2237c68aaf9c44a Mon Sep 17 00:00:00 2001 From: maziggy Date: Tue, 17 Feb 2026 12:14:47 +0100 Subject: [PATCH] fix(queue): persist clear plate state across page refresh (#410) After clicking "Clear Plate & Start Next", refreshing the page showed the button again because the frontend determined the state purely from the printer's FINISH/FAILED status. The backend already tracked a plate_cleared flag in memory but never exposed it to the frontend. - Add plate_cleared field to PrinterStatus schema and API response - Pass plateCleared prop to PrinterQueueWidget - Skip clear plate UI when plate is already acknowledged - Add 2 tests for plateCleared=true behavior --- CHANGELOG.md | 1 + backend/app/api/routes/printers.py | 1 + backend/app/schemas/printer.py | 2 ++ .../PrinterQueueWidgetClearPlate.test.tsx | 22 +++++++++++++++++++ frontend/src/api/client.ts | 2 ++ .../src/components/PrinterQueueWidget.tsx | 5 +++-- frontend/src/pages/PrintersPage.tsx | 2 +- .../{index-NiP_88T6.js => index-D8lA4NE5.js} | 4 ++-- static/index.html | 2 +- 9 files changed, 35 insertions(+), 6 deletions(-) rename static/assets/{index-NiP_88T6.js => index-D8lA4NE5.js} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfb200e65..982ad016a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ All notable changes to Bambuddy will be documented in this file. ### New Features - **External Links: Open in New Tab** ([#338](https://github.com/maziggy/bambuddy/issues/338)) — External sidebar links can now optionally open in a new browser tab instead of an iframe. Sites behind reverse proxies (Traefik, nginx) that send `X-Frame-Options: SAMEORIGIN` or CSP `frame-ancestors` headers block iframe embedding, causing "refused to connect" errors. A new "Open in new tab" toggle in the add/edit link modal lets users choose per-link. Keyboard shortcuts (number keys) also respect the setting. Defaults to iframe (existing behavior) for backward compatibility. - **Print Queue: Clear Plate Confirmation** — When a print finishes or fails and more items are queued, the printer card now shows a "Clear Plate & Start Next" button. The scheduler no longer auto-starts the next print while the printer is in FINISH or FAILED state — the user must confirm the build plate has been cleared first. This prevents prints from starting on a dirty plate. The button respects the `printers:control` permission and is available in all supported languages (en/de/ja). +- **Clear Plate State Persists Across Page Refresh** ([#410](https://github.com/maziggy/bambuddy/issues/410)) — After clicking "Clear Plate & Start Next", refreshing the page showed the Clear Plate button again because the frontend determined the state purely from the printer's FINISH/FAILED status. The `plate_cleared` flag is now included in the printer status API response, so the widget correctly shows the passive queue link instead of the Clear Plate button after acknowledgment — even after a page refresh. ### Improved - **Skip Objects: Confirmation Dialog** ([#346](https://github.com/maziggy/bambuddy/issues/346)) — Added a warning confirmation modal before skipping an object during a print. Shows the object name and warns the action is irreversible. Prevents accidentally skipping the wrong object. Translated in all 4 locales (en, de, ja, it). diff --git a/backend/app/api/routes/printers.py b/backend/app/api/routes/printers.py index f245093d3..82aba3382 100644 --- a/backend/app/api/routes/printers.py +++ b/backend/app/api/routes/printers.py @@ -466,6 +466,7 @@ async def get_printer_status( big_fan2_speed=state.big_fan2_speed, heatbreak_fan_speed=state.heatbreak_fan_speed, firmware_version=state.firmware_version, + plate_cleared=printer_manager.is_plate_cleared(printer_id), ) diff --git a/backend/app/schemas/printer.py b/backend/app/schemas/printer.py index 34e4cedc4..8d843855f 100644 --- a/backend/app/schemas/printer.py +++ b/backend/app/schemas/printer.py @@ -245,3 +245,5 @@ class PrinterStatus(BaseModel): heatbreak_fan_speed: int | None = None # Hotend heatbreak fan # Firmware version (from info.module[name="ota"].sw_ver) firmware_version: str | None = None + # Queue: user has acknowledged plate is cleared for next queued print + plate_cleared: bool = False diff --git a/frontend/src/__tests__/components/PrinterQueueWidgetClearPlate.test.tsx b/frontend/src/__tests__/components/PrinterQueueWidgetClearPlate.test.tsx index 7f41f845b..92f1794c9 100644 --- a/frontend/src/__tests__/components/PrinterQueueWidgetClearPlate.test.tsx +++ b/frontend/src/__tests__/components/PrinterQueueWidgetClearPlate.test.tsx @@ -101,6 +101,28 @@ describe('PrinterQueueWidget - Clear Plate', () => { expect(link).toHaveAttribute('href', '/queue'); }); }); + + it('shows passive link when FINISH but plateCleared is true', async () => { + render(); + + await waitFor(() => { + const link = screen.getByRole('link'); + expect(link).toHaveAttribute('href', '/queue'); + }); + + expect(screen.queryByText('Clear Plate & Start Next')).not.toBeInTheDocument(); + }); + + it('shows passive link when FAILED but plateCleared is true', async () => { + render(); + + await waitFor(() => { + const link = screen.getByRole('link'); + expect(link).toHaveAttribute('href', '/queue'); + }); + + expect(screen.queryByText('Clear Plate & Start Next')).not.toBeInTheDocument(); + }); }); describe('clear plate button shows queue info', () => { diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index a8744f1d9..5b6c2ed6d 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -250,6 +250,8 @@ export interface PrinterStatus { big_fan2_speed: number | null; // Chamber/exhaust fan heatbreak_fan_speed: number | null; // Hotend heatbreak fan firmware_version: string | null; // Firmware version from MQTT + // Queue: user has acknowledged plate is cleared for next queued print + plate_cleared: boolean; } export interface PrinterCreate { diff --git a/frontend/src/components/PrinterQueueWidget.tsx b/frontend/src/components/PrinterQueueWidget.tsx index 998d9b4d3..6a7ec152a 100644 --- a/frontend/src/components/PrinterQueueWidget.tsx +++ b/frontend/src/components/PrinterQueueWidget.tsx @@ -10,6 +10,7 @@ import { parseUTCDate } from '../utils/date'; interface PrinterQueueWidgetProps { printerId: number; printerState?: string | null; + plateCleared?: boolean; } function formatRelativeTime(dateString: string | null): string { @@ -26,7 +27,7 @@ function formatRelativeTime(dateString: string | null): string { return date.toLocaleDateString(); } -export function PrinterQueueWidget({ printerId, printerState }: PrinterQueueWidgetProps) { +export function PrinterQueueWidget({ printerId, printerState, plateCleared }: PrinterQueueWidgetProps) { const { t } = useTranslation(); const queryClient = useQueryClient(); const { showToast } = useToast(); @@ -56,7 +57,7 @@ export function PrinterQueueWidget({ printerId, printerState }: PrinterQueueWidg return null; } - const needsClearPlate = printerState === 'FINISH' || printerState === 'FAILED'; + const needsClearPlate = (printerState === 'FINISH' || printerState === 'FAILED') && !plateCleared; if (needsClearPlate) { return ( diff --git a/frontend/src/pages/PrintersPage.tsx b/frontend/src/pages/PrintersPage.tsx index d1f7cdd63..fc0f705ac 100644 --- a/frontend/src/pages/PrintersPage.tsx +++ b/frontend/src/pages/PrintersPage.tsx @@ -2471,7 +2471,7 @@ function PrinterCard({ {/* Queue Widget - always visible when there are pending items */} - + )} diff --git a/static/assets/index-NiP_88T6.js b/static/assets/index-D8lA4NE5.js similarity index 99% rename from static/assets/index-NiP_88T6.js rename to static/assets/index-D8lA4NE5.js index b25dc70a8..d685dbc9c 100644 --- a/static/assets/index-NiP_88T6.js +++ b/static/assets/index-D8lA4NE5.js @@ -8416,7 +8416,7 @@ void main() { `,children:[a.jsxs("div",{className:` w-12 h-12 flex-shrink-0 rounded-lg flex flex-col items-center justify-center ${x.skipped?"bg-red-100 dark:bg-red-500/20 border border-red-300 dark:border-red-500/40":"bg-green-100 dark:bg-bambu-green/20 border border-green-300 dark:border-bambu-green/40"} - `,children:[a.jsx("span",{className:`text-lg font-mono font-bold ${x.skipped?"text-red-500 dark:text-red-400":"text-green-600 dark:text-bambu-green"}`,children:x.id}),a.jsx("span",{className:`text-[8px] uppercase tracking-wider ${x.skipped?"text-red-400/60":"text-green-500/60 dark:text-bambu-green/60"}`,children:"ID"})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:`block text-sm truncate ${x.skipped?"text-red-500 dark:text-red-400 line-through":"text-gray-900 dark:text-white"}`,children:x.name}),x.skipped&&a.jsx("span",{className:"text-[10px] text-red-400/60",children:r("printers.willBeSkipped")})]}),x.skipped?a.jsx("span",{className:"px-4 py-2 text-xs text-red-500 dark:text-red-400/70 bg-red-100 dark:bg-red-500/10 rounded-lg",children:r("printers.skipObjects.skipped")}):a.jsx("button",{onClick:()=>l({id:x.id,name:x.name}),disabled:p.isPending||(d?.layer_num??0)<=1||!s("printers:control"),className:`px-4 py-2 text-xs font-medium rounded-lg transition-colors ${(d?.layer_num??0)<=1||!s("printers:control")?"bg-gray-100 dark:bg-bambu-dark text-gray-400 dark:text-bambu-gray/50 cursor-not-allowed":"bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-500/30 border border-red-300 dark:border-red-500/30"}`,title:s("printers:control")?(d?.layer_num??0)<=1?r("printers.skipObjects.waitForLayer",{layer:d?.layer_num??0}):r("printers.skipObjects.skip"):r("printers.permission.noControl"),children:r("printers.skipObjects.skip")})]},x.id))})]})]}):a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx(it,{className:"w-5 h-5 animate-spin text-bambu-gray"})})]})]}),o&&a.jsx(vn,{variant:"warning",title:r("printers.skipObjects.confirmTitle"),message:r("printers.skipObjects.confirmMessage",{name:o.name}),confirmText:r("printers.skipObjects.skip"),isLoading:p.isPending,onConfirm:()=>p.mutate([o.id]),onCancel:()=>l(null)}),c&&h&&a.jsxs("div",{className:"fixed inset-0 bg-black/90 flex items-center justify-center z-60",onClick:()=>u(!1),children:[a.jsx("button",{onClick:()=>u(!1),className:"absolute top-4 right-4 p-2 text-white/70 hover:text-white transition-colors",children:a.jsx(Ft,{className:"w-6 h-6"})}),a.jsxs("div",{className:"relative max-w-[600px] max-h-[80vh] aspect-square",onClick:x=>x.stopPropagation(),children:[d?.cover_url?a.jsx("img",{src:`${d.cover_url}?view=top`,alt:r("printers.printPreview"),className:"w-full h-full object-contain rounded-lg bg-gray-900"}):a.jsx("div",{className:"w-full h-full rounded-lg bg-gray-800 flex items-center justify-center",children:a.jsx(ea,{className:"w-16 h-16 text-gray-500"})}),h.objects.length>0&&a.jsx("div",{className:"absolute inset-0 pointer-events-none",children:h.objects.map((x,v)=>{let b,y;if(x.x!=null&&x.y!=null&&h.bbox_all){const[S,N,A,C]=h.bbox_all,T=A-S,k=C-N,j=8,E=100-j*2;b=j+(x.x-S)/T*E,y=j+(C-x.y)/k*E,b=Math.max(5,Math.min(95,b)),y=Math.max(5,Math.min(95,y))}else if(x.x!=null&&x.y!=null)b=x.x/256*100,y=100-x.y/256*100,b=Math.max(5,Math.min(95,b)),y=Math.max(5,Math.min(95,y));else{const S=Math.ceil(Math.sqrt(h.objects.length)),N=Math.floor(v/S),A=v%S,C=Math.ceil(h.objects.length/S);b=15+A*(70/S)+35/S,y=15+N*(70/C)+35/C}return a.jsx("div",{className:`absolute flex items-center justify-center w-6 h-6 rounded-full text-[10px] font-bold shadow-lg ${x.skipped?"bg-red-500 text-white line-through":"bg-bambu-green text-black"}`,style:{left:`${b}%`,top:`${y}%`,transform:"translate(-50%, -50%)"},title:x.name,children:x.id},x.id)})}),a.jsx("div",{className:"absolute bottom-2 right-2 px-2 py-1 bg-white/90 dark:bg-black/80 rounded text-[10px] text-gray-700 dark:text-white shadow-sm",children:r("printers.skipObjects.activeCount",{count:h.objects.filter(x=>!x.skipped).length})})]})]})]}):null}const rAe="embeddedCameraState_",JH=5,iAe=2e3,aAe=3e4,sAe=5e3,w2={x:window.innerWidth-420,y:20,width:400,height:300};function oAe({printerId:t,printerName:e,viewerIndex:n=0,onClose:r}){const{t:i}=Vt(),s=tn(),{showToast:o}=hn(),{hasPermission:l}=Ir(),c=`${rAe}${t}`,u=()=>{try{const Re=localStorage.getItem(c);if(Re){const qe=JSON.parse(Re);return{x:Math.min(Math.max(0,qe.x),window.innerWidth-100),y:Math.min(Math.max(0,qe.y),window.innerHeight-100),width:Math.max(200,Math.min(qe.width,window.innerWidth-20)),height:Math.max(150,Math.min(qe.height,window.innerHeight-20))}}}catch{}const De=n*30;return{...w2,x:Math.max(0,w2.x-De),y:Math.max(0,w2.y+De)}},[d,h]=w.useState(u),[f,p]=w.useState(!1),[x,v]=w.useState(!1),[b,y]=w.useState({x:0,y:0}),[S,N]=w.useState(!1),[A,C]=w.useState(!1),[T,k]=w.useState(1),[j,E]=w.useState({x:0,y:0}),[P,U]=w.useState(!1),[O,B]=w.useState({x:0,y:0}),[R,G]=w.useState(null),[q,z]=w.useState(null),[K,Y]=w.useState(!1),[oe,$]=w.useState(!0),[X,ee]=w.useState(Date.now()),[J,_e]=w.useState(0),[pe,me]=w.useState(!1),[je,de]=w.useState(0),ce=w.useRef(null),Se=w.useRef(null),ie=w.useRef(null),Fe=w.useRef(null),V=w.useRef(null),[W,ue]=w.useState(!1),{data:Q}=Ze({queryKey:["printer",t],queryFn:()=>re.getPrinter(t),enabled:t>0}),{data:se}=Ze({queryKey:["printerStatus",t],queryFn:()=>re.getPrinterStatus(t),refetchInterval:3e4,enabled:t>0}),Z=ot({mutationFn:De=>re.setChamberLight(t,De),onMutate:async De=>{await s.cancelQueries({queryKey:["printerStatus",t]});const Re=s.getQueryData(["printerStatus",t]);return s.setQueryData(["printerStatus",t],qe=>({...qe,chamber_light:De})),{previousStatus:Re}},onSuccess:(De,Re)=>{o(`Chamber light ${Re?"on":"off"}`)},onError:(De,Re,qe)=>{qe?.previousStatus&&s.setQueryData(["printerStatus",t],qe.previousStatus),o(De.message||i("printers.toast.failedToControlChamberLight"),"error")}}),Ne=(se?.state==="RUNNING"||se?.state==="PAUSE"||se?.state==="PAUSED")&&(se?.printable_objects_count??0)>=2;w.useEffect(()=>{const De=setTimeout(()=>{localStorage.setItem(c,JSON.stringify(d))},500);return()=>clearTimeout(De)},[d,c]);const ve=w.useRef(!1);w.useEffect(()=>{ve.current=!1;const De=`/api/v1/printers/${t}/camera/stop`,Re=()=>{if(t>0&&!ve.current){ve.current=!0;const pt={},At=id();At&&(pt.Authorization=`Bearer ${At}`),fetch(De,{method:"POST",keepalive:!0,headers:pt}).catch(()=>{})}},qe=Se.current;return()=>{qe&&(qe.src=""),Re(),ie.current&&clearTimeout(ie.current),Fe.current&&clearInterval(Fe.current),V.current&&clearInterval(V.current)}},[t]),w.useEffect(()=>{if(oe){const De=setTimeout(()=>$(!1),3e3);return()=>clearTimeout(De)}},[oe,X]);const fe=w.useCallback(()=>{if(J>=JH){me(!1),Y(!0);return}const De=Math.min(iAe*Math.pow(2,J),aAe);me(!0),de(Math.ceil(De/1e3)),Fe.current=setInterval(()=>{de(Re=>Re<=1?(Fe.current&&clearInterval(Fe.current),0):Re-1)},1e3),ie.current=setTimeout(()=>{_e(Re=>Re+1),me(!1),$(!0),Y(!1),Se.current&&(Se.current.src=""),ee(Date.now())},De)},[J]);w.useEffect(()=>{if(oe||pe||S){V.current&&(clearInterval(V.current),V.current=null);return}return V.current=setInterval(async()=>{try{const De=await re.getCameraStatus(t);(De.stalled||!De.active&&!K)&&(V.current&&(clearInterval(V.current),V.current=null),$(!1),fe())}catch{}},sAe),()=>{V.current&&(clearInterval(V.current),V.current=null)}},[oe,K,pe,S,t,fe]),w.useEffect(()=>{const De=()=>{const Re=!!document.fullscreenElement;C(Re),Re||(k(1),E({x:0,y:0}))};return document.addEventListener("fullscreenchange",De),()=>document.removeEventListener("fullscreenchange",De)},[]);const L=()=>{ce.current&&(document.fullscreenElement?document.exitFullscreen():ce.current.requestFullscreen())},D=()=>{k(De=>Math.min(De+.5,4))},H=()=>{k(De=>{const Re=Math.max(De-.5,1);return Re===1&&E({x:0,y:0}),Re})},he=De=>{De.preventDefault(),De.deltaY<0?D():H()},xe=De=>{T>1&&(De.preventDefault(),U(!0),B({x:De.clientX-j.x,y:De.clientY-j.y}))},be=w.useCallback(()=>{if(!ce.current||!Se.current)return{x:200,y:150};const De=ce.current.getBoundingClientRect(),Re=De.width*(T-1)/2,qe=De.height*(T-1)/2;return{x:Math.max(50,Re),y:Math.max(50,qe)}},[T]),Ue=De=>{if(P&&T>1){const Re=De.clientX-O.x,qe=De.clientY-O.y,pt=be();E({x:Math.max(-pt.x,Math.min(pt.x,Re)),y:Math.max(-pt.y,Math.min(pt.y,qe))})}},Oe=()=>{U(!1)},Qe=De=>{if(De.length<2)return 0;const Re=De[0].clientX-De[1].clientX,qe=De[0].clientY-De[1].clientY;return Math.sqrt(Re*Re+qe*qe)},rt=De=>De.length<2?{x:De[0].clientX,y:De[0].clientY}:{x:(De[0].clientX+De[1].clientX)/2,y:(De[0].clientY+De[1].clientY)/2},we=De=>{De.touches.length===2?(De.preventDefault(),G(Qe(De.touches)),z(rt(De.touches))):De.touches.length===1&&T>1&&(De.preventDefault(),U(!0),B({x:De.touches[0].clientX-j.x,y:De.touches[0].clientY-j.y}))},ye=De=>{if(De.touches.length===2&&R!==null){De.preventDefault();const Re=Qe(De.touches),qe=Re/R;k(At=>{const Rt=Math.max(1,Math.min(4,At*qe));return Rt===1&&E({x:0,y:0}),Rt}),G(Re);const pt=rt(De.touches);if(q){const At=be();E(Rt=>({x:Math.max(-At.x,Math.min(At.x,Rt.x+(pt.x-q.x))),y:Math.max(-At.y,Math.min(At.y,Rt.y+(pt.y-q.y)))}))}z(pt)}else if(De.touches.length===1&&P&&T>1){De.preventDefault();const Re=De.touches[0].clientX-O.x,qe=De.touches[0].clientY-O.y,pt=be();E({x:Math.max(-pt.x,Math.min(pt.x,Re)),y:Math.max(-pt.y,Math.min(pt.y,qe))})}},le=De=>{De.touches.length<2&&(G(null),z(null)),De.touches.length===0&&U(!1)},Le=()=>{k(1),E({x:0,y:0})},Me=()=>{$(!1),J{$(!1),Y(!1),_e(0),me(!1),ie.current&&clearTimeout(ie.current),Fe.current&&clearInterval(Fe.current)},Ae=()=>{$(!0),Y(!1),_e(0),me(!1),ie.current&&clearTimeout(ie.current),Fe.current&&clearInterval(Fe.current);const De={},Re=id();Re&&(De.Authorization=`Bearer ${Re}`),fetch(`/api/v1/printers/${t}/camera/stop`,{method:"POST",headers:De}).catch(()=>{}),Se.current&&(Se.current.src=""),setTimeout(()=>ee(Date.now()),100)},Je=De=>{De.target.closest(".no-drag")||(p(!0),y({x:De.clientX-d.x,y:De.clientY-d.y}))},Pe=De=>{De.stopPropagation(),v(!0)};w.useEffect(()=>{const De=qe=>{if(f)h(pt=>({...pt,x:Math.max(0,Math.min(qe.clientX-b.x,window.innerWidth-pt.width)),y:Math.max(0,Math.min(qe.clientY-b.y,window.innerHeight-pt.height))}));else if(x&&ce.current){const pt=ce.current.getBoundingClientRect();h(At=>({...At,width:Math.max(200,Math.min(qe.clientX-pt.left,window.innerWidth-At.x-10)),height:Math.max(150,Math.min(qe.clientY-pt.top,window.innerHeight-At.y-10))}))}},Re=()=>{p(!1),v(!1)};if(f||x)return document.addEventListener("mousemove",De),document.addEventListener("mouseup",Re),()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",Re)}},[f,x,b]);const Xe=`/api/v1/printers/${t}/camera/stream?fps=15&t=${X}`;return a.jsxs("div",{ref:ce,className:`${A?"fixed inset-0 z-[100]":"fixed z-50 rounded-lg shadow-2xl border border-bambu-dark-tertiary"} bg-bambu-dark-secondary overflow-hidden`,style:A?void 0:{left:d.x,top:d.y,width:S?200:d.width,height:S?40:d.height,cursor:f?"grabbing":"default"},children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-bambu-dark border-b border-bambu-dark-tertiary cursor-grab active:cursor-grabbing",onMouseDown:Je,children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-white truncate",children:[a.jsx(Dh,{className:"w-4 h-4 text-bambu-gray flex-shrink-0"}),a.jsx("span",{className:"truncate",children:Q?.name||e})]}),a.jsxs("div",{className:"flex items-center gap-1 no-drag",children:[a.jsx("button",{onClick:()=>Z.mutate(!se?.chamber_light),disabled:!se?.connected||Z.isPending||!l("printers:control"),className:`p-1 rounded disabled:opacity-50 ${se?.chamber_light?"bg-yellow-500/20 hover:bg-yellow-500/30":"hover:bg-bambu-dark-tertiary"}`,title:l("printers:control")?i("camera.chamberLight"):i("printers.permission.noControl"),children:a.jsx(xL,{on:se?.chamber_light??!1,className:"w-3.5 h-3.5"})}),a.jsx("button",{onClick:()=>ue(!0),disabled:!Ne||!l("printers:control"),className:`p-1 rounded disabled:opacity-50 ${Ne&&l("printers:control")?"hover:bg-bambu-dark-tertiary":""}`,title:l("printers:control")?i(Ne?"printers.skipObjects.tooltip":"printers.skipObjects.onlyWhilePrinting"):i("printers.permission.noControl"),children:a.jsx(SC,{className:"w-3.5 h-3.5 text-bambu-gray"})}),a.jsx("button",{onClick:Ae,disabled:oe||pe,className:"p-1 hover:bg-bambu-dark-tertiary rounded disabled:opacity-50",title:"Refresh stream",children:a.jsx(kr,{className:`w-3.5 h-3.5 text-bambu-gray ${oe?"animate-spin":""}`})}),a.jsx("button",{onClick:L,className:"p-1 hover:bg-bambu-dark-tertiary rounded",title:A?"Exit fullscreen":"Fullscreen",children:A?a.jsx(gX,{className:"w-3.5 h-3.5 text-bambu-gray"}):a.jsx(ame,{className:"w-3.5 h-3.5 text-bambu-gray"})}),a.jsx("button",{onClick:()=>N(!S),className:"p-1 hover:bg-bambu-dark-tertiary rounded",title:S?"Expand":"Minimize",children:S?a.jsx(iC,{className:"w-3.5 h-3.5 text-bambu-gray"}):a.jsx(LF,{className:"w-3.5 h-3.5 text-bambu-gray"})}),a.jsx("button",{onClick:r,className:"p-1 hover:bg-red-500/20 rounded",title:"Close",children:a.jsx(Ft,{className:"w-3.5 h-3.5 text-bambu-gray hover:text-red-400"})})]})]}),!S&&a.jsxs("div",{className:"relative w-full bg-black flex items-center justify-center overflow-hidden h-[calc(100%-40px)]",onWheel:he,onMouseMove:Ue,onMouseUp:Oe,onMouseLeave:Oe,onTouchStart:we,onTouchMove:ye,onTouchEnd:le,style:{touchAction:"none"},children:[oe&&!pe&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 z-10",children:a.jsx(kr,{className:"w-6 h-6 text-bambu-gray animate-spin"})}),pe&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80 z-10",children:a.jsxs("div",{className:"text-center p-2",children:[a.jsx(Rf,{className:"w-6 h-6 text-orange-400 mx-auto mb-2"}),a.jsxs("p",{className:"text-xs text-bambu-gray",children:["Reconnecting in ",je,"s..."]})]})}),K&&!pe&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black z-10",children:a.jsxs("div",{className:"text-center p-2",children:[a.jsx(Cn,{className:"w-6 h-6 text-orange-400 mx-auto mb-2"}),a.jsx("p",{className:"text-xs text-bambu-gray mb-2",children:"Camera unavailable"}),a.jsx("button",{onClick:Ae,className:"px-2 py-1 text-xs bg-bambu-green text-white rounded hover:bg-bambu-green/80",children:"Retry"})]})}),a.jsx("img",{ref:Se,src:Xe,alt:"Camera stream",className:"max-w-full max-h-full object-contain select-none",style:{transform:`scale(${T}) translate(${j.x/T}px, ${j.y/T}px)`,cursor:T>1?P?"grabbing":"grab":"default"},onError:Me,onLoad:$e,onMouseDown:xe,draggable:!1},X),a.jsxs("div",{className:"absolute bottom-2 left-2 flex items-center gap-1 bg-black/60 rounded px-1.5 py-1 no-drag",children:[a.jsx("button",{onClick:H,disabled:T<=1,className:"p-1 hover:bg-white/10 rounded disabled:opacity-30",title:"Zoom out",children:a.jsx(HF,{className:"w-3.5 h-3.5 text-white"})}),a.jsxs("button",{onClick:Le,className:"px-1.5 py-0.5 text-xs text-white hover:bg-white/10 rounded min-w-[32px]",title:"Reset zoom",children:[Math.round(T*100),"%"]}),a.jsx("button",{onClick:D,disabled:T>=4,className:"p-1 hover:bg-white/10 rounded disabled:opacity-30",title:"Zoom in",children:a.jsx(BF,{className:"w-3.5 h-3.5 text-white"})})]}),!A&&a.jsx("div",{className:"absolute bottom-0 right-0 w-6 h-6 cursor-se-resize no-drag hover:bg-white/10 rounded-tl transition-colors",onMouseDown:Pe,title:"Drag to resize",children:a.jsx("svg",{className:"w-6 h-6 text-bambu-gray/70 hover:text-bambu-gray",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M22 22H20V20H22V22ZM22 18H20V16H22V18ZM18 22H16V20H18V22ZM22 14H20V12H22V14ZM18 18H16V16H18V18ZM14 22H12V20H14V22ZM22 10H20V8H22V10ZM18 14H16V12H18V14ZM14 18H12V16H14V18ZM10 22H8V20H10V22Z"})})})]}),a.jsx(yL,{printerId:t,isOpen:W,onClose:()=>ue(!1)})]})}function lAe({printerId:t,printerName:e,onClose:n}){const{t:r}=Vt(),i=tn(),[s,o]=w.useState(!0),[l,c]=w.useState(new Set),[u,d]=w.useState(""),[h,f]=w.useState("all"),p=w.useRef(null),{data:x,isLoading:v,refetch:b}=Ze({queryKey:["mqtt-logs",t],queryFn:()=>re.getMQTTLogs(t),refetchInterval:1e3}),y=ot({mutationFn:()=>re.enableMQTTLogging(t),onSuccess:()=>{i.invalidateQueries({queryKey:["mqtt-logs",t]})}}),S=ot({mutationFn:()=>re.disableMQTTLogging(t),onSuccess:()=>{i.invalidateQueries({queryKey:["mqtt-logs",t]})}}),N=ot({mutationFn:()=>re.clearMQTTLogs(t),onSuccess:()=>{i.invalidateQueries({queryKey:["mqtt-logs",t]})}});w.useEffect(()=>{const P=U=>{U.key==="Escape"&&n()};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[n]),w.useEffect(()=>{s&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[x?.logs,s]);const A=P=>{c(U=>{const O=new Set(U);return O.has(P)?O.delete(P):O.add(P),O})},C=P=>new Date(P).toLocaleTimeString("en-US",{hour12:!1,fractionalSecondDigits:3}),T=(P,U)=>{if(P==null)return"";const O=typeof P=="string"?JSON.parse(P):P,B=JSON.stringify(O,null,U?2:0);return!U&&B.length>100?B.substring(0,100)+"...":B},k=x?.logging_enabled??!1,j=w.useMemo(()=>x?.logs??[],[x?.logs]),E=w.useMemo(()=>j.filter(P=>{if(h!=="all"&&P.direction!==h)return!1;if(u.trim()){const U=u.toLowerCase(),O=P.topic.toLowerCase().includes(U),R=JSON.stringify(P.payload).toLowerCase().includes(U);return O||R}return!0}),[j,u,h]);return a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-bambu-dark-secondary rounded-lg max-w-4xl w-full max-h-[85vh] flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-bambu-dark-tertiary",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:r("mqttDebug.title")}),a.jsx("p",{className:"text-sm text-bambu-gray",children:e})]}),a.jsx("button",{onClick:n,className:"text-bambu-gray hover:text-white transition-colors",children:a.jsx(Ft,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"flex flex-col gap-2 p-4 border-b border-bambu-dark-tertiary",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[k?a.jsxs(Ce,{size:"sm",variant:"secondary",onClick:()=>S.mutate(),disabled:S.isPending,children:[a.jsx(bl,{className:"w-4 h-4"}),r("mqttDebug.stopLogging")]}):a.jsxs(Ce,{size:"sm",onClick:()=>y.mutate(),disabled:y.isPending,children:[a.jsx(so,{className:"w-4 h-4"}),r("mqttDebug.startLogging")]}),a.jsxs(Ce,{size:"sm",variant:"secondary",onClick:()=>N.mutate(),disabled:N.isPending||j.length===0,children:[a.jsx(Jt,{className:"w-4 h-4"}),r("mqttDebug.clearLog")]}),a.jsx(Ce,{size:"sm",variant:"secondary",onClick:()=>b(),disabled:v,children:a.jsx(kr,{className:`w-4 h-4 ${v?"animate-spin":""}`})}),a.jsx("div",{className:"flex-1"}),a.jsxs("label",{className:"flex items-center gap-2 text-sm text-bambu-gray cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:s,onChange:P=>o(P.target.checked),className:"rounded border-bambu-dark-tertiary"}),"Auto-scroll"]}),a.jsxs("span",{className:"text-sm text-bambu-gray",children:[E.length,"/",j.length]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Or,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-bambu-gray"}),a.jsx("input",{type:"text",placeholder:r("mqttDebug.searchPlaceholder"),value:u,onChange:P=>d(P.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm bg-bambu-dark border border-bambu-dark-tertiary rounded text-white placeholder-bambu-gray focus:border-bambu-green focus:outline-none"}),u&&a.jsx("button",{onClick:()=>d(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-bambu-gray hover:text-white",children:a.jsx(Ft,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex items-center gap-1 bg-bambu-dark rounded border border-bambu-dark-tertiary",children:[a.jsx("button",{onClick:()=>f("all"),className:`px-2 py-1.5 text-xs rounded-l transition-colors ${h==="all"?"bg-bambu-green text-white":"text-bambu-gray hover:text-white"}`,children:r("mqttDebug.all")}),a.jsxs("button",{onClick:()=>f("in"),className:`px-2 py-1.5 text-xs transition-colors flex items-center gap-1 ${h==="in"?"bg-blue-500 text-white":"text-bambu-gray hover:text-white"}`,children:[a.jsx(hb,{className:"w-3 h-3"}),r("mqttDebug.incoming")]}),a.jsxs("button",{onClick:()=>f("out"),className:`px-2 py-1.5 text-xs rounded-r transition-colors flex items-center gap-1 ${h==="out"?"bg-green-500 text-white":"text-bambu-gray hover:text-white"}`,children:[a.jsx(Pf,{className:"w-3 h-3"}),r("mqttDebug.outgoing")]})]})]})]}),a.jsx("div",{ref:p,className:"flex-1 overflow-auto p-4 font-mono text-xs bg-black min-h-[400px]",children:j.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-bambu-gray",children:[a.jsx("p",{className:"mb-2",children:r("mqttDebug.noMessages")}),!k&&a.jsx("p",{className:"text-sm",children:r("mqttDebug.startLoggingHint")})]}):E.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-bambu-gray",children:[a.jsx("p",{className:"mb-2",children:r("mqttDebug.noMessagesMatch")}),a.jsx("p",{className:"text-sm",children:r("mqttDebug.adjustFilterHint")})]}):a.jsx("div",{className:"space-y-1",children:E.map((P,U)=>{const O=l.has(U),B=P.direction==="in";return a.jsxs("div",{className:`p-2 rounded cursor-pointer hover:bg-bambu-dark-secondary transition-colors ${O?"bg-bambu-dark-secondary":""}`,onClick:()=>A(U),children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-bambu-gray shrink-0",children:C(P.timestamp)}),a.jsx("span",{className:`shrink-0 ${B?"text-blue-400":"text-green-400"}`,title:r(B?"mqttDebug.incoming":"mqttDebug.outgoing"),children:B?a.jsx(hb,{className:"w-3 h-3"}):a.jsx(Pf,{className:"w-3 h-3"})}),a.jsx("span",{className:"text-purple-400 shrink-0",children:P.topic})]}),O?a.jsx("pre",{className:"mt-2 p-3 bg-gray-900 border border-gray-700 rounded text-green-400 overflow-x-auto whitespace-pre-wrap break-all max-h-96 overflow-y-auto text-xs",children:T(P.payload,!0)}):a.jsx("pre",{className:"mt-1 text-white/80 truncate",children:T(P.payload,!1)})]},U)})})}),a.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-bambu-dark-tertiary",children:[a.jsx("div",{className:"text-sm text-bambu-gray",children:k?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),r("mqttDebug.loggingActive")]}):a.jsx("span",{children:r("mqttDebug.loggingStopped")})}),a.jsx(Ce,{variant:"secondary",onClick:n,children:r("common.close")})]})]})})}const CD={"0300_4000":"Z axis homing failed; the task has been stopped.","0300_4001":"The printer timed out waiting for the nozzle to cool down before homing.","0300_4002":"Auto Bed Leveling failed; the task has been stopped.","0300_4005":"The hotend cooling fan speed is abnormal.","0300_4006":"The nozzle is clogged.","0300_4008":"The AMS failed to change filament.","0300_4009":"Homing XY axis failed.","0300_400A":"Mechanical resonance frequency identification failed.","0300_400B":"Internal communication exception","0300_400C":"The task was canceled.","0300_400D":"Resume failed after power loss.","0300_400E":"The motor self-check failed.","0300_400F":"The power supply voltage does not match the printer.","0300_4010":"Nozzle offset calibration failed.","0300_4011":"Flow Dynamics Calibration failed; please reinitiate printing or calibration.","0300_4013":"Printing cannot be initiated while AMS is drying.","0300_4014":"Homing Z axis failed: temperature control abnormality.","0300_4015":"Nozzle clumping detection calibration failed. Please go to 'Assistant' for troubleshooting.","0300_4016":"Nozzle cleaning failed. Please click the Assistant for troubleshooting.","0300_401F":"The hotend is not installed, and the toolhead cannot perform homing. Please install the hotend and then continue.","0300_4020":"The nozzle presence detection failed. Please check the Assistant for details.","0300_4021":"Nozzle offset calibration sensor signal abnormality detected. Please check the sensor and retry.","0300_4042":"The Laser Safety Window is not properly installed. The task has been stopped.","0300_4044":"The Flame Sensor is abnormal. The sensor may be short-circuited. Please troubleshoot the issue before starting a print job.","0300_404B":"Task aborted because the front door or top cover is open.","0300_404D":"The current temperature of the hotend, heatbed, or chamber is too high. Please wait for it to cool down to room temperature before restarting the task.","0300_4050":"Liveview Camera calibration timeout; please restart the printer.","0300_4052":"Blade Z-axis homing failed","0300_4057":"Z-axis step loss detected. The task has stopped. Please check if there are any obstructions beneath the heatbed.","0300_4066":"Calibration of motion precision failed.","0300_4067":"Calibration result is over the threshold.","0300_4068":"Step loss occurred during the motion accuracy enhancement process. Please try again.","0300_8000":"Printing was paused for unknown reason. You can select 'Resume' to resume the print job.","0300_8001":"Printing was paused by the user. You can select 'Resume' to continue printing.","0300_8002":"First layer defects were detected by the Micro Lidar. Please check the quality of the printed model before continuing your print.","0300_8003":"Spaghetti defects were detected by the AI Print Monitoring. Please check the quality of the printed model before continuing your print.","0300_8004":"Filament ran out. Please load new filament.","0300_8005":"Toolhead front cover fell off. Please remount the front cover and check to make sure your print is going okay.","0300_8006":"The build plate marker was not detected. Please confirm the build plate is correctly positioned on the heatbed with all four corners aligned, and the marker is visible.","0300_8007":"There was an unfinished print job when the printer lost power. If the model is still adhered to the build plate, you can try resuming the print job.","0300_8008":"Nozzle temperature malfunction","0300_8009":"Heatbed temperature malfunction","0300_800A":"A Filament pile-up was detected by AI Print Monitoring. Please clean filament from the waste chute.","0300_800B":"The cutter is stuck. Please make sure the cutter handle is out and check the filament sensor cable connection.","0300_800C":"Skipped step detected: auto-recover complete; please resume print and check if there are any layer shift problems.","0300_800D":"Detected that the extruder is not extruding normally. If the defects are acceptable, select 'Resume' to resume the print job.","0300_800E":"The print file is not available. Please check to see if the storage media has been removed.","0300_800F":"The door seems to be open, so printing was paused.","0300_8010":"The hotend cooling fan speed is abnormal.","0300_8011":"Detected build plate is not the same as the Gcode file. Please adjust slicer settings or use the correct plate.","0300_8013":"Printing paused due to the pause command added to the printing file.","0300_8014":"The nozzle is covered with filament, or the build plate is installed incorrectly. Please cancel this print and clean the nozzle or adjust the build plate according to the actual status. You can als...","0300_8015":"The filament on external spool has run out; please load new filament. If the filament is loaded, please select 'Resume'.","0300_8016":"The nozzle is clogged with filament. Please cancel this print and clean the nozzle or select 'Resume' to resume the print job.","0300_8017":"Foreign objects detected on heatbed. Please check and clean the heatbed. Then, select 'Resume' to resume the print job.","0300_8018":"Chamber temperature malfunction.","0300_8019":"No build plate is placed.","0300_801A":"Filament extrusion error; please check the assistant for troubleshooting. After resolving the issue, decide whether to cancel or resume the print job based on the actual print status.","0300_801B":"Nozzle temperature problem detected. Refer to Assistant to re-connect the hotend connector. POWER OFF the printer before this operation to avoid short circuits.","0300_801C":"The extrusion resistance is abnormal. The extruder may be clogged; please refer to the assistant. After trouble shooting, you can select 'Resume' to resume the print job.","0300_801D":"The extruder servo motor position sensor is malfunctioning. Please power off the printer first and check if the connection cable is loose.","0300_801E":"The extrusion motor is overloaded, please check the Assistant for details.","0300_8021":"The nozzle may not be installed or not properly installed. Please ensure the nozzle is correctly installed before proceeding.","0300_8022":"The heatbed may be obstructed while moving downward. Please clear any objects beneath the heatbed and check for any resistance or jamming during its movement.","0300_8028":"Nozzle offset calibration sensor error. If using a single hotend or the calibration function is disabled, you may ignore this and continue printing; otherwise, it is recommended to check the sensor...","0300_8041":"Platform detection timeout: please restart the printer.","0300_8042":"Task paused because the door is open.","0300_8043":"The laser module is abnormal.","0300_8044":"Fire was detected inside the chamber.","0300_8045":"Material detection timeout: please restart the printer.","0300_8046":"Foreign object detect timeout: please restart the printer.","0300_8047":"Quick-release lever detection time out: please restart the printer.","0300_8048":"Laser Module unlock has timed out, and the task cannot proceed. Please restart the printer and try again.","0300_8049":"The current plate is invalid.","0300_804A":"Emergency stop button improperly installed. Please reinstall according to the Wiki before proceeding.","0300_804B":"Task paused. The Laser Safety Window is open.","0300_804E":"This is a printing task. Please detach the Laser/Cutting Module from the Toolhead.","0300_804F":"The loading/unloading process is currently ongoing. Please stop the process or remove the laser/cutting module.","0300_8050":"This device does not support the 40W Laser Module. Please remove it or replace it with a 10W Laser Module.","0300_8051":"The cutting module has dropped or the cutting module cable is disconnected; please check the module.","0300_8053":"Laser module detected. Please install the right nozzle correctly to ensure proper Laser Module Mounting Calibration.","0300_8054":"Please place the paper required for Print Then Cut.","0300_8055":"The module mounted on the toolhead does not match the task. Please install the correct module.","0300_8057":"The rotary attachment is disconnected. Please ensure it is properly installed and the cable is securely plugged in.","0300_8058":"The rotary attachment is detected. Please remove it before continuing.","0300_8061":"The mode of Airflow System failed to activate; check the air door condition.","0300_8062":"The chamber temperature is too high. It may be due to high environmental temperature.","0300_8063":"The chamber temperature is too high. Please open the top cover and front door to cool down.","0300_8064":"The chamber temperature is too high. Please open the top cover and front door to cool down. (Open door detection for this print job will be set to 'Notification' level)","0300_8065":"The temperature of the MC module is too high. Please check the Wiki for possible explanations.","0300_8071":"The Toolhead Enhanced Cooling Fan module is malfunctioning.","0300_807D":"Fire Extinguisher not detected, the automatic extinguishing function will be unavailable.","0300_807E":"Fire Extinguisher not detected, the automatic extinguishing function will be unavailable.","0300_807F":"Fire Extinguisher is malfunctioning.","0300_8080":"Fire extinguisher motor reset failed.","0300_8081":"Fire extinguisher cylinder not installed. Please confirm on the extinguisher page.","0300_8082":"The Fire Extinguisher Gas Cylinder is empty.","0300_C012":"Please heat the nozzle to above 170°C.","0300_C056":"A minor fire was detected inside the chamber, and the Auto Fire Extinguishing process has been aborted.","0300_C070":"The fire extinguisher has been detected and is ready for use after the laser module is connected.","0500_4001":"Failed to connect to Bambu Cloud. Please check your network connection.","0500_4002":"Unsupported print file path or name. Please resend the print job.","0500_4003":"Printing stopped because the printer was unable to parse the file. Please resend your print job.","0500_4004":"Device is busy and cannot start new task. Please wait for current task to complete before sending new task.","0500_4005":"Print jobs are not allowed to be sent while updating firmware.","0500_4006":"There is not enough free storage space for the print job. Restoring to factory settings can free up available space.","0500_4007":"The device requires a repair upgrade, and printing is currently unavailable.","0500_4008":"Starting printing failed; please power cycle the printer and resend the print job.","0500_4009":"Print jobs are not allowed to be sent while updating logs.","0500_400A":"The file name is not supported. Please rename and restart the print job.","0500_400B":"There was a problem downloading a file. Please check your network connection and resend the print job.","0500_400C":"Please insert a MicroSD card and restart the print job.","0500_400D":"Please run a self-test and restart the print job.","0500_400E":"Printing was cancelled.","0500_400F":"AMS is initializing and cannot be upgraded at the moment. Please try again later.","0500_4010":"AMS is drying and cannot be upgraded at the moment. Please try again later.","0500_4011":"The printer is loading or unloading filament and cannot be upgraded at the moment. Please try again later.","0500_4012":"The device is printing and cannot be upgraded at the moment. Please try again later.","0500_4013":"AMS is in operation and cannot be upgraded at the moment. Please try again when it is idle.","0500_4014":"Slicing for the print job failed. Please check your settings and restart the print job.","0500_4015":"There is not enough free storage space for the print job. Please format or clear files from the MicroSD card to free up space.","0500_4016":"The MicroSD Card is write-protected. Please replace the MicroSD Card.","0500_4017":"Binding failed. Please retry or restart the printer and retry.","0500_4018":"Binding configuration information parsing failed; please try again.","0500_4019":"The printer has already been bound. Please unbind it and try again.","0500_401A":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0500_401B":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_401C":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_401D":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0500_401E":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_401F":"Authorization timed out. Please make sure that your phone or PC has access to the internet, and ensure that the Bambu Studio/Bambu Handy APP is running in the foreground during the binding operation.","0500_4020":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_4021":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0500_4022":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_4023":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_4024":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0500_4025":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_4026":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_4027":"Cloud access failed; this may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0500_4028":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_4029":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_402A":"Failed to connect to the router, which may be caused by wireless interference or being too far away from the router. Please try again or move the printer closer to the router and try again.","0500_402B":"Router connection failed due to incorrect password. Please check the password and try again.","0500_402C":"Failed to obtain IP address, which may be caused by wireless interference resulting in data transmission failure or the DHCP address pool of the router being full. Please move the printer closer to...","0500_402D":"System exception","0500_402E":"System does not support the file system currently used by the USB flash drive. Please replace or format the USB flash drive to FAT32.","0500_402F":"The MicroSD card sector data is damaged. Please use the SD card repair tool to repair or format it. If it still cannot be identified, please replace the MicroSD card.","0500_4030":"The device is currently upgrading. Please try again when it is idle.","0500_4031":"The accessory firmware does not match the printer. Please update it on the 'Firmware' page.","0500_4033":"The AMS firmware does not match the printer. Please update it on the 'Firmware' page.","0500_4034":"The Laser Module firmware does not match the printer. Please update it on the 'Firmware' page.","0500_4035":"The BirdsEye Camera is malfunctioning. Please try restarting the device. If the issue persists after multiple restarts, check the camera connection status or contact customer support.","0500_4037":"Your sliced file is not compatible with current printer model. This file can't be printed on this printer.","0500_4038":"The nozzle diameter in sliced file is not consistent with the current nozzle setting. This file can't be printed.","0500_4039":"The current task does not allow the installation of the laser/cutting module, and the task has been halted.","0500_403A":"The current temperature is too low. In order to protect you and your printer, printing tasks, moving an axis and other operations are disabled. Please move the printer to an environment above 10 de...","0500_403B":"Laser/cutting tasks cannot be initiated on the machine at the moment. Please use the computer software to start the task.","0500_403C":"The current nozzle setting does not match the slicing file. Continuing to print may affect print quality. It is recommended to re-slice before starting the print.","0500_403D":"The toolhead module is not set up. Please set it up before initiating the task.","0500_403E":"The current tool head does not support initialization.","0500_403F":"Failed to download print job; please check your network connection.","0500_4040":"The printer has reached its power limit. Please connect a dedicated power adapter to this AMS to enable drying.","0500_4041":"The AMS drying cannot be started during printing.","0500_4042":"Due to power limitations, starting AMS drying will pause current operations such as nozzle heating and fan running. Do you want to proceed with drying?","0500_4043":"Due to power limitations, only one AMS is allowed to use the device's power for drying.","0500_4044":"BirdsEye Camera malfunction: please contact customer support.","0500_4045":"Hotend check in progress. This operation is temporarily unavailable. Please wait.","0500_4050":"Error detected on the print board.","0500_4052":"Error detected on the hot end.","0500_4054":"Error detected on the mat.","0500_405D":"Laser module Serial Number error: unable to calibrate or make project.","0500_4065":"The task requires a Laser Platform, but the current one is a Cutting Platform. Please replace it, measure the material thickness in the software, and then restart the task.","0500_4070":"The laser or cutter module is connected, so the device cannot initiate a 3D printing task.","0500_4075":"No Laser Platform was detected, which may affect thickness measurement accuracy. Please place the laser platform correctly and ensure the rear markers are not blocked, then restart the thickness me...","0500_4076":"Please place the Laser Platform correctly and ensure the rear markers are not blocked, then restart the thickness measurement in the software before initiating the task.","0500_4097":"The device cannot detect the Laser Module. Please reconnect the module cable or restart the printer.","0500_4098":"The device cannot detect AMS A. Please reconnect the AMS cable or restart the printer.","0500_4099":"The firmware of Cutting Module does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0500_409A":"The firmware of the Air Pump does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0500_409B":"The firmware of the Laser Module does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0500_409D":"The firmware of AMS A does not match the printer; the device cannot continue working. Please upgrade it on the 'Firmware' page.","0500_409E":"The device cannot detect the Cutting Module. Please reconnect the module cable or restart the printer.","0500_409F":"The device cannot detect the Air Pump. Please reconnect the module cable or restart the printer.","0500_40A0":"The Rotary Attachment module is not detected. Please reconnect the cable or restart the printer.","0500_40A1":"The Auto Fire Extinguishing System is not detected. Please reconnect the module cable or restart the printer.","0500_40A3":"AMS(or AMS lite) A communication is abnormal. Please reconnect the module cable or restart the printer.","0500_40A4":"The current firmware only supports 1 AMS Lite. Please remove all AMS units before reconnecting the supported AMS Lite device.","0500_40A5":"The current firmware only supports AMS/AMS 2 Pro/AMS HT, with a maximum of 4 units. Please remove all AMS units before reconnecting the supported one.","0500_8013":"The print file is not available. Please check to see if the storage media has been removed.","0500_8036":"Your sliced file is not consistent with the current printer model. Continue?","0500_803C":"The current nozzle setting does not match the slicing file. Continuing to print may affect print quality. It is recommended to re-slice before starting the print.","0500_8040":"Toolhead front cover is detached. Moving the toolhead may damage the printer. Do you want to continue?","0500_8041":"The filament in hotend is too cold. Extrusion may damage the extruder. Still feeding in/out the filament?","0500_8048":"The module on the toolhead is not calibrated. Please cancel the task to perform calibration or switch to a calibrated module.","0500_8051":"Detected build plate is not the same as the Gcode file. Please adjust slicer settings or use the correct plate.","0500_8053":"Nozzle mismatch was detected during printing. Please initiate the print after re-slicing, or continue printing after replacing with the correct nozzle. Caution: the hotend temperature is high.","0500_8055":"Laser module is installed, but a Cutting Platform is detected. Please place a Laser Platform and perform laser calibration.","0500_8056":"Cutting module is installed, but the laser platform is detected. Please place the cutting platform for calibration.","0500_8058":"Please place the light grip cutting mat correctly and ensure the marker is exposed.","0500_8059":"Cutting platform base is not correctly aligned. Please ensure that the four corners of the platform are aligned with the heatbed.","0500_805A":"Please place the cutting mat on cutting protection base.","0500_805B":"The cutting mat type is unknown; please replace it with the correct cutting mat.","0500_805C":"The grip cutting mat type does not match; please place a LightGrip cutting mat.","0500_805E":"Cutting module Serial Number error: unable to calibrate or make project.","0500_8060":"The current module on toolhead does not meet requirements. Please replace the module as per the on-screen instructions.","0500_8061":"No print plate detected. Please make sure it is placed correctly.","0500_8062":"The print plate marker was not detected. Please confirm the print plate is correctly positioned on the heatbed with all four corners aligned, and the marker is visible. If strong light is shining o...","0500_8063":"The platform is not detected during calibration; please make sure the Laser Platform is properly placed.","0500_8064":"Please place the Laser Platform correctly and ensure the rear markers are not blocked for laser calibration.","0500_8066":"The task requires a Cutting Platform, but the current one is a Laser Platform. Please replace it with a Cutting Platform (Cutting Protection Base + LightGrip cutting mat).","0500_8067":"Please place a LightGrip cutting mat on the cutting protection base.","0500_8068":"Please place the strong grip cutting mat correctly and ensure the marker is exposed.","0500_8069":"Unable to recognize the left and right hotends. They might be third party hotends, or the hotend marks may be dirty. Please manually set the hotend types.","0500_806A":"Unable to recognize the left and right hotends. They might be third party hotends, or the hotend marks may be dirty. Please set hotend types on printer screen before next print.","0500_806B":"Quick-release Lever is not locked. Please press down the external toolhead module to ensure it is properly seated, then push down the level to lock it in place.","0500_806C":"Please place the cutting platform correctly and ensure the marker is exposed.","0500_806D":"Material not detected. Please confirm placement and continue.","0500_806E":"Foreign objects detected on heatbed; please check and clean up the heatbed.","0500_806F":"The grip cutting mat type does not match; please place a StrongGrip cutting mat.","0500_8071":"No cutting platform was detected. Please confirm that it has been correctly placed.","0500_8072":"Live View camera is blocked","0500_8073":"Heatbed limit block is obstructed or contaminated. Please clean and ensure the limit block is visible, otherwise platform position offset detection may be inaccurate.","0500_8074":"The Laser Platform is offset. Please ensure that the four corners of the platform are aligned with the heatbed, and the marker is not obstructed.","0500_8077":"The visual marker was not detected. Please ensure the paper is properly placed.","0500_8078":"Current material does not match the sliced file settings. Please load the correct material and ensure the QR code on the material is not damaged or dirty.","0500_8079":"Please place the Laser Test Material (350g paperboard) and position support strips underneath to prevent material warping.","0500_807A":"The foreign object detection function is not working. You can continue the task or check the assistant for troubleshooting.","0500_807B":"Please place the cutting platform (cutting protection base + LightGrip cutting mat).","0500_807C":"Please place the cutting platform (cutting protection base + StrongGrip cutting mat).","0500_807D":"This task requires a Cutting Platform, but the current one is a Laser Platform. Please replace it with a Cutting Platform (Cutting Protection Base + StrongGrip Cutting Mat).","0500_807E":"Please place a StrongGrip cutting mat on the cutting protection base.","0500_8080":"The left and right hotends are not installed.","0500_8081":"The left and right hotends are not installed.","0500_8082":"Please remove the protective film on the Opaque Glossy Acrylic before processing","0500_8083":"Material is not allowed in Mounting Calibration. Please remove the material from the platform.","0500_8084":"The Live View Camera is dirty; please clean it and continue.","0500_8085":"Toolhead camera is obstructed","0500_8086":"Toolhead Camera is dirty, which affects the AI function; please clean the lens surface.","0500_8087":"BirdsEye camera is obstructed","0500_8088":"The Birdseye Camera is dirty","0500_8089":"Task paused due to Presence Check failed. Please check the printer to continue.","0500_808A":"The BirdsEye Camera is installed offset. Please refer to the assistant to reinstall it.","0500_808B":"The BirdsEye Camera setup failed. Please remove all objects and the mat on the heatbed to ensure the heatbed markers are visible. Meanwhile, please ensure the BirdsEye Camera is installed correctly...","0500_808C":"Detected build plate offset. Please align the build plate with the heatbed, and then continue.","0500_808D":"The Cutting Module offset calibration failed, which may result in inaccurate cuts. Please ensure the cutting material is properly positioned and check whether the cutting blade tip is worn.","0500_808E":"BirdsEye Camera initialization failed. The toolhead camera did not detect the Heatbed features. Please clean the Heatbed, remove all objects and pads, and ensure the bed markings are visible. Check...","0500_808F":"Nozzle camera lens is dirty, affecting AI monitoring. Clean the lens with a non-woven cloth and a small amount of alcohol. Beware of hotend heat; wait for it to cool before handling.","0500_8090":"Please attach the 80g White Printing Paper to the center area of the platform.","0500_8091":"The Cutting Module offset calibration failed, which may result in inaccurate cuts. Please ensure the 80g white printer paper(letter paper thickness) is properly positioned and check whether the cut...","0500_8092":"Toolhead Camera initialization failed. This print can still continue, but some AI functions will be disabled. If you encounter this issue again after restarting, please contact customer support.","0500_8093":"The nozzle silicone sleeve is not installed; there is a risk of temperature control failure. Please install it correctly and try again.","0500_80A0":"The visual encoder board was not detected. Please check if the board is properly placed and aligned at all four corners, and ensure the positioning markings are clear and free from wear.","0500_C010":"MicroSD Card read/write exception: please reinsert or replace the MicroSD Card.","0500_C032":"Laser/Cutting module connected to the toolhead. The drying process has been automatically stopped.","0500_C036":"This is a printing task. Please detach the Laser/Cutting Module from the Toolhead.","0500_C07F":"Device is busy and cannot perform this operation. To proceed, please pause or stop the current task.","0501_4017":"Binding failed. Please retry or restart the printer and retry.","0501_4018":"Binding configuration information parsing failed; please try again.","0501_4019":"The printer has already been bound. Please unbind it and try again.","0501_401A":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0501_401B":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_401C":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_401D":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0501_401E":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_401F":"Authorization timed out. Please make sure that your phone or PC has access to the internet, and ensure that the Bambu Studio/Bambu Handy APP is running in the foreground during the binding operation.","0501_4020":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4021":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0501_4022":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_4023":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4024":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0501_4025":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_4026":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4027":"Cloud access failed; this may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0501_4028":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_4029":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4031":"Device discovery binding is in progress, and the QR code cannot be displayed on the screen. You can wait for the binding to finish or abort the device discovery binding process in the APP/Studio an...","0501_4032":"QR code binding is in progress, so device discovery binding cannot be performed. You can scan the QR code on the screen for binding or exit the QR code display page on screen and try device discove...","0501_4033":"Your APP region does not match with your printer; please download the APP in the corresponding region and register your account again.","0501_4034":"The slicing progress has not been updated for a long time, and the printing task has exited. Please confirm the parameters and reinitiate printing.","0501_4035":"The device is in the process of binding and cannot respond to new binding requests.","0501_4038":"The regional settings do not match the printer; please check the printer's regional settings.","0501_4039":"Device login has expired; please try to bind again.","0501_4098":"The device cannot detect AMS B. Please reconnect the AMS cable or restart the printer.","0501_409D":"The firmware of AMS B does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0501_40A3":"AMS(or AMS lite) B communication is abnormal. Please reconnect the module cable or restart the printer.","0502_4001":"Current filament will be used in this print job. Settings cannot be changed.","0502_4002":"Please go to “Settings > Calibration” to run the Motion Accuracy Enhancement Calibration before turning on Motion Accuracy Enhancement mode.","0502_4003":"The printer is currently printing and the motion accuracy enhancement feature cannot be turned on or off.","0502_4004":"Some features are not supported by the current device. Please check the Studio feature settings or update the firmware to the latest version.","0502_4005":"The AMS has not been calibrated yet, so printing cannot be initiated.","0502_4006":"Unknown module detected; please try updating the firmware to the latest version.","0502_400D":"Failed to start a new task: filament loading/unloading not completed.","0502_400E":"Failed to start a new task: The nozzle cold pull was not completed.","0502_4013":"This device is not compatible with the 40W laser module. Please replace it with a 10W laser module or remove it.","0502_4098":"The device cannot detect AMS C. Please reconnect the AMS cable or restart the printer.","0502_409D":"The firmware of AMS C does not match the printer; the device cannot continue working. Please upgrade it on the 'Firmware' page.","0502_40A3":"AMS(or AMS lite) C communication is abnormal. Please reconnect the module cable or restart the printer.","0502_C00F":"The device is busy and cannot perform nozzle identification.","0502_C010":"Due to printer power limitations, printing, calibration, controls and other actions cannot be performed during AMS drying. Please stop the drying process before proceeding with any other operation.","0502_C011":"Currently in 2D production mode. Please continue the operation on the printer","0502_C012":"The task cannot be paused.","0502_C014":"The AMS Remaining Filament Estimation is enabled by default and cannot be disabled.","0502_C024":"The flow dynamic calibration records have exceeded the storage limit. Please delete some historical records in the slicer software before adding new calibration data.","0503_4098":"The device cannot detect AMS D. Please reconnect the AMS cable or restart the printer.","0503_409D":"The firmware of AMS D does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0503_40A3":"AMS(or AMS lite) D communication is abnormal. Please reconnect the module cable or restart the printer.","0580_4096":"The device cannot detect AMS-HT A. Please reconnect the AMS-HT cable or restart the printer.","0580_409C":"The firmware of AMS-HT A does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0580_40A2":"AMS-HT A communication is abnormal. Please reconnect the module cable or restart the printer.","0581_4096":"The device cannot detect AMS-HT B. Please reconnect the AMS-HT cable or restart the printer.","0581_409C":"The firmware of AMS-HT B does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0581_40A2":"AMS-HT B communication is abnormal. Please reconnect the module cable or restart the printer.","0582_4096":"The device cannot detect AMS-HT C. Please reconnect the AMS-HT cable or restart the printer.","0582_409C":"The firmware of AMS-HT C does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0582_40A2":"AMS-HT C communication is abnormal. Please reconnect the module cable or restart the printer.","0583_4096":"The device cannot detect AMS-HT D. Please reconnect the AMS-HT cable or restart the printer.","0583_409C":"The firmware of AMS-HT D does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0583_40A2":"AMS-HT D communication is abnormal. Please reconnect the module cable or restart the printer.","0584_4096":"The device cannot detect AMS-HT F. Please reconnect the AMS-HT cable or restart the printer.","0584_409C":"The firmware of AMS-HT E does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0584_40A2":"AMS-HT E communication is abnormal. Please reconnect the module cable or restart the printer.","0585_4096":"The device cannot detect AMS-HT E. Please reconnect the AMS-HT cable or restart the printer.","0585_409C":"The firmware of AMS-HT F does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0585_40A2":"AMS-HT F communication is abnormal. Please reconnect the module cable or restart the printer.","0586_4096":"The device cannot detect AMS-HT G. Please reconnect the AMS-HT cable or restart the printer.","0586_409C":"The firmware of AMS-HT G does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0586_40A2":"AMS-HT G communication is abnormal. Please reconnect the module cable or restart the printer.","0587_4096":"The device cannot detect AMS-HT H. Please reconnect the AMS-HT cable or restart the printer.","0587_409C":"The firmware of AMS-HT H does not match the printer; the device cannot continue working. Please upgrade it on the 'Firmware' page.","0587_40A2":"AMS-HT H communication is abnormal. Please reconnect the module cable or restart the printer.","05FE_8053":"The left nozzle is not matched with slicing file. Please initiate the print after re-slicing, or continue printing after replacing with the correct nozzle. Caution: the hotend temperature is high.","05FE_8069":"Unable to recognize the left hotend. It might be a third party hotend, or the hotend mark may be dirty. Please manually set the hotend type.","05FE_806A":"Unable to recognize the left hotend. It might be a third party hotend, or the hotend mark may be dirty. Please set hotend type on printer screen before next print.","05FE_8080":"The left hotend is not installed.","05FE_8081":"The left hotend is not installed.","05FF_8053":"The right nozzle is not matched with slicing file. Please initiate the print after re-slicing, or continue printing after replacing with the correct nozzle. Caution: the hotend temperature is high.","05FF_8069":"Unable to recognize the right hotend. It might be a third party hotend, or the hotend mark may be dirty. Please manually set the hotend type.","05FF_806A":"Unable to recognize the right hotend. It might be a third party hotend, or the hotend mark may be dirty. Please set hotend type on printer screen before next print.","05FF_8080":"The right hotend is not installed.","05FF_8081":"The right hotend is not installed.","0700_4001":"The AMS has been disabled for a print, but it still has filament loaded. Please unload the AMS filament and switch to the spool holder filament for printing.","0700_4025":"Failed to read the filament information.","0700_8001":"Failed to cut the filament. Please check the cutter.","0700_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0700_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0700_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0700_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0700_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0700_8007":"Extruding filament failed. The extruder might be clogged.","0700_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS A to the extruder is properly connected.","0700_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0700_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0700_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0700_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0700_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0700_8017":"AMS A is drying. Please stop drying process before loading/unloading material.","0700_8021":"AMS setup failed; please refer to the assistant.","0700_8023":"AMS A cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0700_C069":"An error occurred during AMS A drying. Please go to Assistant for more details.","0700_C06A":"AMS A is reading RFID. Unable to start drying. Please try again later.","0700_C06B":"AMS A is changing filament. Unable to start drying. Please try again later.","0700_C06C":"AMS A is in Feed Assist Mode. Unable to start drying. Please try again later.","0700_C06D":"AMS A is assisting in filament insertion. Unable to start drying. Please try again later.","0700_C06E":"AMS A motor is performing self-test. Unable to start drying. Please try again later.","0701_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","0701_4025":"Failed to read the filament information.","0701_8001":"Failed to cut the filament. Please check the cutter.","0701_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0701_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0701_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0701_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0701_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0701_8007":"Extruding filament failed. The extruder might be clogged.","0701_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS B to the extruder is properly connected.","0701_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0701_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0701_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0701_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0701_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0701_8017":"AMS B is drying. Please stop drying process before loading/unloading material.","0701_8021":"AMS setup failed; please refer to the assistant.","0701_8023":"AMS B cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0701_C069":"An error occurred during AMS B drying. Please go to Assistant for more details.","0701_C06A":"AMS B is reading RFID. Unable to start drying. Please try again later.","0701_C06B":"AMS B is changing filament. Unable to start drying. Please try again later.","0701_C06C":"AMS B is in Feed Assist Mode. Unable to start drying. Please try again later.","0701_C06D":"AMS B is assisting in filament insertion. Unable to start drying. Please try again later.","0701_C06E":"AMS B motor is performing self-test. Unable to start drying. Please try again later.","0702_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","0702_4025":"Failed to read the filament information.","0702_8001":"Failed to cut the filament. Please check the cutter.","0702_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0702_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0702_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0702_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0702_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0702_8007":"Extruding filament failed. The extruder might be clogged.","0702_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS C to the extruder is properly connected.","0702_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0702_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0702_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0702_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0702_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0702_8017":"AMS C is drying. Please stop drying process before loading/unloading material.","0702_8021":"AMS setup failed; please refer to the assistant.","0702_8023":"AMS C cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0702_C069":"An error occurred during AMS C drying. Please go to Assistant for more details.","0702_C06A":"AMS C is reading RFID. Unable to start drying. Please try again later.","0702_C06B":"AMS C is changing filament. Unable to start drying. Please try again later.","0702_C06C":"AMS C is in Feed Assist Mode. Unable to start drying. Please try again later.","0702_C06D":"AMS C is assisting in filament insertion. Unable to start drying. Please try again later.","0702_C06E":"AMS C motor is performing self-test. Unable to start drying. Please try again later.","0703_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","0703_4025":"Failed to read the filament information.","0703_8001":"Failed to cut the filament. Please check the cutter.","0703_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0703_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0703_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0703_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0703_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0703_8007":"Extruding filament failed. The extruder might be clogged.","0703_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS D to the extruder is properly connected.","0703_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0703_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0703_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0703_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0703_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0703_8017":"AMS D is drying. Please stop drying process before loading/unloading material.","0703_8021":"AMS setup failed; please refer to the assistant.","0703_8023":"AMS D cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0703_C069":"An error occurred during AMS D drying. Please go to Assistant for more details.","0703_C06A":"AMS D is reading RFID. Unable to start drying. Please try again later.","0703_C06B":"AMS D is changing filament. Unable to start drying. Please try again later.","0703_C06C":"AMS D is in Feed Assist Mode. Unable to start drying. Please try again later.","0703_C06D":"AMS D is assisting in filament insertion. Unable to start drying. Please try again later.","0703_C06E":"AMS D motor is performing self-test. Unable to start drying. Please try again later.","0704_4025":"Failed to read the filament information.","0704_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0704_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0704_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0704_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0704_8007":"Extruding filament failed. The extruder might be clogged.","0704_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS E to the extruder is properly connected.","0704_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0704_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0704_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0704_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0704_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0704_8021":"AMS setup failed; please refer to the assistant.","0704_8023":"AMS E cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0705_4025":"Failed to read the filament information.","0705_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0705_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0705_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0705_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0705_8007":"Extruding filament failed. The extruder might be clogged.","0705_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS F to the extruder is properly connected.","0705_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0705_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0705_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0705_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0705_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0705_8021":"AMS setup failed; please refer to the assistant.","0705_8023":"AMS F cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0706_4025":"Failed to read the filament information.","0706_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0706_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0706_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0706_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0706_8007":"Extruding filament failed. The extruder might be clogged.","0706_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS G to the extruder is properly connected.","0706_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0706_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0706_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0706_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0706_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0706_8021":"AMS setup failed; please refer to the assistant.","0706_8023":"AMS G cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0707_4025":"Failed to read the filament information.","0707_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0707_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0707_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0707_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0707_8007":"Extruding filament failed. The extruder might be clogged.","0707_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS H to the extruder is properly connected.","0707_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0707_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0707_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0707_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0707_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0707_8021":"AMS setup failed; please refer to the assistant.","0707_8023":"AMS H cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","07FE_8001":"Failed to cut the filament of the left extruder. Please check the cutter.","07FE_8002":"The cutter of the left extruder is stuck. Please pull out the cutter handle.","07FE_8003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are ab...","07FE_8004":"Failed to pull back the filament from the left extruder. Please check whether the filament is stuck inside the extruder.","07FE_8005":"Failed to feed the filament outside the AMS. Please clip the end of the filament flat and check to see if the spool is stuck.","07FE_8006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","07FE_8007":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","07FE_8010":"Check if the left external filament spool or filament is stuck.","07FE_8011":"The external filament connected to the left extruder has run out; please load a new filament.","07FE_8012":"Failed to get mapping table; please select 'Resume' to retry.","07FE_8013":"Timeout purging old filament of the left extruder: Please check if the filament is stuck or the extruder is clogged.","07FE_8020":"Extruder change failed; please refer to the assistant.","07FE_8021":"AMS setup failed; please refer to the assistant.","07FE_8024":"Extruder position calibration failed; please refer to the assistant.","07FE_8025":"Cold pull timed out. Please promptly operate or check whether the filament is broken inside the extruder, and click the Assistant for details.","07FE_8030":"The filament specified in the slicer has been used up. Printing is paused. Please go to the machine to replace the material and resume printing.","07FE_C003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","07FE_C006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","07FE_C008":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","07FE_C009":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","07FE_C00A":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'.","07FE_C010":"Insert the filament (over 30cm long) until it stops. You might see slight smoke during flushing. After insertion, close the front door and top cover.","07FE_C011":"Please manually and slowly pull out the filament from the extruder. Then click “Continue”.","07FE_C012":"Press the black PTFE tube coupler and unplug the PTFE tube. After completing the operation, click 'Continue.'","07FF_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","07FF_8001":"Failed to cut the filament of the right extruder. Please check the cutter.","07FF_8002":"The cutter is stuck. Please make sure the cutter handle is out.","07FF_8003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are a...","07FF_8004":"Failed to pull back the filament from the right extruder. Please check whether the filament is stuck inside the extruder.","07FF_8005":"Failed to feed the filament outside the AMS. Please clip the end of the filament flat and check to see if the spool is stuck.","07FF_8006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","07FF_8007":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","07FF_8010":"Check if the external filament spool or filament is stuck.","07FF_8011":"External filament has run out; please load a new filament.","07FF_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","07FF_8013":"Timeout purging old filament of the right extruder: Please check if the filament is stuck or the extruder is clogged.","07FF_8020":"Extruder change failed; please refer to the assistant.","07FF_8021":"AMS setup failed; please refer to the assistant.","07FF_8024":"Extruder position calibration failed; please refer to the assistant.","07FF_8025":"Cold pull timed out. Please promptly operate or check whether the filament is broken inside the extruder, and click the Assistant for details.","07FF_8030":"The filament specified in the slicer has been used up. Printing is paused. Please go to the machine to replace the material and resume printing.","07FF_C003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","07FF_C006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","07FF_C008":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","07FF_C009":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","07FF_C00A":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'.","07FF_C010":"Insert the filament (over 30cm long) until it stops. You might see slight smoke during flushing. After insertion, close the front door and top cover.","07FF_C011":"Hold the driven wheel bracket, slowly pull the filament from the extruder, then press 'Continue'.","07FF_C012":"Press the black PTFE tube coupler and unplug the PTFE tube. After completing the operation, click 'Continue.'","0C00_4020":"The setup of BirdsEye Camera failed. Please clear all objects and remove the mat. Make sure the marker is not obstructed. Meanwhile, clean both the BirdsEye Camera and Toolhead Camera, and remove a...","0C00_4021":"The setup of BirdsEye Camera failed; please reboot the printer.","0C00_4022":"The setup of BirdsEye Camera failed. Please check if the laser module is working properly.","0C00_4024":"The Birdseye Camera is installed offset. Please refer to the assistant to reinstall it.","0C00_4025":"The Birdseye Camera is dirty. Please clean it and restart the process.","0C00_4026":"The Live View Camera initialization failed; please reboot the printer.","0C00_4027":"The Live View Camera calibration failed. Please refer to the assistant for details and recalibrate the camera after processing.","0C00_4029":"Material not detected. Please confirm placement and continue.","0C00_402A":"The visual marker was not detected. Please re-paste the paper in the correct position.","0C00_402C":"Device data link error. Please reboot the printer","0C00_402D":"The toolhead camera is not working properly; please reboot the device.","0C00_403D":"The vision encoder plate was not detected. Please confirm it is correctly positioned on the heatbed.","0C00_403E":"The high-precision nozzle offset calibration has failed, possibly due to a damaged pattern or the similarity of the colors of the two selected filaments. Please clear the printed pattern and replac...","0C00_4041":"Toolhead camera calibration failed. Please ensure the Calibration Marker on the heatbed or Height Calibration Marker on the homing area is clean and undamaged, then re-run the calibration process.","0C00_8001":"First layer defects were detected. If the defects are acceptable, select 'Resume' to resume the print job.","0C00_8005":"Purged filament has piled up in the waste chute, which may cause a tool head collision.","0C00_8009":"Build plate localization marker was not found.","0C00_800B":"The heatbed marker was not detected. Please clear all objects and remove the mat. Make sure the marker is not obstructed.","0C00_8015":"Objects detected on the platform; please clean them up in a timely manner.","0C00_8016":"The foreign object detection function is not working. You can continue the task or check assistant for solutions.","0C00_8017":"Foreign objects detected on the platform; please clean them up on time.","0C00_8018":"The foreign object detection function is not working. You can continue the task or view the assistant for troubleshooting.","0C00_8033":"Quick-release Lever is not locked. Please push it down to secure.","0C00_8034":"Liveview Camera initialization failed. This print can still continue, but some AI functions will be disabled. If you encounter this issue again after restarting, please contact customer support.","0C00_803F":"AI detected nozzle clumping. Please check the nozzle condition. Refer to assistant for solutions.","0C00_8040":"AI detected air-printing defect. Please check the hotend extrusion status. Refer to assistant for solutions.","0C00_8042":"The AI print monitor has detected a spaghetti defect. Please check the print and take the necessary action.","0C00_8043":"AI detected nozzle clumping. Please check the nozzle condition. Refer to assistant for solutions.","0C00_C003":"Possible defects were detected in the first layer.","0C00_C004":"Possible spaghetti failure was detected.","0C00_C006":"Purged filament may have piled up in the waste chute.","1000_C001":"High bed temperature may lead to filament clogging in the nozzle. You may open the chamber door.","1000_C002":"Printing CF material with stainless steel may cause nozzle damage.","1000_C003":"Enabling Timelapse in traditional mode may cause defects; please activate this feature as needed.","1001_4001":"Timelapse is not supported as Spiral Vase mode is enabled in slicing presets.","1001_4002":"Timelapse is not supported as the Print sequence is set to 'By object'.","1001_8003":"The time-lapse mode is set to Traditional in the slicing file. This may cause surface defects. Would you like to enable it?","1001_8004":"Prime Tower is not enabled and time-lapse mode is set to Smooth in slicing file. This may cause surface defects. Would you like to enable it?","1200_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1200_8001":"Cutting the filament failed. Please check to see if the cutter is stuck. Refer to the Assistant for solutions.","1200_8002":"The cutter is stuck. Please pull out the cutter handle.","1200_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1200_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1200_8005":"The filament is not inserted. Please insert the filament.","1200_8006":"Unable to feed filament into the extruder. This could be due to tangled filament or a stuck spool. If not, please check if the AMS PTFE tube is connected.","1200_8007":"Failed to extrude the filament. This might be caused by clogged extruder or stuck filament. Refer to the Assistant for solutions.","1200_8010":"Filament or spool may be stuck.","1200_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1200_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1200_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1200_8014":"The filament location in the toolhead was not found. Refer to the Assistant for solutions.","1200_8015":"Failed to pull out the filament from the toolhead. Please check if the filament is stuck, or if it is broken inside the extruder or PTFE tube.","1200_8016":"The extruder is not extruding normally. Refer to the Assistant for troubleshooting. There may be defects in this layer, but you may resume if the defects are acceptable.","1201_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1201_8001":"Failed to cut the filament. Please check the cutter.","1201_8002":"The cutter is stuck. Please pull out the cutter handle.","1201_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1201_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1201_8005":"Failed to feed the filament. Please load the filament and then select 'Retry'.","1201_8006":"Failed to feed the filament into the toolhead. Please check whether the filament is stuck.","1201_8007":"Failed to extrude the filament. The extruder may be clogged or the filament may be stuck; please refer to HMS.","1201_8010":"Please check if the spool or filament is stuck.","1201_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1201_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1201_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1201_8014":"Failed to check the filament location in the tool head; please refer to the HMS.","1201_8015":"Failed to pull back the filament from the toolhead. Please check if the filament is stuck or the filament is broken inside the extruder.","1201_8016":"The extruder is not extruding normally; please refer to the HMS. After trouble shooting, if the defects are acceptable, please resume printing.","1202_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1202_8001":"Failed to cut the filament. Please check the cutter.","1202_8002":"The cutter is stuck. Please pull out the cutter handle.","1202_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1202_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1202_8005":"The filament is not inserted. Please insert the filament.","1202_8006":"Failed to feed the filament into the toolhead. Please check whether the filament is stuck.","1202_8007":"Failed to extrude the filament. The extruder may be clogged or the filament may be stuck; please refer to HMS.","1202_8010":"Please check if the spool or filament is stuck.","1202_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1202_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1202_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1202_8014":"Failed to check the filament location in the tool head; please refer to the HMS.","1202_8015":"Failed to pull back the filament from the toolhead. Please check if the filament is stuck or is broken inside the extruder.","1202_8016":"The extruder is not extruding normally; please refer to the HMS. After trouble shooting, if the defects are acceptable, please resume printing.","1203_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1203_8001":"Failed to cut the filament. Please check the cutter.","1203_8002":"The cutter is stuck. Please pull out the cutter handle.","1203_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1203_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1203_8005":"The filament is not inserted. Please insert the filament.","1203_8006":"Failed to feed the filament into the toolhead. Please check whether the filament is stuck.","1203_8007":"Failed to extrude the filament. The extruder may be clogged or the filament may be stuck; please refer to HMS.","1203_8010":"Please check if the spool or filament is stuck.","1203_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1203_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1203_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1203_8014":"Failed to check the filament location in the tool head; please refer to the HMS.","1203_8015":"Failed to pull back the filament from the toolhead. Please check if the filament is stuck or is broken inside the extruder.","1203_8016":"The extruder is not extruding normally; please refer to the HMS. After trouble shooting, if the defects are acceptable, please resume printing.","12FF_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","12FF_8001":"Failed to cut the filament. Please check the cutter.","12FF_8002":"The cutter is stuck. Please pull out the cutter handle.","12FF_8003":"Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube if you are about to us...","12FF_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","12FF_8005":"The filament is not inserted. Please insert the filament.","12FF_8006":"Please feed filament into the PTFE tube until it can not be pushed any farther.","12FF_8007":"Check nozzle. Select 'Done' if filament was extruded, otherwise push filament forward slightly and select 'Retry.'","12FF_8010":"Please check if the filament or the spool is stuck.","12FF_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","12FF_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","12FF_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","12FF_C003":"Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder or PTFE Tube. (Connect a PTFE tube if you are about to us...","12FF_C006":"Please feed filament into the PTFE tube until it can not be pushed any farther.","1800_4025":"Failed to read the filament information.","1800_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1800_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1800_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1800_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1800_8007":"Extruding filament failed. The extruder might be clogged.","1800_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT A to the extruder is properly connected.","1800_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1800_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1800_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1800_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1800_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1800_8017":"AMS-HT A is drying. Please stop drying process before loading/unloading material.","1800_8021":"AMS setup failed; please refer to the assistant.","1800_8023":"AMS-HT A cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1800_C069":"An error occurred during AMS-HT A drying. Please go to Assistant for more details.","1800_C06A":"AMS-HT A is reading RFID. Unable to start drying. Please try again later.","1800_C06B":"AMS-HT A is changing filament. Unable to start drying. Please try again later.","1800_C06C":"AMS-HT A is in Feed Assist Mode. Unable to start drying. Please try again later.","1800_C06D":"AMS-HT A is assisting in filament insertion. Unable to start drying. Please try again later.","1800_C06E":"AMS-HT A motor is performing self-test. Unable to start drying. Please try again later.","1801_4025":"Failed to read the filament information.","1801_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1801_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1801_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1801_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1801_8007":"Extruding filament failed. The extruder might be clogged.","1801_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT B to the extruder is properly connected.","1801_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1801_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1801_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1801_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1801_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1801_8017":"AMS-HT B is drying. Please stop drying process before loading/unloading material.","1801_8021":"AMS setup failed; please refer to the assistant.","1801_8023":"AMS-HT B cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1801_C069":"An error occurred during AMS-HT B drying. Please go to Assistant for more details.","1801_C06A":"AMS-HT B is reading RFID. Unable to start drying. Please try again later.","1801_C06B":"AMS-HT B is changing filament. Unable to start drying. Please try again later.","1801_C06C":"AMS-HT B is in Feed Assist Mode. Unable to start drying. Please try again later.","1801_C06D":"AMS-HT B is assisting in filament insertion. Unable to start drying. Please try again later.","1801_C06E":"AMS-HT B motor is performing self-test. Unable to start drying. Please try again later.","1802_4025":"Failed to read the filament information.","1802_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1802_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1802_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1802_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1802_8007":"Extruding filament failed. The extruder might be clogged.","1802_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT C to the extruder is properly connected.","1802_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1802_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1802_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1802_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1802_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1802_8017":"AMS-HT C is drying. Please stop drying process before loading/unloading material.","1802_8021":"AMS setup failed; please refer to the assistant.","1802_8023":"AMS-HT C cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1802_C069":"An error occurred during AMS-HT C drying. Please go to Assistant for more details.","1802_C06A":"AMS-HT C is reading RFID. Unable to start drying. Please try again later.","1802_C06B":"AMS-HT C is changing filament. Unable to start drying. Please try again later.","1802_C06C":"AMS-HT C is in Feed Assist Mode. Unable to start drying. Please try again later.","1802_C06D":"AMS-HT C is assisting in filament insertion. Unable to start drying. Please try again later.","1802_C06E":"AMS-HT C motor is performing self-test. Unable to start drying. Please try again later.","1803_4025":"Failed to read the filament information.","1803_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1803_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1803_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1803_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1803_8007":"Extruding filament failed. The extruder might be clogged.","1803_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT D to the extruder is properly connected.","1803_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1803_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1803_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1803_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1803_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1803_8017":"AMS-HT D is drying. Please stop drying process before loading/unloading material.","1803_8021":"AMS setup failed; please refer to the assistant.","1803_8023":"AMS-HT D cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1803_C069":"An error occurred during AMS-HT D drying. Please go to Assistant for more details.","1803_C06A":"AMS-HT D is reading RFID. Unable to start drying. Please try again later.","1803_C06B":"AMS-HT D is changing filament. Unable to start drying. Please try again later.","1803_C06C":"AMS-HT D is in Feed Assist Mode. Unable to start drying. Please try again later.","1803_C06D":"AMS-HT D is assisting in filament insertion. Unable to start drying. Please try again later.","1803_C06E":"AMS-HT D motor is performing self-test. Unable to start drying. Please try again later.","1804_4025":"Failed to read the filament information.","1804_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1804_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1804_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1804_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1804_8007":"Extruding filament failed. The extruder might be clogged.","1804_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT E to the extruder is properly connected.","1804_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1804_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1804_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1804_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1804_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1804_8021":"AMS setup failed; please refer to the assistant.","1804_8023":"AMS-HT E cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1804_C069":"An error occurred during AMS-HT E drying. Please go to Assistant for more details.","1804_C06A":"AMS-HT E is reading RFID. Unable to start drying. Please try again later.","1804_C06B":"AMS-HT E is changing filament. Unable to start drying. Please try again later.","1804_C06C":"AMS-HT E is in Feed Assist Mode. Unable to start drying. Please try again later.","1804_C06D":"AMS-HT E is assisting in filament insertion. Unable to start drying. Please try again later.","1804_C06E":"AMS-HT E motor is performing self-test. Unable to start drying. Please try again later.","1805_4025":"Failed to read the filament information.","1805_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1805_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1805_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1805_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1805_8007":"Extruding filament failed. The extruder might be clogged.","1805_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT F to the extruder is properly connected.","1805_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1805_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1805_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1805_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1805_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1805_8021":"AMS setup failed; please refer to the assistant.","1805_8023":"AMS-HT F cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1805_C069":"An error occurred during AMS-HT F drying. Please go to Assistant for more details.","1805_C06A":"AMS-HT F is reading RFID. Unable to start drying. Please try again later.","1805_C06B":"AMS-HT F is changing filament. Unable to start drying. Please try again later.","1805_C06C":"AMS-HT F is in Feed Assist Mode. Unable to start drying. Please try again later.","1805_C06D":"AMS-HT F is assisting in filament insertion. Unable to start drying. Please try again later.","1805_C06E":"AMS-HT F motor is performing self-test. Unable to start drying. Please try again later.","1806_4025":"Failed to read the filament information.","1806_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1806_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1806_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1806_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1806_8007":"Extruding filament failed. The extruder might be clogged.","1806_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT G to the extruder is properly connected.","1806_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1806_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1806_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1806_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1806_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1806_8021":"AMS setup failed; please refer to the assistant.","1806_8023":"AMS-HT G cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1806_C069":"An error occurred during AMS-HT G drying. Please go to Assistant for more details.","1806_C06A":"AMS-HT G is reading RFID. Unable to start drying. Please try again later.","1806_C06B":"AMS-HT G is changing filament. Unable to start drying. Please try again later.","1806_C06C":"AMS-HT G is in Feed Assist Mode. Unable to start drying. Please try again later.","1806_C06D":"AMS-HT G is assisting in filament insertion. Unable to start drying. Please try again later.","1806_C06E":"AMS-HT G motor is performing self-test. Unable to start drying. Please try again later.","1807_4025":"Failed to read the filament information.","1807_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1807_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1807_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1807_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1807_8007":"Extruding filament failed. The extruder might be clogged.","1807_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT H to the extruder is properly connected.","1807_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1807_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1807_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1807_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1807_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1807_8021":"AMS setup failed; please refer to the assistant.","1807_8023":"AMS-HT H cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1807_C069":"An error occurred during AMS-HT H drying. Please go to Assistant for more details.","1807_C06A":"AMS-HT H is reading RFID. Unable to start drying. Please try again later.","1807_C06B":"AMS-HT H is changing filament. Unable to start drying. Please try again later.","1807_C06C":"AMS-HT H is in Feed Assist Mode. Unable to start drying. Please try again later.","1807_C06D":"AMS-HT H is assisting in filament insertion. Unable to start drying. Please try again later.","1807_C06E":"AMS-HT H motor is performing self-test. Unable to start drying. Please try again later.","18FE_8001":"Failed to cut the filament of the left extruder. Please check the cutter.","18FE_8002":"The cutter of the left extruder is stuck. Please pull out the cutter handle.","18FE_8003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are ab...","18FE_8004":"Failed to pull back the filament from the left extruder. Please check whether the filament is stuck inside the extruder.","18FE_8005":"Failed to feed the filament outside the AMS-HT. Please clip the end of the filament flat and check to see if the spool is stuck.","18FE_8006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","18FE_8007":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","18FE_8011":"The external filament connected to the left extruder has run out; please load a new filament.","18FE_8012":"Failed to get mapping table; please select 'Resume' to retry.","18FE_8013":"Timeout purging old filament of the left extruder: Please check if the filament is stuck or the extruder is clogged.","18FE_8020":"Extruder change failed; please refer to the assistant.","18FE_8021":"AMS setup failed; please refer to the assistant.","18FE_8024":"Extruder position calibration failed; please refer to the assistant.","18FE_C003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","18FE_C006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","18FE_C008":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","18FE_C009":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","18FE_C00A":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'.","18FF_8001":"Failed to cut the filament of the right extruder. Please check the cutter.","18FF_8002":"The cutter of the right extruder is stuck. Please pull out the cutter handle.","18FF_8003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are a...","18FF_8004":"Failed to pull back the filament from the right extruder. Please check whether the filament is stuck inside the extruder.","18FF_8005":"Failed to feed the filament outside the AMS-HT. Please clip the end of the filament flat and check to see if the spool is stuck.","18FF_8006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","18FF_8007":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","18FF_8011":"The external filament connected to the right extruder has run out; please load a new filament.","18FF_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","18FF_8013":"Timeout purging old filament of the right extruder: Please check if the filament is stuck or the extruder is clogged.","18FF_8020":"Extruder change failed; please refer to the assistant.","18FF_8021":"AMS setup failed; please refer to the assistant.","18FF_8024":"Extruder position calibration failed; please refer to the assistant.","18FF_C003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","18FF_C006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","18FF_C008":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","18FF_C009":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","18FF_C00A":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'."};function cAe(t){switch(t){case 1:return{label:"Fatal",color:"text-red-500",bgColor:"bg-red-500/20",Icon:Cn};case 2:return{label:"Serious",color:"text-red-400",bgColor:"bg-red-500/15",Icon:Cn};case 3:return{label:"Warning",color:"text-orange-400",bgColor:"bg-orange-500/20",Icon:Hi};default:return{label:"Info",color:"text-blue-400",bgColor:"bg-blue-500/20",Icon:Js}}}function MD(t,e){const n=t>>16&65535||(t>>8&255)<<8|t&255,r=e&65535;return`${n.toString(16).padStart(4,"0").toUpperCase()}_${r.toString(16).padStart(4,"0").toUpperCase()}`}function uAe(t){return t.filter(e=>{const n=parseInt(e.code.replace("0x",""),16)||0,r=MD(e.attr,n);return CD[r]!==void 0})}function dAe(){return"https://wiki.bambulab.com/en/hms/home"}function hAe({printerName:t,errors:e,onClose:n,printerId:r,hasPermission:i}){const{t:s}=Vt(),{showToast:o}=hn(),l=ot({mutationFn:()=>re.clearHMSErrors(r),onSuccess:()=>{o(s("hmsErrors.clearSuccess"),"success"),n()},onError:()=>{o(s("hmsErrors.clearFailed"),"error")}}),c=e.filter(u=>{const d=parseInt(u.code.replace("0x",""),16)||0,h=MD(u.attr,d);return CD[h]!==void 0});return w.useEffect(()=>{const u=d=>{d.key==="Escape"&&n()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[n]),a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-bambu-dark-secondary rounded-lg shadow-xl max-w-lg w-full max-h-[80vh] flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-bambu-dark-tertiary",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{className:"w-5 h-5 text-orange-400"}),a.jsx("h2",{className:"text-lg font-semibold text-white",children:s("hmsErrors.title",{name:t})})]}),a.jsx("button",{onClick:n,className:"p-1 hover:bg-bambu-dark-tertiary rounded-lg transition-colors",children:a.jsx(Ft,{className:"w-5 h-5 text-bambu-gray"})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.length===0?a.jsxs("div",{className:"text-center py-8 text-bambu-gray",children:[a.jsx(Hi,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),a.jsx("p",{children:s("hmsErrors.noErrors")})]}):a.jsx("div",{className:"space-y-3",children:c.map((u,d)=>{const{label:h,color:f,bgColor:p,Icon:x}=cAe(u.severity),v=parseInt(u.code.replace("0x",""),16)||0,b=MD(u.attr,v),y=CD[b],S=dAe(),N=b.replace("_","-");return a.jsx("div",{className:`p-4 rounded-lg ${p} border border-white/10`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(x,{className:`w-5 h-5 ${f} flex-shrink-0 mt-0.5`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsxs("span",{className:`font-mono text-sm ${f}`,children:["[",N,"]"]}),a.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${p} ${f}`,children:h})]}),a.jsx("p",{className:"text-sm text-bambu-gray mb-2",children:y}),a.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-bambu-green hover:underline",children:[a.jsx(Kr,{className:"w-3 h-3"}),s("hmsErrors.viewOnWiki")]})]})]})},`${u.code}-${d}`)})})}),a.jsxs("div",{className:"p-4 border-t border-bambu-dark-tertiary flex items-center justify-between gap-3",children:[a.jsx("p",{className:"text-xs text-bambu-gray",children:s("hmsErrors.clearInstructions")}),c.length>0&&a.jsxs("button",{onClick:()=>l.mutate(),disabled:!i("printers:control")||l.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg bg-red-500/20 text-red-400 hover:bg-red-500/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0",children:[l.isPending?a.jsx(it,{className:"w-4 h-4 animate-spin"}):a.jsx(Jt,{className:"w-4 h-4"}),s("hmsErrors.clearErrors")]})]})]})})}function mAe(t){if(!t)return"ASAP";const e=Zi(t);if(!e)return"ASAP";const n=new Date,r=e.getTime()-n.getTime();return r<0?"Now":r<6e4?"In <1 min":r<36e5?`In ${Math.round(r/6e4)} min`:r<864e5?`In ${Math.round(r/36e5)}h`:e.toLocaleDateString()}function fAe({printerId:t,printerState:e}){const{t:n}=Vt(),r=tn(),{showToast:i}=hn(),{hasPermission:s}=Ir(),{data:o}=Ze({queryKey:["queue",t,"pending"],queryFn:()=>re.getQueue(t,"pending"),refetchInterval:3e4}),l=ot({mutationFn:()=>re.clearPlate(t),onSuccess:()=>{r.invalidateQueries({queryKey:["queue",t]}),r.invalidateQueries({queryKey:["printerStatus",t]}),i(n("queue.clearPlateSuccess"),"success")},onError:h=>{i(h.message,"error")}}),c=o?.[0],u=o?.length||0;return u===0?null:e==="FINISH"||e==="FAILED"?a.jsxs("div",{className:"mb-3 p-3 bg-bambu-dark rounded-lg border border-yellow-400/30",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(ii,{className:"w-5 h-5 text-yellow-400 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-xs text-bambu-gray",children:n("queue.nextInQueue")}),a.jsx("p",{className:"text-sm text-white truncate",children:c?.archive_name||c?.library_file_name||`File #${c?.archive_id||c?.library_file_id}`})]}),u>1&&a.jsxs("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-400/20 text-yellow-400 rounded flex-shrink-0",children:["+",u-1]})]}),l.isSuccess?a.jsxs("div",{className:"w-full py-2 px-3 rounded-lg bg-bambu-green/10 border border-bambu-green/20 text-bambu-green text-sm flex items-center justify-center gap-2",children:[a.jsx(fb,{className:"w-4 h-4"}),n("queue.plateReady")]}):a.jsxs("button",{onClick:()=>l.mutate(),disabled:l.isPending||!s("printers:control"),className:"w-full py-2 px-3 rounded-lg bg-bambu-green/20 border border-bambu-green/40 text-bambu-green hover:bg-bambu-green/30 transition-colors text-sm font-medium flex items-center justify-center gap-2 disabled:opacity-50",children:[l.isPending?a.jsx(it,{className:"w-4 h-4 animate-spin"}):a.jsx(fb,{className:"w-4 h-4"}),n("queue.clearPlate")]})]}):a.jsx(Xs,{to:"/queue",className:"block mb-3 p-3 bg-bambu-dark rounded-lg hover:bg-bambu-dark-tertiary transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[a.jsx(ii,{className:"w-5 h-5 text-yellow-400 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-xs text-bambu-gray",children:n("queue.nextInQueue")}),a.jsx("p",{className:"text-sm text-white truncate",children:c?.archive_name||c?.library_file_name||`File #${c?.archive_id||c?.library_file_id}`})]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a.jsxs("span",{className:"text-xs text-bambu-gray flex items-center gap-1",children:[a.jsx(Wn,{className:"w-3 h-3"}),mAe(c?.scheduled_time||null)]}),u>1&&a.jsxs("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-400/20 text-yellow-400 rounded",children:["+",u-1]}),a.jsx(pa,{className:"w-4 h-4 text-bambu-gray"})]})]})})}function ZY(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{var{children:n,width:r,height:i,viewBox:s,className:o,style:l,title:c,desc:u}=t,d=vAe(t,yAe),h=s||{width:r,height:i,x:0,y:0},f=or("recharts-surface",o);return w.createElement("svg",AD({},is(d),{className:f,width:r,height:i,style:l,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height),ref:e}),w.createElement("title",null,c),w.createElement("desc",null,u),n)}),_Ae=["children","className"];function TD(){return TD=Object.assign?Object.assign.bind():function(t){for(var e=1;e{var{children:n,className:r}=t,i=SAe(t,_Ae),s=or("recharts-layer",r);return w.createElement("g",TD({className:s},is(i),{ref:e}),n)}),tQ=w.createContext(null),kAe=()=>w.useContext(tQ);function Wr(t){return function(){return t}}const nQ=Math.cos,W1=Math.sin,nc=Math.sqrt,K1=Math.PI,NC=2*K1,ED=Math.PI,PD=2*ED,Km=1e-6,CAe=PD-Km;function rQ(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rQ;const n=10**e;return function(r){this._+=r[0];for(let i=1,s=r.length;iKm)if(!(Math.abs(h*c-u*d)>Km)||!s)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-o,x=i-l,v=c*c+u*u,b=p*p+x*x,y=Math.sqrt(v),S=Math.sqrt(f),N=s*Math.tan((ED-Math.acos((v+f-b)/(2*y*S)))/2),A=N/S,C=N/y;Math.abs(A-1)>Km&&this._append`L${e+A*d},${n+A*h}`,this._append`A${s},${s},0,0,${+(h*p>d*x)},${this._x1=e+C*c},${this._y1=n+C*u}`}}arc(e,n,r,i,s,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=e+l,d=n+c,h=1^o,f=o?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Km||Math.abs(this._y1-d)>Km)&&this._append`L${u},${d}`,r&&(f<0&&(f=f%PD+PD),f>CAe?this._append`A${r},${r},0,1,${h},${e-l},${n-c}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:f>Km&&this._append`A${r},${r},0,${+(f>=ED)},${h},${this._x1=e+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function _L(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new AAe(e)}function SL(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function iQ(t){this._context=t}iQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function kC(t){return new iQ(t)}function aQ(t){return t[0]}function sQ(t){return t[1]}function oQ(t,e){var n=Wr(!0),r=null,i=kC,s=null,o=_L(l);t=typeof t=="function"?t:t===void 0?aQ:Wr(t),e=typeof e=="function"?e:e===void 0?sQ:Wr(e);function l(c){var u,d=(c=SL(c)).length,h,f=!1,p;for(r==null&&(s=i(p=o())),u=0;u<=d;++u)!(u=p;--x)l.point(N[x],A[x]);l.lineEnd(),l.areaEnd()}y&&(N[f]=+t(b,f,h),A[f]=+e(b,f,h),l.point(r?+r(b,f,h):N[f],n?+n(b,f,h):A[f]))}if(S)return l=null,S+""||null}function d(){return oQ().defined(i).curve(o).context(s)}return u.x=function(h){return arguments.length?(t=typeof h=="function"?h:Wr(+h),r=null,u):t},u.x0=function(h){return arguments.length?(t=typeof h=="function"?h:Wr(+h),u):t},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Wr(+h),u):r},u.y=function(h){return arguments.length?(e=typeof h=="function"?h:Wr(+h),n=null,u):e},u.y0=function(h){return arguments.length?(e=typeof h=="function"?h:Wr(+h),u):e},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Wr(+h),u):n},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(n)},u.lineX1=function(){return d().x(r).y(e)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:Wr(!!h),u):i},u.curve=function(h){return arguments.length?(o=h,s!=null&&(l=o(s)),u):o},u.context=function(h){return arguments.length?(h==null?s=l=null:l=o(s=h),u):s},u}class lQ{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function TAe(t){return new lQ(t,!0)}function EAe(t){return new lQ(t,!1)}const NL={draw(t,e){const n=nc(e/K1);t.moveTo(n,0),t.arc(0,0,n,0,NC)}},PAe={draw(t,e){const n=nc(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},cQ=nc(1/3),jAe=cQ*2,DAe={draw(t,e){const n=nc(e/jAe),r=n*cQ;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},RAe={draw(t,e){const n=nc(e),r=-n/2;t.rect(r,r,n,n)}},FAe=.8908130915292852,uQ=W1(K1/10)/W1(7*K1/10),LAe=W1(NC/10)*uQ,OAe=-nQ(NC/10)*uQ,IAe={draw(t,e){const n=nc(e*FAe),r=LAe*n,i=OAe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let s=1;s<5;++s){const o=NC*s/5,l=nQ(o),c=W1(o);t.lineTo(c*n,-l*n),t.lineTo(l*r-c*i,c*r+l*i)}t.closePath()}},_2=nc(3),zAe={draw(t,e){const n=-nc(e/(_2*3));t.moveTo(0,n*2),t.lineTo(-_2*n,-n),t.lineTo(_2*n,-n),t.closePath()}},Xo=-.5,Yo=nc(3)/2,jD=1/nc(12),UAe=(jD/2+1)*3,BAe={draw(t,e){const n=nc(e/UAe),r=n/2,i=n*jD,s=r,o=n*jD+n,l=-s,c=o;t.moveTo(r,i),t.lineTo(s,o),t.lineTo(l,c),t.lineTo(Xo*r-Yo*i,Yo*r+Xo*i),t.lineTo(Xo*s-Yo*o,Yo*s+Xo*o),t.lineTo(Xo*l-Yo*c,Yo*l+Xo*c),t.lineTo(Xo*r+Yo*i,Xo*i-Yo*r),t.lineTo(Xo*s+Yo*o,Xo*o-Yo*s),t.lineTo(Xo*l+Yo*c,Xo*c-Yo*l),t.closePath()}};function HAe(t,e){let n=null,r=_L(i);t=typeof t=="function"?t:Wr(t||NL),e=typeof e=="function"?e:Wr(e===void 0?64:+e);function i(){let s;if(n||(n=s=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Wr(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Wr(+s),i):e},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function X1(){}function Y1(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function dQ(t){this._context=t}dQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Y1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Y1(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function $Ae(t){return new dQ(t)}function hQ(t){this._context=t}hQ.prototype={areaStart:X1,areaEnd:X1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Y1(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function VAe(t){return new hQ(t)}function mQ(t){this._context=t}mQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Y1(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function GAe(t){return new mQ(t)}function fQ(t){this._context=t}fQ.prototype={areaStart:X1,areaEnd:X1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function qAe(t){return new fQ(t)}function e$(t){return t<0?-1:1}function t$(t,e,n){var r=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),l=(s*i+o*r)/(r+i);return(e$(s)+e$(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function n$(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function S2(t,e,n){var r=t._x0,i=t._y0,s=t._x1,o=t._y1,l=(s-r)/3;t._context.bezierCurveTo(r+l,i+l*e,s-l,o-l*n,s,o)}function Q1(t){this._context=t}Q1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:S2(this,this._t0,n$(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,S2(this,n$(this,n=t$(this,t,e)),n);break;default:S2(this,this._t0,n=t$(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function pQ(t){this._context=new gQ(t)}(pQ.prototype=Object.create(Q1.prototype)).point=function(t,e){Q1.prototype.point.call(this,e,t)};function gQ(t){this._context=t}gQ.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,s){this._context.bezierCurveTo(e,t,r,n,s,i)}};function WAe(t){return new Q1(t)}function KAe(t){return new pQ(t)}function bQ(t){this._context=t}bQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=r$(t),i=r$(e),s=0,o=1;o=0;--e)i[e]=(o[e]-i[e+1])/s[e];for(s[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function YAe(t){return new CC(t,.5)}function QAe(t){return new CC(t,0)}function ZAe(t){return new CC(t,1)}function $f(t,e){if((o=t.length)>1)for(var n=1,r,i,s=t[e[0]],o,l=s.length;n=0;)n[e]=e;return n}function JAe(t,e){return t[e]}function eTe(t){const e=[];return e.key=t,e}function tTe(){var t=Wr([]),e=DD,n=$f,r=JAe;function i(s){var o=Array.from(t.apply(this,arguments),eTe),l,c=o.length,u=-1,d;for(const h of s)for(l=0,++u;l0){for(var n,r,i=0,s=t[0].length,o;i0){for(var n=0,r=t[e[0]],i,s=r.length;n0)||!((s=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,s,o;r1&&arguments[1]!==void 0?arguments[1]:cTe,n=10**e,r=Math.round(t*n)/n;return Object.is(r,-0)?0:r}function Ti(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{var l=n[o-1];return typeof l=="string"?i+l+s:l!==void 0?i+kh(l)+s:i+s},"")}var La=t=>t===0?0:t>0?1:-1,Ql=t=>typeof t=="number"&&t!=+t,Gf=t=>typeof t=="string"&&t.indexOf("%")===t.length-1,$t=t=>(typeof t=="number"||t instanceof Number)&&!Ql(t),vl=t=>$t(t)||typeof t=="string",uTe=0,O0=t=>{var e=++uTe;return"".concat(t||"").concat(e)},ys=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!$t(e)&&typeof e!="string")return r;var s;if(Gf(e)){if(n==null)return r;var o=e.indexOf("%");s=n*parseFloat(e.slice(0,o))/100}else s=+e;return Ql(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},yQ=t=>{if(!Array.isArray(t))return!1;for(var e=t.length,n={},r=0;rr&&(typeof e=="function"?e(r):Vf(r,e))===n)}var hi=t=>t===null||typeof t>"u",Sv=t=>hi(t)?t:"".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));function eo(t){return t!=null}function rm(){}var dTe=["type","size","sizeType"];function RD(){return RD=Object.assign?Object.assign.bind():function(t){for(var e=1;e{var e="symbol".concat(Sv(t));return wQ[e]||NL},yTe=(t,e,n)=>{if(e==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var r=18*bTe;return 1.25*t*t*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},vTe=(t,e)=>{wQ["symbol".concat(Sv(t))]=e},AL=t=>{var{type:e="circle",size:n=64,sizeType:r="area"}=t,i=pTe(t,dTe),s=h$(h$({},i),{},{type:e,size:n,sizeType:r}),o="circle";typeof e=="string"&&(o=e);var l=()=>{var f=xTe(o),p=HAe().type(f).size(yTe(n,r,o)),x=p();if(x!==null)return x},{className:c,cx:u,cy:d}=s,h=is(s);return $t(u)&&$t(d)&&$t(n)?w.createElement("path",RD({},h,{className:or("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};AL.registerSymbol=vTe;var _Q=t=>"radius"in t&&"startAngle"in t&&"endAngle"in t,TL=(t,e)=>{if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(w.isValidElement(t)&&(n=t.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{vL(i)&&(r[i]=(s=>n[i](n,s)))}),r},wTe=(t,e,n)=>r=>(t(e,n,r),null),Nv=(t,e,n)=>{if(t===null||typeof t!="object"&&typeof t!="function")return null;var r=null;return Object.keys(t).forEach(i=>{var s=t[i];vL(i)&&typeof s=="function"&&(r||(r={}),r[i]=wTe(s,e,n))}),r};function m$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _Te(t){for(var e=1;e(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return s}function Z1(){return Z1=Object.assign?Object.assign.bind():function(t){for(var e=1;el({id:x.id,name:x.name}),disabled:p.isPending||(d?.layer_num??0)<=1||!s("printers:control"),className:`px-4 py-2 text-xs font-medium rounded-lg transition-colors ${(d?.layer_num??0)<=1||!s("printers:control")?"bg-gray-100 dark:bg-bambu-dark text-gray-400 dark:text-bambu-gray/50 cursor-not-allowed":"bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-500/30 border border-red-300 dark:border-red-500/30"}`,title:s("printers:control")?(d?.layer_num??0)<=1?r("printers.skipObjects.waitForLayer",{layer:d?.layer_num??0}):r("printers.skipObjects.skip"):r("printers.permission.noControl"),children:r("printers.skipObjects.skip")})]},x.id))})]})]}):a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx(it,{className:"w-5 h-5 animate-spin text-bambu-gray"})})]})]}),o&&a.jsx(vn,{variant:"warning",title:r("printers.skipObjects.confirmTitle"),message:r("printers.skipObjects.confirmMessage",{name:o.name}),confirmText:r("printers.skipObjects.skip"),isLoading:p.isPending,onConfirm:()=>p.mutate([o.id]),onCancel:()=>l(null)}),c&&h&&a.jsxs("div",{className:"fixed inset-0 bg-black/90 flex items-center justify-center z-60",onClick:()=>u(!1),children:[a.jsx("button",{onClick:()=>u(!1),className:"absolute top-4 right-4 p-2 text-white/70 hover:text-white transition-colors",children:a.jsx(Ft,{className:"w-6 h-6"})}),a.jsxs("div",{className:"relative max-w-[600px] max-h-[80vh] aspect-square",onClick:x=>x.stopPropagation(),children:[d?.cover_url?a.jsx("img",{src:`${d.cover_url}?view=top`,alt:r("printers.printPreview"),className:"w-full h-full object-contain rounded-lg bg-gray-900"}):a.jsx("div",{className:"w-full h-full rounded-lg bg-gray-800 flex items-center justify-center",children:a.jsx(ea,{className:"w-16 h-16 text-gray-500"})}),h.objects.length>0&&a.jsx("div",{className:"absolute inset-0 pointer-events-none",children:h.objects.map((x,v)=>{let b,y;if(x.x!=null&&x.y!=null&&h.bbox_all){const[S,N,A,C]=h.bbox_all,T=A-S,k=C-N,j=8,E=100-j*2;b=j+(x.x-S)/T*E,y=j+(C-x.y)/k*E,b=Math.max(5,Math.min(95,b)),y=Math.max(5,Math.min(95,y))}else if(x.x!=null&&x.y!=null)b=x.x/256*100,y=100-x.y/256*100,b=Math.max(5,Math.min(95,b)),y=Math.max(5,Math.min(95,y));else{const S=Math.ceil(Math.sqrt(h.objects.length)),N=Math.floor(v/S),A=v%S,C=Math.ceil(h.objects.length/S);b=15+A*(70/S)+35/S,y=15+N*(70/C)+35/C}return a.jsx("div",{className:`absolute flex items-center justify-center w-6 h-6 rounded-full text-[10px] font-bold shadow-lg ${x.skipped?"bg-red-500 text-white line-through":"bg-bambu-green text-black"}`,style:{left:`${b}%`,top:`${y}%`,transform:"translate(-50%, -50%)"},title:x.name,children:x.id},x.id)})}),a.jsx("div",{className:"absolute bottom-2 right-2 px-2 py-1 bg-white/90 dark:bg-black/80 rounded text-[10px] text-gray-700 dark:text-white shadow-sm",children:r("printers.skipObjects.activeCount",{count:h.objects.filter(x=>!x.skipped).length})})]})]})]}):null}const rAe="embeddedCameraState_",JH=5,iAe=2e3,aAe=3e4,sAe=5e3,w2={x:window.innerWidth-420,y:20,width:400,height:300};function oAe({printerId:t,printerName:e,viewerIndex:n=0,onClose:r}){const{t:i}=Vt(),s=tn(),{showToast:o}=hn(),{hasPermission:l}=Ir(),c=`${rAe}${t}`,u=()=>{try{const Re=localStorage.getItem(c);if(Re){const qe=JSON.parse(Re);return{x:Math.min(Math.max(0,qe.x),window.innerWidth-100),y:Math.min(Math.max(0,qe.y),window.innerHeight-100),width:Math.max(200,Math.min(qe.width,window.innerWidth-20)),height:Math.max(150,Math.min(qe.height,window.innerHeight-20))}}}catch{}const De=n*30;return{...w2,x:Math.max(0,w2.x-De),y:Math.max(0,w2.y+De)}},[d,h]=w.useState(u),[f,p]=w.useState(!1),[x,v]=w.useState(!1),[b,y]=w.useState({x:0,y:0}),[S,N]=w.useState(!1),[A,C]=w.useState(!1),[T,k]=w.useState(1),[j,E]=w.useState({x:0,y:0}),[P,U]=w.useState(!1),[O,B]=w.useState({x:0,y:0}),[R,G]=w.useState(null),[q,z]=w.useState(null),[K,Y]=w.useState(!1),[oe,$]=w.useState(!0),[X,ee]=w.useState(Date.now()),[J,_e]=w.useState(0),[pe,me]=w.useState(!1),[je,de]=w.useState(0),ce=w.useRef(null),Se=w.useRef(null),ie=w.useRef(null),Fe=w.useRef(null),V=w.useRef(null),[W,ue]=w.useState(!1),{data:Q}=Ze({queryKey:["printer",t],queryFn:()=>re.getPrinter(t),enabled:t>0}),{data:se}=Ze({queryKey:["printerStatus",t],queryFn:()=>re.getPrinterStatus(t),refetchInterval:3e4,enabled:t>0}),Z=ot({mutationFn:De=>re.setChamberLight(t,De),onMutate:async De=>{await s.cancelQueries({queryKey:["printerStatus",t]});const Re=s.getQueryData(["printerStatus",t]);return s.setQueryData(["printerStatus",t],qe=>({...qe,chamber_light:De})),{previousStatus:Re}},onSuccess:(De,Re)=>{o(`Chamber light ${Re?"on":"off"}`)},onError:(De,Re,qe)=>{qe?.previousStatus&&s.setQueryData(["printerStatus",t],qe.previousStatus),o(De.message||i("printers.toast.failedToControlChamberLight"),"error")}}),Ne=(se?.state==="RUNNING"||se?.state==="PAUSE"||se?.state==="PAUSED")&&(se?.printable_objects_count??0)>=2;w.useEffect(()=>{const De=setTimeout(()=>{localStorage.setItem(c,JSON.stringify(d))},500);return()=>clearTimeout(De)},[d,c]);const ve=w.useRef(!1);w.useEffect(()=>{ve.current=!1;const De=`/api/v1/printers/${t}/camera/stop`,Re=()=>{if(t>0&&!ve.current){ve.current=!0;const pt={},At=id();At&&(pt.Authorization=`Bearer ${At}`),fetch(De,{method:"POST",keepalive:!0,headers:pt}).catch(()=>{})}},qe=Se.current;return()=>{qe&&(qe.src=""),Re(),ie.current&&clearTimeout(ie.current),Fe.current&&clearInterval(Fe.current),V.current&&clearInterval(V.current)}},[t]),w.useEffect(()=>{if(oe){const De=setTimeout(()=>$(!1),3e3);return()=>clearTimeout(De)}},[oe,X]);const fe=w.useCallback(()=>{if(J>=JH){me(!1),Y(!0);return}const De=Math.min(iAe*Math.pow(2,J),aAe);me(!0),de(Math.ceil(De/1e3)),Fe.current=setInterval(()=>{de(Re=>Re<=1?(Fe.current&&clearInterval(Fe.current),0):Re-1)},1e3),ie.current=setTimeout(()=>{_e(Re=>Re+1),me(!1),$(!0),Y(!1),Se.current&&(Se.current.src=""),ee(Date.now())},De)},[J]);w.useEffect(()=>{if(oe||pe||S){V.current&&(clearInterval(V.current),V.current=null);return}return V.current=setInterval(async()=>{try{const De=await re.getCameraStatus(t);(De.stalled||!De.active&&!K)&&(V.current&&(clearInterval(V.current),V.current=null),$(!1),fe())}catch{}},sAe),()=>{V.current&&(clearInterval(V.current),V.current=null)}},[oe,K,pe,S,t,fe]),w.useEffect(()=>{const De=()=>{const Re=!!document.fullscreenElement;C(Re),Re||(k(1),E({x:0,y:0}))};return document.addEventListener("fullscreenchange",De),()=>document.removeEventListener("fullscreenchange",De)},[]);const L=()=>{ce.current&&(document.fullscreenElement?document.exitFullscreen():ce.current.requestFullscreen())},D=()=>{k(De=>Math.min(De+.5,4))},H=()=>{k(De=>{const Re=Math.max(De-.5,1);return Re===1&&E({x:0,y:0}),Re})},he=De=>{De.preventDefault(),De.deltaY<0?D():H()},xe=De=>{T>1&&(De.preventDefault(),U(!0),B({x:De.clientX-j.x,y:De.clientY-j.y}))},be=w.useCallback(()=>{if(!ce.current||!Se.current)return{x:200,y:150};const De=ce.current.getBoundingClientRect(),Re=De.width*(T-1)/2,qe=De.height*(T-1)/2;return{x:Math.max(50,Re),y:Math.max(50,qe)}},[T]),Ue=De=>{if(P&&T>1){const Re=De.clientX-O.x,qe=De.clientY-O.y,pt=be();E({x:Math.max(-pt.x,Math.min(pt.x,Re)),y:Math.max(-pt.y,Math.min(pt.y,qe))})}},Oe=()=>{U(!1)},Qe=De=>{if(De.length<2)return 0;const Re=De[0].clientX-De[1].clientX,qe=De[0].clientY-De[1].clientY;return Math.sqrt(Re*Re+qe*qe)},rt=De=>De.length<2?{x:De[0].clientX,y:De[0].clientY}:{x:(De[0].clientX+De[1].clientX)/2,y:(De[0].clientY+De[1].clientY)/2},we=De=>{De.touches.length===2?(De.preventDefault(),G(Qe(De.touches)),z(rt(De.touches))):De.touches.length===1&&T>1&&(De.preventDefault(),U(!0),B({x:De.touches[0].clientX-j.x,y:De.touches[0].clientY-j.y}))},ye=De=>{if(De.touches.length===2&&R!==null){De.preventDefault();const Re=Qe(De.touches),qe=Re/R;k(At=>{const Rt=Math.max(1,Math.min(4,At*qe));return Rt===1&&E({x:0,y:0}),Rt}),G(Re);const pt=rt(De.touches);if(q){const At=be();E(Rt=>({x:Math.max(-At.x,Math.min(At.x,Rt.x+(pt.x-q.x))),y:Math.max(-At.y,Math.min(At.y,Rt.y+(pt.y-q.y)))}))}z(pt)}else if(De.touches.length===1&&P&&T>1){De.preventDefault();const Re=De.touches[0].clientX-O.x,qe=De.touches[0].clientY-O.y,pt=be();E({x:Math.max(-pt.x,Math.min(pt.x,Re)),y:Math.max(-pt.y,Math.min(pt.y,qe))})}},le=De=>{De.touches.length<2&&(G(null),z(null)),De.touches.length===0&&U(!1)},Le=()=>{k(1),E({x:0,y:0})},Me=()=>{$(!1),J{$(!1),Y(!1),_e(0),me(!1),ie.current&&clearTimeout(ie.current),Fe.current&&clearInterval(Fe.current)},Ae=()=>{$(!0),Y(!1),_e(0),me(!1),ie.current&&clearTimeout(ie.current),Fe.current&&clearInterval(Fe.current);const De={},Re=id();Re&&(De.Authorization=`Bearer ${Re}`),fetch(`/api/v1/printers/${t}/camera/stop`,{method:"POST",headers:De}).catch(()=>{}),Se.current&&(Se.current.src=""),setTimeout(()=>ee(Date.now()),100)},Je=De=>{De.target.closest(".no-drag")||(p(!0),y({x:De.clientX-d.x,y:De.clientY-d.y}))},Pe=De=>{De.stopPropagation(),v(!0)};w.useEffect(()=>{const De=qe=>{if(f)h(pt=>({...pt,x:Math.max(0,Math.min(qe.clientX-b.x,window.innerWidth-pt.width)),y:Math.max(0,Math.min(qe.clientY-b.y,window.innerHeight-pt.height))}));else if(x&&ce.current){const pt=ce.current.getBoundingClientRect();h(At=>({...At,width:Math.max(200,Math.min(qe.clientX-pt.left,window.innerWidth-At.x-10)),height:Math.max(150,Math.min(qe.clientY-pt.top,window.innerHeight-At.y-10))}))}},Re=()=>{p(!1),v(!1)};if(f||x)return document.addEventListener("mousemove",De),document.addEventListener("mouseup",Re),()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",Re)}},[f,x,b]);const Xe=`/api/v1/printers/${t}/camera/stream?fps=15&t=${X}`;return a.jsxs("div",{ref:ce,className:`${A?"fixed inset-0 z-[100]":"fixed z-50 rounded-lg shadow-2xl border border-bambu-dark-tertiary"} bg-bambu-dark-secondary overflow-hidden`,style:A?void 0:{left:d.x,top:d.y,width:S?200:d.width,height:S?40:d.height,cursor:f?"grabbing":"default"},children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-bambu-dark border-b border-bambu-dark-tertiary cursor-grab active:cursor-grabbing",onMouseDown:Je,children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-white truncate",children:[a.jsx(Dh,{className:"w-4 h-4 text-bambu-gray flex-shrink-0"}),a.jsx("span",{className:"truncate",children:Q?.name||e})]}),a.jsxs("div",{className:"flex items-center gap-1 no-drag",children:[a.jsx("button",{onClick:()=>Z.mutate(!se?.chamber_light),disabled:!se?.connected||Z.isPending||!l("printers:control"),className:`p-1 rounded disabled:opacity-50 ${se?.chamber_light?"bg-yellow-500/20 hover:bg-yellow-500/30":"hover:bg-bambu-dark-tertiary"}`,title:l("printers:control")?i("camera.chamberLight"):i("printers.permission.noControl"),children:a.jsx(xL,{on:se?.chamber_light??!1,className:"w-3.5 h-3.5"})}),a.jsx("button",{onClick:()=>ue(!0),disabled:!Ne||!l("printers:control"),className:`p-1 rounded disabled:opacity-50 ${Ne&&l("printers:control")?"hover:bg-bambu-dark-tertiary":""}`,title:l("printers:control")?i(Ne?"printers.skipObjects.tooltip":"printers.skipObjects.onlyWhilePrinting"):i("printers.permission.noControl"),children:a.jsx(SC,{className:"w-3.5 h-3.5 text-bambu-gray"})}),a.jsx("button",{onClick:Ae,disabled:oe||pe,className:"p-1 hover:bg-bambu-dark-tertiary rounded disabled:opacity-50",title:"Refresh stream",children:a.jsx(kr,{className:`w-3.5 h-3.5 text-bambu-gray ${oe?"animate-spin":""}`})}),a.jsx("button",{onClick:L,className:"p-1 hover:bg-bambu-dark-tertiary rounded",title:A?"Exit fullscreen":"Fullscreen",children:A?a.jsx(gX,{className:"w-3.5 h-3.5 text-bambu-gray"}):a.jsx(ame,{className:"w-3.5 h-3.5 text-bambu-gray"})}),a.jsx("button",{onClick:()=>N(!S),className:"p-1 hover:bg-bambu-dark-tertiary rounded",title:S?"Expand":"Minimize",children:S?a.jsx(iC,{className:"w-3.5 h-3.5 text-bambu-gray"}):a.jsx(LF,{className:"w-3.5 h-3.5 text-bambu-gray"})}),a.jsx("button",{onClick:r,className:"p-1 hover:bg-red-500/20 rounded",title:"Close",children:a.jsx(Ft,{className:"w-3.5 h-3.5 text-bambu-gray hover:text-red-400"})})]})]}),!S&&a.jsxs("div",{className:"relative w-full bg-black flex items-center justify-center overflow-hidden h-[calc(100%-40px)]",onWheel:he,onMouseMove:Ue,onMouseUp:Oe,onMouseLeave:Oe,onTouchStart:we,onTouchMove:ye,onTouchEnd:le,style:{touchAction:"none"},children:[oe&&!pe&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 z-10",children:a.jsx(kr,{className:"w-6 h-6 text-bambu-gray animate-spin"})}),pe&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80 z-10",children:a.jsxs("div",{className:"text-center p-2",children:[a.jsx(Rf,{className:"w-6 h-6 text-orange-400 mx-auto mb-2"}),a.jsxs("p",{className:"text-xs text-bambu-gray",children:["Reconnecting in ",je,"s..."]})]})}),K&&!pe&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black z-10",children:a.jsxs("div",{className:"text-center p-2",children:[a.jsx(Cn,{className:"w-6 h-6 text-orange-400 mx-auto mb-2"}),a.jsx("p",{className:"text-xs text-bambu-gray mb-2",children:"Camera unavailable"}),a.jsx("button",{onClick:Ae,className:"px-2 py-1 text-xs bg-bambu-green text-white rounded hover:bg-bambu-green/80",children:"Retry"})]})}),a.jsx("img",{ref:Se,src:Xe,alt:"Camera stream",className:"max-w-full max-h-full object-contain select-none",style:{transform:`scale(${T}) translate(${j.x/T}px, ${j.y/T}px)`,cursor:T>1?P?"grabbing":"grab":"default"},onError:Me,onLoad:$e,onMouseDown:xe,draggable:!1},X),a.jsxs("div",{className:"absolute bottom-2 left-2 flex items-center gap-1 bg-black/60 rounded px-1.5 py-1 no-drag",children:[a.jsx("button",{onClick:H,disabled:T<=1,className:"p-1 hover:bg-white/10 rounded disabled:opacity-30",title:"Zoom out",children:a.jsx(HF,{className:"w-3.5 h-3.5 text-white"})}),a.jsxs("button",{onClick:Le,className:"px-1.5 py-0.5 text-xs text-white hover:bg-white/10 rounded min-w-[32px]",title:"Reset zoom",children:[Math.round(T*100),"%"]}),a.jsx("button",{onClick:D,disabled:T>=4,className:"p-1 hover:bg-white/10 rounded disabled:opacity-30",title:"Zoom in",children:a.jsx(BF,{className:"w-3.5 h-3.5 text-white"})})]}),!A&&a.jsx("div",{className:"absolute bottom-0 right-0 w-6 h-6 cursor-se-resize no-drag hover:bg-white/10 rounded-tl transition-colors",onMouseDown:Pe,title:"Drag to resize",children:a.jsx("svg",{className:"w-6 h-6 text-bambu-gray/70 hover:text-bambu-gray",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M22 22H20V20H22V22ZM22 18H20V16H22V18ZM18 22H16V20H18V22ZM22 14H20V12H22V14ZM18 18H16V16H18V18ZM14 22H12V20H14V22ZM22 10H20V8H22V10ZM18 14H16V12H18V14ZM14 18H12V16H14V18ZM10 22H8V20H10V22Z"})})})]}),a.jsx(yL,{printerId:t,isOpen:W,onClose:()=>ue(!1)})]})}function lAe({printerId:t,printerName:e,onClose:n}){const{t:r}=Vt(),i=tn(),[s,o]=w.useState(!0),[l,c]=w.useState(new Set),[u,d]=w.useState(""),[h,f]=w.useState("all"),p=w.useRef(null),{data:x,isLoading:v,refetch:b}=Ze({queryKey:["mqtt-logs",t],queryFn:()=>re.getMQTTLogs(t),refetchInterval:1e3}),y=ot({mutationFn:()=>re.enableMQTTLogging(t),onSuccess:()=>{i.invalidateQueries({queryKey:["mqtt-logs",t]})}}),S=ot({mutationFn:()=>re.disableMQTTLogging(t),onSuccess:()=>{i.invalidateQueries({queryKey:["mqtt-logs",t]})}}),N=ot({mutationFn:()=>re.clearMQTTLogs(t),onSuccess:()=>{i.invalidateQueries({queryKey:["mqtt-logs",t]})}});w.useEffect(()=>{const P=U=>{U.key==="Escape"&&n()};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[n]),w.useEffect(()=>{s&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[x?.logs,s]);const A=P=>{c(U=>{const O=new Set(U);return O.has(P)?O.delete(P):O.add(P),O})},C=P=>new Date(P).toLocaleTimeString("en-US",{hour12:!1,fractionalSecondDigits:3}),T=(P,U)=>{if(P==null)return"";const O=typeof P=="string"?JSON.parse(P):P,B=JSON.stringify(O,null,U?2:0);return!U&&B.length>100?B.substring(0,100)+"...":B},k=x?.logging_enabled??!1,j=w.useMemo(()=>x?.logs??[],[x?.logs]),E=w.useMemo(()=>j.filter(P=>{if(h!=="all"&&P.direction!==h)return!1;if(u.trim()){const U=u.toLowerCase(),O=P.topic.toLowerCase().includes(U),R=JSON.stringify(P.payload).toLowerCase().includes(U);return O||R}return!0}),[j,u,h]);return a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-bambu-dark-secondary rounded-lg max-w-4xl w-full max-h-[85vh] flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-bambu-dark-tertiary",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:r("mqttDebug.title")}),a.jsx("p",{className:"text-sm text-bambu-gray",children:e})]}),a.jsx("button",{onClick:n,className:"text-bambu-gray hover:text-white transition-colors",children:a.jsx(Ft,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"flex flex-col gap-2 p-4 border-b border-bambu-dark-tertiary",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[k?a.jsxs(Ce,{size:"sm",variant:"secondary",onClick:()=>S.mutate(),disabled:S.isPending,children:[a.jsx(bl,{className:"w-4 h-4"}),r("mqttDebug.stopLogging")]}):a.jsxs(Ce,{size:"sm",onClick:()=>y.mutate(),disabled:y.isPending,children:[a.jsx(so,{className:"w-4 h-4"}),r("mqttDebug.startLogging")]}),a.jsxs(Ce,{size:"sm",variant:"secondary",onClick:()=>N.mutate(),disabled:N.isPending||j.length===0,children:[a.jsx(Jt,{className:"w-4 h-4"}),r("mqttDebug.clearLog")]}),a.jsx(Ce,{size:"sm",variant:"secondary",onClick:()=>b(),disabled:v,children:a.jsx(kr,{className:`w-4 h-4 ${v?"animate-spin":""}`})}),a.jsx("div",{className:"flex-1"}),a.jsxs("label",{className:"flex items-center gap-2 text-sm text-bambu-gray cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:s,onChange:P=>o(P.target.checked),className:"rounded border-bambu-dark-tertiary"}),"Auto-scroll"]}),a.jsxs("span",{className:"text-sm text-bambu-gray",children:[E.length,"/",j.length]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Or,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-bambu-gray"}),a.jsx("input",{type:"text",placeholder:r("mqttDebug.searchPlaceholder"),value:u,onChange:P=>d(P.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm bg-bambu-dark border border-bambu-dark-tertiary rounded text-white placeholder-bambu-gray focus:border-bambu-green focus:outline-none"}),u&&a.jsx("button",{onClick:()=>d(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-bambu-gray hover:text-white",children:a.jsx(Ft,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex items-center gap-1 bg-bambu-dark rounded border border-bambu-dark-tertiary",children:[a.jsx("button",{onClick:()=>f("all"),className:`px-2 py-1.5 text-xs rounded-l transition-colors ${h==="all"?"bg-bambu-green text-white":"text-bambu-gray hover:text-white"}`,children:r("mqttDebug.all")}),a.jsxs("button",{onClick:()=>f("in"),className:`px-2 py-1.5 text-xs transition-colors flex items-center gap-1 ${h==="in"?"bg-blue-500 text-white":"text-bambu-gray hover:text-white"}`,children:[a.jsx(hb,{className:"w-3 h-3"}),r("mqttDebug.incoming")]}),a.jsxs("button",{onClick:()=>f("out"),className:`px-2 py-1.5 text-xs rounded-r transition-colors flex items-center gap-1 ${h==="out"?"bg-green-500 text-white":"text-bambu-gray hover:text-white"}`,children:[a.jsx(Pf,{className:"w-3 h-3"}),r("mqttDebug.outgoing")]})]})]})]}),a.jsx("div",{ref:p,className:"flex-1 overflow-auto p-4 font-mono text-xs bg-black min-h-[400px]",children:j.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-bambu-gray",children:[a.jsx("p",{className:"mb-2",children:r("mqttDebug.noMessages")}),!k&&a.jsx("p",{className:"text-sm",children:r("mqttDebug.startLoggingHint")})]}):E.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-bambu-gray",children:[a.jsx("p",{className:"mb-2",children:r("mqttDebug.noMessagesMatch")}),a.jsx("p",{className:"text-sm",children:r("mqttDebug.adjustFilterHint")})]}):a.jsx("div",{className:"space-y-1",children:E.map((P,U)=>{const O=l.has(U),B=P.direction==="in";return a.jsxs("div",{className:`p-2 rounded cursor-pointer hover:bg-bambu-dark-secondary transition-colors ${O?"bg-bambu-dark-secondary":""}`,onClick:()=>A(U),children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-bambu-gray shrink-0",children:C(P.timestamp)}),a.jsx("span",{className:`shrink-0 ${B?"text-blue-400":"text-green-400"}`,title:r(B?"mqttDebug.incoming":"mqttDebug.outgoing"),children:B?a.jsx(hb,{className:"w-3 h-3"}):a.jsx(Pf,{className:"w-3 h-3"})}),a.jsx("span",{className:"text-purple-400 shrink-0",children:P.topic})]}),O?a.jsx("pre",{className:"mt-2 p-3 bg-gray-900 border border-gray-700 rounded text-green-400 overflow-x-auto whitespace-pre-wrap break-all max-h-96 overflow-y-auto text-xs",children:T(P.payload,!0)}):a.jsx("pre",{className:"mt-1 text-white/80 truncate",children:T(P.payload,!1)})]},U)})})}),a.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-bambu-dark-tertiary",children:[a.jsx("div",{className:"text-sm text-bambu-gray",children:k?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),r("mqttDebug.loggingActive")]}):a.jsx("span",{children:r("mqttDebug.loggingStopped")})}),a.jsx(Ce,{variant:"secondary",onClick:n,children:r("common.close")})]})]})})}const CD={"0300_4000":"Z axis homing failed; the task has been stopped.","0300_4001":"The printer timed out waiting for the nozzle to cool down before homing.","0300_4002":"Auto Bed Leveling failed; the task has been stopped.","0300_4005":"The hotend cooling fan speed is abnormal.","0300_4006":"The nozzle is clogged.","0300_4008":"The AMS failed to change filament.","0300_4009":"Homing XY axis failed.","0300_400A":"Mechanical resonance frequency identification failed.","0300_400B":"Internal communication exception","0300_400C":"The task was canceled.","0300_400D":"Resume failed after power loss.","0300_400E":"The motor self-check failed.","0300_400F":"The power supply voltage does not match the printer.","0300_4010":"Nozzle offset calibration failed.","0300_4011":"Flow Dynamics Calibration failed; please reinitiate printing or calibration.","0300_4013":"Printing cannot be initiated while AMS is drying.","0300_4014":"Homing Z axis failed: temperature control abnormality.","0300_4015":"Nozzle clumping detection calibration failed. Please go to 'Assistant' for troubleshooting.","0300_4016":"Nozzle cleaning failed. Please click the Assistant for troubleshooting.","0300_401F":"The hotend is not installed, and the toolhead cannot perform homing. Please install the hotend and then continue.","0300_4020":"The nozzle presence detection failed. Please check the Assistant for details.","0300_4021":"Nozzle offset calibration sensor signal abnormality detected. Please check the sensor and retry.","0300_4042":"The Laser Safety Window is not properly installed. The task has been stopped.","0300_4044":"The Flame Sensor is abnormal. The sensor may be short-circuited. Please troubleshoot the issue before starting a print job.","0300_404B":"Task aborted because the front door or top cover is open.","0300_404D":"The current temperature of the hotend, heatbed, or chamber is too high. Please wait for it to cool down to room temperature before restarting the task.","0300_4050":"Liveview Camera calibration timeout; please restart the printer.","0300_4052":"Blade Z-axis homing failed","0300_4057":"Z-axis step loss detected. The task has stopped. Please check if there are any obstructions beneath the heatbed.","0300_4066":"Calibration of motion precision failed.","0300_4067":"Calibration result is over the threshold.","0300_4068":"Step loss occurred during the motion accuracy enhancement process. Please try again.","0300_8000":"Printing was paused for unknown reason. You can select 'Resume' to resume the print job.","0300_8001":"Printing was paused by the user. You can select 'Resume' to continue printing.","0300_8002":"First layer defects were detected by the Micro Lidar. Please check the quality of the printed model before continuing your print.","0300_8003":"Spaghetti defects were detected by the AI Print Monitoring. Please check the quality of the printed model before continuing your print.","0300_8004":"Filament ran out. Please load new filament.","0300_8005":"Toolhead front cover fell off. Please remount the front cover and check to make sure your print is going okay.","0300_8006":"The build plate marker was not detected. Please confirm the build plate is correctly positioned on the heatbed with all four corners aligned, and the marker is visible.","0300_8007":"There was an unfinished print job when the printer lost power. If the model is still adhered to the build plate, you can try resuming the print job.","0300_8008":"Nozzle temperature malfunction","0300_8009":"Heatbed temperature malfunction","0300_800A":"A Filament pile-up was detected by AI Print Monitoring. Please clean filament from the waste chute.","0300_800B":"The cutter is stuck. Please make sure the cutter handle is out and check the filament sensor cable connection.","0300_800C":"Skipped step detected: auto-recover complete; please resume print and check if there are any layer shift problems.","0300_800D":"Detected that the extruder is not extruding normally. If the defects are acceptable, select 'Resume' to resume the print job.","0300_800E":"The print file is not available. Please check to see if the storage media has been removed.","0300_800F":"The door seems to be open, so printing was paused.","0300_8010":"The hotend cooling fan speed is abnormal.","0300_8011":"Detected build plate is not the same as the Gcode file. Please adjust slicer settings or use the correct plate.","0300_8013":"Printing paused due to the pause command added to the printing file.","0300_8014":"The nozzle is covered with filament, or the build plate is installed incorrectly. Please cancel this print and clean the nozzle or adjust the build plate according to the actual status. You can als...","0300_8015":"The filament on external spool has run out; please load new filament. If the filament is loaded, please select 'Resume'.","0300_8016":"The nozzle is clogged with filament. Please cancel this print and clean the nozzle or select 'Resume' to resume the print job.","0300_8017":"Foreign objects detected on heatbed. Please check and clean the heatbed. Then, select 'Resume' to resume the print job.","0300_8018":"Chamber temperature malfunction.","0300_8019":"No build plate is placed.","0300_801A":"Filament extrusion error; please check the assistant for troubleshooting. After resolving the issue, decide whether to cancel or resume the print job based on the actual print status.","0300_801B":"Nozzle temperature problem detected. Refer to Assistant to re-connect the hotend connector. POWER OFF the printer before this operation to avoid short circuits.","0300_801C":"The extrusion resistance is abnormal. The extruder may be clogged; please refer to the assistant. After trouble shooting, you can select 'Resume' to resume the print job.","0300_801D":"The extruder servo motor position sensor is malfunctioning. Please power off the printer first and check if the connection cable is loose.","0300_801E":"The extrusion motor is overloaded, please check the Assistant for details.","0300_8021":"The nozzle may not be installed or not properly installed. Please ensure the nozzle is correctly installed before proceeding.","0300_8022":"The heatbed may be obstructed while moving downward. Please clear any objects beneath the heatbed and check for any resistance or jamming during its movement.","0300_8028":"Nozzle offset calibration sensor error. If using a single hotend or the calibration function is disabled, you may ignore this and continue printing; otherwise, it is recommended to check the sensor...","0300_8041":"Platform detection timeout: please restart the printer.","0300_8042":"Task paused because the door is open.","0300_8043":"The laser module is abnormal.","0300_8044":"Fire was detected inside the chamber.","0300_8045":"Material detection timeout: please restart the printer.","0300_8046":"Foreign object detect timeout: please restart the printer.","0300_8047":"Quick-release lever detection time out: please restart the printer.","0300_8048":"Laser Module unlock has timed out, and the task cannot proceed. Please restart the printer and try again.","0300_8049":"The current plate is invalid.","0300_804A":"Emergency stop button improperly installed. Please reinstall according to the Wiki before proceeding.","0300_804B":"Task paused. The Laser Safety Window is open.","0300_804E":"This is a printing task. Please detach the Laser/Cutting Module from the Toolhead.","0300_804F":"The loading/unloading process is currently ongoing. Please stop the process or remove the laser/cutting module.","0300_8050":"This device does not support the 40W Laser Module. Please remove it or replace it with a 10W Laser Module.","0300_8051":"The cutting module has dropped or the cutting module cable is disconnected; please check the module.","0300_8053":"Laser module detected. Please install the right nozzle correctly to ensure proper Laser Module Mounting Calibration.","0300_8054":"Please place the paper required for Print Then Cut.","0300_8055":"The module mounted on the toolhead does not match the task. Please install the correct module.","0300_8057":"The rotary attachment is disconnected. Please ensure it is properly installed and the cable is securely plugged in.","0300_8058":"The rotary attachment is detected. Please remove it before continuing.","0300_8061":"The mode of Airflow System failed to activate; check the air door condition.","0300_8062":"The chamber temperature is too high. It may be due to high environmental temperature.","0300_8063":"The chamber temperature is too high. Please open the top cover and front door to cool down.","0300_8064":"The chamber temperature is too high. Please open the top cover and front door to cool down. (Open door detection for this print job will be set to 'Notification' level)","0300_8065":"The temperature of the MC module is too high. Please check the Wiki for possible explanations.","0300_8071":"The Toolhead Enhanced Cooling Fan module is malfunctioning.","0300_807D":"Fire Extinguisher not detected, the automatic extinguishing function will be unavailable.","0300_807E":"Fire Extinguisher not detected, the automatic extinguishing function will be unavailable.","0300_807F":"Fire Extinguisher is malfunctioning.","0300_8080":"Fire extinguisher motor reset failed.","0300_8081":"Fire extinguisher cylinder not installed. Please confirm on the extinguisher page.","0300_8082":"The Fire Extinguisher Gas Cylinder is empty.","0300_C012":"Please heat the nozzle to above 170°C.","0300_C056":"A minor fire was detected inside the chamber, and the Auto Fire Extinguishing process has been aborted.","0300_C070":"The fire extinguisher has been detected and is ready for use after the laser module is connected.","0500_4001":"Failed to connect to Bambu Cloud. Please check your network connection.","0500_4002":"Unsupported print file path or name. Please resend the print job.","0500_4003":"Printing stopped because the printer was unable to parse the file. Please resend your print job.","0500_4004":"Device is busy and cannot start new task. Please wait for current task to complete before sending new task.","0500_4005":"Print jobs are not allowed to be sent while updating firmware.","0500_4006":"There is not enough free storage space for the print job. Restoring to factory settings can free up available space.","0500_4007":"The device requires a repair upgrade, and printing is currently unavailable.","0500_4008":"Starting printing failed; please power cycle the printer and resend the print job.","0500_4009":"Print jobs are not allowed to be sent while updating logs.","0500_400A":"The file name is not supported. Please rename and restart the print job.","0500_400B":"There was a problem downloading a file. Please check your network connection and resend the print job.","0500_400C":"Please insert a MicroSD card and restart the print job.","0500_400D":"Please run a self-test and restart the print job.","0500_400E":"Printing was cancelled.","0500_400F":"AMS is initializing and cannot be upgraded at the moment. Please try again later.","0500_4010":"AMS is drying and cannot be upgraded at the moment. Please try again later.","0500_4011":"The printer is loading or unloading filament and cannot be upgraded at the moment. Please try again later.","0500_4012":"The device is printing and cannot be upgraded at the moment. Please try again later.","0500_4013":"AMS is in operation and cannot be upgraded at the moment. Please try again when it is idle.","0500_4014":"Slicing for the print job failed. Please check your settings and restart the print job.","0500_4015":"There is not enough free storage space for the print job. Please format or clear files from the MicroSD card to free up space.","0500_4016":"The MicroSD Card is write-protected. Please replace the MicroSD Card.","0500_4017":"Binding failed. Please retry or restart the printer and retry.","0500_4018":"Binding configuration information parsing failed; please try again.","0500_4019":"The printer has already been bound. Please unbind it and try again.","0500_401A":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0500_401B":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_401C":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_401D":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0500_401E":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_401F":"Authorization timed out. Please make sure that your phone or PC has access to the internet, and ensure that the Bambu Studio/Bambu Handy APP is running in the foreground during the binding operation.","0500_4020":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_4021":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0500_4022":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_4023":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_4024":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0500_4025":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_4026":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_4027":"Cloud access failed; this may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0500_4028":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0500_4029":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0500_402A":"Failed to connect to the router, which may be caused by wireless interference or being too far away from the router. Please try again or move the printer closer to the router and try again.","0500_402B":"Router connection failed due to incorrect password. Please check the password and try again.","0500_402C":"Failed to obtain IP address, which may be caused by wireless interference resulting in data transmission failure or the DHCP address pool of the router being full. Please move the printer closer to...","0500_402D":"System exception","0500_402E":"System does not support the file system currently used by the USB flash drive. Please replace or format the USB flash drive to FAT32.","0500_402F":"The MicroSD card sector data is damaged. Please use the SD card repair tool to repair or format it. If it still cannot be identified, please replace the MicroSD card.","0500_4030":"The device is currently upgrading. Please try again when it is idle.","0500_4031":"The accessory firmware does not match the printer. Please update it on the 'Firmware' page.","0500_4033":"The AMS firmware does not match the printer. Please update it on the 'Firmware' page.","0500_4034":"The Laser Module firmware does not match the printer. Please update it on the 'Firmware' page.","0500_4035":"The BirdsEye Camera is malfunctioning. Please try restarting the device. If the issue persists after multiple restarts, check the camera connection status or contact customer support.","0500_4037":"Your sliced file is not compatible with current printer model. This file can't be printed on this printer.","0500_4038":"The nozzle diameter in sliced file is not consistent with the current nozzle setting. This file can't be printed.","0500_4039":"The current task does not allow the installation of the laser/cutting module, and the task has been halted.","0500_403A":"The current temperature is too low. In order to protect you and your printer, printing tasks, moving an axis and other operations are disabled. Please move the printer to an environment above 10 de...","0500_403B":"Laser/cutting tasks cannot be initiated on the machine at the moment. Please use the computer software to start the task.","0500_403C":"The current nozzle setting does not match the slicing file. Continuing to print may affect print quality. It is recommended to re-slice before starting the print.","0500_403D":"The toolhead module is not set up. Please set it up before initiating the task.","0500_403E":"The current tool head does not support initialization.","0500_403F":"Failed to download print job; please check your network connection.","0500_4040":"The printer has reached its power limit. Please connect a dedicated power adapter to this AMS to enable drying.","0500_4041":"The AMS drying cannot be started during printing.","0500_4042":"Due to power limitations, starting AMS drying will pause current operations such as nozzle heating and fan running. Do you want to proceed with drying?","0500_4043":"Due to power limitations, only one AMS is allowed to use the device's power for drying.","0500_4044":"BirdsEye Camera malfunction: please contact customer support.","0500_4045":"Hotend check in progress. This operation is temporarily unavailable. Please wait.","0500_4050":"Error detected on the print board.","0500_4052":"Error detected on the hot end.","0500_4054":"Error detected on the mat.","0500_405D":"Laser module Serial Number error: unable to calibrate or make project.","0500_4065":"The task requires a Laser Platform, but the current one is a Cutting Platform. Please replace it, measure the material thickness in the software, and then restart the task.","0500_4070":"The laser or cutter module is connected, so the device cannot initiate a 3D printing task.","0500_4075":"No Laser Platform was detected, which may affect thickness measurement accuracy. Please place the laser platform correctly and ensure the rear markers are not blocked, then restart the thickness me...","0500_4076":"Please place the Laser Platform correctly and ensure the rear markers are not blocked, then restart the thickness measurement in the software before initiating the task.","0500_4097":"The device cannot detect the Laser Module. Please reconnect the module cable or restart the printer.","0500_4098":"The device cannot detect AMS A. Please reconnect the AMS cable or restart the printer.","0500_4099":"The firmware of Cutting Module does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0500_409A":"The firmware of the Air Pump does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0500_409B":"The firmware of the Laser Module does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0500_409D":"The firmware of AMS A does not match the printer; the device cannot continue working. Please upgrade it on the 'Firmware' page.","0500_409E":"The device cannot detect the Cutting Module. Please reconnect the module cable or restart the printer.","0500_409F":"The device cannot detect the Air Pump. Please reconnect the module cable or restart the printer.","0500_40A0":"The Rotary Attachment module is not detected. Please reconnect the cable or restart the printer.","0500_40A1":"The Auto Fire Extinguishing System is not detected. Please reconnect the module cable or restart the printer.","0500_40A3":"AMS(or AMS lite) A communication is abnormal. Please reconnect the module cable or restart the printer.","0500_40A4":"The current firmware only supports 1 AMS Lite. Please remove all AMS units before reconnecting the supported AMS Lite device.","0500_40A5":"The current firmware only supports AMS/AMS 2 Pro/AMS HT, with a maximum of 4 units. Please remove all AMS units before reconnecting the supported one.","0500_8013":"The print file is not available. Please check to see if the storage media has been removed.","0500_8036":"Your sliced file is not consistent with the current printer model. Continue?","0500_803C":"The current nozzle setting does not match the slicing file. Continuing to print may affect print quality. It is recommended to re-slice before starting the print.","0500_8040":"Toolhead front cover is detached. Moving the toolhead may damage the printer. Do you want to continue?","0500_8041":"The filament in hotend is too cold. Extrusion may damage the extruder. Still feeding in/out the filament?","0500_8048":"The module on the toolhead is not calibrated. Please cancel the task to perform calibration or switch to a calibrated module.","0500_8051":"Detected build plate is not the same as the Gcode file. Please adjust slicer settings or use the correct plate.","0500_8053":"Nozzle mismatch was detected during printing. Please initiate the print after re-slicing, or continue printing after replacing with the correct nozzle. Caution: the hotend temperature is high.","0500_8055":"Laser module is installed, but a Cutting Platform is detected. Please place a Laser Platform and perform laser calibration.","0500_8056":"Cutting module is installed, but the laser platform is detected. Please place the cutting platform for calibration.","0500_8058":"Please place the light grip cutting mat correctly and ensure the marker is exposed.","0500_8059":"Cutting platform base is not correctly aligned. Please ensure that the four corners of the platform are aligned with the heatbed.","0500_805A":"Please place the cutting mat on cutting protection base.","0500_805B":"The cutting mat type is unknown; please replace it with the correct cutting mat.","0500_805C":"The grip cutting mat type does not match; please place a LightGrip cutting mat.","0500_805E":"Cutting module Serial Number error: unable to calibrate or make project.","0500_8060":"The current module on toolhead does not meet requirements. Please replace the module as per the on-screen instructions.","0500_8061":"No print plate detected. Please make sure it is placed correctly.","0500_8062":"The print plate marker was not detected. Please confirm the print plate is correctly positioned on the heatbed with all four corners aligned, and the marker is visible. If strong light is shining o...","0500_8063":"The platform is not detected during calibration; please make sure the Laser Platform is properly placed.","0500_8064":"Please place the Laser Platform correctly and ensure the rear markers are not blocked for laser calibration.","0500_8066":"The task requires a Cutting Platform, but the current one is a Laser Platform. Please replace it with a Cutting Platform (Cutting Protection Base + LightGrip cutting mat).","0500_8067":"Please place a LightGrip cutting mat on the cutting protection base.","0500_8068":"Please place the strong grip cutting mat correctly and ensure the marker is exposed.","0500_8069":"Unable to recognize the left and right hotends. They might be third party hotends, or the hotend marks may be dirty. Please manually set the hotend types.","0500_806A":"Unable to recognize the left and right hotends. They might be third party hotends, or the hotend marks may be dirty. Please set hotend types on printer screen before next print.","0500_806B":"Quick-release Lever is not locked. Please press down the external toolhead module to ensure it is properly seated, then push down the level to lock it in place.","0500_806C":"Please place the cutting platform correctly and ensure the marker is exposed.","0500_806D":"Material not detected. Please confirm placement and continue.","0500_806E":"Foreign objects detected on heatbed; please check and clean up the heatbed.","0500_806F":"The grip cutting mat type does not match; please place a StrongGrip cutting mat.","0500_8071":"No cutting platform was detected. Please confirm that it has been correctly placed.","0500_8072":"Live View camera is blocked","0500_8073":"Heatbed limit block is obstructed or contaminated. Please clean and ensure the limit block is visible, otherwise platform position offset detection may be inaccurate.","0500_8074":"The Laser Platform is offset. Please ensure that the four corners of the platform are aligned with the heatbed, and the marker is not obstructed.","0500_8077":"The visual marker was not detected. Please ensure the paper is properly placed.","0500_8078":"Current material does not match the sliced file settings. Please load the correct material and ensure the QR code on the material is not damaged or dirty.","0500_8079":"Please place the Laser Test Material (350g paperboard) and position support strips underneath to prevent material warping.","0500_807A":"The foreign object detection function is not working. You can continue the task or check the assistant for troubleshooting.","0500_807B":"Please place the cutting platform (cutting protection base + LightGrip cutting mat).","0500_807C":"Please place the cutting platform (cutting protection base + StrongGrip cutting mat).","0500_807D":"This task requires a Cutting Platform, but the current one is a Laser Platform. Please replace it with a Cutting Platform (Cutting Protection Base + StrongGrip Cutting Mat).","0500_807E":"Please place a StrongGrip cutting mat on the cutting protection base.","0500_8080":"The left and right hotends are not installed.","0500_8081":"The left and right hotends are not installed.","0500_8082":"Please remove the protective film on the Opaque Glossy Acrylic before processing","0500_8083":"Material is not allowed in Mounting Calibration. Please remove the material from the platform.","0500_8084":"The Live View Camera is dirty; please clean it and continue.","0500_8085":"Toolhead camera is obstructed","0500_8086":"Toolhead Camera is dirty, which affects the AI function; please clean the lens surface.","0500_8087":"BirdsEye camera is obstructed","0500_8088":"The Birdseye Camera is dirty","0500_8089":"Task paused due to Presence Check failed. Please check the printer to continue.","0500_808A":"The BirdsEye Camera is installed offset. Please refer to the assistant to reinstall it.","0500_808B":"The BirdsEye Camera setup failed. Please remove all objects and the mat on the heatbed to ensure the heatbed markers are visible. Meanwhile, please ensure the BirdsEye Camera is installed correctly...","0500_808C":"Detected build plate offset. Please align the build plate with the heatbed, and then continue.","0500_808D":"The Cutting Module offset calibration failed, which may result in inaccurate cuts. Please ensure the cutting material is properly positioned and check whether the cutting blade tip is worn.","0500_808E":"BirdsEye Camera initialization failed. The toolhead camera did not detect the Heatbed features. Please clean the Heatbed, remove all objects and pads, and ensure the bed markings are visible. Check...","0500_808F":"Nozzle camera lens is dirty, affecting AI monitoring. Clean the lens with a non-woven cloth and a small amount of alcohol. Beware of hotend heat; wait for it to cool before handling.","0500_8090":"Please attach the 80g White Printing Paper to the center area of the platform.","0500_8091":"The Cutting Module offset calibration failed, which may result in inaccurate cuts. Please ensure the 80g white printer paper(letter paper thickness) is properly positioned and check whether the cut...","0500_8092":"Toolhead Camera initialization failed. This print can still continue, but some AI functions will be disabled. If you encounter this issue again after restarting, please contact customer support.","0500_8093":"The nozzle silicone sleeve is not installed; there is a risk of temperature control failure. Please install it correctly and try again.","0500_80A0":"The visual encoder board was not detected. Please check if the board is properly placed and aligned at all four corners, and ensure the positioning markings are clear and free from wear.","0500_C010":"MicroSD Card read/write exception: please reinsert or replace the MicroSD Card.","0500_C032":"Laser/Cutting module connected to the toolhead. The drying process has been automatically stopped.","0500_C036":"This is a printing task. Please detach the Laser/Cutting Module from the Toolhead.","0500_C07F":"Device is busy and cannot perform this operation. To proceed, please pause or stop the current task.","0501_4017":"Binding failed. Please retry or restart the printer and retry.","0501_4018":"Binding configuration information parsing failed; please try again.","0501_4019":"The printer has already been bound. Please unbind it and try again.","0501_401A":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0501_401B":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_401C":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_401D":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0501_401E":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_401F":"Authorization timed out. Please make sure that your phone or PC has access to the internet, and ensure that the Bambu Studio/Bambu Handy APP is running in the foreground during the binding operation.","0501_4020":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4021":"Cloud access failed, which may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0501_4022":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_4023":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4024":"Cloud access failed. Possible reasons include network instability caused by interference, inability to access the internet, or router firewall configuration restrictions. You can try moving the pri...","0501_4025":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_4026":"Cloud access rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4027":"Cloud access failed; this may be caused by network instability due to interference. You can try moving the printer closer to the router before you try again.","0501_4028":"Cloud response is invalid. If you have tried multiple times and are still failing, please contact customer support.","0501_4029":"Cloud access is rejected. If you have tried multiple times and are still failing, please contact customer support.","0501_4031":"Device discovery binding is in progress, and the QR code cannot be displayed on the screen. You can wait for the binding to finish or abort the device discovery binding process in the APP/Studio an...","0501_4032":"QR code binding is in progress, so device discovery binding cannot be performed. You can scan the QR code on the screen for binding or exit the QR code display page on screen and try device discove...","0501_4033":"Your APP region does not match with your printer; please download the APP in the corresponding region and register your account again.","0501_4034":"The slicing progress has not been updated for a long time, and the printing task has exited. Please confirm the parameters and reinitiate printing.","0501_4035":"The device is in the process of binding and cannot respond to new binding requests.","0501_4038":"The regional settings do not match the printer; please check the printer's regional settings.","0501_4039":"Device login has expired; please try to bind again.","0501_4098":"The device cannot detect AMS B. Please reconnect the AMS cable or restart the printer.","0501_409D":"The firmware of AMS B does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0501_40A3":"AMS(or AMS lite) B communication is abnormal. Please reconnect the module cable or restart the printer.","0502_4001":"Current filament will be used in this print job. Settings cannot be changed.","0502_4002":"Please go to “Settings > Calibration” to run the Motion Accuracy Enhancement Calibration before turning on Motion Accuracy Enhancement mode.","0502_4003":"The printer is currently printing and the motion accuracy enhancement feature cannot be turned on or off.","0502_4004":"Some features are not supported by the current device. Please check the Studio feature settings or update the firmware to the latest version.","0502_4005":"The AMS has not been calibrated yet, so printing cannot be initiated.","0502_4006":"Unknown module detected; please try updating the firmware to the latest version.","0502_400D":"Failed to start a new task: filament loading/unloading not completed.","0502_400E":"Failed to start a new task: The nozzle cold pull was not completed.","0502_4013":"This device is not compatible with the 40W laser module. Please replace it with a 10W laser module or remove it.","0502_4098":"The device cannot detect AMS C. Please reconnect the AMS cable or restart the printer.","0502_409D":"The firmware of AMS C does not match the printer; the device cannot continue working. Please upgrade it on the 'Firmware' page.","0502_40A3":"AMS(or AMS lite) C communication is abnormal. Please reconnect the module cable or restart the printer.","0502_C00F":"The device is busy and cannot perform nozzle identification.","0502_C010":"Due to printer power limitations, printing, calibration, controls and other actions cannot be performed during AMS drying. Please stop the drying process before proceeding with any other operation.","0502_C011":"Currently in 2D production mode. Please continue the operation on the printer","0502_C012":"The task cannot be paused.","0502_C014":"The AMS Remaining Filament Estimation is enabled by default and cannot be disabled.","0502_C024":"The flow dynamic calibration records have exceeded the storage limit. Please delete some historical records in the slicer software before adding new calibration data.","0503_4098":"The device cannot detect AMS D. Please reconnect the AMS cable or restart the printer.","0503_409D":"The firmware of AMS D does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0503_40A3":"AMS(or AMS lite) D communication is abnormal. Please reconnect the module cable or restart the printer.","0580_4096":"The device cannot detect AMS-HT A. Please reconnect the AMS-HT cable or restart the printer.","0580_409C":"The firmware of AMS-HT A does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0580_40A2":"AMS-HT A communication is abnormal. Please reconnect the module cable or restart the printer.","0581_4096":"The device cannot detect AMS-HT B. Please reconnect the AMS-HT cable or restart the printer.","0581_409C":"The firmware of AMS-HT B does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0581_40A2":"AMS-HT B communication is abnormal. Please reconnect the module cable or restart the printer.","0582_4096":"The device cannot detect AMS-HT C. Please reconnect the AMS-HT cable or restart the printer.","0582_409C":"The firmware of AMS-HT C does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0582_40A2":"AMS-HT C communication is abnormal. Please reconnect the module cable or restart the printer.","0583_4096":"The device cannot detect AMS-HT D. Please reconnect the AMS-HT cable or restart the printer.","0583_409C":"The firmware of AMS-HT D does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0583_40A2":"AMS-HT D communication is abnormal. Please reconnect the module cable or restart the printer.","0584_4096":"The device cannot detect AMS-HT F. Please reconnect the AMS-HT cable or restart the printer.","0584_409C":"The firmware of AMS-HT E does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0584_40A2":"AMS-HT E communication is abnormal. Please reconnect the module cable or restart the printer.","0585_4096":"The device cannot detect AMS-HT E. Please reconnect the AMS-HT cable or restart the printer.","0585_409C":"The firmware of AMS-HT F does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0585_40A2":"AMS-HT F communication is abnormal. Please reconnect the module cable or restart the printer.","0586_4096":"The device cannot detect AMS-HT G. Please reconnect the AMS-HT cable or restart the printer.","0586_409C":"The firmware of AMS-HT G does not match the printer; the device cannot continue working. Please update it on the 'Firmware' page.","0586_40A2":"AMS-HT G communication is abnormal. Please reconnect the module cable or restart the printer.","0587_4096":"The device cannot detect AMS-HT H. Please reconnect the AMS-HT cable or restart the printer.","0587_409C":"The firmware of AMS-HT H does not match the printer; the device cannot continue working. Please upgrade it on the 'Firmware' page.","0587_40A2":"AMS-HT H communication is abnormal. Please reconnect the module cable or restart the printer.","05FE_8053":"The left nozzle is not matched with slicing file. Please initiate the print after re-slicing, or continue printing after replacing with the correct nozzle. Caution: the hotend temperature is high.","05FE_8069":"Unable to recognize the left hotend. It might be a third party hotend, or the hotend mark may be dirty. Please manually set the hotend type.","05FE_806A":"Unable to recognize the left hotend. It might be a third party hotend, or the hotend mark may be dirty. Please set hotend type on printer screen before next print.","05FE_8080":"The left hotend is not installed.","05FE_8081":"The left hotend is not installed.","05FF_8053":"The right nozzle is not matched with slicing file. Please initiate the print after re-slicing, or continue printing after replacing with the correct nozzle. Caution: the hotend temperature is high.","05FF_8069":"Unable to recognize the right hotend. It might be a third party hotend, or the hotend mark may be dirty. Please manually set the hotend type.","05FF_806A":"Unable to recognize the right hotend. It might be a third party hotend, or the hotend mark may be dirty. Please set hotend type on printer screen before next print.","05FF_8080":"The right hotend is not installed.","05FF_8081":"The right hotend is not installed.","0700_4001":"The AMS has been disabled for a print, but it still has filament loaded. Please unload the AMS filament and switch to the spool holder filament for printing.","0700_4025":"Failed to read the filament information.","0700_8001":"Failed to cut the filament. Please check the cutter.","0700_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0700_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0700_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0700_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0700_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0700_8007":"Extruding filament failed. The extruder might be clogged.","0700_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS A to the extruder is properly connected.","0700_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0700_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0700_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0700_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0700_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0700_8017":"AMS A is drying. Please stop drying process before loading/unloading material.","0700_8021":"AMS setup failed; please refer to the assistant.","0700_8023":"AMS A cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0700_C069":"An error occurred during AMS A drying. Please go to Assistant for more details.","0700_C06A":"AMS A is reading RFID. Unable to start drying. Please try again later.","0700_C06B":"AMS A is changing filament. Unable to start drying. Please try again later.","0700_C06C":"AMS A is in Feed Assist Mode. Unable to start drying. Please try again later.","0700_C06D":"AMS A is assisting in filament insertion. Unable to start drying. Please try again later.","0700_C06E":"AMS A motor is performing self-test. Unable to start drying. Please try again later.","0701_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","0701_4025":"Failed to read the filament information.","0701_8001":"Failed to cut the filament. Please check the cutter.","0701_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0701_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0701_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0701_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0701_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0701_8007":"Extruding filament failed. The extruder might be clogged.","0701_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS B to the extruder is properly connected.","0701_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0701_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0701_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0701_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0701_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0701_8017":"AMS B is drying. Please stop drying process before loading/unloading material.","0701_8021":"AMS setup failed; please refer to the assistant.","0701_8023":"AMS B cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0701_C069":"An error occurred during AMS B drying. Please go to Assistant for more details.","0701_C06A":"AMS B is reading RFID. Unable to start drying. Please try again later.","0701_C06B":"AMS B is changing filament. Unable to start drying. Please try again later.","0701_C06C":"AMS B is in Feed Assist Mode. Unable to start drying. Please try again later.","0701_C06D":"AMS B is assisting in filament insertion. Unable to start drying. Please try again later.","0701_C06E":"AMS B motor is performing self-test. Unable to start drying. Please try again later.","0702_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","0702_4025":"Failed to read the filament information.","0702_8001":"Failed to cut the filament. Please check the cutter.","0702_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0702_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0702_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0702_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0702_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0702_8007":"Extruding filament failed. The extruder might be clogged.","0702_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS C to the extruder is properly connected.","0702_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0702_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0702_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0702_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0702_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0702_8017":"AMS C is drying. Please stop drying process before loading/unloading material.","0702_8021":"AMS setup failed; please refer to the assistant.","0702_8023":"AMS C cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0702_C069":"An error occurred during AMS C drying. Please go to Assistant for more details.","0702_C06A":"AMS C is reading RFID. Unable to start drying. Please try again later.","0702_C06B":"AMS C is changing filament. Unable to start drying. Please try again later.","0702_C06C":"AMS C is in Feed Assist Mode. Unable to start drying. Please try again later.","0702_C06D":"AMS C is assisting in filament insertion. Unable to start drying. Please try again later.","0702_C06E":"AMS C motor is performing self-test. Unable to start drying. Please try again later.","0703_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","0703_4025":"Failed to read the filament information.","0703_8001":"Failed to cut the filament. Please check the cutter.","0703_8002":"The cutter is stuck. Please make sure the cutter handle is out.","0703_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0703_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0703_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0703_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0703_8007":"Extruding filament failed. The extruder might be clogged.","0703_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS D to the extruder is properly connected.","0703_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0703_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0703_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0703_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0703_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0703_8017":"AMS D is drying. Please stop drying process before loading/unloading material.","0703_8021":"AMS setup failed; please refer to the assistant.","0703_8023":"AMS D cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0703_C069":"An error occurred during AMS D drying. Please go to Assistant for more details.","0703_C06A":"AMS D is reading RFID. Unable to start drying. Please try again later.","0703_C06B":"AMS D is changing filament. Unable to start drying. Please try again later.","0703_C06C":"AMS D is in Feed Assist Mode. Unable to start drying. Please try again later.","0703_C06D":"AMS D is assisting in filament insertion. Unable to start drying. Please try again later.","0703_C06E":"AMS D motor is performing self-test. Unable to start drying. Please try again later.","0704_4025":"Failed to read the filament information.","0704_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0704_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0704_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0704_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0704_8007":"Extruding filament failed. The extruder might be clogged.","0704_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS E to the extruder is properly connected.","0704_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0704_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0704_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0704_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0704_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0704_8021":"AMS setup failed; please refer to the assistant.","0704_8023":"AMS E cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0705_4025":"Failed to read the filament information.","0705_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0705_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0705_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0705_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0705_8007":"Extruding filament failed. The extruder might be clogged.","0705_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS F to the extruder is properly connected.","0705_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0705_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0705_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0705_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0705_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0705_8021":"AMS setup failed; please refer to the assistant.","0705_8023":"AMS F cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0706_4025":"Failed to read the filament information.","0706_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0706_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0706_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0706_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0706_8007":"Extruding filament failed. The extruder might be clogged.","0706_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS G to the extruder is properly connected.","0706_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0706_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0706_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0706_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0706_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0706_8021":"AMS setup failed; please refer to the assistant.","0706_8023":"AMS G cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","0707_4025":"Failed to read the filament information.","0707_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","0707_8004":"AMS failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","0707_8005":"The AMS failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","0707_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","0707_8007":"Extruding filament failed. The extruder might be clogged.","0707_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS H to the extruder is properly connected.","0707_8010":"The AMS assist motor is overloaded. This could be due to entangled filament or a stuck spool.","0707_8011":"AMS filament ran out. Please insert a new filament into the same AMS slot.","0707_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","0707_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","0707_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","0707_8021":"AMS setup failed; please refer to the assistant.","0707_8023":"AMS H cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","07FE_8001":"Failed to cut the filament of the left extruder. Please check the cutter.","07FE_8002":"The cutter of the left extruder is stuck. Please pull out the cutter handle.","07FE_8003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are ab...","07FE_8004":"Failed to pull back the filament from the left extruder. Please check whether the filament is stuck inside the extruder.","07FE_8005":"Failed to feed the filament outside the AMS. Please clip the end of the filament flat and check to see if the spool is stuck.","07FE_8006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","07FE_8007":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","07FE_8010":"Check if the left external filament spool or filament is stuck.","07FE_8011":"The external filament connected to the left extruder has run out; please load a new filament.","07FE_8012":"Failed to get mapping table; please select 'Resume' to retry.","07FE_8013":"Timeout purging old filament of the left extruder: Please check if the filament is stuck or the extruder is clogged.","07FE_8020":"Extruder change failed; please refer to the assistant.","07FE_8021":"AMS setup failed; please refer to the assistant.","07FE_8024":"Extruder position calibration failed; please refer to the assistant.","07FE_8025":"Cold pull timed out. Please promptly operate or check whether the filament is broken inside the extruder, and click the Assistant for details.","07FE_8030":"The filament specified in the slicer has been used up. Printing is paused. Please go to the machine to replace the material and resume printing.","07FE_C003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","07FE_C006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","07FE_C008":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","07FE_C009":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","07FE_C00A":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'.","07FE_C010":"Insert the filament (over 30cm long) until it stops. You might see slight smoke during flushing. After insertion, close the front door and top cover.","07FE_C011":"Please manually and slowly pull out the filament from the extruder. Then click “Continue”.","07FE_C012":"Press the black PTFE tube coupler and unplug the PTFE tube. After completing the operation, click 'Continue.'","07FF_4001":"Filament is still loaded from the AMS after it has been disabled. Please unload the filament, load from the spool holder, and restart printing.","07FF_8001":"Failed to cut the filament of the right extruder. Please check the cutter.","07FF_8002":"The cutter is stuck. Please make sure the cutter handle is out.","07FF_8003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are a...","07FF_8004":"Failed to pull back the filament from the right extruder. Please check whether the filament is stuck inside the extruder.","07FF_8005":"Failed to feed the filament outside the AMS. Please clip the end of the filament flat and check to see if the spool is stuck.","07FF_8006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","07FF_8007":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","07FF_8010":"Check if the external filament spool or filament is stuck.","07FF_8011":"External filament has run out; please load a new filament.","07FF_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","07FF_8013":"Timeout purging old filament of the right extruder: Please check if the filament is stuck or the extruder is clogged.","07FF_8020":"Extruder change failed; please refer to the assistant.","07FF_8021":"AMS setup failed; please refer to the assistant.","07FF_8024":"Extruder position calibration failed; please refer to the assistant.","07FF_8025":"Cold pull timed out. Please promptly operate or check whether the filament is broken inside the extruder, and click the Assistant for details.","07FF_8030":"The filament specified in the slicer has been used up. Printing is paused. Please go to the machine to replace the material and resume printing.","07FF_C003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","07FF_C006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","07FF_C008":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","07FF_C009":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","07FF_C00A":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'.","07FF_C010":"Insert the filament (over 30cm long) until it stops. You might see slight smoke during flushing. After insertion, close the front door and top cover.","07FF_C011":"Hold the driven wheel bracket, slowly pull the filament from the extruder, then press 'Continue'.","07FF_C012":"Press the black PTFE tube coupler and unplug the PTFE tube. After completing the operation, click 'Continue.'","0C00_4020":"The setup of BirdsEye Camera failed. Please clear all objects and remove the mat. Make sure the marker is not obstructed. Meanwhile, clean both the BirdsEye Camera and Toolhead Camera, and remove a...","0C00_4021":"The setup of BirdsEye Camera failed; please reboot the printer.","0C00_4022":"The setup of BirdsEye Camera failed. Please check if the laser module is working properly.","0C00_4024":"The Birdseye Camera is installed offset. Please refer to the assistant to reinstall it.","0C00_4025":"The Birdseye Camera is dirty. Please clean it and restart the process.","0C00_4026":"The Live View Camera initialization failed; please reboot the printer.","0C00_4027":"The Live View Camera calibration failed. Please refer to the assistant for details and recalibrate the camera after processing.","0C00_4029":"Material not detected. Please confirm placement and continue.","0C00_402A":"The visual marker was not detected. Please re-paste the paper in the correct position.","0C00_402C":"Device data link error. Please reboot the printer","0C00_402D":"The toolhead camera is not working properly; please reboot the device.","0C00_403D":"The vision encoder plate was not detected. Please confirm it is correctly positioned on the heatbed.","0C00_403E":"The high-precision nozzle offset calibration has failed, possibly due to a damaged pattern or the similarity of the colors of the two selected filaments. Please clear the printed pattern and replac...","0C00_4041":"Toolhead camera calibration failed. Please ensure the Calibration Marker on the heatbed or Height Calibration Marker on the homing area is clean and undamaged, then re-run the calibration process.","0C00_8001":"First layer defects were detected. If the defects are acceptable, select 'Resume' to resume the print job.","0C00_8005":"Purged filament has piled up in the waste chute, which may cause a tool head collision.","0C00_8009":"Build plate localization marker was not found.","0C00_800B":"The heatbed marker was not detected. Please clear all objects and remove the mat. Make sure the marker is not obstructed.","0C00_8015":"Objects detected on the platform; please clean them up in a timely manner.","0C00_8016":"The foreign object detection function is not working. You can continue the task or check assistant for solutions.","0C00_8017":"Foreign objects detected on the platform; please clean them up on time.","0C00_8018":"The foreign object detection function is not working. You can continue the task or view the assistant for troubleshooting.","0C00_8033":"Quick-release Lever is not locked. Please push it down to secure.","0C00_8034":"Liveview Camera initialization failed. This print can still continue, but some AI functions will be disabled. If you encounter this issue again after restarting, please contact customer support.","0C00_803F":"AI detected nozzle clumping. Please check the nozzle condition. Refer to assistant for solutions.","0C00_8040":"AI detected air-printing defect. Please check the hotend extrusion status. Refer to assistant for solutions.","0C00_8042":"The AI print monitor has detected a spaghetti defect. Please check the print and take the necessary action.","0C00_8043":"AI detected nozzle clumping. Please check the nozzle condition. Refer to assistant for solutions.","0C00_C003":"Possible defects were detected in the first layer.","0C00_C004":"Possible spaghetti failure was detected.","0C00_C006":"Purged filament may have piled up in the waste chute.","1000_C001":"High bed temperature may lead to filament clogging in the nozzle. You may open the chamber door.","1000_C002":"Printing CF material with stainless steel may cause nozzle damage.","1000_C003":"Enabling Timelapse in traditional mode may cause defects; please activate this feature as needed.","1001_4001":"Timelapse is not supported as Spiral Vase mode is enabled in slicing presets.","1001_4002":"Timelapse is not supported as the Print sequence is set to 'By object'.","1001_8003":"The time-lapse mode is set to Traditional in the slicing file. This may cause surface defects. Would you like to enable it?","1001_8004":"Prime Tower is not enabled and time-lapse mode is set to Smooth in slicing file. This may cause surface defects. Would you like to enable it?","1200_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1200_8001":"Cutting the filament failed. Please check to see if the cutter is stuck. Refer to the Assistant for solutions.","1200_8002":"The cutter is stuck. Please pull out the cutter handle.","1200_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1200_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1200_8005":"The filament is not inserted. Please insert the filament.","1200_8006":"Unable to feed filament into the extruder. This could be due to tangled filament or a stuck spool. If not, please check if the AMS PTFE tube is connected.","1200_8007":"Failed to extrude the filament. This might be caused by clogged extruder or stuck filament. Refer to the Assistant for solutions.","1200_8010":"Filament or spool may be stuck.","1200_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1200_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1200_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1200_8014":"The filament location in the toolhead was not found. Refer to the Assistant for solutions.","1200_8015":"Failed to pull out the filament from the toolhead. Please check if the filament is stuck, or if it is broken inside the extruder or PTFE tube.","1200_8016":"The extruder is not extruding normally. Refer to the Assistant for troubleshooting. There may be defects in this layer, but you may resume if the defects are acceptable.","1201_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1201_8001":"Failed to cut the filament. Please check the cutter.","1201_8002":"The cutter is stuck. Please pull out the cutter handle.","1201_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1201_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1201_8005":"Failed to feed the filament. Please load the filament and then select 'Retry'.","1201_8006":"Failed to feed the filament into the toolhead. Please check whether the filament is stuck.","1201_8007":"Failed to extrude the filament. The extruder may be clogged or the filament may be stuck; please refer to HMS.","1201_8010":"Please check if the spool or filament is stuck.","1201_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1201_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1201_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1201_8014":"Failed to check the filament location in the tool head; please refer to the HMS.","1201_8015":"Failed to pull back the filament from the toolhead. Please check if the filament is stuck or the filament is broken inside the extruder.","1201_8016":"The extruder is not extruding normally; please refer to the HMS. After trouble shooting, if the defects are acceptable, please resume printing.","1202_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1202_8001":"Failed to cut the filament. Please check the cutter.","1202_8002":"The cutter is stuck. Please pull out the cutter handle.","1202_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1202_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1202_8005":"The filament is not inserted. Please insert the filament.","1202_8006":"Failed to feed the filament into the toolhead. Please check whether the filament is stuck.","1202_8007":"Failed to extrude the filament. The extruder may be clogged or the filament may be stuck; please refer to HMS.","1202_8010":"Please check if the spool or filament is stuck.","1202_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1202_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1202_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1202_8014":"Failed to check the filament location in the tool head; please refer to the HMS.","1202_8015":"Failed to pull back the filament from the toolhead. Please check if the filament is stuck or is broken inside the extruder.","1202_8016":"The extruder is not extruding normally; please refer to the HMS. After trouble shooting, if the defects are acceptable, please resume printing.","1203_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","1203_8001":"Failed to cut the filament. Please check the cutter.","1203_8002":"The cutter is stuck. Please pull out the cutter handle.","1203_8003":"Failed to pull out the filament from the extruder. Please check whether the extruder is clogged or whether the filament is broken inside the extruder.","1203_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","1203_8005":"The filament is not inserted. Please insert the filament.","1203_8006":"Failed to feed the filament into the toolhead. Please check whether the filament is stuck.","1203_8007":"Failed to extrude the filament. The extruder may be clogged or the filament may be stuck; please refer to HMS.","1203_8010":"Please check if the spool or filament is stuck.","1203_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","1203_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1203_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","1203_8014":"Failed to check the filament location in the tool head; please refer to the HMS.","1203_8015":"Failed to pull back the filament from the toolhead. Please check if the filament is stuck or is broken inside the extruder.","1203_8016":"The extruder is not extruding normally; please refer to the HMS. After trouble shooting, if the defects are acceptable, please resume printing.","12FF_4001":"Filament is still loaded from the AMS when it has been disabled. Please unload AMS filament, load from spool holder, and restart print job.","12FF_8001":"Failed to cut the filament. Please check the cutter.","12FF_8002":"The cutter is stuck. Please pull out the cutter handle.","12FF_8003":"Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube if you are about to us...","12FF_8004":"Failed to pull back the filament from the toolhead. Please check whether the filament is stuck.","12FF_8005":"The filament is not inserted. Please insert the filament.","12FF_8006":"Please feed filament into the PTFE tube until it can not be pushed any farther.","12FF_8007":"Check nozzle. Select 'Done' if filament was extruded, otherwise push filament forward slightly and select 'Retry.'","12FF_8010":"Please check if the filament or the spool is stuck.","12FF_8011":"AMS filament has run out. Please insert a new filament into the same AMS slot.","12FF_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","12FF_8013":"Timeout while purging old filament. Please check if the filament is stuck or the extruder clogged.","12FF_C003":"Please pull out the filament on the spool holder. If this message persists, please check to see if there is filament broken in the extruder or PTFE Tube. (Connect a PTFE tube if you are about to us...","12FF_C006":"Please feed filament into the PTFE tube until it can not be pushed any farther.","1800_4025":"Failed to read the filament information.","1800_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1800_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1800_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1800_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1800_8007":"Extruding filament failed. The extruder might be clogged.","1800_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT A to the extruder is properly connected.","1800_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1800_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1800_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1800_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1800_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1800_8017":"AMS-HT A is drying. Please stop drying process before loading/unloading material.","1800_8021":"AMS setup failed; please refer to the assistant.","1800_8023":"AMS-HT A cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1800_C069":"An error occurred during AMS-HT A drying. Please go to Assistant for more details.","1800_C06A":"AMS-HT A is reading RFID. Unable to start drying. Please try again later.","1800_C06B":"AMS-HT A is changing filament. Unable to start drying. Please try again later.","1800_C06C":"AMS-HT A is in Feed Assist Mode. Unable to start drying. Please try again later.","1800_C06D":"AMS-HT A is assisting in filament insertion. Unable to start drying. Please try again later.","1800_C06E":"AMS-HT A motor is performing self-test. Unable to start drying. Please try again later.","1801_4025":"Failed to read the filament information.","1801_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1801_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1801_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1801_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1801_8007":"Extruding filament failed. The extruder might be clogged.","1801_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT B to the extruder is properly connected.","1801_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1801_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1801_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1801_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1801_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1801_8017":"AMS-HT B is drying. Please stop drying process before loading/unloading material.","1801_8021":"AMS setup failed; please refer to the assistant.","1801_8023":"AMS-HT B cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1801_C069":"An error occurred during AMS-HT B drying. Please go to Assistant for more details.","1801_C06A":"AMS-HT B is reading RFID. Unable to start drying. Please try again later.","1801_C06B":"AMS-HT B is changing filament. Unable to start drying. Please try again later.","1801_C06C":"AMS-HT B is in Feed Assist Mode. Unable to start drying. Please try again later.","1801_C06D":"AMS-HT B is assisting in filament insertion. Unable to start drying. Please try again later.","1801_C06E":"AMS-HT B motor is performing self-test. Unable to start drying. Please try again later.","1802_4025":"Failed to read the filament information.","1802_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1802_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1802_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1802_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1802_8007":"Extruding filament failed. The extruder might be clogged.","1802_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT C to the extruder is properly connected.","1802_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1802_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1802_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1802_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1802_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1802_8017":"AMS-HT C is drying. Please stop drying process before loading/unloading material.","1802_8021":"AMS setup failed; please refer to the assistant.","1802_8023":"AMS-HT C cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1802_C069":"An error occurred during AMS-HT C drying. Please go to Assistant for more details.","1802_C06A":"AMS-HT C is reading RFID. Unable to start drying. Please try again later.","1802_C06B":"AMS-HT C is changing filament. Unable to start drying. Please try again later.","1802_C06C":"AMS-HT C is in Feed Assist Mode. Unable to start drying. Please try again later.","1802_C06D":"AMS-HT C is assisting in filament insertion. Unable to start drying. Please try again later.","1802_C06E":"AMS-HT C motor is performing self-test. Unable to start drying. Please try again later.","1803_4025":"Failed to read the filament information.","1803_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1803_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1803_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1803_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1803_8007":"Extruding filament failed. The extruder might be clogged.","1803_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT D to the extruder is properly connected.","1803_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1803_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1803_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1803_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1803_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1803_8017":"AMS-HT D is drying. Please stop drying process before loading/unloading material.","1803_8021":"AMS setup failed; please refer to the assistant.","1803_8023":"AMS-HT D cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1803_C069":"An error occurred during AMS-HT D drying. Please go to Assistant for more details.","1803_C06A":"AMS-HT D is reading RFID. Unable to start drying. Please try again later.","1803_C06B":"AMS-HT D is changing filament. Unable to start drying. Please try again later.","1803_C06C":"AMS-HT D is in Feed Assist Mode. Unable to start drying. Please try again later.","1803_C06D":"AMS-HT D is assisting in filament insertion. Unable to start drying. Please try again later.","1803_C06E":"AMS-HT D motor is performing self-test. Unable to start drying. Please try again later.","1804_4025":"Failed to read the filament information.","1804_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1804_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1804_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1804_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1804_8007":"Extruding filament failed. The extruder might be clogged.","1804_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT E to the extruder is properly connected.","1804_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1804_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1804_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1804_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1804_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1804_8021":"AMS setup failed; please refer to the assistant.","1804_8023":"AMS-HT E cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1804_C069":"An error occurred during AMS-HT E drying. Please go to Assistant for more details.","1804_C06A":"AMS-HT E is reading RFID. Unable to start drying. Please try again later.","1804_C06B":"AMS-HT E is changing filament. Unable to start drying. Please try again later.","1804_C06C":"AMS-HT E is in Feed Assist Mode. Unable to start drying. Please try again later.","1804_C06D":"AMS-HT E is assisting in filament insertion. Unable to start drying. Please try again later.","1804_C06E":"AMS-HT E motor is performing self-test. Unable to start drying. Please try again later.","1805_4025":"Failed to read the filament information.","1805_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1805_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1805_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1805_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1805_8007":"Extruding filament failed. The extruder might be clogged.","1805_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT F to the extruder is properly connected.","1805_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1805_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1805_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1805_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1805_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1805_8021":"AMS setup failed; please refer to the assistant.","1805_8023":"AMS-HT F cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1805_C069":"An error occurred during AMS-HT F drying. Please go to Assistant for more details.","1805_C06A":"AMS-HT F is reading RFID. Unable to start drying. Please try again later.","1805_C06B":"AMS-HT F is changing filament. Unable to start drying. Please try again later.","1805_C06C":"AMS-HT F is in Feed Assist Mode. Unable to start drying. Please try again later.","1805_C06D":"AMS-HT F is assisting in filament insertion. Unable to start drying. Please try again later.","1805_C06E":"AMS-HT F motor is performing self-test. Unable to start drying. Please try again later.","1806_4025":"Failed to read the filament information.","1806_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1806_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1806_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1806_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1806_8007":"Extruding filament failed. The extruder might be clogged.","1806_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT G to the extruder is properly connected.","1806_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1806_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1806_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1806_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1806_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1806_8021":"AMS setup failed; please refer to the assistant.","1806_8023":"AMS-HT G cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1806_C069":"An error occurred during AMS-HT G drying. Please go to Assistant for more details.","1806_C06A":"AMS-HT G is reading RFID. Unable to start drying. Please try again later.","1806_C06B":"AMS-HT G is changing filament. Unable to start drying. Please try again later.","1806_C06C":"AMS-HT G is in Feed Assist Mode. Unable to start drying. Please try again later.","1806_C06D":"AMS-HT G is assisting in filament insertion. Unable to start drying. Please try again later.","1806_C06E":"AMS-HT G motor is performing self-test. Unable to start drying. Please try again later.","1807_4025":"Failed to read the filament information.","1807_8003":"Failed to pull out the filament from the extruder. This might be caused by clogged extruder or filament broken inside the extruder.","1807_8004":"AMS-HT failed to pull back filament. This could be due to a stuck spool or the end of the filament being stuck in the path.","1807_8005":"The AMS-HT failed to send out filament. You can clip the end of your filament flat, and reinsert. If this message persists, please check the PTFE tubes in AMS for any signs of wear and tear.","1807_8006":"Unable to feed filament into the extruder. The AMS may be mismatched with the extruder. You can rerun the AMS Setup. This could also be due to an entangled filament or a stuck spool. If not, please...","1807_8007":"Extruding filament failed. The extruder might be clogged.","1807_800A":"PTFE tube disconnection detected. Please check if the PTFE tube from AMS-HT H to the extruder is properly connected.","1807_8010":"The AMS-HT assist motor is overloaded. This could be due to entangled filament or a stuck spool.","1807_8011":"AMS-HT filament ran out. Please insert a new filament into the same AMS-HT slot.","1807_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","1807_8013":"Timeout purging old filament: Please check if the filament is stuck or the extruder is clogged.","1807_8016":"The extruder is not extruding normally; please refer to the Assistant. After trouble shooting. If the defects are acceptable, please resume.","1807_8021":"AMS setup failed; please refer to the assistant.","1807_8023":"AMS-HT H cooling failed. The ambient temperature may be too high. Please operate the device in a suitable environment.","1807_C069":"An error occurred during AMS-HT H drying. Please go to Assistant for more details.","1807_C06A":"AMS-HT H is reading RFID. Unable to start drying. Please try again later.","1807_C06B":"AMS-HT H is changing filament. Unable to start drying. Please try again later.","1807_C06C":"AMS-HT H is in Feed Assist Mode. Unable to start drying. Please try again later.","1807_C06D":"AMS-HT H is assisting in filament insertion. Unable to start drying. Please try again later.","1807_C06E":"AMS-HT H motor is performing self-test. Unable to start drying. Please try again later.","18FE_8001":"Failed to cut the filament of the left extruder. Please check the cutter.","18FE_8002":"The cutter of the left extruder is stuck. Please pull out the cutter handle.","18FE_8003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are ab...","18FE_8004":"Failed to pull back the filament from the left extruder. Please check whether the filament is stuck inside the extruder.","18FE_8005":"Failed to feed the filament outside the AMS-HT. Please clip the end of the filament flat and check to see if the spool is stuck.","18FE_8006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","18FE_8007":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","18FE_8011":"The external filament connected to the left extruder has run out; please load a new filament.","18FE_8012":"Failed to get mapping table; please select 'Resume' to retry.","18FE_8013":"Timeout purging old filament of the left extruder: Please check if the filament is stuck or the extruder is clogged.","18FE_8020":"Extruder change failed; please refer to the assistant.","18FE_8021":"AMS setup failed; please refer to the assistant.","18FE_8024":"Extruder position calibration failed; please refer to the assistant.","18FE_C003":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","18FE_C006":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","18FE_C008":"Please pull out the filament on the spool holder of the left extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube i...","18FE_C009":"Please feed filament into the PTFE tube of the left extruder until it can not be pushed any farther.","18FE_C00A":"Please observe the nozzle of the left extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'.","18FF_8001":"Failed to cut the filament of the right extruder. Please check the cutter.","18FF_8002":"The cutter of the right extruder is stuck. Please pull out the cutter handle.","18FF_8003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder. (Connect a PTFE tube if you are a...","18FF_8004":"Failed to pull back the filament from the right extruder. Please check whether the filament is stuck inside the extruder.","18FF_8005":"Failed to feed the filament outside the AMS-HT. Please clip the end of the filament flat and check to see if the spool is stuck.","18FF_8006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","18FF_8007":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if it has not, please push the filament forward slightly, and then select 'Retry'.","18FF_8011":"The external filament connected to the right extruder has run out; please load a new filament.","18FF_8012":"Failed to get AMS mapping table; please select 'Resume' to retry.","18FF_8013":"Timeout purging old filament of the right extruder: Please check if the filament is stuck or the extruder is clogged.","18FF_8020":"Extruder change failed; please refer to the assistant.","18FF_8021":"AMS setup failed; please refer to the assistant.","18FF_8024":"Extruder position calibration failed; please refer to the assistant.","18FF_C003":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","18FF_C006":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","18FF_C008":"Please pull out the filament on the spool holder of the right extruder. If this message persists, please check to see if there is filament broken in the extruder or PTFE tube. (Connect a PTFE tube ...","18FF_C009":"Please feed filament into the PTFE tube of the right extruder until it can not be pushed any farther.","18FF_C00A":"Please observe the nozzle of the right extruder. If the filament has been extruded, select 'Continue'; if not, please push the filament forward slightly and then select 'Retry'."};function cAe(t){switch(t){case 1:return{label:"Fatal",color:"text-red-500",bgColor:"bg-red-500/20",Icon:Cn};case 2:return{label:"Serious",color:"text-red-400",bgColor:"bg-red-500/15",Icon:Cn};case 3:return{label:"Warning",color:"text-orange-400",bgColor:"bg-orange-500/20",Icon:Hi};default:return{label:"Info",color:"text-blue-400",bgColor:"bg-blue-500/20",Icon:Js}}}function MD(t,e){const n=t>>16&65535||(t>>8&255)<<8|t&255,r=e&65535;return`${n.toString(16).padStart(4,"0").toUpperCase()}_${r.toString(16).padStart(4,"0").toUpperCase()}`}function uAe(t){return t.filter(e=>{const n=parseInt(e.code.replace("0x",""),16)||0,r=MD(e.attr,n);return CD[r]!==void 0})}function dAe(){return"https://wiki.bambulab.com/en/hms/home"}function hAe({printerName:t,errors:e,onClose:n,printerId:r,hasPermission:i}){const{t:s}=Vt(),{showToast:o}=hn(),l=ot({mutationFn:()=>re.clearHMSErrors(r),onSuccess:()=>{o(s("hmsErrors.clearSuccess"),"success"),n()},onError:()=>{o(s("hmsErrors.clearFailed"),"error")}}),c=e.filter(u=>{const d=parseInt(u.code.replace("0x",""),16)||0,h=MD(u.attr,d);return CD[h]!==void 0});return w.useEffect(()=>{const u=d=>{d.key==="Escape"&&n()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[n]),a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-bambu-dark-secondary rounded-lg shadow-xl max-w-lg w-full max-h-[80vh] flex flex-col",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-bambu-dark-tertiary",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cn,{className:"w-5 h-5 text-orange-400"}),a.jsx("h2",{className:"text-lg font-semibold text-white",children:s("hmsErrors.title",{name:t})})]}),a.jsx("button",{onClick:n,className:"p-1 hover:bg-bambu-dark-tertiary rounded-lg transition-colors",children:a.jsx(Ft,{className:"w-5 h-5 text-bambu-gray"})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.length===0?a.jsxs("div",{className:"text-center py-8 text-bambu-gray",children:[a.jsx(Hi,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),a.jsx("p",{children:s("hmsErrors.noErrors")})]}):a.jsx("div",{className:"space-y-3",children:c.map((u,d)=>{const{label:h,color:f,bgColor:p,Icon:x}=cAe(u.severity),v=parseInt(u.code.replace("0x",""),16)||0,b=MD(u.attr,v),y=CD[b],S=dAe(),N=b.replace("_","-");return a.jsx("div",{className:`p-4 rounded-lg ${p} border border-white/10`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(x,{className:`w-5 h-5 ${f} flex-shrink-0 mt-0.5`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsxs("span",{className:`font-mono text-sm ${f}`,children:["[",N,"]"]}),a.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${p} ${f}`,children:h})]}),a.jsx("p",{className:"text-sm text-bambu-gray mb-2",children:y}),a.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-bambu-green hover:underline",children:[a.jsx(Kr,{className:"w-3 h-3"}),s("hmsErrors.viewOnWiki")]})]})]})},`${u.code}-${d}`)})})}),a.jsxs("div",{className:"p-4 border-t border-bambu-dark-tertiary flex items-center justify-between gap-3",children:[a.jsx("p",{className:"text-xs text-bambu-gray",children:s("hmsErrors.clearInstructions")}),c.length>0&&a.jsxs("button",{onClick:()=>l.mutate(),disabled:!i("printers:control")||l.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg bg-red-500/20 text-red-400 hover:bg-red-500/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex-shrink-0",children:[l.isPending?a.jsx(it,{className:"w-4 h-4 animate-spin"}):a.jsx(Jt,{className:"w-4 h-4"}),s("hmsErrors.clearErrors")]})]})]})})}function mAe(t){if(!t)return"ASAP";const e=Zi(t);if(!e)return"ASAP";const n=new Date,r=e.getTime()-n.getTime();return r<0?"Now":r<6e4?"In <1 min":r<36e5?`In ${Math.round(r/6e4)} min`:r<864e5?`In ${Math.round(r/36e5)}h`:e.toLocaleDateString()}function fAe({printerId:t,printerState:e,plateCleared:n}){const{t:r}=Vt(),i=tn(),{showToast:s}=hn(),{hasPermission:o}=Ir(),{data:l}=Ze({queryKey:["queue",t,"pending"],queryFn:()=>re.getQueue(t,"pending"),refetchInterval:3e4}),c=ot({mutationFn:()=>re.clearPlate(t),onSuccess:()=>{i.invalidateQueries({queryKey:["queue",t]}),i.invalidateQueries({queryKey:["printerStatus",t]}),s(r("queue.clearPlateSuccess"),"success")},onError:f=>{s(f.message,"error")}}),u=l?.[0],d=l?.length||0;return d===0?null:(e==="FINISH"||e==="FAILED")&&!n?a.jsxs("div",{className:"mb-3 p-3 bg-bambu-dark rounded-lg border border-yellow-400/30",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(ii,{className:"w-5 h-5 text-yellow-400 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-xs text-bambu-gray",children:r("queue.nextInQueue")}),a.jsx("p",{className:"text-sm text-white truncate",children:u?.archive_name||u?.library_file_name||`File #${u?.archive_id||u?.library_file_id}`})]}),d>1&&a.jsxs("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-400/20 text-yellow-400 rounded flex-shrink-0",children:["+",d-1]})]}),c.isSuccess?a.jsxs("div",{className:"w-full py-2 px-3 rounded-lg bg-bambu-green/10 border border-bambu-green/20 text-bambu-green text-sm flex items-center justify-center gap-2",children:[a.jsx(fb,{className:"w-4 h-4"}),r("queue.plateReady")]}):a.jsxs("button",{onClick:()=>c.mutate(),disabled:c.isPending||!o("printers:control"),className:"w-full py-2 px-3 rounded-lg bg-bambu-green/20 border border-bambu-green/40 text-bambu-green hover:bg-bambu-green/30 transition-colors text-sm font-medium flex items-center justify-center gap-2 disabled:opacity-50",children:[c.isPending?a.jsx(it,{className:"w-4 h-4 animate-spin"}):a.jsx(fb,{className:"w-4 h-4"}),r("queue.clearPlate")]})]}):a.jsx(Xs,{to:"/queue",className:"block mb-3 p-3 bg-bambu-dark rounded-lg hover:bg-bambu-dark-tertiary transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[a.jsx(ii,{className:"w-5 h-5 text-yellow-400 flex-shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-xs text-bambu-gray",children:r("queue.nextInQueue")}),a.jsx("p",{className:"text-sm text-white truncate",children:u?.archive_name||u?.library_file_name||`File #${u?.archive_id||u?.library_file_id}`})]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a.jsxs("span",{className:"text-xs text-bambu-gray flex items-center gap-1",children:[a.jsx(Wn,{className:"w-3 h-3"}),mAe(u?.scheduled_time||null)]}),d>1&&a.jsxs("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-400/20 text-yellow-400 rounded",children:["+",d-1]}),a.jsx(pa,{className:"w-4 h-4 text-bambu-gray"})]})]})})}function ZY(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{var{children:n,width:r,height:i,viewBox:s,className:o,style:l,title:c,desc:u}=t,d=vAe(t,yAe),h=s||{width:r,height:i,x:0,y:0},f=or("recharts-surface",o);return w.createElement("svg",AD({},is(d),{className:f,width:r,height:i,style:l,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height),ref:e}),w.createElement("title",null,c),w.createElement("desc",null,u),n)}),_Ae=["children","className"];function TD(){return TD=Object.assign?Object.assign.bind():function(t){for(var e=1;e{var{children:n,className:r}=t,i=SAe(t,_Ae),s=or("recharts-layer",r);return w.createElement("g",TD({className:s},is(i),{ref:e}),n)}),tQ=w.createContext(null),kAe=()=>w.useContext(tQ);function Wr(t){return function(){return t}}const nQ=Math.cos,W1=Math.sin,nc=Math.sqrt,K1=Math.PI,NC=2*K1,ED=Math.PI,PD=2*ED,Km=1e-6,CAe=PD-Km;function rQ(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rQ;const n=10**e;return function(r){this._+=r[0];for(let i=1,s=r.length;iKm)if(!(Math.abs(h*c-u*d)>Km)||!s)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-o,x=i-l,v=c*c+u*u,b=p*p+x*x,y=Math.sqrt(v),S=Math.sqrt(f),N=s*Math.tan((ED-Math.acos((v+f-b)/(2*y*S)))/2),A=N/S,C=N/y;Math.abs(A-1)>Km&&this._append`L${e+A*d},${n+A*h}`,this._append`A${s},${s},0,0,${+(h*p>d*x)},${this._x1=e+C*c},${this._y1=n+C*u}`}}arc(e,n,r,i,s,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=e+l,d=n+c,h=1^o,f=o?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Km||Math.abs(this._y1-d)>Km)&&this._append`L${u},${d}`,r&&(f<0&&(f=f%PD+PD),f>CAe?this._append`A${r},${r},0,1,${h},${e-l},${n-c}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:f>Km&&this._append`A${r},${r},0,${+(f>=ED)},${h},${this._x1=e+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function _L(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new AAe(e)}function SL(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function iQ(t){this._context=t}iQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function kC(t){return new iQ(t)}function aQ(t){return t[0]}function sQ(t){return t[1]}function oQ(t,e){var n=Wr(!0),r=null,i=kC,s=null,o=_L(l);t=typeof t=="function"?t:t===void 0?aQ:Wr(t),e=typeof e=="function"?e:e===void 0?sQ:Wr(e);function l(c){var u,d=(c=SL(c)).length,h,f=!1,p;for(r==null&&(s=i(p=o())),u=0;u<=d;++u)!(u=p;--x)l.point(N[x],A[x]);l.lineEnd(),l.areaEnd()}y&&(N[f]=+t(b,f,h),A[f]=+e(b,f,h),l.point(r?+r(b,f,h):N[f],n?+n(b,f,h):A[f]))}if(S)return l=null,S+""||null}function d(){return oQ().defined(i).curve(o).context(s)}return u.x=function(h){return arguments.length?(t=typeof h=="function"?h:Wr(+h),r=null,u):t},u.x0=function(h){return arguments.length?(t=typeof h=="function"?h:Wr(+h),u):t},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Wr(+h),u):r},u.y=function(h){return arguments.length?(e=typeof h=="function"?h:Wr(+h),n=null,u):e},u.y0=function(h){return arguments.length?(e=typeof h=="function"?h:Wr(+h),u):e},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Wr(+h),u):n},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(n)},u.lineX1=function(){return d().x(r).y(e)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:Wr(!!h),u):i},u.curve=function(h){return arguments.length?(o=h,s!=null&&(l=o(s)),u):o},u.context=function(h){return arguments.length?(h==null?s=l=null:l=o(s=h),u):s},u}class lQ{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function TAe(t){return new lQ(t,!0)}function EAe(t){return new lQ(t,!1)}const NL={draw(t,e){const n=nc(e/K1);t.moveTo(n,0),t.arc(0,0,n,0,NC)}},PAe={draw(t,e){const n=nc(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},cQ=nc(1/3),jAe=cQ*2,DAe={draw(t,e){const n=nc(e/jAe),r=n*cQ;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},RAe={draw(t,e){const n=nc(e),r=-n/2;t.rect(r,r,n,n)}},FAe=.8908130915292852,uQ=W1(K1/10)/W1(7*K1/10),LAe=W1(NC/10)*uQ,OAe=-nQ(NC/10)*uQ,IAe={draw(t,e){const n=nc(e*FAe),r=LAe*n,i=OAe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let s=1;s<5;++s){const o=NC*s/5,l=nQ(o),c=W1(o);t.lineTo(c*n,-l*n),t.lineTo(l*r-c*i,c*r+l*i)}t.closePath()}},_2=nc(3),zAe={draw(t,e){const n=-nc(e/(_2*3));t.moveTo(0,n*2),t.lineTo(-_2*n,-n),t.lineTo(_2*n,-n),t.closePath()}},Xo=-.5,Yo=nc(3)/2,jD=1/nc(12),UAe=(jD/2+1)*3,BAe={draw(t,e){const n=nc(e/UAe),r=n/2,i=n*jD,s=r,o=n*jD+n,l=-s,c=o;t.moveTo(r,i),t.lineTo(s,o),t.lineTo(l,c),t.lineTo(Xo*r-Yo*i,Yo*r+Xo*i),t.lineTo(Xo*s-Yo*o,Yo*s+Xo*o),t.lineTo(Xo*l-Yo*c,Yo*l+Xo*c),t.lineTo(Xo*r+Yo*i,Xo*i-Yo*r),t.lineTo(Xo*s+Yo*o,Xo*o-Yo*s),t.lineTo(Xo*l+Yo*c,Xo*c-Yo*l),t.closePath()}};function HAe(t,e){let n=null,r=_L(i);t=typeof t=="function"?t:Wr(t||NL),e=typeof e=="function"?e:Wr(e===void 0?64:+e);function i(){let s;if(n||(n=s=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:Wr(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:Wr(+s),i):e},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function X1(){}function Y1(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function dQ(t){this._context=t}dQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Y1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Y1(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function $Ae(t){return new dQ(t)}function hQ(t){this._context=t}hQ.prototype={areaStart:X1,areaEnd:X1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Y1(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function VAe(t){return new hQ(t)}function mQ(t){this._context=t}mQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Y1(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function GAe(t){return new mQ(t)}function fQ(t){this._context=t}fQ.prototype={areaStart:X1,areaEnd:X1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function qAe(t){return new fQ(t)}function e$(t){return t<0?-1:1}function t$(t,e,n){var r=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),l=(s*i+o*r)/(r+i);return(e$(s)+e$(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function n$(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function S2(t,e,n){var r=t._x0,i=t._y0,s=t._x1,o=t._y1,l=(s-r)/3;t._context.bezierCurveTo(r+l,i+l*e,s-l,o-l*n,s,o)}function Q1(t){this._context=t}Q1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:S2(this,this._t0,n$(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,S2(this,n$(this,n=t$(this,t,e)),n);break;default:S2(this,this._t0,n=t$(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function pQ(t){this._context=new gQ(t)}(pQ.prototype=Object.create(Q1.prototype)).point=function(t,e){Q1.prototype.point.call(this,e,t)};function gQ(t){this._context=t}gQ.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,s){this._context.bezierCurveTo(e,t,r,n,s,i)}};function WAe(t){return new Q1(t)}function KAe(t){return new pQ(t)}function bQ(t){this._context=t}bQ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=r$(t),i=r$(e),s=0,o=1;o=0;--e)i[e]=(o[e]-i[e+1])/s[e];for(s[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function YAe(t){return new CC(t,.5)}function QAe(t){return new CC(t,0)}function ZAe(t){return new CC(t,1)}function $f(t,e){if((o=t.length)>1)for(var n=1,r,i,s=t[e[0]],o,l=s.length;n=0;)n[e]=e;return n}function JAe(t,e){return t[e]}function eTe(t){const e=[];return e.key=t,e}function tTe(){var t=Wr([]),e=DD,n=$f,r=JAe;function i(s){var o=Array.from(t.apply(this,arguments),eTe),l,c=o.length,u=-1,d;for(const h of s)for(l=0,++u;l0){for(var n,r,i=0,s=t[0].length,o;i0){for(var n=0,r=t[e[0]],i,s=r.length;n0)||!((s=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,s,o;r1&&arguments[1]!==void 0?arguments[1]:cTe,n=10**e,r=Math.round(t*n)/n;return Object.is(r,-0)?0:r}function Ti(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{var l=n[o-1];return typeof l=="string"?i+l+s:l!==void 0?i+kh(l)+s:i+s},"")}var La=t=>t===0?0:t>0?1:-1,Ql=t=>typeof t=="number"&&t!=+t,Gf=t=>typeof t=="string"&&t.indexOf("%")===t.length-1,$t=t=>(typeof t=="number"||t instanceof Number)&&!Ql(t),vl=t=>$t(t)||typeof t=="string",uTe=0,O0=t=>{var e=++uTe;return"".concat(t||"").concat(e)},ys=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!$t(e)&&typeof e!="string")return r;var s;if(Gf(e)){if(n==null)return r;var o=e.indexOf("%");s=n*parseFloat(e.slice(0,o))/100}else s=+e;return Ql(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},yQ=t=>{if(!Array.isArray(t))return!1;for(var e=t.length,n={},r=0;rr&&(typeof e=="function"?e(r):Vf(r,e))===n)}var hi=t=>t===null||typeof t>"u",Sv=t=>hi(t)?t:"".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));function eo(t){return t!=null}function rm(){}var dTe=["type","size","sizeType"];function RD(){return RD=Object.assign?Object.assign.bind():function(t){for(var e=1;e{var e="symbol".concat(Sv(t));return wQ[e]||NL},yTe=(t,e,n)=>{if(e==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var r=18*bTe;return 1.25*t*t*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},vTe=(t,e)=>{wQ["symbol".concat(Sv(t))]=e},AL=t=>{var{type:e="circle",size:n=64,sizeType:r="area"}=t,i=pTe(t,dTe),s=h$(h$({},i),{},{type:e,size:n,sizeType:r}),o="circle";typeof e=="string"&&(o=e);var l=()=>{var f=xTe(o),p=HAe().type(f).size(yTe(n,r,o)),x=p();if(x!==null)return x},{className:c,cx:u,cy:d}=s,h=is(s);return $t(u)&&$t(d)&&$t(n)?w.createElement("path",RD({},h,{className:or("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};AL.registerSymbol=vTe;var _Q=t=>"radius"in t&&"startAngle"in t&&"endAngle"in t,TL=(t,e)=>{if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(w.isValidElement(t)&&(n=t.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{vL(i)&&(r[i]=(s=>n[i](n,s)))}),r},wTe=(t,e,n)=>r=>(t(e,n,r),null),Nv=(t,e,n)=>{if(t===null||typeof t!="object"&&typeof t!="function")return null;var r=null;return Object.keys(t).forEach(i=>{var s=t[i];vL(i)&&typeof s=="function"&&(r||(r={}),r[i]=wTe(s,e,n))}),r};function m$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _Te(t){for(var e=1;e(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return s}function Z1(){return Z1=Object.assign?Object.assign.bind():function(t){for(var e=1;e{var f=d.formatter||i,p=or({"recharts-legend-item":!0,["legend-item-".concat(h)]:!0,inactive:d.inactive});if(d.type==="none")return null;var x=d.inactive?s:d.color,v=f?f(d.value,d,h):d.value;return w.createElement("li",Z1({className:p,style:c,key:"legend-item-".concat(h)},Nv(t,d,h)),w.createElement(wL,{width:n,height:n,viewBox:l,style:u,"aria-label":"".concat(v," legend icon")},w.createElement(PTe,{data:d,iconType:o,inactiveColor:s})),w.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v))})}var DTe=t=>{var e=bi(t,ETe),{payload:n,layout:r,align:i}=e;if(!n||!n.length)return null;var s={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return w.createElement("ul",{className:"recharts-default-legend",style:s},w.createElement(jTe,Z1({},e,{payload:n})))},P2={},j2={},p$;function RTe(){return p$||(p$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n,r){const i=new Map;for(let s=0;s=0}t.isLength=e})(O2)),O2}var y$;function EL(){return y$||(y$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=LTe();function n(r){return r!=null&&typeof r!="function"&&e.isLength(r.length)}t.isArrayLike=n})(L2)),L2}var I2={},v$;function OTe(){return v$||(v$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return typeof n=="object"&&n!==null}t.isObjectLike=e})(I2)),I2}var w$;function ITe(){return w$||(w$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=EL(),n=OTe();function r(i){return n.isObjectLike(i)&&e.isArrayLike(i)}t.isArrayLikeObject=r})(F2)),F2}var z2={},U2={},_$;function zTe(){return _$||(_$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=ML();function n(r){return function(i){return e.get(i,r)}}t.property=n})(U2)),U2}var B2={},H2={},$2={},V2={},S$;function NQ(){return S$||(S$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return n!==null&&(typeof n=="object"||typeof n=="function")}t.isObject=e})(V2)),V2}var G2={},N$;function kQ(){return N$||(N$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return n==null||typeof n!="object"&&typeof n!="function"}t.isPrimitive=e})(G2)),G2}var q2={},k$;function CQ(){return k$||(k$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}t.isEqualsSameValueZero=e})(q2)),q2}var C$;function UTe(){return C$||(C$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=NQ(),n=kQ(),r=CQ();function i(d,h,f){return typeof f!="function"?i(d,h,()=>{}):s(d,h,function p(x,v,b,y,S,N){const A=f(x,v,b,y,S,N);return A!==void 0?!!A:s(x,v,p,N)},new Map)}function s(d,h,f,p){if(h===d)return!0;switch(typeof h){case"object":return o(d,h,f,p);case"function":return Object.keys(h).length>0?s(d,{...h},f,p):r.isEqualsSameValueZero(d,h);default:return e.isObject(d)?typeof h=="string"?h==="":!0:r.isEqualsSameValueZero(d,h)}}function o(d,h,f,p){if(h==null)return!0;if(Array.isArray(h))return c(d,h,f,p);if(h instanceof Map)return l(d,h,f,p);if(h instanceof Set)return u(d,h,f,p);const x=Object.keys(h);if(d==null||n.isPrimitive(d))return x.length===0;if(x.length===0)return!0;if(p?.has(h))return p.get(h)===d;p?.set(h,d);try{for(let v=0;v{})}t.isMatch=n})(H2)),H2}var W2={},K2={},X2={},A$;function BTe(){return A$||(A$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}t.getSymbols=e})(X2)),X2}var Y2={},T$;function PL(){return T$||(T$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}t.getTag=e})(Y2)),Y2}var Q2={},E$;function AQ(){return E$||(E$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",s="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",u="[object Set]",d="[object Array]",h="[object Function]",f="[object ArrayBuffer]",p="[object Object]",x="[object Error]",v="[object DataView]",b="[object Uint8Array]",y="[object Uint8ClampedArray]",S="[object Uint16Array]",N="[object Uint32Array]",A="[object BigUint64Array]",C="[object Int8Array]",T="[object Int16Array]",k="[object Int32Array]",j="[object BigInt64Array]",E="[object Float32Array]",P="[object Float64Array]";t.argumentsTag=s,t.arrayBufferTag=f,t.arrayTag=d,t.bigInt64ArrayTag=j,t.bigUint64ArrayTag=A,t.booleanTag=i,t.dataViewTag=v,t.dateTag=l,t.errorTag=x,t.float32ArrayTag=E,t.float64ArrayTag=P,t.functionTag=h,t.int16ArrayTag=T,t.int32ArrayTag=k,t.int8ArrayTag=C,t.mapTag=c,t.numberTag=r,t.objectTag=p,t.regexpTag=e,t.setTag=u,t.stringTag=n,t.symbolTag=o,t.uint16ArrayTag=S,t.uint32ArrayTag=N,t.uint8ArrayTag=b,t.uint8ClampedArrayTag=y})(Q2)),Q2}var Z2={},P$;function HTe(){return P$||(P$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}t.isTypedArray=e})(Z2)),Z2}var j$;function TQ(){return j$||(j$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=BTe(),n=PL(),r=AQ(),i=kQ(),s=HTe();function o(d,h){return l(d,void 0,d,new Map,h)}function l(d,h,f,p=new Map,x=void 0){const v=x?.(d,h,f,p);if(v!==void 0)return v;if(i.isPrimitive(d))return d;if(p.has(d))return p.get(d);if(Array.isArray(d)){const b=new Array(d.length);p.set(d,b);for(let y=0;ye.isMatch(s,i)}t.matches=r})(B2)),B2}var J2={},eP={},tP={},F$;function GTe(){return F$||(F$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=TQ(),n=PL(),r=AQ();function i(s,o){return e.cloneDeepWith(s,(l,c,u,d)=>{const h=o?.(l,c,u,d);if(h!==void 0)return h;if(typeof s=="object"){if(n.getTag(s)===r.objectTag&&typeof s.constructor!="function"){const f={};return d.set(s,f),e.copyProperties(f,s,u,d),f}switch(Object.prototype.toString.call(s)){case r.numberTag:case r.stringTag:case r.booleanTag:{const f=new s.constructor(s?.valueOf());return e.copyProperties(f,s),f}case r.argumentsTag:{const f={};return e.copyProperties(f,s),f.length=s.length,f[Symbol.iterator]=s[Symbol.iterator],f}default:return}}})}t.cloneDeepWith=i})(tP)),tP}var L$;function qTe(){return L$||(L$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=GTe();function n(r){return e.cloneDeepWith(r)}t.cloneDeep=n})(eP)),eP}var nP={},rP={},O$;function EQ(){return O$||(O$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&rt,qr=()=>{var t=w.useContext(jL);return t?t.store.dispatch:nEe},c1=()=>{},rEe=()=>c1,iEe=(t,e)=>t===e;function qt(t){var e=w.useContext(jL),n=w.useMemo(()=>e?r=>{if(r!=null)return t(r)}:c1,[e,t]);return jQ.useSyncExternalStoreWithSelector(e?e.subscription.addNestedSub:rEe,e?e.store.getState:c1,e?e.store.getState:c1,n,iEe)}function aEe(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function sEe(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function oEe(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(n=>typeof n=="function")){const n=t.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${e}[${n}]`)}}var W$=t=>Array.isArray(t)?t:[t];function lEe(t){const e=Array.isArray(t[0])?t[0]:t;return oEe(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function cEe(t,e){const n=[],{length:r}=t;for(let i=0;i{n=pS(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function mEe(t,...e){const n=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,r=(...i)=>{let s=0,o=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),aEe(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:h,memoizeOptions:f=[],argsMemoize:p=DQ,argsMemoizeOptions:x=[]}=d,v=W$(f),b=W$(x),y=lEe(i),S=h(function(){return s++,u.apply(null,arguments)},...v),N=p(function(){o++;const C=cEe(y,arguments);return l=S.apply(null,C),l},...b);return Object.assign(N,{resultFunc:u,memoizedResultFunc:S,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:h,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var ct=mEe(DQ),fEe=Object.assign((t,e=ct)=>{sEe(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const n=Object.keys(t),r=n.map(s=>t[s]);return e(r,(...s)=>s.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>fEe}),lP={},cP={},uP={},X$;function pEe(){return X$||(X$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,s)=>{if(r!==i){const o=e(r),l=e(i);if(o===l&&o===0){if(ri)return s==="desc"?-1:1}return s==="desc"?l-o:o-l}return 0};t.compareValues=n})(uP)),uP}var dP={},hP={},Y$;function RQ(){return Y$||(Y$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return typeof n=="symbol"||n instanceof Symbol}t.isSymbol=e})(hP)),hP}var Q$;function gEe(){return Q$||(Q$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=RQ(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,o){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||e.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!n.test(s))||o!=null&&Object.hasOwn(o,s)}t.isKey=i})(dP)),dP}var Z$;function bEe(){return Z$||(Z$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=pEe(),n=gEe(),r=CL();function i(s,o,l,c){if(s==null)return[];l=c?void 0:l,Array.isArray(s)||(s=Object.values(s)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(p=>String(p));const u=(p,x)=>{let v=p;for(let b=0;bx==null||p==null?x:typeof p=="object"&&"key"in p?Object.hasOwn(x,p.key)?x[p.key]:u(x,p.path):typeof p=="function"?p(x):Array.isArray(p)?u(x,p):typeof x=="object"?x[p]:x,h=o.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||n.isKey(p)?p:{key:p,path:r.toPath(p)}));return s.map(p=>({original:p,criteria:h.map(x=>d(x,p))})).slice().sort((p,x)=>{for(let v=0;vp.original)}t.orderBy=i})(cP)),cP}var mP={},J$;function xEe(){return J$||(J$=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n,r=1){const i=[],s=Math.floor(r),o=(l,c)=>{for(let u=0;u1&&r.isIterateeCall(s,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),e.orderBy(s,n.flatten(o),["asc"])}t.sortBy=i})(lP)),lP}var pP,nV;function vEe(){return nV||(nV=1,pP=yEe().sortBy),pP}var wEe=vEe();const MC=ec(wEe);var LQ=t=>t.legend.settings,_Ee=t=>t.legend.size,SEe=t=>t.legend.payload,NEe=ct([SEe,LQ],(t,e)=>{var{itemSorter:n}=e,r=t.flat(1);return n?MC(r,n):r});function kEe(){return qt(NEe)}var gS=1;function OQ(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[e,n]=w.useState({height:0,left:0,top:0,width:0}),r=w.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),o={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(o.height-e.height)>gS||Math.abs(o.left-e.left)>gS||Math.abs(o.top-e.top)>gS||Math.abs(o.width-e.width)>gS)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[e.width,e.height,e.top,e.left,...t]);return[e,r]}function Xa(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var CEe=typeof Symbol=="function"&&Symbol.observable||"@@observable",rV=CEe,gP=()=>Math.random().toString(36).substring(7).split("").join("."),MEe={INIT:`@@redux/INIT${gP()}`,REPLACE:`@@redux/REPLACE${gP()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${gP()}`},J1=MEe;function DL(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function IQ(t,e,n){if(typeof t!="function")throw new Error(Xa(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Xa(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Xa(1));return n(IQ)(t,e)}let r=t,i=e,s=new Map,o=s,l=0,c=!1;function u(){o===s&&(o=new Map,s.forEach((b,y)=>{o.set(y,b)}))}function d(){if(c)throw new Error(Xa(3));return i}function h(b){if(typeof b!="function")throw new Error(Xa(4));if(c)throw new Error(Xa(5));let y=!0;u();const S=l++;return o.set(S,b),function(){if(y){if(c)throw new Error(Xa(6));y=!1,u(),o.delete(S),s=null}}}function f(b){if(!DL(b))throw new Error(Xa(7));if(typeof b.type>"u")throw new Error(Xa(8));if(typeof b.type!="string")throw new Error(Xa(17));if(c)throw new Error(Xa(9));try{c=!0,i=r(i,b)}finally{c=!1}return(s=o).forEach(S=>{S()}),b}function p(b){if(typeof b!="function")throw new Error(Xa(10));r=b,f({type:J1.REPLACE})}function x(){const b=h;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Xa(11));function S(){const A=y;A.next&&A.next(d())}return S(),{unsubscribe:b(S)}},[rV](){return this}}}return f({type:J1.INIT}),{dispatch:f,subscribe:h,getState:d,replaceReducer:p,[rV]:x}}function AEe(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:J1.INIT})>"u")throw new Error(Xa(12));if(typeof n(void 0,{type:J1.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Xa(13))})}function zQ(t){const e=Object.keys(t),n={};for(let s=0;s"u")throw l&&l.type,new Error(Xa(14));u[h]=x,c=c||x!==p}return c=c||r.length!==Object.keys(o).length,c?u:o}}function eN(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function TEe(...t){return e=>(n,r)=>{const i=e(n,r);let s=()=>{throw new Error(Xa(15))};const o={getState:i.getState,dispatch:(c,...u)=>s(c,...u)},l=t.map(c=>c(o));return s=eN(...l)(i.dispatch),{...i,dispatch:s}}}function UQ(t){return DL(t)&&"type"in t&&typeof t.type=="string"}var BQ=Symbol.for("immer-nothing"),iV=Symbol.for("immer-draftable"),Is=Symbol.for("immer-state");function Il(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Ao=Object,Cb=Ao.getPrototypeOf,tN="constructor",AC="prototype",FD="configurable",nN="enumerable",u1="writable",I0="value",od=t=>!!t&&!!t[Is];function Zl(t){return t?HQ(t)||EC(t)||!!t[iV]||!!t[tN]?.[iV]||PC(t)||jC(t):!1}var EEe=Ao[AC][tN].toString(),aV=new WeakMap;function HQ(t){if(!t||!RL(t))return!1;const e=Cb(t);if(e===null||e===Ao[AC])return!0;const n=Ao.hasOwnProperty.call(e,tN)&&e[tN];if(n===Object)return!0;if(!Og(n))return!1;let r=aV.get(n);return r===void 0&&(r=Function.toString.call(n),aV.set(n,r)),r===EEe}function TC(t,e,n=!0){kv(t)===0?(n?Reflect.ownKeys(t):Ao.keys(t)).forEach(i=>{e(i,t[i],t)}):t.forEach((r,i)=>e(i,r,t))}function kv(t){const e=t[Is];return e?e.type_:EC(t)?1:PC(t)?2:jC(t)?3:0}var sV=(t,e,n=kv(t))=>n===2?t.has(e):Ao[AC].hasOwnProperty.call(t,e),LD=(t,e,n=kv(t))=>n===2?t.get(e):t[e],rN=(t,e,n,r=kv(t))=>{r===2?t.set(e,n):r===3?t.add(n):t[e]=n};function PEe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var EC=Array.isArray,PC=t=>t instanceof Map,jC=t=>t instanceof Set,RL=t=>typeof t=="object",Og=t=>typeof t=="function",bP=t=>typeof t=="boolean";function jEe(t){const e=+t;return Number.isInteger(e)&&String(e)===t}var Du=t=>t.copy_||t.base_,FL=t=>t.modified_?t.copy_:t.base_;function OD(t,e){if(PC(t))return new Map(t);if(jC(t))return new Set(t);if(EC(t))return Array[AC].slice.call(t);const n=HQ(t);if(e===!0||e==="class_only"&&!n){const r=Ao.getOwnPropertyDescriptors(t);delete r[Is];let i=Reflect.ownKeys(r);for(let s=0;s1&&Ao.defineProperties(t,{set:bS,add:bS,clear:bS,delete:bS}),Ao.freeze(t),e&&TC(t,(n,r)=>{LL(r,!0)},!1)),t}function DEe(){Il(2)}var bS={[I0]:DEe};function DC(t){return t===null||!RL(t)?!0:Ao.isFrozen(t)}var iN="MapSet",ID="Patches",oV="ArrayMethods",$Q={};function qf(t){const e=$Q[t];return e||Il(0,t),e}var lV=t=>!!$Q[t],z0,VQ=()=>z0,REe=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:lV(iN)?qf(iN):void 0,arrayMethodsPlugin_:lV(oV)?qf(oV):void 0});function cV(t,e){e&&(t.patchPlugin_=qf(ID),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function zD(t){UD(t),t.drafts_.forEach(FEe),t.drafts_=null}function UD(t){t===z0&&(z0=t.parent_)}var uV=t=>z0=REe(z0,t);function FEe(t){const e=t[Is];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function dV(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];if(t!==void 0&&t!==n){n[Is].modified_&&(zD(e),Il(4)),Zl(t)&&(t=hV(e,t));const{patchPlugin_:i}=e;i&&i.generateReplacementPatches_(n[Is].base_,t,e)}else t=hV(e,n);return LEe(e,t,!0),zD(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==BQ?t:void 0}function hV(t,e){if(DC(e))return e;const n=e[Is];if(!n)return aN(e,t.handledSet_,t);if(!RC(n,t))return e;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(t);WQ(n,t)}return n.copy_}function LEe(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&LL(e,n)}function GQ(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var RC=(t,e)=>t.scope_===e,OEe=[];function qQ(t,e,n,r){const i=Du(t),s=t.type_;if(r!==void 0&&LD(i,r,s)===e){rN(i,r,n,s);return}if(!t.draftLocations_){const l=t.draftLocations_=new Map;TC(i,(c,u)=>{if(od(u)){const d=l.get(u)||[];d.push(c),l.set(u,d)}})}const o=t.draftLocations_.get(e)??OEe;for(const l of o)rN(i,l,n,s)}function IEe(t,e,n){t.callbacks_.push(function(i){const s=e;if(!s||!RC(s,i))return;i.mapSetPlugin_?.fixSetContents(s);const o=FL(s);qQ(t,s.draft_??s,o,n),WQ(s,i)})}function WQ(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){const{patchPlugin_:r}=e;if(r){const i=r.getPath(t);i&&r.generatePatches_(t,i,e)}GQ(t)}}function zEe(t,e,n){const{scope_:r}=t;if(od(n)){const i=n[Is];RC(i,r)&&i.callbacks_.push(function(){d1(t);const o=FL(i);qQ(t,n,o,e)})}else Zl(n)&&t.callbacks_.push(function(){const s=Du(t);t.type_===3?s.has(n)&&aN(n,r.handledSet_,r):LD(s,e,t.type_)===n&&r.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&aN(LD(t.copy_,e,t.type_),r.handledSet_,r)})}function aN(t,e,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||od(t)||e.has(t)||!Zl(t)||DC(t)||(e.add(t),TC(t,(r,i)=>{if(od(i)){const s=i[Is];if(RC(s,n)){const o=FL(s);rN(t,r,o,t.type_),GQ(s)}}else Zl(i)&&aN(i,e,n)})),t}function UEe(t,e){const n=EC(t),r={type_:n?1:0,scope_:e?e.scope_:VQ(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=sN;n&&(i=[r],s=U0);const{revoke:o,proxy:l}=Proxy.revocable(i,s);return r.draft_=l,r.revoke_=o,[l,r]}var sN={get(t,e){if(e===Is)return t;let n=t.scope_.arrayMethodsPlugin_;const r=t.type_===1&&typeof e=="string";if(r&&n?.isArrayOperationMethod(e))return n.createMethodInterceptor(t,e);const i=Du(t);if(!sV(i,e,t.type_))return BEe(t,i,e);const s=i[e];if(t.finalized_||!Zl(s)||r&&t.operationMethod&&n?.isMutatingArrayMethod(t.operationMethod)&&jEe(e))return s;if(s===xP(t.base_,e)){d1(t);const o=t.type_===1?+e:e,l=HD(t.scope_,s,t,o);return t.copy_[o]=l}return s},has(t,e){return e in Du(t)},ownKeys(t){return Reflect.ownKeys(Du(t))},set(t,e,n){const r=KQ(Du(t),e);if(r?.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){const i=xP(Du(t),e),s=i?.[Is];if(s&&s.base_===n)return t.copy_[e]=n,t.assigned_.set(e,!1),!0;if(PEe(n,i)&&(n!==void 0||sV(t.base_,e,t.type_)))return!0;d1(t),BD(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_.set(e,!0),zEe(t,e,n)),!0},deleteProperty(t,e){return d1(t),xP(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),BD(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=Du(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{[u1]:!0,[FD]:t.type_!==1||e!=="length",[nN]:r[nN],[I0]:n[e]}},defineProperty(){Il(11)},getPrototypeOf(t){return Cb(t.base_)},setPrototypeOf(){Il(12)}},U0={};for(let t in sN){let e=sN[t];U0[t]=function(){const n=arguments;return n[0]=n[0][0],e.apply(this,n)}}U0.deleteProperty=function(t,e){return U0.set.call(this,t,e,void 0)};U0.set=function(t,e,n){return sN.set.call(this,t[0],e,n,t[0])};function xP(t,e){const n=t[Is];return(n?Du(n):t)[e]}function BEe(t,e,n){const r=KQ(e,n);return r?I0 in r?r[I0]:r.get?.call(t.draft_):void 0}function KQ(t,e){if(!(e in t))return;let n=Cb(t);for(;n;){const r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Cb(n)}}function BD(t){t.modified_||(t.modified_=!0,t.parent_&&BD(t.parent_))}function d1(t){t.copy_||(t.assigned_=new Map,t.copy_=OD(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var HEe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Og(n)&&!Og(r)){const o=r;r=n;const l=this;return function(u=o,...d){return l.produce(u,h=>r.call(this,h,...d))}}Og(r)||Il(6),i!==void 0&&!Og(i)&&Il(7);let s;if(Zl(n)){const o=uV(this),l=HD(o,n,void 0);let c=!0;try{s=r(l),c=!1}finally{c?zD(o):UD(o)}return cV(o,i),dV(s,o)}else if(!n||!RL(n)){if(s=r(n),s===void 0&&(s=n),s===BQ&&(s=void 0),this.autoFreeze_&&LL(s,!0),i){const o=[],l=[];qf(ID).generateReplacementPatches_(n,s,{patches_:o,inversePatches_:l}),i(o,l)}return s}else Il(1,n)},this.produceWithPatches=(n,r)=>{if(Og(n))return(l,...c)=>this.produceWithPatches(l,u=>n(u,...c));let i,s;return[this.produce(n,r,(l,c)=>{i=l,s=c}),i,s]},bP(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),bP(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),bP(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Zl(e)||Il(8),od(e)&&(e=Gl(e));const n=uV(this),r=HD(n,e,void 0);return r[Is].isManual_=!0,UD(n),r}finishDraft(e,n){const r=e&&e[Is];(!r||!r.isManual_)&&Il(9);const{scope_:i}=r;return cV(i,n),dV(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,n){let r;for(r=n.length-1;r>=0;r--){const s=n[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(n=n.slice(r+1));const i=qf(ID).applyPatches_;return od(e)?i(e,n):this.produce(e,s=>i(s,n))}};function HD(t,e,n,r){const[i,s]=PC(e)?qf(iN).proxyMap_(e,n):jC(e)?qf(iN).proxySet_(e,n):UEe(e,n);return(n?.scope_??VQ()).drafts_.push(i),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&r!==void 0?IEe(n,s,r):s.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:u}=c;s.modified_&&u&&u.generatePatches_(s,[],c)}),i}function Gl(t){return od(t)||Il(10,t),XQ(t)}function XQ(t){if(!Zl(t)||DC(t))return t;const e=t[Is];let n,r=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=OD(t,e.scope_.immer_.useStrictShallowCopy_),r=e.scope_.immer_.shouldUseStrictIteration()}else n=OD(t,!0);return TC(n,(i,s)=>{rN(n,i,XQ(s))},r),e&&(e.finalized_=!1),n}var $Ee=new HEe,YQ=$Ee.produce;function QQ(t){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,t):i(s)}var VEe=QQ(),GEe=QQ,qEe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?eN:eN.apply(null,arguments)};function wl(t,e){function n(...r){if(e){let i=e(...r);if(!i)throw new Error(jo(0));return{type:t,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:t,payload:r[0]}}return n.toString=()=>`${t}`,n.type=t,n.match=r=>UQ(r)&&r.type===t,n}var ZQ=class Iy extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,Iy.prototype)}static get[Symbol.species](){return Iy}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new Iy(...e[0].concat(this)):new Iy(...e.concat(this))}};function mV(t){return Zl(t)?YQ(t,()=>{}):t}function xS(t,e,n){return t.has(e)?t.get(e):t.set(e,n(e)).get(e)}function WEe(t){return typeof t=="boolean"}var KEe=()=>function(e){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=e??{};let o=new ZQ;return n&&(WEe(n)?o.push(VEe):o.push(GEe(n.extraArgument))),o},JQ="RTK_autoBatch",li=()=>t=>({payload:t,meta:{[JQ]:!0}}),fV=t=>e=>{setTimeout(e,t)},eZ=(t={type:"raf"})=>e=>(...n)=>{const r=e(...n);let i=!0,s=!1,o=!1;const l=new Set,c=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:fV(10):t.type==="callback"?t.queueNotification:fV(t.timeout),u=()=>{o=!1,s&&(s=!1,l.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const h=()=>i&&d(),f=r.subscribe(h);return l.add(d),()=>{f(),l.delete(d)}},dispatch(d){try{return i=!d?.meta?.[JQ],s=!i,s&&(o||(o=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},XEe=t=>function(n){const{autoBatch:r=!0}=n??{};let i=new ZQ(t);return r&&i.push(eZ(typeof r=="object"?r:void 0)),i};function YEe(t){const e=KEe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:s=void 0,enhancers:o=void 0}=t||{};let l;if(typeof n=="function")l=n;else if(DL(n))l=zQ(n);else throw new Error(jo(1));let c;typeof r=="function"?c=r(e):c=e();let u=eN;i&&(u=qEe({trace:!1,...typeof i=="object"&&i}));const d=TEe(...c),h=XEe(d);let f=typeof o=="function"?o(h):h();const p=u(...f);return IQ(l,s,p)}function tZ(t){const e={},n=[];let r;const i={addCase(s,o){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(jo(28));if(l in e)throw new Error(jo(29));return e[l]=o,i},addAsyncThunk(s,o){return o.pending&&(e[s.pending.type]=o.pending),o.rejected&&(e[s.rejected.type]=o.rejected),o.fulfilled&&(e[s.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){return n.push({matcher:s,reducer:o}),i},addDefaultCase(s){return r=s,i}};return t(i),[e,n,r]}function QEe(t){return typeof t=="function"}function ZEe(t,e){let[n,r,i]=tZ(e),s;if(QEe(t))s=()=>mV(t());else{const l=mV(t);s=()=>l}function o(l=s(),c){let u=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return u.filter(d=>!!d).length===0&&(u=[i]),u.reduce((d,h)=>{if(h)if(od(d)){const p=h(d,c);return p===void 0?d:p}else{if(Zl(d))return YQ(d,f=>h(f,c));{const f=h(d,c);if(f===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return d},l)}return o.getInitialState=s,o}var JEe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",e2e=(t=21)=>{let e="",n=t;for(;n--;)e+=JEe[Math.random()*64|0];return e},t2e=Symbol.for("rtk-slice-createasyncthunk");function n2e(t,e){return`${t}/${e}`}function r2e({creators:t}={}){const e=t?.asyncThunk?.[t2e];return function(r){const{name:i,reducerPath:s=i}=r;if(!i)throw new Error(jo(11));const o=(typeof r.reducers=="function"?r.reducers(a2e()):r.reducers)||{},l=Object.keys(o),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(N,A){const C=typeof N=="string"?N:N.type;if(!C)throw new Error(jo(12));if(C in c.sliceCaseReducersByType)throw new Error(jo(13));return c.sliceCaseReducersByType[C]=A,u},addMatcher(N,A){return c.sliceMatchers.push({matcher:N,reducer:A}),u},exposeAction(N,A){return c.actionCreators[N]=A,u},exposeCaseReducer(N,A){return c.sliceCaseReducersByName[N]=A,u}};l.forEach(N=>{const A=o[N],C={reducerName:N,type:n2e(i,N),createNotation:typeof r.reducers=="function"};o2e(A)?c2e(C,A,u,e):s2e(C,A,u)});function d(){const[N={},A=[],C=void 0]=typeof r.extraReducers=="function"?tZ(r.extraReducers):[r.extraReducers],T={...N,...c.sliceCaseReducersByType};return ZEe(r.initialState,k=>{for(let j in T)k.addCase(j,T[j]);for(let j of c.sliceMatchers)k.addMatcher(j.matcher,j.reducer);for(let j of A)k.addMatcher(j.matcher,j.reducer);C&&k.addDefaultCase(C)})}const h=N=>N,f=new Map,p=new WeakMap;let x;function v(N,A){return x||(x=d()),x(N,A)}function b(){return x||(x=d()),x.getInitialState()}function y(N,A=!1){function C(k){let j=k[N];return typeof j>"u"&&A&&(j=xS(p,C,b)),j}function T(k=h){const j=xS(f,A,()=>new WeakMap);return xS(j,k,()=>{const E={};for(const[P,U]of Object.entries(r.selectors??{}))E[P]=i2e(U,k,()=>xS(p,k,b),A);return E})}return{reducerPath:N,getSelectors:T,get selectors(){return T(C)},selectSlice:C}}const S={name:i,reducer:v,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:b,...y(s),injectInto(N,{reducerPath:A,...C}={}){const T=A??s;return N.inject({reducerPath:T,reducer:v},C),{...S,...y(T,!0)}}};return S}}function i2e(t,e,n,r){function i(s,...o){let l=e(s);return typeof l>"u"&&r&&(l=n()),t(l,...o)}return i.unwrapped=t,i}var lo=r2e();function a2e(){function t(e,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...n}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...n){return e(...n)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:n}},asyncThunk:t}}function s2e({type:t,reducerName:e,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!l2e(r))throw new Error(jo(17));s=r.reducer,o=r.prepare}else s=r;i.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,o?wl(t,o):wl(t))}function o2e(t){return t._reducerDefinitionType==="asyncThunk"}function l2e(t){return t._reducerDefinitionType==="reducerWithPrepare"}function c2e({type:t,reducerName:e},n,r,i){if(!i)throw new Error(jo(18));const{payloadCreator:s,fulfilled:o,pending:l,rejected:c,settled:u,options:d}=n,h=i(t,s,d);r.exposeAction(e,h),o&&r.addCase(h.fulfilled,o),l&&r.addCase(h.pending,l),c&&r.addCase(h.rejected,c),u&&r.addMatcher(h.settled,u),r.exposeCaseReducer(e,{fulfilled:o||yS,pending:l||yS,rejected:c||yS,settled:u||yS})}function yS(){}var u2e="task",nZ="listener",rZ="completed",OL="cancelled",d2e=`task-${OL}`,h2e=`task-${rZ}`,$D=`${nZ}-${OL}`,m2e=`${nZ}-${rZ}`,FC=class{constructor(t){this.code=t,this.message=`${u2e} ${OL} (reason: ${t})`}name="TaskAbortError";message},IL=(t,e)=>{if(typeof t!="function")throw new TypeError(jo(32))},oN=()=>{},iZ=(t,e=oN)=>(t.catch(e),t),aZ=(t,e)=>(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)),yf=t=>{if(t.aborted)throw new FC(t.reason)};function sZ(t,e){let n=oN;return new Promise((r,i)=>{const s=()=>i(new FC(t.reason));if(t.aborted){s();return}n=aZ(t,s),e.finally(()=>n()).then(r,i)}).finally(()=>{n=oN})}var f2e=async(t,e)=>{try{return await Promise.resolve(),{status:"ok",value:await t()}}catch(n){return{status:n instanceof FC?"cancelled":"rejected",error:n}}finally{e?.()}},lN=t=>e=>iZ(sZ(t,e).then(n=>(yf(t),n))),oZ=t=>{const e=lN(t);return n=>e(new Promise(r=>setTimeout(r,n)))},{assign:ab}=Object,pV={},LC="listenerMiddleware",p2e=(t,e)=>{const n=r=>aZ(t,()=>r.abort(t.reason));return(r,i)=>{IL(r);const s=new AbortController;n(s);const o=f2e(async()=>{yf(t),yf(s.signal);const l=await r({pause:lN(s.signal),delay:oZ(s.signal),signal:s.signal});return yf(s.signal),l},()=>s.abort(h2e));return i?.autoJoin&&e.push(o.catch(oN)),{result:lN(t)(o),cancel(){s.abort(d2e)}}}},g2e=(t,e)=>{const n=async(r,i)=>{yf(e);let s=()=>{};const l=[new Promise((c,u)=>{let d=t({predicate:r,effect:(h,f)=>{f.unsubscribe(),c([h,f.getState(),f.getOriginalState()])}});s=()=>{d(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await sZ(e,Promise.race(l));return yf(e),c}finally{s()}};return(r,i)=>iZ(n(r,i))},lZ=t=>{let{type:e,actionCreator:n,matcher:r,predicate:i,effect:s}=t;if(e)i=wl(e).match;else if(n)e=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(jo(21));return IL(s),{predicate:i,type:e,effect:s}},cZ=ab(t=>{const{type:e,predicate:n,effect:r}=lZ(t);return{id:e2e(),effect:r,type:e,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(jo(22))}}},{withTypes:()=>cZ}),gV=(t,e)=>{const{type:n,effect:r,predicate:i}=lZ(e);return Array.from(t.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},VD=t=>{t.pending.forEach(e=>{e.abort($D)})},b2e=(t,e)=>()=>{for(const n of e.keys())VD(n);t.clear()},bV=(t,e,n)=>{try{t(e,n)}catch(r){setTimeout(()=>{throw r},0)}},uZ=ab(wl(`${LC}/add`),{withTypes:()=>uZ}),x2e=wl(`${LC}/removeAll`),dZ=ab(wl(`${LC}/remove`),{withTypes:()=>dZ}),y2e=(...t)=>{console.error(`${LC}/error`,...t)},Cv=(t={})=>{const e=new Map,n=new Map,r=p=>{const x=n.get(p)??0;n.set(p,x+1)},i=p=>{const x=n.get(p)??1;x===1?n.delete(p):n.set(p,x-1)},{extra:s,onError:o=y2e}=t;IL(o);const l=p=>(p.unsubscribe=()=>e.delete(p.id),e.set(p.id,p),x=>{p.unsubscribe(),x?.cancelActive&&VD(p)}),c=p=>{const x=gV(e,p)??cZ(p);return l(x)};ab(c,{withTypes:()=>c});const u=p=>{const x=gV(e,p);return x&&(x.unsubscribe(),p.cancelActive&&VD(x)),!!x};ab(u,{withTypes:()=>u});const d=async(p,x,v,b)=>{const y=new AbortController,S=g2e(c,y.signal),N=[];try{p.pending.add(y),r(p),await Promise.resolve(p.effect(x,ab({},v,{getOriginalState:b,condition:(A,C)=>S(A,C).then(Boolean),take:S,delay:oZ(y.signal),pause:lN(y.signal),extra:s,signal:y.signal,fork:p2e(y.signal,N),unsubscribe:p.unsubscribe,subscribe:()=>{e.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((A,C,T)=>{A!==y&&(A.abort($D),T.delete(A))})},cancel:()=>{y.abort($D),p.pending.delete(y)},throwIfCancelled:()=>{yf(y.signal)}})))}catch(A){A instanceof FC||bV(o,A,{raisedBy:"effect"})}finally{await Promise.all(N),y.abort(m2e),i(p),p.pending.delete(y)}},h=b2e(e,n);return{middleware:p=>x=>v=>{if(!UQ(v))return x(v);if(uZ.match(v))return c(v.payload);if(x2e.match(v)){h();return}if(dZ.match(v))return u(v.payload);let b=p.getState();const y=()=>{if(b===pV)throw new Error(jo(23));return b};let S;try{if(S=x(v),e.size>0){const N=p.getState(),A=Array.from(e.values());for(const C of A){let T=!1;try{T=C.predicate(v,N,b)}catch(k){T=!1,bV(o,k,{raisedBy:"predicate"})}T&&d(C,v,p,y)}}}finally{b=pV}return S},startListening:c,stopListening:u,clearListeners:h}};function jo(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var v2e={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},hZ=lo({name:"chartLayout",initialState:v2e,reducers:{setLayout(t,e){t.layoutType=e.payload},setChartSize(t,e){t.width=e.payload.width,t.height=e.payload.height},setMargin(t,e){var n,r,i,s;t.margin.top=(n=e.payload.top)!==null&&n!==void 0?n:0,t.margin.right=(r=e.payload.right)!==null&&r!==void 0?r:0,t.margin.bottom=(i=e.payload.bottom)!==null&&i!==void 0?i:0,t.margin.left=(s=e.payload.left)!==null&&s!==void 0?s:0},setScale(t,e){t.scale=e.payload}}}),{setMargin:w2e,setLayout:_2e,setChartSize:S2e,setScale:N2e}=hZ.actions,k2e=hZ.reducer;function mZ(t,e,n){return Array.isArray(t)&&t&&e+n!==0?t.slice(e,n+1):t}function Sn(t){return Number.isFinite(t)}function Fc(t){return typeof t=="number"&&t>0&&Number.isFinite(t)}function xV(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Gg(t){for(var e=1;e{if(e&&n){var{width:r,height:i}=n,{align:s,verticalAlign:o,layout:l}=e;if((l==="vertical"||l==="horizontal"&&o==="middle")&&s!=="center"&&$t(t[s]))return Gg(Gg({},t),{},{[s]:t[s]+(r||0)});if((l==="horizontal"||l==="vertical"&&s==="center")&&o!=="middle"&&$t(t[o]))return Gg(Gg({},t),{},{[o]:t[o]+(i||0)})}return t},rc=(t,e)=>t==="horizontal"&&e==="xAxis"||t==="vertical"&&e==="yAxis"||t==="centric"&&e==="angleAxis"||t==="radial"&&e==="radiusAxis",fZ=(t,e,n,r)=>{if(r)return t.map(l=>l.coordinate);var i,s,o=t.map(l=>(l.coordinate===e&&(i=!0),l.coordinate===n&&(s=!0),l.coordinate));return i||o.push(e),s||o.push(n),o},pZ=(t,e,n)=>{if(!t)return null;var{duplicateDomain:r,type:i,range:s,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:u,tickCount:d,ticks:h,niceTicks:f,axisType:p}=t;if(!o)return null;var x=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,v=i==="category"&&o.bandwidth?o.bandwidth()/x:0;if(v=p==="angleAxis"&&s&&s.length>=2?La(s[0]-s[1])*2*v:v,h||f){var b=(h||f||[]).map((y,S)=>{var N=r?r.indexOf(y):y,A=o.map(N);return Sn(A)?{coordinate:A+v,value:y,offset:v,index:S}:null}).filter(eo);return b}return c&&u?u.map((y,S)=>{var N=o.map(y);return Sn(N)?{coordinate:N+v,value:y,index:S,offset:v}:null}).filter(eo):o.ticks&&d!=null?o.ticks(d).map((y,S)=>{var N=o.map(y);return Sn(N)?{coordinate:N+v,value:y,index:S,offset:v}:null}).filter(eo):o.domain().map((y,S)=>{var N=o.map(y);return Sn(N)?{coordinate:N+v,value:r?r[y]:y,index:S,offset:v}:null}).filter(eo)},E2e=(t,e)=>{if(!e||e.length!==2||!$t(e[0])||!$t(e[1]))return t;var n=Math.min(e[0],e[1]),r=Math.max(e[0],e[1]),i=[t[0],t[1]];return(!$t(t[0])||t[0]r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]{var e,n=t.length;if(!(n<=0)){var r=(e=t[0])===null||e===void 0?void 0:e.length;if(!(r==null||r<=0))for(var i=0;i=0?(u[0]=s,s+=f,u[1]=s):(u[0]=o,o+=f,u[1]=o)}}}},j2e=t=>{var e,n=t.length;if(!(n<=0)){var r=(e=t[0])===null||e===void 0?void 0:e.length;if(!(r==null||r<=0))for(var i=0;i=0?(c[0]=s,s+=u,c[1]=s):(c[0]=0,c[1]=0)}}}},D2e={sign:P2e,expand:nTe,none:$f,silhouette:rTe,wiggle:iTe,positive:j2e},R2e=(t,e,n)=>{var r,i=(r=D2e[n])!==null&&r!==void 0?r:$f,s=tTe().keys(e).value((l,c)=>Number(yr(l,c,0))).order(DD).offset(i),o=s(t);return o.forEach((l,c)=>{l.forEach((u,d)=>{var h=yr(t[d],e[c],0);Array.isArray(h)&&h.length===2&&$t(h[0])&&$t(h[1])&&(u[0]=h[0],u[1]=h[1])})}),o};function gZ(t){return t==null?void 0:String(t)}function cN(t){var{axis:e,ticks:n,bandSize:r,entry:i,index:s,dataKey:o}=t;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!hi(i[e.dataKey])){var l=vQ(n,"value",i[e.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[s]?n[s].coordinate+r/2:null}var c=yr(i,hi(o)?e.dataKey:o),u=e.scale.map(c);return $t(u)?u:null}var yV=t=>{var{axis:e,ticks:n,offset:r,bandSize:i,entry:s,index:o}=t;if(e.type==="category")return n[o]?n[o].coordinate+r:null;var l=yr(s,e.dataKey,e.scale.domain()[o]);if(hi(l))return null;var c=e.scale.map(l);return $t(c)?c-i/2+r:null},F2e=t=>{var{numericAxis:e}=t,n=e.scale.domain();if(e.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},L2e=t=>{var e=t.flat(2).filter($t);return[Math.min(...e),Math.max(...e)]},O2e=t=>[t[0]===1/0?0:t[0],t[1]===-1/0?0:t[1]],I2e=(t,e,n)=>{if(t!=null)return O2e(Object.keys(t).reduce((r,i)=>{var s=t[i];if(!s)return r;var{stackedData:o}=s,l=o.reduce((c,u)=>{var d=mZ(u,e,n),h=L2e(d);return!Sn(h[0])||!Sn(h[1])?c:[Math.min(c[0],h[0]),Math.max(c[1],h[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},vV=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wV=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Zh=(t,e,n)=>{if(t&&t.scale&&t.scale.bandwidth){var r=t.scale.bandwidth();if(!n||r>0)return r}if(t&&e&&e.length>=2){for(var i=MC(e,d=>d.coordinate),s=1/0,o=1,l=i.length;o{if(e==="horizontal")return t.chartX;if(e==="vertical")return t.chartY},U2e=(t,e)=>e==="centric"?t.angle:t.radius,pd=t=>t.layout.width,gd=t=>t.layout.height,B2e=t=>t.layout.scale,bZ=t=>t.layout.margin,OC=ct(t=>t.cartesianAxis.xAxis,t=>Object.values(t)),IC=ct(t=>t.cartesianAxis.yAxis,t=>Object.values(t)),xZ="data-recharts-item-index",yZ="data-recharts-item-id",Mv=60;function SV(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function vS(t){for(var e=1;et.brush.height;function q2e(t){var e=IC(t);return e.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Mv;return n+i}return n},0)}function W2e(t){var e=IC(t);return e.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Mv;return n+i}return n},0)}function K2e(t){var e=OC(t);return e.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function X2e(t){var e=OC(t);return e.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var va=ct([pd,gd,bZ,G2e,q2e,W2e,K2e,X2e,LQ,_Ee],(t,e,n,r,i,s,o,l,c,u)=>{var d={left:(n.left||0)+i,right:(n.right||0)+s},h={top:(n.top||0)+o,bottom:(n.bottom||0)+l},f=vS(vS({},h),d),p=f.bottom;f.bottom+=r,f=T2e(f,c,u);var x=t-f.left-f.right,v=e-f.top-f.bottom;return vS(vS({brushBottom:p},f),{},{width:Math.max(x,0),height:Math.max(v,0)})}),Y2e=ct(va,t=>({x:t.left,y:t.top,width:t.width,height:t.height})),zL=ct(pd,gd,(t,e)=>({x:0,y:0,width:t,height:e})),Q2e=w.createContext(null),wa=()=>w.useContext(Q2e)!=null,zC=t=>t.brush,UC=ct([zC,va,bZ],(t,e,n)=>({height:t.height,x:$t(t.x)?t.x:e.left,y:$t(t.y)?t.y:e.top+e.height+e.brushBottom-(n?.bottom||0),width:$t(t.width)?t.width:e.width})),yP={},vP={},wP={},NV;function Z2e(){return NV||(NV=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n,r,{signal:i,edges:s}={}){let o,l=null;const c=s!=null&&s.includes("leading"),u=s==null||s.includes("trailing"),d=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},h=()=>{u&&d(),v()};let f=null;const p=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,h()},r)},x=()=>{f!==null&&(clearTimeout(f),f=null)},v=()=>{x(),o=void 0,l=null},b=()=>{d()},y=function(...S){if(i?.aborted)return;o=this,l=S;const N=f==null;p(),c&&N&&d()};return y.schedule=p,y.cancel=v,y.flush=b,i?.addEventListener("abort",v,{once:!0}),y}t.debounce=e})(wP)),wP}var kV;function J2e(){return kV||(kV=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=Z2e();function n(r,i=0,s={}){typeof s!="object"&&(s={});const{leading:o=!1,trailing:l=!0,maxWait:c}=s,u=Array(2);o&&(u[0]="leading"),l&&(u[1]="trailing");let d,h=null;const f=e.debounce(function(...v){d=r.apply(this,v),h=null},i,{edges:u}),p=function(...v){return c!=null&&(h===null&&(h=Date.now()),Date.now()-h>=c)?(d=r.apply(this,v),h=Date.now(),f.cancel(),f.schedule(),d):(f.apply(this,v),d)},x=()=>(f.flush(),d);return p.cancel=f.cancel,p.flush=x,p}t.debounce=n})(vP)),vP}var CV;function ePe(){return CV||(CV=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=J2e();function n(r,i=0,s={}){const{leading:o=!0,trailing:l=!0}=s;return e.debounce(r,i,{leading:o,maxWait:i,trailing:l})}t.throttle=n})(yP)),yP}var _P,MV;function tPe(){return MV||(MV=1,_P=ePe().throttle),_P}var nPe=tPe();const rPe=ec(nPe);var uN=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;si[o++]))}},Mc={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},vZ=(t,e,n)=>{var{width:r=Mc.width,height:i=Mc.height,aspect:s,maxHeight:o}=n,l=Gf(r)?t:Number(r),c=Gf(i)?e:Number(i);return s&&s>0&&(l?c=l/s:c&&(l=c*s),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},iPe={width:0,height:0,overflow:"visible"},aPe={width:0,overflowX:"visible"},sPe={height:0,overflowY:"visible"},oPe={},lPe=t=>{var{width:e,height:n}=t,r=Gf(e),i=Gf(n);return r&&i?iPe:r?aPe:i?sPe:oPe};function cPe(t){var{width:e,height:n,aspect:r}=t,i=e,s=n;return i===void 0&&s===void 0?(i=Mc.width,s=Mc.height):i===void 0?i=r&&r>0?void 0:Mc.width:s===void 0&&(s=r&&r>0?void 0:Mc.height),{width:i,height:s}}function GD(){return GD=Object.assign?Object.assign.bind():function(t){for(var e=1;e({width:n,height:r}),[n,r]);return mPe(i)?w.createElement(wZ.Provider,{value:i},e):null}var UL=()=>w.useContext(wZ),fPe=w.forwardRef((t,e)=>{var{aspect:n,initialDimension:r=Mc.initialDimension,width:i,height:s,minWidth:o=Mc.minWidth,minHeight:l,maxHeight:c,children:u,debounce:d=Mc.debounce,id:h,className:f,onResize:p,style:x={}}=t,v=w.useRef(null),b=w.useRef();b.current=p,w.useImperativeHandle(e,()=>v.current);var[y,S]=w.useState({containerWidth:r.width,containerHeight:r.height}),N=w.useCallback((j,E)=>{S(P=>{var U=Math.round(j),O=Math.round(E);return P.containerWidth===U&&P.containerHeight===O?P:{containerWidth:U,containerHeight:O}})},[]);w.useEffect(()=>{if(v.current==null||typeof ResizeObserver>"u")return rm;var j=O=>{var B,R=O[0];if(R!=null){var{width:G,height:q}=R.contentRect;N(G,q),(B=b.current)===null||B===void 0||B.call(b,G,q)}};d>0&&(j=rPe(j,d,{trailing:!0,leading:!1}));var E=new ResizeObserver(j),{width:P,height:U}=v.current.getBoundingClientRect();return N(P,U),E.observe(v.current),()=>{E.disconnect()}},[N,d]);var{containerWidth:A,containerHeight:C}=y;uN(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:T,calculatedHeight:k}=vZ(A,C,{width:i,height:s,aspect:n,maxHeight:c});return uN(T!=null&&T>0||k!=null&&k>0,`The width(%s) and height(%s) of chart should be greater than 0, @@ -8500,7 +8500,7 @@ void main() { border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent ${c==="top"?"top-full border-t-[6px] border-t-bambu-dark-tertiary":"bottom-full border-b-[6px] border-b-bambu-dark-tertiary"} - `})]})]})}function UHe({slots:t,filamentInfo:e}){const{t:n}=Vt(),r=t.filter(l=>l.id>=2),i=6,s=r.length>0?Math.min(...r.map(l=>l.id)):16,o=Array.from({length:i},(l,c)=>r.find(u=>u.id===s+c)??{id:-(c+1),nozzle_type:"",nozzle_diameter:"",wear:null,stat:null,max_temp:0,serial_number:"",filament_color:"",filament_id:"",filament_type:""});return a.jsxs("div",{className:"text-center px-2.5 py-1.5 bg-bambu-dark rounded-lg flex-[2_1_190px] flex flex-col justify-center",children:[a.jsx("p",{className:"text-[9px] text-bambu-gray mb-1",children:n("printers.nozzleRack")}),a.jsx("div",{className:"flex gap-[3px] justify-center",children:o.map((l,c)=>{const u=!l.nozzle_diameter&&!l.nozzle_type,d=u?null:S4(l.filament_color),h=d?IHe(l.filament_color):!1;return a.jsx(fne,{slot:l,index:c,filamentName:l.filament_id?e?.[l.filament_id]?.name:void 0,children:a.jsx("div",{className:`w-7 h-7 rounded flex items-center justify-center cursor-default transition-colors border-b-2 ${u?"bg-bambu-dark-tertiary/20 border-bambu-dark-tertiary/20":"bg-bambu-dark-tertiary/40 border-bambu-dark-tertiary/40"}`,style:d?{backgroundColor:d}:void 0,children:a.jsx("span",{className:`text-[10px] font-semibold ${u?"text-bambu-gray/30":h?"text-black/80":"text-white"}`,style:d&&!h?{textShadow:"0 1px 3px rgba(0,0,0,0.9)"}:void 0,children:u?"—":l.nozzle_diameter||"?"})})},l.id>=0?l.id:`empty-${c}`)})})]})}function s9({className:t}){return a.jsx("svg",{className:t,viewBox:"0 0 36 54",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M17.8131 0.00538C18.4463 -0.15091 20.3648 3.14642 20.8264 3.84781C25.4187 10.816 35.3089 26.9368 35.9383 34.8694C37.4182 53.5822 11.882 61.3357 2.53721 45.3789C-1.73471 38.0791 0.016 32.2049 3.178 25.0232C6.99221 16.3662 12.6411 7.90372 17.8131 0.00538ZM18.3738 7.24807L17.5881 7.48441C14.4452 12.9431 10.917 18.2341 8.19369 23.9368C4.6808 31.29 1.18317 38.5479 7.69403 45.5657C17.3058 55.9228 34.9847 46.8808 31.4604 32.8681C29.2558 24.0969 22.4207 15.2913 18.3776 7.24807H18.3738Z",fill:"#C3C2C1"})})}function BHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 35 53",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M17.3165 0.0038C17.932 -0.14959 19.7971 3.08645 20.2458 3.77481C24.7103 10.6135 34.3251 26.4346 34.937 34.2198C36.3757 52.5848 11.5505 60.1942 2.46584 44.534C-1.68714 37.3735 0.0148 31.6085 3.08879 24.5603C6.79681 16.0605 12.2884 7.75907 17.3165 0.0038ZM17.8615 7.11561L17.0977 7.34755C14.0423 12.7048 10.6124 17.8974 7.96483 23.4941C4.54975 30.7107 1.14949 37.8337 7.47908 44.721C16.8233 54.8856 34.01 46.0117 30.5838 32.2595C28.4405 23.6512 21.7957 15.0093 17.8652 7.11561H17.8615Z",fill:"#C3C2C1"}),a.jsx("path",{d:"M5.03547 30.112C9.64453 30.4936 11.632 35.7985 16.4154 35.791C19.6339 35.7873 20.2161 33.2283 22.3853 31.6197C31.6776 24.7286 33.5835 37.4894 27.9881 44.4254C18.1878 56.5653 -1.16063 44.6013 5.03917 30.1158L5.03547 30.112Z",fill:"#1F8FEB"})]})}function HHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 36 54",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M17.9625 4.48059L4.77216 26.3154L2.08228 40.2175L10.0224 50.8414H23.1594L33.3246 42.1693V30.2455L17.9625 4.48059Z",fill:"#1F8FEB"}),a.jsx("path",{d:"M17.7948 0.00538C18.4273 -0.15091 20.3438 3.14642 20.8048 3.84781C25.3921 10.816 35.2715 26.9368 35.9001 34.8694C37.3784 53.5822 11.8702 61.3357 2.53562 45.3789C-1.73163 38.0829 0.0134 32.2087 3.1757 25.027C6.98574 16.3662 12.6284 7.90372 17.7948 0.00538ZM18.3549 7.24807L17.57 7.48441C14.4306 12.9431 10.9063 18.2341 8.1859 23.9368C4.67686 31.29 1.18305 38.5479 7.68679 45.5657C17.2881 55.9228 34.9476 46.8808 31.4271 32.8681C29.2249 24.0969 22.3974 15.2913 18.3587 7.24807H18.3549Z",fill:"#C3C2C1"})]})}function $He({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"}),a.jsx("circle",{cx:"6",cy:"15",r:"2.5",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"})]})}function VHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"4.5",y:"8",width:"3",height:"4.5",fill:"#d4a017",rx:"0.5"}),a.jsx("circle",{cx:"6",cy:"15",r:"2",fill:"#d4a017"}),a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"})]})}function GHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"4.5",y:"3",width:"3",height:"9.5",fill:"#c62828",rx:"0.5"}),a.jsx("circle",{cx:"6",cy:"15",r:"2",fill:"#c62828"}),a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"})]})}function aj({className:t,color:e,isHeating:n}){const i={"text-orange-400":"#fb923c","text-blue-400":"#60a5fa","text-green-400":"#4ade80"}[e]||"#888",s=n?{filter:`drop-shadow(0 0 4px ${i}) drop-shadow(0 0 8px ${i})`}:{};return n?a.jsxs("svg",{className:t,style:s,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"4.5",y:"3",width:"3",height:"9.5",fill:i,rx:"0.5"}),a.jsx("circle",{cx:"6",cy:"15",r:"2",fill:i}),a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:i,strokeWidth:"1",fill:"none"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:i,strokeWidth:"1",fill:"none"}),a.jsx("circle",{cx:"6",cy:"15",r:"2.5",stroke:i,strokeWidth:"1",fill:"none"})]})}function o9({humidity:t,goodThreshold:e=40,fairThreshold:n=60,onClick:r,compact:i}){const s=typeof t=="string"?parseInt(t,10):t,o=typeof e=="number"?e:40,l=typeof n=="number"?n:60;let c,u;isNaN(s)?(c="#C3C2C1",u="Unknown"):s<=o?(c="#22a352",u="Good"):s<=l?(c="#d4a017",u="Fair"):(c="#c62828",u="Bad");let d;return isNaN(s)||s<=o?d=s9:s<=l?d=BHe:d=HHe,a.jsxs("button",{type:"button",onClick:r,className:`flex items-center gap-1 ${r?"cursor-pointer hover:opacity-80 transition-opacity":""}`,title:`Humidity: ${s}% - ${u}${r?" (click for history)":""}`,children:[a.jsx(d,{className:i?"w-2.5 h-3":"w-3 h-4"}),a.jsxs("span",{className:`font-medium tabular-nums ${i?"text-[10px]":"text-xs"}`,style:{color:c},children:[s,"%"]})]})}function l9({temp:t,goodThreshold:e=28,fairThreshold:n=35,onClick:r,compact:i}){const s=typeof e=="number"?e:28,o=typeof n=="number"?n:35;let l,c,u;return t<=s?(l="#22a352",c="Good",u=$He):t<=o?(l="#d4a017",c="Fair",u=VHe):(l="#c62828",c="Bad",u=GHe),a.jsxs("button",{type:"button",onClick:r,className:`flex items-center gap-1 ${r?"cursor-pointer hover:opacity-80 transition-opacity":""}`,title:`Temperature: ${t}°C - ${c}${r?" (click for history)":""}`,children:[a.jsx(u,{className:i?"w-2.5 h-3":"w-3 h-4"}),a.jsxs("span",{className:`tabular-nums text-right ${i?"text-[10px] w-8":"w-12"}`,style:{color:l},children:[t,"°C"]})]})}function ih(t,e){const n=typeof t=="string"?parseInt(t,10):t,r=isNaN(n)?0:n,i=e===1,s=r>=128?r-128:r,o=String.fromCharCode(65+s);return i?`HT-${o}`:`AMS-${o}`}function sj(t){return t>50?"#00ae42":t>=15?"#f59e0b":"#ef4444"}function oj(t){return!t?.remaining_weight||!t?.filament_weight||t.filament_weight<=0?null:Math.min(100,Math.round(t.remaining_weight/t.filament_weight*100))}function qHe(t){if(!t)return"/img/printers/default.png";const e=t.toLowerCase().replace(/\s+/g,"");return e.includes("x1e")?"/img/printers/x1e.png":e.includes("x1c")||e.includes("x1carbon")||e.includes("x1")?"/img/printers/x1c.png":e.includes("h2d")?"/img/printers/h2d.png":e.includes("h2c")?"/img/printers/h2c.png":e.includes("h2s")?"/img/printers/h2d.png":e.includes("p2s")||e.includes("p1s")?"/img/printers/p1s.png":e.includes("p1p")?"/img/printers/p1p.png":e.includes("a1mini")?"/img/printers/a1mini.png":e.includes("a1")?"/img/printers/a1.png":"/img/printers/default.png"}function WHe(t){return t>=-50?{labelKey:"printers.wifiSignal.excellent",color:"text-bambu-green",bars:4}:t>=-60?{labelKey:"printers.wifiSignal.good",color:"text-bambu-green",bars:3}:t>=-70?{labelKey:"printers.wifiSignal.fair",color:"text-yellow-400",bars:2}:t>=-80?{labelKey:"printers.wifiSignal.weak",color:"text-orange-400",bars:1}:{labelKey:"printers.wifiSignal.veryWeak",color:"text-red-400",bars:1}}function lj(t){return t?!!(t.tray_uuid&&t.tray_uuid!=="00000000000000000000000000000000"||t.tag_uid&&t.tag_uid!=="0000000000000000"):!1}function KHe({url:t,printName:e}){const{t:n}=Vt(),[r,i]=w.useState(!1),[s,o]=w.useState(!1),[l,c]=w.useState(!1),u=w.useMemo(()=>{if(!t)return null;const d=t.includes("?")?"&":"?";return`${t}${d}v=${encodeURIComponent(e||Date.now().toString())}`},[t,e]);return w.useEffect(()=>{i(!1),o(!1)},[u]),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`w-20 h-20 flex-shrink-0 rounded-lg overflow-hidden bg-bambu-dark-tertiary flex items-center justify-center ${u&&r?"cursor-pointer":""}`,onClick:()=>u&&r&&c(!0),children:u&&!s?a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:n("printers.printPreview"),className:`w-full h-full object-cover ${r?"block":"hidden"}`,onLoad:()=>i(!0),onError:()=>o(!0)}),!r&&a.jsx(ea,{className:"w-8 h-8 text-bambu-gray"})]}):a.jsx(ea,{className:"w-8 h-8 text-bambu-gray"})}),l&&u&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-8",onClick:()=>c(!1),children:a.jsxs("div",{className:"relative max-w-2xl max-h-full",children:[a.jsx("img",{src:u,alt:n("printers.printPreview"),className:"max-w-full max-h-[80vh] rounded-lg shadow-2xl"}),e&&a.jsx("p",{className:"text-white text-center mt-4 text-lg",children:e})]})})]})}function XHe({printers:t}){const{t:e}=Vt(),n=tn(),[r,i]=w.useState(0);w.useEffect(()=>{let l=!1;const c=n.getQueryCache().subscribe(()=>{l||(l=!0,requestAnimationFrame(()=>{i(u=>u+1),l=!1}))});return()=>c()},[n]);const{counts:s,nextFinish:o}=w.useMemo(()=>{let l=0,c=0,u=0,d=0,h=null,f=null,p=0;return t?.forEach(x=>{const v=n.getQueryData(["printerStatus",x.id]);v===void 0?d++:v.connected?v.state==="RUNNING"?(l++,v.remaining_time!=null&&v.remaining_time>0&&(f===null||v.remaining_time0?"bg-bambu-green":"bg-gray-500"}`}),a.jsxs("span",{className:"text-bambu-gray",children:[a.jsx("span",{className:"text-white font-medium",children:s.idle})," ",e("printers.status.available").toLowerCase()]})]}),s.printing>0&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-bambu-green animate-pulse"}),a.jsxs("span",{className:"text-bambu-gray",children:[a.jsx("span",{className:"text-white font-medium",children:s.printing})," ",e("printers.status.printing").toLowerCase()]})]}),s.offline>0&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-400"}),a.jsxs("span",{className:"text-bambu-gray",children:[a.jsx("span",{className:"text-white font-medium",children:s.offline})," ",e("printers.status.offline").toLowerCase()]})]}),o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-px h-4 bg-bambu-dark-tertiary"}),a.jsxs("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-bambu-green font-medium",children:[e("printers.nextAvailable"),":"]}),a.jsx("span",{className:"text-white font-medium",children:o.name})]}),a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsx("div",{className:"w-full sm:w-16 bg-bambu-dark-tertiary rounded-full h-1.5",children:a.jsx("div",{className:"bg-bambu-green h-1.5 rounded-full transition-all",style:{width:`${o.progress}%`}})}),a.jsxs("span",{className:"text-white font-medium",children:[Math.round(o.progress),"%"]}),a.jsxs("span",{className:"text-bambu-gray",children:["(",Zs(o.remainingMin*60),")"]})]})]})]})]}):null}function c9(t,e){if(e)return e;switch(t){case"RUNNING":return"Printing";case"PAUSE":return"Paused";case"FINISH":return"Finished";case"FAILED":return"Failed";case"IDLE":return"Idle";default:return t?t.charAt(0)+t.slice(1).toLowerCase():"Idle"}}function TR(t){return t?{O1D:"H2D",O1E:"H2D Pro",O2D:"H2D Pro",O1C:"H2C",O1S:"H2S","BL-P001":"X1C","BL-P002":"X1","BL-P003":"X1E",C11:"P1S",C12:"P1P",C13:"P2S",N2S:"A1",N1:"A1 Mini",X1C:"X1C",X1:"X1",X1E:"X1E",P1S:"P1S",P1P:"P1P",P2S:"P2S",A1:"A1","A1 Mini":"A1 Mini",H2D:"H2D","H2D Pro":"H2D Pro",H2C:"H2C",H2S:"H2S"}[t]||t:""}function u9({printer:t,hideIfDisconnected:e,maintenanceInfo:n,viewMode:r="expanded",cardSize:i=2,amsThresholds:s,spoolmanEnabled:o=!1,hasUnlinkedSpools:l=!1,linkedSpools:c,spoolmanUrl:u,onGetAssignment:d,onUnassignSpool:h,timeFormat:f="system",cameraViewMode:p="window",onOpenEmbeddedCamera:x,checkPrinterFirmware:v=!0}){const{t:b}=Vt(),y=tn(),S=$c(),{showToast:N}=hn(),{hasPermission:A}=Ir(),[C,T]=w.useState(!1),[k,j]=w.useState(!1),[E,P]=w.useState(!0),[U,O]=w.useState(!1),[B,R]=w.useState(!1),[G,q]=w.useState(!1),[z,K]=w.useState(!1),[Y,oe]=w.useState(!1),[$,X]=w.useState(!1),[ee,J]=w.useState(!1),[_e,pe]=w.useState(!1),[me,je]=w.useState(!1),[de,ce]=w.useState(!1),[Se,ie]=w.useState(null),[Fe,V]=w.useState(null),[W,ue]=w.useState(null),[Q,se]=w.useState(null),[Z,Ne]=w.useState(!1),[ve,fe]=w.useState(null),[L,D]=w.useState(!1),[H,he]=w.useState(!1),[xe,be]=w.useState(null),[Ue,Oe]=w.useState(!1),[Qe,rt]=w.useState(!1),{data:we}=Ze({queryKey:["printerStatus",t.id],queryFn:()=>re.getPrinterStatus(t.id),refetchInterval:3e4}),{data:ye}=Ze({queryKey:["firmwareUpdate",t.id],queryFn:()=>JS.checkPrinterUpdate(t.id),staleTime:300*1e3,refetchInterval:300*1e3,enabled:v&&A("firmware:read")}),le=w.useMemo(()=>{const bt=new Set;if(we?.ams)for(const Et of we.ams)for(const Hn of Et.tray||[])Hn.tray_info_idx&&bt.add(Hn.tray_info_idx);for(const Et of we?.vt_tray??[])Et.tray_info_idx&&bt.add(Et.tray_info_idx);if(we?.nozzle_rack)for(const Et of we.nozzle_rack)Et.filament_id&&bt.add(Et.filament_id);return Array.from(bt)},[we?.ams,we?.vt_tray,we?.nozzle_rack]),{data:Le}=Ze({queryKey:["filamentInfo",le],queryFn:()=>re.getFilamentInfo(le),enabled:le.length>0,staleTime:300*1e3}),{data:Me}=Ze({queryKey:["slotPresets",t.id],queryFn:()=>re.getSlotPresets(t.id),staleTime:120*1e3}),[$e,Ae]=w.useState(null);w.useEffect(()=>{we?.wifi_signal!=null&&Ae(we.wifi_signal)},[we?.wifi_signal]);const Je=we?.wifi_signal??$e,Pe=w.useRef(void 0);w.useEffect(()=>{we?.connected!==void 0&&(Pe.current=we.connected)},[we?.connected]);const Xe=we?.connected??Pe.current,De=w.useRef({});w.useEffect(()=>{we?.ams_extruder_map&&Object.keys(we.ams_extruder_map).length>0&&(De.current=we.ams_extruder_map)},[we?.ams_extruder_map]);const Re=we?.ams_extruder_map&&Object.keys(we.ams_extruder_map).length>0?we.ams_extruder_map:De.current,qe=w.useRef([]);w.useEffect(()=>{we?.ams&&we.ams.length>0&&(qe.current=we.ams)},[we?.ams]);const pt=we?.ams&&we.ams.length>0?we.ams:qe.current,At=w.useRef(void 0),Rt=we?.tray_now;Rt!==void 0&&Rt!==255?At.current=Rt:Rt===255&&(At.current=void 0);const Wt=Rt!==void 0&&Rt!==255?Rt:At.current,{data:Tt}=Ze({queryKey:["smartPlugByPrinter",t.id],queryFn:()=>re.getSmartPlugByPrinter(t.id)}),{data:Ie}=Ze({queryKey:["scriptPlugsByPrinter",t.id],queryFn:()=>re.getScriptPlugsByPrinter(t.id)}),{data:xt}=Ze({queryKey:["smartPlugStatus",Tt?.id],queryFn:()=>Tt?re.getSmartPlugStatus(Tt.id):null,enabled:!!Tt,refetchInterval:1e4}),{data:wt}=Ze({queryKey:["queue",t.id,"pending"],queryFn:()=>re.getQueue(t.id,"pending")}),Bt=wt?.length||0,{data:Tn}=Ze({queryKey:["queue",t.id,"printing"],queryFn:()=>re.getQueue(t.id,"printing"),enabled:we?.state==="RUNNING"}),{data:fr}=Ze({queryKey:["currentPrintUser",t.id],queryFn:()=>re.getCurrentPrintUser(t.id),enabled:we?.state==="RUNNING"}),Zn=Tn?.[0]?.created_by_username||fr?.username,{data:Jn}=Ze({queryKey:["archives",t.id,"last"],queryFn:()=>re.getArchives(t.id,1,0),enabled:we?.connected&&we?.state!=="RUNNING"}),Pn=Jn?.[0],cr=e&&Xe===!1,jn=ot({mutationFn:bt=>re.deletePrinter(t.id,bt.deleteArchives),onSuccess:()=>{y.invalidateQueries({queryKey:["printers"]}),y.invalidateQueries({queryKey:["archives"]}),y.invalidateQueries({queryKey:["maintenanceOverview"]})},onError:bt=>N(bt.message||b("printers.toast.failedToDelete"),"error")}),ai=ot({mutationFn:()=>re.connectPrinter(t.id),onSuccess:()=>{y.invalidateQueries({queryKey:["printerStatus",t.id]})}}),ne=ot({mutationFn:bt=>Tt?re.controlSmartPlug(Tt.id,bt):Promise.reject("No plug"),onSuccess:()=>{y.invalidateQueries({queryKey:["smartPlugStatus",Tt?.id]})}}),He=ot({mutationFn:bt=>Tt?re.updateSmartPlug(Tt.id,{auto_off:bt}):Promise.reject("No plug"),onSuccess:()=>{y.invalidateQueries({queryKey:["smartPlugByPrinter",t.id]}),y.invalidateQueries({queryKey:["smart-plugs"]})}}),et=ot({mutationFn:bt=>re.controlSmartPlug(bt,"on"),onSuccess:()=>{N(b("printers.toast.scriptTriggered"))},onError:bt=>N(bt.message||b("printers.toast.failedToRunScript"),"error")}),lt=ot({mutationFn:()=>re.stopPrint(t.id),onSuccess:()=>{N(b("printers.toast.printStopped")),y.invalidateQueries({queryKey:["printerStatus",t.id]})},onError:bt=>N(bt.message||b("printers.toast.failedToStopPrint"),"error")}),dt=ot({mutationFn:()=>re.pausePrint(t.id),onSuccess:()=>{N(b("printers.toast.printPaused")),y.invalidateQueries({queryKey:["printerStatus",t.id]})},onError:bt=>N(bt.message||b("printers.toast.failedToPausePrint"),"error")}),Lt=ot({mutationFn:()=>re.resumePrint(t.id),onSuccess:()=>{N(b("printers.toast.printResumed")),y.invalidateQueries({queryKey:["printerStatus",t.id]})},onError:bt=>N(bt.message||b("printers.toast.failedToResumePrint"),"error")}),ge=ot({mutationFn:bt=>re.setChamberLight(t.id,bt),onMutate:async bt=>{await y.cancelQueries({queryKey:["printerStatus",t.id]});const Et=y.getQueryData(["printerStatus",t.id]);return y.setQueryData(["printerStatus",t.id],Hn=>({...Hn,chamber_light:bt})),{previousStatus:Et}},onSuccess:(bt,Et)=>{N(`Chamber light ${Et?"on":"off"}`)},onError:(bt,Et,Hn)=>{Hn?.previousStatus&&y.setQueryData(["printerStatus",t.id],Hn.previousStatus),N(bt.message||b("printers.toast.failedToControlChamberLight"),"error")}}),ze=ot({mutationFn:bt=>re.updatePrinter(t.id,{plate_detection_enabled:bt}),onSuccess:()=>{y.invalidateQueries({queryKey:["printers"]}),N(ze.variables?b("printers.toast.plateCheckEnabled"):b("printers.toast.plateCheckDisabled"))},onError:bt=>N(bt.message||b("printers.toast.failedToUpdateSetting"),"error")}),Ge=(we?.state==="RUNNING"||we?.state==="PAUSE"||we?.state==="PAUSED")&&(we?.printable_objects_count??0)>=2,{data:Ve}=Ze({queryKey:["printableObjects",t.id],queryFn:()=>re.getPrintableObjects(t.id),enabled:de||Ge,refetchInterval:de?5e3:Ge?3e4:!1}),[Ee,st]=w.useState(null),tt=w.useRef(!1),at=w.useRef(null),Mt=w.useRef(!1),Kt=ot({mutationFn:({amsId:bt,slotId:Et})=>re.refreshAmsSlot(t.id,bt,Et),onMutate:({amsId:bt,slotId:Et})=>{at.current&&clearTimeout(at.current),tt.current=!1,Mt.current=!1,st({amsId:bt,slotId:Et}),setTimeout(()=>{Mt.current=!0},2e3),at.current=setTimeout(()=>{st(null)},3e4)},onSuccess:bt=>{N(bt.message||b("printers.toast.rfidRereadInitiated"))},onError:bt=>{N(bt.message||b("printers.toast.failedToRereadRfid"),"error"),at.current&&clearTimeout(at.current),st(null)}}),[Ot,jt]=w.useState(null),[Ht,Zt]=w.useState(null),nn=async()=>{try{const bt=await re.getPlateReferences(t.id);jt(bt)}catch{}},Mn=()=>{ze.mutate(!t.plate_detection_enabled)},pn=async()=>{D(!0),fe(null);const bt=we?.chamber_light===!1;rt(bt),bt&&(await re.setChamberLight(t.id,!0),await new Promise(Et=>setTimeout(Et,2500)));try{const Et=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(Et),nn()}catch(Et){N(Et instanceof Error?Et.message:b("printers.toast.failedToCheckPlate"),"error"),bt&&(await re.setChamberLight(t.id,!1),rt(!1))}finally{D(!1)}},Xt=w.useCallback(async()=>{fe(null),Qe&&(await re.setChamberLight(t.id,!1),rt(!1))},[Qe,t.id]),sn=async bt=>{he(!0);try{const Et=await re.calibratePlateDetection(t.id,{label:bt});if(Et.success){N(Et.message||b("printers.toast.calibrationSaved"),"success"),nn();const Hn=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(Hn)}else N(Et.message||b("printers.toast.calibrationFailed"),"error")}catch(Et){N(Et instanceof Error?Et.message:b("printers.toast.calibrationFailed"),"error")}finally{he(!1)}},fn=async(bt,Et)=>{try{await re.updatePlateReferenceLabel(t.id,bt,Et),Zt(null),nn()}catch(Hn){N(Hn instanceof Error?Hn.message:b("printers.toast.failedToUpdateLabel"),"error")}},Mr=async bt=>{try{await re.deletePlateReference(t.id,bt),N(b("printers.toast.referenceDeleted"),"success"),nn();const Et=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(Et)}catch(Et){N(Et instanceof Error?Et.message:b("printers.toast.failedToDeleteReference"),"error")}},Qr=async()=>{if(xe){Oe(!0);try{await re.updatePrinter(t.id,{plate_detection_roi:xe}),N(b("printers.toast.detectionAreaSaved"),"success"),be(null);const bt=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(bt)}catch(bt){N(bt instanceof Error?bt.message:b("printers.toast.failedToSaveDetectionArea"),"error")}finally{Oe(!1)}}};w.useEffect(()=>{const bt=Et=>{Et.key==="Escape"&&ve&&Xt()};return window.addEventListener("keydown",bt),()=>window.removeEventListener("keydown",bt)},[ve,Xt]);const gn=w.useRef(null);w.useEffect(()=>{if(!Ee)return;const bt=we?.ams_status_main??0;return bt!==0&&(tt.current=!0,gn.current&&(clearTimeout(gn.current),gn.current=null)),tt.current&&bt===0&&(Mt.current?(at.current&&clearTimeout(at.current),st(null)):gn.current||(gn.current=setTimeout(()=>{at.current&&clearTimeout(at.current),st(null)},2e3))),()=>{gn.current&&clearTimeout(gn.current)}},[we?.ams_status_main,Ee]);const[Zr,Kn]=w.useState(null);if(cr)return null;const vi=()=>{switch(i){case 1:return"w-10 h-10";case 2:return"w-14 h-14";case 3:return"w-16 h-16";case 4:return"w-20 h-20";default:return"w-14 h-14"}},mi=()=>{switch(i){case 1:return"text-base truncate";case 2:return"text-lg";case 3:return"text-xl";case 4:return"text-2xl";default:return"text-lg"}},fi=()=>{switch(i){case 1:return"mb-2";case 2:return"mb-4";case 3:return"mb-5";case 4:return"mb-6";default:return"mb-4"}};return a.jsxs(vt,{className:"relative",children:[a.jsxs(Nt,{className:i>=3?"p-5":"",children:[a.jsxs("div",{className:fi(),children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[a.jsx("img",{src:qHe(t.model),alt:t.model||b("common.printer"),className:`object-contain rounded-lg bg-bambu-dark flex-shrink-0 ${vi()}`}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:`font-semibold text-white ${mi()}`,children:t.name}),r==="compact"&&a.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${we?.connected?"bg-status-ok":"bg-status-error"}`,title:we?.connected?b("printers.connection.connected"):b("printers.connection.offline")})]}),a.jsxs("p",{className:"text-sm text-bambu-gray",children:[t.model||"Unknown Model",r==="expanded"&&we?.nozzles&&we.nozzles[0]?.nozzle_diameter&&a.jsxs("span",{className:"ml-1.5 text-bambu-gray",title:we.nozzles[0].nozzle_type||"Nozzle",children:["• ",we.nozzles[0].nozzle_diameter,"mm"]}),r==="expanded"&&n&&n.total_print_hours>0&&a.jsxs("span",{className:"ml-2 text-bambu-gray",children:[a.jsx(Wn,{className:"w-3 h-3 inline-block mr-1"}),Math.round(n.total_print_hours),"h"]})]})]})]}),a.jsxs("div",{className:"relative flex-shrink-0",children:[a.jsx(Ce,{variant:"ghost",size:"sm",onClick:()=>T(!C),children:a.jsx(Eh,{className:"w-4 h-4"})}),C&&a.jsxs("div",{className:"absolute right-0 mt-2 w-48 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg shadow-lg z-20",children:[a.jsxs("button",{className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 ${A("printers:update")?"hover:bg-bambu-dark-tertiary":"opacity-50 cursor-not-allowed"}`,onClick:()=>{A("printers:update")&&(O(!0),T(!1))},title:A("printers:update")?void 0:b("printers.permission.noEdit"),children:[a.jsx(Vi,{className:"w-4 h-4"}),b("common.edit")]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm hover:bg-bambu-dark-tertiary flex items-center gap-2",onClick:()=>{ai.mutate(),T(!1)},children:[a.jsx(kr,{className:"w-4 h-4"}),b("printers.reconnect")]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm hover:bg-bambu-dark-tertiary flex items-center gap-2",onClick:()=>{q(!0),T(!1)},children:[a.jsx(wX,{className:"w-4 h-4"}),b("printers.mqttDebug")]}),a.jsxs("button",{className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 ${A("printers:delete")?"text-red-400 hover:bg-bambu-dark-tertiary":"text-red-400/50 cursor-not-allowed"}`,onClick:()=>{A("printers:delete")&&(j(!0),T(!1))},title:A("printers:delete")?void 0:b("printers.permission.noDelete"),children:[a.jsx(Jt,{className:"w-4 h-4"}),b("common.delete")]})]})]})]}),r==="expanded"&&a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[a.jsxs("span",{className:`flex items-center gap-1.5 px-2 py-1 rounded-full text-xs ${we?.connected?"bg-status-ok/20 text-status-ok":"bg-status-error/20 text-status-error"}`,children:[we?.connected?a.jsx(Wb,{className:"w-3 h-3"}):a.jsx(dC,{className:"w-3 h-3"}),we?.connected?b("printers.connection.connected"):b("printers.connection.offline")]}),we?.connected&&Je!=null&&a.jsxs("span",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs ${Je>=-50||Je>=-60?"bg-status-ok/20 text-status-ok":Je>=-70?"bg-status-warning/20 text-status-warning":Je>=-80?"bg-orange-500/20 text-orange-600":"bg-status-error/20 text-status-error"}`,title:`WiFi: ${Je} dBm - ${b(WHe(Je).labelKey)}`,children:[a.jsx($fe,{className:"w-3 h-3"}),Je,"dBm"]}),we?.connected&&(()=>{const bt=we.hms_errors?uAe(we.hms_errors):[];return a.jsxs("button",{onClick:()=>X(!0),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs cursor-pointer hover:opacity-80 transition-opacity ${bt.length>0?bt.some(Et=>Et.severity<=2)?"bg-status-error/20 text-status-error":"bg-status-warning/20 text-status-warning":"bg-status-ok/20 text-status-ok"}`,title:b("printers.clickToViewHmsErrors"),children:[a.jsx(Cn,{className:"w-3 h-3"}),bt.length>0?bt.length:"OK"]})})(),n&&a.jsxs("button",{onClick:()=>S("/maintenance"),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs cursor-pointer hover:opacity-80 transition-opacity ${n.due_count>0?"bg-status-error/20 text-status-error":n.warning_count>0?"bg-status-warning/20 text-status-warning":"bg-status-ok/20 text-status-ok"}`,title:n.due_count>0||n.warning_count>0?`${n.due_count>0?`${n.due_count} maintenance due`:""}${n.due_count>0&&n.warning_count>0?", ":""}${n.warning_count>0?`${n.warning_count} due soon`:""} - Click to view`:b("printers.maintenanceUpToDate"),children:[a.jsx(Ff,{className:"w-3 h-3"}),n.due_count>0||n.warning_count>0?n.due_count+n.warning_count:"OK"]}),Bt>0&&a.jsxs("button",{onClick:()=>S("/queue"),className:"flex items-center gap-1 px-2 py-1 rounded-full text-xs bg-purple-500/20 text-purple-400 hover:opacity-80 transition-opacity",title:b("printers.queue.inQueue",{count:Bt}),children:[a.jsx(ma,{className:"w-3 h-3"}),Bt]}),v&&ye?.current_version&&ye?.latest_version?a.jsxs("button",{onClick:()=>Ne(!0),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs hover:opacity-80 transition-opacity ${ye.update_available?"bg-orange-500/20 text-orange-400":"bg-status-ok/20 text-status-ok"}`,title:ye.update_available?b("printers.firmwareUpdateAvailable",{current:ye.current_version,latest:ye.latest_version}):b("printers.firmwareUpToDate",{version:ye.current_version}),children:[ye.update_available?a.jsx(di,{className:"w-3 h-3"}):a.jsx(gr,{className:"w-3 h-3"}),ye.current_version]}):we?.firmware_version?a.jsx("span",{className:"flex items-center gap-1 px-2 py-1 rounded-full text-xs bg-bambu-dark-tertiary/50 text-bambu-gray",children:we.firmware_version}):null]})]}),k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsx(vt,{className:"w-full max-w-md mx-4",children:a.jsxs(Nt,{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[a.jsx("div",{className:"p-2 rounded-full bg-red-500/20",children:a.jsx(Cn,{className:"w-5 h-5 text-red-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:b("printers.confirm.deleteTitle")}),a.jsx("p",{className:"text-sm text-bambu-gray mt-1",children:b("printers.confirm.deleteMessage",{name:t.name})})]})]}),a.jsx("div",{className:"bg-bambu-dark rounded-lg p-3 mb-4",children:a.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:E,onChange:bt=>P(bt.target.checked),className:"mt-0.5 w-4 h-4 rounded border-bambu-gray bg-bambu-dark-secondary text-bambu-green focus:ring-bambu-green focus:ring-offset-0"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-white",children:b("printers.deleteArchives")}),a.jsx("p",{className:"text-xs text-bambu-gray mt-0.5",children:b(E?"printers.confirm.deleteArchivesNote":"printers.confirm.keepArchivesNote")})]})]})}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(Ce,{variant:"secondary",onClick:()=>{j(!1),P(!0)},children:b("common.cancel")}),a.jsx(Ce,{variant:"danger",onClick:()=>{jn.mutate({deleteArchives:E}),j(!1),P(!0)},children:"Delete"})]})]})})}),we?.connected&&a.jsxs(a.Fragment,{children:[r==="compact"?a.jsx("div",{className:"mt-2",children:we.state==="RUNNING"?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1 bg-bambu-dark-tertiary rounded-full h-1.5",children:a.jsx("div",{className:"bg-bambu-green h-1.5 rounded-full transition-all",style:{width:`${we.progress||0}%`}})}),a.jsxs("span",{className:"text-xs text-white",children:[Math.round(we.progress||0),"%"]})]}):a.jsx("p",{className:"text-xs text-bambu-gray",children:c9(we.state,we.stg_cur_name)})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 p-3 bg-bambu-dark rounded-lg relative",children:[a.jsxs("button",{onClick:()=>ce(!0),disabled:!(we.state==="RUNNING"||we.state==="PAUSE"||we.state==="PAUSED")||(we.printable_objects_count??0)<2||!A("printers:control"),className:`absolute top-2 right-2 p-1.5 rounded transition-colors z-10 ${(we.state==="RUNNING"||we.state==="PAUSE"||we.state==="PAUSED")&&(we.printable_objects_count??0)>=2&&A("printers:control")?"text-bambu-gray hover:text-white hover:bg-white/10":"text-bambu-gray/30 cursor-not-allowed"}`,title:A("printers:control")?we.state==="RUNNING"||we.state==="PAUSE"||we.state==="PAUSED"?(we.printable_objects_count??0)>=2?b("printers.skipObjects.tooltip"):b("printers.skipObjects.requiresMultiple"):b("printers.skipObjects.onlyWhilePrinting"):b("printers.permission.noControl"),children:[a.jsx(SC,{className:"w-4 h-4"}),Ve&&Ve.skipped_count>0&&a.jsx("span",{className:"absolute -top-1 -right-1 min-w-[16px] h-4 px-1 flex items-center justify-center text-[10px] font-bold bg-red-500 text-white rounded-full",children:Ve.skipped_count})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(KHe,{url:we.state==="RUNNING"?we.cover_url:null,printName:we.state==="RUNNING"&&(we.subtask_name||we.current_print)||void 0}),a.jsx("div",{className:"flex-1 min-w-0",children:we.current_print&&we.state==="RUNNING"?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm text-bambu-gray mb-1",children:we.stg_cur_name||"Printing"}),a.jsx("p",{className:"text-white text-sm mb-2 truncate",children:we.subtask_name||we.current_print}),a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("div",{className:"flex-1 bg-bambu-dark-tertiary rounded-full h-2 mr-3",children:a.jsx("div",{className:"bg-bambu-green h-2 rounded-full transition-all",style:{width:`${we.progress||0}%`}})}),a.jsxs("span",{className:"text-white",children:[Math.round(we.progress||0),"%"]})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-bambu-gray",children:[we.remaining_time!=null&&we.remaining_time>0&&a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Wn,{className:"w-3 h-3"}),Zs(we.remaining_time*60)]}),a.jsxs("span",{className:"text-bambu-green font-medium",title:b("printers.estimatedCompletion"),children:["ETA ",$F(we.remaining_time,f,b)]})]}),we.layer_num!=null&&we.total_layers!=null&&we.total_layers>0&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ma,{className:"w-3 h-3"}),we.layer_num,"/",we.total_layers]}),Zn&&a.jsxs("span",{className:"flex items-center gap-1",title:`Started by ${Zn}`,children:[a.jsx(rd,{className:"w-3 h-3"}),Zn]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm text-bambu-gray mb-1",children:b("printers.sort.status")}),a.jsx("p",{className:"text-white text-sm mb-2",children:c9(we.state,we.stg_cur_name)}),a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("div",{className:"flex-1 bg-bambu-dark-tertiary rounded-full h-2 mr-3",children:a.jsx("div",{className:"bg-bambu-dark-tertiary h-2 rounded-full"})}),a.jsx("span",{className:"text-bambu-gray",children:"—"})]}),Pn?a.jsxs("p",{className:"text-xs text-bambu-gray mt-2 truncate",title:Pn.print_name||Pn.filename,children:["Last: ",Pn.print_name||Pn.filename,Pn.completed_at&&a.jsxs("span",{className:"ml-1 text-bambu-gray/60",children:["• ",gb(Pn.completed_at,{month:"short",day:"numeric"})]})]}):a.jsx("p",{className:"text-xs text-bambu-gray mt-2",children:b("printers.readyToPrint")})]})})]})]}),a.jsx(fAe,{printerId:t.id,printerState:we.state})]}),we.temperatures&&r==="expanded"&&(()=>{const bt=we.temperatures.nozzle_heating||we.temperatures.nozzle_2_heating||!1,Et=we.temperatures.bed_heating||!1,Hn=we.temperatures.chamber_heating||!1,kt=t.nozzle_count===2||we.temperatures.nozzle_2!==void 0,Nn=we.active_extruder===1?"L":"R",si=we.nozzle_rack?.find(ka=>ka.id===1),Fn=we.nozzle_rack?.find(ka=>ka.id===0),sa=Fn||si;return a.jsxs("div",{className:"flex items-stretch gap-1.5 flex-wrap",children:[a.jsxs("div",{className:"text-center px-2 py-1.5 bg-bambu-dark rounded-lg flex-1 flex flex-col justify-center items-center",children:[a.jsx(aj,{className:"w-3.5 h-3.5 mb-0.5",color:"text-orange-400",isHeating:bt}),we.temperatures.nozzle_2!==void 0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-[9px] text-bambu-gray",children:"L / R"}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.nozzle||0),"° / ",Math.round(we.temperatures.nozzle_2||0),"°"]})]}):sa?a.jsx(fne,{slot:sa,index:0,activeStatus:!0,filamentName:sa.filament_id?Le?.[sa.filament_id]?.name:void 0,children:a.jsxs("div",{className:"cursor-default",children:[a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.nozzle")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.nozzle||0),"°C"]})]})}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.nozzle")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.nozzle||0),"°C"]})]})]}),a.jsxs("div",{className:"text-center px-2 py-1.5 bg-bambu-dark rounded-lg flex-1 flex flex-col justify-center items-center",children:[a.jsx(aj,{className:"w-3.5 h-3.5 mb-0.5",color:"text-blue-400",isHeating:Et}),a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.bed")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.bed||0),"°C"]})]}),we.temperatures.chamber!==void 0&&a.jsxs("div",{className:"text-center px-2 py-1.5 bg-bambu-dark rounded-lg flex-1 flex flex-col justify-center items-center",children:[a.jsx(aj,{className:"w-3.5 h-3.5 mb-0.5",color:"text-green-400",isHeating:Hn}),a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.chamber")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.chamber||0),"°C"]})]}),kt&&a.jsx(zHe,{leftSlot:si,rightSlot:Fn,activeNozzle:Nn,filamentInfo:Le,children:a.jsxs("div",{className:"text-center px-3 py-1.5 bg-bambu-dark rounded-lg h-full flex flex-col justify-center items-center cursor-default",title:b("printers.activeNozzle",{nozzle:b(Nn==="L"?"common.left":"common.right")}),children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsxs("span",{className:`text-[11px] font-bold ${Nn==="L"?"text-amber-400":"text-gray-500"}`,children:["L",si?.nozzle_diameter?` ${si.nozzle_diameter}`:""]}),a.jsx("span",{className:"text-[9px] text-bambu-gray/40",children:"·"}),a.jsxs("span",{className:`text-[11px] font-bold ${Nn==="R"?"text-amber-400":"text-gray-500"}`,children:["R",Fn?.nozzle_diameter?` ${Fn.nozzle_diameter}`:""]})]}),a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.nozzle")})]})}),we.nozzle_rack&&we.nozzle_rack.some(ka=>ka.id>=2)&&a.jsx(UHe,{slots:we.nozzle_rack,filamentInfo:Le})]})})(),r==="expanded"&&(()=>{const bt=we.state==="RUNNING",Et=we.state==="PAUSED"||we.state==="PAUSE",Hn=bt||Et,kt=lt.isPending||dt.isPending||Lt.isPending,Nn=we.cooling_fan_speed,si=we.big_fan1_speed,Fn=we.big_fan2_speed;return a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-bambu-gray font-medium",children:b("printers.controls")}),a.jsx("div",{className:"flex-1 h-px bg-bambu-dark-tertiary/30"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2 max-[550px]:items-start",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-[550px]:flex-wrap max-[550px]:items-start max-[550px]:gap-1.5",children:[a.jsxs("div",{className:`flex items-center gap-1 px-1.5 py-1 rounded ${Nn&&Nn>0?"bg-cyan-500/10":"bg-bambu-dark"}`,title:b("printers.fans.partCooling"),children:[a.jsx(hX,{className:`w-3.5 h-3.5 ${Nn&&Nn>0?"text-cyan-400":"text-bambu-gray/50"}`}),a.jsxs("span",{className:`text-[10px] ${Nn&&Nn>0?"text-cyan-400":"text-bambu-gray/50"}`,children:[Nn??0,"%"]})]}),a.jsxs("div",{className:`flex items-center gap-1 px-1.5 py-1 rounded ${si&&si>0?"bg-blue-500/10":"bg-bambu-dark"}`,title:b("printers.fans.auxiliary"),children:[a.jsx(SX,{className:`w-3.5 h-3.5 ${si&&si>0?"text-blue-400":"text-bambu-gray/50"}`}),a.jsxs("span",{className:`text-[10px] ${si&&si>0?"text-blue-400":"text-bambu-gray/50"}`,children:[si??0,"%"]})]}),a.jsxs("div",{className:`flex items-center gap-1 px-1.5 py-1 rounded ${Fn&&Fn>0?"bg-green-500/10":"bg-bambu-dark"}`,title:b("printers.fans.chamber"),children:[a.jsx(cde,{className:`w-3.5 h-3.5 ${Fn&&Fn>0?"text-green-400":"text-bambu-gray/50"}`}),a.jsxs("span",{className:`text-[10px] ${Fn&&Fn>0?"text-green-400":"text-bambu-gray/50"}`,children:[Fn??0,"%"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 max-[550px]:self-start",children:[a.jsxs("button",{onClick:()=>J(!0),disabled:!Hn||kt||!A("printers:control"),className:` + `})]})]})}function UHe({slots:t,filamentInfo:e}){const{t:n}=Vt(),r=t.filter(l=>l.id>=2),i=6,s=r.length>0?Math.min(...r.map(l=>l.id)):16,o=Array.from({length:i},(l,c)=>r.find(u=>u.id===s+c)??{id:-(c+1),nozzle_type:"",nozzle_diameter:"",wear:null,stat:null,max_temp:0,serial_number:"",filament_color:"",filament_id:"",filament_type:""});return a.jsxs("div",{className:"text-center px-2.5 py-1.5 bg-bambu-dark rounded-lg flex-[2_1_190px] flex flex-col justify-center",children:[a.jsx("p",{className:"text-[9px] text-bambu-gray mb-1",children:n("printers.nozzleRack")}),a.jsx("div",{className:"flex gap-[3px] justify-center",children:o.map((l,c)=>{const u=!l.nozzle_diameter&&!l.nozzle_type,d=u?null:S4(l.filament_color),h=d?IHe(l.filament_color):!1;return a.jsx(fne,{slot:l,index:c,filamentName:l.filament_id?e?.[l.filament_id]?.name:void 0,children:a.jsx("div",{className:`w-7 h-7 rounded flex items-center justify-center cursor-default transition-colors border-b-2 ${u?"bg-bambu-dark-tertiary/20 border-bambu-dark-tertiary/20":"bg-bambu-dark-tertiary/40 border-bambu-dark-tertiary/40"}`,style:d?{backgroundColor:d}:void 0,children:a.jsx("span",{className:`text-[10px] font-semibold ${u?"text-bambu-gray/30":h?"text-black/80":"text-white"}`,style:d&&!h?{textShadow:"0 1px 3px rgba(0,0,0,0.9)"}:void 0,children:u?"—":l.nozzle_diameter||"?"})})},l.id>=0?l.id:`empty-${c}`)})})]})}function s9({className:t}){return a.jsx("svg",{className:t,viewBox:"0 0 36 54",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M17.8131 0.00538C18.4463 -0.15091 20.3648 3.14642 20.8264 3.84781C25.4187 10.816 35.3089 26.9368 35.9383 34.8694C37.4182 53.5822 11.882 61.3357 2.53721 45.3789C-1.73471 38.0791 0.016 32.2049 3.178 25.0232C6.99221 16.3662 12.6411 7.90372 17.8131 0.00538ZM18.3738 7.24807L17.5881 7.48441C14.4452 12.9431 10.917 18.2341 8.19369 23.9368C4.6808 31.29 1.18317 38.5479 7.69403 45.5657C17.3058 55.9228 34.9847 46.8808 31.4604 32.8681C29.2558 24.0969 22.4207 15.2913 18.3776 7.24807H18.3738Z",fill:"#C3C2C1"})})}function BHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 35 53",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M17.3165 0.0038C17.932 -0.14959 19.7971 3.08645 20.2458 3.77481C24.7103 10.6135 34.3251 26.4346 34.937 34.2198C36.3757 52.5848 11.5505 60.1942 2.46584 44.534C-1.68714 37.3735 0.0148 31.6085 3.08879 24.5603C6.79681 16.0605 12.2884 7.75907 17.3165 0.0038ZM17.8615 7.11561L17.0977 7.34755C14.0423 12.7048 10.6124 17.8974 7.96483 23.4941C4.54975 30.7107 1.14949 37.8337 7.47908 44.721C16.8233 54.8856 34.01 46.0117 30.5838 32.2595C28.4405 23.6512 21.7957 15.0093 17.8652 7.11561H17.8615Z",fill:"#C3C2C1"}),a.jsx("path",{d:"M5.03547 30.112C9.64453 30.4936 11.632 35.7985 16.4154 35.791C19.6339 35.7873 20.2161 33.2283 22.3853 31.6197C31.6776 24.7286 33.5835 37.4894 27.9881 44.4254C18.1878 56.5653 -1.16063 44.6013 5.03917 30.1158L5.03547 30.112Z",fill:"#1F8FEB"})]})}function HHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 36 54",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M17.9625 4.48059L4.77216 26.3154L2.08228 40.2175L10.0224 50.8414H23.1594L33.3246 42.1693V30.2455L17.9625 4.48059Z",fill:"#1F8FEB"}),a.jsx("path",{d:"M17.7948 0.00538C18.4273 -0.15091 20.3438 3.14642 20.8048 3.84781C25.3921 10.816 35.2715 26.9368 35.9001 34.8694C37.3784 53.5822 11.8702 61.3357 2.53562 45.3789C-1.73163 38.0829 0.0134 32.2087 3.1757 25.027C6.98574 16.3662 12.6284 7.90372 17.7948 0.00538ZM18.3549 7.24807L17.57 7.48441C14.4306 12.9431 10.9063 18.2341 8.1859 23.9368C4.67686 31.29 1.18305 38.5479 7.68679 45.5657C17.2881 55.9228 34.9476 46.8808 31.4271 32.8681C29.2249 24.0969 22.3974 15.2913 18.3587 7.24807H18.3549Z",fill:"#C3C2C1"})]})}function $He({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"}),a.jsx("circle",{cx:"6",cy:"15",r:"2.5",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"})]})}function VHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"4.5",y:"8",width:"3",height:"4.5",fill:"#d4a017",rx:"0.5"}),a.jsx("circle",{cx:"6",cy:"15",r:"2",fill:"#d4a017"}),a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"})]})}function GHe({className:t}){return a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"4.5",y:"3",width:"3",height:"9.5",fill:"#c62828",rx:"0.5"}),a.jsx("circle",{cx:"6",cy:"15",r:"2",fill:"#c62828"}),a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:"#C3C2C1",strokeWidth:"1",fill:"none"})]})}function aj({className:t,color:e,isHeating:n}){const i={"text-orange-400":"#fb923c","text-blue-400":"#60a5fa","text-green-400":"#4ade80"}[e]||"#888",s=n?{filter:`drop-shadow(0 0 4px ${i}) drop-shadow(0 0 8px ${i})`}:{};return n?a.jsxs("svg",{className:t,style:s,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"4.5",y:"3",width:"3",height:"9.5",fill:i,rx:"0.5"}),a.jsx("circle",{cx:"6",cy:"15",r:"2",fill:i}),a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:i,strokeWidth:"1",fill:"none"})]}):a.jsxs("svg",{className:t,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6 0.5C4.6 0.5 3.5 1.6 3.5 3V12.1C2.6 12.8 2 13.9 2 15C2 17.2 3.8 19 6 19C8.2 19 10 17.2 10 15C10 13.9 9.4 12.8 8.5 12.1V3C8.5 1.6 7.4 0.5 6 0.5Z",stroke:i,strokeWidth:"1",fill:"none"}),a.jsx("circle",{cx:"6",cy:"15",r:"2.5",stroke:i,strokeWidth:"1",fill:"none"})]})}function o9({humidity:t,goodThreshold:e=40,fairThreshold:n=60,onClick:r,compact:i}){const s=typeof t=="string"?parseInt(t,10):t,o=typeof e=="number"?e:40,l=typeof n=="number"?n:60;let c,u;isNaN(s)?(c="#C3C2C1",u="Unknown"):s<=o?(c="#22a352",u="Good"):s<=l?(c="#d4a017",u="Fair"):(c="#c62828",u="Bad");let d;return isNaN(s)||s<=o?d=s9:s<=l?d=BHe:d=HHe,a.jsxs("button",{type:"button",onClick:r,className:`flex items-center gap-1 ${r?"cursor-pointer hover:opacity-80 transition-opacity":""}`,title:`Humidity: ${s}% - ${u}${r?" (click for history)":""}`,children:[a.jsx(d,{className:i?"w-2.5 h-3":"w-3 h-4"}),a.jsxs("span",{className:`font-medium tabular-nums ${i?"text-[10px]":"text-xs"}`,style:{color:c},children:[s,"%"]})]})}function l9({temp:t,goodThreshold:e=28,fairThreshold:n=35,onClick:r,compact:i}){const s=typeof e=="number"?e:28,o=typeof n=="number"?n:35;let l,c,u;return t<=s?(l="#22a352",c="Good",u=$He):t<=o?(l="#d4a017",c="Fair",u=VHe):(l="#c62828",c="Bad",u=GHe),a.jsxs("button",{type:"button",onClick:r,className:`flex items-center gap-1 ${r?"cursor-pointer hover:opacity-80 transition-opacity":""}`,title:`Temperature: ${t}°C - ${c}${r?" (click for history)":""}`,children:[a.jsx(u,{className:i?"w-2.5 h-3":"w-3 h-4"}),a.jsxs("span",{className:`tabular-nums text-right ${i?"text-[10px] w-8":"w-12"}`,style:{color:l},children:[t,"°C"]})]})}function ih(t,e){const n=typeof t=="string"?parseInt(t,10):t,r=isNaN(n)?0:n,i=e===1,s=r>=128?r-128:r,o=String.fromCharCode(65+s);return i?`HT-${o}`:`AMS-${o}`}function sj(t){return t>50?"#00ae42":t>=15?"#f59e0b":"#ef4444"}function oj(t){return!t?.remaining_weight||!t?.filament_weight||t.filament_weight<=0?null:Math.min(100,Math.round(t.remaining_weight/t.filament_weight*100))}function qHe(t){if(!t)return"/img/printers/default.png";const e=t.toLowerCase().replace(/\s+/g,"");return e.includes("x1e")?"/img/printers/x1e.png":e.includes("x1c")||e.includes("x1carbon")||e.includes("x1")?"/img/printers/x1c.png":e.includes("h2d")?"/img/printers/h2d.png":e.includes("h2c")?"/img/printers/h2c.png":e.includes("h2s")?"/img/printers/h2d.png":e.includes("p2s")||e.includes("p1s")?"/img/printers/p1s.png":e.includes("p1p")?"/img/printers/p1p.png":e.includes("a1mini")?"/img/printers/a1mini.png":e.includes("a1")?"/img/printers/a1.png":"/img/printers/default.png"}function WHe(t){return t>=-50?{labelKey:"printers.wifiSignal.excellent",color:"text-bambu-green",bars:4}:t>=-60?{labelKey:"printers.wifiSignal.good",color:"text-bambu-green",bars:3}:t>=-70?{labelKey:"printers.wifiSignal.fair",color:"text-yellow-400",bars:2}:t>=-80?{labelKey:"printers.wifiSignal.weak",color:"text-orange-400",bars:1}:{labelKey:"printers.wifiSignal.veryWeak",color:"text-red-400",bars:1}}function lj(t){return t?!!(t.tray_uuid&&t.tray_uuid!=="00000000000000000000000000000000"||t.tag_uid&&t.tag_uid!=="0000000000000000"):!1}function KHe({url:t,printName:e}){const{t:n}=Vt(),[r,i]=w.useState(!1),[s,o]=w.useState(!1),[l,c]=w.useState(!1),u=w.useMemo(()=>{if(!t)return null;const d=t.includes("?")?"&":"?";return`${t}${d}v=${encodeURIComponent(e||Date.now().toString())}`},[t,e]);return w.useEffect(()=>{i(!1),o(!1)},[u]),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`w-20 h-20 flex-shrink-0 rounded-lg overflow-hidden bg-bambu-dark-tertiary flex items-center justify-center ${u&&r?"cursor-pointer":""}`,onClick:()=>u&&r&&c(!0),children:u&&!s?a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:n("printers.printPreview"),className:`w-full h-full object-cover ${r?"block":"hidden"}`,onLoad:()=>i(!0),onError:()=>o(!0)}),!r&&a.jsx(ea,{className:"w-8 h-8 text-bambu-gray"})]}):a.jsx(ea,{className:"w-8 h-8 text-bambu-gray"})}),l&&u&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-8",onClick:()=>c(!1),children:a.jsxs("div",{className:"relative max-w-2xl max-h-full",children:[a.jsx("img",{src:u,alt:n("printers.printPreview"),className:"max-w-full max-h-[80vh] rounded-lg shadow-2xl"}),e&&a.jsx("p",{className:"text-white text-center mt-4 text-lg",children:e})]})})]})}function XHe({printers:t}){const{t:e}=Vt(),n=tn(),[r,i]=w.useState(0);w.useEffect(()=>{let l=!1;const c=n.getQueryCache().subscribe(()=>{l||(l=!0,requestAnimationFrame(()=>{i(u=>u+1),l=!1}))});return()=>c()},[n]);const{counts:s,nextFinish:o}=w.useMemo(()=>{let l=0,c=0,u=0,d=0,h=null,f=null,p=0;return t?.forEach(x=>{const v=n.getQueryData(["printerStatus",x.id]);v===void 0?d++:v.connected?v.state==="RUNNING"?(l++,v.remaining_time!=null&&v.remaining_time>0&&(f===null||v.remaining_time0?"bg-bambu-green":"bg-gray-500"}`}),a.jsxs("span",{className:"text-bambu-gray",children:[a.jsx("span",{className:"text-white font-medium",children:s.idle})," ",e("printers.status.available").toLowerCase()]})]}),s.printing>0&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-bambu-green animate-pulse"}),a.jsxs("span",{className:"text-bambu-gray",children:[a.jsx("span",{className:"text-white font-medium",children:s.printing})," ",e("printers.status.printing").toLowerCase()]})]}),s.offline>0&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-400"}),a.jsxs("span",{className:"text-bambu-gray",children:[a.jsx("span",{className:"text-white font-medium",children:s.offline})," ",e("printers.status.offline").toLowerCase()]})]}),o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-px h-4 bg-bambu-dark-tertiary"}),a.jsxs("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-bambu-green font-medium",children:[e("printers.nextAvailable"),":"]}),a.jsx("span",{className:"text-white font-medium",children:o.name})]}),a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsx("div",{className:"w-full sm:w-16 bg-bambu-dark-tertiary rounded-full h-1.5",children:a.jsx("div",{className:"bg-bambu-green h-1.5 rounded-full transition-all",style:{width:`${o.progress}%`}})}),a.jsxs("span",{className:"text-white font-medium",children:[Math.round(o.progress),"%"]}),a.jsxs("span",{className:"text-bambu-gray",children:["(",Zs(o.remainingMin*60),")"]})]})]})]})]}):null}function c9(t,e){if(e)return e;switch(t){case"RUNNING":return"Printing";case"PAUSE":return"Paused";case"FINISH":return"Finished";case"FAILED":return"Failed";case"IDLE":return"Idle";default:return t?t.charAt(0)+t.slice(1).toLowerCase():"Idle"}}function TR(t){return t?{O1D:"H2D",O1E:"H2D Pro",O2D:"H2D Pro",O1C:"H2C",O1S:"H2S","BL-P001":"X1C","BL-P002":"X1","BL-P003":"X1E",C11:"P1S",C12:"P1P",C13:"P2S",N2S:"A1",N1:"A1 Mini",X1C:"X1C",X1:"X1",X1E:"X1E",P1S:"P1S",P1P:"P1P",P2S:"P2S",A1:"A1","A1 Mini":"A1 Mini",H2D:"H2D","H2D Pro":"H2D Pro",H2C:"H2C",H2S:"H2S"}[t]||t:""}function u9({printer:t,hideIfDisconnected:e,maintenanceInfo:n,viewMode:r="expanded",cardSize:i=2,amsThresholds:s,spoolmanEnabled:o=!1,hasUnlinkedSpools:l=!1,linkedSpools:c,spoolmanUrl:u,onGetAssignment:d,onUnassignSpool:h,timeFormat:f="system",cameraViewMode:p="window",onOpenEmbeddedCamera:x,checkPrinterFirmware:v=!0}){const{t:b}=Vt(),y=tn(),S=$c(),{showToast:N}=hn(),{hasPermission:A}=Ir(),[C,T]=w.useState(!1),[k,j]=w.useState(!1),[E,P]=w.useState(!0),[U,O]=w.useState(!1),[B,R]=w.useState(!1),[G,q]=w.useState(!1),[z,K]=w.useState(!1),[Y,oe]=w.useState(!1),[$,X]=w.useState(!1),[ee,J]=w.useState(!1),[_e,pe]=w.useState(!1),[me,je]=w.useState(!1),[de,ce]=w.useState(!1),[Se,ie]=w.useState(null),[Fe,V]=w.useState(null),[W,ue]=w.useState(null),[Q,se]=w.useState(null),[Z,Ne]=w.useState(!1),[ve,fe]=w.useState(null),[L,D]=w.useState(!1),[H,he]=w.useState(!1),[xe,be]=w.useState(null),[Ue,Oe]=w.useState(!1),[Qe,rt]=w.useState(!1),{data:we}=Ze({queryKey:["printerStatus",t.id],queryFn:()=>re.getPrinterStatus(t.id),refetchInterval:3e4}),{data:ye}=Ze({queryKey:["firmwareUpdate",t.id],queryFn:()=>JS.checkPrinterUpdate(t.id),staleTime:300*1e3,refetchInterval:300*1e3,enabled:v&&A("firmware:read")}),le=w.useMemo(()=>{const bt=new Set;if(we?.ams)for(const Et of we.ams)for(const Hn of Et.tray||[])Hn.tray_info_idx&&bt.add(Hn.tray_info_idx);for(const Et of we?.vt_tray??[])Et.tray_info_idx&&bt.add(Et.tray_info_idx);if(we?.nozzle_rack)for(const Et of we.nozzle_rack)Et.filament_id&&bt.add(Et.filament_id);return Array.from(bt)},[we?.ams,we?.vt_tray,we?.nozzle_rack]),{data:Le}=Ze({queryKey:["filamentInfo",le],queryFn:()=>re.getFilamentInfo(le),enabled:le.length>0,staleTime:300*1e3}),{data:Me}=Ze({queryKey:["slotPresets",t.id],queryFn:()=>re.getSlotPresets(t.id),staleTime:120*1e3}),[$e,Ae]=w.useState(null);w.useEffect(()=>{we?.wifi_signal!=null&&Ae(we.wifi_signal)},[we?.wifi_signal]);const Je=we?.wifi_signal??$e,Pe=w.useRef(void 0);w.useEffect(()=>{we?.connected!==void 0&&(Pe.current=we.connected)},[we?.connected]);const Xe=we?.connected??Pe.current,De=w.useRef({});w.useEffect(()=>{we?.ams_extruder_map&&Object.keys(we.ams_extruder_map).length>0&&(De.current=we.ams_extruder_map)},[we?.ams_extruder_map]);const Re=we?.ams_extruder_map&&Object.keys(we.ams_extruder_map).length>0?we.ams_extruder_map:De.current,qe=w.useRef([]);w.useEffect(()=>{we?.ams&&we.ams.length>0&&(qe.current=we.ams)},[we?.ams]);const pt=we?.ams&&we.ams.length>0?we.ams:qe.current,At=w.useRef(void 0),Rt=we?.tray_now;Rt!==void 0&&Rt!==255?At.current=Rt:Rt===255&&(At.current=void 0);const Wt=Rt!==void 0&&Rt!==255?Rt:At.current,{data:Tt}=Ze({queryKey:["smartPlugByPrinter",t.id],queryFn:()=>re.getSmartPlugByPrinter(t.id)}),{data:Ie}=Ze({queryKey:["scriptPlugsByPrinter",t.id],queryFn:()=>re.getScriptPlugsByPrinter(t.id)}),{data:xt}=Ze({queryKey:["smartPlugStatus",Tt?.id],queryFn:()=>Tt?re.getSmartPlugStatus(Tt.id):null,enabled:!!Tt,refetchInterval:1e4}),{data:wt}=Ze({queryKey:["queue",t.id,"pending"],queryFn:()=>re.getQueue(t.id,"pending")}),Bt=wt?.length||0,{data:Tn}=Ze({queryKey:["queue",t.id,"printing"],queryFn:()=>re.getQueue(t.id,"printing"),enabled:we?.state==="RUNNING"}),{data:fr}=Ze({queryKey:["currentPrintUser",t.id],queryFn:()=>re.getCurrentPrintUser(t.id),enabled:we?.state==="RUNNING"}),Zn=Tn?.[0]?.created_by_username||fr?.username,{data:Jn}=Ze({queryKey:["archives",t.id,"last"],queryFn:()=>re.getArchives(t.id,1,0),enabled:we?.connected&&we?.state!=="RUNNING"}),Pn=Jn?.[0],cr=e&&Xe===!1,jn=ot({mutationFn:bt=>re.deletePrinter(t.id,bt.deleteArchives),onSuccess:()=>{y.invalidateQueries({queryKey:["printers"]}),y.invalidateQueries({queryKey:["archives"]}),y.invalidateQueries({queryKey:["maintenanceOverview"]})},onError:bt=>N(bt.message||b("printers.toast.failedToDelete"),"error")}),ai=ot({mutationFn:()=>re.connectPrinter(t.id),onSuccess:()=>{y.invalidateQueries({queryKey:["printerStatus",t.id]})}}),ne=ot({mutationFn:bt=>Tt?re.controlSmartPlug(Tt.id,bt):Promise.reject("No plug"),onSuccess:()=>{y.invalidateQueries({queryKey:["smartPlugStatus",Tt?.id]})}}),He=ot({mutationFn:bt=>Tt?re.updateSmartPlug(Tt.id,{auto_off:bt}):Promise.reject("No plug"),onSuccess:()=>{y.invalidateQueries({queryKey:["smartPlugByPrinter",t.id]}),y.invalidateQueries({queryKey:["smart-plugs"]})}}),et=ot({mutationFn:bt=>re.controlSmartPlug(bt,"on"),onSuccess:()=>{N(b("printers.toast.scriptTriggered"))},onError:bt=>N(bt.message||b("printers.toast.failedToRunScript"),"error")}),lt=ot({mutationFn:()=>re.stopPrint(t.id),onSuccess:()=>{N(b("printers.toast.printStopped")),y.invalidateQueries({queryKey:["printerStatus",t.id]})},onError:bt=>N(bt.message||b("printers.toast.failedToStopPrint"),"error")}),dt=ot({mutationFn:()=>re.pausePrint(t.id),onSuccess:()=>{N(b("printers.toast.printPaused")),y.invalidateQueries({queryKey:["printerStatus",t.id]})},onError:bt=>N(bt.message||b("printers.toast.failedToPausePrint"),"error")}),Lt=ot({mutationFn:()=>re.resumePrint(t.id),onSuccess:()=>{N(b("printers.toast.printResumed")),y.invalidateQueries({queryKey:["printerStatus",t.id]})},onError:bt=>N(bt.message||b("printers.toast.failedToResumePrint"),"error")}),ge=ot({mutationFn:bt=>re.setChamberLight(t.id,bt),onMutate:async bt=>{await y.cancelQueries({queryKey:["printerStatus",t.id]});const Et=y.getQueryData(["printerStatus",t.id]);return y.setQueryData(["printerStatus",t.id],Hn=>({...Hn,chamber_light:bt})),{previousStatus:Et}},onSuccess:(bt,Et)=>{N(`Chamber light ${Et?"on":"off"}`)},onError:(bt,Et,Hn)=>{Hn?.previousStatus&&y.setQueryData(["printerStatus",t.id],Hn.previousStatus),N(bt.message||b("printers.toast.failedToControlChamberLight"),"error")}}),ze=ot({mutationFn:bt=>re.updatePrinter(t.id,{plate_detection_enabled:bt}),onSuccess:()=>{y.invalidateQueries({queryKey:["printers"]}),N(ze.variables?b("printers.toast.plateCheckEnabled"):b("printers.toast.plateCheckDisabled"))},onError:bt=>N(bt.message||b("printers.toast.failedToUpdateSetting"),"error")}),Ge=(we?.state==="RUNNING"||we?.state==="PAUSE"||we?.state==="PAUSED")&&(we?.printable_objects_count??0)>=2,{data:Ve}=Ze({queryKey:["printableObjects",t.id],queryFn:()=>re.getPrintableObjects(t.id),enabled:de||Ge,refetchInterval:de?5e3:Ge?3e4:!1}),[Ee,st]=w.useState(null),tt=w.useRef(!1),at=w.useRef(null),Mt=w.useRef(!1),Kt=ot({mutationFn:({amsId:bt,slotId:Et})=>re.refreshAmsSlot(t.id,bt,Et),onMutate:({amsId:bt,slotId:Et})=>{at.current&&clearTimeout(at.current),tt.current=!1,Mt.current=!1,st({amsId:bt,slotId:Et}),setTimeout(()=>{Mt.current=!0},2e3),at.current=setTimeout(()=>{st(null)},3e4)},onSuccess:bt=>{N(bt.message||b("printers.toast.rfidRereadInitiated"))},onError:bt=>{N(bt.message||b("printers.toast.failedToRereadRfid"),"error"),at.current&&clearTimeout(at.current),st(null)}}),[Ot,jt]=w.useState(null),[Ht,Zt]=w.useState(null),nn=async()=>{try{const bt=await re.getPlateReferences(t.id);jt(bt)}catch{}},Mn=()=>{ze.mutate(!t.plate_detection_enabled)},pn=async()=>{D(!0),fe(null);const bt=we?.chamber_light===!1;rt(bt),bt&&(await re.setChamberLight(t.id,!0),await new Promise(Et=>setTimeout(Et,2500)));try{const Et=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(Et),nn()}catch(Et){N(Et instanceof Error?Et.message:b("printers.toast.failedToCheckPlate"),"error"),bt&&(await re.setChamberLight(t.id,!1),rt(!1))}finally{D(!1)}},Xt=w.useCallback(async()=>{fe(null),Qe&&(await re.setChamberLight(t.id,!1),rt(!1))},[Qe,t.id]),sn=async bt=>{he(!0);try{const Et=await re.calibratePlateDetection(t.id,{label:bt});if(Et.success){N(Et.message||b("printers.toast.calibrationSaved"),"success"),nn();const Hn=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(Hn)}else N(Et.message||b("printers.toast.calibrationFailed"),"error")}catch(Et){N(Et instanceof Error?Et.message:b("printers.toast.calibrationFailed"),"error")}finally{he(!1)}},fn=async(bt,Et)=>{try{await re.updatePlateReferenceLabel(t.id,bt,Et),Zt(null),nn()}catch(Hn){N(Hn instanceof Error?Hn.message:b("printers.toast.failedToUpdateLabel"),"error")}},Mr=async bt=>{try{await re.deletePlateReference(t.id,bt),N(b("printers.toast.referenceDeleted"),"success"),nn();const Et=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(Et)}catch(Et){N(Et instanceof Error?Et.message:b("printers.toast.failedToDeleteReference"),"error")}},Qr=async()=>{if(xe){Oe(!0);try{await re.updatePrinter(t.id,{plate_detection_roi:xe}),N(b("printers.toast.detectionAreaSaved"),"success"),be(null);const bt=await re.checkPlateEmpty(t.id,{includeDebugImage:!0});fe(bt)}catch(bt){N(bt instanceof Error?bt.message:b("printers.toast.failedToSaveDetectionArea"),"error")}finally{Oe(!1)}}};w.useEffect(()=>{const bt=Et=>{Et.key==="Escape"&&ve&&Xt()};return window.addEventListener("keydown",bt),()=>window.removeEventListener("keydown",bt)},[ve,Xt]);const gn=w.useRef(null);w.useEffect(()=>{if(!Ee)return;const bt=we?.ams_status_main??0;return bt!==0&&(tt.current=!0,gn.current&&(clearTimeout(gn.current),gn.current=null)),tt.current&&bt===0&&(Mt.current?(at.current&&clearTimeout(at.current),st(null)):gn.current||(gn.current=setTimeout(()=>{at.current&&clearTimeout(at.current),st(null)},2e3))),()=>{gn.current&&clearTimeout(gn.current)}},[we?.ams_status_main,Ee]);const[Zr,Kn]=w.useState(null);if(cr)return null;const vi=()=>{switch(i){case 1:return"w-10 h-10";case 2:return"w-14 h-14";case 3:return"w-16 h-16";case 4:return"w-20 h-20";default:return"w-14 h-14"}},mi=()=>{switch(i){case 1:return"text-base truncate";case 2:return"text-lg";case 3:return"text-xl";case 4:return"text-2xl";default:return"text-lg"}},fi=()=>{switch(i){case 1:return"mb-2";case 2:return"mb-4";case 3:return"mb-5";case 4:return"mb-6";default:return"mb-4"}};return a.jsxs(vt,{className:"relative",children:[a.jsxs(Nt,{className:i>=3?"p-5":"",children:[a.jsxs("div",{className:fi(),children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[a.jsx("img",{src:qHe(t.model),alt:t.model||b("common.printer"),className:`object-contain rounded-lg bg-bambu-dark flex-shrink-0 ${vi()}`}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:`font-semibold text-white ${mi()}`,children:t.name}),r==="compact"&&a.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${we?.connected?"bg-status-ok":"bg-status-error"}`,title:we?.connected?b("printers.connection.connected"):b("printers.connection.offline")})]}),a.jsxs("p",{className:"text-sm text-bambu-gray",children:[t.model||"Unknown Model",r==="expanded"&&we?.nozzles&&we.nozzles[0]?.nozzle_diameter&&a.jsxs("span",{className:"ml-1.5 text-bambu-gray",title:we.nozzles[0].nozzle_type||"Nozzle",children:["• ",we.nozzles[0].nozzle_diameter,"mm"]}),r==="expanded"&&n&&n.total_print_hours>0&&a.jsxs("span",{className:"ml-2 text-bambu-gray",children:[a.jsx(Wn,{className:"w-3 h-3 inline-block mr-1"}),Math.round(n.total_print_hours),"h"]})]})]})]}),a.jsxs("div",{className:"relative flex-shrink-0",children:[a.jsx(Ce,{variant:"ghost",size:"sm",onClick:()=>T(!C),children:a.jsx(Eh,{className:"w-4 h-4"})}),C&&a.jsxs("div",{className:"absolute right-0 mt-2 w-48 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg shadow-lg z-20",children:[a.jsxs("button",{className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 ${A("printers:update")?"hover:bg-bambu-dark-tertiary":"opacity-50 cursor-not-allowed"}`,onClick:()=>{A("printers:update")&&(O(!0),T(!1))},title:A("printers:update")?void 0:b("printers.permission.noEdit"),children:[a.jsx(Vi,{className:"w-4 h-4"}),b("common.edit")]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm hover:bg-bambu-dark-tertiary flex items-center gap-2",onClick:()=>{ai.mutate(),T(!1)},children:[a.jsx(kr,{className:"w-4 h-4"}),b("printers.reconnect")]}),a.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm hover:bg-bambu-dark-tertiary flex items-center gap-2",onClick:()=>{q(!0),T(!1)},children:[a.jsx(wX,{className:"w-4 h-4"}),b("printers.mqttDebug")]}),a.jsxs("button",{className:`w-full px-4 py-2 text-left text-sm flex items-center gap-2 ${A("printers:delete")?"text-red-400 hover:bg-bambu-dark-tertiary":"text-red-400/50 cursor-not-allowed"}`,onClick:()=>{A("printers:delete")&&(j(!0),T(!1))},title:A("printers:delete")?void 0:b("printers.permission.noDelete"),children:[a.jsx(Jt,{className:"w-4 h-4"}),b("common.delete")]})]})]})]}),r==="expanded"&&a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[a.jsxs("span",{className:`flex items-center gap-1.5 px-2 py-1 rounded-full text-xs ${we?.connected?"bg-status-ok/20 text-status-ok":"bg-status-error/20 text-status-error"}`,children:[we?.connected?a.jsx(Wb,{className:"w-3 h-3"}):a.jsx(dC,{className:"w-3 h-3"}),we?.connected?b("printers.connection.connected"):b("printers.connection.offline")]}),we?.connected&&Je!=null&&a.jsxs("span",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs ${Je>=-50||Je>=-60?"bg-status-ok/20 text-status-ok":Je>=-70?"bg-status-warning/20 text-status-warning":Je>=-80?"bg-orange-500/20 text-orange-600":"bg-status-error/20 text-status-error"}`,title:`WiFi: ${Je} dBm - ${b(WHe(Je).labelKey)}`,children:[a.jsx($fe,{className:"w-3 h-3"}),Je,"dBm"]}),we?.connected&&(()=>{const bt=we.hms_errors?uAe(we.hms_errors):[];return a.jsxs("button",{onClick:()=>X(!0),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs cursor-pointer hover:opacity-80 transition-opacity ${bt.length>0?bt.some(Et=>Et.severity<=2)?"bg-status-error/20 text-status-error":"bg-status-warning/20 text-status-warning":"bg-status-ok/20 text-status-ok"}`,title:b("printers.clickToViewHmsErrors"),children:[a.jsx(Cn,{className:"w-3 h-3"}),bt.length>0?bt.length:"OK"]})})(),n&&a.jsxs("button",{onClick:()=>S("/maintenance"),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs cursor-pointer hover:opacity-80 transition-opacity ${n.due_count>0?"bg-status-error/20 text-status-error":n.warning_count>0?"bg-status-warning/20 text-status-warning":"bg-status-ok/20 text-status-ok"}`,title:n.due_count>0||n.warning_count>0?`${n.due_count>0?`${n.due_count} maintenance due`:""}${n.due_count>0&&n.warning_count>0?", ":""}${n.warning_count>0?`${n.warning_count} due soon`:""} - Click to view`:b("printers.maintenanceUpToDate"),children:[a.jsx(Ff,{className:"w-3 h-3"}),n.due_count>0||n.warning_count>0?n.due_count+n.warning_count:"OK"]}),Bt>0&&a.jsxs("button",{onClick:()=>S("/queue"),className:"flex items-center gap-1 px-2 py-1 rounded-full text-xs bg-purple-500/20 text-purple-400 hover:opacity-80 transition-opacity",title:b("printers.queue.inQueue",{count:Bt}),children:[a.jsx(ma,{className:"w-3 h-3"}),Bt]}),v&&ye?.current_version&&ye?.latest_version?a.jsxs("button",{onClick:()=>Ne(!0),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs hover:opacity-80 transition-opacity ${ye.update_available?"bg-orange-500/20 text-orange-400":"bg-status-ok/20 text-status-ok"}`,title:ye.update_available?b("printers.firmwareUpdateAvailable",{current:ye.current_version,latest:ye.latest_version}):b("printers.firmwareUpToDate",{version:ye.current_version}),children:[ye.update_available?a.jsx(di,{className:"w-3 h-3"}):a.jsx(gr,{className:"w-3 h-3"}),ye.current_version]}):we?.firmware_version?a.jsx("span",{className:"flex items-center gap-1 px-2 py-1 rounded-full text-xs bg-bambu-dark-tertiary/50 text-bambu-gray",children:we.firmware_version}):null]})]}),k&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:a.jsx(vt,{className:"w-full max-w-md mx-4",children:a.jsxs(Nt,{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[a.jsx("div",{className:"p-2 rounded-full bg-red-500/20",children:a.jsx(Cn,{className:"w-5 h-5 text-red-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:b("printers.confirm.deleteTitle")}),a.jsx("p",{className:"text-sm text-bambu-gray mt-1",children:b("printers.confirm.deleteMessage",{name:t.name})})]})]}),a.jsx("div",{className:"bg-bambu-dark rounded-lg p-3 mb-4",children:a.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:E,onChange:bt=>P(bt.target.checked),className:"mt-0.5 w-4 h-4 rounded border-bambu-gray bg-bambu-dark-secondary text-bambu-green focus:ring-bambu-green focus:ring-offset-0"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-white",children:b("printers.deleteArchives")}),a.jsx("p",{className:"text-xs text-bambu-gray mt-0.5",children:b(E?"printers.confirm.deleteArchivesNote":"printers.confirm.keepArchivesNote")})]})]})}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(Ce,{variant:"secondary",onClick:()=>{j(!1),P(!0)},children:b("common.cancel")}),a.jsx(Ce,{variant:"danger",onClick:()=>{jn.mutate({deleteArchives:E}),j(!1),P(!0)},children:"Delete"})]})]})})}),we?.connected&&a.jsxs(a.Fragment,{children:[r==="compact"?a.jsx("div",{className:"mt-2",children:we.state==="RUNNING"?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1 bg-bambu-dark-tertiary rounded-full h-1.5",children:a.jsx("div",{className:"bg-bambu-green h-1.5 rounded-full transition-all",style:{width:`${we.progress||0}%`}})}),a.jsxs("span",{className:"text-xs text-white",children:[Math.round(we.progress||0),"%"]})]}):a.jsx("p",{className:"text-xs text-bambu-gray",children:c9(we.state,we.stg_cur_name)})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 p-3 bg-bambu-dark rounded-lg relative",children:[a.jsxs("button",{onClick:()=>ce(!0),disabled:!(we.state==="RUNNING"||we.state==="PAUSE"||we.state==="PAUSED")||(we.printable_objects_count??0)<2||!A("printers:control"),className:`absolute top-2 right-2 p-1.5 rounded transition-colors z-10 ${(we.state==="RUNNING"||we.state==="PAUSE"||we.state==="PAUSED")&&(we.printable_objects_count??0)>=2&&A("printers:control")?"text-bambu-gray hover:text-white hover:bg-white/10":"text-bambu-gray/30 cursor-not-allowed"}`,title:A("printers:control")?we.state==="RUNNING"||we.state==="PAUSE"||we.state==="PAUSED"?(we.printable_objects_count??0)>=2?b("printers.skipObjects.tooltip"):b("printers.skipObjects.requiresMultiple"):b("printers.skipObjects.onlyWhilePrinting"):b("printers.permission.noControl"),children:[a.jsx(SC,{className:"w-4 h-4"}),Ve&&Ve.skipped_count>0&&a.jsx("span",{className:"absolute -top-1 -right-1 min-w-[16px] h-4 px-1 flex items-center justify-center text-[10px] font-bold bg-red-500 text-white rounded-full",children:Ve.skipped_count})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(KHe,{url:we.state==="RUNNING"?we.cover_url:null,printName:we.state==="RUNNING"&&(we.subtask_name||we.current_print)||void 0}),a.jsx("div",{className:"flex-1 min-w-0",children:we.current_print&&we.state==="RUNNING"?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm text-bambu-gray mb-1",children:we.stg_cur_name||"Printing"}),a.jsx("p",{className:"text-white text-sm mb-2 truncate",children:we.subtask_name||we.current_print}),a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("div",{className:"flex-1 bg-bambu-dark-tertiary rounded-full h-2 mr-3",children:a.jsx("div",{className:"bg-bambu-green h-2 rounded-full transition-all",style:{width:`${we.progress||0}%`}})}),a.jsxs("span",{className:"text-white",children:[Math.round(we.progress||0),"%"]})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-bambu-gray",children:[we.remaining_time!=null&&we.remaining_time>0&&a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Wn,{className:"w-3 h-3"}),Zs(we.remaining_time*60)]}),a.jsxs("span",{className:"text-bambu-green font-medium",title:b("printers.estimatedCompletion"),children:["ETA ",$F(we.remaining_time,f,b)]})]}),we.layer_num!=null&&we.total_layers!=null&&we.total_layers>0&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ma,{className:"w-3 h-3"}),we.layer_num,"/",we.total_layers]}),Zn&&a.jsxs("span",{className:"flex items-center gap-1",title:`Started by ${Zn}`,children:[a.jsx(rd,{className:"w-3 h-3"}),Zn]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-sm text-bambu-gray mb-1",children:b("printers.sort.status")}),a.jsx("p",{className:"text-white text-sm mb-2",children:c9(we.state,we.stg_cur_name)}),a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("div",{className:"flex-1 bg-bambu-dark-tertiary rounded-full h-2 mr-3",children:a.jsx("div",{className:"bg-bambu-dark-tertiary h-2 rounded-full"})}),a.jsx("span",{className:"text-bambu-gray",children:"—"})]}),Pn?a.jsxs("p",{className:"text-xs text-bambu-gray mt-2 truncate",title:Pn.print_name||Pn.filename,children:["Last: ",Pn.print_name||Pn.filename,Pn.completed_at&&a.jsxs("span",{className:"ml-1 text-bambu-gray/60",children:["• ",gb(Pn.completed_at,{month:"short",day:"numeric"})]})]}):a.jsx("p",{className:"text-xs text-bambu-gray mt-2",children:b("printers.readyToPrint")})]})})]})]}),a.jsx(fAe,{printerId:t.id,printerState:we.state,plateCleared:we.plate_cleared})]}),we.temperatures&&r==="expanded"&&(()=>{const bt=we.temperatures.nozzle_heating||we.temperatures.nozzle_2_heating||!1,Et=we.temperatures.bed_heating||!1,Hn=we.temperatures.chamber_heating||!1,kt=t.nozzle_count===2||we.temperatures.nozzle_2!==void 0,Nn=we.active_extruder===1?"L":"R",si=we.nozzle_rack?.find(ka=>ka.id===1),Fn=we.nozzle_rack?.find(ka=>ka.id===0),sa=Fn||si;return a.jsxs("div",{className:"flex items-stretch gap-1.5 flex-wrap",children:[a.jsxs("div",{className:"text-center px-2 py-1.5 bg-bambu-dark rounded-lg flex-1 flex flex-col justify-center items-center",children:[a.jsx(aj,{className:"w-3.5 h-3.5 mb-0.5",color:"text-orange-400",isHeating:bt}),we.temperatures.nozzle_2!==void 0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-[9px] text-bambu-gray",children:"L / R"}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.nozzle||0),"° / ",Math.round(we.temperatures.nozzle_2||0),"°"]})]}):sa?a.jsx(fne,{slot:sa,index:0,activeStatus:!0,filamentName:sa.filament_id?Le?.[sa.filament_id]?.name:void 0,children:a.jsxs("div",{className:"cursor-default",children:[a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.nozzle")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.nozzle||0),"°C"]})]})}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.nozzle")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.nozzle||0),"°C"]})]})]}),a.jsxs("div",{className:"text-center px-2 py-1.5 bg-bambu-dark rounded-lg flex-1 flex flex-col justify-center items-center",children:[a.jsx(aj,{className:"w-3.5 h-3.5 mb-0.5",color:"text-blue-400",isHeating:Et}),a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.bed")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.bed||0),"°C"]})]}),we.temperatures.chamber!==void 0&&a.jsxs("div",{className:"text-center px-2 py-1.5 bg-bambu-dark rounded-lg flex-1 flex flex-col justify-center items-center",children:[a.jsx(aj,{className:"w-3.5 h-3.5 mb-0.5",color:"text-green-400",isHeating:Hn}),a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.chamber")}),a.jsxs("p",{className:"text-[11px] text-white",children:[Math.round(we.temperatures.chamber||0),"°C"]})]}),kt&&a.jsx(zHe,{leftSlot:si,rightSlot:Fn,activeNozzle:Nn,filamentInfo:Le,children:a.jsxs("div",{className:"text-center px-3 py-1.5 bg-bambu-dark rounded-lg h-full flex flex-col justify-center items-center cursor-default",title:b("printers.activeNozzle",{nozzle:b(Nn==="L"?"common.left":"common.right")}),children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsxs("span",{className:`text-[11px] font-bold ${Nn==="L"?"text-amber-400":"text-gray-500"}`,children:["L",si?.nozzle_diameter?` ${si.nozzle_diameter}`:""]}),a.jsx("span",{className:"text-[9px] text-bambu-gray/40",children:"·"}),a.jsxs("span",{className:`text-[11px] font-bold ${Nn==="R"?"text-amber-400":"text-gray-500"}`,children:["R",Fn?.nozzle_diameter?` ${Fn.nozzle_diameter}`:""]})]}),a.jsx("p",{className:"text-[9px] text-bambu-gray",children:b("printers.temperatures.nozzle")})]})}),we.nozzle_rack&&we.nozzle_rack.some(ka=>ka.id>=2)&&a.jsx(UHe,{slots:we.nozzle_rack,filamentInfo:Le})]})})(),r==="expanded"&&(()=>{const bt=we.state==="RUNNING",Et=we.state==="PAUSED"||we.state==="PAUSE",Hn=bt||Et,kt=lt.isPending||dt.isPending||Lt.isPending,Nn=we.cooling_fan_speed,si=we.big_fan1_speed,Fn=we.big_fan2_speed;return a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-bambu-gray font-medium",children:b("printers.controls")}),a.jsx("div",{className:"flex-1 h-px bg-bambu-dark-tertiary/30"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2 max-[550px]:items-start",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-[550px]:flex-wrap max-[550px]:items-start max-[550px]:gap-1.5",children:[a.jsxs("div",{className:`flex items-center gap-1 px-1.5 py-1 rounded ${Nn&&Nn>0?"bg-cyan-500/10":"bg-bambu-dark"}`,title:b("printers.fans.partCooling"),children:[a.jsx(hX,{className:`w-3.5 h-3.5 ${Nn&&Nn>0?"text-cyan-400":"text-bambu-gray/50"}`}),a.jsxs("span",{className:`text-[10px] ${Nn&&Nn>0?"text-cyan-400":"text-bambu-gray/50"}`,children:[Nn??0,"%"]})]}),a.jsxs("div",{className:`flex items-center gap-1 px-1.5 py-1 rounded ${si&&si>0?"bg-blue-500/10":"bg-bambu-dark"}`,title:b("printers.fans.auxiliary"),children:[a.jsx(SX,{className:`w-3.5 h-3.5 ${si&&si>0?"text-blue-400":"text-bambu-gray/50"}`}),a.jsxs("span",{className:`text-[10px] ${si&&si>0?"text-blue-400":"text-bambu-gray/50"}`,children:[si??0,"%"]})]}),a.jsxs("div",{className:`flex items-center gap-1 px-1.5 py-1 rounded ${Fn&&Fn>0?"bg-green-500/10":"bg-bambu-dark"}`,title:b("printers.fans.chamber"),children:[a.jsx(cde,{className:`w-3.5 h-3.5 ${Fn&&Fn>0?"text-green-400":"text-bambu-gray/50"}`}),a.jsxs("span",{className:`text-[10px] ${Fn&&Fn>0?"text-green-400":"text-bambu-gray/50"}`,children:[Fn??0,"%"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 max-[550px]:self-start",children:[a.jsxs("button",{onClick:()=>J(!0),disabled:!Hn||kt||!A("printers:control"),className:` flex items-center justify-center gap-1 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${Hn&&A("printers:control")?"bg-red-500/20 text-red-400 hover:bg-red-500/30":"bg-bambu-dark text-bambu-gray/50 cursor-not-allowed"} diff --git a/static/index.html b/static/index.html index bb9a66445..d5413e3db 100644 --- a/static/index.html +++ b/static/index.html @@ -23,7 +23,7 @@ - +