@seedtactics/insight-client 17.0.9 → 17.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -256,7 +256,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
256
256
|
40% { transform: translate(0, 0) }
|
|
257
257
|
50% { transform: translate(${OW}px, 0) }
|
|
258
258
|
60% { transform: translate(0, 0) }
|
|
259
|
-
`,AW=`${kW} 1s ease-in-out infinite`;function jW(e){return`animationName`in e}function MW(e){let t=e.currentTarget.getAnimations().find(e=>jW(e)&&e.animationName===kW.name);if(t&&typeof t.startTime==`number`)t.startTime-=t.startTime%1e3;else if(t&&typeof t.startTime==`object`&&t.startTime instanceof CSSNumericValue){let e=t.startTime.to(`ms`).value;t.startTime=CSS.ms(e-e%1e3)}}var NW=W(`div`,{shouldForwardProp:e=>e!==`fsize`})(({fsize:e,theme:t})=>{if(!e)return{fontSize:`1.25rem`,fontWeight:`500`};switch(e){case`normal`:return{fontSize:`1rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1.25rem`},[t.breakpoints.up(`lg`)]:{fontSize:`1.5rem`}};case`large`:return{fontSize:`1.5rem`,fontWeight:`500`,[t.breakpoints.up(`lg`)]:{fontSize:`1.75rem`},[t.breakpoints.up(`xl`)]:{fontSize:`2rem`}};case`x-large`:return{fontSize:`1.5rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1.75rem`},[t.breakpoints.up(`lg`)]:{fontSize:`2.75rem`},[t.breakpoints.up(`xl`)]:{fontSize:`3.75rem`}}}}),PW=W(`div`,{shouldForwardProp:e=>e!==`fsize`})(({fsize:e,theme:t})=>{if(!e)return{fontSize:`0.75rem`,fontWeight:`500`};switch(e){case`normal`:return{fontSize:`0.75rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1rem`}};case`large`:return{fontSize:`1rem`,fontWeight:`500`,[t.breakpoints.up(`lg`)]:{fontSize:`1.5rem`},[t.breakpoints.up(`xl`)]:{fontSize:`1.75rem`}};case`x-large`:return{fontSize:`1rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1.5rem`},[t.breakpoints.up(`lg`)]:{fontSize:`2.5rem`},[t.breakpoints.up(`xl`)]:{fontSize:`3.5rem`}}}});function FW({mat:e,displayActionForSinglePallet:t,displayActionForSingleBasket:n,fsize:r}){let i=I(QO),a=IW(e,i,Ik(I(Dr).basketName),t,n);return a===null?null:(0,V.jsx)(PW,{fsize:r,children:mL(i,e)?`System alarm`:a})}function IW(e,t,n,r,i){switch(e.action.type){case B.Loading:if(e.action.loadFromBasketId){if(e.action.loadOntoPalletNum===null||e.action.loadOntoPalletNum===void 0)return(0,V.jsxs)(V.Fragment,{children:[`Load into `,n,` `,e.action.loadFromBasketId]});if(r===void 0)return(0,V.jsxs)(V.Fragment,{children:[`Load from `,n,` `,e.action.loadFromBasketId,` to pal`,` `,e.action.loadOntoPalletNum??``]});if(r===e.action.loadOntoPalletNum){let r=e.action.loadOntoFace??0,i=e.action.loadOntoPalletNum?t.pallets[e.action.loadOntoPalletNum]?.faceNames?.[r-1]:null;return(0,V.jsxs)(V.Fragment,{children:[`Load from `,n,` `,e.action.loadFromBasketId,` to`,` `,i??`face ${r}`]})}return null}switch(e.location.type){case lt.OnPallet:if(r===void 0||r===e.location.palletNum){if(e.action.loadOntoFace===void 0||e.action.loadOntoFace===e.location.face)return e.action.processAfterLoad&&e.action.processAfterLoad!==e.process?(0,V.jsxs)(V.Fragment,{children:[`Reclamp material to process # `,e.action.processAfterLoad]}):null;{let n=e.action.loadOntoFace??0,r=e.location.palletNum?t.pallets[e.location.palletNum]?.faceNames?.[n-1]:null;return(0,V.jsxs)(V.Fragment,{children:[`Transfer to `,r??`face ${n}`]})}}return null;default:{let n=e.action.loadOntoFace??0,i=e.action.loadOntoPalletNum?t.pallets[e.action.loadOntoPalletNum]?.faceNames?.[n-1]:null;return r===void 0?(0,V.jsxs)(V.Fragment,{children:[`Load to `,i??`face ${n}`,` of pal `,e.action.loadOntoPalletNum??``]}):r===e.action.loadOntoPalletNum?(0,V.jsxs)(V.Fragment,{children:[`Load to `,i??`face ${n}`]}):null}}case B.LoadingToBasket:return i!==void 0&&i===e.action.loadToBasketId&&e.action.loadToBasketSlot!==void 0?(0,V.jsxs)(V.Fragment,{children:[`Load into slot `,Fk(e.action.loadToBasketSlot),e.action.processAfterLoad===void 0?``:` for process ${e.action.processAfterLoad}`]}):(0,V.jsxs)(V.Fragment,{children:[`Load into `,n,` `,e.action.loadToBasketId??``,e.action.loadToBasketSlot===void 0?``:` slot ${Fk(e.action.loadToBasketSlot)}`,e.action.processAfterLoad===void 0?``:` for process ${e.action.processAfterLoad}`]});case B.UnloadToInProcess:case B.UnloadToCompletedMaterial:return e.action.unloadToBasketId?(0,V.jsxs)(V.Fragment,{children:[`Unload to `,n,` `,e.action.unloadToBasketId,e.action.unloadToBasketSlot===void 0?``:` slot ${Fk(e.action.unloadToBasketSlot)}`]}):e.action.unloadIntoQueue?(0,V.jsxs)(V.Fragment,{children:[`Unload into queue `,e.action.unloadIntoQueue]}):e.action.type===B.UnloadToCompletedMaterial&&e.location.type===lt.InBasket?(0,V.jsxs)(V.Fragment,{children:[`Unload completed from `,n,` `,e.location.basketId]}):e.location.type===lt.InBasket?(0,V.jsxs)(V.Fragment,{children:[`Unload from `,n,` `,e.location.basketId]}):(0,V.jsx)(V.Fragment,{children:`Unload from pallet`});case B.Waiting:if(e.location.type===lt.InQueue&&e.jobUnique&&e.jobUnique!==``)return(0,V.jsxs)(V.Fragment,{children:[`Waiting; next process is #`,e.process+1]});if(e.location.type===lt.InBasket)return(0,V.jsxs)(V.Fragment,{children:[`In `,n,` `,e.location.basketId]});if(e.location.type===lt.OnPallet&&(e.lastCompletedMachiningRouteStopIndex===null||e.lastCompletedMachiningRouteStopIndex===void 0))return(0,V.jsx)(V.Fragment,{children:`Waiting for machining`});break;case B.Machining:return(0,V.jsxs)(V.Fragment,{children:[`Machining program `,e.action.program??``]})}return null}function LW({mat:e,inProcMat:t}){let n=I(jR).matsById.get(e.materialID),r=t?n?.quarantineSignals?.get(EW(t).process)?.note:void 0,i=null;if(e.signaledInspections.length>0&&(i=`Inspect: `+e.signaledInspections.join(`, `)),e.quarantineAfterUnload){let e=`Material will quarantine after unload`+(r?`: ${r}`:``);i===null?i=e:i+=`; ${e}`}return i===null?null:(0,V.jsx)(X,{title:i,describeChild:!0,children:(0,V.jsx)(yE,{titleAccess:`Material warnings`})})}function RW({fsize:e,mat:t}){let n=I(QO).jobs[t.jobUnique],r=t.path;if((t.action.type===B.Loading||t.action.type===B.LoadingToBasket)&&t.action.pathAfterLoad&&(r=t.action.pathAfterLoad),!n)return null;let i=n.procsAndPaths?.[0]?.paths?.[r-1];return i&&i.casting&&i.casting!==``?(0,V.jsx)(PW,{fsize:e,children:i.casting}):null}function zW({fsize:e,uniq:t}){let n=I(QO).jobs[t],r=I(az);if(n&&n.bookings&&n.bookings.length>0){let t=r.get(n.bookings[0]);if(t&&t.notes&&t.notes!==``)return(0,V.jsx)(PW,{fsize:e,style:{textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,maxWidth:`10em`},children:t.notes})}return null}function BW(){let e=I(QO),t=I(ML);if(!t)return null;let n=e.workorders?.find(e=>e.workorderId===t)?.comments??[];return(0,V.jsxs)(`div`,{style:{marginTop:`1em`,marginLeft:`1em`},children:[(0,V.jsxs)(`p`,{children:[`Workorder: `,t]}),(0,V.jsx)(`ul`,{children:n.map((e,t)=>(0,V.jsx)(`li`,{children:e.comment},t))})]})}var VW=function({mat:e,materialCount:t=1,inProcMat:n,fsize:r,focusInspectionType:i,isDragOverlay:a,isActiveDrag:o,shake:s,dragRootProps:c,showDragHandle:l,setDragHandleRef:u,dragHandleProps:d,displayJob:f,hideEmptySerial:p,showRawMaterial:m,showJobComment:h,displayActionForSinglePallet:g,displayActionForSingleBasket:_,hideAvatar:v,hideWarningIcon:y,ref:b}){let x=L(SL),S=e.completedInspections||{},C;return i&&S[i]?C=(0,V.jsxs)(PW,{fsize:r,children:[(0,V.jsx)(`span`,{children:`Inspection completed `}),(0,V.jsx)(hB,{date:S[i].time})]}):i&&e.last_unload_time?C=(0,V.jsxs)(PW,{fsize:r,children:[(0,V.jsx)(`span`,{children:`Unloaded `}),(0,V.jsx)(hB,{date:e.last_unload_time})]}):e.closeout_completed&&(C=(0,V.jsxs)(PW,{fsize:r,children:[(0,V.jsxs)(`span`,{children:[e.closeout_failed?`Failed `:``,`Closed Out `]}),(0,V.jsx)(hB,{date:e.closeout_completed})]})),(0,V.jsxs)(um,{ref:b,elevation:4,sx:{position:`relative`,display:`flex`,minWidth:`10em`,padding:`8px`,margin:a?void 0:`8px`,opacity:o?.2:1,animation:s?AW:void 0,"&:hover":{animationPlayState:`paused`}},onAnimationIteration:MW,...c,children:[t>1&&(0,V.jsx)(pv,{badgeContent:t,color:`secondary`,sx:{position:`absolute`,top:0,right:0,zIndex:1}}),l?(0,V.jsx)(`div`,{ref:u,role:`button`,tabIndex:0,style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,cursor:a?`grabbing`:`grab`,touchAction:`none`},...d,children:(0,V.jsx)(rre,{fontSize:`large`,color:`action`})}):void 0,(0,V.jsx)($m,{focusRipple:!0,sx:{width:`100%`},onClick:()=>x(n?{type:`InProcMat`,inproc:n}:{type:`MatSummary`,summary:e}),children:(0,V.jsxs)(J,{sx:{display:`flex`,textAlign:`left`,alignItems:`center`,width:`100%`},children:[(0,V.jsx)(DW,{part:e.partName}),(0,V.jsxs)(J,{sx:{marginLeft:`8px`,flexGrow:1,minWidth:0},children:[(0,V.jsx)(NW,{fsize:r,children:e.partName}),f?(0,V.jsx)(PW,{fsize:r,children:e.jobUnique&&e.jobUnique!==``?`Assigned to `+e.jobUnique:`Unassigned material`}):void 0,!p||e.serial?(0,V.jsxs)(PW,{fsize:r,children:[`Serial: `,e.serial?e.serial:`none`]}):void 0,e.workorderId===void 0||e.workorderId===``||e.workorderId===e.serial?void 0:(0,V.jsxs)(PW,{fsize:r,children:[`Workorder: `,e.workorderId]}),e.jobUnique!==void 0&&m&&n&&n.process===0?(0,V.jsx)(RW,{fsize:r,mat:n}):void 0,h&&e.jobUnique&&e.jobUnique!==``?(0,V.jsx)(zW,{fsize:r,uniq:e.jobUnique}):void 0,n?(0,V.jsx)(FW,{mat:n,displayActionForSinglePallet:g,displayActionForSingleBasket:_,fsize:r}):void 0,n?.problem?(0,V.jsx)(PW,{fsize:r,children:(0,V.jsxs)(q,{variant:`body2`,color:`error`,sx:{fontWeight:`bold`},children:[`⚠ `,n.problem]})}):void 0,C]}),(0,V.jsxs)(J,{sx:{marginLeft:`4px`,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,alignItems:`flex-end`,alignSelf:`start`,flexShrink:0},children:[e.serial&&e.serial.length>=1&&!v?(0,V.jsx)(`div`,{children:(0,V.jsx)(X_,{style:{width:`30px`,height:`30px`},children:e.serial.slice(-1)})}):void 0,y?void 0:(0,V.jsx)(`div`,{children:(0,V.jsx)(LW,{mat:e,inProcMat:n})})]})]})})]})},HW=(0,F.memo)(VW),UW=(0,F.memo)(function(e){return(0,V.jsx)(VW,{mat:PR(e.mat),materialCount:e.materialCount,inProcMat:e.mat,displayActionForSinglePallet:e.displayActionForSinglePallet,displayActionForSingleBasket:e.displayActionForSingleBasket,fsize:e.fsize,hideAvatar:e.hideAvatar,displayJob:e.displayJob,showDragHandle:e.showHandle,hideEmptySerial:e.hideEmptySerial,showRawMaterial:e.showRawMaterial,showJobComment:e.showJobComment,shake:e.shake})}),WW=(0,F.memo)(function(e){let t=pL(I(QO),[e.mat]).length>0,n=!t&&(wW(e.mat)||CW(e.mat)),r={mat:e.mat},{active:i,isDragging:a,attributes:o,listeners:s,setNodeRef:c,setActivatorNodeRef:l,transform:u,transition:d}=JU({id:e.mat.materialID,data:r,disabled:{draggable:!n}}),f={...s};for(let[e,t]of Object.entries(o))e.startsWith(`aria`)&&(f[e]=t);let p={transform:u?`translate3d(${Math.round(u.x)}px, ${Math.round(u.y)}px, 0)`:void 0,transition:i===null?void 0:d};return(0,V.jsx)(VW,{ref:c,dragRootProps:{style:p},showDragHandle:n,dragHandleProps:f,setDragHandleRef:l,isActiveDrag:a,mat:PR(e.mat),materialCount:e.materialCount,inProcMat:e.mat,displayActionForSinglePallet:e.displayActionForSinglePallet,displayActionForSingleBasket:e.displayActionForSingleBasket,hideAvatar:e.hideAvatar,displayJob:e.displayJob,hideEmptySerial:e.hideEmptySerial,fsize:e.fsize,shake:i||t?void 0:e.shake,showRawMaterial:e.showRawMaterial,showJobComment:e.showJobComment})});function GW(e){return(0,V.jsx)(VW,{mat:PR(e.mat),materialCount:e.materialCount,inProcMat:e.mat,displayActionForSinglePallet:e.displayActionForSinglePallet,displayActionForSingleBasket:e.displayActionForSingleBasket,showDragHandle:!0,hideAvatar:e.hideAvatar,displayJob:e.displayJob,fsize:e.fsize,hideEmptySerial:e.hideEmptySerial,isDragOverlay:!0})}var KW=(0,F.memo)(function(e){return(0,V.jsx)(um,{elevation:4,sx:{display:`flex`,minWidth:`10em`,padding:`8px`,margin:`8px`},children:(0,V.jsx)(pv,{badgeContent:e.material.length<2?0:e.material.length,color:`secondary`,children:(0,V.jsx)($m,{focusRipple:!0,onClick:()=>e.onOpen(),children:(0,V.jsxs)(J,{sx:{display:`flex`,textAlign:`left`},children:[(0,V.jsx)(DW,{part:e.partOrCasting}),(0,V.jsxs)(J,{sx:{marginLeft:`8px`,flexGrow:1},children:[(0,V.jsx)(q,{variant:`h6`,children:e.partOrCasting}),(0,V.jsx)(PW,{fsize:e.fsize,children:e.assignedJobUnique&&e.assignedJobUnique!==``?`Assigned to `+e.assignedJobUnique:`Unassigned material`})]}),e.material.length>0&&e.material[0].serial&&e.material[0].serial.length>=1?(0,V.jsx)(`div`,{children:(0,V.jsx)(X_,{style:{width:`30px`,height:`30px`},children:e.material[0].serial.slice(-1)})}):void 0]})})})})}),qW=(0,F.memo)(function({partName:e,serial:t,subtitle:n,notes:r}){let i;return i=e===``?t??`Material`:t==null||t===``?r?`Add note for `+e:e:r?`Add note for `+t:e+` - `+t,(0,V.jsxs)(J,{sx:{display:`flex`,textAlign:`left`},children:[e===``?(0,V.jsx)(mE,{}):(0,V.jsx)(DW,{part:e}),(0,V.jsxs)(J,{sx:{marginLeft:`8px`,flexGrow:1},children:[(0,V.jsx)(q,{variant:`h6`,children:i}),n?(0,V.jsx)(q,{variant:`caption`,children:n}):void 0]})]})});function JW({notes:e}){let t=I(SL),n=I(OL),r=I(Wie),i=``,a=null;switch(t?.type){case`InProcMat`:i=t.inproc.partName,a=t.inproc.serial;break;case`MatSummary`:i=t.summary.partName,a=t.summary.serial;break;case`MatDetails`:i=t.details.partName,a=t.details.serial;break;case`LogMat`:i=t.logMat.part,a=t.logMat.serial;break;case`Barcode`:a=t.barcode;break;case`ManuallyEnteredSerial`:case`AddMatWithEnteredSerial`:a=t.serial}return n.state===`hasData`&&n.data!==null&&(i=n.data.partName,a=n.data.serial??a),r.state===`hasData`&&r.data&&(a=r.data),(0,V.jsx)(qW,{notes:e,partName:i,serial:a})}function YW(){let e=I(RL);function t(t){return e.completedInspections.includes(t)?`black`:`red`}return e.signaledInspections.length===0?(0,V.jsx)(`small`,{children:`Inspections: none`}):(0,V.jsxs)(`small`,{children:[`Inspections:`,` `,e.signaledInspections.map((e,n)=>(0,V.jsxs)(`span`,{children:[n===0?``:`, `,(0,V.jsx)(`span`,{style:{color:t(e)},children:e})]},n))]})}function XW({highlightProcsGreaterOrEqualTo:e}){let t=I(IL);return(0,V.jsx)(bL,{entries:t,copyToClipboard:!0,highlightProcsGreaterOrEqualTo:e})}function ZW(){let e=I(AL),t=I(QO).jobs,n=I(az),r=e?t[e.jobUnique]:null;if(r&&r.bookings&&r.bookings.length>0){let e=n.get(r.bookings[0]);if(e&&e.notes&&e.notes!==``)return(0,V.jsx)(q,{variant:`caption`,sx:{width:`100%`,textWrap:`wrap`},children:e.notes})}return null}function QW({material:e}){let t=I(FL),n=EW(e).process,r=t.reduce((t,r)=>r.type===z.SignalQuarantine&&r.material.some(t=>t.id===e.materialID&&t.proc===n)&&(t===null||r.counter>t.counter)?r:t,null)?.details?.note?.trim();return r?`: ${r}`:null}function $W(){let e=I(AL),t=zL(),n=e?_W(e):null;return(0,V.jsx)(V.Fragment,{children:e?.quarantineAfterUnload?(0,V.jsxs)(q,{variant:`caption`,component:`p`,children:[`Quarantine requested`,(0,V.jsx)(iW,{fallback:null,resetKeys:[e.materialID,EW(e).process],children:(0,V.jsx)(QW,{material:e})})]}):t.length===0&&n?.kind===`ActiveLoadStationOperation`&&n.cancellationId===null?(0,V.jsx)(q,{variant:`caption`,component:`p`,children:`This material is part of the current load/unload operation. Complete the operation or cancel it at the machine control before making other changes.`}):null})}var eG=(0,F.memo)(function({highlightProcsGreaterOrEqualTo:e}){let t=I(SL),n=I(TL),r=I(wL);return t===null?null:n===null?t.type===`AddMatWithEnteredSerial`||t.type===`ManuallyEnteredSerial`?(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[`Material with serial `,t.serial,` not found.`]}):t.type===`Barcode`?r?(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[`Material with barcode `,t.barcode,` does not yet exist in the cell.`]}):(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[`Material with barcode `,t.barcode,` not found.`]}):(0,V.jsx)(`div`,{style:{marginLeft:`1em`},children:`Material not found.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[(0,V.jsx)($W,{}),(0,V.jsx)(`div`,{children:(0,V.jsxs)(`small`,{children:[`Workorder: `,n?.workorderId??`none`]})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(mW,{fallback:(0,V.jsxs)(`small`,{children:[`Inspections: `,(0,V.jsx)(Sh,{size:`10`})]}),children:(0,V.jsx)(YW,{})})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(mW,{fallback:(0,V.jsx)(`div`,{}),children:(0,V.jsx)(ZW,{})})})]}),(0,V.jsx)(mW,{fallback:(0,V.jsx)(Sh,{}),children:(0,V.jsx)(XW,{highlightProcsGreaterOrEqualTo:e})})]})});function tG(e){let[t,n]=(0,F.useState)(``),r=I(XO),[i]=Jie(),a=I(TL);return a===null?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cy,{children:(0,V.jsx)(BT,{sx:{mt:`5px`},multiline:!0,label:`Note`,autoFocus:!0,variant:`outlined`,value:t,onChange:e=>n(e.target.value)})}),(0,V.jsxs)(_y,{children:[(0,V.jsx)(Y,{onClick:()=>{i({matId:a.materialID,process:0,operator:r,notes:t}),e.setNotesOpen(!1),n(``)},disabled:t===``,color:`secondary`,children:`Save`}),(0,V.jsx)(Y,{onClick:()=>{e.setNotesOpen(!1),n(``)},color:`secondary`,children:`Cancel`})]})]})}function nG(){let e=I(SL);if(e===null)return null;let t;switch(e.type){case`Barcode`:t=`Loading material with barcode `+e.barcode+`...`;break;case`AddMatWithEnteredSerial`:case`ManuallyEnteredSerial`:t=`Loading material with serial `+e.serial+`...`;break;default:t=`Loading material...`}return(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`},children:[(0,V.jsx)(Sh,{}),(0,V.jsx)(`div`,{style:{marginTop:`1em`},children:t})]})}function rG({setNotesOpen:e}){let t=I(TL);return t===null||t.materialID<0?null:(0,V.jsx)(Y,{onClick:()=>e(!0),color:`primary`,children:`Add Note`})}var iG=(0,F.memo)(function(e){let[t,n]=(0,F.useState)(!1),[r,i]=R(SL);function a(){i(null),e.onClose&&e.onClose()}let o,s;return r&&(o=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ey,{children:(0,V.jsx)(JW,{})}),(0,V.jsx)(Cy,{children:(0,V.jsxs)(mW,{fallback:(0,V.jsx)(nG,{}),children:[(0,V.jsx)(eG,{highlightProcsGreaterOrEqualTo:e.highlightProcsGreaterOrEqualTo}),(0,V.jsx)(mW,{fallback:(0,V.jsx)(Sh,{}),children:e.extraDialogElements})]})}),(0,V.jsxs)(_y,{children:[r&&(e.buttons||e.allowNote)?(0,V.jsx)(iW,{fallback:(0,V.jsx)(`div`,{}),children:(0,V.jsxs)(F.Suspense,{fallback:(0,V.jsx)(`div`,{}),children:[r&&e.allowNote?(0,V.jsx)(rG,{setNotesOpen:n}):void 0,e.buttons]})}):null,(0,V.jsx)(Y,{onClick:a,color:`secondary`,children:`Close`})]})]}),e.allowNote&&(s=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ey,{children:(0,V.jsx)(JW,{notes:!0})}),(0,V.jsxs)(mW,{fallback:(0,V.jsx)(Cy,{children:(0,V.jsx)(Sh,{})}),children:[(0,V.jsx)(tG,{setNotesOpen:n}),`;`]})]}))),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(py,{open:r!==null,onClose:a,maxWidth:`lg`,children:o}),e.allowNote?(0,V.jsx)(py,{open:t,onClose:()=>n(!1),maxWidth:`md`,children:s}):void 0]})}),aG=KO(`MachineCostPerYear`,{}),oG=KO(`AutomationCostPerYear`,null),sG=KO(`Last30LaborCost`,null),cG=IO(e=>KO(`PerMonthLabor-`+e.getFullYear().toString()+`-`+e.getMonth().toString(),null)),lG=d(e=>e(e(gz).type===`Last30`?RO:HO).valuesToLazySeq().filter(e=>e.procsAndPaths.length===1&&e.procsAndPaths[0].paths.length===1&&e.procsAndPaths[0].paths[0].stops.length===1&&lk(e.procsAndPaths[0].paths[0].stops[0].expectedCycleTime)===0).toHashSet(e=>e.partName)),uG=d(e=>{let t=e(gz),n=e(t.type===`Last30`?Vk:Wk),r=e(t.type===`Last30`?jR:NR),i=e(lG),a=TE(WE(),-30),o=t.type===`Last30`?null:t.month;return Ez(n.valuesToLazySeq(),i,r.matsById,o?{month:o}:{thirtyDaysAgo:a})}),dG=d(e=>{let t=e(gz),n=e(aG),r=e(oG),i=e(t.type===`Last30`?sG:cG(t.month));return Dz(e(uG),n,r,i??0)});function fG(){let[e,t]=(0,F.useState)(null),[n,r]=R(oG);return(0,V.jsx)(BT,{id:`auotmation-cost-year`,type:`number`,label:`Cost for automated handling system per year`,style:{marginTop:`1.5em`},variant:`outlined`,value:e===null?n??``:isNaN(e)?``:e,onChange:e=>t(parseFloat(e.target.value)),onBlur:()=>{e!=null&&r(isNaN(e)?null:e),t(null)},slotProps:{htmlInput:{min:0}}})}function pG(){let e=I(gz),t=e.type===`Last30`?null:e.month,[n,r]=(0,F.useState)(null),[i,a]=R(t===null?sG:cG(t));return(0,V.jsx)(BT,{type:`number`,label:`Total labor cost for `+(t===null?`last 30 days`:t.toLocaleDateString(void 0,{month:`long`,year:`numeric`})),variant:`outlined`,value:n===null?i??``:isNaN(n)?``:n,onChange:e=>r(parseFloat(e.target.value)),onBlur:()=>{n!=null&&a(isNaN(n)?null:n),r(null)},slotProps:{htmlInput:{min:0}}})}function mG(e){let[t,n]=(0,F.useState)(null),[r,i]=R(aG);return(0,V.jsx)(BT,{type:`number`,variant:`outlined`,label:`Cost for `+e.machineGroup+` per station per year`,style:{marginTop:`1.5em`},value:t===null?r[e.machineGroup]??``:isNaN(t)?``:t,onChange:e=>n(parseFloat(e.target.value)),onBlur:()=>{if(t!=null){let n={...r};isNaN(t)?delete n[e.machineGroup]:n[e.machineGroup]=t,i(n)}n(null)},slotProps:{htmlInput:{min:0}}})}function hG(){let e=I(dG);return(0,V.jsx)(V.Fragment,{children:e.machineQuantities.keysToAscLazySeq().map((t,n)=>(0,V.jsx)(mG,{machineQuantities:e.machineQuantities,machineGroup:t},n))})}var gG=Intl.NumberFormat(void 0,{minimumFractionDigits:1,maximumFractionDigits:1}),_G=new Intl.NumberFormat(void 0,{style:`percent`,minimumFractionDigits:1,maximumFractionDigits:1});function vG(){QL(`Cost Percentages`);let e=I(uG);return(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsxs)(J,{component:`nav`,sx:{display:`flex`,minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsx)(q,{variant:`subtitle1`,children:`Part Cost Percentage Breakdown`}),(0,V.jsx)(J,{sx:{flexGrow:1}}),(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{style:{height:`25px`,paddingTop:0,paddingBottom:0},onClick:()=>jz(e),size:`large`,children:(0,V.jsx)(iE,{})})})]}),(0,V.jsx)(`main`,{children:(0,V.jsxs)(Nw,{stickyHeader:!0,children:[(0,V.jsx)(nT,{children:(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:`Part`}),(0,V.jsx)(Z,{align:`right`,children:`Completed Quantity`}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsxs)(Z,{align:`right`,children:[e,` Cost %`]},e)),(0,V.jsx)(Z,{align:`right`,children:`Labor Cost %`}),(0,V.jsx)(Z,{align:`right`,children:`Automation Cost %`})]})}),(0,V.jsx)(Bw,{children:Q.of(e.parts).sortBy(e=>e.part).map((t,n)=>(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(J,{sx:{mr:`0.2em`},children:(0,V.jsx)(DW,{part:t.part,size:25})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(q,{variant:`body2`,component:`span`,sx:{display:`block`},children:t.part})})]})}),(0,V.jsx)(Z,{align:`right`,children:t.parts_completed}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsx)(Z,{align:`right`,children:_G.format(t.machine.get(e)??0)},e)),(0,V.jsx)(Z,{align:`right`,children:_G.format(t.labor)}),(0,V.jsx)(Z,{align:`right`,children:_G.format(t.automation)})]},n))})]})})]})}function yG(){let e=I(dG);return(0,V.jsxs)(Nw,{stickyHeader:!0,children:[(0,V.jsx)(nT,{children:(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:`Part`}),(0,V.jsx)(Z,{align:`right`,children:`Completed Quantity`}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsxs)(Z,{align:`right`,children:[e,` Cost`]},e)),(0,V.jsx)(Z,{align:`right`,children:`Labor Cost`}),(0,V.jsx)(Z,{align:`right`,children:`Automation Cost`}),(0,V.jsxs)(Z,{align:`right`,children:[(0,V.jsx)(`span`,{children:`Total`}),(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{style:{height:`25px`,paddingTop:0,paddingBottom:0},onClick:()=>kz(e),size:`large`,children:(0,V.jsx)(iE,{})})})]})]})}),(0,V.jsx)(Bw,{children:Q.of(e.parts).sortBy(e=>e.part).map((t,n)=>(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(J,{sx:{mr:`0.2em`},children:(0,V.jsx)(DW,{part:t.part,size:25})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(q,{variant:`body2`,component:`span`,sx:{display:`block`},children:t.part})})]})}),(0,V.jsx)(Z,{align:`right`,children:t.parts_completed}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsx)(Z,{align:`right`,children:gG.format(t.machine.get(e)??0)},e)),(0,V.jsx)(Z,{align:`right`,children:gG.format(t.labor)}),(0,V.jsx)(Z,{align:`right`,children:gG.format(t.automation)}),(0,V.jsx)(Z,{align:`right`,children:gG.format(t.machine.valuesToAscLazySeq().sumBy(e=>e)+t.labor+t.automation)})]},n))})]})}var bG=(0,F.memo)(function(){return QL(`Cost Per Piece`),(0,V.jsx)(J,{component:`main`,sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`20px`},children:(0,V.jsxs)(FC,{direction:`column`,spacing:4,children:[(0,V.jsxs)(FC,{direction:`column`,spacing:2,children:[(0,V.jsx)(pG,{}),(0,V.jsx)(fG,{}),(0,V.jsx)(hG,{})]}),(0,V.jsx)(yG,{})]})})}),xG=d(!1),SG=xG,CG=d(null),wG=d(EO.empty()),TG=d(null),EG=d(null),DG=d(e=>e(pR)??e(TG)??e(EG));async function OG(e,t,n,r){for(;mR(e,n);){let i=e(QO),a=e(dR).snapshot,o;try{r?.throwIfAborted(),o=await Xt.currentStatus(r),r?.throwIfAborted()}catch(t){let i=e(dR);if(i.id!==n)return!1;if(!r?.aborted&&i.snapshot!==a&&i.snapshot?.source===`socket`)return!0;throw t}let s=e(dR);if(s.id!==n)return!1;let c=s.snapshot?.status;if(c&&o.revision<=c.revision)return!0;if(e(QO)===i||e(QO)===c)return t(gR,n,o,`http`),!0}return!1}var kG=d(null,(e,t,n)=>OG(e,t,e(dR).id,n));async function AG(e,t,n,r=1e3){try{await OG(e,t,n,AbortSignal.timeout(1e4))}catch(i){if(!mR(e,n)||e(fR))return;t(pR,uW(i,`Error loading current status`)),setTimeout(()=>{mR(e,n)&&!e(fR)&&AG(e,t,n,Math.min(r*2,3e4))},r)}}function jG(e,t,n,r,i=1e3){let a=new Date,o=AbortSignal.timeout(12e4);return(r===null?Zt.get(TE(a,-30),a,o):Zt.recent(r,void 0,o)).then(r=>{if(!mR(e,n))return;let i=e(CG)??jO.empty(),a=r.reduce((e,t)=>e.set(t.counter,t),i);t(ioe,a.valuesToAscLazySeq().toRArray()),t(wG,EO.from(a.keys())),t(CG,null),t(EG,null)},a=>{mR(e,n)&&(t(EG,o.aborted?`Loading log history timed out.`:uW(a,`Error loading log history`)),setTimeout(()=>{mR(e,n)&&jG(e,t,n,r,Math.min(i*2,3e4))},i))})}function MG(e,t,n){let r=e(noe),i=e(BO);NG([AG(e,t,n),Xt.recent(TE(new Date,-30),r!==null&&i?Array.from(i):[]).then(r=>{mR(e,n)&&t(roe,r)}),jG(e,t,n,r)],e,t,n)}function NG(e,t,n,r){Promise.all(e).catch(e=>{mR(t,r)&&n(TG,uW(e,`Error`))}).finally(()=>{mR(t,r)&&n(xG,!1)})}var PG=class{constructor(e){this.session=null,this.userCalledClose=!1,this.reconnectAttempts=0,this.url=e,this.connect()}close(){this.userCalledClose=!0,this.ws?.close(),this.endSession(!1)}endSession(e){let t=this.session;this.session=null,this.handleClose?.(t,e)}connect(){if(this.userCalledClose)return;this.ws=new WebSocket(this.url);let e=this.ws,t=setTimeout(()=>{e.close()},2e3);e.addEventListener(`open`,()=>{clearTimeout(t),this.reconnectAttempts=0,this.session=this.handleOpen?.()??null}),e.addEventListener(`close`,()=>{if(clearTimeout(t),this.ws=void 0,this.userCalledClose)return;this.endSession(!0);let e=Math.min(1e3*1.5**this.reconnectAttempts,3e4);setTimeout(()=>{this.reconnectAttempts++,this.connect()},e)}),e.addEventListener(`message`,e=>{this.handleMessage?.(e,this.session)})}},FG=d(null,(e,t)=>{let n=e(dR).id+1;return t(dR,{id:n,open:!0,snapshot:null}),t(xG,!0),t(fR,!1),t(TG,null),t(EG,null),t(pR,null),t(CG,jO.empty()),MG(e,t,n),n}),IG=d(null,(e,t,n,r)=>{r&&t(xG,!0),n!==null&&mR(e,n)&&(t(dR,{id:n+1,open:!1,snapshot:null}),t(fR,!1),t(CG,null))}),LG=d(null,(e,t,n,r)=>{if(r===null||!mR(e,r))return;let i=Ne.fromJS(JSON.parse(n.data)),a=i.newCurrentStatus,o=a&&t(gR,r,a,`socket`),s=a&&!o?new Ne({logEntry:i.logEntry,newJobs:i.newJobs}):i,c={evt:s,now:new Date,expire:!0};s.newCurrentStatus||t(dz,c);let l=s.logEntry,u=e(CG);l&&e(wG).has(l.counter)||(l&&u!==null?t(CG,u.set(l.counter,l)):t(fz,c))});function RG(){let e=L(FG),t=L(IG),n=L(LG),r=I(Dr),i=(0,F.useRef)(null);return(0,F.useEffect)(()=>{if(i.current)return;let a=r.user??null,o=window.location,s;if(o.protocol===`backup:`)return;s=o.protocol===`https:`?`wss:`:`ws:`,s+=`//`+o.host+`/api/v1/events`,a&&(s+=`?token=`+encodeURIComponent(a.access_token));let c=new PG(s);return c.handleOpen=e,c.handleClose=t,c.handleMessage=n,i.current=c,()=>{i.current&&=(i.current.close(),null)}},[r,n,e,t]),null}var zG=[{type:`Subheader`,caption:`Shop Floor`},{type:`Link`,route:{route:$.Station_LoadMonitor,loadNum:1,queues:[],completed:!1},icon:(0,V.jsx)(tre,{}),label:`Load Station`},{type:`Link`,route:{route:$.Station_Queues,queues:[]},icon:(0,V.jsx)(eE,{}),label:`Queue Management`},{type:`Link`,route:{route:$.Station_InspectionMonitor},icon:(0,V.jsx)(lre,{}),label:`Inspection Stand`},{type:`Link`,route:{route:$.Station_Closeout},icon:(0,V.jsx)(dE,{}),label:`Close Out`},{type:`Link`,route:{route:$.Tools_Dashboard},icon:(0,V.jsx)(GT,{}),label:`Tool Management`},{type:`Link`,route:{route:$.Station_Overview},icon:(0,V.jsx)(Jne,{}),label:`System Overview`},{type:`Subheader`,caption:`Daily Monitoring`},{type:`Link`,route:{route:$.Operations_Dashboard},icon:(0,V.jsx)(hE,{}),label:`Operation Management`},{type:`Link`,route:{route:$.Engineering_Cycles},icon:(0,V.jsx)(fre,{}),label:`Engineering`},{type:`Link`,route:{route:$.Quality_Dashboard},icon:(0,V.jsx)(vre,{}),label:`Quality Analysis`},{type:`Link`,route:{route:$.Sales_Dashboard},icon:(0,V.jsx)(mre,{}),label:`Sales`},{type:`Subheader`,caption:`Monthly Review`},{type:`Link`,route:{route:$.Analysis_Buffers},icon:(0,V.jsx)(ure,{}),label:`Flexibility Analysis`}];function BG(e){let t=I(QO),n=I(DG),r=I(bz),i=Q.of([...t.alarms,n,r]).filter(e=>e!==null&&e.length>0).distinct().toRArray(),a=(0,V.jsx)(um,{children:(0,V.jsx)(Ub,{component:`nav`,dense:!0,children:(e.modes??zG).map((t,n)=>t.type===`Subheader`?(0,V.jsx)(R_,{children:t.caption},n):(0,V.jsx)(Kb,{children:(0,V.jsxs)(Wb,{onClick:()=>e.setRoute(t.route),children:[(0,V.jsx)(Jb,{children:t.icon}),(0,V.jsx)(Xb,{children:t.label})]})},n))})});return(0,V.jsx)(`main`,{style:{display:`flex`,justifyContent:`center`},children:(0,V.jsxs)(`div`,{style:{maxWidth:`50em`,padding:`0 1em`},children:[(0,V.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,V.jsx)(q,{variant:`h4`,style:{marginTop:`2em`},children:`Select user and computer location`}),(0,V.jsxs)(q,{variant:`caption`,style:{marginBottom:`2em`,maxWidth:`30em`,marginLeft:`auto`,marginRight:`auto`},children:[`We recommend that after selecting one of the following modes, you bookmark the page and visit it directly.`,(0,V.jsx)(`a`,{href:`https://fms-insight.seedtactics.com/docs/client-dashboard.html`,children:`Learn More`})]})]}),i.length>0?(0,V.jsxs)(Bh,{severity:`error`,sx:{margin:`1em 0`},children:[(0,V.jsx)(Yh,{children:`FMS Insight errors`}),i.map(e=>(0,V.jsx)(`p`,{children:e},e))]}):void 0,a]})})}var VG=[[`All`,`*`,`*`,` `,0,`All`],[`AllReadable`,`*`,`r`,` `,0,`All Readable`],[`AllCreatable`,`*`,`w`,` `,0,`All Creatable`],[`AllLinear`,`*`,`l`,` `,0,`All Linear`],[`AllMatrix`,`*`,`m`,` `,0,`All Matrix`],[`AllGS1`,`*`,`G`,` `,0,`All GS1`],[`AllRetail`,`*`,`R`,` `,0,`All Retail`],[`AllIndustrial`,`*`,`I`,` `,0,`All Industrial`],[`Codabar`,`F`,` `,`lrw `,18,`Codabar`],[`Code39`,`A`,` `,`lrw I`,8,`Code 39`],[`Code39Std`,`A`,`s`,`lrw I`,8,`Code 39 Standard`],[`Code39Ext`,`A`,`e`,`lr I`,9,`Code 39 Extended`],[`Code32`,`A`,`2`,`lr I`,129,`Code 32`],[`PZN`,`A`,`p`,`lr I`,52,`Pharmazentralnummer`],[`Code93`,`G`,` `,`lrw I`,25,`Code 93`],[`Code128`,`C`,` `,`lrwGI`,20,`Code 128`],[`ITF`,`I`,` `,`lrw I`,3,`ITF`],[`ITF14`,`I`,`4`,`lr I`,89,`ITF-14`],[`DataBar`,`e`,` `,`lr GR`,29,`DataBar`],[`DataBarOmni`,`e`,`o`,`lr GR`,29,`DataBar Omni`],[`DataBarStk`,`e`,`s`,`lr GR`,79,`DataBar Stacked`],[`DataBarStkOmni`,`e`,`O`,`lr GR`,80,`DataBar Stacked Omni`],[`DataBarLtd`,`e`,`l`,`lr GR`,30,`DataBar Limited`],[`DataBarExp`,`e`,`e`,`lr GR`,31,`DataBar Expanded`],[`DataBarExpStk`,`e`,`E`,`lr GR`,81,`DataBar Expanded Stacked`],[`EANUPC`,`E`,` `,`lr R`,15,`EAN/UPC`],[`EAN13`,`E`,`1`,`lrw R`,15,`EAN-13`],[`EAN8`,`E`,`8`,`lrw R`,10,`EAN-8`],[`EAN5`,`E`,`5`,`l R`,12,`EAN-5`],[`EAN2`,`E`,`2`,`l R`,11,`EAN-2`],[`ISBN`,`E`,`i`,`lr R`,69,`ISBN`],[`UPCA`,`E`,`a`,`lrw R`,34,`UPC-A`],[`UPCE`,`E`,`e`,`lrw R`,37,`UPC-E`],[`Telepen`,`B`,` `,`lr I`,32,`Telepen`],[`TelepenAlpha`,`B`,`0`,`lr I`,32,`Telepen Alpha`],[`TelepenNumeric`,`B`,`1`,`lr I`,87,`Telepen Numeric`],[`OtherBarcode`,`X`,` `,` r `,0,`Other barcode`],[`DXFilmEdge`,`X`,`x`,`lr `,147,`DX Film Edge`],[`PDF417`,`L`,` `,`mrw `,55,`PDF417`],[`CompactPDF417`,`L`,`c`,`mr `,56,`Compact PDF417`],[`MicroPDF417`,`L`,`m`,`mr `,84,`MicroPDF417`],[`Aztec`,`z`,` `,`mr G `,92,`Aztec`],[`AztecCode`,`z`,`c`,`mrwG `,92,`Aztec Code`],[`AztecRune`,`z`,`r`,`mr `,128,`Aztec Rune`],[`QRCode`,`Q`,` `,`mrwG `,58,`QR Code`],[`QRCodeModel1`,`Q`,`1`,`mr `,0,`QR Code Model 1`],[`QRCodeModel2`,`Q`,`2`,`mr `,58,`QR Code Model 2`],[`MicroQRCode`,`Q`,`m`,`mr `,97,`Micro QR Code`],[`RMQRCode`,`Q`,`r`,`mr G `,145,`rMQR Code`],[`DataMatrix`,`d`,` `,`mrwG `,71,`Data Matrix`],[`MaxiCode`,`U`,` `,`mr `,57,`MaxiCode`]],HG={DataBarExpanded:`DataBarExp`,DataBarLimited:`DataBarLtd`,"Linear-Codes":`AllLinear`,"Matrix-Codes":`AllMatrix`,Any:`All`,rMQRCode:`RMQRCode`};VG.map(e=>e[5]),VG.filter(e=>e[1]===`*`).map(e=>e[0]),VG.filter(e=>e[1]!==`*`).map(e=>e[0]),VG.filter(e=>e[2]===` `).map(e=>e[0]),VG.filter(e=>e[3][0]===`l`).map(e=>e[0]),VG.filter(e=>e[3][0]===`m`).map(e=>e[0]),VG.filter(e=>e[3][1]===`r`).map(e=>e[0]),VG.filter(e=>e[3][2]===`w`||e[4]!==0).map(e=>e[0]),VG.filter(e=>e[3][3]===`G`).map(e=>e[0]),VG.filter(e=>e[3][4]===`R`).map(e=>e[0]),VG.filter(e=>e[3][4]===`I`).map(e=>e[0]);function UG(e){return HG[e]??e}function WG(e){return e.map(UG).join(`,`)}var GG=[`LocalAverage`,`GlobalHistogram`,`FixedThreshold`,`BoolCast`];function KG(e){return GG.indexOf(e)}var qG=`Unknown.ASCII.ISO8859_1.ISO8859_2.ISO8859_3.ISO8859_4.ISO8859_5.ISO8859_6.ISO8859_7.ISO8859_8.ISO8859_9.ISO8859_10.ISO8859_11.ISO8859_13.ISO8859_14.ISO8859_15.ISO8859_16.Cp437.Cp1250.Cp1251.Cp1252.Cp1256.Shift_JIS.Big5.GB2312.GB18030.EUC_JP.EUC_KR.UTF16BE.UTF8.UTF16LE.UTF32BE.UTF32LE.BINARY`.split(`.`);function JG(e){return e===`UnicodeBig`?qG.indexOf(`UTF16BE`):qG.indexOf(e)}var YG=[`Text`,`Binary`,`Mixed`,`GS1`,`ISO15434`,`UnknownECI`];function XG(e){return YG[e]}var ZG=[`Ignore`,`Read`,`Require`];function QG(e){return ZG.indexOf(e)}var $G=[`Plain`,`ECI`,`HRI`,`Escaped`,`Hex`,`HexECI`];function eK(e){return $G.indexOf(e)}var tK={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:`LocalAverage`,isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,validateOptionalChecksum:!1,returnErrors:!1,eanAddOnSymbol:`Ignore`,textMode:`HRI`,characterSet:`Unknown`,tryCode39ExtendedMode:!0};function nK(e){var t;return{...e,formats:WG(e.formats),binarizer:KG(e.binarizer),eanAddOnSymbol:QG(e.eanAddOnSymbol),textMode:eK(e.textMode),characterSet:JG(e.characterSet),tryCode39ExtendedMode:(t=e.tryCode39ExtendedMode)==null||t}}function rK(e){return{...e,orientation:e.rotation,format:e.format,symbology:e.symbology,contentType:XG(e.contentType)}}var iK={format:`QRCode`,readerInit:!1,forceSquareDataMatrix:!1,ecLevel:``,scale:1,sizeHint:0,rotate:0,invert:!1,withHRT:!1,withQuietZones:!0,addHRT:!1,addQuietZones:!0,options:``};function aK(e,t){let n=e.byteLength>>2;for(let r=0;r<n;r+=1024){let i=Math.min(r+1024,n);for(let n=r;n<i;n++){let r=n<<2;t[n]=306*e[r]+601*e[r+1]+117*e[r+2]+512>>10}}}var oK={locateFile:(e,t)=>{let n=e.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@3.1.6/dist/${n[1]}/${e}`:t+e}},sK=new WeakMap;function cK(e,t){return Object.is(e,t)||Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>Object.prototype.hasOwnProperty.call(t,n)&&e[n]===t[n])}function lK(e){let{overrides:t,equalityFn:n=cK,fireImmediately:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[i,a]=sK.get(e)??[oK],o=t??i,s;if(r){if(a&&(s=n(i,o)))return a;let t=e({...o});return sK.set(e,[o,t]),t}(s??n(i,o))||sK.set(e,[o])}async function uK(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tK,r={...tK,...n},i=await lK(e,{fireImmediately:!0}),a,o=nK(r);if(`width`in t&&`height`in t&&`data`in t){let{width:e,height:n}=t,r=t.data.buffer===i.HEAPU8.buffer?t.data.slice():t.data,s=r.byteLength/4,c=i._malloc(s);if(!c)throw Error(`Failed to allocate ${s} bytes in WASM memory`);try{aK(r,i.HEAPU8.subarray(c,c+s)),a=i.readBarcodesFromPixmap(c,e,n,o)}finally{i._free(c)}}else{let e;if(`buffer`in t)e=t;else if(`byteLength`in t)e=new Uint8Array(t);else if(`size`in t)e=new Uint8Array(await t.arrayBuffer());else throw TypeError(`Invalid input type`);let n=i._malloc(e.byteLength);if(!n)throw Error(`Failed to allocate ${e.byteLength} bytes in WASM memory`);try{i.HEAPU8.set(e,n),a=i.readBarcodesFromImage(n,e.byteLength,o)}finally{i._free(n)}}try{let e=[],t=a.size();for(let n=0;n<t;++n)e.push(rK(a.get(n)));return e}finally{a.delete()}}({...tK}),[...tK.formats],{...iK};function dK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}async function fK(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t,n,r,i=e,a=!!globalThis.window,o=!!globalThis.WorkerGlobalScope;(n=globalThis.process)!=null&&(t=n.versions)!=null&&t.node&&((r=globalThis.process)==null||r.type);var s=(e,t)=>{throw t},c=void 0,l=``;function u(e){return i.locateFile?i.locateFile(e,l):l+e}var d,f;if(a||o||typeof fetch==`function`){try{l=new URL(`.`,c).href}catch{}o&&(f=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),d=async e=>{var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}console.log.bind(console);var p=console.error.bind(console),m,h=!1,g;class _{}class v extends _{constructor(e){super(),this.excPtr=e}}function y(){return mr.buffer}function b(){var e;if(!(te!=null&&(e=te.buffer)!=null&&e.resizable)){var t=y();te=new Int8Array(t),Yt=new Int16Array(t),i.HEAPU8=Ne=new Uint8Array(t),Xt=new Uint16Array(t),Zt=new Int32Array(t),de=new Uint32Array(t),Wt=new Float32Array(t),Gt=new Float64Array(t)}}function x(){var e=i.preRun;e&&(typeof e==`function`&&(e=[e]),ie.push(...e)),ne(ie)}function S(){Xr.ra()}function C(){var e=i.postRun;e&&(typeof e==`function`&&(e=[e]),re.push(...e)),ne(re)}function w(e){var t;throw(t=i.onAbort)==null||t.call(i,e),e=`Aborted(${e})`,p(e),h=!0,e+=`. Build with -sASSERTIONS for more info.`,new WebAssembly.RuntimeError(e)}var T;function E(){return u(`zxing_reader.wasm`)}function D(e){if(e==T&&m)return new Uint8Array(m);if(f)return f(e);throw`both async and sync fetching of the wasm failed`}async function O(e){if(!m)try{var t=await d(e);return new Uint8Array(t)}catch{}return D(e)}async function k(e,t){try{var n=await O(e);return await WebAssembly.instantiate(n,t)}catch(e){p(`failed to asynchronously prepare wasm: ${e}`),w(e)}}async function ee(e,t,n){if(!e)try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){p(`wasm streaming compile failed: ${e}`),p(`falling back to ArrayBuffer instantiation`)}return k(t,n)}function A(){return{a:_r}}async function j(){function e(e){return Xr=e.exports,gr(Xr),b(),Xr}function t(t){return e(t.instance)}var n=A(),r=i.instantiateWasm;return r?new Promise(t=>{r(n,n=>t(e(n)))}):(T??=E(),t(await ee(m,T,n)))}class M{constructor(e){dK(this,`name`,`ExitStatus`),this.message=`Program terminated with exit(${e})`,this.status=e}}var te,ne=e=>{for(;e.length>0;)e.shift()(i)},re=[],ie=[],ae=!0,N=e=>sr(e),oe=()=>lr(),se=[],ce=e=>{var t=se[e];return t||(se[e]=t=hr.get(e)),t},P=(e,t)=>ce(e)(t),le=[],ue=0,de;class fe{set_type(e){de[this.ptr+4>>2]=e}get_type(){return de[this.ptr+4>>2]}set_destructor(e){de[this.ptr+8>>2]=e}get_destructor(){return de[this.ptr+8>>2]}set_caught(e){e=+!!e,te[this.ptr+12]=e}get_caught(){return te[this.ptr+12]!=0}set_rethrown(e){e=+!!e,te[this.ptr+13]=e}get_rethrown(){return te[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){de[this.ptr+16>>2]=e}get_adjusted_ptr(){return de[this.ptr+16>>2]}constructor(e){this.excPtr=e,this.ptr=e-24}}var pe=e=>{var t=new fe(e);return t.get_caught()||(t.set_caught(!0),ue--),t.set_rethrown(!1),le.push(t),rr(e)},me=null,he=()=>{ar(0,0);var e=le.pop();dr(e.excPtr),me=null},F=e=>or(e),ge=e=>{var t=me?.excPtr;if(!t)return F(0),0;var n=new fe(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return F(0),t;for(var i of e){if(!i||i===r)break;var a=n.ptr+16;if(fr(i,r,a))return F(i),t}return F(r),t},_e=()=>ge([]),ve=e=>ge([e]),ye=(e,t)=>ge([e,t]),be=e=>{throw e},xe=()=>{le.length||w(`no exception to throw`);var e=le[le.length-1],t=e.excPtr;e.set_rethrown(!0),e.set_caught(!1),ue++,ur(t),t=me=new v(t),be(t)},Se=(e,t,n)=>{new fe(e).init(t,n),ur(e),e=me=new v(e),ue++,be(e)},Ce=e=>{throw e},we=e=>{e=me??=new v(e),Ce(e)},Te=()=>w(``),I={},Ee=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function L(e){return this.fromWireType(de[e>>2])}var R={},De={},Oe={};class ke extends Error{constructor(e){super(e),this.name=`InternalError`}}var Ae=e=>{throw new ke(e)},je=(e,t,n)=>{e.forEach(e=>Oe[e]=t);function r(t){var r=n(t);r.length!==e.length&&Ae(`Mismatched type converter count`);for(var i=0;i<e.length;++i)Be(e[i],r[i])}var i=Array(t.length),a=[],o=0;for(let[e,n]of t.entries())De.hasOwnProperty(n)?i[e]=De[n]:(a.push(n),R.hasOwnProperty(n)||(R[n]=[]),R[n].push(()=>{i[e]=De[n],++o,o===a.length&&r(i)}));a.length===0&&r(i)},Me=e=>cr(e),Ne,Pe=(e,t)=>Ne.fill(0,e,e+t),Fe=e=>{var t=I[e];delete I[e];var n=t.rawConstructor,r=t.rawDestructor,i=t.valueSize,a=t.isTrivial,o=t.fields,s=o.map(e=>e.getterReturnType).concat(o.map(e=>e.setterArgumentType));je([e],s,e=>{var s={};for(var[c,l]of o.entries()){let t=e[c],n=l.getter,r=l.getterContext,i=e[c+o.length],a=l.setter,d=l.setterContext;var u=i.destructorFunction===null&&!i.argStackAlloc?(e,t)=>a(d,e,i.toWireType(null,t)):(e,t)=>{var n=[];a(d,e,i.toWireType(n,t)),Ee(n)};s[l.fieldName]={read:e=>t.fromWireType(n(r,e)),write:u,optional:t.optional}}return[{name:t.name,fromWireType:e=>{var t={};for(var n in s)t[n]=s[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var o in s)if(!(o in t)&&!s[o].optional)throw TypeError(`Missing field: "${o}"`);var c;for(o in a&&!e?(c=Me(i),Pe(c,i)):(c=n(),e&&e.push(r,c)),s)s[o].write(c,t[o]);return c},readValueFromPointer:L,destructorFunction:a?null:r,argStackAlloc:a}]})},z=(e,t,n,r,i)=>{},Ie=e=>{for(var t=``;;){var n=Ne[e++];if(!n)return t;t+=String.fromCharCode(n)}};class Le extends Error{constructor(e){super(e),this.name=`BindingError`}}var Re=e=>{throw new Le(e)};function ze(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=t.name;if(e||Re(`type "${r}" must have a positive integer typeid pointer`),De.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Re(`Cannot register type '${r}' twice`)}if(De[e]=t,delete Oe[e],R.hasOwnProperty(e)){var i=R[e];delete R[e],i.forEach(e=>e())}}function Be(e,t){return ze(e,t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})}var Ve=(e,t,n,r)=>{t=Ie(t),Be(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},readValueFromPointer:function(e){return this.fromWireType(Ne[e])},destructorFunction:null})},He=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ue=e=>{function t(e){return e.$$.ptrType.registeredClass.name}Re(t(e)+` instance already deleted`)},We=!1,Ge=e=>{},Ke=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},qe=e=>{--e.count.value,e.count.value===0&&Ke(e)},Je=e=>globalThis.FinalizationRegistry?(We=new FinalizationRegistry(e=>{qe(e.$$)}),Je=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};We.register(e,n,e)}return e},Ge=e=>We.unregister(e),Je(e)):(Je=e=>e,e),Ye=[],Xe=()=>{for(;Ye.length;){var e=Ye.pop();e.$$.deleteScheduled=!1,e.delete()}},Ze,Qe=()=>{let e=$e.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof $e)||!(e instanceof $e))return!1;var t=this.$$.ptrType.registeredClass,n=this.$$.ptr;e.$$=e.$$;for(var r=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return t===r&&n===i},clone(){if(this.$$.ptr||Ue(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:He(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ue(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Re(`Object already scheduled for deletion`),Ge(this),qe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ue(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Re(`Object already scheduled for deletion`),Ye.push(this),Ye.length===1&&Ze&&Ze(Xe),this.$$.deleteScheduled=!0,this}});let t=Symbol.dispose;t&&(e[t]=e.delete)};function $e(){}var et=(e,t)=>Object.defineProperty(t,"name",{value:e}),tt={},nt=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(){var r=[...arguments];return e[t].overloadTable.hasOwnProperty(r.length)||Re(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},rt=(e,t,n)=>{i.hasOwnProperty(e)?((n===void 0||i[e].overloadTable!==void 0&&i[e].overloadTable[n]!==void 0)&&Re(`Cannot register public name '${e}' twice`),nt(i,e,e),i[e].overloadTable.hasOwnProperty(n)&&Re(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[e].overloadTable[n]=t):(i[e]=t,i[e].argCount=n)},it=48,at=57,ot=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,`$`);var t=e.charCodeAt(0);return t>=it&&t<=at?`_${e}`:e};function st(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=a,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}var ct=(e,t,n)=>{for(;t!==n;)t.upcast||Re(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},lt=e=>{if(e===null)return`null`;var t=typeof e;return t===`object`||t===`array`||t===`function`?e.toString():``+e};function ut(e,t){if(t===null)return this.isReference&&Re(`null is not a valid ${this.name}`),0;t.$$||Re(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||Re(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return ct(t.$$.ptr,n,this.registeredClass)}function B(e,t){var n;if(t===null)return this.isReference&&Re(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;t&&t.$$||Re(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||Re(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Re(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=ct(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&Re(`Passing raw pointer to smart pointer is illegal`),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Re(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var i=t.clone();n=this.rawShare(n,Vt.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,n)}break;default:Re(`Unsupported sharing policy`)}return n}function dt(e,t){if(t===null)return this.isReference&&Re(`null is not a valid ${this.name}`),0;t.$$||Re(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||Re(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Re(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return ct(t.$$.ptr,n,this.registeredClass)}var ft=(e,t,n)=>{if(t===n)return e;if(n.baseClass===void 0)return null;var r=ft(e,t,n.baseClass);return r===null?null:n.downcast(r)},pt={},mt=(e,t)=>{for(t===void 0&&Re(`ptr should not be undefined`);e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},ht=(e,t)=>(t=mt(e,t),pt[t]),gt=(e,t)=>(t.ptrType&&t.ptr||Ae(`makeClassHandle requires ptr and ptrType`),!!t.smartPtrType!=!!t.smartPtr&&Ae(`Both smartPtrType and smartPtr must be specified`),t.count={value:1},Je(Object.create(e,{$$:{value:t,writable:!0}})));function _t(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=ht(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function i(){return this.isSmartPointer?gt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):gt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=tt[this.registeredClass.getActualType(t)];if(!a)return i.call(this);var o=this.isConst?a.constPointerType:a.pointerType,s=ft(t,this.registeredClass,o.registeredClass);return s===null?i.call(this):this.isSmartPointer?gt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:e}):gt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})}var vt=()=>{Object.assign(yt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t,n;(t=(n=this).rawDestructor)==null||t.call(n,e)},readValueFromPointer:L,fromWireType:_t})};function yt(e,t,n,r,i,a,o,s,c,l,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=u,!i&&t.baseClass===void 0?r?(this.toWireType=ut,this.destructorFunction=null):(this.toWireType=dt,this.destructorFunction=null):this.toWireType=B}var bt=(e,t,n)=>{i.hasOwnProperty(e)||Ae(`Replacing nonexistent public symbol`),i[e].overloadTable!==void 0&&n!==void 0?i[e].overloadTable[n]=t:(i[e]=t,i[e].argCount=n)},xt={},St=(e,t,n)=>{e=e.replace(/p/g,`i`);var r=xt[e];return r(t,...n)},Ct=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(arguments.length>3&&arguments[3]!==void 0&&arguments[3],e.includes(`j`))return St(e,t,n);var r=ce(t)(...n);function i(e){return e}return i(r)},wt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return function(){return Ct(e,t,[...arguments],n)}},Tt=function(e,t){arguments.length>2&&arguments[2]!==void 0&&arguments[2],e=Ie(e);function n(){return e.includes(`j`)?wt(e,t):ce(t)}var r=n();return typeof r!=`function`&&Re(`unknown function pointer with signature ${e}: ${t}`),r};class Et extends Error{}var Dt=e=>{var t=er(e),n=Ie(t);return nr(t),n},Ot=(e,t)=>{var n=[],r={};function i(e){if(!r[e]&&!De[e]){if(Oe[e]){Oe[e].forEach(i);return}n.push(e),r[e]=!0}}throw t.forEach(i),new Et(`${e}: `+n.map(Dt).join([`, `]))},kt=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{u=Ie(u),a=Tt(i,a),s&&=Tt(o,s),l&&=Tt(c,l),f=Tt(d,f);var p=ot(u);rt(p,function(){Ot(`Cannot construct ${u} due to unbound types`,[r])}),je([e,t,n],r?[r]:[],t=>{t=t[0];var n,i;r?(n=t.registeredClass,i=n.instancePrototype):i=$e.prototype;var o=et(u,function(){var e=[...arguments];if(Object.getPrototypeOf(this)!==c)throw new Le(`Use 'new' to construct ${u}`);if(d.constructor_body===void 0)throw new Le(`${u} has no accessible constructor`);var t=d.constructor_body[e.length];if(t===void 0)throw new Le(`Tried to invoke ctor of ${u} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)}),c=Object.create(i,{constructor:{value:o}});o.prototype=c;var d=new st(u,o,c,f,n,a,s,l);if(d.baseClass){var m;(m=d.baseClass).__derivedClasses??(m.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d)}var h=new yt(u,d,!0,!1,!1),g=new yt(u+`*`,d,!1,!1,!1),_=new yt(u+` const*`,d,!1,!0,!1);return tt[e]={pointerType:g,constPointerType:_},bt(p,o),[h,g,_]})},At=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(de[t+r*4>>2]);return n};function jt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Mt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].argStackAlloc)return!0;return!1}function Nt(e,t,n,r,i,a){var o=t.length;o<2&&Re(`argTypes array size mismatch! Must at least get return value and receiver (this) types!`);var s=t[1]!==null&&n!==null,c=jt(t),l=Mt(t),u=l&&!a&&!c;l&&!u&&(c=!0);var d=!t[0].isVoid,f=o-2,p=Array(f),m=[],h=[];return et(e,function(){var e=[...arguments];h.length=0;var n;u&&(n=oe());var a,o;try{m.length=s?2:1,m[0]=i,s&&(a=t[1].toWireType(h,this),m[1]=a);for(var l=0;l<f;++l){var g=t[l+2];p[l]=g.toWireType(u&&g.argStackAlloc?null:h,e[l]),m.push(p[l])}o=r(...m)}finally{u&&N(n)}function _(e){if(c)Ee(h);else for(var n=s?1:2;n<t.length;n++){var r=n===1?a:p[n-2];t[n].destructorFunction!==null&&t[n].destructorFunction(r)}if(d)return t[0].fromWireType(e)}return _(o)})}var Pt=(e,t,n,r,i,a)=>{var o=At(t,n);i=Tt(r,i),je([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(e.registeredClass.constructor_body===void 0&&(e.registeredClass.constructor_body=[]),e.registeredClass.constructor_body[t-1]!==void 0)throw new Le(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{Ot(`Cannot construct ${e.name} due to unbound types`,o)},je([],o,r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Nt(n,r,null,i,a),[])),[]})},Ft=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.slice(0,t)},It=(e,t,n,r,i,a,o,s,c,l)=>{var u=At(n,r);t=Ie(t),t=Ft(t),a=Tt(i,a,c),je([],[e],e=>{e=e[0];var r=`${e.name}.${t}`;t.startsWith(`@@`)&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);function i(){Ot(`Cannot call ${r} due to unbound types`,u)}var l=e.registeredClass.instancePrototype,d=l[t];return d===void 0||d.overloadTable===void 0&&d.className!==e.name&&d.argCount===n-2?(i.argCount=n-2,i.className=e.name,l[t]=i):(nt(l,t,r),l[t].overloadTable[n-2]=i),je([],u,i=>{var s=Nt(r,i,e,a,o,c);return l[t].overloadTable===void 0?(s.argCount=n-2,l[t]=s):l[t].overloadTable[n-2]=s,[]}),[]})},Lt=[],Rt=[0,1,,1,null,1,!0,1,!1,1],zt=[],Bt=e=>{if(e>9&&--Rt[e+1]===0){var t=Rt[e];Rt[e]=void 0;var n=zt[e];n&&(zt[e]=void 0,n(t)),Lt.push(e)}},Vt={toValue:e=>(e||Re(`Cannot use deleted val. handle = ${e}`),Rt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Lt.pop()||Rt.length;return Rt[t]=e,Rt[t+1]=1,t}}}},Ht={name:`emscripten::val`,fromWireType:e=>{var t=Vt.toValue(e);return Bt(e),t},toWireType:(e,t)=>Vt.toHandle(t),readValueFromPointer:L,destructorFunction:null},Ut=e=>Be(e,Ht),Wt,Gt,Kt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(Wt[e>>2])};case 8:return function(e){return this.fromWireType(Gt[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},qt=(e,t,n)=>{t=Ie(t),Be(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:Kt(t,n),destructorFunction:null})},Jt=(e,t,n,r,i,a,o,s)=>{var c=At(t,n);e=Ie(e),e=Ft(e),i=Tt(r,i,o),rt(e,function(){Ot(`Cannot call ${e} due to unbound types`,c)},t-1),je([],c,n=>{var r=[n[0],null].concat(n.slice(1));return bt(e,Nt(e,r,null,i,a,o),t-1),[]})},Yt,Xt,Zt,Qt=(e,t,n)=>{switch(t){case 1:return n?e=>te[e]:e=>Ne[e];case 2:return n?e=>Yt[e>>1]:e=>Xt[e>>1];case 4:return n?e=>Zt[e>>2]:e=>de[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},$t=(e,t,n,r,i)=>{t=Ie(t);let a=r===0,o=e=>e;if(a){var s=32-8*n;o=e=>e<<s>>>s,i=o(i)}Be(e,{name:t,fromWireType:o,toWireType:(e,t)=>t,readValueFromPointer:Qt(t,n,r!==0),destructorFunction:null})},en=(e,t,n)=>{let r=(e,t)=>{let n=0;return{next(){if(n>=e)return{done:!0};let r=n;return n++,{value:t(r),done:!1}},[Symbol.iterator](){return this}}};e[Symbol.iterator]||(e[Symbol.iterator]=function(){let e=this[t]();return r(e,e=>this[n](e))})},tn=(e,t,n,r)=>{n=Ie(n),r=Ie(r),je([],[e,t],e=>{let t=e[0];return en(t.registeredClass.instancePrototype,n,r),[]})},nn=(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=de[e>>2],n=de[e+4>>2];return new r(te.buffer,n,t)}n=Ie(n),Be(e,{name:n,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},rn=Object.assign({optional:!0},Ht),an=(e,t)=>{Be(e,rn)},on=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63,o++}}return t[n]=0,n-i},sn=(e,t,n)=>on(e,Ne,t,n),cn=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},ln=globalThis.TextDecoder&&new TextDecoder,un=(e,t,n,r)=>{var i=t+n;if(r)return i;for(;e[t]&&!(t>=i);)++t;return t},dn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=un(e,t,n,r);if(i-t>16&&e.buffer&&ln)return ln.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128))a+=String.fromCharCode(o);else{var s=e[t++]&63;if((o&224)==192)a+=String.fromCharCode((o&31)<<6|s);else{var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}}}return a},fn=(e,t,n)=>e?dn(Ne,e,t,n):``,pn=(e,t)=>{t=Ie(t);var n=!0;Be(e,{name:t,fromWireType(e){var t=de[e>>2],r=e+4,i;if(n)i=fn(r,t,!0);else{i=``;for(var a=0;a<t;++a)i+=String.fromCharCode(Ne[r+a])}return nr(e),i},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;i||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1||Re(`Cannot pass non-string to std::string`),r=n&&i?cn(t):t.length;var a=tr(4+r+1),o=a+4;if(de[a>>2]=r,i){if(n)sn(t,o,r+1);else for(var s=0;s<r;++s){var c=t.charCodeAt(s);c>255&&(nr(a),Re(`String has UTF-16 code units that do not fit in 8 bits`)),Ne[o+s]=c}}else Ne.set(t,o);return e!==null&&e.push(nr,a),a},readValueFromPointer:L,destructorFunction(e){nr(e)}})},mn=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,hn=(e,t,n)=>{var r=e>>1,i=un(Xt,r,t/2,n);if(i-r>16&&mn)return mn.decode(Xt.subarray(r,i));for(var a=``,o=r;o<i;++o){var s=Xt[o];a+=String.fromCharCode(s)}return a},gn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2147483647;if(n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);Yt[t>>1]=o,t+=2}return Yt[t>>1]=0,t-r},_n=e=>e.length*2,vn=(e,t,n)=>{for(var r=``,i=e>>2,a=0;!(a>=t/4);a++){var o=de[i+a];if(!o&&!n)break;r+=String.fromCodePoint(o)}return r},yn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2147483647;if(n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.codePointAt(a);if(o>65535&&a++,Zt[t>>2]=o,t+=4,t+4>i)break}return Zt[t>>2]=0,t-r},bn=e=>{for(var t=0,n=0;n<e.length;++n)e.codePointAt(n)>65535&&n++,t+=4;return t},xn=(e,t,n)=>{n=Ie(n);var r,i,a;t===2?(r=hn,i=gn,a=_n):(r=vn,i=yn,a=bn),Be(e,{name:n,fromWireType:e=>{var n=de[e>>2],i=r(e+4,n*t,!0);return nr(e),i},toWireType:(e,r)=>{typeof r!=`string`&&Re(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=tr(4+o+t);return de[s>>2]=o/t,i(r,s+4,o+t),e!==null&&e.push(nr,s),s},readValueFromPointer:L,destructorFunction(e){nr(e)}})},Sn=(e,t,n,r,i,a,o,s)=>{I[e]={name:Ie(t),rawConstructor:Tt(n,r),rawDestructor:Tt(i,a),valueSize:o,isTrivial:!!s,fields:[]}},Cn=(e,t,n,r,i,a,o,s,c,l)=>{I[e].fields.push({fieldName:Ie(t),getterReturnType:n,getter:Tt(r,i),getterContext:a,setterArgumentType:o,setter:Tt(s,c),setterContext:l})},wn=(e,t)=>{t=Ie(t),Be(e,{isVoid:!0,name:t,fromWireType:()=>void 0,toWireType:(e,t)=>void 0})},Tn=0,En=()=>{ae=!1,Tn=0},Dn=[],On=e=>{var t=Dn.length;return Dn.push(e),t},kn=(e,t)=>{var n=De[e];return n===void 0&&Re(`${t} has unknown type ${Dt(e)}`),n},An=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=kn(de[t+r*4>>2],`parameter ${r}`);return n},jn=(e,t,n)=>{var r=[],i=e(r,n);return r.length&&(de[t>>2]=Vt.toHandle(r)),i},Mn={},Nn=e=>{var t=Mn[e];return t===void 0?Ie(e):t},Pn=(e,t,n)=>{var[r,...i]=An(e,t),a=r.toWireType.bind(r),o=i.map(e=>e.readValueFromPointer.bind(e));e--;var s=Array(e);return On(et(`methodCaller<(${i.map(e=>e.name)}) => ${r.name}>`,(t,r,i,c)=>{for(var l=0,u=0;u<e;++u)s[u]=o[u](c+l),l+=8;var d;switch(n){case 0:d=Vt.toValue(t).apply(null,s);break;case 2:d=Reflect.construct(Vt.toValue(t),s);break;case 3:d=s[0];break;case 1:d=Vt.toValue(t)[Nn(r)](...s)}return jn(a,i,d)}))},Fn=e=>e?(e=Nn(e),Vt.toHandle(globalThis[e])):Vt.toHandle(globalThis),In=e=>{e>9&&(Rt[e+1]+=1)},Ln=(e,t,n,r,i)=>Dn[e](t,n,r,i),Rn=e=>{Ee(Vt.toValue(e)),Bt(e)},zn={},Bn=e=>{if(e instanceof M||e==`unwind`)return g;s(1,e)},Vn=()=>ae||Tn>0,Hn=e=>{if(g=e,!Vn()){var t;(t=i.onExit)==null||t.call(i,e),h=!0}s(e,new M(e))},Un=(e,t)=>{g=e,Hn(e)},Wn=()=>{if(!Vn())try{Un(g)}catch(e){Bn(e)}},Gn=function(e){var t=[...arguments].slice(1);if(!h)try{return e(...t)}catch(e){Bn(e)}finally{Wn()}},Kn=()=>performance.now(),qn=(e,t)=>(zn[e]&&(clearTimeout(zn[e].id),delete zn[e]),t&&(zn[e]={id:setTimeout(()=>{delete zn[e],Gn(ir,e,Kn())},t),timeout_ms:t}),0),Jn=()=>2147483648,Yn=(e,t)=>Math.ceil(e/t)*t,Xn=e=>{var t=(e-mr.buffer.byteLength+65535)/65536|0;try{return mr.grow(t),b(),1}catch{}},Zn=e=>{var t=Ne.length;e>>>=0;var n=Jn();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),Xn(Math.min(n,Yn(Math.max(e,i),65536))))return!0}return!1},Qn=e=>e;Qe(),vt(),i.noExitRuntime&&(ae=i.noExitRuntime),i.print&&i.print,i.printErr&&(p=i.printErr),i.wasmBinary&&(m=i.wasmBinary),i.arguments&&i.arguments,i.thisProgram&&i.thisProgram;var $n=i.preInit;if($n)for(typeof $n==`function`&&(i.preInit=$n=[$n]);$n.length>0;)$n.shift()();var er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr;function gr(e){er=e.sa,tr=i._malloc=e.ta,nr=i._free=e.ua,rr=e.va,ir=e.xa,ar=e.ya,or=e.za,sr=e.Aa,cr=e.Ba,lr=e.Ca,ur=e.Da,dr=e.Ea,fr=e.Fa,pr=xt.iiij=e.Ga,mr=e.qa,hr=e.wa}var _r={aa:P,v:pe,I:he,a:_e,i:ve,l:ye,fa:xe,s:Se,e:we,ea:Te,T:Fe,W:z,ia:Ve,pa:kt,oa:Pt,E:It,ga:Ut,Q:qt,R:Jt,y:$t,ka:tn,u:nn,S:an,ha:pn,L:xn,C:Sn,U:Cn,ja:wn,da:En,na:Pn,ba:Bt,B:Fn,P:In,ma:Ln,la:Rn,_:qn,$:Zn,Z:Lr,N:Br,A:Er,b:yr,z:zr,g:br,D:Ir,h:Tr,k:Nr,o:Mr,K:Rr,O:Fr,H:wr,G:Wr,V:Jr,c:Sr,j:vr,X:Gr,f:Cr,M:Hr,J:qr,d:xr,F:Kr,m:Or,Y:Ur,n:jr,t:Ar,x:Pr,q:kr,r:Vr,p:Dr,w:Qn,ca:Hn};function vr(e,t){var n=oe();try{ce(e)(t)}catch(e){if(N(n),!(e instanceof _))throw e;ar(1,0)}}function yr(e,t){var n=oe();try{return ce(e)(t)}catch(e){if(N(n),!(e instanceof _))throw e;ar(1,0)}}function br(e,t,n){var r=oe();try{return ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function xr(e,t,n,r){var i=oe();try{ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Sr(e){var t=oe();try{ce(e)()}catch(e){if(N(t),!(e instanceof _))throw e;ar(1,0)}}function Cr(e,t,n){var r=oe();try{ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function wr(e,t,n,r,i,a,o,s){var c=oe();try{return ce(e)(t,n,r,i,a,o,s)}catch(e){if(N(c),!(e instanceof _))throw e;ar(1,0)}}function Tr(e,t,n,r){var i=oe();try{return ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Er(e,t,n,r,i,a){var o=oe();try{return ce(e)(t,n,r,i,a)}catch(e){if(N(o),!(e instanceof _))throw e;ar(1,0)}}function Dr(e,t,n,r,i,a,o,s,c,l,u){var d=oe();try{ce(e)(t,n,r,i,a,o,s,c,l,u)}catch(e){if(N(d),!(e instanceof _))throw e;ar(1,0)}}function Or(e,t,n,r,i){var a=oe();try{ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function kr(e,t,n,r,i,a,o,s,c){var l=oe();try{ce(e)(t,n,r,i,a,o,s,c)}catch(e){if(N(l),!(e instanceof _))throw e;ar(1,0)}}function Ar(e,t,n,r,i,a,o){var s=oe();try{ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function jr(e,t,n,r,i,a){var o=oe();try{ce(e)(t,n,r,i,a)}catch(e){if(N(o),!(e instanceof _))throw e;ar(1,0)}}function Mr(e,t,n,r,i,a){var o=oe();try{return ce(e)(t,n,r,i,a)}catch(e){if(N(o),!(e instanceof _))throw e;ar(1,0)}}function Nr(e,t,n,r,i){var a=oe();try{return ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function Pr(e,t,n,r,i,a,o,s){var c=oe();try{ce(e)(t,n,r,i,a,o,s)}catch(e){if(N(c),!(e instanceof _))throw e;ar(1,0)}}function Fr(e,t,n,r,i,a,o){var s=oe();try{return ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function Ir(e,t,n,r,i){var a=oe();try{return ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function Lr(e,t,n){var r=oe();try{return ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function Rr(e,t,n,r,i,a,o){var s=oe();try{return ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function zr(e,t,n,r){var i=oe();try{return ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Br(e,t,n,r){var i=oe();try{return ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Vr(e,t,n,r,i,a,o,s,c,l){var u=oe();try{ce(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(N(u),!(e instanceof _))throw e;ar(1,0)}}function Hr(e,t,n,r,i,a,o,s,c){var l=oe();try{ce(e)(t,n,r,i,a,o,s,c)}catch(e){if(N(l),!(e instanceof _))throw e;ar(1,0)}}function Ur(e,t,n,r,i,a,o,s){var c=oe();try{ce(e)(t,n,r,i,a,o,s)}catch(e){if(N(c),!(e instanceof _))throw e;ar(1,0)}}function Wr(e,t,n,r,i,a,o,s,c){var l=oe();try{return ce(e)(t,n,r,i,a,o,s,c)}catch(e){if(N(l),!(e instanceof _))throw e;ar(1,0)}}function Gr(e,t,n){var r=oe();try{ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function Kr(e,t,n,r,i,a,o){var s=oe();try{ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function qr(e,t,n,r,i){var a=oe();try{ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function Jr(e,t,n,r,i){var a=oe();try{return pr(e,t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}async function Yr(){var e;x();var t=i.setStatus;t&&(t(`Running...`),await new Promise(e=>setTimeout(e,1)),setTimeout(t,1,``)),!h&&(S(),(e=i.onRuntimeInitialized)==null||e.call(i),C())}var Xr=await j();return await Yr(),i}function pK(e){return lK(fK,e)}async function mK(e,t){return uK(fK,e,t)}var hK=[[`aztec`,`Aztec`],[`aztec_code`,`AztecCode`],[`aztec_rune`,`AztecRune`],[`code_128`,`Code128`],[`code_39`,`Code39`],[`code_39_standard`,`Code39Std`],[`code_39_extended`,`Code39Ext`],[`code_32`,`Code32`],[`pzn`,`PZN`],[`code_93`,`Code93`],[`codabar`,`Codabar`],[`databar`,`DataBar`],[`databar_omni`,`DataBarOmni`],[`databar_stacked`,`DataBarStk`],[`databar_stacked_omni`,`DataBarStkOmni`],[`databar_expanded`,`DataBarExp`],[`databar_expanded_stacked`,`DataBarExpStk`],[`databar_limited`,`DataBarLtd`],[`data_matrix`,`DataMatrix`],[`dx_film_edge`,`DXFilmEdge`],[`ean_13`,`EAN13`],[`ean_upc`,`EANUPC`],[`isbn`,`ISBN`],[`ean_8`,`EAN8`],[`itf`,`ITF`],[`itf_14`,`ITF14`],[`maxi_code`,`MaxiCode`],[`micro_qr_code`,`MicroQRCode`],[`pdf417`,`PDF417`],[`compact_pdf417`,`CompactPDF417`],[`micro_pdf417`,`MicroPDF417`],[`qr_code`,`QRCode`],[`qr_code_model_1`,`QRCodeModel1`],[`qr_code_model_2`,`QRCodeModel2`],[`rm_qr_code`,`RMQRCode`],[`upc_a`,`UPCA`],[`upc_e`,`UPCE`],[`telepen`,`Telepen`],[`telepen_alpha`,`TelepenAlpha`],[`telepen_numeric`,`TelepenNumeric`],[`other_barcode`,`OtherBarcode`],[`linear_codes`,`AllLinear`],[`matrix_codes`,`AllMatrix`],[`gs1_codes`,`AllGS1`],[`retail_codes`,`AllRetail`],[`industrial_codes`,`AllIndustrial`],[`any`,`All`]],gK=[...hK,[`unknown`]].map(e=>e[0]),_K=new Map(hK);function vK(e){for(let[t,n]of _K)if(e===n)return t;return`unknown`}function yK(e){if(bK(e))return{width:e.naturalWidth,height:e.naturalHeight};if(xK(e))return{width:e.width.baseVal.value,height:e.height.baseVal.value};if(SK(e))return{width:e.videoWidth,height:e.videoHeight};if(wK(e))return{width:e.width,height:e.height};if(EK(e))return{width:e.displayWidth,height:e.displayHeight};if(CK(e)||TK(e))return{width:e.width,height:e.height};throw TypeError(`The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.`)}function bK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLImageElement)}catch{return!1}}function xK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.SVGImageElement)}catch{return!1}}function SK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLVideoElement)}catch{return!1}}function CK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLCanvasElement)}catch{return!1}}function wK(e){try{return e instanceof ImageBitmap||Object.prototype.toString.call(e)===`[object ImageBitmap]`}catch{return!1}}function TK(e){try{return e instanceof OffscreenCanvas||Object.prototype.toString.call(e)===`[object OffscreenCanvas]`}catch{return!1}}function EK(e){try{return e instanceof VideoFrame||Object.prototype.toString.call(e)===`[object VideoFrame]`}catch{return!1}}function DK(e){try{return e instanceof Blob||Object.prototype.toString.call(e)===`[object Blob]`}catch{return!1}}function OK(e){try{return e instanceof ImageData||Object.prototype.toString.call(e)===`[object ImageData]`}catch{return!1}}function kK(e,t){try{let n=new OffscreenCanvas(e,t);if(n.getContext(`2d`)instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}}async function AK(e){if(bK(e)&&!await PK(e))throw new DOMException(`Failed to load or decode HTMLImageElement.`,`InvalidStateError`);if(xK(e)&&!await FK(e))throw new DOMException(`Failed to load or decode SVGImageElement.`,`InvalidStateError`);if(EK(e)&&IK(e))throw new DOMException(`VideoFrame is closed.`,`InvalidStateError`);if(SK(e)&&(e.readyState===0||e.readyState===1))throw new DOMException(`Invalid element or state.`,`InvalidStateError`);if(wK(e)&&RK(e))throw new DOMException(`The image source is detached.`,`InvalidStateError`);let{width:t,height:n}=yK(e);if(t===0||n===0)return null;let r=kK(t,n).getContext(`2d`);r.drawImage(e,0,0);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function jK(e){let t;try{t=await createImageBitmap(e)}catch{try{if(globalThis.Image){t=new Image;let n=``;try{n=URL.createObjectURL(e),t.src=n,await t.decode()}finally{URL.revokeObjectURL(n)}}else return e}catch{throw new DOMException(`Failed to load or decode Blob.`,`InvalidStateError`)}}try{return await AK(t)}finally{wK(t)&&t.close()}}function MK(e){let{width:t,height:n}=e;if(t===0||n===0)return null;let r=e.getContext(`2d`);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function NK(e){if(DK(e))return await jK(e);if(OK(e)){if(LK(e))throw new DOMException(`The image data has been detached.`,`InvalidStateError`);return e}return CK(e)||TK(e)?MK(e):await AK(e)}async function PK(e){try{return await e.decode(),!0}catch{return!1}}async function FK(e){try{return await e.decode?.call(e),!0}catch{return!1}}function IK(e){return e.format===null}function LK(e){return e.data.buffer.byteLength===0}function RK(e){return e.width===0&&e.height===0}function zK(e,t){return BK(e)?new DOMException(`${t}: ${e.message}`,e.name):VK(e)?new e.constructor(`${t}: ${e.message}`):Error(`${t}: ${e}`)}function BK(e){return e instanceof DOMException||Object.prototype.toString.call(e)===`[object DOMException]`}function VK(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function HK(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function UK(e,t,n){HK(e,t),t.set(e,n)}function WK(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function GK(e,t,n){return e.set(WK(e,t),n),n}function KK(e,t){return e.get(WK(e,t))}var qK=new WeakMap,JK=class{constructor(e={}){UK(this,qK,void 0);try{var t;let n=e==null||(t=e.formats)==null?void 0:t.filter(e=>e!==`unknown`);if(n?.length===0)throw TypeError(`Hint option provided, but is empty.`);for(let e of n??[])if(!_K.has(e))throw TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${e}' is not a valid enum value of type BarcodeFormat.`);GK(qK,this,n??[]),pK({fireImmediately:!0}).catch(()=>{})}catch(e){throw zK(e,`Failed to construct 'BarcodeDetector'`)}}static async getSupportedFormats(){return gK.filter(e=>e!==`unknown`)}async detect(e){try{let t=await NK(e);if(t===null)return[];let n,r={textMode:`Plain`,formats:KK(qK,this).map(e=>_K.get(e))};try{n=await mK(t,r)}catch(e){throw console.error(e),new DOMException(`Barcode detection service unavailable.`,`NotSupportedError`)}return n.map(e=>{let{topLeft:{x:t,y:n},topRight:{x:r,y:i},bottomLeft:{x:a,y:o},bottomRight:{x:s,y:c}}=e.position,l=Math.min(t,r,a,s),u=Math.min(n,i,o,c),d=Math.max(t,r,a,s),f=Math.max(n,i,o,c);return{boundingBox:new DOMRectReadOnly(l,u,d-l,f-u),rawValue:e.text,format:vK(e.format),cornerPoints:[{x:t,y:n},{x:r,y:i},{x:s,y:c},{x:a,y:o}]}})}catch(e){throw zK(e,`Failed to execute 'detect' on 'BarcodeDetector'`)}}},YK=!0,XK=!0;function ZK(e,t,n){let r=e.match(t);return r&&r.length>=n&&parseFloat(r[n],10)}function QK(e,t,n){if(!e.RTCPeerConnection)return;if(!Object.getOwnPropertyDescriptor(EventTarget.prototype,`addEventListener`).writable){tq(`Unable to polyfill events`);return}let r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);let a=e=>{let t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,a),i.apply(this,[e,a])};let a=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t]||!this._eventMap[t].has(n))return a.apply(this,arguments);let r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,a.apply(this,[e,r])},Object.defineProperty(r,`on`+t,{get(){return this[`_on`+t]},set(e){this[`_on`+t]&&(this.removeEventListener(t,this[`_on`+t]),delete this[`_on`+t]),e&&this.addEventListener(t,this[`_on`+t]=e)},enumerable:!0,configurable:!0})}function $K(e){return typeof e==`boolean`?(YK=e,e?`adapter.js logging disabled`:`adapter.js logging enabled`):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function eq(e){return typeof e==`boolean`?(XK=!e,`adapter.js deprecation warnings `+(e?`disabled`:`enabled`)):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function tq(){if(typeof window==`object`){if(YK)return;typeof console<`u`&&typeof console.log==`function`&&console.log.apply(console,arguments)}}function nq(e,t){XK&&console.warn(e+` is deprecated, please use `+t+` instead.`)}function rq(e){let t={browser:null,version:null};if(e===void 0||!e.navigator||!e.navigator.userAgent)return t.browser=`Not a browser.`,t;let{navigator:n}=e;if(n.userAgentData&&n.userAgentData.brands){let e=n.userAgentData.brands.find(e=>e.brand===`Chromium`);if(e){let t=parseInt(e.version,10);if(t>=90)return{browser:`chrome`,version:t}}}if(n.mozGetUserMedia)t.browser=`firefox`,t.version=parseInt(ZK(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||e.isSecureContext===!1&&e.webkitRTCPeerConnection)t.browser=`chrome`,t.version=parseInt(ZK(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2))||null;else if(e.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser=`safari`,t.version=parseInt(ZK(n.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&`currentDirection`in e.RTCRtpTransceiver.prototype,t._safariVersion=ZK(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return t.browser=`Not a supported browser.`,t;return t}function iq(e){return Object.prototype.toString.call(e)===`[object Object]`}function aq(e){return iq(e)?Object.keys(e).reduce(function(t,n){let r=iq(e[n]),i=r?aq(e[n]):e[n],a=r&&!Object.keys(i).length;return i===void 0||a?t:Object.assign(t,{[n]:i})},{}):e}function oq(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach(r=>{r.endsWith(`Id`)?oq(e,e.get(t[r]),n):r.endsWith(`Ids`)&&t[r].forEach(t=>{oq(e,e.get(t),n)})}))}function sq(e,t,n){let r=n?`outbound-rtp`:`inbound-rtp`,i=new Map;if(t===null)return i;let a=[];return e.forEach(e=>{e.type===`track`&&e.trackIdentifier===t.id&&a.push(e)}),a.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&oq(e,n,i)})}),i}var cq=tq;function lq(e,t){if(t.version>=64)return;let n=e&&e.navigator;if(!n.mediaDevices)return;let r=function(e){if(typeof e!=`object`||e.mandatory||e.optional)return e;let t={};return Object.keys(e).forEach(n=>{if(n===`require`||n===`advanced`||n===`mediaSource`)return;let r=typeof e[n]==`object`?e[n]:{ideal:e[n]};r.exact!==void 0&&typeof r.exact==`number`&&(r.min=r.max=r.exact);let i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):t===`deviceId`?`sourceId`:t};if(r.ideal!==void 0){t.optional=t.optional||[];let e={};typeof r.ideal==`number`?(e[i(`min`,n)]=r.ideal,t.optional.push(e),e={},e[i(`max`,n)]=r.ideal,t.optional.push(e)):(e[i(``,n)]=r.ideal,t.optional.push(e))}r.exact!==void 0&&typeof r.exact!=`number`?(t.mandatory=t.mandatory||{},t.mandatory[i(``,n)]=r.exact):[`min`,`max`].forEach(e=>{r[e]!==void 0&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if(e=JSON.parse(JSON.stringify(e)),e&&typeof e.audio==`object`){let t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),t(e.audio,`autoGainControl`,`googAutoGainControl`),t(e.audio,`noiseSuppression`,`googNoiseSuppression`),e.audio=r(e.audio)}if(e&&typeof e.video==`object`){let a=e.video.facingMode;a&&=typeof a==`object`?a:{ideal:a};let o=t.version<66;if(a&&(a.exact===`user`||a.exact===`environment`||a.ideal===`user`||a.ideal===`environment`)&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!o)){delete e.video.facingMode;let t;if(a.exact===`environment`||a.ideal===`environment`?t=[`back`,`rear`]:(a.exact===`user`||a.ideal===`user`)&&(t=[`front`]),t)return n.mediaDevices.enumerateDevices().then(n=>{n=n.filter(e=>e.kind===`videoinput`);let o=n.find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!o&&n.length&&t.includes(`back`)&&(o=n[n.length-1]),o&&(e.video.deviceId=a.exact?{exact:o.deviceId}:{ideal:o.deviceId}),e.video=r(e.video),cq(`chrome: `+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return cq(`chrome: `+JSON.stringify(e)),i(e)},a=function(e){return t.version>=64?e:{name:{PermissionDeniedError:`NotAllowedError`,PermissionDismissedError:`NotAllowedError`,InvalidStateError:`NotAllowedError`,DevicesNotFoundError:`NotFoundError`,ConstraintNotSatisfiedError:`OverconstrainedError`,TrackStartError:`NotReadableError`,MediaDeviceFailedDueToShutdown:`NotAllowedError`,MediaDeviceKillSwitchOn:`NotAllowedError`,TabCaptureError:`AbortError`,ScreenCaptureError:`AbortError`,DeviceCaptureError:`AbortError`}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&`: `)+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(a(e))})})}.bind(n),n.mediaDevices.getUserMedia){let e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException(``,`NotFoundError`);return e},e=>Promise.reject(a(e))))}}}var uq=s({fixNegotiationNeeded:()=>vq,shimAddTrackRemoveTrack:()=>gq,shimAddTrackRemoveTrackWithNative:()=>hq,shimGetSendersWithDtmf:()=>pq,shimGetUserMedia:()=>lq,shimMediaStream:()=>dq,shimOnTrack:()=>fq,shimPeerConnection:()=>_q,shimSenderReceiverGetStats:()=>mq});function dq(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function fq(e,t){if(!(t.version>102)){if(typeof e==`object`&&e.RTCPeerConnection&&!(`ontrack`in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener(`track`,this._ontrack),this.addEventListener(`track`,this._ontrack=e)},enumerable:!0,configurable:!0});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener(`addtrack`,n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};let i=new Event(`track`);i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};let i=new Event(`track`);i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener(`addstream`,this._ontrackpoly)),t.apply(this,arguments)}}else QK(e,`track`,e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}}function pq(e){if(typeof e==`object`&&e.RTCPeerConnection&&!(`getSenders`in e.RTCPeerConnection.prototype)&&`createDTMFSender`in e.RTCPeerConnection.prototype){let t=function(e,t){return{track:t,get dtmf(){return this._dtmf===void 0&&(this._dtmf=t.kind===`audio`?e.createDTMFSender(t):null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};let n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};let r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);let t=this._senders.indexOf(e);t!==-1&&this._senders.splice(t,1)}}let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{let t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if(typeof e==`object`&&e.RTCPeerConnection&&`getSenders`in e.RTCPeerConnection.prototype&&`createDTMFSender`in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!(`dtmf`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this._dtmf=this.track.kind===`audio`?this._pc.createDTMFSender(this.track):null),this._dtmf}})}}function mq(e,t){if(t.version>=67||!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!(`getStats`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>sq(t,e.track,!0))}}if(!(`getStats`in e.RTCRtpReceiver.prototype)){let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),QK(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>sq(t,e.track,!1))}}if(!(`getStats`in e.RTCRtpSender.prototype&&`getStats`in e.RTCRtpReceiver.prototype))return;let n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){let e=arguments[0],t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException(`There are more than one sender or receiver for the track.`,`InvalidAccessError`)):t?t.getStats():n?n.getStats():Promise.reject(new DOMException(`There is no sender or receiver for the track.`,`InvalidAccessError`))}return n.apply(this,arguments)}}function hq(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};let r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?this._shimmedLocalStreams[n.id].indexOf(r)===-1&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)});let t=this.getSenders();n.apply(this,arguments);let r=this.getSenders().filter(e=>t.indexOf(e)===-1);this._shimmedLocalStreams[e.id]=[e].concat(r)};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};let i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{let n=this._shimmedLocalStreams[t].indexOf(e);n!==-1&&this._shimmedLocalStreams[t].splice(n,1),this._shimmedLocalStreams[t].length===1&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function gq(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return hq(e);let n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){let e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};let r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)}),!this._reverseStreams[t.id]){let n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};let i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);let r=[].slice.call(arguments,1);if(r.length!==1||!r[0].getTracks().find(e=>e===t))throw new DOMException(`The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.`,`NotSupportedError`);if(this.getSenders().find(e=>e.track===t))throw new DOMException(`Track already exists.`,`InvalidAccessError`);this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};let i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event(`negotiationneeded`))});else{let r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)};function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,`g`),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,`g`),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}[`createOffer`,`createAnswer`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){let e=arguments;return arguments.length&&typeof arguments[0]==`function`?n.apply(this,[t=>{let n=a(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>a(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]});let s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type||(arguments[0]=o(this,arguments[0])),s.apply(this,arguments)};let c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,`localDescription`);Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){let e=c.get.apply(this);return e.type===``?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);if(!e._pc)throw new DOMException(`Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.`,`TypeError`);if(e._pc!==this)throw new DOMException(`Sender was not created by this connection.`,`InvalidAccessError`);this._streams=this._streams||{};let t;Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(t.getTracks().length===1?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event(`negotiationneeded`)))}}function _q(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})}function vq(e,t){t.version>102||QK(e,`negotiationneeded`,e=>{let n=e.target;if(!((t.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics===`plan-b`)&&n.signalingState!==`stable`))return e})}function yq(e,t){let n=e&&e.navigator;if(!n.mediaDevices)return;let r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){nq(`navigator.getUserMedia`,`navigator.mediaDevices.getUserMedia`),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&`autoGainControl`in n.mediaDevices.getSupportedConstraints())){let e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return typeof n==`object`&&typeof n.audio==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,`autoGainControl`,`mozAutoGainControl`),e(n.audio,`noiseSuppression`,`mozNoiseSuppression`)),t(n)},r&&r.prototype.getSettings){let t=r.prototype.getSettings;r.prototype.getSettings=function(){let n=t.apply(this,arguments);return e(n,`mozAutoGainControl`,`autoGainControl`),e(n,`mozNoiseSuppression`,`noiseSuppression`),n}}if(r&&r.prototype.applyConstraints){let t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return this.kind===`audio`&&typeof n==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n,`autoGainControl`,`mozAutoGainControl`),e(n,`noiseSuppression`,`mozNoiseSuppression`)),t.apply(this,[n])}}}}function bq(e,t){e.navigator.mediaDevices&&(e.navigator.mediaDevices&&`getDisplayMedia`in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){let e=new DOMException(`getDisplayMedia without video constraints is undefined`);return e.name=`NotFoundError`,e.code=8,Promise.reject(e)}return n.video===!0?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)}))}var xq=s({shimAddTransceiver:()=>kq,shimCreateAnswer:()=>Mq,shimCreateOffer:()=>jq,shimGetDisplayMedia:()=>bq,shimGetParameters:()=>Aq,shimGetStats:()=>wq,shimGetUserMedia:()=>yq,shimOnTrack:()=>Sq,shimPeerConnection:()=>Cq,shimRTCDataChannel:()=>Oq,shimReceiverGetStats:()=>Eq,shimRemoveStream:()=>Dq,shimSenderGetStats:()=>Tq});function Sq(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Cq(e,t){typeof e==`object`&&(e.RTCPeerConnection||e.mozRTCPeerConnection)&&(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function wq(e,t){if(typeof e!=`object`||!(e.RTCPeerConnection||e.mozRTCPeerConnection)||t.version>=151)return;let n={inboundrtp:`inbound-rtp`,outboundrtp:`outbound-rtp`,candidatepair:`candidate-pair`,localcandidate:`local-candidate`,remotecandidate:`remote-candidate`},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){let[e,i,a]=arguments;return this.signalingState===`closed`?Promise.resolve(new Map):r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if(t.name!==`TypeError`)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,a)}}function Tq(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpSender.prototype)return;let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Eq(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpReceiver.prototype)return;let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),QK(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Dq(e){!e.RTCPeerConnection||`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){nq(`removeStream`,`removeTrack`),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function Oq(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function kq(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.addTransceiver;n&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;e===void 0&&(e=[]),e=[...e];let t=e.length>0;t&&e.forEach(e=>{if(`rid`in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw TypeError(`Invalid RID value provided.`);if(`scaleResolutionDownBy`in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw RangeError(`scale_resolution_down_by must be >= 1.0`);if(`maxFramerate`in e&&!(parseFloat(e.maxFramerate)>=0))throw RangeError(`max_framerate must be >= 0.0`)});let r=n.apply(this,arguments);if(t){let{sender:t}=r,n=t.getParameters();(!(`encodings`in n)||n.encodings.length===1&&Object.keys(n.encodings[0]).length===0)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return r})}function Aq(e,t){if(!(typeof e==`object`&&e.RTCRtpSender)||t.version>=110)return;let n=e.RTCRtpSender.prototype.getParameters;n&&(e.RTCRtpSender.prototype.getParameters=function(){let e=n.apply(this,arguments);return`encodings`in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function jq(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>n.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):n.apply(this,arguments)}}function Mq(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>n.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):n.apply(this,arguments)}}var Nq=s({shimAudioContext:()=>Hq,shimCallbacksAPI:()=>Iq,shimConstraints:()=>Rq,shimCreateOfferLegacy:()=>Vq,shimGetUserMedia:()=>Lq,shimLocalStreamsAPI:()=>Pq,shimRTCIceServerUrls:()=>zq,shimRemoteStreamsAPI:()=>Fq,shimTrackEventTransceiver:()=>Bq});function Pq(e){if(typeof e==`object`&&e.RTCPeerConnection){if(`getLocalStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||=[],this._localStreams}),!(`addStream`in e.RTCPeerConnection.prototype)){let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||=[],this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||=[];let t=this._localStreams.indexOf(e);if(t===-1)return;this._localStreams.splice(t,1);let n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function Fq(e){if(typeof e==`object`&&e.RTCPeerConnection&&(`getRemoteStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!(`onaddstream`in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener(`addstream`,this._onaddstream),this.removeEventListener(`track`,this._onaddstreampoly)),this.addEventListener(`addstream`,this._onaddstream=e),this.addEventListener(`track`,this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||=[],this._remoteStreams.includes(e))return;this._remoteStreams.push(e);let t=new Event(`addstream`);t.stream=e,this.dispatchEvent(t)})})}});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){let e=this;return this._onaddstreampoly||this.addEventListener(`track`,this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||=[],e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);let n=new Event(`addstream`);n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function Iq(e){if(typeof e!=`object`||!e.RTCPeerConnection)return;let t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,a=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){let r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){let n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,n){let r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){let r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){let r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function Lq(e){let t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){let e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(Rq(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function Rq(e){return e&&e.video!==void 0?Object.assign({},e,{video:aq(e.video)}):e}function zq(e){if(!e.RTCPeerConnection)return;let t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){let t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];r.urls===void 0&&r.url?(nq(`RTCIceServer.url`,`RTCIceServer.urls`),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,`generateCertificate`in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get(){return t.generateCertificate}})}function Bq(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Vq(e){let t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){e.offerToReceiveAudio!==void 0&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);let t=this.getTransceivers().find(e=>e.receiver.track.kind===`audio`);e.offerToReceiveAudio===!1&&t?t.direction===`sendrecv`?t.setDirection?t.setDirection(`sendonly`):t.direction=`sendonly`:t.direction===`recvonly`&&(t.setDirection?t.setDirection(`inactive`):t.direction=`inactive`):e.offerToReceiveAudio===!0&&!t&&this.addTransceiver(`audio`,{direction:`recvonly`}),e.offerToReceiveVideo!==void 0&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);let n=this.getTransceivers().find(e=>e.receiver.track.kind===`video`);e.offerToReceiveVideo===!1&&n?n.direction===`sendrecv`?n.setDirection?n.setDirection(`sendonly`):n.direction=`sendonly`:n.direction===`recvonly`&&(n.setDirection?n.setDirection(`inactive`):n.direction=`inactive`):e.offerToReceiveVideo===!0&&!n&&this.addTransceiver(`video`,{direction:`recvonly`})}return t.apply(this,arguments)}}function Hq(e){typeof e!=`object`||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Uq=o(((e,t)=>{var n={};n.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split(`
|
|
259
|
+
`,AW=`${kW} 1s ease-in-out infinite`;function jW(e){return`animationName`in e}function MW(e){let t=e.currentTarget.getAnimations().find(e=>jW(e)&&e.animationName===kW.name);if(t&&typeof t.startTime==`number`)t.startTime-=t.startTime%1e3;else if(t&&typeof t.startTime==`object`&&t.startTime instanceof CSSNumericValue){let e=t.startTime.to(`ms`).value;t.startTime=CSS.ms(e-e%1e3)}}var NW=W(`div`,{shouldForwardProp:e=>e!==`fsize`})(({fsize:e,theme:t})=>{if(!e)return{fontSize:`1.25rem`,fontWeight:`500`};switch(e){case`normal`:return{fontSize:`1rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1.25rem`},[t.breakpoints.up(`lg`)]:{fontSize:`1.5rem`}};case`large`:return{fontSize:`1.5rem`,fontWeight:`500`,[t.breakpoints.up(`lg`)]:{fontSize:`1.75rem`},[t.breakpoints.up(`xl`)]:{fontSize:`2rem`}};case`x-large`:return{fontSize:`1.5rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1.75rem`},[t.breakpoints.up(`lg`)]:{fontSize:`2.75rem`},[t.breakpoints.up(`xl`)]:{fontSize:`3.75rem`}}}}),PW=W(`div`,{shouldForwardProp:e=>e!==`fsize`})(({fsize:e,theme:t})=>{if(!e)return{fontSize:`0.75rem`,fontWeight:`500`};switch(e){case`normal`:return{fontSize:`0.75rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1rem`}};case`large`:return{fontSize:`1rem`,fontWeight:`500`,[t.breakpoints.up(`lg`)]:{fontSize:`1.5rem`},[t.breakpoints.up(`xl`)]:{fontSize:`1.75rem`}};case`x-large`:return{fontSize:`1rem`,fontWeight:`500`,[t.breakpoints.up(`md`)]:{fontSize:`1.5rem`},[t.breakpoints.up(`lg`)]:{fontSize:`2.5rem`},[t.breakpoints.up(`xl`)]:{fontSize:`3.5rem`}}}});function FW({mat:e,displayActionForSinglePallet:t,displayActionForSingleBasket:n,fsize:r}){let i=I(QO),a=IW(e,i,Ik(I(Dr).basketName),t,n);return a===null?null:(0,V.jsx)(PW,{fsize:r,children:mL(i,e)?`System alarm`:a})}function IW(e,t,n,r,i){switch(e.action.type){case B.Loading:if(e.action.loadFromBasketId){if(e.action.loadOntoPalletNum===null||e.action.loadOntoPalletNum===void 0)return(0,V.jsxs)(V.Fragment,{children:[`Load into `,n,` `,e.action.loadFromBasketId]});if(r===void 0)return(0,V.jsxs)(V.Fragment,{children:[`Load from `,n,` `,e.action.loadFromBasketId,` to pal`,` `,e.action.loadOntoPalletNum??``]});if(r===e.action.loadOntoPalletNum){let r=e.action.loadOntoFace??0,i=e.action.loadOntoPalletNum?t.pallets[e.action.loadOntoPalletNum]?.faceNames?.[r-1]:null;return(0,V.jsxs)(V.Fragment,{children:[`Load from `,n,` `,e.action.loadFromBasketId,` to`,` `,i??`face ${r}`]})}return null}switch(e.location.type){case lt.OnPallet:if(r===void 0||r===e.location.palletNum){if(e.action.loadOntoFace===void 0||e.action.loadOntoFace===e.location.face)return e.action.processAfterLoad&&e.action.processAfterLoad!==e.process?(0,V.jsxs)(V.Fragment,{children:[`Reclamp material to process # `,e.action.processAfterLoad]}):null;{let n=e.action.loadOntoFace??0,r=e.location.palletNum?t.pallets[e.location.palletNum]?.faceNames?.[n-1]:null;return(0,V.jsxs)(V.Fragment,{children:[`Transfer to `,r??`face ${n}`]})}}return null;default:{let n=e.action.loadOntoFace??0,i=e.action.loadOntoPalletNum?t.pallets[e.action.loadOntoPalletNum]?.faceNames?.[n-1]:null;return r===void 0?(0,V.jsxs)(V.Fragment,{children:[`Load to `,i??`face ${n}`,` of pal `,e.action.loadOntoPalletNum??``]}):r===e.action.loadOntoPalletNum?(0,V.jsxs)(V.Fragment,{children:[`Load to `,i??`face ${n}`]}):null}}case B.LoadingToBasket:return i!==void 0&&i===e.action.loadToBasketId&&e.action.loadToBasketSlot!==void 0?(0,V.jsxs)(V.Fragment,{children:[`Load into slot `,Fk(e.action.loadToBasketSlot),e.action.processAfterLoad===void 0?``:` for process ${e.action.processAfterLoad}`]}):(0,V.jsxs)(V.Fragment,{children:[`Load into `,n,` `,e.action.loadToBasketId??``,e.action.loadToBasketSlot===void 0?``:` slot ${Fk(e.action.loadToBasketSlot)}`,e.action.processAfterLoad===void 0?``:` for process ${e.action.processAfterLoad}`]});case B.UnloadToInProcess:case B.UnloadToCompletedMaterial:return e.action.unloadToBasketId?(0,V.jsxs)(V.Fragment,{children:[`Unload to `,n,` `,e.action.unloadToBasketId,e.action.unloadToBasketSlot===void 0?``:` slot ${Fk(e.action.unloadToBasketSlot)}`]}):e.action.unloadIntoQueue?(0,V.jsxs)(V.Fragment,{children:[`Unload into queue `,e.action.unloadIntoQueue]}):e.action.type===B.UnloadToCompletedMaterial&&e.location.type===lt.InBasket?(0,V.jsxs)(V.Fragment,{children:[`Unload completed from `,n,` `,e.location.basketId]}):e.location.type===lt.InBasket?(0,V.jsxs)(V.Fragment,{children:[`Unload from `,n,` `,e.location.basketId]}):(0,V.jsx)(V.Fragment,{children:`Unload from pallet`});case B.Waiting:if(e.location.type===lt.InQueue&&e.jobUnique&&e.jobUnique!==``)return(0,V.jsxs)(V.Fragment,{children:[`Waiting; next process is #`,e.process+1]});if(e.location.type===lt.InBasket)return(0,V.jsxs)(V.Fragment,{children:[`In `,n,` `,e.location.basketId]});if(e.location.type===lt.OnPallet){if((t.jobs[e.jobUnique]?.procsAndPaths?.[e.process-1]?.paths?.[e.path-1])?.stops?.length===0)return(0,V.jsx)(V.Fragment,{children:`Waiting`});if(e.lastCompletedMachiningRouteStopIndex===null||e.lastCompletedMachiningRouteStopIndex===void 0)return(0,V.jsx)(V.Fragment,{children:`Waiting for machining`})}break;case B.Machining:return(0,V.jsxs)(V.Fragment,{children:[`Machining program `,e.action.program??``]})}return null}function LW({mat:e,inProcMat:t}){let n=I(jR).matsById.get(e.materialID),r=t?n?.quarantineSignals?.get(EW(t).process)?.note:void 0,i=null;if(e.signaledInspections.length>0&&(i=`Inspect: `+e.signaledInspections.join(`, `)),e.quarantineAfterUnload){let e=`Material will quarantine after unload`+(r?`: ${r}`:``);i===null?i=e:i+=`; ${e}`}return i===null?null:(0,V.jsx)(X,{title:i,describeChild:!0,children:(0,V.jsx)(yE,{titleAccess:`Material warnings`})})}function RW({fsize:e,mat:t}){let n=I(QO).jobs[t.jobUnique],r=t.path;if((t.action.type===B.Loading||t.action.type===B.LoadingToBasket)&&t.action.pathAfterLoad&&(r=t.action.pathAfterLoad),!n)return null;let i=n.procsAndPaths?.[0]?.paths?.[r-1];return i&&i.casting&&i.casting!==``?(0,V.jsx)(PW,{fsize:e,children:i.casting}):null}function zW({fsize:e,uniq:t}){let n=I(QO).jobs[t],r=I(az);if(n&&n.bookings&&n.bookings.length>0){let t=r.get(n.bookings[0]);if(t&&t.notes&&t.notes!==``)return(0,V.jsx)(PW,{fsize:e,style:{textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,maxWidth:`10em`},children:t.notes})}return null}function BW(){let e=I(QO),t=I(ML);if(!t)return null;let n=e.workorders?.find(e=>e.workorderId===t)?.comments??[];return(0,V.jsxs)(`div`,{style:{marginTop:`1em`,marginLeft:`1em`},children:[(0,V.jsxs)(`p`,{children:[`Workorder: `,t]}),(0,V.jsx)(`ul`,{children:n.map((e,t)=>(0,V.jsx)(`li`,{children:e.comment},t))})]})}var VW=function({mat:e,materialCount:t=1,inProcMat:n,fsize:r,focusInspectionType:i,isDragOverlay:a,isActiveDrag:o,shake:s,dragRootProps:c,showDragHandle:l,setDragHandleRef:u,dragHandleProps:d,displayJob:f,hideEmptySerial:p,showRawMaterial:m,showJobComment:h,displayActionForSinglePallet:g,displayActionForSingleBasket:_,hideAvatar:v,hideWarningIcon:y,ref:b}){let x=L(SL),S=e.completedInspections||{},C;return i&&S[i]?C=(0,V.jsxs)(PW,{fsize:r,children:[(0,V.jsx)(`span`,{children:`Inspection completed `}),(0,V.jsx)(hB,{date:S[i].time})]}):i&&e.last_unload_time?C=(0,V.jsxs)(PW,{fsize:r,children:[(0,V.jsx)(`span`,{children:`Unloaded `}),(0,V.jsx)(hB,{date:e.last_unload_time})]}):e.closeout_completed&&(C=(0,V.jsxs)(PW,{fsize:r,children:[(0,V.jsxs)(`span`,{children:[e.closeout_failed?`Failed `:``,`Closed Out `]}),(0,V.jsx)(hB,{date:e.closeout_completed})]})),(0,V.jsxs)(um,{ref:b,elevation:4,sx:{position:`relative`,display:`flex`,minWidth:`10em`,padding:`8px`,margin:a?void 0:`8px`,opacity:o?.2:1,animation:s?AW:void 0,"&:hover":{animationPlayState:`paused`}},onAnimationIteration:MW,...c,children:[t>1&&(0,V.jsx)(pv,{badgeContent:t,color:`secondary`,sx:{position:`absolute`,top:0,right:0,zIndex:1}}),l?(0,V.jsx)(`div`,{ref:u,role:`button`,tabIndex:0,style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,cursor:a?`grabbing`:`grab`,touchAction:`none`},...d,children:(0,V.jsx)(rre,{fontSize:`large`,color:`action`})}):void 0,(0,V.jsx)($m,{focusRipple:!0,sx:{width:`100%`},onClick:()=>x(n?{type:`InProcMat`,inproc:n}:{type:`MatSummary`,summary:e}),children:(0,V.jsxs)(J,{sx:{display:`flex`,textAlign:`left`,alignItems:`center`,width:`100%`},children:[(0,V.jsx)(DW,{part:e.partName}),(0,V.jsxs)(J,{sx:{marginLeft:`8px`,flexGrow:1,minWidth:0},children:[(0,V.jsx)(NW,{fsize:r,children:e.partName}),f?(0,V.jsx)(PW,{fsize:r,children:e.jobUnique&&e.jobUnique!==``?`Assigned to `+e.jobUnique:`Unassigned material`}):void 0,!p||e.serial?(0,V.jsxs)(PW,{fsize:r,children:[`Serial: `,e.serial?e.serial:`none`]}):void 0,e.workorderId===void 0||e.workorderId===``||e.workorderId===e.serial?void 0:(0,V.jsxs)(PW,{fsize:r,children:[`Workorder: `,e.workorderId]}),e.jobUnique!==void 0&&m&&n&&n.process===0?(0,V.jsx)(RW,{fsize:r,mat:n}):void 0,h&&e.jobUnique&&e.jobUnique!==``?(0,V.jsx)(zW,{fsize:r,uniq:e.jobUnique}):void 0,n?(0,V.jsx)(FW,{mat:n,displayActionForSinglePallet:g,displayActionForSingleBasket:_,fsize:r}):void 0,n?.problem?(0,V.jsx)(PW,{fsize:r,children:(0,V.jsxs)(q,{variant:`body2`,color:`error`,sx:{fontWeight:`bold`},children:[`⚠ `,n.problem]})}):void 0,C]}),(0,V.jsxs)(J,{sx:{marginLeft:`4px`,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,alignItems:`flex-end`,alignSelf:`start`,flexShrink:0},children:[e.serial&&e.serial.length>=1&&!v?(0,V.jsx)(`div`,{children:(0,V.jsx)(X_,{style:{width:`30px`,height:`30px`},children:e.serial.slice(-1)})}):void 0,y?void 0:(0,V.jsx)(`div`,{children:(0,V.jsx)(LW,{mat:e,inProcMat:n})})]})]})})]})},HW=(0,F.memo)(VW),UW=(0,F.memo)(function(e){return(0,V.jsx)(VW,{mat:PR(e.mat),materialCount:e.materialCount,inProcMat:e.mat,displayActionForSinglePallet:e.displayActionForSinglePallet,displayActionForSingleBasket:e.displayActionForSingleBasket,fsize:e.fsize,hideAvatar:e.hideAvatar,displayJob:e.displayJob,showDragHandle:e.showHandle,hideEmptySerial:e.hideEmptySerial,showRawMaterial:e.showRawMaterial,showJobComment:e.showJobComment,shake:e.shake})}),WW=(0,F.memo)(function(e){let t=pL(I(QO),[e.mat]).length>0,n=!t&&(wW(e.mat)||CW(e.mat)),r={mat:e.mat},{active:i,isDragging:a,attributes:o,listeners:s,setNodeRef:c,setActivatorNodeRef:l,transform:u,transition:d}=JU({id:e.mat.materialID,data:r,disabled:{draggable:!n}}),f={...s};for(let[e,t]of Object.entries(o))e.startsWith(`aria`)&&(f[e]=t);let p={transform:u?`translate3d(${Math.round(u.x)}px, ${Math.round(u.y)}px, 0)`:void 0,transition:i===null?void 0:d};return(0,V.jsx)(VW,{ref:c,dragRootProps:{style:p},showDragHandle:n,dragHandleProps:f,setDragHandleRef:l,isActiveDrag:a,mat:PR(e.mat),materialCount:e.materialCount,inProcMat:e.mat,displayActionForSinglePallet:e.displayActionForSinglePallet,displayActionForSingleBasket:e.displayActionForSingleBasket,hideAvatar:e.hideAvatar,displayJob:e.displayJob,hideEmptySerial:e.hideEmptySerial,fsize:e.fsize,shake:i||t?void 0:e.shake,showRawMaterial:e.showRawMaterial,showJobComment:e.showJobComment})});function GW(e){return(0,V.jsx)(VW,{mat:PR(e.mat),materialCount:e.materialCount,inProcMat:e.mat,displayActionForSinglePallet:e.displayActionForSinglePallet,displayActionForSingleBasket:e.displayActionForSingleBasket,showDragHandle:!0,hideAvatar:e.hideAvatar,displayJob:e.displayJob,fsize:e.fsize,hideEmptySerial:e.hideEmptySerial,isDragOverlay:!0})}var KW=(0,F.memo)(function(e){return(0,V.jsx)(um,{elevation:4,sx:{display:`flex`,minWidth:`10em`,padding:`8px`,margin:`8px`},children:(0,V.jsx)(pv,{badgeContent:e.material.length<2?0:e.material.length,color:`secondary`,children:(0,V.jsx)($m,{focusRipple:!0,onClick:()=>e.onOpen(),children:(0,V.jsxs)(J,{sx:{display:`flex`,textAlign:`left`},children:[(0,V.jsx)(DW,{part:e.partOrCasting}),(0,V.jsxs)(J,{sx:{marginLeft:`8px`,flexGrow:1},children:[(0,V.jsx)(q,{variant:`h6`,children:e.partOrCasting}),(0,V.jsx)(PW,{fsize:e.fsize,children:e.assignedJobUnique&&e.assignedJobUnique!==``?`Assigned to `+e.assignedJobUnique:`Unassigned material`})]}),e.material.length>0&&e.material[0].serial&&e.material[0].serial.length>=1?(0,V.jsx)(`div`,{children:(0,V.jsx)(X_,{style:{width:`30px`,height:`30px`},children:e.material[0].serial.slice(-1)})}):void 0]})})})})}),qW=(0,F.memo)(function({partName:e,serial:t,subtitle:n,notes:r}){let i;return i=e===``?t??`Material`:t==null||t===``?r?`Add note for `+e:e:r?`Add note for `+t:e+` - `+t,(0,V.jsxs)(J,{sx:{display:`flex`,textAlign:`left`},children:[e===``?(0,V.jsx)(mE,{}):(0,V.jsx)(DW,{part:e}),(0,V.jsxs)(J,{sx:{marginLeft:`8px`,flexGrow:1},children:[(0,V.jsx)(q,{variant:`h6`,children:i}),n?(0,V.jsx)(q,{variant:`caption`,children:n}):void 0]})]})});function JW({notes:e}){let t=I(SL),n=I(OL),r=I(Wie),i=``,a=null;switch(t?.type){case`InProcMat`:i=t.inproc.partName,a=t.inproc.serial;break;case`MatSummary`:i=t.summary.partName,a=t.summary.serial;break;case`MatDetails`:i=t.details.partName,a=t.details.serial;break;case`LogMat`:i=t.logMat.part,a=t.logMat.serial;break;case`Barcode`:a=t.barcode;break;case`ManuallyEnteredSerial`:case`AddMatWithEnteredSerial`:a=t.serial}return n.state===`hasData`&&n.data!==null&&(i=n.data.partName,a=n.data.serial??a),r.state===`hasData`&&r.data&&(a=r.data),(0,V.jsx)(qW,{notes:e,partName:i,serial:a})}function YW(){let e=I(RL);function t(t){return e.completedInspections.includes(t)?`black`:`red`}return e.signaledInspections.length===0?(0,V.jsx)(`small`,{children:`Inspections: none`}):(0,V.jsxs)(`small`,{children:[`Inspections:`,` `,e.signaledInspections.map((e,n)=>(0,V.jsxs)(`span`,{children:[n===0?``:`, `,(0,V.jsx)(`span`,{style:{color:t(e)},children:e})]},n))]})}function XW({highlightProcsGreaterOrEqualTo:e}){let t=I(IL);return(0,V.jsx)(bL,{entries:t,copyToClipboard:!0,highlightProcsGreaterOrEqualTo:e})}function ZW(){let e=I(AL),t=I(QO).jobs,n=I(az),r=e?t[e.jobUnique]:null;if(r&&r.bookings&&r.bookings.length>0){let e=n.get(r.bookings[0]);if(e&&e.notes&&e.notes!==``)return(0,V.jsx)(q,{variant:`caption`,sx:{width:`100%`,textWrap:`wrap`},children:e.notes})}return null}function QW({material:e}){let t=I(FL),n=EW(e).process,r=t.reduce((t,r)=>r.type===z.SignalQuarantine&&r.material.some(t=>t.id===e.materialID&&t.proc===n)&&(t===null||r.counter>t.counter)?r:t,null)?.details?.note?.trim();return r?`: ${r}`:null}function $W(){let e=I(AL),t=zL(),n=e?_W(e):null;return(0,V.jsx)(V.Fragment,{children:e?.quarantineAfterUnload?(0,V.jsxs)(q,{variant:`caption`,component:`p`,children:[`Quarantine requested`,(0,V.jsx)(iW,{fallback:null,resetKeys:[e.materialID,EW(e).process],children:(0,V.jsx)(QW,{material:e})})]}):t.length===0&&n?.kind===`ActiveLoadStationOperation`&&n.cancellationId===null?(0,V.jsx)(q,{variant:`caption`,component:`p`,children:`This material is part of the current load/unload operation. Complete the operation or cancel it at the machine control before making other changes.`}):null})}var eG=(0,F.memo)(function({highlightProcsGreaterOrEqualTo:e}){let t=I(SL),n=I(TL),r=I(wL);return t===null?null:n===null?t.type===`AddMatWithEnteredSerial`||t.type===`ManuallyEnteredSerial`?(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[`Material with serial `,t.serial,` not found.`]}):t.type===`Barcode`?r?(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[`Material with barcode `,t.barcode,` does not yet exist in the cell.`]}):(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[`Material with barcode `,t.barcode,` not found.`]}):(0,V.jsx)(`div`,{style:{marginLeft:`1em`},children:`Material not found.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{style:{marginLeft:`1em`},children:[(0,V.jsx)($W,{}),(0,V.jsx)(`div`,{children:(0,V.jsxs)(`small`,{children:[`Workorder: `,n?.workorderId??`none`]})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(mW,{fallback:(0,V.jsxs)(`small`,{children:[`Inspections: `,(0,V.jsx)(Sh,{size:`10`})]}),children:(0,V.jsx)(YW,{})})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(mW,{fallback:(0,V.jsx)(`div`,{}),children:(0,V.jsx)(ZW,{})})})]}),(0,V.jsx)(mW,{fallback:(0,V.jsx)(Sh,{}),children:(0,V.jsx)(XW,{highlightProcsGreaterOrEqualTo:e})})]})});function tG(e){let[t,n]=(0,F.useState)(``),r=I(XO),[i]=Jie(),a=I(TL);return a===null?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Cy,{children:(0,V.jsx)(BT,{sx:{mt:`5px`},multiline:!0,label:`Note`,autoFocus:!0,variant:`outlined`,value:t,onChange:e=>n(e.target.value)})}),(0,V.jsxs)(_y,{children:[(0,V.jsx)(Y,{onClick:()=>{i({matId:a.materialID,process:0,operator:r,notes:t}),e.setNotesOpen(!1),n(``)},disabled:t===``,color:`secondary`,children:`Save`}),(0,V.jsx)(Y,{onClick:()=>{e.setNotesOpen(!1),n(``)},color:`secondary`,children:`Cancel`})]})]})}function nG(){let e=I(SL);if(e===null)return null;let t;switch(e.type){case`Barcode`:t=`Loading material with barcode `+e.barcode+`...`;break;case`AddMatWithEnteredSerial`:case`ManuallyEnteredSerial`:t=`Loading material with serial `+e.serial+`...`;break;default:t=`Loading material...`}return(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`},children:[(0,V.jsx)(Sh,{}),(0,V.jsx)(`div`,{style:{marginTop:`1em`},children:t})]})}function rG({setNotesOpen:e}){let t=I(TL);return t===null||t.materialID<0?null:(0,V.jsx)(Y,{onClick:()=>e(!0),color:`primary`,children:`Add Note`})}var iG=(0,F.memo)(function(e){let[t,n]=(0,F.useState)(!1),[r,i]=R(SL);function a(){i(null),e.onClose&&e.onClose()}let o,s;return r&&(o=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ey,{children:(0,V.jsx)(JW,{})}),(0,V.jsx)(Cy,{children:(0,V.jsxs)(mW,{fallback:(0,V.jsx)(nG,{}),children:[(0,V.jsx)(eG,{highlightProcsGreaterOrEqualTo:e.highlightProcsGreaterOrEqualTo}),(0,V.jsx)(mW,{fallback:(0,V.jsx)(Sh,{}),children:e.extraDialogElements})]})}),(0,V.jsxs)(_y,{children:[r&&(e.buttons||e.allowNote)?(0,V.jsx)(iW,{fallback:(0,V.jsx)(`div`,{}),children:(0,V.jsxs)(F.Suspense,{fallback:(0,V.jsx)(`div`,{}),children:[r&&e.allowNote?(0,V.jsx)(rG,{setNotesOpen:n}):void 0,e.buttons]})}):null,(0,V.jsx)(Y,{onClick:a,color:`secondary`,children:`Close`})]})]}),e.allowNote&&(s=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ey,{children:(0,V.jsx)(JW,{notes:!0})}),(0,V.jsxs)(mW,{fallback:(0,V.jsx)(Cy,{children:(0,V.jsx)(Sh,{})}),children:[(0,V.jsx)(tG,{setNotesOpen:n}),`;`]})]}))),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(py,{open:r!==null,onClose:a,maxWidth:`lg`,children:o}),e.allowNote?(0,V.jsx)(py,{open:t,onClose:()=>n(!1),maxWidth:`md`,children:s}):void 0]})}),aG=KO(`MachineCostPerYear`,{}),oG=KO(`AutomationCostPerYear`,null),sG=KO(`Last30LaborCost`,null),cG=IO(e=>KO(`PerMonthLabor-`+e.getFullYear().toString()+`-`+e.getMonth().toString(),null)),lG=d(e=>e(e(gz).type===`Last30`?RO:HO).valuesToLazySeq().filter(e=>e.procsAndPaths.length===1&&e.procsAndPaths[0].paths.length===1&&e.procsAndPaths[0].paths[0].stops.length===1&&lk(e.procsAndPaths[0].paths[0].stops[0].expectedCycleTime)===0).toHashSet(e=>e.partName)),uG=d(e=>{let t=e(gz),n=e(t.type===`Last30`?Vk:Wk),r=e(t.type===`Last30`?jR:NR),i=e(lG),a=TE(WE(),-30),o=t.type===`Last30`?null:t.month;return Ez(n.valuesToLazySeq(),i,r.matsById,o?{month:o}:{thirtyDaysAgo:a})}),dG=d(e=>{let t=e(gz),n=e(aG),r=e(oG),i=e(t.type===`Last30`?sG:cG(t.month));return Dz(e(uG),n,r,i??0)});function fG(){let[e,t]=(0,F.useState)(null),[n,r]=R(oG);return(0,V.jsx)(BT,{id:`auotmation-cost-year`,type:`number`,label:`Cost for automated handling system per year`,style:{marginTop:`1.5em`},variant:`outlined`,value:e===null?n??``:isNaN(e)?``:e,onChange:e=>t(parseFloat(e.target.value)),onBlur:()=>{e!=null&&r(isNaN(e)?null:e),t(null)},slotProps:{htmlInput:{min:0}}})}function pG(){let e=I(gz),t=e.type===`Last30`?null:e.month,[n,r]=(0,F.useState)(null),[i,a]=R(t===null?sG:cG(t));return(0,V.jsx)(BT,{type:`number`,label:`Total labor cost for `+(t===null?`last 30 days`:t.toLocaleDateString(void 0,{month:`long`,year:`numeric`})),variant:`outlined`,value:n===null?i??``:isNaN(n)?``:n,onChange:e=>r(parseFloat(e.target.value)),onBlur:()=>{n!=null&&a(isNaN(n)?null:n),r(null)},slotProps:{htmlInput:{min:0}}})}function mG(e){let[t,n]=(0,F.useState)(null),[r,i]=R(aG);return(0,V.jsx)(BT,{type:`number`,variant:`outlined`,label:`Cost for `+e.machineGroup+` per station per year`,style:{marginTop:`1.5em`},value:t===null?r[e.machineGroup]??``:isNaN(t)?``:t,onChange:e=>n(parseFloat(e.target.value)),onBlur:()=>{if(t!=null){let n={...r};isNaN(t)?delete n[e.machineGroup]:n[e.machineGroup]=t,i(n)}n(null)},slotProps:{htmlInput:{min:0}}})}function hG(){let e=I(dG);return(0,V.jsx)(V.Fragment,{children:e.machineQuantities.keysToAscLazySeq().map((t,n)=>(0,V.jsx)(mG,{machineQuantities:e.machineQuantities,machineGroup:t},n))})}var gG=Intl.NumberFormat(void 0,{minimumFractionDigits:1,maximumFractionDigits:1}),_G=new Intl.NumberFormat(void 0,{style:`percent`,minimumFractionDigits:1,maximumFractionDigits:1});function vG(){QL(`Cost Percentages`);let e=I(uG);return(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsxs)(J,{component:`nav`,sx:{display:`flex`,minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsx)(q,{variant:`subtitle1`,children:`Part Cost Percentage Breakdown`}),(0,V.jsx)(J,{sx:{flexGrow:1}}),(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{style:{height:`25px`,paddingTop:0,paddingBottom:0},onClick:()=>jz(e),size:`large`,children:(0,V.jsx)(iE,{})})})]}),(0,V.jsx)(`main`,{children:(0,V.jsxs)(Nw,{stickyHeader:!0,children:[(0,V.jsx)(nT,{children:(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:`Part`}),(0,V.jsx)(Z,{align:`right`,children:`Completed Quantity`}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsxs)(Z,{align:`right`,children:[e,` Cost %`]},e)),(0,V.jsx)(Z,{align:`right`,children:`Labor Cost %`}),(0,V.jsx)(Z,{align:`right`,children:`Automation Cost %`})]})}),(0,V.jsx)(Bw,{children:Q.of(e.parts).sortBy(e=>e.part).map((t,n)=>(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(J,{sx:{mr:`0.2em`},children:(0,V.jsx)(DW,{part:t.part,size:25})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(q,{variant:`body2`,component:`span`,sx:{display:`block`},children:t.part})})]})}),(0,V.jsx)(Z,{align:`right`,children:t.parts_completed}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsx)(Z,{align:`right`,children:_G.format(t.machine.get(e)??0)},e)),(0,V.jsx)(Z,{align:`right`,children:_G.format(t.labor)}),(0,V.jsx)(Z,{align:`right`,children:_G.format(t.automation)})]},n))})]})})]})}function yG(){let e=I(dG);return(0,V.jsxs)(Nw,{stickyHeader:!0,children:[(0,V.jsx)(nT,{children:(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:`Part`}),(0,V.jsx)(Z,{align:`right`,children:`Completed Quantity`}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsxs)(Z,{align:`right`,children:[e,` Cost`]},e)),(0,V.jsx)(Z,{align:`right`,children:`Labor Cost`}),(0,V.jsx)(Z,{align:`right`,children:`Automation Cost`}),(0,V.jsxs)(Z,{align:`right`,children:[(0,V.jsx)(`span`,{children:`Total`}),(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{style:{height:`25px`,paddingTop:0,paddingBottom:0},onClick:()=>kz(e),size:`large`,children:(0,V.jsx)(iE,{})})})]})]})}),(0,V.jsx)(Bw,{children:Q.of(e.parts).sortBy(e=>e.part).map((t,n)=>(0,V.jsxs)(mT,{children:[(0,V.jsx)(Z,{children:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(J,{sx:{mr:`0.2em`},children:(0,V.jsx)(DW,{part:t.part,size:25})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(q,{variant:`body2`,component:`span`,sx:{display:`block`},children:t.part})})]})}),(0,V.jsx)(Z,{align:`right`,children:t.parts_completed}),e.machineQuantities.keysToAscLazySeq().map(e=>(0,V.jsx)(Z,{align:`right`,children:gG.format(t.machine.get(e)??0)},e)),(0,V.jsx)(Z,{align:`right`,children:gG.format(t.labor)}),(0,V.jsx)(Z,{align:`right`,children:gG.format(t.automation)}),(0,V.jsx)(Z,{align:`right`,children:gG.format(t.machine.valuesToAscLazySeq().sumBy(e=>e)+t.labor+t.automation)})]},n))})]})}var bG=(0,F.memo)(function(){return QL(`Cost Per Piece`),(0,V.jsx)(J,{component:`main`,sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`20px`},children:(0,V.jsxs)(FC,{direction:`column`,spacing:4,children:[(0,V.jsxs)(FC,{direction:`column`,spacing:2,children:[(0,V.jsx)(pG,{}),(0,V.jsx)(fG,{}),(0,V.jsx)(hG,{})]}),(0,V.jsx)(yG,{})]})})}),xG=d(!1),SG=xG,CG=d(null),wG=d(EO.empty()),TG=d(null),EG=d(null),DG=d(e=>e(pR)??e(TG)??e(EG));async function OG(e,t,n,r){for(;mR(e,n);){let i=e(QO),a=e(dR).snapshot,o;try{r?.throwIfAborted(),o=await Xt.currentStatus(r),r?.throwIfAborted()}catch(t){let i=e(dR);if(i.id!==n)return!1;if(!r?.aborted&&i.snapshot!==a&&i.snapshot?.source===`socket`)return!0;throw t}let s=e(dR);if(s.id!==n)return!1;let c=s.snapshot?.status;if(c&&o.revision<=c.revision)return!0;if(e(QO)===i||e(QO)===c)return t(gR,n,o,`http`),!0}return!1}var kG=d(null,(e,t,n)=>OG(e,t,e(dR).id,n));async function AG(e,t,n,r=1e3){try{await OG(e,t,n,AbortSignal.timeout(1e4))}catch(i){if(!mR(e,n)||e(fR))return;t(pR,uW(i,`Error loading current status`)),setTimeout(()=>{mR(e,n)&&!e(fR)&&AG(e,t,n,Math.min(r*2,3e4))},r)}}function jG(e,t,n,r,i=1e3){let a=new Date,o=AbortSignal.timeout(12e4);return(r===null?Zt.get(TE(a,-30),a,o):Zt.recent(r,void 0,o)).then(r=>{if(!mR(e,n))return;let i=e(CG)??jO.empty(),a=r.reduce((e,t)=>e.set(t.counter,t),i);t(ioe,a.valuesToAscLazySeq().toRArray()),t(wG,EO.from(a.keys())),t(CG,null),t(EG,null)},a=>{mR(e,n)&&(t(EG,o.aborted?`Loading log history timed out.`:uW(a,`Error loading log history`)),setTimeout(()=>{mR(e,n)&&jG(e,t,n,r,Math.min(i*2,3e4))},i))})}function MG(e,t,n){let r=e(noe),i=e(BO);NG([AG(e,t,n),Xt.recent(TE(new Date,-30),r!==null&&i?Array.from(i):[]).then(r=>{mR(e,n)&&t(roe,r)}),jG(e,t,n,r)],e,t,n)}function NG(e,t,n,r){Promise.all(e).catch(e=>{mR(t,r)&&n(TG,uW(e,`Error`))}).finally(()=>{mR(t,r)&&n(xG,!1)})}var PG=class{constructor(e){this.session=null,this.userCalledClose=!1,this.reconnectAttempts=0,this.url=e,this.connect()}close(){this.userCalledClose=!0,this.ws?.close(),this.endSession(!1)}endSession(e){let t=this.session;this.session=null,this.handleClose?.(t,e)}connect(){if(this.userCalledClose)return;this.ws=new WebSocket(this.url);let e=this.ws,t=setTimeout(()=>{e.close()},2e3);e.addEventListener(`open`,()=>{clearTimeout(t),this.reconnectAttempts=0,this.session=this.handleOpen?.()??null}),e.addEventListener(`close`,()=>{if(clearTimeout(t),this.ws=void 0,this.userCalledClose)return;this.endSession(!0);let e=Math.min(1e3*1.5**this.reconnectAttempts,3e4);setTimeout(()=>{this.reconnectAttempts++,this.connect()},e)}),e.addEventListener(`message`,e=>{this.handleMessage?.(e,this.session)})}},FG=d(null,(e,t)=>{let n=e(dR).id+1;return t(dR,{id:n,open:!0,snapshot:null}),t(xG,!0),t(fR,!1),t(TG,null),t(EG,null),t(pR,null),t(CG,jO.empty()),MG(e,t,n),n}),IG=d(null,(e,t,n,r)=>{r&&t(xG,!0),n!==null&&mR(e,n)&&(t(dR,{id:n+1,open:!1,snapshot:null}),t(fR,!1),t(CG,null))}),LG=d(null,(e,t,n,r)=>{if(r===null||!mR(e,r))return;let i=Ne.fromJS(JSON.parse(n.data)),a=i.newCurrentStatus,o=a&&t(gR,r,a,`socket`),s=a&&!o?new Ne({logEntry:i.logEntry,newJobs:i.newJobs}):i,c={evt:s,now:new Date,expire:!0};s.newCurrentStatus||t(dz,c);let l=s.logEntry,u=e(CG);l&&e(wG).has(l.counter)||(l&&u!==null?t(CG,u.set(l.counter,l)):t(fz,c))});function RG(){let e=L(FG),t=L(IG),n=L(LG),r=I(Dr),i=(0,F.useRef)(null);return(0,F.useEffect)(()=>{if(i.current)return;let a=r.user??null,o=window.location,s;if(o.protocol===`backup:`)return;s=o.protocol===`https:`?`wss:`:`ws:`,s+=`//`+o.host+`/api/v1/events`,a&&(s+=`?token=`+encodeURIComponent(a.access_token));let c=new PG(s);return c.handleOpen=e,c.handleClose=t,c.handleMessage=n,i.current=c,()=>{i.current&&=(i.current.close(),null)}},[r,n,e,t]),null}var zG=[{type:`Subheader`,caption:`Shop Floor`},{type:`Link`,route:{route:$.Station_LoadMonitor,loadNum:1,queues:[],completed:!1},icon:(0,V.jsx)(tre,{}),label:`Load Station`},{type:`Link`,route:{route:$.Station_Queues,queues:[]},icon:(0,V.jsx)(eE,{}),label:`Queue Management`},{type:`Link`,route:{route:$.Station_InspectionMonitor},icon:(0,V.jsx)(lre,{}),label:`Inspection Stand`},{type:`Link`,route:{route:$.Station_Closeout},icon:(0,V.jsx)(dE,{}),label:`Close Out`},{type:`Link`,route:{route:$.Tools_Dashboard},icon:(0,V.jsx)(GT,{}),label:`Tool Management`},{type:`Link`,route:{route:$.Station_Overview},icon:(0,V.jsx)(Jne,{}),label:`System Overview`},{type:`Subheader`,caption:`Daily Monitoring`},{type:`Link`,route:{route:$.Operations_Dashboard},icon:(0,V.jsx)(hE,{}),label:`Operation Management`},{type:`Link`,route:{route:$.Engineering_Cycles},icon:(0,V.jsx)(fre,{}),label:`Engineering`},{type:`Link`,route:{route:$.Quality_Dashboard},icon:(0,V.jsx)(vre,{}),label:`Quality Analysis`},{type:`Link`,route:{route:$.Sales_Dashboard},icon:(0,V.jsx)(mre,{}),label:`Sales`},{type:`Subheader`,caption:`Monthly Review`},{type:`Link`,route:{route:$.Analysis_Buffers},icon:(0,V.jsx)(ure,{}),label:`Flexibility Analysis`}];function BG(e){let t=I(QO),n=I(DG),r=I(bz),i=Q.of([...t.alarms,n,r]).filter(e=>e!==null&&e.length>0).distinct().toRArray(),a=(0,V.jsx)(um,{children:(0,V.jsx)(Ub,{component:`nav`,dense:!0,children:(e.modes??zG).map((t,n)=>t.type===`Subheader`?(0,V.jsx)(R_,{children:t.caption},n):(0,V.jsx)(Kb,{children:(0,V.jsxs)(Wb,{onClick:()=>e.setRoute(t.route),children:[(0,V.jsx)(Jb,{children:t.icon}),(0,V.jsx)(Xb,{children:t.label})]})},n))})});return(0,V.jsx)(`main`,{style:{display:`flex`,justifyContent:`center`},children:(0,V.jsxs)(`div`,{style:{maxWidth:`50em`,padding:`0 1em`},children:[(0,V.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,V.jsx)(q,{variant:`h4`,style:{marginTop:`2em`},children:`Select user and computer location`}),(0,V.jsxs)(q,{variant:`caption`,style:{marginBottom:`2em`,maxWidth:`30em`,marginLeft:`auto`,marginRight:`auto`},children:[`We recommend that after selecting one of the following modes, you bookmark the page and visit it directly.`,(0,V.jsx)(`a`,{href:`https://fms-insight.seedtactics.com/docs/client-dashboard.html`,children:`Learn More`})]})]}),i.length>0?(0,V.jsxs)(Bh,{severity:`error`,sx:{margin:`1em 0`},children:[(0,V.jsx)(Yh,{children:`FMS Insight errors`}),i.map(e=>(0,V.jsx)(`p`,{children:e},e))]}):void 0,a]})})}var VG=[[`All`,`*`,`*`,` `,0,`All`],[`AllReadable`,`*`,`r`,` `,0,`All Readable`],[`AllCreatable`,`*`,`w`,` `,0,`All Creatable`],[`AllLinear`,`*`,`l`,` `,0,`All Linear`],[`AllMatrix`,`*`,`m`,` `,0,`All Matrix`],[`AllGS1`,`*`,`G`,` `,0,`All GS1`],[`AllRetail`,`*`,`R`,` `,0,`All Retail`],[`AllIndustrial`,`*`,`I`,` `,0,`All Industrial`],[`Codabar`,`F`,` `,`lrw `,18,`Codabar`],[`Code39`,`A`,` `,`lrw I`,8,`Code 39`],[`Code39Std`,`A`,`s`,`lrw I`,8,`Code 39 Standard`],[`Code39Ext`,`A`,`e`,`lr I`,9,`Code 39 Extended`],[`Code32`,`A`,`2`,`lr I`,129,`Code 32`],[`PZN`,`A`,`p`,`lr I`,52,`Pharmazentralnummer`],[`Code93`,`G`,` `,`lrw I`,25,`Code 93`],[`Code128`,`C`,` `,`lrwGI`,20,`Code 128`],[`ITF`,`I`,` `,`lrw I`,3,`ITF`],[`ITF14`,`I`,`4`,`lr I`,89,`ITF-14`],[`DataBar`,`e`,` `,`lr GR`,29,`DataBar`],[`DataBarOmni`,`e`,`o`,`lr GR`,29,`DataBar Omni`],[`DataBarStk`,`e`,`s`,`lr GR`,79,`DataBar Stacked`],[`DataBarStkOmni`,`e`,`O`,`lr GR`,80,`DataBar Stacked Omni`],[`DataBarLtd`,`e`,`l`,`lr GR`,30,`DataBar Limited`],[`DataBarExp`,`e`,`e`,`lr GR`,31,`DataBar Expanded`],[`DataBarExpStk`,`e`,`E`,`lr GR`,81,`DataBar Expanded Stacked`],[`EANUPC`,`E`,` `,`lr R`,15,`EAN/UPC`],[`EAN13`,`E`,`1`,`lrw R`,15,`EAN-13`],[`EAN8`,`E`,`8`,`lrw R`,10,`EAN-8`],[`EAN5`,`E`,`5`,`l R`,12,`EAN-5`],[`EAN2`,`E`,`2`,`l R`,11,`EAN-2`],[`ISBN`,`E`,`i`,`lr R`,69,`ISBN`],[`UPCA`,`E`,`a`,`lrw R`,34,`UPC-A`],[`UPCE`,`E`,`e`,`lrw R`,37,`UPC-E`],[`Telepen`,`B`,` `,`lr I`,32,`Telepen`],[`TelepenAlpha`,`B`,`0`,`lr I`,32,`Telepen Alpha`],[`TelepenNumeric`,`B`,`1`,`lr I`,87,`Telepen Numeric`],[`OtherBarcode`,`X`,` `,` r `,0,`Other barcode`],[`DXFilmEdge`,`X`,`x`,`lr `,147,`DX Film Edge`],[`PDF417`,`L`,` `,`mrw `,55,`PDF417`],[`CompactPDF417`,`L`,`c`,`mr `,56,`Compact PDF417`],[`MicroPDF417`,`L`,`m`,`mr `,84,`MicroPDF417`],[`Aztec`,`z`,` `,`mr G `,92,`Aztec`],[`AztecCode`,`z`,`c`,`mrwG `,92,`Aztec Code`],[`AztecRune`,`z`,`r`,`mr `,128,`Aztec Rune`],[`QRCode`,`Q`,` `,`mrwG `,58,`QR Code`],[`QRCodeModel1`,`Q`,`1`,`mr `,0,`QR Code Model 1`],[`QRCodeModel2`,`Q`,`2`,`mr `,58,`QR Code Model 2`],[`MicroQRCode`,`Q`,`m`,`mr `,97,`Micro QR Code`],[`RMQRCode`,`Q`,`r`,`mr G `,145,`rMQR Code`],[`DataMatrix`,`d`,` `,`mrwG `,71,`Data Matrix`],[`MaxiCode`,`U`,` `,`mr `,57,`MaxiCode`]],HG={DataBarExpanded:`DataBarExp`,DataBarLimited:`DataBarLtd`,"Linear-Codes":`AllLinear`,"Matrix-Codes":`AllMatrix`,Any:`All`,rMQRCode:`RMQRCode`};VG.map(e=>e[5]),VG.filter(e=>e[1]===`*`).map(e=>e[0]),VG.filter(e=>e[1]!==`*`).map(e=>e[0]),VG.filter(e=>e[2]===` `).map(e=>e[0]),VG.filter(e=>e[3][0]===`l`).map(e=>e[0]),VG.filter(e=>e[3][0]===`m`).map(e=>e[0]),VG.filter(e=>e[3][1]===`r`).map(e=>e[0]),VG.filter(e=>e[3][2]===`w`||e[4]!==0).map(e=>e[0]),VG.filter(e=>e[3][3]===`G`).map(e=>e[0]),VG.filter(e=>e[3][4]===`R`).map(e=>e[0]),VG.filter(e=>e[3][4]===`I`).map(e=>e[0]);function UG(e){return HG[e]??e}function WG(e){return e.map(UG).join(`,`)}var GG=[`LocalAverage`,`GlobalHistogram`,`FixedThreshold`,`BoolCast`];function KG(e){return GG.indexOf(e)}var qG=`Unknown.ASCII.ISO8859_1.ISO8859_2.ISO8859_3.ISO8859_4.ISO8859_5.ISO8859_6.ISO8859_7.ISO8859_8.ISO8859_9.ISO8859_10.ISO8859_11.ISO8859_13.ISO8859_14.ISO8859_15.ISO8859_16.Cp437.Cp1250.Cp1251.Cp1252.Cp1256.Shift_JIS.Big5.GB2312.GB18030.EUC_JP.EUC_KR.UTF16BE.UTF8.UTF16LE.UTF32BE.UTF32LE.BINARY`.split(`.`);function JG(e){return e===`UnicodeBig`?qG.indexOf(`UTF16BE`):qG.indexOf(e)}var YG=[`Text`,`Binary`,`Mixed`,`GS1`,`ISO15434`,`UnknownECI`];function XG(e){return YG[e]}var ZG=[`Ignore`,`Read`,`Require`];function QG(e){return ZG.indexOf(e)}var $G=[`Plain`,`ECI`,`HRI`,`Escaped`,`Hex`,`HexECI`];function eK(e){return $G.indexOf(e)}var tK={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:`LocalAverage`,isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,validateOptionalChecksum:!1,returnErrors:!1,eanAddOnSymbol:`Ignore`,textMode:`HRI`,characterSet:`Unknown`,tryCode39ExtendedMode:!0};function nK(e){var t;return{...e,formats:WG(e.formats),binarizer:KG(e.binarizer),eanAddOnSymbol:QG(e.eanAddOnSymbol),textMode:eK(e.textMode),characterSet:JG(e.characterSet),tryCode39ExtendedMode:(t=e.tryCode39ExtendedMode)==null||t}}function rK(e){return{...e,orientation:e.rotation,format:e.format,symbology:e.symbology,contentType:XG(e.contentType)}}var iK={format:`QRCode`,readerInit:!1,forceSquareDataMatrix:!1,ecLevel:``,scale:1,sizeHint:0,rotate:0,invert:!1,withHRT:!1,withQuietZones:!0,addHRT:!1,addQuietZones:!0,options:``};function aK(e,t){let n=e.byteLength>>2;for(let r=0;r<n;r+=1024){let i=Math.min(r+1024,n);for(let n=r;n<i;n++){let r=n<<2;t[n]=306*e[r]+601*e[r+1]+117*e[r+2]+512>>10}}}var oK={locateFile:(e,t)=>{let n=e.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@3.1.6/dist/${n[1]}/${e}`:t+e}},sK=new WeakMap;function cK(e,t){return Object.is(e,t)||Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>Object.prototype.hasOwnProperty.call(t,n)&&e[n]===t[n])}function lK(e){let{overrides:t,equalityFn:n=cK,fireImmediately:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[i,a]=sK.get(e)??[oK],o=t??i,s;if(r){if(a&&(s=n(i,o)))return a;let t=e({...o});return sK.set(e,[o,t]),t}(s??n(i,o))||sK.set(e,[o])}async function uK(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tK,r={...tK,...n},i=await lK(e,{fireImmediately:!0}),a,o=nK(r);if(`width`in t&&`height`in t&&`data`in t){let{width:e,height:n}=t,r=t.data.buffer===i.HEAPU8.buffer?t.data.slice():t.data,s=r.byteLength/4,c=i._malloc(s);if(!c)throw Error(`Failed to allocate ${s} bytes in WASM memory`);try{aK(r,i.HEAPU8.subarray(c,c+s)),a=i.readBarcodesFromPixmap(c,e,n,o)}finally{i._free(c)}}else{let e;if(`buffer`in t)e=t;else if(`byteLength`in t)e=new Uint8Array(t);else if(`size`in t)e=new Uint8Array(await t.arrayBuffer());else throw TypeError(`Invalid input type`);let n=i._malloc(e.byteLength);if(!n)throw Error(`Failed to allocate ${e.byteLength} bytes in WASM memory`);try{i.HEAPU8.set(e,n),a=i.readBarcodesFromImage(n,e.byteLength,o)}finally{i._free(n)}}try{let e=[],t=a.size();for(let n=0;n<t;++n)e.push(rK(a.get(n)));return e}finally{a.delete()}}({...tK}),[...tK.formats],{...iK};function dK(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}async function fK(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t,n,r,i=e,a=!!globalThis.window,o=!!globalThis.WorkerGlobalScope;(n=globalThis.process)!=null&&(t=n.versions)!=null&&t.node&&((r=globalThis.process)==null||r.type);var s=(e,t)=>{throw t},c=void 0,l=``;function u(e){return i.locateFile?i.locateFile(e,l):l+e}var d,f;if(a||o||typeof fetch==`function`){try{l=new URL(`.`,c).href}catch{}o&&(f=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),d=async e=>{var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}console.log.bind(console);var p=console.error.bind(console),m,h=!1,g;class _{}class v extends _{constructor(e){super(),this.excPtr=e}}function y(){return mr.buffer}function b(){var e;if(!(te!=null&&(e=te.buffer)!=null&&e.resizable)){var t=y();te=new Int8Array(t),Yt=new Int16Array(t),i.HEAPU8=Ne=new Uint8Array(t),Xt=new Uint16Array(t),Zt=new Int32Array(t),de=new Uint32Array(t),Wt=new Float32Array(t),Gt=new Float64Array(t)}}function x(){var e=i.preRun;e&&(typeof e==`function`&&(e=[e]),ie.push(...e)),ne(ie)}function S(){Xr.ra()}function C(){var e=i.postRun;e&&(typeof e==`function`&&(e=[e]),re.push(...e)),ne(re)}function w(e){var t;throw(t=i.onAbort)==null||t.call(i,e),e=`Aborted(${e})`,p(e),h=!0,e+=`. Build with -sASSERTIONS for more info.`,new WebAssembly.RuntimeError(e)}var T;function E(){return u(`zxing_reader.wasm`)}function D(e){if(e==T&&m)return new Uint8Array(m);if(f)return f(e);throw`both async and sync fetching of the wasm failed`}async function O(e){if(!m)try{var t=await d(e);return new Uint8Array(t)}catch{}return D(e)}async function k(e,t){try{var n=await O(e);return await WebAssembly.instantiate(n,t)}catch(e){p(`failed to asynchronously prepare wasm: ${e}`),w(e)}}async function ee(e,t,n){if(!e)try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){p(`wasm streaming compile failed: ${e}`),p(`falling back to ArrayBuffer instantiation`)}return k(t,n)}function A(){return{a:_r}}async function j(){function e(e){return Xr=e.exports,gr(Xr),b(),Xr}function t(t){return e(t.instance)}var n=A(),r=i.instantiateWasm;return r?new Promise(t=>{r(n,n=>t(e(n)))}):(T??=E(),t(await ee(m,T,n)))}class M{constructor(e){dK(this,`name`,`ExitStatus`),this.message=`Program terminated with exit(${e})`,this.status=e}}var te,ne=e=>{for(;e.length>0;)e.shift()(i)},re=[],ie=[],ae=!0,N=e=>sr(e),oe=()=>lr(),se=[],ce=e=>{var t=se[e];return t||(se[e]=t=hr.get(e)),t},P=(e,t)=>ce(e)(t),le=[],ue=0,de;class fe{set_type(e){de[this.ptr+4>>2]=e}get_type(){return de[this.ptr+4>>2]}set_destructor(e){de[this.ptr+8>>2]=e}get_destructor(){return de[this.ptr+8>>2]}set_caught(e){e=+!!e,te[this.ptr+12]=e}get_caught(){return te[this.ptr+12]!=0}set_rethrown(e){e=+!!e,te[this.ptr+13]=e}get_rethrown(){return te[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){de[this.ptr+16>>2]=e}get_adjusted_ptr(){return de[this.ptr+16>>2]}constructor(e){this.excPtr=e,this.ptr=e-24}}var pe=e=>{var t=new fe(e);return t.get_caught()||(t.set_caught(!0),ue--),t.set_rethrown(!1),le.push(t),rr(e)},me=null,he=()=>{ar(0,0);var e=le.pop();dr(e.excPtr),me=null},F=e=>or(e),ge=e=>{var t=me?.excPtr;if(!t)return F(0),0;var n=new fe(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return F(0),t;for(var i of e){if(!i||i===r)break;var a=n.ptr+16;if(fr(i,r,a))return F(i),t}return F(r),t},_e=()=>ge([]),ve=e=>ge([e]),ye=(e,t)=>ge([e,t]),be=e=>{throw e},xe=()=>{le.length||w(`no exception to throw`);var e=le[le.length-1],t=e.excPtr;e.set_rethrown(!0),e.set_caught(!1),ue++,ur(t),t=me=new v(t),be(t)},Se=(e,t,n)=>{new fe(e).init(t,n),ur(e),e=me=new v(e),ue++,be(e)},Ce=e=>{throw e},we=e=>{e=me??=new v(e),Ce(e)},Te=()=>w(``),I={},Ee=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function L(e){return this.fromWireType(de[e>>2])}var R={},De={},Oe={};class ke extends Error{constructor(e){super(e),this.name=`InternalError`}}var Ae=e=>{throw new ke(e)},je=(e,t,n)=>{e.forEach(e=>Oe[e]=t);function r(t){var r=n(t);r.length!==e.length&&Ae(`Mismatched type converter count`);for(var i=0;i<e.length;++i)Be(e[i],r[i])}var i=Array(t.length),a=[],o=0;for(let[e,n]of t.entries())De.hasOwnProperty(n)?i[e]=De[n]:(a.push(n),R.hasOwnProperty(n)||(R[n]=[]),R[n].push(()=>{i[e]=De[n],++o,o===a.length&&r(i)}));a.length===0&&r(i)},Me=e=>cr(e),Ne,Pe=(e,t)=>Ne.fill(0,e,e+t),Fe=e=>{var t=I[e];delete I[e];var n=t.rawConstructor,r=t.rawDestructor,i=t.valueSize,a=t.isTrivial,o=t.fields,s=o.map(e=>e.getterReturnType).concat(o.map(e=>e.setterArgumentType));je([e],s,e=>{var s={};for(var[c,l]of o.entries()){let t=e[c],n=l.getter,r=l.getterContext,i=e[c+o.length],a=l.setter,d=l.setterContext;var u=i.destructorFunction===null&&!i.argStackAlloc?(e,t)=>a(d,e,i.toWireType(null,t)):(e,t)=>{var n=[];a(d,e,i.toWireType(n,t)),Ee(n)};s[l.fieldName]={read:e=>t.fromWireType(n(r,e)),write:u,optional:t.optional}}return[{name:t.name,fromWireType:e=>{var t={};for(var n in s)t[n]=s[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var o in s)if(!(o in t)&&!s[o].optional)throw TypeError(`Missing field: "${o}"`);var c;for(o in a&&!e?(c=Me(i),Pe(c,i)):(c=n(),e&&e.push(r,c)),s)s[o].write(c,t[o]);return c},readValueFromPointer:L,destructorFunction:a?null:r,argStackAlloc:a}]})},z=(e,t,n,r,i)=>{},Ie=e=>{for(var t=``;;){var n=Ne[e++];if(!n)return t;t+=String.fromCharCode(n)}};class Le extends Error{constructor(e){super(e),this.name=`BindingError`}}var Re=e=>{throw new Le(e)};function ze(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=t.name;if(e||Re(`type "${r}" must have a positive integer typeid pointer`),De.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Re(`Cannot register type '${r}' twice`)}if(De[e]=t,delete Oe[e],R.hasOwnProperty(e)){var i=R[e];delete R[e],i.forEach(e=>e())}}function Be(e,t){return ze(e,t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})}var Ve=(e,t,n,r)=>{t=Ie(t),Be(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},readValueFromPointer:function(e){return this.fromWireType(Ne[e])},destructorFunction:null})},He=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ue=e=>{function t(e){return e.$$.ptrType.registeredClass.name}Re(t(e)+` instance already deleted`)},We=!1,Ge=e=>{},Ke=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},qe=e=>{--e.count.value,e.count.value===0&&Ke(e)},Je=e=>globalThis.FinalizationRegistry?(We=new FinalizationRegistry(e=>{qe(e.$$)}),Je=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};We.register(e,n,e)}return e},Ge=e=>We.unregister(e),Je(e)):(Je=e=>e,e),Ye=[],Xe=()=>{for(;Ye.length;){var e=Ye.pop();e.$$.deleteScheduled=!1,e.delete()}},Ze,Qe=()=>{let e=$e.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof $e)||!(e instanceof $e))return!1;var t=this.$$.ptrType.registeredClass,n=this.$$.ptr;e.$$=e.$$;for(var r=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return t===r&&n===i},clone(){if(this.$$.ptr||Ue(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Je(Object.create(Object.getPrototypeOf(this),{$$:{value:He(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ue(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Re(`Object already scheduled for deletion`),Ge(this),qe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ue(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Re(`Object already scheduled for deletion`),Ye.push(this),Ye.length===1&&Ze&&Ze(Xe),this.$$.deleteScheduled=!0,this}});let t=Symbol.dispose;t&&(e[t]=e.delete)};function $e(){}var et=(e,t)=>Object.defineProperty(t,"name",{value:e}),tt={},nt=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(){var r=[...arguments];return e[t].overloadTable.hasOwnProperty(r.length)||Re(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},rt=(e,t,n)=>{i.hasOwnProperty(e)?((n===void 0||i[e].overloadTable!==void 0&&i[e].overloadTable[n]!==void 0)&&Re(`Cannot register public name '${e}' twice`),nt(i,e,e),i[e].overloadTable.hasOwnProperty(n)&&Re(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[e].overloadTable[n]=t):(i[e]=t,i[e].argCount=n)},it=48,at=57,ot=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,`$`);var t=e.charCodeAt(0);return t>=it&&t<=at?`_${e}`:e};function st(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=a,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}var ct=(e,t,n)=>{for(;t!==n;)t.upcast||Re(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},lt=e=>{if(e===null)return`null`;var t=typeof e;return t===`object`||t===`array`||t===`function`?e.toString():``+e};function ut(e,t){if(t===null)return this.isReference&&Re(`null is not a valid ${this.name}`),0;t.$$||Re(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||Re(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return ct(t.$$.ptr,n,this.registeredClass)}function B(e,t){var n;if(t===null)return this.isReference&&Re(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;t&&t.$$||Re(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||Re(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Re(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=ct(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&Re(`Passing raw pointer to smart pointer is illegal`),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Re(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var i=t.clone();n=this.rawShare(n,Vt.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,n)}break;default:Re(`Unsupported sharing policy`)}return n}function dt(e,t){if(t===null)return this.isReference&&Re(`null is not a valid ${this.name}`),0;t.$$||Re(`Cannot pass "${lt(t)}" as a ${this.name}`),t.$$.ptr||Re(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Re(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return ct(t.$$.ptr,n,this.registeredClass)}var ft=(e,t,n)=>{if(t===n)return e;if(n.baseClass===void 0)return null;var r=ft(e,t,n.baseClass);return r===null?null:n.downcast(r)},pt={},mt=(e,t)=>{for(t===void 0&&Re(`ptr should not be undefined`);e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},ht=(e,t)=>(t=mt(e,t),pt[t]),gt=(e,t)=>(t.ptrType&&t.ptr||Ae(`makeClassHandle requires ptr and ptrType`),!!t.smartPtrType!=!!t.smartPtr&&Ae(`Both smartPtrType and smartPtr must be specified`),t.count={value:1},Je(Object.create(e,{$$:{value:t,writable:!0}})));function _t(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=ht(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function i(){return this.isSmartPointer?gt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):gt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=tt[this.registeredClass.getActualType(t)];if(!a)return i.call(this);var o=this.isConst?a.constPointerType:a.pointerType,s=ft(t,this.registeredClass,o.registeredClass);return s===null?i.call(this):this.isSmartPointer?gt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:e}):gt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})}var vt=()=>{Object.assign(yt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t,n;(t=(n=this).rawDestructor)==null||t.call(n,e)},readValueFromPointer:L,fromWireType:_t})};function yt(e,t,n,r,i,a,o,s,c,l,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=u,!i&&t.baseClass===void 0?r?(this.toWireType=ut,this.destructorFunction=null):(this.toWireType=dt,this.destructorFunction=null):this.toWireType=B}var bt=(e,t,n)=>{i.hasOwnProperty(e)||Ae(`Replacing nonexistent public symbol`),i[e].overloadTable!==void 0&&n!==void 0?i[e].overloadTable[n]=t:(i[e]=t,i[e].argCount=n)},xt={},St=(e,t,n)=>{e=e.replace(/p/g,`i`);var r=xt[e];return r(t,...n)},Ct=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(arguments.length>3&&arguments[3]!==void 0&&arguments[3],e.includes(`j`))return St(e,t,n);var r=ce(t)(...n);function i(e){return e}return i(r)},wt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return function(){return Ct(e,t,[...arguments],n)}},Tt=function(e,t){arguments.length>2&&arguments[2]!==void 0&&arguments[2],e=Ie(e);function n(){return e.includes(`j`)?wt(e,t):ce(t)}var r=n();return typeof r!=`function`&&Re(`unknown function pointer with signature ${e}: ${t}`),r};class Et extends Error{}var Dt=e=>{var t=er(e),n=Ie(t);return nr(t),n},Ot=(e,t)=>{var n=[],r={};function i(e){if(!r[e]&&!De[e]){if(Oe[e]){Oe[e].forEach(i);return}n.push(e),r[e]=!0}}throw t.forEach(i),new Et(`${e}: `+n.map(Dt).join([`, `]))},kt=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{u=Ie(u),a=Tt(i,a),s&&=Tt(o,s),l&&=Tt(c,l),f=Tt(d,f);var p=ot(u);rt(p,function(){Ot(`Cannot construct ${u} due to unbound types`,[r])}),je([e,t,n],r?[r]:[],t=>{t=t[0];var n,i;r?(n=t.registeredClass,i=n.instancePrototype):i=$e.prototype;var o=et(u,function(){var e=[...arguments];if(Object.getPrototypeOf(this)!==c)throw new Le(`Use 'new' to construct ${u}`);if(d.constructor_body===void 0)throw new Le(`${u} has no accessible constructor`);var t=d.constructor_body[e.length];if(t===void 0)throw new Le(`Tried to invoke ctor of ${u} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)}),c=Object.create(i,{constructor:{value:o}});o.prototype=c;var d=new st(u,o,c,f,n,a,s,l);if(d.baseClass){var m;(m=d.baseClass).__derivedClasses??(m.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d)}var h=new yt(u,d,!0,!1,!1),g=new yt(u+`*`,d,!1,!1,!1),_=new yt(u+` const*`,d,!1,!0,!1);return tt[e]={pointerType:g,constPointerType:_},bt(p,o),[h,g,_]})},At=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(de[t+r*4>>2]);return n};function jt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Mt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].argStackAlloc)return!0;return!1}function Nt(e,t,n,r,i,a){var o=t.length;o<2&&Re(`argTypes array size mismatch! Must at least get return value and receiver (this) types!`);var s=t[1]!==null&&n!==null,c=jt(t),l=Mt(t),u=l&&!a&&!c;l&&!u&&(c=!0);var d=!t[0].isVoid,f=o-2,p=Array(f),m=[],h=[];return et(e,function(){var e=[...arguments];h.length=0;var n;u&&(n=oe());var a,o;try{m.length=s?2:1,m[0]=i,s&&(a=t[1].toWireType(h,this),m[1]=a);for(var l=0;l<f;++l){var g=t[l+2];p[l]=g.toWireType(u&&g.argStackAlloc?null:h,e[l]),m.push(p[l])}o=r(...m)}finally{u&&N(n)}function _(e){if(c)Ee(h);else for(var n=s?1:2;n<t.length;n++){var r=n===1?a:p[n-2];t[n].destructorFunction!==null&&t[n].destructorFunction(r)}if(d)return t[0].fromWireType(e)}return _(o)})}var Pt=(e,t,n,r,i,a)=>{var o=At(t,n);i=Tt(r,i),je([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(e.registeredClass.constructor_body===void 0&&(e.registeredClass.constructor_body=[]),e.registeredClass.constructor_body[t-1]!==void 0)throw new Le(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{Ot(`Cannot construct ${e.name} due to unbound types`,o)},je([],o,r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Nt(n,r,null,i,a),[])),[]})},Ft=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.slice(0,t)},It=(e,t,n,r,i,a,o,s,c,l)=>{var u=At(n,r);t=Ie(t),t=Ft(t),a=Tt(i,a,c),je([],[e],e=>{e=e[0];var r=`${e.name}.${t}`;t.startsWith(`@@`)&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);function i(){Ot(`Cannot call ${r} due to unbound types`,u)}var l=e.registeredClass.instancePrototype,d=l[t];return d===void 0||d.overloadTable===void 0&&d.className!==e.name&&d.argCount===n-2?(i.argCount=n-2,i.className=e.name,l[t]=i):(nt(l,t,r),l[t].overloadTable[n-2]=i),je([],u,i=>{var s=Nt(r,i,e,a,o,c);return l[t].overloadTable===void 0?(s.argCount=n-2,l[t]=s):l[t].overloadTable[n-2]=s,[]}),[]})},Lt=[],Rt=[0,1,,1,null,1,!0,1,!1,1],zt=[],Bt=e=>{if(e>9&&--Rt[e+1]===0){var t=Rt[e];Rt[e]=void 0;var n=zt[e];n&&(zt[e]=void 0,n(t)),Lt.push(e)}},Vt={toValue:e=>(e||Re(`Cannot use deleted val. handle = ${e}`),Rt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Lt.pop()||Rt.length;return Rt[t]=e,Rt[t+1]=1,t}}}},Ht={name:`emscripten::val`,fromWireType:e=>{var t=Vt.toValue(e);return Bt(e),t},toWireType:(e,t)=>Vt.toHandle(t),readValueFromPointer:L,destructorFunction:null},Ut=e=>Be(e,Ht),Wt,Gt,Kt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(Wt[e>>2])};case 8:return function(e){return this.fromWireType(Gt[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},qt=(e,t,n)=>{t=Ie(t),Be(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:Kt(t,n),destructorFunction:null})},Jt=(e,t,n,r,i,a,o,s)=>{var c=At(t,n);e=Ie(e),e=Ft(e),i=Tt(r,i,o),rt(e,function(){Ot(`Cannot call ${e} due to unbound types`,c)},t-1),je([],c,n=>{var r=[n[0],null].concat(n.slice(1));return bt(e,Nt(e,r,null,i,a,o),t-1),[]})},Yt,Xt,Zt,Qt=(e,t,n)=>{switch(t){case 1:return n?e=>te[e]:e=>Ne[e];case 2:return n?e=>Yt[e>>1]:e=>Xt[e>>1];case 4:return n?e=>Zt[e>>2]:e=>de[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},$t=(e,t,n,r,i)=>{t=Ie(t);let a=r===0,o=e=>e;if(a){var s=32-8*n;o=e=>e<<s>>>s,i=o(i)}Be(e,{name:t,fromWireType:o,toWireType:(e,t)=>t,readValueFromPointer:Qt(t,n,r!==0),destructorFunction:null})},en=(e,t,n)=>{let r=(e,t)=>{let n=0;return{next(){if(n>=e)return{done:!0};let r=n;return n++,{value:t(r),done:!1}},[Symbol.iterator](){return this}}};e[Symbol.iterator]||(e[Symbol.iterator]=function(){let e=this[t]();return r(e,e=>this[n](e))})},tn=(e,t,n,r)=>{n=Ie(n),r=Ie(r),je([],[e,t],e=>{let t=e[0];return en(t.registeredClass.instancePrototype,n,r),[]})},nn=(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=de[e>>2],n=de[e+4>>2];return new r(te.buffer,n,t)}n=Ie(n),Be(e,{name:n,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},rn=Object.assign({optional:!0},Ht),an=(e,t)=>{Be(e,rn)},on=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63,o++}}return t[n]=0,n-i},sn=(e,t,n)=>on(e,Ne,t,n),cn=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},ln=globalThis.TextDecoder&&new TextDecoder,un=(e,t,n,r)=>{var i=t+n;if(r)return i;for(;e[t]&&!(t>=i);)++t;return t},dn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=un(e,t,n,r);if(i-t>16&&e.buffer&&ln)return ln.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128))a+=String.fromCharCode(o);else{var s=e[t++]&63;if((o&224)==192)a+=String.fromCharCode((o&31)<<6|s);else{var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}}}return a},fn=(e,t,n)=>e?dn(Ne,e,t,n):``,pn=(e,t)=>{t=Ie(t);var n=!0;Be(e,{name:t,fromWireType(e){var t=de[e>>2],r=e+4,i;if(n)i=fn(r,t,!0);else{i=``;for(var a=0;a<t;++a)i+=String.fromCharCode(Ne[r+a])}return nr(e),i},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;i||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1||Re(`Cannot pass non-string to std::string`),r=n&&i?cn(t):t.length;var a=tr(4+r+1),o=a+4;if(de[a>>2]=r,i){if(n)sn(t,o,r+1);else for(var s=0;s<r;++s){var c=t.charCodeAt(s);c>255&&(nr(a),Re(`String has UTF-16 code units that do not fit in 8 bits`)),Ne[o+s]=c}}else Ne.set(t,o);return e!==null&&e.push(nr,a),a},readValueFromPointer:L,destructorFunction(e){nr(e)}})},mn=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,hn=(e,t,n)=>{var r=e>>1,i=un(Xt,r,t/2,n);if(i-r>16&&mn)return mn.decode(Xt.subarray(r,i));for(var a=``,o=r;o<i;++o){var s=Xt[o];a+=String.fromCharCode(s)}return a},gn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2147483647;if(n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);Yt[t>>1]=o,t+=2}return Yt[t>>1]=0,t-r},_n=e=>e.length*2,vn=(e,t,n)=>{for(var r=``,i=e>>2,a=0;!(a>=t/4);a++){var o=de[i+a];if(!o&&!n)break;r+=String.fromCodePoint(o)}return r},yn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2147483647;if(n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.codePointAt(a);if(o>65535&&a++,Zt[t>>2]=o,t+=4,t+4>i)break}return Zt[t>>2]=0,t-r},bn=e=>{for(var t=0,n=0;n<e.length;++n)e.codePointAt(n)>65535&&n++,t+=4;return t},xn=(e,t,n)=>{n=Ie(n);var r,i,a;t===2?(r=hn,i=gn,a=_n):(r=vn,i=yn,a=bn),Be(e,{name:n,fromWireType:e=>{var n=de[e>>2],i=r(e+4,n*t,!0);return nr(e),i},toWireType:(e,r)=>{typeof r!=`string`&&Re(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=tr(4+o+t);return de[s>>2]=o/t,i(r,s+4,o+t),e!==null&&e.push(nr,s),s},readValueFromPointer:L,destructorFunction(e){nr(e)}})},Sn=(e,t,n,r,i,a,o,s)=>{I[e]={name:Ie(t),rawConstructor:Tt(n,r),rawDestructor:Tt(i,a),valueSize:o,isTrivial:!!s,fields:[]}},Cn=(e,t,n,r,i,a,o,s,c,l)=>{I[e].fields.push({fieldName:Ie(t),getterReturnType:n,getter:Tt(r,i),getterContext:a,setterArgumentType:o,setter:Tt(s,c),setterContext:l})},wn=(e,t)=>{t=Ie(t),Be(e,{isVoid:!0,name:t,fromWireType:()=>void 0,toWireType:(e,t)=>void 0})},Tn=0,En=()=>{ae=!1,Tn=0},Dn=[],On=e=>{var t=Dn.length;return Dn.push(e),t},kn=(e,t)=>{var n=De[e];return n===void 0&&Re(`${t} has unknown type ${Dt(e)}`),n},An=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=kn(de[t+r*4>>2],`parameter ${r}`);return n},jn=(e,t,n)=>{var r=[],i=e(r,n);return r.length&&(de[t>>2]=Vt.toHandle(r)),i},Mn={},Nn=e=>{var t=Mn[e];return t===void 0?Ie(e):t},Pn=(e,t,n)=>{var[r,...i]=An(e,t),a=r.toWireType.bind(r),o=i.map(e=>e.readValueFromPointer.bind(e));e--;var s=Array(e);return On(et(`methodCaller<(${i.map(e=>e.name)}) => ${r.name}>`,(t,r,i,c)=>{for(var l=0,u=0;u<e;++u)s[u]=o[u](c+l),l+=8;var d;switch(n){case 0:d=Vt.toValue(t).apply(null,s);break;case 2:d=Reflect.construct(Vt.toValue(t),s);break;case 3:d=s[0];break;case 1:d=Vt.toValue(t)[Nn(r)](...s)}return jn(a,i,d)}))},Fn=e=>e?(e=Nn(e),Vt.toHandle(globalThis[e])):Vt.toHandle(globalThis),In=e=>{e>9&&(Rt[e+1]+=1)},Ln=(e,t,n,r,i)=>Dn[e](t,n,r,i),Rn=e=>{Ee(Vt.toValue(e)),Bt(e)},zn={},Bn=e=>{if(e instanceof M||e==`unwind`)return g;s(1,e)},Vn=()=>ae||Tn>0,Hn=e=>{if(g=e,!Vn()){var t;(t=i.onExit)==null||t.call(i,e),h=!0}s(e,new M(e))},Un=(e,t)=>{g=e,Hn(e)},Wn=()=>{if(!Vn())try{Un(g)}catch(e){Bn(e)}},Gn=function(e){var t=[...arguments].slice(1);if(!h)try{return e(...t)}catch(e){Bn(e)}finally{Wn()}},Kn=()=>performance.now(),qn=(e,t)=>(zn[e]&&(clearTimeout(zn[e].id),delete zn[e]),t&&(zn[e]={id:setTimeout(()=>{delete zn[e],Gn(ir,e,Kn())},t),timeout_ms:t}),0),Jn=()=>2147483648,Yn=(e,t)=>Math.ceil(e/t)*t,Xn=e=>{var t=(e-mr.buffer.byteLength+65535)/65536|0;try{return mr.grow(t),b(),1}catch{}},Zn=e=>{var t=Ne.length;e>>>=0;var n=Jn();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),Xn(Math.min(n,Yn(Math.max(e,i),65536))))return!0}return!1},Qn=e=>e;Qe(),vt(),i.noExitRuntime&&(ae=i.noExitRuntime),i.print&&i.print,i.printErr&&(p=i.printErr),i.wasmBinary&&(m=i.wasmBinary),i.arguments&&i.arguments,i.thisProgram&&i.thisProgram;var $n=i.preInit;if($n)for(typeof $n==`function`&&(i.preInit=$n=[$n]);$n.length>0;)$n.shift()();var er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr;function gr(e){er=e.sa,tr=i._malloc=e.ta,nr=i._free=e.ua,rr=e.va,ir=e.xa,ar=e.ya,or=e.za,sr=e.Aa,cr=e.Ba,lr=e.Ca,ur=e.Da,dr=e.Ea,fr=e.Fa,pr=xt.iiij=e.Ga,mr=e.qa,hr=e.wa}var _r={aa:P,v:pe,I:he,a:_e,i:ve,l:ye,fa:xe,s:Se,e:we,ea:Te,T:Fe,W:z,ia:Ve,pa:kt,oa:Pt,E:It,ga:Ut,Q:qt,R:Jt,y:$t,ka:tn,u:nn,S:an,ha:pn,L:xn,C:Sn,U:Cn,ja:wn,da:En,na:Pn,ba:Bt,B:Fn,P:In,ma:Ln,la:Rn,_:qn,$:Zn,Z:Lr,N:Br,A:Er,b:yr,z:zr,g:br,D:Ir,h:Tr,k:Nr,o:Mr,K:Rr,O:Fr,H:wr,G:Wr,V:Jr,c:Sr,j:vr,X:Gr,f:Cr,M:Hr,J:qr,d:xr,F:Kr,m:Or,Y:Ur,n:jr,t:Ar,x:Pr,q:kr,r:Vr,p:Dr,w:Qn,ca:Hn};function vr(e,t){var n=oe();try{ce(e)(t)}catch(e){if(N(n),!(e instanceof _))throw e;ar(1,0)}}function yr(e,t){var n=oe();try{return ce(e)(t)}catch(e){if(N(n),!(e instanceof _))throw e;ar(1,0)}}function br(e,t,n){var r=oe();try{return ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function xr(e,t,n,r){var i=oe();try{ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Sr(e){var t=oe();try{ce(e)()}catch(e){if(N(t),!(e instanceof _))throw e;ar(1,0)}}function Cr(e,t,n){var r=oe();try{ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function wr(e,t,n,r,i,a,o,s){var c=oe();try{return ce(e)(t,n,r,i,a,o,s)}catch(e){if(N(c),!(e instanceof _))throw e;ar(1,0)}}function Tr(e,t,n,r){var i=oe();try{return ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Er(e,t,n,r,i,a){var o=oe();try{return ce(e)(t,n,r,i,a)}catch(e){if(N(o),!(e instanceof _))throw e;ar(1,0)}}function Dr(e,t,n,r,i,a,o,s,c,l,u){var d=oe();try{ce(e)(t,n,r,i,a,o,s,c,l,u)}catch(e){if(N(d),!(e instanceof _))throw e;ar(1,0)}}function Or(e,t,n,r,i){var a=oe();try{ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function kr(e,t,n,r,i,a,o,s,c){var l=oe();try{ce(e)(t,n,r,i,a,o,s,c)}catch(e){if(N(l),!(e instanceof _))throw e;ar(1,0)}}function Ar(e,t,n,r,i,a,o){var s=oe();try{ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function jr(e,t,n,r,i,a){var o=oe();try{ce(e)(t,n,r,i,a)}catch(e){if(N(o),!(e instanceof _))throw e;ar(1,0)}}function Mr(e,t,n,r,i,a){var o=oe();try{return ce(e)(t,n,r,i,a)}catch(e){if(N(o),!(e instanceof _))throw e;ar(1,0)}}function Nr(e,t,n,r,i){var a=oe();try{return ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function Pr(e,t,n,r,i,a,o,s){var c=oe();try{ce(e)(t,n,r,i,a,o,s)}catch(e){if(N(c),!(e instanceof _))throw e;ar(1,0)}}function Fr(e,t,n,r,i,a,o){var s=oe();try{return ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function Ir(e,t,n,r,i){var a=oe();try{return ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function Lr(e,t,n){var r=oe();try{return ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function Rr(e,t,n,r,i,a,o){var s=oe();try{return ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function zr(e,t,n,r){var i=oe();try{return ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Br(e,t,n,r){var i=oe();try{return ce(e)(t,n,r)}catch(e){if(N(i),!(e instanceof _))throw e;ar(1,0)}}function Vr(e,t,n,r,i,a,o,s,c,l){var u=oe();try{ce(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(N(u),!(e instanceof _))throw e;ar(1,0)}}function Hr(e,t,n,r,i,a,o,s,c){var l=oe();try{ce(e)(t,n,r,i,a,o,s,c)}catch(e){if(N(l),!(e instanceof _))throw e;ar(1,0)}}function Ur(e,t,n,r,i,a,o,s){var c=oe();try{ce(e)(t,n,r,i,a,o,s)}catch(e){if(N(c),!(e instanceof _))throw e;ar(1,0)}}function Wr(e,t,n,r,i,a,o,s,c){var l=oe();try{return ce(e)(t,n,r,i,a,o,s,c)}catch(e){if(N(l),!(e instanceof _))throw e;ar(1,0)}}function Gr(e,t,n){var r=oe();try{ce(e)(t,n)}catch(e){if(N(r),!(e instanceof _))throw e;ar(1,0)}}function Kr(e,t,n,r,i,a,o){var s=oe();try{ce(e)(t,n,r,i,a,o)}catch(e){if(N(s),!(e instanceof _))throw e;ar(1,0)}}function qr(e,t,n,r,i){var a=oe();try{ce(e)(t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}function Jr(e,t,n,r,i){var a=oe();try{return pr(e,t,n,r,i)}catch(e){if(N(a),!(e instanceof _))throw e;ar(1,0)}}async function Yr(){var e;x();var t=i.setStatus;t&&(t(`Running...`),await new Promise(e=>setTimeout(e,1)),setTimeout(t,1,``)),!h&&(S(),(e=i.onRuntimeInitialized)==null||e.call(i),C())}var Xr=await j();return await Yr(),i}function pK(e){return lK(fK,e)}async function mK(e,t){return uK(fK,e,t)}var hK=[[`aztec`,`Aztec`],[`aztec_code`,`AztecCode`],[`aztec_rune`,`AztecRune`],[`code_128`,`Code128`],[`code_39`,`Code39`],[`code_39_standard`,`Code39Std`],[`code_39_extended`,`Code39Ext`],[`code_32`,`Code32`],[`pzn`,`PZN`],[`code_93`,`Code93`],[`codabar`,`Codabar`],[`databar`,`DataBar`],[`databar_omni`,`DataBarOmni`],[`databar_stacked`,`DataBarStk`],[`databar_stacked_omni`,`DataBarStkOmni`],[`databar_expanded`,`DataBarExp`],[`databar_expanded_stacked`,`DataBarExpStk`],[`databar_limited`,`DataBarLtd`],[`data_matrix`,`DataMatrix`],[`dx_film_edge`,`DXFilmEdge`],[`ean_13`,`EAN13`],[`ean_upc`,`EANUPC`],[`isbn`,`ISBN`],[`ean_8`,`EAN8`],[`itf`,`ITF`],[`itf_14`,`ITF14`],[`maxi_code`,`MaxiCode`],[`micro_qr_code`,`MicroQRCode`],[`pdf417`,`PDF417`],[`compact_pdf417`,`CompactPDF417`],[`micro_pdf417`,`MicroPDF417`],[`qr_code`,`QRCode`],[`qr_code_model_1`,`QRCodeModel1`],[`qr_code_model_2`,`QRCodeModel2`],[`rm_qr_code`,`RMQRCode`],[`upc_a`,`UPCA`],[`upc_e`,`UPCE`],[`telepen`,`Telepen`],[`telepen_alpha`,`TelepenAlpha`],[`telepen_numeric`,`TelepenNumeric`],[`other_barcode`,`OtherBarcode`],[`linear_codes`,`AllLinear`],[`matrix_codes`,`AllMatrix`],[`gs1_codes`,`AllGS1`],[`retail_codes`,`AllRetail`],[`industrial_codes`,`AllIndustrial`],[`any`,`All`]],gK=[...hK,[`unknown`]].map(e=>e[0]),_K=new Map(hK);function vK(e){for(let[t,n]of _K)if(e===n)return t;return`unknown`}function yK(e){if(bK(e))return{width:e.naturalWidth,height:e.naturalHeight};if(xK(e))return{width:e.width.baseVal.value,height:e.height.baseVal.value};if(SK(e))return{width:e.videoWidth,height:e.videoHeight};if(wK(e))return{width:e.width,height:e.height};if(EK(e))return{width:e.displayWidth,height:e.displayHeight};if(CK(e)||TK(e))return{width:e.width,height:e.height};throw TypeError(`The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.`)}function bK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLImageElement)}catch{return!1}}function xK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.SVGImageElement)}catch{return!1}}function SK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLVideoElement)}catch{return!1}}function CK(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLCanvasElement)}catch{return!1}}function wK(e){try{return e instanceof ImageBitmap||Object.prototype.toString.call(e)===`[object ImageBitmap]`}catch{return!1}}function TK(e){try{return e instanceof OffscreenCanvas||Object.prototype.toString.call(e)===`[object OffscreenCanvas]`}catch{return!1}}function EK(e){try{return e instanceof VideoFrame||Object.prototype.toString.call(e)===`[object VideoFrame]`}catch{return!1}}function DK(e){try{return e instanceof Blob||Object.prototype.toString.call(e)===`[object Blob]`}catch{return!1}}function OK(e){try{return e instanceof ImageData||Object.prototype.toString.call(e)===`[object ImageData]`}catch{return!1}}function kK(e,t){try{let n=new OffscreenCanvas(e,t);if(n.getContext(`2d`)instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}}async function AK(e){if(bK(e)&&!await PK(e))throw new DOMException(`Failed to load or decode HTMLImageElement.`,`InvalidStateError`);if(xK(e)&&!await FK(e))throw new DOMException(`Failed to load or decode SVGImageElement.`,`InvalidStateError`);if(EK(e)&&IK(e))throw new DOMException(`VideoFrame is closed.`,`InvalidStateError`);if(SK(e)&&(e.readyState===0||e.readyState===1))throw new DOMException(`Invalid element or state.`,`InvalidStateError`);if(wK(e)&&RK(e))throw new DOMException(`The image source is detached.`,`InvalidStateError`);let{width:t,height:n}=yK(e);if(t===0||n===0)return null;let r=kK(t,n).getContext(`2d`);r.drawImage(e,0,0);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function jK(e){let t;try{t=await createImageBitmap(e)}catch{try{if(globalThis.Image){t=new Image;let n=``;try{n=URL.createObjectURL(e),t.src=n,await t.decode()}finally{URL.revokeObjectURL(n)}}else return e}catch{throw new DOMException(`Failed to load or decode Blob.`,`InvalidStateError`)}}try{return await AK(t)}finally{wK(t)&&t.close()}}function MK(e){let{width:t,height:n}=e;if(t===0||n===0)return null;let r=e.getContext(`2d`);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function NK(e){if(DK(e))return await jK(e);if(OK(e)){if(LK(e))throw new DOMException(`The image data has been detached.`,`InvalidStateError`);return e}return CK(e)||TK(e)?MK(e):await AK(e)}async function PK(e){try{return await e.decode(),!0}catch{return!1}}async function FK(e){try{return await e.decode?.call(e),!0}catch{return!1}}function IK(e){return e.format===null}function LK(e){return e.data.buffer.byteLength===0}function RK(e){return e.width===0&&e.height===0}function zK(e,t){return BK(e)?new DOMException(`${t}: ${e.message}`,e.name):VK(e)?new e.constructor(`${t}: ${e.message}`):Error(`${t}: ${e}`)}function BK(e){return e instanceof DOMException||Object.prototype.toString.call(e)===`[object DOMException]`}function VK(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function HK(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function UK(e,t,n){HK(e,t),t.set(e,n)}function WK(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function GK(e,t,n){return e.set(WK(e,t),n),n}function KK(e,t){return e.get(WK(e,t))}var qK=new WeakMap,JK=class{constructor(e={}){UK(this,qK,void 0);try{var t;let n=e==null||(t=e.formats)==null?void 0:t.filter(e=>e!==`unknown`);if(n?.length===0)throw TypeError(`Hint option provided, but is empty.`);for(let e of n??[])if(!_K.has(e))throw TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${e}' is not a valid enum value of type BarcodeFormat.`);GK(qK,this,n??[]),pK({fireImmediately:!0}).catch(()=>{})}catch(e){throw zK(e,`Failed to construct 'BarcodeDetector'`)}}static async getSupportedFormats(){return gK.filter(e=>e!==`unknown`)}async detect(e){try{let t=await NK(e);if(t===null)return[];let n,r={textMode:`Plain`,formats:KK(qK,this).map(e=>_K.get(e))};try{n=await mK(t,r)}catch(e){throw console.error(e),new DOMException(`Barcode detection service unavailable.`,`NotSupportedError`)}return n.map(e=>{let{topLeft:{x:t,y:n},topRight:{x:r,y:i},bottomLeft:{x:a,y:o},bottomRight:{x:s,y:c}}=e.position,l=Math.min(t,r,a,s),u=Math.min(n,i,o,c),d=Math.max(t,r,a,s),f=Math.max(n,i,o,c);return{boundingBox:new DOMRectReadOnly(l,u,d-l,f-u),rawValue:e.text,format:vK(e.format),cornerPoints:[{x:t,y:n},{x:r,y:i},{x:s,y:c},{x:a,y:o}]}})}catch(e){throw zK(e,`Failed to execute 'detect' on 'BarcodeDetector'`)}}},YK=!0,XK=!0;function ZK(e,t,n){let r=e.match(t);return r&&r.length>=n&&parseFloat(r[n],10)}function QK(e,t,n){if(!e.RTCPeerConnection)return;if(!Object.getOwnPropertyDescriptor(EventTarget.prototype,`addEventListener`).writable){tq(`Unable to polyfill events`);return}let r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);let a=e=>{let t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,a),i.apply(this,[e,a])};let a=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t]||!this._eventMap[t].has(n))return a.apply(this,arguments);let r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,a.apply(this,[e,r])},Object.defineProperty(r,`on`+t,{get(){return this[`_on`+t]},set(e){this[`_on`+t]&&(this.removeEventListener(t,this[`_on`+t]),delete this[`_on`+t]),e&&this.addEventListener(t,this[`_on`+t]=e)},enumerable:!0,configurable:!0})}function $K(e){return typeof e==`boolean`?(YK=e,e?`adapter.js logging disabled`:`adapter.js logging enabled`):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function eq(e){return typeof e==`boolean`?(XK=!e,`adapter.js deprecation warnings `+(e?`disabled`:`enabled`)):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function tq(){if(typeof window==`object`){if(YK)return;typeof console<`u`&&typeof console.log==`function`&&console.log.apply(console,arguments)}}function nq(e,t){XK&&console.warn(e+` is deprecated, please use `+t+` instead.`)}function rq(e){let t={browser:null,version:null};if(e===void 0||!e.navigator||!e.navigator.userAgent)return t.browser=`Not a browser.`,t;let{navigator:n}=e;if(n.userAgentData&&n.userAgentData.brands){let e=n.userAgentData.brands.find(e=>e.brand===`Chromium`);if(e){let t=parseInt(e.version,10);if(t>=90)return{browser:`chrome`,version:t}}}if(n.mozGetUserMedia)t.browser=`firefox`,t.version=parseInt(ZK(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||e.isSecureContext===!1&&e.webkitRTCPeerConnection)t.browser=`chrome`,t.version=parseInt(ZK(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2))||null;else if(e.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser=`safari`,t.version=parseInt(ZK(n.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&`currentDirection`in e.RTCRtpTransceiver.prototype,t._safariVersion=ZK(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return t.browser=`Not a supported browser.`,t;return t}function iq(e){return Object.prototype.toString.call(e)===`[object Object]`}function aq(e){return iq(e)?Object.keys(e).reduce(function(t,n){let r=iq(e[n]),i=r?aq(e[n]):e[n],a=r&&!Object.keys(i).length;return i===void 0||a?t:Object.assign(t,{[n]:i})},{}):e}function oq(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach(r=>{r.endsWith(`Id`)?oq(e,e.get(t[r]),n):r.endsWith(`Ids`)&&t[r].forEach(t=>{oq(e,e.get(t),n)})}))}function sq(e,t,n){let r=n?`outbound-rtp`:`inbound-rtp`,i=new Map;if(t===null)return i;let a=[];return e.forEach(e=>{e.type===`track`&&e.trackIdentifier===t.id&&a.push(e)}),a.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&oq(e,n,i)})}),i}var cq=tq;function lq(e,t){if(t.version>=64)return;let n=e&&e.navigator;if(!n.mediaDevices)return;let r=function(e){if(typeof e!=`object`||e.mandatory||e.optional)return e;let t={};return Object.keys(e).forEach(n=>{if(n===`require`||n===`advanced`||n===`mediaSource`)return;let r=typeof e[n]==`object`?e[n]:{ideal:e[n]};r.exact!==void 0&&typeof r.exact==`number`&&(r.min=r.max=r.exact);let i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):t===`deviceId`?`sourceId`:t};if(r.ideal!==void 0){t.optional=t.optional||[];let e={};typeof r.ideal==`number`?(e[i(`min`,n)]=r.ideal,t.optional.push(e),e={},e[i(`max`,n)]=r.ideal,t.optional.push(e)):(e[i(``,n)]=r.ideal,t.optional.push(e))}r.exact!==void 0&&typeof r.exact!=`number`?(t.mandatory=t.mandatory||{},t.mandatory[i(``,n)]=r.exact):[`min`,`max`].forEach(e=>{r[e]!==void 0&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if(e=JSON.parse(JSON.stringify(e)),e&&typeof e.audio==`object`){let t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),t(e.audio,`autoGainControl`,`googAutoGainControl`),t(e.audio,`noiseSuppression`,`googNoiseSuppression`),e.audio=r(e.audio)}if(e&&typeof e.video==`object`){let a=e.video.facingMode;a&&=typeof a==`object`?a:{ideal:a};let o=t.version<66;if(a&&(a.exact===`user`||a.exact===`environment`||a.ideal===`user`||a.ideal===`environment`)&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!o)){delete e.video.facingMode;let t;if(a.exact===`environment`||a.ideal===`environment`?t=[`back`,`rear`]:(a.exact===`user`||a.ideal===`user`)&&(t=[`front`]),t)return n.mediaDevices.enumerateDevices().then(n=>{n=n.filter(e=>e.kind===`videoinput`);let o=n.find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!o&&n.length&&t.includes(`back`)&&(o=n[n.length-1]),o&&(e.video.deviceId=a.exact?{exact:o.deviceId}:{ideal:o.deviceId}),e.video=r(e.video),cq(`chrome: `+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return cq(`chrome: `+JSON.stringify(e)),i(e)},a=function(e){return t.version>=64?e:{name:{PermissionDeniedError:`NotAllowedError`,PermissionDismissedError:`NotAllowedError`,InvalidStateError:`NotAllowedError`,DevicesNotFoundError:`NotFoundError`,ConstraintNotSatisfiedError:`OverconstrainedError`,TrackStartError:`NotReadableError`,MediaDeviceFailedDueToShutdown:`NotAllowedError`,MediaDeviceKillSwitchOn:`NotAllowedError`,TabCaptureError:`AbortError`,ScreenCaptureError:`AbortError`,DeviceCaptureError:`AbortError`}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&`: `)+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(a(e))})})}.bind(n),n.mediaDevices.getUserMedia){let e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException(``,`NotFoundError`);return e},e=>Promise.reject(a(e))))}}}var uq=s({fixNegotiationNeeded:()=>vq,shimAddTrackRemoveTrack:()=>gq,shimAddTrackRemoveTrackWithNative:()=>hq,shimGetSendersWithDtmf:()=>pq,shimGetUserMedia:()=>lq,shimMediaStream:()=>dq,shimOnTrack:()=>fq,shimPeerConnection:()=>_q,shimSenderReceiverGetStats:()=>mq});function dq(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function fq(e,t){if(!(t.version>102)){if(typeof e==`object`&&e.RTCPeerConnection&&!(`ontrack`in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener(`track`,this._ontrack),this.addEventListener(`track`,this._ontrack=e)},enumerable:!0,configurable:!0});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener(`addtrack`,n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};let i=new Event(`track`);i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};let i=new Event(`track`);i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener(`addstream`,this._ontrackpoly)),t.apply(this,arguments)}}else QK(e,`track`,e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}}function pq(e){if(typeof e==`object`&&e.RTCPeerConnection&&!(`getSenders`in e.RTCPeerConnection.prototype)&&`createDTMFSender`in e.RTCPeerConnection.prototype){let t=function(e,t){return{track:t,get dtmf(){return this._dtmf===void 0&&(this._dtmf=t.kind===`audio`?e.createDTMFSender(t):null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};let n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};let r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);let t=this._senders.indexOf(e);t!==-1&&this._senders.splice(t,1)}}let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{let t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if(typeof e==`object`&&e.RTCPeerConnection&&`getSenders`in e.RTCPeerConnection.prototype&&`createDTMFSender`in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!(`dtmf`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this._dtmf=this.track.kind===`audio`?this._pc.createDTMFSender(this.track):null),this._dtmf}})}}function mq(e,t){if(t.version>=67||!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!(`getStats`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>sq(t,e.track,!0))}}if(!(`getStats`in e.RTCRtpReceiver.prototype)){let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),QK(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>sq(t,e.track,!1))}}if(!(`getStats`in e.RTCRtpSender.prototype&&`getStats`in e.RTCRtpReceiver.prototype))return;let n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){let e=arguments[0],t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException(`There are more than one sender or receiver for the track.`,`InvalidAccessError`)):t?t.getStats():n?n.getStats():Promise.reject(new DOMException(`There is no sender or receiver for the track.`,`InvalidAccessError`))}return n.apply(this,arguments)}}function hq(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};let r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?this._shimmedLocalStreams[n.id].indexOf(r)===-1&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)});let t=this.getSenders();n.apply(this,arguments);let r=this.getSenders().filter(e=>t.indexOf(e)===-1);this._shimmedLocalStreams[e.id]=[e].concat(r)};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};let i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{let n=this._shimmedLocalStreams[t].indexOf(e);n!==-1&&this._shimmedLocalStreams[t].splice(n,1),this._shimmedLocalStreams[t].length===1&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function gq(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return hq(e);let n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){let e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};let r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)}),!this._reverseStreams[t.id]){let n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};let i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);let r=[].slice.call(arguments,1);if(r.length!==1||!r[0].getTracks().find(e=>e===t))throw new DOMException(`The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.`,`NotSupportedError`);if(this.getSenders().find(e=>e.track===t))throw new DOMException(`Track already exists.`,`InvalidAccessError`);this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};let i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event(`negotiationneeded`))});else{let r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)};function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,`g`),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,`g`),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}[`createOffer`,`createAnswer`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){let e=arguments;return arguments.length&&typeof arguments[0]==`function`?n.apply(this,[t=>{let n=a(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>a(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]});let s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type||(arguments[0]=o(this,arguments[0])),s.apply(this,arguments)};let c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,`localDescription`);Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){let e=c.get.apply(this);return e.type===``?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);if(!e._pc)throw new DOMException(`Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.`,`TypeError`);if(e._pc!==this)throw new DOMException(`Sender was not created by this connection.`,`InvalidAccessError`);this._streams=this._streams||{};let t;Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(t.getTracks().length===1?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event(`negotiationneeded`)))}}function _q(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})}function vq(e,t){t.version>102||QK(e,`negotiationneeded`,e=>{let n=e.target;if(!((t.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics===`plan-b`)&&n.signalingState!==`stable`))return e})}function yq(e,t){let n=e&&e.navigator;if(!n.mediaDevices)return;let r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){nq(`navigator.getUserMedia`,`navigator.mediaDevices.getUserMedia`),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&`autoGainControl`in n.mediaDevices.getSupportedConstraints())){let e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return typeof n==`object`&&typeof n.audio==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,`autoGainControl`,`mozAutoGainControl`),e(n.audio,`noiseSuppression`,`mozNoiseSuppression`)),t(n)},r&&r.prototype.getSettings){let t=r.prototype.getSettings;r.prototype.getSettings=function(){let n=t.apply(this,arguments);return e(n,`mozAutoGainControl`,`autoGainControl`),e(n,`mozNoiseSuppression`,`noiseSuppression`),n}}if(r&&r.prototype.applyConstraints){let t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return this.kind===`audio`&&typeof n==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n,`autoGainControl`,`mozAutoGainControl`),e(n,`noiseSuppression`,`mozNoiseSuppression`)),t.apply(this,[n])}}}}function bq(e,t){e.navigator.mediaDevices&&(e.navigator.mediaDevices&&`getDisplayMedia`in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){let e=new DOMException(`getDisplayMedia without video constraints is undefined`);return e.name=`NotFoundError`,e.code=8,Promise.reject(e)}return n.video===!0?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)}))}var xq=s({shimAddTransceiver:()=>kq,shimCreateAnswer:()=>Mq,shimCreateOffer:()=>jq,shimGetDisplayMedia:()=>bq,shimGetParameters:()=>Aq,shimGetStats:()=>wq,shimGetUserMedia:()=>yq,shimOnTrack:()=>Sq,shimPeerConnection:()=>Cq,shimRTCDataChannel:()=>Oq,shimReceiverGetStats:()=>Eq,shimRemoveStream:()=>Dq,shimSenderGetStats:()=>Tq});function Sq(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Cq(e,t){typeof e==`object`&&(e.RTCPeerConnection||e.mozRTCPeerConnection)&&(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function wq(e,t){if(typeof e!=`object`||!(e.RTCPeerConnection||e.mozRTCPeerConnection)||t.version>=151)return;let n={inboundrtp:`inbound-rtp`,outboundrtp:`outbound-rtp`,candidatepair:`candidate-pair`,localcandidate:`local-candidate`,remotecandidate:`remote-candidate`},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){let[e,i,a]=arguments;return this.signalingState===`closed`?Promise.resolve(new Map):r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if(t.name!==`TypeError`)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,a)}}function Tq(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpSender.prototype)return;let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Eq(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpReceiver.prototype)return;let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),QK(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Dq(e){!e.RTCPeerConnection||`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){nq(`removeStream`,`removeTrack`),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function Oq(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function kq(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.addTransceiver;n&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;e===void 0&&(e=[]),e=[...e];let t=e.length>0;t&&e.forEach(e=>{if(`rid`in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw TypeError(`Invalid RID value provided.`);if(`scaleResolutionDownBy`in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw RangeError(`scale_resolution_down_by must be >= 1.0`);if(`maxFramerate`in e&&!(parseFloat(e.maxFramerate)>=0))throw RangeError(`max_framerate must be >= 0.0`)});let r=n.apply(this,arguments);if(t){let{sender:t}=r,n=t.getParameters();(!(`encodings`in n)||n.encodings.length===1&&Object.keys(n.encodings[0]).length===0)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return r})}function Aq(e,t){if(!(typeof e==`object`&&e.RTCRtpSender)||t.version>=110)return;let n=e.RTCRtpSender.prototype.getParameters;n&&(e.RTCRtpSender.prototype.getParameters=function(){let e=n.apply(this,arguments);return`encodings`in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function jq(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>n.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):n.apply(this,arguments)}}function Mq(e,t){if(!(typeof e==`object`&&e.RTCPeerConnection)||t.version>=110)return;let n=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>n.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):n.apply(this,arguments)}}var Nq=s({shimAudioContext:()=>Hq,shimCallbacksAPI:()=>Iq,shimConstraints:()=>Rq,shimCreateOfferLegacy:()=>Vq,shimGetUserMedia:()=>Lq,shimLocalStreamsAPI:()=>Pq,shimRTCIceServerUrls:()=>zq,shimRemoteStreamsAPI:()=>Fq,shimTrackEventTransceiver:()=>Bq});function Pq(e){if(typeof e==`object`&&e.RTCPeerConnection){if(`getLocalStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||=[],this._localStreams}),!(`addStream`in e.RTCPeerConnection.prototype)){let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||=[],this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||=[];let t=this._localStreams.indexOf(e);if(t===-1)return;this._localStreams.splice(t,1);let n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function Fq(e){if(typeof e==`object`&&e.RTCPeerConnection&&(`getRemoteStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!(`onaddstream`in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener(`addstream`,this._onaddstream),this.removeEventListener(`track`,this._onaddstreampoly)),this.addEventListener(`addstream`,this._onaddstream=e),this.addEventListener(`track`,this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||=[],this._remoteStreams.includes(e))return;this._remoteStreams.push(e);let t=new Event(`addstream`);t.stream=e,this.dispatchEvent(t)})})}});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){let e=this;return this._onaddstreampoly||this.addEventListener(`track`,this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||=[],e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);let n=new Event(`addstream`);n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function Iq(e){if(typeof e!=`object`||!e.RTCPeerConnection)return;let t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,a=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){let r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){let n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,n){let r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){let r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){let r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function Lq(e){let t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){let e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(Rq(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function Rq(e){return e&&e.video!==void 0?Object.assign({},e,{video:aq(e.video)}):e}function zq(e){if(!e.RTCPeerConnection)return;let t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){let t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];r.urls===void 0&&r.url?(nq(`RTCIceServer.url`,`RTCIceServer.urls`),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,`generateCertificate`in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get(){return t.generateCertificate}})}function Bq(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Vq(e){let t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){e.offerToReceiveAudio!==void 0&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);let t=this.getTransceivers().find(e=>e.receiver.track.kind===`audio`);e.offerToReceiveAudio===!1&&t?t.direction===`sendrecv`?t.setDirection?t.setDirection(`sendonly`):t.direction=`sendonly`:t.direction===`recvonly`&&(t.setDirection?t.setDirection(`inactive`):t.direction=`inactive`):e.offerToReceiveAudio===!0&&!t&&this.addTransceiver(`audio`,{direction:`recvonly`}),e.offerToReceiveVideo!==void 0&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);let n=this.getTransceivers().find(e=>e.receiver.track.kind===`video`);e.offerToReceiveVideo===!1&&n?n.direction===`sendrecv`?n.setDirection?n.setDirection(`sendonly`):n.direction=`sendonly`:n.direction===`recvonly`&&(n.setDirection?n.setDirection(`inactive`):n.direction=`inactive`):e.offerToReceiveVideo===!0&&!n&&this.addTransceiver(`video`,{direction:`recvonly`})}return t.apply(this,arguments)}}function Hq(e){typeof e!=`object`||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Uq=o(((e,t)=>{var n={};n.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split(`
|
|
260
260
|
`).map(e=>e.trim())},n.splitSections=function(e){return e.split(`
|
|
261
261
|
m=`).map((e,t)=>(t>0?`m=`+e:e).trim()+`\r
|
|
262
262
|
`)},n.getDescription=function(e){let t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){let t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter(e=>e.indexOf(t)===0)},n.parseCandidate=function(e){let t;t=e.indexOf(`a=candidate:`)===0?e.substring(12).split(` `):e.substring(10).split(` `);let n={foundation:t[0],component:{1:`rtp`,2:`rtcp`}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case`raddr`:n.relatedAddress=t[e+1];break;case`rport`:n.relatedPort=parseInt(t[e+1],10);break;case`tcptype`:n.tcpType=t[e+1];break;case`ufrag`:n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:n[t[e]]===void 0&&(n[t[e]]=t[e+1])}return n},n.writeCandidate=function(e){let t=[];t.push(e.foundation);let n=e.component;n===`rtp`?t.push(1):n===`rtcp`?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);let r=e.type;return t.push(`typ`),t.push(r),r!==`host`&&e.relatedAddress&&e.relatedPort!==void 0&&(t.push(`raddr`),t.push(e.relatedAddress),t.push(`rport`),t.push(e.relatedPort)),e.tcpType&&e.protocol.toLowerCase()===`tcp`&&(t.push(`tcptype`),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push(`ufrag`),t.push(e.usernameFragment||e.ufrag)),`candidate:`+t.join(` `)},n.parseIceOptions=function(e){return e.substring(14).split(` `)},n.parseRtpMap=function(e){let t=e.substring(9).split(` `),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split(`/`),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=t.length===3?parseInt(t[2],10):1,n.numChannels=n.channels,n},n.writeRtpMap=function(e){let t=e.payloadType;e.preferredPayloadType!==void 0&&(t=e.preferredPayloadType);let n=e.channels||e.numChannels||1;return`a=rtpmap:`+t+` `+e.name+`/`+e.clockRate+(n===1?``:`/`+n)+`\r
|
|
@@ -283,10 +283,15 @@ function materialActionDescription(mat, curSt, basketName, displayActionForSingl
|
|
|
283
283
|
else if (mat.location.type === api.LocType.InBasket) {
|
|
284
284
|
return (_jsxs(_Fragment, { children: ["In ", basketName, " ", mat.location.basketId] }));
|
|
285
285
|
}
|
|
286
|
-
else if (mat.location.type === api.LocType.OnPallet
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
else if (mat.location.type === api.LocType.OnPallet) {
|
|
287
|
+
const path = curSt.jobs[mat.jobUnique]?.procsAndPaths?.[mat.process - 1]?.paths?.[mat.path - 1];
|
|
288
|
+
if (path?.stops?.length === 0) {
|
|
289
|
+
return _jsx(_Fragment, { children: "Waiting" });
|
|
290
|
+
}
|
|
291
|
+
if (mat.lastCompletedMachiningRouteStopIndex === null ||
|
|
292
|
+
mat.lastCompletedMachiningRouteStopIndex === undefined) {
|
|
293
|
+
return _jsx(_Fragment, { children: "Waiting for machining" });
|
|
294
|
+
}
|
|
290
295
|
}
|
|
291
296
|
break;
|
|
292
297
|
case api.ActionType.Machining:
|
package/dist/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<link rel="shortcut icon" href="/assets/favicon-gWFxiJK2.ico" />
|
|
7
7
|
<title>SeedTactic FMS Insight</title>
|
|
8
8
|
<style type="text/css">.download-loader{width:100px;height:100px;display:inline-block}.download-circular{width:100px;height:100px;animation:2s linear infinite rotate}.download-path{stroke-dasharray:1 200;stroke-dashoffset:0;stroke-linecap:round;stroke:#8d6e63;animation:1.5s ease-out infinite dash}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:89 200;stroke-dashoffset:-35px}to{stroke-dasharray:89 200;stroke-dashoffset:-124px}}</style>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-BKr-hck2.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-DXfAwuj-.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|