@kosdev-code/kos-ddk-model-components 0.1.0-dev.5200 → 0.1.0-dev.5205

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.
package/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";var uo=Object.defineProperty;var mo=(t,e,n)=>e in t?uo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var M=(t,e,n)=>(mo(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@kosdev-code/kos-ui-sdk"),r=require("@emotion/react/jsx-runtime"),S=require("@emotion/styled"),l=require("@kosdev-code/kos-ddk-components"),p=require("react"),D=require("@kosdev-code/kos-ddk-models"),ye=require("@kosdev-code/kos-ddk-styles"),Dt=require("@kosdev-code/kos-dispense-sdk"),K=require("@kosdev-code/kos-freestyle-sdk"),ae=require("@kosdev-code/kos-ui-plugin"),I=require("@kosdev-code/kos-ui-plugin/utilities"),qn=require("react-router-dom");class H{constructor(e,n){M(this,"future");M(this,"intentContainer");M(this,"title");M(this,"intent");M(this,"namespace");M(this,"successMessage");M(this,"failureMessage");M(this,"actionLabel");this.intentContainer=e,this.title=n.title,this.namespace=n.namespace,this.intent=n.intent,this.successMessage=n.successMessage,this.failureMessage=n.failureMessage,this.actionLabel=n.actionLabel}get type(){return"intentContainer"}async performAction(){const e=await this.intentContainer.performIntent(this.intent);e!=null&&e.tracker&&(this.future=u.FutureManager.getFuture(e.tracker))}}class Gn extends H{constructor(e){super(e,{title:"Calibrate",intent:"CALIBRATE",successMessage:"Calibrate Complete",failureMessage:"Calibrate Failed"})}enabled(){return!0}}class Yn extends H{constructor(e){super(e,{title:"45ml Flow Test",intent:"FIXED_45",successMessage:"45ml Flow Test Complete",failureMessage:"45ml Flow Test Failed"})}enabled(){return!0}}class Jn extends H{constructor(e){super(e,{title:"Flush",intent:"FLUSH",successMessage:"Flush Complete",failureMessage:"Flush Failed"})}enabled(){return!0}}class Qn extends H{constructor(e){super(e,{title:"High Flow Test",intent:"HIGH_FLOW_TEST",successMessage:"High Flow Test Complete",failureMessage:"High Flow Test Failed"})}enabled(){return!0}}class es extends H{constructor(e){super(e,{title:"Hold to Pour",intent:"HOLD_TO_POUR",successMessage:"Pour Complete",failureMessage:"Pour Failed"})}enabled(){return!0}}class ts extends H{constructor(e){super(e,{title:"Low Flow Test",intent:"LOW_FLOW_TEST",successMessage:"Low Flow Test Complete",failureMessage:"Low Flow Test Failed"})}enabled(){return!0}}class ns extends H{constructor(e){super(e,{title:"Manual Override",intent:"SOFT_START",successMessage:"Manual Override Complete",failureMessage:"Manual Override Failed"})}enabled(){return!0}}class ss extends H{constructor(e){super(e,{title:"Reset",intent:"MSV_RESET",successMessage:"Reset Complete",failureMessage:"Reset Failed"})}enabled(){return!0}}class os extends H{constructor(e){super(e,{title:"Prime",intent:"PRIME",successMessage:"Prime Complete",failureMessage:"Prime Failed"})}enabled(){return!0}}class rs extends H{constructor(e){super(e,{title:"Purge",intent:"PURGE",successMessage:"Purge Complete",failureMessage:"Purge Failed"})}enabled(){return!0}}class as{constructor(e,n){M(this,"future");M(this,"troubleAware");M(this,"title");M(this,"troubleKey");M(this,"namespace");M(this,"successMessage");M(this,"failureMessage");M(this,"actionLabel");this.troubleAware=e,this.troubleKey=n.trouble,this.namespace=n.namespace||"troubles",this.title=n.title||`${this.namespace}:troubles.${this.troubleKey}.progress`,this.successMessage=n.successMessage||`${this.namespace}:troubles.${this.troubleKey}.success`,this.failureMessage=n.failureMessage||`${this.namespace}:troubles.${this.troubleKey}.error`,this.actionLabel=n.action||`${this.namespace}:troubles.${this.troubleKey}.action`}get type(){return"troubleAware"}async performAction(){const e=this.troubleAware.troublesByType[this.troubleKey];if(!e)return;const s=await e[0].resolve();s!=null&&s.tracker&&(this.future=u.FutureManager.getFuture(s.tracker))}}class is extends as{constructor(e,n){super(e,{trouble:n})}enabled(){return!0}}const po="PrimeTrouble",ho="PurgeTrouble",fo=S.div`
1
+ "use strict";var mo=Object.defineProperty;var po=(t,e,n)=>e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var M=(t,e,n)=>(po(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@kosdev-code/kos-ui-sdk"),r=require("@emotion/react/jsx-runtime"),S=require("@emotion/styled"),l=require("@kosdev-code/kos-ddk-components"),p=require("react"),N=require("@kosdev-code/kos-ddk-models"),be=require("@kosdev-code/kos-ddk-styles"),Dt=require("@kosdev-code/kos-dispense-sdk"),K=require("@kosdev-code/kos-freestyle-sdk"),ae=require("@kosdev-code/kos-ui-plugin"),E=require("@kosdev-code/kos-ui-plugin/utilities"),qn=require("react-router-dom");class H{constructor(e,n){M(this,"future");M(this,"intentContainer");M(this,"title");M(this,"intent");M(this,"namespace");M(this,"successMessage");M(this,"failureMessage");M(this,"actionLabel");this.intentContainer=e,this.title=n.title,this.namespace=n.namespace,this.intent=n.intent,this.successMessage=n.successMessage,this.failureMessage=n.failureMessage,this.actionLabel=n.actionLabel}get type(){return"intentContainer"}async performAction(){const e=await this.intentContainer.performIntent(this.intent);e!=null&&e.tracker&&(this.future=u.FutureManager.getFuture(e.tracker))}}class Gn extends H{constructor(e){super(e,{title:"Calibrate",intent:"CALIBRATE",successMessage:"Calibrate Complete",failureMessage:"Calibrate Failed"})}enabled(){return!0}}class Yn extends H{constructor(e){super(e,{title:"45ml Flow Test",intent:"FIXED_45",successMessage:"45ml Flow Test Complete",failureMessage:"45ml Flow Test Failed"})}enabled(){return!0}}class Jn extends H{constructor(e){super(e,{title:"Flush",intent:"FLUSH",successMessage:"Flush Complete",failureMessage:"Flush Failed"})}enabled(){return!0}}class Qn extends H{constructor(e){super(e,{title:"High Flow Test",intent:"HIGH_FLOW_TEST",successMessage:"High Flow Test Complete",failureMessage:"High Flow Test Failed"})}enabled(){return!0}}class es extends H{constructor(e){super(e,{title:"Hold to Pour",intent:"HOLD_TO_POUR",successMessage:"Pour Complete",failureMessage:"Pour Failed"})}enabled(){return!0}}class ts extends H{constructor(e){super(e,{title:"Low Flow Test",intent:"LOW_FLOW_TEST",successMessage:"Low Flow Test Complete",failureMessage:"Low Flow Test Failed"})}enabled(){return!0}}class ns extends H{constructor(e){super(e,{title:"Manual Override",intent:"SOFT_START",successMessage:"Manual Override Complete",failureMessage:"Manual Override Failed"})}enabled(){return!0}}class ss extends H{constructor(e){super(e,{title:"Reset",intent:"MSV_RESET",successMessage:"Reset Complete",failureMessage:"Reset Failed"})}enabled(){return!0}}class os extends H{constructor(e){super(e,{title:"Prime",intent:"PRIME",successMessage:"Prime Complete",failureMessage:"Prime Failed"})}enabled(){return!0}}class rs extends H{constructor(e){super(e,{title:"Purge",intent:"PURGE",successMessage:"Purge Complete",failureMessage:"Purge Failed"})}enabled(){return!0}}class as{constructor(e,n){M(this,"future");M(this,"troubleAware");M(this,"title");M(this,"troubleKey");M(this,"namespace");M(this,"successMessage");M(this,"failureMessage");M(this,"actionLabel");this.troubleAware=e,this.troubleKey=n.trouble,this.namespace=n.namespace||"troubles",this.title=n.title||`${this.namespace}:troubles.${this.troubleKey}.progress`,this.successMessage=n.successMessage||`${this.namespace}:troubles.${this.troubleKey}.success`,this.failureMessage=n.failureMessage||`${this.namespace}:troubles.${this.troubleKey}.error`,this.actionLabel=n.action||`${this.namespace}:troubles.${this.troubleKey}.action`}get type(){return"troubleAware"}async performAction(){const e=this.troubleAware.troublesByType[this.troubleKey];if(!e)return;const s=await e[0].resolve();s!=null&&s.tracker&&(this.future=u.FutureManager.getFuture(s.tracker))}}class is extends as{constructor(e,n){super(e,{trouble:n})}enabled(){return!0}}const ho="PrimeTrouble",fo="PurgeTrouble",go=S.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  overflow-y: auto;
5
5
  overflow-x: hidden;
6
6
  gap: 32px;
7
7
  height: 100%;
8
- `,cs=u.kosComponent(({holder:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=u.useKosTranslation("common"),{componentModeOverride:a}=l.useComponentConfigurationContext(),c=t.data.agitated;return r.jsx(l.Modal,{contain:a!=="compact",onClosed:e,show:!n,children:r.jsxs(fo,{children:[r.jsx(l.Header,{contain:a==="compact",showCloseButton:!0,title:o("shelf-agitator"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:a==="compact"?l.BackButton:void 0}),r.jsx(l.Content,{align:"top",children:r.jsx(l.InfoCard,{label:o("agitating"),padding:"x-large",value:o(c?"no":"yes")})}),r.jsx(l.Footer,{children:r.jsx(l.Button,{mode:"primary",disabled:c,onPointerDown:()=>console.log("agitate!"),children:o("test-shelf-agitator")})})]})})}),Ot=()=>{const t=D.AgitationControl.type;return u.useKosModel({modelId:t,modelType:D.AgitationControl.type,options:{}})},G=t=>{var c,i;const[e,n]=p.useState(t==null?void 0:t.futureHandler.future),[s,o]=p.useState((i=(c=t==null?void 0:t.futureHandler)==null?void 0:c.future)==null?void 0:i.endState);p.useEffect(()=>{const d=u.kosAutoEffect(()=>{const m=t==null?void 0:t.futureHandler.future;n(m),o(m==null?void 0:m.endState)});return()=>{d(),t==null||t.futureHandler.removeFuture()}},[t==null?void 0:t.futureHandler]);const a=p.useCallback(()=>{t==null||t.futureHandler.removeFuture()},[t==null?void 0:t.futureHandler]);return{future:e,clearFuture:a,success:s===u.FutureEndState.Success,failure:s&&s!==u.FutureEndState.Success}},go=u.KosLog.createLogger({name:"future-progress-bar"}),ls=S(l.CloseButton)`
8
+ `,cs=u.kosComponent(({holder:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=u.useKosTranslation("common"),{componentModeOverride:a}=l.useComponentConfigurationContext(),c=t.data.agitated;return r.jsx(l.Modal,{contain:a!=="compact",onClosed:e,show:!n,children:r.jsxs(go,{children:[r.jsx(l.Header,{contain:a==="compact",showCloseButton:!0,title:o("shelf-agitator"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:a==="compact"?l.BackButton:void 0}),r.jsx(l.Content,{align:"top",children:r.jsx(l.InfoCard,{label:o("agitating"),padding:"x-large",value:o(c?"no":"yes")})}),r.jsx(l.Footer,{children:r.jsx(l.Button,{mode:"primary",disabled:c,onPointerDown:()=>console.log("agitate!"),children:o("test-shelf-agitator")})})]})})}),Ot=()=>{const t=N.AgitationControl.type;return u.useKosModel({modelId:t,modelType:N.AgitationControl.type,options:{}})},G=t=>{var c,i;const[e,n]=p.useState(t==null?void 0:t.futureHandler.future),[s,o]=p.useState((i=(c=t==null?void 0:t.futureHandler)==null?void 0:c.future)==null?void 0:i.endState);p.useEffect(()=>{const d=u.kosAutoEffect(()=>{const m=t==null?void 0:t.futureHandler.future;n(m),o(m==null?void 0:m.endState)});return()=>{d(),t==null||t.futureHandler.removeFuture()}},[t==null?void 0:t.futureHandler]);const a=p.useCallback(()=>{t==null||t.futureHandler.removeFuture()},[t==null?void 0:t.futureHandler]);return{future:e,clearFuture:a,success:s===u.FutureEndState.Success,failure:s&&s!==u.FutureEndState.Success}},xo=u.KosLog.createLogger({name:"future-progress-bar"}),ls=S(l.CloseButton)`
9
9
  --ddk-component-icon-button-icon-color-active: var(
10
10
  --ddk-component-progress-bar-close-button-color-active
11
11
  );
@@ -18,7 +18,7 @@
18
18
  --ddk-component-icon-button-icon-color-hover: var(
19
19
  --ddk-component-progress-bar-close-button-color-hover
20
20
  );
21
- `,xo=S.div`
21
+ `,vo=S.div`
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  width: 100%;
@@ -35,11 +35,11 @@
35
35
  display: flex;
36
36
  gap: var(--ddk-component-status-bar-gap);
37
37
  align-items: center;
38
- `,vo=S.div`
38
+ `,yo=S.div`
39
39
  border-top: solid 1px #888888;
40
40
  padding-top: 8px;
41
41
  width: calc(100% - 10px);
42
- `,Ee=({children:t,onPointerDown:e,title:n,subtitle:s})=>{const{componentModeOverride:o}=l.useComponentConfigurationContext(),{t:a}=u.useKosTranslation("common"),c=n??t;return r.jsxs(ds,{children:[r.jsxs(xo,{children:[r.jsxs(us,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[r.jsx(ye.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),c]}),s&&r.jsx(vo,{children:s})]}),o==="compact"?r.jsx(l.Button,{mode:"primary",onPointerDown:e,children:a("close","Close")}):r.jsx(ls,{label:!1,size:"large",onPointerDown:e})]})},et=({children:t,onPointerDown:e})=>{const{componentModeOverride:n}=l.useComponentConfigurationContext(),{t:s}=u.useKosTranslation("common");return r.jsxs(ds,{children:[r.jsxs(us,{children:[r.jsx(ye.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),t]}),n==="compact"?r.jsx(l.Button,{mode:"primary",onPointerDown:e,children:s("close","Close")}):r.jsx(ls,{label:!1,size:"large",onPointerDown:e})]})},bn=t=>(t==null?void 0:t.title)&&(t==null?void 0:t.subtitle),V=u.kosComponent(({title:t,future:e,failureMessage:n,successMessage:s,cancelMessage:o,isCancelable:a=!0,onSuccess:c,onClose:i})=>{const{t:d}=u.useKosTranslation("common"),[m,f]=p.useState(!0),[h,g]=p.useState(),y=`${e==null?void 0:e.timeRemaining} ${d("remaining","remaining")}`,b=p.useCallback(()=>{h!=="in-progress"&&(i==null||i(),f(!1))},[i,h]),v=p.useCallback(()=>{b(),c==null||c()},[b,c]);p.useEffect(()=>{(e==null?void 0:e.status)==="IN_PROGRESS"||(e==null?void 0:e.status)==="NOT_ACTIVE"?(g("in-progress"),f(!0)):(e==null?void 0:e.status)==="SUCCESS"?(g("success"),f(!!s),s||(b(),c==null||c())):(e==null?void 0:e.status)==="FAIL"||(e==null?void 0:e.status)==="ABORT"?(g("failure"),f(!!n)):(e==null?void 0:e.status)==="CANCEL"?(g("cancelled"),f(!!o)):e&&go.error("unknown status",e==null?void 0:e.status)},[n,e,e==null?void 0:e.status,s,o,b,c]);const w=bn(n)?n.subtitle:void 0,P=bn(n)?n.title:n??d("something-went-wrong","Something went wrong");return e&&r.jsx(l.ProgressBar,{isCancelable:a,onCancel:()=>{e.cancelFuture()},blocked:h==="in-progress",onClose:b,renderFailure:n&&r.jsx(Ee,{subtitle:w,onPointerDown:b,children:P}),renderCancel:o&&r.jsx(Ee,{onPointerDown:b,children:o}),renderSuccess:s&&r.jsx(et,{onPointerDown:v,children:s}),show:m,status:h,subtitle:y,title:t,value:e.progress})}),yo=u.KosLog.createLogger({name:"agitation-control-view"});yo.debug("agitation-control-view component loaded");const bo=S.div``,Co=u.kosComponent(()=>{const{model:t}=Ot(),{t:e,i18n:n}=u.useKosTranslation("troubles"),{future:s,failure:o}=G(t),a=p.useCallback(()=>{t&&t.clearAll()},[t]),c=s==null?void 0:s.reason,i=c?`__troubles.errors.${c}__`:void 0,d="troubles.agitation.error",m=n.exists(`troubles.errors.${c}`);return r.jsx(bo,{children:r.jsx(V,{title:e("troubles.agitation.title"),future:s,isCancelable:!0,onClose:a,failureMessage:e(d,{context:i&&m?"reason":void 0,data:{reason:i}})})})}),ms=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,o]=p.useState("high-flow-test-idle"),[a,c]=p.useState(),[i,d]=p.useState(),[m,f]=p.useState(),{future:h}=G(t);p.useEffect(()=>{switch(h==null?void 0:h.endState){case"CANCEL":switch(s){case"high-flow-test-in-progress":o("high-flow-test-idle");break;default:c("calibration-canceled"),o("failure")}break;case"SUCCESS":switch(s){case"high-flow-test-in-progress":o("high-flow-test-success");break;case"calibration-in-progress":o("calibration-input");break;case"verification-in-progress":o("verification-input");break}break;case"FAIL":c(h==null?void 0:h.reason),o("failure");break}},[h==null?void 0:h.endState,h==null?void 0:h.reason,s]);const g=p.useMemo(()=>({"high-flow-test-idle":{information:r.jsx(l.LabelInformation,{children:n("high-flow-test-idle-information")}),footer:r.jsx(l.Button,{onPointerDown:()=>{t.performPreCalibrate(),o("high-flow-test-in-progress")},children:n("initiate-high-flow-test")}),status:"information"},"high-flow-test-in-progress":{information:r.jsx(l.LabelInformation,{children:n("high-flow-test-in-progress-information")}),footer:r.jsx(l.Button,{disabled:!0,children:n("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:r.jsx(l.LabelInformation,{children:n("high-flow-test-success-information")}),footer:r.jsx(l.Button,{onPointerDown:()=>o("calibration-idle"),children:n("proceed")}),status:"success"},"calibration-idle":{information:r.jsx(l.BodyMediumInformation,{children:n("calibration-idle-information")}),footer:r.jsx(l.Button,{onPointerDown:()=>{t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:r.jsx(l.LabelInformation,{children:n("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.BodyMediumInformation,{children:n("calibration-input-information")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&d(y)},value:i!==void 0?i:""})]}),footer:r.jsx(l.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:r.jsx(l.BodyMediumInformation,{children:n("verification-idle-information")}),footer:r.jsx(l.Button,{onPointerDown:async()=>{i!==void 0&&(t.performVerify(i),o("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:r.jsx(l.LabelInformation,{children:n("verification-in-progress-information")}),status:"loading"},"verification-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.BodyMediumInformation,{children:n("verification-input-information")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&f(y)},value:m!==void 0?m:""})]}),footer:r.jsx(l.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;const y=await t.performComplete(i,m);y==="success"?o("verification-success"):(c(y),o(y==="errBadPump"?"verification-failure":"failure"))},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:r.jsx(l.LabelInformation,{children:n("verification-success-information")}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:r.jsx(l.LabelInformation,{children:n(`error.${a}`)}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("calibration-failed")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a||"unknownError"}`)})]}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[a,e,t,n,i,m]);return r.jsxs(r.Fragment,{children:[r.jsx(l.WorkflowModal,{title:n(t.name),...g[s],onClose:()=>e()}),h&&r.jsx(V,{title:n("initiating"),future:h})]})}),Lt=u.kosComponent(({probeAware:t})=>{if(!t)return null;const e=t.highProbeWet.value,n=t.lowProbeWet.value,s=t.filling.value;return r.jsxs(wo,{children:[r.jsxs(Ct,{children:[r.jsx(wt,{children:"High Probe"}),r.jsx(_t,{children:e?"Wet":"Dry"})]}),r.jsxs(Ct,{children:[r.jsx(wt,{children:"Low Probe"}),r.jsx(_t,{children:n?"Wet":"Dry"})]}),r.jsxs(Ct,{children:[r.jsx(wt,{children:"Filling"}),r.jsx(_t,{children:s?"Yes":"No"})]})]})}),wo=S.div`
42
+ `,Ee=({children:t,onPointerDown:e,title:n,subtitle:s})=>{const{componentModeOverride:o}=l.useComponentConfigurationContext(),{t:a}=u.useKosTranslation("common"),c=n??t;return r.jsxs(ds,{children:[r.jsxs(vo,{children:[r.jsxs(us,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[r.jsx(be.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),c]}),s&&r.jsx(yo,{children:s})]}),o==="compact"?r.jsx(l.Button,{mode:"primary",onPointerDown:e,children:a("close","Close")}):r.jsx(ls,{label:!1,size:"large",onPointerDown:e})]})},et=({children:t,onPointerDown:e})=>{const{componentModeOverride:n}=l.useComponentConfigurationContext(),{t:s}=u.useKosTranslation("common");return r.jsxs(ds,{children:[r.jsxs(us,{children:[r.jsx(be.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),t]}),n==="compact"?r.jsx(l.Button,{mode:"primary",onPointerDown:e,children:s("close","Close")}):r.jsx(ls,{label:!1,size:"large",onPointerDown:e})]})},bn=t=>(t==null?void 0:t.title)&&(t==null?void 0:t.subtitle),B=u.kosComponent(({title:t,future:e,failureMessage:n,successMessage:s,cancelMessage:o,isCancelable:a=!0,onSuccess:c,onClose:i})=>{const{t:d}=u.useKosTranslation("common"),[m,f]=p.useState(!0),[h,g]=p.useState(),y=`${e==null?void 0:e.timeRemaining} ${d("remaining","remaining")}`,b=p.useCallback(()=>{h!=="in-progress"&&(i==null||i(),f(!1))},[i,h]),v=p.useCallback(()=>{b(),c==null||c()},[b,c]);p.useEffect(()=>{(e==null?void 0:e.status)==="IN_PROGRESS"||(e==null?void 0:e.status)==="NOT_ACTIVE"?(g("in-progress"),f(!0)):(e==null?void 0:e.status)==="SUCCESS"?(g("success"),f(!!s),s||(b(),c==null||c())):(e==null?void 0:e.status)==="FAIL"||(e==null?void 0:e.status)==="ABORT"?(g("failure"),f(!!n)):(e==null?void 0:e.status)==="CANCEL"?(g("cancelled"),f(!!o)):e&&xo.error("unknown status",e==null?void 0:e.status)},[n,e,e==null?void 0:e.status,s,o,b,c]);const _=bn(n)?n.subtitle:void 0,O=bn(n)?n.title:n??d("something-went-wrong","Something went wrong");return e&&r.jsx(l.ProgressBar,{isCancelable:a,onCancel:()=>{e.cancelFuture()},blocked:h==="in-progress",onClose:b,renderFailure:n&&r.jsx(Ee,{subtitle:_,onPointerDown:b,children:O}),renderCancel:o&&r.jsx(Ee,{onPointerDown:b,children:o}),renderSuccess:s&&r.jsx(et,{onPointerDown:v,children:s}),show:m,status:h,subtitle:y,title:t,value:e.progress})}),bo=u.KosLog.createLogger({name:"agitation-control-view"});bo.debug("agitation-control-view component loaded");const Co=S.div``,wo=u.kosComponent(()=>{const{model:t}=Ot(),{t:e,i18n:n}=u.useKosTranslation("troubles"),{future:s,failure:o}=G(t),a=p.useCallback(()=>{t&&t.clearAll()},[t]),c=s==null?void 0:s.reason,i=c?`__troubles.errors.${c}__`:void 0,d="troubles.agitation.error",m=n.exists(`troubles.errors.${c}`);return r.jsx(Co,{children:r.jsx(B,{title:e("troubles.agitation.title"),future:s,isCancelable:!0,onClose:a,failureMessage:e(d,{context:i&&m?"reason":void 0,data:{reason:i}})})})}),ms=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,o]=p.useState("high-flow-test-idle"),[a,c]=p.useState(),[i,d]=p.useState(),[m,f]=p.useState(),{future:h}=G(t);p.useEffect(()=>{switch(h==null?void 0:h.endState){case"CANCEL":switch(s){case"high-flow-test-in-progress":o("high-flow-test-idle");break;default:c("calibration-canceled"),o("failure")}break;case"SUCCESS":switch(s){case"high-flow-test-in-progress":o("high-flow-test-success");break;case"calibration-in-progress":o("calibration-input");break;case"verification-in-progress":o("verification-input");break}break;case"FAIL":c(h==null?void 0:h.reason),o("failure");break}},[h==null?void 0:h.endState,h==null?void 0:h.reason,s]);const g=p.useMemo(()=>({"high-flow-test-idle":{information:r.jsx(l.LabelInformation,{children:n("high-flow-test-idle-information")}),footer:r.jsx(l.Button,{onPointerDown:()=>{t.performPreCalibrate(),o("high-flow-test-in-progress")},children:n("initiate-high-flow-test")}),status:"information"},"high-flow-test-in-progress":{information:r.jsx(l.LabelInformation,{children:n("high-flow-test-in-progress-information")}),footer:r.jsx(l.Button,{disabled:!0,children:n("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:r.jsx(l.LabelInformation,{children:n("high-flow-test-success-information")}),footer:r.jsx(l.Button,{onPointerDown:()=>o("calibration-idle"),children:n("proceed")}),status:"success"},"calibration-idle":{information:r.jsx(l.BodyMediumInformation,{children:n("calibration-idle-information")}),footer:r.jsx(l.Button,{onPointerDown:()=>{t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:r.jsx(l.LabelInformation,{children:n("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.BodyMediumInformation,{children:n("calibration-input-information")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&d(y)},value:i!==void 0?i:""})]}),footer:r.jsx(l.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:r.jsx(l.BodyMediumInformation,{children:n("verification-idle-information")}),footer:r.jsx(l.Button,{onPointerDown:async()=>{i!==void 0&&(t.performVerify(i),o("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:r.jsx(l.LabelInformation,{children:n("verification-in-progress-information")}),status:"loading"},"verification-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.BodyMediumInformation,{children:n("verification-input-information")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&f(y)},value:m!==void 0?m:""})]}),footer:r.jsx(l.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;const y=await t.performComplete(i,m);y==="success"?o("verification-success"):(c(y),o(y==="errBadPump"?"verification-failure":"failure"))},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:r.jsx(l.LabelInformation,{children:n("verification-success-information")}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:r.jsx(l.LabelInformation,{children:n(`error.${a}`)}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("calibration-failed")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a||"unknownError"}`)})]}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[a,e,t,n,i,m]);return r.jsxs(r.Fragment,{children:[r.jsx(l.WorkflowModal,{title:n(t.name),...g[s],onClose:()=>e()}),h&&r.jsx(B,{title:n("initiating"),future:h})]})}),Lt=u.kosComponent(({probeAware:t})=>{if(!t)return null;const e=t.highProbeWet.value,n=t.lowProbeWet.value,s=t.filling.value;return r.jsxs(_o,{children:[r.jsxs(Ct,{children:[r.jsx(wt,{children:"High Probe"}),r.jsx(_t,{children:e?"Wet":"Dry"})]}),r.jsxs(Ct,{children:[r.jsx(wt,{children:"Low Probe"}),r.jsx(_t,{children:n?"Wet":"Dry"})]}),r.jsxs(Ct,{children:[r.jsx(wt,{children:"Filling"}),r.jsx(_t,{children:s?"Yes":"No"})]})]})}),_o=S.div`
43
43
  display: grid;
44
44
  grid-template-columns: repeat(3, 1fr);
45
45
  gap: 16px;
@@ -61,13 +61,13 @@
61
61
  color: var(--ddk-generic-color-grey-90);
62
62
  text-align: center;
63
63
  font-size: var(--ddk-generic-font-size-large);
64
- `,_o=u.kosComponent(({cardModel:t})=>{u.KosLog.debug("Agitator",t.path);const{t:e}=u.useKosTranslation("carb-tank",{keyPrefix:"dashboard.detail"}),{future:n}=G(t),s=p.useCallback(o=>{o==="agitate"?t==null||t.handleTestCarbTank():o==="activate"&&(t==null||t.toggleCarbTank())},[t]);return r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{children:r.jsx(Lt,{probeAware:t})}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{onPointerDown:()=>s("agitate"),disabled:!t.isCarbInitialized,children:e("action.test")}),r.jsx(l.Button,{onPointerDown:()=>s("activate"),children:e("action.activate",{context:t.isCarbInitialized?"enabled":"disabled"})})]}),n&&r.jsx(V,{title:e("testing"),future:n})]})}),ko=S.div`
64
+ `,ko=u.kosComponent(({cardModel:t})=>{u.KosLog.debug("Agitator",t.path);const{t:e}=u.useKosTranslation("carb-tank",{keyPrefix:"dashboard.detail"}),{future:n}=G(t),s=p.useCallback(o=>{o==="agitate"?t==null||t.handleTestCarbTank():o==="activate"&&(t==null||t.toggleCarbTank())},[t]);return r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{children:r.jsx(Lt,{probeAware:t})}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{onPointerDown:()=>s("agitate"),disabled:!t.isCarbInitialized,children:e("action.test")}),r.jsx(l.Button,{onPointerDown:()=>s("activate"),children:e("action.activate",{context:t.isCarbInitialized?"enabled":"disabled"})})]}),n&&r.jsx(B,{title:e("testing"),future:n})]})}),So=S.div`
65
65
  font-size: var(--ddk-component-holder-card-footer-font-size);
66
66
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
67
- `,So=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=u.useKosTranslation("common");return r.jsxs(r.Fragment,{children:[r.jsx(l.StatusIndicator,{size:"small",status:t.cardModel.isCarbInitialized?"completed":"incomplete"}),t.cardModel.isFilling&&r.jsx(ko,{children:e("agitating")})]})}),To=u.kosComponent(({cardModel:t})=>{u.KosLog.debug("Agitator",t.path);const{t:e}=u.useKosTranslation(["agitator","common"]),{future:n}=G(t),s=p.useCallback(o=>{o==="agitate"&&(t==null||t.testAgitate())},[t]);return r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{children:r.jsx(l.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")})}),r.jsx(l.Footer,{children:r.jsx(l.Button,{onPointerDown:()=>s("agitate"),children:e("action.label",{context:"agitator"})})}),n&&r.jsx(V,{title:e("testing"),future:n})]})}),jo=S.div`
67
+ `,To=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=u.useKosTranslation("common");return r.jsxs(r.Fragment,{children:[r.jsx(l.StatusIndicator,{size:"small",status:t.cardModel.isCarbInitialized?"completed":"incomplete"}),t.cardModel.isFilling&&r.jsx(So,{children:e("agitating")})]})}),jo=u.kosComponent(({cardModel:t})=>{u.KosLog.debug("Agitator",t.path);const{t:e}=u.useKosTranslation(["agitator","common"]),{future:n}=G(t),s=p.useCallback(o=>{o==="agitate"&&(t==null||t.testAgitate())},[t]);return r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{children:r.jsx(l.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")})}),r.jsx(l.Footer,{children:r.jsx(l.Button,{onPointerDown:()=>s("agitate"),children:e("action.label",{context:"agitator"})})}),n&&r.jsx(B,{title:e("testing"),future:n})]})}),Io=S.div`
68
68
  font-size: var(--ddk-component-holder-card-footer-font-size);
69
69
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
70
- `,Io=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=u.useKosTranslation("common");return r.jsxs(r.Fragment,{children:[r.jsx(l.StatusIndicator,{size:"small",status:"completed"}),t.cardModel.isAgitating&&r.jsx(jo,{children:e("agitating")})]})}),Eo={getStagedChange:void 0,updateStagedChange:void 0,saveChanges:void 0,clearStagedChanges:void 0},ps=p.createContext(Eo),hs=({children:t})=>{const[e,n]=p.useState({}),s=i=>e[i],o=(i,d)=>{n(m=>({...m,[i]:d}))},a=()=>n({}),c=async()=>{for(const i in e)e[i].configProperty.updateProperty(e[i].value);a()};return r.jsx(ps.Provider,{value:{getStagedChange:s,updateStagedChange:o,saveChanges:c,clearStagedChanges:a},children:t})},Rt=()=>p.useContext(ps),Po=t=>e=>r.jsx(hs,{children:r.jsx(t,{...e})}),fs=({label:t,configProperty:e})=>{const{value:n}=u.useConfigProperty({configProperty:e});return r.jsx(l.InfoCard,{label:t,value:n})},tt=({configProperty:t,hideUnits:e,isValid:n,...s})=>{var f,h;const{t:o}=u.useKosTranslation("common",{keyPrefix:"validation"}),{significantValue:a}=u.useConfigProperty({configProperty:t}),c=g=>{g||(g=""),t.updateProperty(g)},i=(f=t.displayOptions)==null?void 0:f.max,d=(h=t.displayOptions)==null?void 0:h.min,m=p.useCallback(g=>{const y=n==null?void 0:n(g);return y||(Number(g)<d?o("minValue",{data:{minValue:d}}):Number(g)>i?o("maxValue",{data:{maxValue:i}}):void 0)},[n,i,d,o]);return r.jsx(l.InputCard,{...s,isValid:m,onChange:c,unitValue:e?void 0:t.unit,value:a})},he=({configProperty:t,label:e,onChange:n,...s})=>{var c,i;const{t:o}=u.useKosTranslation(["config-properties","common"]),a=u.useConfigProperty({configProperty:t});return r.jsx(l.InputRangeCard,{...s,label:e??o(t.id),layout:"num",maxValue:(c=a.displayOptions)==null?void 0:c.max,minValue:(i=a.displayOptions)==null?void 0:i.min,onChange:d=>t.updateProperty(d),unitValue:a.unit,value:a.significantValue})},Pe=({configProperty:t,overrideChecked:e,...n})=>{var d;const{getStagedChange:s,updateStagedChange:o}=Rt(),{value:a}=u.useConfigProperty({configProperty:t}),c=((d=s==null?void 0:s(t.id))==null?void 0:d.value)??a,i=m=>{o?o(t.id,{configProperty:t,value:m}):t.updateProperty(m)};return r.jsx(l.ToggleCard,{toggleLabel:c==="true"?"Enabled":"Disabled",...n,onChange:i,checked:e!==void 0?e:c==="true"})},Ao=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],nt=({collapse:t,cancelButtonLabel:e,configProperty:n,displayMode:s="raw",displayValue:o,float:a,items:c,label:i,onChange:d,onSave:m,proceedButtonLabel:f,selectedItemId:h,unitValue:g,...y})=>{const{t:b}=u.useKosTranslation(["config-properties","common"]),v=u.useConfigProperty({configProperty:n,optionsTransformer:Ao});return r.jsx(l.PickerCard,{...y,cancelButtonLabel:e??(b("discard-changes",{defaultValue:"Discard Changes",ns:"common"})||void 0),collapse:t,displayValue:o??s==="raw"?v.value:v.displayValue,float:a,items:c??v.mappedOptions,label:i??b(n.id),onSave:w=>m?m(w):n.updateProperty(w),proceedButtonLabel:f??(b("save",{defaultValue:"Save",ns:"common"})||void 0),selectedItemId:h??v.value,unitValue:g??v.unit})},No=S(tt)`
70
+ `,Eo=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=u.useKosTranslation("common");return r.jsxs(r.Fragment,{children:[r.jsx(l.StatusIndicator,{size:"small",status:"completed"}),t.cardModel.isAgitating&&r.jsx(Io,{children:e("agitating")})]})}),Po={getStagedChange:void 0,updateStagedChange:void 0,saveChanges:void 0,clearStagedChanges:void 0},ps=p.createContext(Po),hs=({children:t})=>{const[e,n]=p.useState({}),s=i=>e[i],o=(i,d)=>{n(m=>({...m,[i]:d}))},a=()=>n({}),c=async()=>{for(const i in e)e[i].configProperty.updateProperty(e[i].value);a()};return r.jsx(ps.Provider,{value:{getStagedChange:s,updateStagedChange:o,saveChanges:c,clearStagedChanges:a},children:t})},Rt=()=>p.useContext(ps),Ao=t=>e=>r.jsx(hs,{children:r.jsx(t,{...e})}),fs=({label:t,configProperty:e})=>{const{value:n}=u.useConfigProperty({configProperty:e});return r.jsx(l.InfoCard,{label:t,value:n})},tt=({configProperty:t,hideUnits:e,isValid:n,...s})=>{var f,h;const{t:o}=u.useKosTranslation("common",{keyPrefix:"validation"}),{significantValue:a}=u.useConfigProperty({configProperty:t}),c=g=>{g||(g=""),t.updateProperty(g)},i=(f=t.displayOptions)==null?void 0:f.max,d=(h=t.displayOptions)==null?void 0:h.min,m=p.useCallback(g=>{const y=n==null?void 0:n(g);return y||(Number(g)<d?o("minValue",{data:{minValue:d}}):Number(g)>i?o("maxValue",{data:{maxValue:i}}):void 0)},[n,i,d,o]);return r.jsx(l.InputCard,{...s,isValid:m,onChange:c,unitValue:e?void 0:t.unit,value:a})},fe=({configProperty:t,label:e,onChange:n,...s})=>{var c,i;const{t:o}=u.useKosTranslation(["config-properties","common"]),a=u.useConfigProperty({configProperty:t});return r.jsx(l.InputRangeCard,{...s,label:e??o(t.id),layout:"num",maxValue:(c=a.displayOptions)==null?void 0:c.max,minValue:(i=a.displayOptions)==null?void 0:i.min,onChange:d=>t.updateProperty(d),unitValue:a.unit,value:a.significantValue})},Pe=({configProperty:t,overrideChecked:e,...n})=>{var d;const{getStagedChange:s,updateStagedChange:o}=Rt(),{value:a}=u.useConfigProperty({configProperty:t}),c=((d=s==null?void 0:s(t.id))==null?void 0:d.value)??a,i=m=>{o?o(t.id,{configProperty:t,value:m}):t.updateProperty(m)};return r.jsx(l.ToggleCard,{toggleLabel:c==="true"?"Enabled":"Disabled",...n,onChange:i,checked:e!==void 0?e:c==="true"})},No=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],nt=({collapse:t,cancelButtonLabel:e,configProperty:n,displayMode:s="raw",displayValue:o,float:a,items:c,label:i,onChange:d,onSave:m,proceedButtonLabel:f,selectedItemId:h,unitValue:g,...y})=>{const{t:b}=u.useKosTranslation(["config-properties","common"]),v=u.useConfigProperty({configProperty:n,optionsTransformer:No});return r.jsx(l.PickerCard,{...y,cancelButtonLabel:e??(b("discard-changes",{defaultValue:"Discard Changes",ns:"common"})||void 0),collapse:t,displayValue:o??s==="raw"?v.value:v.displayValue,float:a,items:c??v.mappedOptions,label:i??b(n.id),onSave:_=>m?m(_):n.updateProperty(_),proceedButtonLabel:f??(b("save",{defaultValue:"Save",ns:"common"})||void 0),selectedItemId:h??v.value,unitValue:g??v.unit})},Do=S(tt)`
71
71
  border-top: var(--ddk-component-input-enable-card-input-container-border);
72
72
  border-radius: 0;
73
73
  cursor: pointer;
@@ -103,7 +103,7 @@
103
103
  --ddk-component-input-enable-card-input-font-weight
104
104
  );
105
105
  }
106
- `,Do=S(nt)`
106
+ `,Oo=S(nt)`
107
107
  border-top: var(--ddk-component-input-enable-card-input-container-border);
108
108
  border-radius: 0;
109
109
  cursor: pointer;
@@ -140,14 +140,14 @@
140
140
  --ddk-component-input-enable-card-input-font-weight
141
141
  );
142
142
  }
143
- `,Oo=(t,e,n,s,o)=>{let a;const c=o==="compact"?No:tt,i=o==="compact"?Do:nt,d=s.label??n(t.id);switch(t.schemaType){case"boolean":a=r.jsx(Pe,{configProperty:t,...s,label:d});break;case"double":a=r.jsx(he,{configProperty:t,...s,label:d});break;case"int":a=r.jsx(he,{configProperty:t,...s,label:d});break;case"String":a=r.jsx(c,{configProperty:t,...s,label:d});break;case"enum":a=r.jsx(i,{configProperty:t,...s,label:d});break}return a},Lo=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],gs=({configProperty:t,factory:e,mappedOptions:n,t:s,...o})=>{const{t:a}=u.useKosTranslation(["config-properties","common"]),{componentModeOverride:c}=l.useComponentConfigurationContext(),i=u.useConfigProperty({configProperty:t,optionsTransformer:Lo});return e=e??Oo,e(t,{...i,mappedOptions:n??i.mappedOptions},s??a,o,c)},Ro=S(l.Card)`
143
+ `,Lo=(t,e,n,s,o)=>{let a;const c=o==="compact"?Do:tt,i=o==="compact"?Oo:nt,d=s.label??n(t.id);switch(t.schemaType){case"boolean":a=r.jsx(Pe,{configProperty:t,...s,label:d});break;case"double":a=r.jsx(fe,{configProperty:t,...s,label:d});break;case"int":a=r.jsx(fe,{configProperty:t,...s,label:d});break;case"String":a=r.jsx(c,{configProperty:t,...s,label:d});break;case"enum":a=r.jsx(i,{configProperty:t,...s,label:d});break}return a},Ro=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],gs=({configProperty:t,factory:e,mappedOptions:n,t:s,...o})=>{const{t:a}=u.useKosTranslation(["config-properties","common"]),{componentModeOverride:c}=l.useComponentConfigurationContext(),i=u.useConfigProperty({configProperty:t,optionsTransformer:Ro});return e=e??Lo,e(t,{...i,mappedOptions:n??i.mappedOptions},s??a,o,c)},Fo=S(l.Card)`
144
144
  align-items: ${t=>t.mode==="compact"?"flex-start":void 0};
145
145
  flex-direction: var(
146
146
  --ddk-component-input-enable-card-container-flex-direction
147
147
  );
148
148
  padding: var(--ddk-component-input-enable-card-container-padding);
149
149
  gap: var(--ddk-component-input-enable-card-container-gap);
150
- `,Fo=S.div`
150
+ `,Mo=S.div`
151
151
  box-sizing: border-box;
152
152
  display: flex;
153
153
  flex-direction: var(
@@ -155,27 +155,27 @@
155
155
  );
156
156
  gap: var(--ddk-component-input-enable-card-input-container-gap);
157
157
  width: 100%;
158
- `,Mo=S(gs)`
158
+ `,Vo=S(gs)`
159
159
  width: 100%;
160
160
  `,Bo=S.div`
161
161
  box-sizing: border-box;
162
162
  padding: ${t=>t.compact?"var(--ddk-component-input-enable-card-toggle-container-padding)":"0"};
163
163
  width: var(--ddk-component-input-enable-card-toggle-container-width);
164
- `,xs=({configProperties:t,disabled:e,enabledConfigProperty:n})=>{const{value:s}=u.useConfigProperty({configProperty:n}),o=s==="true",{componentModeOverride:a}=l.useComponentConfigurationContext(),c=t.length===1,i=c?Mo:gs;return r.jsxs(Ro,{disabled:!o||e,mode:a,children:[r.jsx(Fo,{children:t.map(d=>r.jsx(i,{disabled:!o||e,label:d.options?d.options.label:void 0,configProperty:d.configProperty,collapse:!c&&a==="standard",layout:d.options?d.options.layout:void 0,float:!0,hideUnits:d.options?d.options.hideUnits:void 0},d.configProperty.id))}),r.jsx(Bo,{compact:!c||a==="compact",children:r.jsx(Pe,{alwaysShowLabel:!0,collapse:!0,configProperty:n,disabled:e,stretch:a==="compact"})})]})},Vo=({configProperty:t,disabled:e,enabledConfigProperty:n,options:s})=>{const o=p.useMemo(()=>[{configProperty:t,options:s}],[t,s]);return r.jsx(xs,{configProperties:o,disabled:e,enabledConfigProperty:n})},vs=({configProperty:t,...e})=>{const{value:n}=u.useConfigProperty({configProperty:t}),s=o=>{o!==void 0&&(t==null||t.updateProperty(String(o)))};return r.jsx(l.SwitchCard,{...e,onChange:s,value:n})},ys=({description:t,float:e,label:n,modalTitle:s,onSave:o,time:a,...c})=>{const{regionModel:i}=u.useKosRegions(),{t:d}=u.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:f,hourOptions:h,minuteOptions:g,setTime:y,time:b}=u.useRegionTimeProps({initialDate:a}),v=b.getHours(),w=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v<12?v:v-12,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:v<12?"AM":"PM"}],[m,h,g,b,v]),P=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0}],[h,g,b,v]);return r.jsx(l.MultiPickerCard,{...c,cancelButtonLabel:d("discard-changes","Discard Changes")||void 0,closeButtonLabel:d("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?w:P,description:t,displayValue:f,float:e,icon:ye.TimeIcon,label:n,modalTitle:s,proceedButtonLabel:d("save","Save")||void 0,onSave:O=>{const E=i!=null&&i.is12HourTimeFormat?O.ampm==="AM"?O.hr:O.hr+12:O.hr,j=O.min,_=new Date(b);_.setHours(E),_.setMinutes(j),y(_),o==null||o({hours:E,minutes:j})}})},bs=({configProperty:t,...e})=>{var f;const{getStagedChange:n,updateStagedChange:s}=Rt(),{value:o}=u.useConfigProperty({configProperty:t}),a=((f=n==null?void 0:n(t.id))==null?void 0:f.value)??o,{hours:c,minutes:i}=D.toTimeComponents(Number(a)),d=new Date;d.setHours(c),d.setMinutes(i);const m=h=>{const g=D.toSeconds(h.hours,h.minutes);s?s(t.id,{configProperty:t,value:g}):t.updateProperty(g)};return r.jsx(ys,{...e,onSave:m,time:d})},$o=[0,6],Cs=({day:t=new Date().getDate(),month:e=new Date().getMonth(),onSave:n,year:s=new Date().getFullYear(),...o})=>{var y,b,v,w,P,O;const{t:a}=u.useKosTranslation("region"),{regionModel:c}=u.useKosRegions(),i=u.useDateProps({date:{year:s,month:e,day:t},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(c==null?void 0:c.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:$o,yearsRange:[s-10,s+10]}}),d=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.yearsOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:_.label}))},[(y=i==null?void 0:i.dateState)==null?void 0:y.yearsOptionsArray]),m=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.daysOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:_.label}))},[(b=i==null?void 0:i.dateState)==null?void 0:b.daysOptionsArray]),f=p.useMemo(()=>{var E,j;return(j=(E=i==null?void 0:i.dateState)==null?void 0:E.monthsOptionsArray)==null?void 0:j.map(_=>({id:_.value,label:String(_.label)}))},[(v=i==null?void 0:i.dateState)==null?void 0:v.monthsOptionsArray]),h=p.useMemo(()=>{const E=[];return c==null||c.selectedDateOrder.split("").forEach(j=>{var _,$,z;j==="y"?E.push({id:"year",items:d,selectedItemId:(_=i==null?void 0:i.dateState)==null?void 0:_.year,loop:!1}):j==="m"?E.push({id:"month",items:f,selectedItemId:($=i==null?void 0:i.dateState)==null?void 0:$.month}):j==="d"&&E.push({id:"day",items:m,selectedItemId:(z=i==null?void 0:i.dateState)==null?void 0:z.day,loop:!1})}),E},[(w=i==null?void 0:i.dateState)==null?void 0:w.day,(P=i==null?void 0:i.dateState)==null?void 0:P.month,(O=i==null?void 0:i.dateState)==null?void 0:O.year,m,f,c==null?void 0:c.selectedDateOrder,d]),g=p.useCallback(async E=>{const _=new Date(E.year,E.month+1,0).getDate(),$=E.day>_?1:E.day;n({day:$,month:E.month,year:E.year})},[n]);return r.jsx(l.MultiPickerCard,{cancelButtonLabel:a("discard-changes","Discard Changes")||void 0,closeButtonLabel:a("close","Close")||void 0,data:h,displayValue:i.dateState.formattedDate,icon:ye.CalendarIcon,label:a("todays-date","Today's Date"),onSave:g,proceedButtonLabel:a("save","Save")||void 0,...o})},ws=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,o]=p.useState("idle"),[a,c]=p.useState(),i=p.useCallback(async()=>{o("test"),c(void 0);const m=await t.performElectricalTest();m.error?(c(m.error),o("failure")):m.result==="errEEPROM"?(c("errEEPROM"),o("failure")):o("success")},[t]),d=p.useMemo(()=>({idle:{information:r.jsx(l.LabelInformation,{children:n("perform-electrical-test")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")})},test:{information:r.jsx(l.LabelInformation,{children:n("testing")}),footer:r.jsx(l.Button,{disabled:!0,children:n("electrical-test")}),status:"loading"},success:{information:r.jsx(l.LabelInformation,{children:n("electrical-test-success-header")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"success"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("electrical-test-failure-header")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a}`)})]}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"information"}}),[a,n,i]);return r.jsx(l.WorkflowModal,{title:n(t.name),...d[s],onClose:()=>e()})}),Tt={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Ko=t=>{const[e,n]=p.useState(null),[s,o]=p.useState(Tt),a=t.map(c=>{const[i,,d]=c;return[i==null?void 0:i.future,i,d]}).flat();return p.useEffect(()=>{const c=t.find(i=>{const[d]=i;return!!(d!=null&&d.future)});c?(n(c[0]),o(c[2])):(n(null),o(Tt))},[...a,t]),[e,s]},Uo=t=>{switch(t){case"calibrate":return Gn;case"fixed-45":return Yn;case"flush":return Jn;case"high-flow-test":return Qn;case"hold-to-pour":return es;case"low-flow-test":return ts;case"manual-override":return ns;case"msv-reset":return ss;case"prime":return os;case"purge":return rs;default:return}},zo=t=>(e,n="intents")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),be=(t,e=Uo)=>{const{t:n}=u.useKosTranslation("troubles"),[s,o]=p.useState(null),[a,c]=p.useState(Tt),i=p.useCallback(async d=>{const m=e(d);if(m){const f=zo(n)(d);c(f);const h=new m(t);await h.performAction(),o(h)}},[e,t,n]);return[s,i,a]},Zo=t=>(u.KosLog.debug(`pumpActionFactory: actionId=${t}`),is),Ho=t=>(e,n="troubles")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),Wo=(t,e,n=Zo)=>{const{t:s}=u.useKosTranslation("troubles"),[o,a]=p.useState(null),[c]=p.useState(Ho(s)(e)),i=p.useCallback(async()=>{const d=n(e);if(d){const m=new d(t,e);await m.performAction(),a(m)}},[n,t,e]);return[o,i,c]};function Xo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ot();return r.jsx(o,{...s,children:r.jsx(t,{...e,agitationControl:n})})}}const Ft=()=>{const t=D.Animation.type;return u.useKosModel({modelId:t,modelType:D.Animation.type,options:{}})};function _s(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ft();return r.jsx(o,{...s,children:r.jsx(t,{...e,animation:n})})}}const Le=()=>{const t=D.Application.type;return u.useKosModel({modelId:t,modelType:D.Application.type,options:{}})};function qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Le();return r.jsx(o,{...s,children:r.jsx(t,{...e,application:n})})}}const ks=()=>{const t=D.CarbWater.type;return u.useKosModel({modelId:t,modelType:D.CarbWater.type,options:{}})};function Go(t){return e=>{const{model:n,status:s,KosModelLoader:o}=ks();return r.jsx(o,{...s,children:r.jsx(t,{...e,carbWater:n})})}}const Ss=()=>{const t=D.CopyLogs.type;return u.useKosModel({modelId:t,modelType:D.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function Yo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ss();return r.jsx(o,{...s,children:r.jsx(t,{...e,copyLogs:n})})}}const Mt=()=>{const t=D.DashboardOperations.type;return u.useKosModel({modelId:t,modelType:D.DashboardOperations.type,options:{}})};function Jo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dashboardOperations:n})})}}const Bt=()=>{const t=D.DispenserInfo.type;return u.useKosModel({modelId:t,modelType:D.DispenserInfo.type,options:{}})};function Ts(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Bt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dispenserInfo:n})})}}const js=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.Door.type,options:{}})};function Qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=js(e.id);return r.jsx(o,{...s,children:r.jsx(t,{...e,door:n})})}}var F;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const a={};for(const c of o)a[c]=c;return a},t.getValidEnumValues=o=>{const a=t.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),c={};for(const i of a)c[i]=o[i];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(a){return o[a]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const a=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&a.push(c);return a},t.find=(o,a)=>{for(const c of o)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function s(o,a=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(F||(F={}));var Cn;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Cn||(Cn={}));const k=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},x=F.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class q extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)s._errors.push(n(c));else{let i=s,d=0;for(;d<c.path.length;){const m=c.path[d];d===c.path.length-1?(i[m]=i[m]||{_errors:[]},i[m]._errors.push(n(c))):i[m]=i[m]||{_errors:[]},i=i[m],d++}}};return o(this),s}static assert(e){if(!(e instanceof q))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},s=[];for(const o of this.issues)if(o.path.length>0){const a=o.path[0];n[a]=n[a]||[],n[a].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}q.create=t=>new q(t);const jt=(t,e)=>{let n;switch(t.code){case x.invalid_type:t.received===k.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,F.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:n=`Unrecognized key(s) in object: ${F.joinValues(t.keys,", ")}`;break;case x.invalid_union:n="Invalid input";break;case x.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${F.joinValues(t.options)}`;break;case x.invalid_enum_value:n=`Invalid enum value. Expected ${F.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:n="Invalid function arguments";break;case x.invalid_return_type:n="Invalid function return type";break;case x.invalid_date:n="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:F.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case x.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case x.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case x.custom:n="Invalid input";break;case x.invalid_intersection_types:n="Intersection results could not be merged";break;case x.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:n="Number must be finite";break;default:n=e.defaultError,F.assertNever(t)}return{message:n}};let er=jt;function tr(){return er}const nr=t=>{const{data:e,path:n,errorMaps:s,issueData:o}=t,a=[...n,...o.path||[]],c={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let i="";const d=s.filter(m=>!!m).slice().reverse();for(const m of d)i=m(c,{data:e,defaultError:i}).message;return{...o,path:a,message:i}};function C(t,e){const n=tr(),s=nr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===jt?void 0:jt].filter(o=>!!o)});t.common.issues.push(s)}class U{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const s=[];for(const o of n){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),s.push(o.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const o of n){const a=await o.key,c=await o.value;s.push({key:a,value:c})}return U.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const o of n){const{key:a,value:c}=o;if(a.status==="aborted"||c.status==="aborted")return A;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(s[a.value]=c.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),Ie=t=>({status:"dirty",value:t}),Z=t=>({status:"valid",value:t}),wn=t=>t.status==="aborted",_n=t=>t.status==="dirty",fe=t=>t.status==="valid",Xe=t=>typeof Promise<"u"&&t instanceof Promise;var T;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(T||(T={}));class ne{constructor(e,n,s,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kn=(t,e)=>{if(fe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new q(t.common.issues);return this._error=n,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:s,description:o}=t;if(e&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(c,i)=>{const{message:d}=t;return c.code==="invalid_enum_value"?{message:d??i.defaultError}:typeof i.data>"u"?{message:d??s??i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:d??n??i.defaultError}},description:o}}class R{get description(){return this._def.description}_getType(e){return J(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new U,ctx:{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xe(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){const s={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parseSync({data:e,path:s.path,parent:s});return kn(s,o)}"~validate"(e){var s,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return fe(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(o=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>fe(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parse({data:e,path:s.path,parent:s}),a=await(Xe(o)?o:Promise.resolve(o));return kn(s,a)}refine(e,n){const s=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,a)=>{const c=e(o),i=()=>a.addIssue({code:x.custom,...s(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(d=>d?!0:(i(),!1)):c?!0:(i(),!1)})}refinement(e,n){return this._refinement((s,o)=>e(s)?!0:(o.addIssue(typeof n=="function"?n(s,o):n),!1))}_refinement(e){return new xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return te.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return Je.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ye.create(this,e,this._def)}transform(e){return new xe({...L(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Pt({...L(this._def),innerType:this,defaultValue:n,typeName:N.ZodDefault})}brand(){return new Sr({typeName:N.ZodBranded,type:this,...L(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new At({...L(this._def),innerType:this,catchValue:n,typeName:N.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Vt.create(this,e)}readonly(){return Nt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sr=/^c[^\s-]{8,}$/i,or=/^[0-9a-z]+$/,rr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ar=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ir=/^[a-z0-9_-]{21}$/i,cr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ur="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kt;const mr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Is="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vr=new RegExp(`^${Is}$`);function Es(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function yr(t){return new RegExp(`^${Es(t)}$`)}function br(t){let e=`${Is}T${Es(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Cr(t,e){return!!((e==="v4"||!e)&&mr.test(t)||(e==="v6"||!e)&&hr.test(t))}function wr(t,e){if(!cr.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(s));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function _r(t,e){return!!((e==="v4"||!e)&&pr.test(t)||(e==="v6"||!e)&&fr.test(t))}class Q extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.string,received:a.parsedType}),A}const s=new U;let o;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const c=e.data.length>a.value,i=e.data.length<a.value;(c||i)&&(o=this._getOrReturnCtx(e,o),c?C(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&C(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")dr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"email",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")kt||(kt=new RegExp(ur,"u")),kt.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"emoji",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")ar.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"uuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")ir.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"nanoid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")sr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")or.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cuid2",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")rr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"ulid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),C(o,{validation:"url",code:x.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"regex",code:x.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?br(a).test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?vr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?yr(a).test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{code:x.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?lr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"duration",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Cr(e.data,a.version)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"ip",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?wr(e.data,a.alg)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"jwt",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?_r(e.data,a.version)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"cidr",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?gr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"base64",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?xr.test(e.data)||(o=this._getOrReturnCtx(e,o),C(o,{validation:"base64url",code:x.invalid_string,message:a.message}),s.dirty()):F.assertNever(a);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(o=>e.test(o),{validation:n,code:x.invalid_string,...T.errToObj(s)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...T.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...T.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...T.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...T.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...T.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...T.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...T.errToObj(n)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Q.create=t=>new Q({checks:[],typeName:N.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});function kr(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=n>s?n:s,a=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return a%c/10**o}class Ae extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.number,received:a.parsedType}),A}let s;const o=new U;for(const a of this._def.checks)a.kind==="int"?F.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:x.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?kr(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_finite,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,T.toString(n))}gt(e,n){return this.setLimit("min",e,!1,T.toString(n))}lte(e,n){return this.setLimit("max",e,!0,T.toString(n))}lt(e,n){return this.setLimit("max",e,!1,T.toString(n))}setLimit(e,n,s,o){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:T.toString(o)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Ae.create=t=>new Ae({checks:[],typeName:N.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class Ne extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let s;const o=new U;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),C(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:k.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,T.toString(n))}gt(e,n){return this.setLimit("min",e,!1,T.toString(n))}lte(e,n){return this.setLimit("max",e,!0,T.toString(n))}lt(e,n){return this.setLimit("max",e,!1,T.toString(n))}setLimit(e,n,s,o){return new Ne({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:T.toString(o)}]})}_addCheck(e){return new Ne({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ne.create=t=>new Ne({checks:[],typeName:N.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});class Sn extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.boolean,received:s.parsedType}),A}return Z(e.data)}}Sn.create=t=>new Sn({typeName:N.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class qe extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_type,expected:k.date,received:a.parsedType}),A}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return C(a,{code:x.invalid_date}),A}const s=new U;let o;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(o=this._getOrReturnCtx(e,o),C(o,{code:x.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):F.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qe({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}qe.create=t=>new qe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:N.ZodDate,...L(t)});class Tn extends R{_parse(e){if(this._getType(e)!==k.symbol){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.symbol,received:s.parsedType}),A}return Z(e.data)}}Tn.create=t=>new Tn({typeName:N.ZodSymbol,...L(t)});class jn extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.undefined,received:s.parsedType}),A}return Z(e.data)}}jn.create=t=>new jn({typeName:N.ZodUndefined,...L(t)});class In extends R{_parse(e){if(this._getType(e)!==k.null){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.null,received:s.parsedType}),A}return Z(e.data)}}In.create=t=>new In({typeName:N.ZodNull,...L(t)});class En extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}En.create=t=>new En({typeName:N.ZodAny,...L(t)});class Pn extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}Pn.create=t=>new Pn({typeName:N.ZodUnknown,...L(t)});class se extends R{_parse(e){const n=this._getOrReturnCtx(e);return C(n,{code:x.invalid_type,expected:k.never,received:n.parsedType}),A}}se.create=t=>new se({typeName:N.ZodNever,...L(t)});class An extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.void,received:s.parsedType}),A}return Z(e.data)}}An.create=t=>new An({typeName:N.ZodVoid,...L(t)});class W extends R{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),o=this._def;if(n.parsedType!==k.array)return C(n,{code:x.invalid_type,expected:k.array,received:n.parsedType}),A;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,i=n.data.length<o.exactLength.value;(c||i)&&(C(n,{code:c?x.too_big:x.too_small,minimum:i?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),s.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(C(n,{code:x.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),s.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(C(n,{code:x.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((c,i)=>o.type._parseAsync(new ne(n,c,n.path,i)))).then(c=>U.mergeArray(s,c));const a=[...n.data].map((c,i)=>o.type._parseSync(new ne(n,c,n.path,i)));return U.mergeArray(s,a)}get element(){return this._def.type}min(e,n){return new W({...this._def,minLength:{value:e,message:T.toString(n)}})}max(e,n){return new W({...this._def,maxLength:{value:e,message:T.toString(n)}})}length(e,n){return new W({...this._def,exactLength:{value:e,message:T.toString(n)}})}nonempty(e){return this.min(1,e)}}W.create=(t,e)=>new W({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...L(e)});function pe(t){if(t instanceof B){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=te.create(pe(s))}return new B({...t._def,shape:()=>e})}else return t instanceof W?new W({...t._def,type:pe(t.element)}):t instanceof te?te.create(pe(t.unwrap())):t instanceof ve?ve.create(pe(t.unwrap())):t instanceof ie?ie.create(t.items.map(e=>pe(e))):t}class B extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=F.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==k.object){const m=this._getOrReturnCtx(e);return C(m,{code:x.invalid_type,expected:k.object,received:m.parsedType}),A}const{status:s,ctx:o}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof se&&this._def.unknownKeys==="strip"))for(const m in o.data)c.includes(m)||i.push(m);const d=[];for(const m of c){const f=a[m],h=o.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new ne(o,h,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof se){const m=this._def.unknownKeys;if(m==="passthrough")for(const f of i)d.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(m==="strict")i.length>0&&(C(o,{code:x.unrecognized_keys,keys:i}),s.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const f of i){const h=o.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new ne(o,h,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const m=[];for(const f of d){const h=await f.key,g=await f.value;m.push({key:h,value:g,alwaysSet:f.alwaysSet})}return m}).then(m=>U.mergeObjectSync(s,m)):U.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new B({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var a,c;const o=((c=(a=this._def).errorMap)==null?void 0:c.call(a,n,s).message)??s.defaultError;return n.code==="unrecognized_keys"?{message:T.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new B({...this._def,unknownKeys:"strip"})}passthrough(){return new B({...this._def,unknownKeys:"passthrough"})}extend(e){return new B({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new B({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new B({...this._def,catchall:e})}pick(e){const n={};for(const s of F.objectKeys(e))e[s]&&this.shape[s]&&(n[s]=this.shape[s]);return new B({...this._def,shape:()=>n})}omit(e){const n={};for(const s of F.objectKeys(this.shape))e[s]||(n[s]=this.shape[s]);return new B({...this._def,shape:()=>n})}deepPartial(){return pe(this)}partial(e){const n={};for(const s of F.objectKeys(this.shape)){const o=this.shape[s];e&&!e[s]?n[s]=o:n[s]=o.optional()}return new B({...this._def,shape:()=>n})}required(e){const n={};for(const s of F.objectKeys(this.shape))if(e&&!e[s])n[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof te;)a=a._def.innerType;n[s]=a}return new B({...this._def,shape:()=>n})}keyof(){return Ps(F.objectKeys(this.shape))}}B.create=(t,e)=>new B({shape:()=>t,unknownKeys:"strip",catchall:se.create(),typeName:N.ZodObject,...L(e)});B.strictCreate=(t,e)=>new B({shape:()=>t,unknownKeys:"strict",catchall:se.create(),typeName:N.ZodObject,...L(e)});B.lazycreate=(t,e)=>new B({shape:t,unknownKeys:"strip",catchall:se.create(),typeName:N.ZodObject,...L(e)});class Ge extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function o(a){for(const i of a)if(i.result.status==="valid")return i.result;for(const i of a)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;const c=a.map(i=>new q(i.ctx.common.issues));return C(n,{code:x.invalid_union,unionErrors:c}),A}if(n.common.async)return Promise.all(s.map(async a=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let a;const c=[];for(const d of s){const m={...n,common:{...n.common,issues:[]},parent:null},f=d._parseSync({data:n.data,path:n.path,parent:m});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const i=c.map(d=>new q(d));return C(n,{code:x.invalid_union,unionErrors:i}),A}}get options(){return this._def.options}}Ge.create=(t,e)=>new Ge({options:t,typeName:N.ZodUnion,...L(e)});function It(t,e){const n=J(t),s=J(e);if(t===e)return{valid:!0,data:t};if(n===k.object&&s===k.object){const o=F.objectKeys(e),a=F.objectKeys(t).filter(i=>o.indexOf(i)!==-1),c={...t,...e};for(const i of a){const d=It(t[i],e[i]);if(!d.valid)return{valid:!1};c[i]=d.data}return{valid:!0,data:c}}else if(n===k.array&&s===k.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let a=0;a<t.length;a++){const c=t[a],i=e[a],d=It(c,i);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===k.date&&s===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ye extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=(a,c)=>{if(wn(a)||wn(c))return A;const i=It(a.value,c.value);return i.valid?((_n(a)||_n(c))&&n.dirty(),{status:n.value,value:i.data}):(C(s,{code:x.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Ye.create=(t,e,n)=>new Ye({left:t,right:e,typeName:N.ZodIntersection,...L(n)});class ie extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.array)return C(s,{code:x.invalid_type,expected:k.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return C(s,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(C(s,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...s.data].map((c,i)=>{const d=this._def.items[i]||this._def.rest;return d?d._parse(new ne(s,c,s.path,i)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>U.mergeArray(n,c)):U.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new ie({...this._def,rest:e})}}ie.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ie({items:t,typeName:N.ZodTuple,rest:null,...L(e)})};class Nn extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.map)return C(s,{code:x.invalid_type,expected:k.map,received:s.parsedType}),A;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([i,d],m)=>({key:o._parse(new ne(s,i,s.path,[m,"key"])),value:a._parse(new ne(s,d,s.path,[m,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const d of c){const m=await d.key,f=await d.value;if(m.status==="aborted"||f.status==="aborted")return A;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}})}else{const i=new Map;for(const d of c){const m=d.key,f=d.value;if(m.status==="aborted"||f.status==="aborted")return A;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}}}}Nn.create=(t,e,n)=>new Nn({valueType:e,keyType:t,typeName:N.ZodMap,...L(n)});class De extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.set)return C(s,{code:x.invalid_type,expected:k.set,received:s.parsedType}),A;const o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(C(s,{code:x.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&s.data.size>o.maxSize.value&&(C(s,{code:x.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const a=this._def.valueType;function c(d){const m=new Set;for(const f of d){if(f.status==="aborted")return A;f.status==="dirty"&&n.dirty(),m.add(f.value)}return{status:n.value,value:m}}const i=[...s.data.values()].map((d,m)=>a._parse(new ne(s,d,s.path,m)));return s.common.async?Promise.all(i).then(d=>c(d)):c(i)}min(e,n){return new De({...this._def,minSize:{value:e,message:T.toString(n)}})}max(e,n){return new De({...this._def,maxSize:{value:e,message:T.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}De.create=(t,e)=>new De({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...L(e)});class Dn extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Dn.create=(t,e)=>new Dn({getter:t,typeName:N.ZodLazy,...L(e)});class Et extends R{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return C(n,{received:n.data,code:x.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}Et.create=(t,e)=>new Et({value:t,typeName:N.ZodLiteral,...L(e)});function Ps(t,e){return new ge({values:t,typeName:N.ZodEnum,...L(e)})}class ge extends R{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return C(n,{expected:F.joinValues(s),received:n.parsedType,code:x.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return C(n,{received:n.data,code:x.invalid_enum_value,options:s}),A}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ge.create(e,{...this._def,...n})}exclude(e,n=this._def){return ge.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}ge.create=Ps;class On extends R{_parse(e){const n=F.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==k.string&&s.parsedType!==k.number){const o=F.objectValues(n);return C(s,{expected:F.joinValues(o),received:s.parsedType,code:x.invalid_type}),A}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=F.objectValues(n);return C(s,{received:s.data,code:x.invalid_enum_value,options:o}),A}return Z(e.data)}get enum(){return this._def.values}}On.create=(t,e)=>new On({values:t,typeName:N.ZodNativeEnum,...L(e)});class Je extends R{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==k.promise&&n.common.async===!1)return C(n,{code:x.invalid_type,expected:k.promise,received:n.parsedType}),A;const s=n.parsedType===k.promise?n.data:Promise.resolve(n.data);return Z(s.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Je.create=(t,e)=>new Je({type:t,typeName:N.ZodPromise,...L(e)});class xe extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=this._def.effect||null,a={addIssue:c=>{C(s,c),c.fatal?n.abort():n.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){const c=o.transform(s.data,a);if(s.common.async)return Promise.resolve(c).then(async i=>{if(n.value==="aborted")return A;const d=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return d.status==="aborted"?A:d.status==="dirty"||n.value==="dirty"?Ie(d.value):d});{if(n.value==="aborted")return A;const i=this._def.schema._parseSync({data:c,path:s.path,parent:s});return i.status==="aborted"?A:i.status==="dirty"||n.value==="dirty"?Ie(i.value):i}}if(o.type==="refinement"){const c=i=>{const d=o.refinement(i,a);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?A:(i.status==="dirty"&&n.dirty(),c(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?A:(i.status==="dirty"&&n.dirty(),c(i.value).then(()=>({status:n.value,value:i.value}))))}if(o.type==="transform")if(s.common.async===!1){const c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!fe(c))return A;const i=o.transform(c.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>fe(c)?Promise.resolve(o.transform(c.value,a)).then(i=>({status:n.value,value:i})):A);F.assertNever(o)}}xe.create=(t,e,n)=>new xe({schema:t,typeName:N.ZodEffects,effect:e,...L(n)});xe.createWithPreprocess=(t,e,n)=>new xe({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...L(n)});class te extends R{_parse(e){return this._getType(e)===k.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}te.create=(t,e)=>new te({innerType:t,typeName:N.ZodOptional,...L(e)});class ve extends R{_parse(e){return this._getType(e)===k.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(t,e)=>new ve({innerType:t,typeName:N.ZodNullable,...L(e)});class Pt extends R{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===k.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Pt.create=(t,e)=>new Pt({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class At extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Xe(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}At.create=(t,e)=>new At({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class Ln extends R{_parse(e){if(this._getType(e)!==k.nan){const s=this._getOrReturnCtx(e);return C(s,{code:x.invalid_type,expected:k.nan,received:s.parsedType}),A}return{status:"valid",value:e.data}}}Ln.create=t=>new Ln({typeName:N.ZodNaN,...L(t)});class Sr extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class Vt extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?A:a.status==="dirty"?(n.dirty(),Ie(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?A:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(e,n){return new Vt({in:e,out:n,typeName:N.ZodPipeline})}}class Nt extends R{_parse(e){const n=this._def.innerType._parse(e),s=o=>(fe(o)&&(o.value=Object.freeze(o.value)),o);return Xe(n)?n.then(o=>s(o)):s(n)}unwrap(){return this._def.innerType}}Nt.create=(t,e)=>new Nt({innerType:t,typeName:N.ZodReadonly,...L(e)});var N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));const X=Q.create;se.create;W.create;Ge.create;Ye.create;ie.create;const st=Et.create,Tr=ge.create;Je.create;te.create;ve.create;const Rn=I.createExtensionSchema({type:st("dashboard.summary").describe("Extension type, must be 'dashboard.summary'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this summary belongs to")},{rankable:!0}),ot=I.extensionPointId("ddk","dashboard","summary"),jr=I.defineExtensionPoint({id:ot,contributionKey:"dashboardSummary",displayName:"Dashboard Summary",description:"Extension point for dashboard summary plugin configurations with view support",hasView:!0,isRankable:!0,schema:Rn,metadata:{exportName:"DashboardSummaryExtension",category:"Dashboard",tags:["dashboard","summary","visualization"]},validate:(t,e)=>{I.validateWithSchema(Rn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Ir=ot,Er=`${ot}.def`,Pr=`${ot}.view`,Fn=I.createExtensionSchema({type:st("dashboard.detail").describe("Extension type, must be 'dashboard.detail'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this detail belongs to")},{rankable:!0}),rt=I.extensionPointId("ddk","dashboard","detail"),Ar=I.defineExtensionPoint({id:rt,contributionKey:"dashboardDetail",displayName:"Dashboard Detail",description:"Extension point for dashboard detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Fn,metadata:{exportName:"DashboardDetailExtension",category:"Dashboard",tags:["dashboard","detail","visualization"]},validate:(t,e)=>{I.validateWithSchema(Fn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Nr=rt,Dr=`${rt}.def`,Or=`${rt}.view`,Mn=I.createExtensionSchema({type:st("dashboard.detail.pump").describe("Extension type, must be 'dashboard.detail.pump'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to match this extension with specific dashboard pumps")},{rankable:!0}),at=I.extensionPointId("ddk","dashboard","pump-detail"),Oe=I.defineExtensionPoint({id:at,contributionKey:"dashboardPumpDetail",displayName:"Dashboard Pump Detail",description:"Extension point for dashboard pump detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Mn,metadata:{exportName:"DashboardPumpDetailExtension"},validate:(t,e)=>{I.validateWithSchema(Mn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Lr=at,Rr=`${at}.def`,Fr=`${at}.view`,Bn=I.createExtensionSchema({cuiDescriptor:X().min(1,"CUI descriptor is required").describe("Descriptor used to identify and categorize the CUI functionality"),modalMode:Tr(["fullscreen","maximized"]).optional().describe("Modal display mode for the CUI interface")}),it=I.extensionPointId("ddk","cui"),As=I.defineExtensionPoint({id:it,contributionKey:"cui",displayName:"CUI (Consumer User Interface)",description:"Extension point for CUI plugin configurations with view support",hasView:!0,isRankable:!1,schema:Bn,metadata:{exportName:"CuiExtension",category:"Interface",tags:["cui","user-interface","consumer"]},validate:(t,e)=>{I.validateWithSchema(Bn,t,e)&&I.validateDescriptorFormat("CUI descriptor",t.cuiDescriptor,e)},transform:I.createViewAwareTransform()}),Mr=it,Br=`${it}.def`,Vr=`${it}.view`,Vn=I.createExtensionSchema({navDescriptor:X().min(1,"Navigation descriptor is required").describe("Descriptor used to identify and map the navigation functionality")}),ct=I.extensionPointId("ddk","nav","view"),$r=I.defineExtensionPoint({id:ct,contributionKey:"navViews",displayName:"Navigation Views",description:"Extension point for navigation view plugin configurations with view support",hasView:!0,isRankable:!1,schema:Vn,metadata:{exportName:"NavViewExtension",category:"Navigation",tags:["navigation","nav","views","routing"]},validate:(t,e)=>{I.validateWithSchema(Vn,t,e)&&I.validateDescriptorFormat("Navigation descriptor",t.navDescriptor,e)},transform:I.createViewAwareTransform()}),Kr=ct,Ur=`${ct}.def`,zr=`${ct}.view`,$n=I.createExtensionSchema({setupDescriptor:X().min(1,"Setup descriptor is required").describe("Descriptor used to identify and categorize the setup step")},{rankable:!0}),lt=I.extensionPointId("ddk","setup"),$t=I.defineExtensionPoint({id:lt,contributionKey:"setupStep",displayName:"Setup Steps",description:"Extension point for setup step plugin configurations with view support",hasView:!0,isRankable:!0,schema:$n,metadata:{exportName:"SetupExtension",category:"Setup",tags:["setup","configuration","steps","wizard"]},validate:(t,e)=>{I.validateWithSchema($n,t,e)&&(I.validateDescriptorFormat("Setup descriptor",t.setupDescriptor,e),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Zr=lt,Hr=`${lt}.def`,Wr=`${lt}.view`,Kn=I.createExtensionSchema({type:st("trouble.action").describe("Extension type, must be 'trouble.action'"),troubleType:X().min(1,"Trouble type is required").describe("Specific trouble type from TroubleContainer that triggers this action (e.g., 'pump-motor-fault', 'sensor-calibration-error'). This must match the exact trouble type string emitted by the device/system."),stateKey:X().min(1,"State key is required").describe("Normalized state key for grouping related troubles under a common UI experience (e.g., 'pumpProblem', 'sensorIssue'). Multiple troubleTypes can share the same stateKey to show the same troubleshooting component. If not provided, defaults to troubleType for 1:1 mapping."),stateValue:X().min(1,"State value is required").describe("Value set in the reactive state when this trouble becomes active (e.g., 'pump-failure', 'needs-calibration'). Used by other components to detect trouble categories and trigger appropriate responses. If not provided, defaults to troubleType.")},{rankable:!0}),dt=I.extensionPointId("ddk","trouble","action"),Qe=I.defineExtensionPoint({id:dt,contributionKey:"troubleActions",displayName:"Trouble Actions",description:"Extension point for trouble action plugin configurations with view support",hasView:!0,isRankable:!0,schema:Kn,metadata:{exportName:"TroubleActionExtension",category:"Trouble Management",tags:["trouble","action","state","error-handling"]},validate:(t,e)=>{I.validateWithSchema(Kn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Xr=dt,qr=`${dt}.def`,Gr=`${dt}.view`,Un=I.createExtensionSchema({viewKey:X().min(1,"View key is required").describe("Key identifying the UI region where this component should be rendered (e.g., 'settings.config', 'dashboard.sidebar'). Multiple plugins can contribute to the same viewKey, and all will be rendered in the designated region.")},{rankable:!0}),ut=I.extensionPointId("ddk","view"),Yr=I.defineExtensionPoint({id:ut,contributionKey:"views",displayName:"Views",description:"Extension point for view plugin configurations with regional rendering support",hasView:!0,isRankable:!0,schema:Un,metadata:{exportName:"ViewExtension",category:"UI Layout",tags:["views","ui","rendering","layout","regions"]},validate:(t,e)=>{I.validateWithSchema(Un,t,e)&&(t.viewKey&&(t.viewKey.includes(".")||e.addInfo(`ViewKey '${t.viewKey}' might benefit from dot notation (e.g., 'settings.config', 'dashboard.sidebar') for better organization`),["view","content","main"].includes(t.viewKey)&&e.addWarning(`ViewKey '${t.viewKey}' is very generic - consider using more specific keys like 'settings.main' or 'dashboard.content'`)),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Jr=ut,Qr=`${ut}.def`,ea=`${ut}.view`,ta="ddk.ncui.utilities",zn={[$t.id]:"setupDescriptor",[As.id]:"cuiDescriptor",[ta]:"utilDescriptor"},Ns=({defaultNamespace:t,extensionPoint:e})=>{const{getExtensions:n}=ae.useKosPluginsContext(),s=n(e),o=s.map(d=>d.data.namespace)||[],{t:a}=u.useKosTranslation([t,...new Set(o)]),c=s.reduce((d,m)=>{const f=m,h=f.data;return d[h[zn[e]]]={extension:e,module:f.id,namespace:h.namespace,title:h.title},d},{}),i=s.reduce((d,m)=>{const h=m.data;return d[h[zn[e]]]=`${h.namespace}:${h.title}`,d},{});return{namespaces:o,t:a,labelMap:i,contributionMap:c}},Ce=(t,e)=>{const n=p.useMemo(()=>({agitate:cs,calibrate:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ms,{pump:m,onComplete:d})},calibrateSPM:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.SpmPump.type);return r.jsx(no,{pump:m,onComplete:d})},diagnostics:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ws,{pump:m,onComplete:d})},"replace-pump":({holder:c,pump:i,onComplete:d})=>r.jsx(Ys,{pump:i??c.pumps.data[0],onComplete:d}),"rfid-override":Js,"replace-line":({holder:c,onComplete:i})=>r.jsx(Gs,{holder:c,onComplete:i})}),[]),[s,o]=p.useState(void 0),a=s?n[s]:void 0;return{holderExperience:a?r.jsx(a,{holder:t,pump:e,onComplete:()=>{o(void 0)}}):void 0,setHolderExperience:o,currentExperienceId:s}},Kt=p.createContext(void 0),na=({children:t,value:e})=>r.jsx(Kt.Provider,{value:e,children:t}),sa=t=>({HolderContent:void 0}),Ut=(t,e=sa)=>{const n=p.useContext(Kt);return e=(n==null?void 0:n.actionFactory)||e,e(t)},zt=()=>{const t=D.IngredientSummary.type;return u.useKosModel({modelId:t,modelType:D.IngredientSummary.type,options:{}})};function oa(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,ingredientSummary:n})})}}const Zt=()=>{const t=D.MacroAssignment.type;return u.useKosModel({modelId:t,modelType:D.MacroAssignment.type,options:{}})};function Ds(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,macroAssignment:n})})}}const Ht=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.NetworkTest.type,options:{}})};function ra(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Ht(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,networkTest:s})})}}const Wt=()=>{const t=D.NetworkTestContainer.type;return u.useKosModel({modelId:t,modelType:D.NetworkTestContainer.type,options:{}})};function Os(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Wt();return r.jsx(o,{...s,children:r.jsx(t,{...e,networkTestContainer:n})})}}const Ls=()=>{const t=D.NutritiveSweetener.type;return u.useKosModel({modelId:t,modelType:D.NutritiveSweetener.type,options:{}})};function aa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ls();return r.jsx(o,{...s,children:r.jsx(t,{...e,nutritiveSweetener:n})})}}const Rs=()=>{const t=D.PlainWater.type;return u.useKosModel({modelId:t,modelType:D.PlainWater.type,options:{},destroyOnUnmount:!0})};function ia(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Rs();return r.jsx(o,{...s,children:r.jsx(t,{...e,plainWater:n})})}}const ca=t=>{switch(t.type){case"fcm":return K.FcmPump.type;case"lfcv":return K.LfcvPump.type;case"micro":return K.SpmPump.type;case"cgp":return K.CgpPump.type;default:return}},ee="pluginVisibility",We=new Map;u.registerExtensionPoint(ee,{register:(t,e)=>{var n;We.has(t)||We.set(t,[]),(n=We.get(t))==null||n.push(e)},execute:(t,e,n)=>{const s=We.get(t);if(!s)return!0;const o=s.map(a=>a(e,n));return o.length===0?!0:!o.includes(!1)}});class Fs{constructor(e,n){M(this,"core");M(this,"dispense");this.core=e,this.dispense=n}registerDashboardVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}registerNavVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}}class la{constructor(){M(this,"dispense");M(this,"core");M(this,"plugin");this.dispense=new Dt.DispenseExtensionManager,this.core=new u.CoreExtensionManager,this.plugin=new Fs(this.core,this.dispense)}}const Re=t=>t?Ms(t.type):{action:"",label:"",progress:"",summary:""},Ms=t=>{const e=`troubles:troubles.${t}`;return{action:`${e}.action`,label:`${e}.label`,progress:`${e}.progress`,summary:`${e}.summary`}},Fe=t=>{const e=ae.useReactiveExtensionRegistry(),[,n]=p.useState({}),[s]=p.useState(new Set);return p.useEffect(()=>{const a=[];return s.forEach(c=>{const i=e.subscribe(c,()=>{n({})});a.push(i)}),()=>{a.forEach(c=>c())}},[e,s]),{getExtensions:p.useCallback(a=>(s.add(a),Object.values(e.getExtensions(a,!1)).filter(d=>{const m=d.id;return u.ExtensionManager[ee].execute(ee,m,t)})),[e,t,s])}},mt=()=>{const t=D.Reboot.type;return u.useKosModel({modelId:t,modelType:D.Reboot.type,options:{}})};function da(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,reboot:n})})}}const pt=()=>{const t=D.Settings.type;return u.useKosModel({modelId:t,modelType:D.Settings.type,options:{}})};function Xt(t){return e=>{const{model:n,status:s,KosModelLoader:o}=pt();return r.jsx(o,{...s,children:r.jsx(t,{...e,settings:n})})}}const qt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.SetupStep.type,options:{}})};function ua(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=qt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,setupStep:s})})}}const Gt=()=>{const t=D.SetupStepContainer.type;return u.useKosModel({modelId:t,modelType:D.SetupStepContainer.type,options:{}})};function Bs(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Gt();return r.jsx(o,{...s,children:r.jsx(t,{...e,setupStepContainer:n})})}}const Vs=()=>{const t=D.Start.type;return u.useKosModel({modelId:t,modelType:D.Start.type,options:{}})};function ma(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Vs();return r.jsx(o,{...s,children:r.jsx(t,{...e,start:n})})}}const Yt=()=>{const t=D.TroubleActionManager.type,{getExtensions:e}=Fe(),n=e(Qe.id).map(o=>o.data);return u.useKosModel({modelId:t,modelType:D.TroubleActionManager.type,options:{definitions:n}})};function pa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Yt();return r.jsx(o,{...s,children:r.jsx(t,{...e,troubleAction:n})})}}const ht=t=>{const[e,n]=p.useState({});return p.useEffect(()=>{async function s(){if(t){const o=await u.troubleDataFactory(t);n(o)}}s()},[t]),e},ha=t=>!t||t==="white",fa=t=>t?void 0:"white",$s=t=>{if(!u.isTroubleAware(t))return{};const e=t,{visibleTroubles:n,initialized:s}=we(e),o=(n==null?void 0:n.length)??0,a=n==null?void 0:n[0],c=o>0,i=c?`${a==null?void 0:a.color}`:void 0,d=ha(i),m=c?fa(d):void 0;return{backgroundColor:i,fontColor:m,highestTrouble:a,initialized:s,troubleCount:o,hasTroubles:c}},ga=({troubleType:t,condition:e})=>{const{model:n}=u.useTroubleContainerModel(),[s,o]=p.useState(!1),[a,c]=p.useState([]);return p.useEffect(()=>u.kosAutoEffect(()=>{const d=(t?n==null?void 0:n.troubles.getIndexByKey("byType",t):n==null?void 0:n.troubles.data)||[],m=e?d.filter(e):d;o(m.length>0),c(m)}),[e,n,t]),[s,a.length>0?a[0]:void 0,a]},Jt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:D.Utilities.type,options:{}})};function xa(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Jt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,utilities:s})})}}const Qt=()=>{const t=D.UtilitiesContainer.type;return u.useKosModel({modelId:t,modelType:D.UtilitiesContainer.type,options:{}})};function va(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Qt();return r.jsx(o,{...s,children:r.jsx(t,{...e,utilitiesContainer:n})})}}const Ks=u.withDevice(u.kosComponent(({device:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),s=t.serialNumber==="unassigned"?void 0:t.serialNumber;return r.jsx(l.InfoCard,{label:e("dispenser-serial"),value:s})})),ya=Ts(u.kosComponent(({dispenserInfo:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile");return r.jsxs(r.Fragment,{children:[r.jsx(fs,{label:e("dispenser-name","Dispenser Name"),configProperty:t.name}),r.jsx(Ks,{})]})})),ba=Xt(u.kosComponent(({settings:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),n=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return r.jsxs(r.Fragment,{children:[r.jsx(tt,{closeButtonLabel:e("close","Close")||void 0,configProperty:t==null?void 0:t.name,isValid:n,label:e("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),r.jsx(bs,{label:e("activate-and-reboot-time"),configProperty:t.activateAndRebootTime})]})})),Us=S(l.LabelDate)`
164
+ `,xs=({configProperties:t,disabled:e,enabledConfigProperty:n})=>{const{value:s}=u.useConfigProperty({configProperty:n}),o=s==="true",{componentModeOverride:a}=l.useComponentConfigurationContext(),c=t.length===1,i=c?Vo:gs;return r.jsxs(Fo,{disabled:!o||e,mode:a,children:[r.jsx(Mo,{children:t.map(d=>r.jsx(i,{disabled:!o||e,label:d.options?d.options.label:void 0,configProperty:d.configProperty,collapse:!c&&a==="standard",layout:d.options?d.options.layout:void 0,float:!0,hideUnits:d.options?d.options.hideUnits:void 0},d.configProperty.id))}),r.jsx(Bo,{compact:!c||a==="compact",children:r.jsx(Pe,{alwaysShowLabel:!0,collapse:!0,configProperty:n,disabled:e,stretch:a==="compact"})})]})},$o=({configProperty:t,disabled:e,enabledConfigProperty:n,options:s})=>{const o=p.useMemo(()=>[{configProperty:t,options:s}],[t,s]);return r.jsx(xs,{configProperties:o,disabled:e,enabledConfigProperty:n})},vs=({configProperty:t,...e})=>{const{value:n}=u.useConfigProperty({configProperty:t}),s=o=>{o!==void 0&&(t==null||t.updateProperty(String(o)))};return r.jsx(l.SwitchCard,{...e,onChange:s,value:n})},ys=({description:t,float:e,label:n,modalTitle:s,onSave:o,time:a,...c})=>{const{regionModel:i}=u.useKosRegions(),{t:d}=u.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:f,hourOptions:h,minuteOptions:g,setTime:y,time:b}=u.useRegionTimeProps({initialDate:a}),v=b.getHours(),_=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v<12?v:v-12,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:v<12?"AM":"PM"}],[m,h,g,b,v]),O=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:v,loop:!0},{id:"min",items:g,selectedItemId:b.getMinutes(),loop:!0}],[h,g,b,v]);return r.jsx(l.MultiPickerCard,{...c,cancelButtonLabel:d("discard-changes","Discard Changes")||void 0,closeButtonLabel:d("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?_:O,description:t,displayValue:f,float:e,icon:be.TimeIcon,label:n,modalTitle:s,proceedButtonLabel:d("save","Save")||void 0,onSave:D=>{const I=i!=null&&i.is12HourTimeFormat?D.ampm==="AM"?D.hr:D.hr+12:D.hr,T=D.min,C=new Date(b);C.setHours(I),C.setMinutes(T),y(C),o==null||o({hours:I,minutes:T})}})},bs=({configProperty:t,...e})=>{var f;const{getStagedChange:n,updateStagedChange:s}=Rt(),{value:o}=u.useConfigProperty({configProperty:t}),a=((f=n==null?void 0:n(t.id))==null?void 0:f.value)??o,{hours:c,minutes:i}=N.toTimeComponents(Number(a)),d=new Date;d.setHours(c),d.setMinutes(i);const m=h=>{const g=N.toSeconds(h.hours,h.minutes);s?s(t.id,{configProperty:t,value:g}):t.updateProperty(g)};return r.jsx(ys,{...e,onSave:m,time:d})},Ko=[0,6],Cs=({day:t=new Date().getDate(),month:e=new Date().getMonth(),onSave:n,year:s=new Date().getFullYear(),...o})=>{var y,b,v,_,O,D;const{t:a}=u.useKosTranslation("region"),{regionModel:c}=u.useKosRegions(),i=u.useDateProps({date:{year:s,month:e,day:t},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(c==null?void 0:c.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:Ko,yearsRange:[s-10,s+10]}}),d=p.useMemo(()=>{var I,T;return(T=(I=i==null?void 0:i.dateState)==null?void 0:I.yearsOptionsArray)==null?void 0:T.map(C=>({id:C.value,label:C.label}))},[(y=i==null?void 0:i.dateState)==null?void 0:y.yearsOptionsArray]),m=p.useMemo(()=>{var I,T;return(T=(I=i==null?void 0:i.dateState)==null?void 0:I.daysOptionsArray)==null?void 0:T.map(C=>({id:C.value,label:C.label}))},[(b=i==null?void 0:i.dateState)==null?void 0:b.daysOptionsArray]),f=p.useMemo(()=>{var I,T;return(T=(I=i==null?void 0:i.dateState)==null?void 0:I.monthsOptionsArray)==null?void 0:T.map(C=>({id:C.value,label:String(C.label)}))},[(v=i==null?void 0:i.dateState)==null?void 0:v.monthsOptionsArray]),h=p.useMemo(()=>{const I=[];return c==null||c.selectedDateOrder.split("").forEach(T=>{var C,$,z;T==="y"?I.push({id:"year",items:d,selectedItemId:(C=i==null?void 0:i.dateState)==null?void 0:C.year,loop:!1}):T==="m"?I.push({id:"month",items:f,selectedItemId:($=i==null?void 0:i.dateState)==null?void 0:$.month}):T==="d"&&I.push({id:"day",items:m,selectedItemId:(z=i==null?void 0:i.dateState)==null?void 0:z.day,loop:!1})}),I},[(_=i==null?void 0:i.dateState)==null?void 0:_.day,(O=i==null?void 0:i.dateState)==null?void 0:O.month,(D=i==null?void 0:i.dateState)==null?void 0:D.year,m,f,c==null?void 0:c.selectedDateOrder,d]),g=p.useCallback(async I=>{const C=new Date(I.year,I.month+1,0).getDate(),$=I.day>C?1:I.day;n({day:$,month:I.month,year:I.year})},[n]);return r.jsx(l.MultiPickerCard,{cancelButtonLabel:a("discard-changes","Discard Changes")||void 0,closeButtonLabel:a("close","Close")||void 0,data:h,displayValue:i.dateState.formattedDate,icon:be.CalendarIcon,label:a("todays-date","Today's Date"),onSave:g,proceedButtonLabel:a("save","Save")||void 0,...o})},ws=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,o]=p.useState("idle"),[a,c]=p.useState(),i=p.useCallback(async()=>{o("test"),c(void 0);const m=await t.performElectricalTest();m.error?(c(m.error),o("failure")):m.result==="errEEPROM"?(c("errEEPROM"),o("failure")):o("success")},[t]),d=p.useMemo(()=>({idle:{information:r.jsx(l.LabelInformation,{children:n("perform-electrical-test")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")})},test:{information:r.jsx(l.LabelInformation,{children:n("testing")}),footer:r.jsx(l.Button,{disabled:!0,children:n("electrical-test")}),status:"loading"},success:{information:r.jsx(l.LabelInformation,{children:n("electrical-test-success-header")}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"success"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("electrical-test-failure-header")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a}`)})]}),footer:r.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"information"}}),[a,n,i]);return r.jsx(l.WorkflowModal,{title:n(t.name),...d[s],onClose:()=>e()})}),Tt={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Uo=t=>{const[e,n]=p.useState(null),[s,o]=p.useState(Tt),a=t.map(c=>{const[i,,d]=c;return[i==null?void 0:i.future,i,d]}).flat();return p.useEffect(()=>{const c=t.find(i=>{const[d]=i;return!!(d!=null&&d.future)});c?(n(c[0]),o(c[2])):(n(null),o(Tt))},[...a,t]),[e,s]},zo=t=>{switch(t){case"calibrate":return Gn;case"fixed-45":return Yn;case"flush":return Jn;case"high-flow-test":return Qn;case"hold-to-pour":return es;case"low-flow-test":return ts;case"manual-override":return ns;case"msv-reset":return ss;case"prime":return os;case"purge":return rs;default:return}},Zo=t=>(e,n="intents")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),ce=(t,e=zo)=>{const{t:n}=u.useKosTranslation("troubles"),[s,o]=p.useState(null),[a,c]=p.useState(Tt),i=p.useCallback(async d=>{const m=e(d);if(m){const f=Zo(n)(d);if(c(f),t){const h=new m(t);await h.performAction(),o(h)}}},[e,t,n]);return t?[s,i,a]:[null,i,a]},Ho=t=>(u.KosLog.debug(`pumpActionFactory: actionId=${t}`),is),Wo=t=>(e,n="troubles")=>({title:t(`${n}:troubles.${e}.progress`),summary:t(`${n}:troubles.${e}.summary`),successMessage:t(`${n}:troubles.${e}.success`),failureMessage:t(`${n}:troubles.${e}.error`),actionLabel:t(`${n}:troubles.${e}.action`)}),Xo=(t,e,n=Ho)=>{const{t:s}=u.useKosTranslation("troubles"),[o,a]=p.useState(null),[c]=p.useState(Wo(s)(e)),i=p.useCallback(async()=>{const d=n(e);if(d){const m=new d(t,e);await m.performAction(),a(m)}},[n,t,e]);return[o,i,c]};function qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ot();return r.jsx(o,{...s,children:r.jsx(t,{...e,agitationControl:n})})}}const Ft=()=>{const t=N.Animation.type;return u.useKosModel({modelId:t,modelType:N.Animation.type,options:{}})};function _s(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ft();return r.jsx(o,{...s,children:r.jsx(t,{...e,animation:n})})}}const Le=()=>{const t=N.Application.type;return u.useKosModel({modelId:t,modelType:N.Application.type,options:{}})};function Go(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Le();return r.jsx(o,{...s,children:r.jsx(t,{...e,application:n})})}}const ks=()=>{const t=N.CarbWater.type;return u.useKosModel({modelId:t,modelType:N.CarbWater.type,options:{}})};function Yo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=ks();return r.jsx(o,{...s,children:r.jsx(t,{...e,carbWater:n})})}}const Ss=()=>{const t=N.CopyLogs.type;return u.useKosModel({modelId:t,modelType:N.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function Jo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ss();return r.jsx(o,{...s,children:r.jsx(t,{...e,copyLogs:n})})}}const Mt=()=>{const t=N.DashboardOperations.type;return u.useKosModel({modelId:t,modelType:N.DashboardOperations.type,options:{}})};function Qo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dashboardOperations:n})})}}const Vt=()=>{const t=N.DispenserInfo.type;return u.useKosModel({modelId:t,modelType:N.DispenserInfo.type,options:{}})};function Ts(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Vt();return r.jsx(o,{...s,children:r.jsx(t,{...e,dispenserInfo:n})})}}const js=t=>{const e=t;return u.useKosModel({modelId:e,modelType:N.Door.type,options:{}})};function er(t){return e=>{const{model:n,status:s,KosModelLoader:o}=js(e.id);return r.jsx(o,{...s,children:r.jsx(t,{...e,door:n})})}}var F;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const a={};for(const c of o)a[c]=c;return a},t.getValidEnumValues=o=>{const a=t.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),c={};for(const i of a)c[i]=o[i];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(a){return o[a]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const a=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&a.push(c);return a},t.find=(o,a)=>{for(const c of o)if(a(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function s(o,a=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(F||(F={}));var Cn;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Cn||(Cn={}));const k=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},x=F.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class q extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)s._errors.push(n(c));else{let i=s,d=0;for(;d<c.path.length;){const m=c.path[d];d===c.path.length-1?(i[m]=i[m]||{_errors:[]},i[m]._errors.push(n(c))):i[m]=i[m]||{_errors:[]},i=i[m],d++}}};return o(this),s}static assert(e){if(!(e instanceof q))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},s=[];for(const o of this.issues)if(o.path.length>0){const a=o.path[0];n[a]=n[a]||[],n[a].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}q.create=t=>new q(t);const jt=(t,e)=>{let n;switch(t.code){case x.invalid_type:t.received===k.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,F.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:n=`Unrecognized key(s) in object: ${F.joinValues(t.keys,", ")}`;break;case x.invalid_union:n="Invalid input";break;case x.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${F.joinValues(t.options)}`;break;case x.invalid_enum_value:n=`Invalid enum value. Expected ${F.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:n="Invalid function arguments";break;case x.invalid_return_type:n="Invalid function return type";break;case x.invalid_date:n="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:F.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case x.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case x.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case x.custom:n="Invalid input";break;case x.invalid_intersection_types:n="Intersection results could not be merged";break;case x.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:n="Number must be finite";break;default:n=e.defaultError,F.assertNever(t)}return{message:n}};let tr=jt;function nr(){return tr}const sr=t=>{const{data:e,path:n,errorMaps:s,issueData:o}=t,a=[...n,...o.path||[]],c={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let i="";const d=s.filter(m=>!!m).slice().reverse();for(const m of d)i=m(c,{data:e,defaultError:i}).message;return{...o,path:a,message:i}};function w(t,e){const n=nr(),s=sr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===jt?void 0:jt].filter(o=>!!o)});t.common.issues.push(s)}class U{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const s=[];for(const o of n){if(o.status==="aborted")return P;o.status==="dirty"&&e.dirty(),s.push(o.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const o of n){const a=await o.key,c=await o.value;s.push({key:a,value:c})}return U.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const o of n){const{key:a,value:c}=o;if(a.status==="aborted"||c.status==="aborted")return P;a.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(s[a.value]=c.value)}return{status:e.value,value:s}}}const P=Object.freeze({status:"aborted"}),Ie=t=>({status:"dirty",value:t}),Z=t=>({status:"valid",value:t}),wn=t=>t.status==="aborted",_n=t=>t.status==="dirty",ge=t=>t.status==="valid",Xe=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(j||(j={}));class ne{constructor(e,n,s,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kn=(t,e)=>{if(ge(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new q(t.common.issues);return this._error=n,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:s,description:o}=t;if(e&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(c,i)=>{const{message:d}=t;return c.code==="invalid_enum_value"?{message:d??i.defaultError}:typeof i.data>"u"?{message:d??s??i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:d??n??i.defaultError}},description:o}}class R{get description(){return this._def.description}_getType(e){return J(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new U,ctx:{common:e.parent.common,data:e.data,parsedType:J(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xe(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){const s={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parseSync({data:e,path:s.path,parent:s});return kn(s,o)}"~validate"(e){var s,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return ge(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(o=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>ge(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:J(e)},o=this._parse({data:e,path:s.path,parent:s}),a=await(Xe(o)?o:Promise.resolve(o));return kn(s,a)}refine(e,n){const s=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,a)=>{const c=e(o),i=()=>a.addIssue({code:x.custom,...s(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(d=>d?!0:(i(),!1)):c?!0:(i(),!1)})}refinement(e,n){return this._refinement((s,o)=>e(s)?!0:(o.addIssue(typeof n=="function"?n(s,o):n),!1))}_refinement(e){return new ve({schema:this,typeName:A.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return te.create(this,this._def)}nullable(){return ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return Je.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ye.create(this,e,this._def)}transform(e){return new ve({...L(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Pt({...L(this._def),innerType:this,defaultValue:n,typeName:A.ZodDefault})}brand(){return new Tr({typeName:A.ZodBranded,type:this,...L(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new At({...L(this._def),innerType:this,catchValue:n,typeName:A.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Bt.create(this,e)}readonly(){return Nt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const or=/^c[^\s-]{8,}$/i,rr=/^[0-9a-z]+$/,ar=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ir=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cr=/^[a-z0-9_-]{21}$/i,lr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ur=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kt;const pr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,fr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,gr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Is="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",yr=new RegExp(`^${Is}$`);function Es(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function br(t){return new RegExp(`^${Es(t)}$`)}function Cr(t){let e=`${Is}T${Es(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function wr(t,e){return!!((e==="v4"||!e)&&pr.test(t)||(e==="v6"||!e)&&fr.test(t))}function _r(t,e){if(!lr.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(s));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function kr(t,e){return!!((e==="v4"||!e)&&hr.test(t)||(e==="v6"||!e)&&gr.test(t))}class Q extends R{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const a=this._getOrReturnCtx(e);return w(a,{code:x.invalid_type,expected:k.string,received:a.parsedType}),P}const s=new U;let o;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const c=e.data.length>a.value,i=e.data.length<a.value;(c||i)&&(o=this._getOrReturnCtx(e,o),c?w(o,{code:x.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&w(o,{code:x.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ur.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"email",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")kt||(kt=new RegExp(mr,"u")),kt.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"emoji",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")ir.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"uuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")cr.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"nanoid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")or.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cuid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")rr.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cuid2",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")ar.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"ulid",code:x.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),w(o,{validation:"url",code:x.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"regex",code:x.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(e,o),w(o,{code:x.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(o=this._getOrReturnCtx(e,o),w(o,{code:x.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(o=this._getOrReturnCtx(e,o),w(o,{code:x.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?Cr(a).test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:x.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?yr.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:x.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?br(a).test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{code:x.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?dr.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"duration",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?wr(e.data,a.version)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"ip",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?_r(e.data,a.alg)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"jwt",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?kr(e.data,a.version)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"cidr",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?xr.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"base64",code:x.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?vr.test(e.data)||(o=this._getOrReturnCtx(e,o),w(o,{validation:"base64url",code:x.invalid_string,message:a.message}),s.dirty()):F.assertNever(a);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(o=>e.test(o),{validation:n,code:x.invalid_string,...j.errToObj(s)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...j.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...j.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...j.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...j.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...j.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...j.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...j.errToObj(n)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Q.create=t=>new Q({checks:[],typeName:A.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});function Sr(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=n>s?n:s,a=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return a%c/10**o}class Ae extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){const a=this._getOrReturnCtx(e);return w(a,{code:x.invalid_type,expected:k.number,received:a.parsedType}),P}let s;const o=new U;for(const a of this._def.checks)a.kind==="int"?F.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:x.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:x.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:x.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?Sr(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),w(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:x.not_finite,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,j.toString(n))}gt(e,n){return this.setLimit("min",e,!1,j.toString(n))}lte(e,n){return this.setLimit("max",e,!0,j.toString(n))}lt(e,n){return this.setLimit("max",e,!1,j.toString(n))}setLimit(e,n,s,o){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:j.toString(o)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Ae.create=t=>new Ae({checks:[],typeName:A.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class Ne extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let s;const o=new U;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:x.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),w(s,{code:x.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),w(s,{code:x.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):F.assertNever(a);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return w(n,{code:x.invalid_type,expected:k.bigint,received:n.parsedType}),P}gte(e,n){return this.setLimit("min",e,!0,j.toString(n))}gt(e,n){return this.setLimit("min",e,!1,j.toString(n))}lte(e,n){return this.setLimit("max",e,!0,j.toString(n))}lt(e,n){return this.setLimit("max",e,!1,j.toString(n))}setLimit(e,n,s,o){return new Ne({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:j.toString(o)}]})}_addCheck(e){return new Ne({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ne.create=t=>new Ne({checks:[],typeName:A.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});class Sn extends R{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const s=this._getOrReturnCtx(e);return w(s,{code:x.invalid_type,expected:k.boolean,received:s.parsedType}),P}return Z(e.data)}}Sn.create=t=>new Sn({typeName:A.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class qe extends R{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const a=this._getOrReturnCtx(e);return w(a,{code:x.invalid_type,expected:k.date,received:a.parsedType}),P}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return w(a,{code:x.invalid_date}),P}const s=new U;let o;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:x.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(o=this._getOrReturnCtx(e,o),w(o,{code:x.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):F.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qe({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}qe.create=t=>new qe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:A.ZodDate,...L(t)});class Tn extends R{_parse(e){if(this._getType(e)!==k.symbol){const s=this._getOrReturnCtx(e);return w(s,{code:x.invalid_type,expected:k.symbol,received:s.parsedType}),P}return Z(e.data)}}Tn.create=t=>new Tn({typeName:A.ZodSymbol,...L(t)});class jn extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return w(s,{code:x.invalid_type,expected:k.undefined,received:s.parsedType}),P}return Z(e.data)}}jn.create=t=>new jn({typeName:A.ZodUndefined,...L(t)});class In extends R{_parse(e){if(this._getType(e)!==k.null){const s=this._getOrReturnCtx(e);return w(s,{code:x.invalid_type,expected:k.null,received:s.parsedType}),P}return Z(e.data)}}In.create=t=>new In({typeName:A.ZodNull,...L(t)});class En extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}En.create=t=>new En({typeName:A.ZodAny,...L(t)});class Pn extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}Pn.create=t=>new Pn({typeName:A.ZodUnknown,...L(t)});class se extends R{_parse(e){const n=this._getOrReturnCtx(e);return w(n,{code:x.invalid_type,expected:k.never,received:n.parsedType}),P}}se.create=t=>new se({typeName:A.ZodNever,...L(t)});class An extends R{_parse(e){if(this._getType(e)!==k.undefined){const s=this._getOrReturnCtx(e);return w(s,{code:x.invalid_type,expected:k.void,received:s.parsedType}),P}return Z(e.data)}}An.create=t=>new An({typeName:A.ZodVoid,...L(t)});class W extends R{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),o=this._def;if(n.parsedType!==k.array)return w(n,{code:x.invalid_type,expected:k.array,received:n.parsedType}),P;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,i=n.data.length<o.exactLength.value;(c||i)&&(w(n,{code:c?x.too_big:x.too_small,minimum:i?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),s.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(w(n,{code:x.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),s.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(w(n,{code:x.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((c,i)=>o.type._parseAsync(new ne(n,c,n.path,i)))).then(c=>U.mergeArray(s,c));const a=[...n.data].map((c,i)=>o.type._parseSync(new ne(n,c,n.path,i)));return U.mergeArray(s,a)}get element(){return this._def.type}min(e,n){return new W({...this._def,minLength:{value:e,message:j.toString(n)}})}max(e,n){return new W({...this._def,maxLength:{value:e,message:j.toString(n)}})}length(e,n){return new W({...this._def,exactLength:{value:e,message:j.toString(n)}})}nonempty(e){return this.min(1,e)}}W.create=(t,e)=>new W({type:t,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,...L(e)});function he(t){if(t instanceof V){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=te.create(he(s))}return new V({...t._def,shape:()=>e})}else return t instanceof W?new W({...t._def,type:he(t.element)}):t instanceof te?te.create(he(t.unwrap())):t instanceof ye?ye.create(he(t.unwrap())):t instanceof ie?ie.create(t.items.map(e=>he(e))):t}class V extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=F.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==k.object){const m=this._getOrReturnCtx(e);return w(m,{code:x.invalid_type,expected:k.object,received:m.parsedType}),P}const{status:s,ctx:o}=this._processInputParams(e),{shape:a,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof se&&this._def.unknownKeys==="strip"))for(const m in o.data)c.includes(m)||i.push(m);const d=[];for(const m of c){const f=a[m],h=o.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new ne(o,h,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof se){const m=this._def.unknownKeys;if(m==="passthrough")for(const f of i)d.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(m==="strict")i.length>0&&(w(o,{code:x.unrecognized_keys,keys:i}),s.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const f of i){const h=o.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new ne(o,h,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const m=[];for(const f of d){const h=await f.key,g=await f.value;m.push({key:h,value:g,alwaysSet:f.alwaysSet})}return m}).then(m=>U.mergeObjectSync(s,m)):U.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new V({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var a,c;const o=((c=(a=this._def).errorMap)==null?void 0:c.call(a,n,s).message)??s.defaultError;return n.code==="unrecognized_keys"?{message:j.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new V({...this._def,unknownKeys:"strip"})}passthrough(){return new V({...this._def,unknownKeys:"passthrough"})}extend(e){return new V({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new V({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:A.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new V({...this._def,catchall:e})}pick(e){const n={};for(const s of F.objectKeys(e))e[s]&&this.shape[s]&&(n[s]=this.shape[s]);return new V({...this._def,shape:()=>n})}omit(e){const n={};for(const s of F.objectKeys(this.shape))e[s]||(n[s]=this.shape[s]);return new V({...this._def,shape:()=>n})}deepPartial(){return he(this)}partial(e){const n={};for(const s of F.objectKeys(this.shape)){const o=this.shape[s];e&&!e[s]?n[s]=o:n[s]=o.optional()}return new V({...this._def,shape:()=>n})}required(e){const n={};for(const s of F.objectKeys(this.shape))if(e&&!e[s])n[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof te;)a=a._def.innerType;n[s]=a}return new V({...this._def,shape:()=>n})}keyof(){return Ps(F.objectKeys(this.shape))}}V.create=(t,e)=>new V({shape:()=>t,unknownKeys:"strip",catchall:se.create(),typeName:A.ZodObject,...L(e)});V.strictCreate=(t,e)=>new V({shape:()=>t,unknownKeys:"strict",catchall:se.create(),typeName:A.ZodObject,...L(e)});V.lazycreate=(t,e)=>new V({shape:t,unknownKeys:"strip",catchall:se.create(),typeName:A.ZodObject,...L(e)});class Ge extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function o(a){for(const i of a)if(i.result.status==="valid")return i.result;for(const i of a)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;const c=a.map(i=>new q(i.ctx.common.issues));return w(n,{code:x.invalid_union,unionErrors:c}),P}if(n.common.async)return Promise.all(s.map(async a=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let a;const c=[];for(const d of s){const m={...n,common:{...n.common,issues:[]},parent:null},f=d._parseSync({data:n.data,path:n.path,parent:m});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const i=c.map(d=>new q(d));return w(n,{code:x.invalid_union,unionErrors:i}),P}}get options(){return this._def.options}}Ge.create=(t,e)=>new Ge({options:t,typeName:A.ZodUnion,...L(e)});function It(t,e){const n=J(t),s=J(e);if(t===e)return{valid:!0,data:t};if(n===k.object&&s===k.object){const o=F.objectKeys(e),a=F.objectKeys(t).filter(i=>o.indexOf(i)!==-1),c={...t,...e};for(const i of a){const d=It(t[i],e[i]);if(!d.valid)return{valid:!1};c[i]=d.data}return{valid:!0,data:c}}else if(n===k.array&&s===k.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let a=0;a<t.length;a++){const c=t[a],i=e[a],d=It(c,i);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===k.date&&s===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ye extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=(a,c)=>{if(wn(a)||wn(c))return P;const i=It(a.value,c.value);return i.valid?((_n(a)||_n(c))&&n.dirty(),{status:n.value,value:i.data}):(w(s,{code:x.invalid_intersection_types}),P)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Ye.create=(t,e,n)=>new Ye({left:t,right:e,typeName:A.ZodIntersection,...L(n)});class ie extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.array)return w(s,{code:x.invalid_type,expected:k.array,received:s.parsedType}),P;if(s.data.length<this._def.items.length)return w(s,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&s.data.length>this._def.items.length&&(w(s,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...s.data].map((c,i)=>{const d=this._def.items[i]||this._def.rest;return d?d._parse(new ne(s,c,s.path,i)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>U.mergeArray(n,c)):U.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new ie({...this._def,rest:e})}}ie.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ie({items:t,typeName:A.ZodTuple,rest:null,...L(e)})};class Nn extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.map)return w(s,{code:x.invalid_type,expected:k.map,received:s.parsedType}),P;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([i,d],m)=>({key:o._parse(new ne(s,i,s.path,[m,"key"])),value:a._parse(new ne(s,d,s.path,[m,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const d of c){const m=await d.key,f=await d.value;if(m.status==="aborted"||f.status==="aborted")return P;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}})}else{const i=new Map;for(const d of c){const m=d.key,f=d.value;if(m.status==="aborted"||f.status==="aborted")return P;(m.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(m.value,f.value)}return{status:n.value,value:i}}}}Nn.create=(t,e,n)=>new Nn({valueType:e,keyType:t,typeName:A.ZodMap,...L(n)});class De extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==k.set)return w(s,{code:x.invalid_type,expected:k.set,received:s.parsedType}),P;const o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(w(s,{code:x.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&s.data.size>o.maxSize.value&&(w(s,{code:x.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const a=this._def.valueType;function c(d){const m=new Set;for(const f of d){if(f.status==="aborted")return P;f.status==="dirty"&&n.dirty(),m.add(f.value)}return{status:n.value,value:m}}const i=[...s.data.values()].map((d,m)=>a._parse(new ne(s,d,s.path,m)));return s.common.async?Promise.all(i).then(d=>c(d)):c(i)}min(e,n){return new De({...this._def,minSize:{value:e,message:j.toString(n)}})}max(e,n){return new De({...this._def,maxSize:{value:e,message:j.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}De.create=(t,e)=>new De({valueType:t,minSize:null,maxSize:null,typeName:A.ZodSet,...L(e)});class Dn extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Dn.create=(t,e)=>new Dn({getter:t,typeName:A.ZodLazy,...L(e)});class Et extends R{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return w(n,{received:n.data,code:x.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}}Et.create=(t,e)=>new Et({value:t,typeName:A.ZodLiteral,...L(e)});function Ps(t,e){return new xe({values:t,typeName:A.ZodEnum,...L(e)})}class xe extends R{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return w(n,{expected:F.joinValues(s),received:n.parsedType,code:x.invalid_type}),P}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return w(n,{received:n.data,code:x.invalid_enum_value,options:s}),P}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return xe.create(e,{...this._def,...n})}exclude(e,n=this._def){return xe.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}xe.create=Ps;class On extends R{_parse(e){const n=F.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==k.string&&s.parsedType!==k.number){const o=F.objectValues(n);return w(s,{expected:F.joinValues(o),received:s.parsedType,code:x.invalid_type}),P}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=F.objectValues(n);return w(s,{received:s.data,code:x.invalid_enum_value,options:o}),P}return Z(e.data)}get enum(){return this._def.values}}On.create=(t,e)=>new On({values:t,typeName:A.ZodNativeEnum,...L(e)});class Je extends R{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==k.promise&&n.common.async===!1)return w(n,{code:x.invalid_type,expected:k.promise,received:n.parsedType}),P;const s=n.parsedType===k.promise?n.data:Promise.resolve(n.data);return Z(s.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Je.create=(t,e)=>new Je({type:t,typeName:A.ZodPromise,...L(e)});class ve extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=this._def.effect||null,a={addIssue:c=>{w(s,c),c.fatal?n.abort():n.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){const c=o.transform(s.data,a);if(s.common.async)return Promise.resolve(c).then(async i=>{if(n.value==="aborted")return P;const d=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return d.status==="aborted"?P:d.status==="dirty"||n.value==="dirty"?Ie(d.value):d});{if(n.value==="aborted")return P;const i=this._def.schema._parseSync({data:c,path:s.path,parent:s});return i.status==="aborted"?P:i.status==="dirty"||n.value==="dirty"?Ie(i.value):i}}if(o.type==="refinement"){const c=i=>{const d=o.refinement(i,a);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?P:(i.status==="dirty"&&n.dirty(),c(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?P:(i.status==="dirty"&&n.dirty(),c(i.value).then(()=>({status:n.value,value:i.value}))))}if(o.type==="transform")if(s.common.async===!1){const c=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ge(c))return P;const i=o.transform(c.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(c=>ge(c)?Promise.resolve(o.transform(c.value,a)).then(i=>({status:n.value,value:i})):P);F.assertNever(o)}}ve.create=(t,e,n)=>new ve({schema:t,typeName:A.ZodEffects,effect:e,...L(n)});ve.createWithPreprocess=(t,e,n)=>new ve({schema:e,effect:{type:"preprocess",transform:t},typeName:A.ZodEffects,...L(n)});class te extends R{_parse(e){return this._getType(e)===k.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}te.create=(t,e)=>new te({innerType:t,typeName:A.ZodOptional,...L(e)});class ye extends R{_parse(e){return this._getType(e)===k.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ye.create=(t,e)=>new ye({innerType:t,typeName:A.ZodNullable,...L(e)});class Pt extends R{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===k.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Pt.create=(t,e)=>new Pt({innerType:t,typeName:A.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class At extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Xe(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}At.create=(t,e)=>new At({innerType:t,typeName:A.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class Ln extends R{_parse(e){if(this._getType(e)!==k.nan){const s=this._getOrReturnCtx(e);return w(s,{code:x.invalid_type,expected:k.nan,received:s.parsedType}),P}return{status:"valid",value:e.data}}}Ln.create=t=>new Ln({typeName:A.ZodNaN,...L(t)});class Tr extends R{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class Bt extends R{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?P:a.status==="dirty"?(n.dirty(),Ie(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?P:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(e,n){return new Bt({in:e,out:n,typeName:A.ZodPipeline})}}class Nt extends R{_parse(e){const n=this._def.innerType._parse(e),s=o=>(ge(o)&&(o.value=Object.freeze(o.value)),o);return Xe(n)?n.then(o=>s(o)):s(n)}unwrap(){return this._def.innerType}}Nt.create=(t,e)=>new Nt({innerType:t,typeName:A.ZodReadonly,...L(e)});var A;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(A||(A={}));const X=Q.create;se.create;W.create;Ge.create;Ye.create;ie.create;const st=Et.create,jr=xe.create;Je.create;te.create;ye.create;const Rn=E.createExtensionSchema({type:st("dashboard.summary").describe("Extension type, must be 'dashboard.summary'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this summary belongs to")},{rankable:!0}),ot=E.extensionPointId("ddk","dashboard","summary"),Ir=E.defineExtensionPoint({id:ot,contributionKey:"dashboardSummary",displayName:"Dashboard Summary",description:"Extension point for dashboard summary plugin configurations with view support",hasView:!0,isRankable:!0,schema:Rn,metadata:{exportName:"DashboardSummaryExtension",category:"Dashboard",tags:["dashboard","summary","visualization"]},validate:(t,e)=>{E.validateWithSchema(Rn,t,e)&&E.validateRankIfPresent(t,e)},transform:E.createViewAwareTransform()}),Er=ot,Pr=`${ot}.def`,Ar=`${ot}.view`,Fn=E.createExtensionSchema({type:st("dashboard.detail").describe("Extension type, must be 'dashboard.detail'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this detail belongs to")},{rankable:!0}),rt=E.extensionPointId("ddk","dashboard","detail"),Nr=E.defineExtensionPoint({id:rt,contributionKey:"dashboardDetail",displayName:"Dashboard Detail",description:"Extension point for dashboard detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Fn,metadata:{exportName:"DashboardDetailExtension",category:"Dashboard",tags:["dashboard","detail","visualization"]},validate:(t,e)=>{E.validateWithSchema(Fn,t,e)&&E.validateRankIfPresent(t,e)},transform:E.createViewAwareTransform()}),Dr=rt,Or=`${rt}.def`,Lr=`${rt}.view`,Mn=E.createExtensionSchema({type:st("dashboard.detail.pump").describe("Extension type, must be 'dashboard.detail.pump'"),dashboardKey:X().min(1,"Dashboard key is required").describe("Key used to match this extension with specific dashboard pumps")},{rankable:!0}),at=E.extensionPointId("ddk","dashboard","pump-detail"),Oe=E.defineExtensionPoint({id:at,contributionKey:"dashboardPumpDetail",displayName:"Dashboard Pump Detail",description:"Extension point for dashboard pump detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Mn,metadata:{exportName:"DashboardPumpDetailExtension"},validate:(t,e)=>{E.validateWithSchema(Mn,t,e)&&E.validateRankIfPresent(t,e)},transform:E.createViewAwareTransform()}),Rr=at,Fr=`${at}.def`,Mr=`${at}.view`,Vn=E.createExtensionSchema({cuiDescriptor:X().min(1,"CUI descriptor is required").describe("Descriptor used to identify and categorize the CUI functionality"),modalMode:jr(["fullscreen","maximized"]).optional().describe("Modal display mode for the CUI interface")}),it=E.extensionPointId("ddk","cui"),As=E.defineExtensionPoint({id:it,contributionKey:"cui",displayName:"CUI (Consumer User Interface)",description:"Extension point for CUI plugin configurations with view support",hasView:!0,isRankable:!1,schema:Vn,metadata:{exportName:"CuiExtension",category:"Interface",tags:["cui","user-interface","consumer"]},validate:(t,e)=>{E.validateWithSchema(Vn,t,e)&&E.validateDescriptorFormat("CUI descriptor",t.cuiDescriptor,e)},transform:E.createViewAwareTransform()}),Vr=it,Br=`${it}.def`,$r=`${it}.view`,Bn=E.createExtensionSchema({navDescriptor:X().min(1,"Navigation descriptor is required").describe("Descriptor used to identify and map the navigation functionality")}),ct=E.extensionPointId("ddk","nav","view"),Kr=E.defineExtensionPoint({id:ct,contributionKey:"navViews",displayName:"Navigation Views",description:"Extension point for navigation view plugin configurations with view support",hasView:!0,isRankable:!1,schema:Bn,metadata:{exportName:"NavViewExtension",category:"Navigation",tags:["navigation","nav","views","routing"]},validate:(t,e)=>{E.validateWithSchema(Bn,t,e)&&E.validateDescriptorFormat("Navigation descriptor",t.navDescriptor,e)},transform:E.createViewAwareTransform()}),Ur=ct,zr=`${ct}.def`,Zr=`${ct}.view`,$n=E.createExtensionSchema({setupDescriptor:X().min(1,"Setup descriptor is required").describe("Descriptor used to identify and categorize the setup step")},{rankable:!0}),lt=E.extensionPointId("ddk","setup"),$t=E.defineExtensionPoint({id:lt,contributionKey:"setupStep",displayName:"Setup Steps",description:"Extension point for setup step plugin configurations with view support",hasView:!0,isRankable:!0,schema:$n,metadata:{exportName:"SetupExtension",category:"Setup",tags:["setup","configuration","steps","wizard"]},validate:(t,e)=>{E.validateWithSchema($n,t,e)&&(E.validateDescriptorFormat("Setup descriptor",t.setupDescriptor,e),E.validateRankIfPresent(t,e))},transform:E.createViewAwareTransform()}),Hr=lt,Wr=`${lt}.def`,Xr=`${lt}.view`,Kn=E.createExtensionSchema({type:st("trouble.action").describe("Extension type, must be 'trouble.action'"),troubleType:X().min(1,"Trouble type is required").describe("Specific trouble type from TroubleContainer that triggers this action (e.g., 'pump-motor-fault', 'sensor-calibration-error'). This must match the exact trouble type string emitted by the device/system."),stateKey:X().min(1,"State key is required").describe("Normalized state key for grouping related troubles under a common UI experience (e.g., 'pumpProblem', 'sensorIssue'). Multiple troubleTypes can share the same stateKey to show the same troubleshooting component. If not provided, defaults to troubleType for 1:1 mapping."),stateValue:X().min(1,"State value is required").describe("Value set in the reactive state when this trouble becomes active (e.g., 'pump-failure', 'needs-calibration'). Used by other components to detect trouble categories and trigger appropriate responses. If not provided, defaults to troubleType.")},{rankable:!0}),dt=E.extensionPointId("ddk","trouble","action"),Qe=E.defineExtensionPoint({id:dt,contributionKey:"troubleActions",displayName:"Trouble Actions",description:"Extension point for trouble action plugin configurations with view support",hasView:!0,isRankable:!0,schema:Kn,metadata:{exportName:"TroubleActionExtension",category:"Trouble Management",tags:["trouble","action","state","error-handling"]},validate:(t,e)=>{E.validateWithSchema(Kn,t,e)&&E.validateRankIfPresent(t,e)},transform:E.createViewAwareTransform()}),qr=dt,Gr=`${dt}.def`,Yr=`${dt}.view`,Un=E.createExtensionSchema({viewKey:X().min(1,"View key is required").describe("Key identifying the UI region where this component should be rendered (e.g., 'settings.config', 'dashboard.sidebar'). Multiple plugins can contribute to the same viewKey, and all will be rendered in the designated region.")},{rankable:!0}),ut=E.extensionPointId("ddk","view"),Jr=E.defineExtensionPoint({id:ut,contributionKey:"views",displayName:"Views",description:"Extension point for view plugin configurations with regional rendering support",hasView:!0,isRankable:!0,schema:Un,metadata:{exportName:"ViewExtension",category:"UI Layout",tags:["views","ui","rendering","layout","regions"]},validate:(t,e)=>{E.validateWithSchema(Un,t,e)&&(t.viewKey&&(t.viewKey.includes(".")||e.addInfo(`ViewKey '${t.viewKey}' might benefit from dot notation (e.g., 'settings.config', 'dashboard.sidebar') for better organization`),["view","content","main"].includes(t.viewKey)&&e.addWarning(`ViewKey '${t.viewKey}' is very generic - consider using more specific keys like 'settings.main' or 'dashboard.content'`)),E.validateRankIfPresent(t,e))},transform:E.createViewAwareTransform()}),Qr=ut,ea=`${ut}.def`,ta=`${ut}.view`,na="ddk.ncui.utilities",zn={[$t.id]:"setupDescriptor",[As.id]:"cuiDescriptor",[na]:"utilDescriptor"},Ns=({defaultNamespace:t,extensionPoint:e})=>{const{getExtensions:n}=ae.useKosPluginsContext(),s=n(e),o=s.map(d=>d.data.namespace)||[],{t:a}=u.useKosTranslation([t,...new Set(o)]),c=s.reduce((d,m)=>{const f=m,h=f.data;return d[h[zn[e]]]={extension:e,module:f.id,namespace:h.namespace,title:h.title},d},{}),i=s.reduce((d,m)=>{const h=m.data;return d[h[zn[e]]]=`${h.namespace}:${h.title}`,d},{});return{namespaces:o,t:a,labelMap:i,contributionMap:c}},Ce=(t,e)=>{const n=p.useMemo(()=>({agitate:cs,calibrate:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ms,{pump:m,onComplete:d})},calibrateSPM:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.SpmPump.type);return r.jsx(so,{pump:m,onComplete:d})},diagnostics:({holder:c,pump:i,onComplete:d})=>{const m=u.getKosCompanionModel(i??c.pumps.data[0],K.FcmPump.type);return r.jsx(ws,{pump:m,onComplete:d})},"replace-pump":({holder:c,pump:i,onComplete:d})=>r.jsx(Js,{pump:i??c.pumps.data[0],onComplete:d}),"rfid-override":Qs,"replace-line":({holder:c,onComplete:i})=>r.jsx(Ys,{holder:c,onComplete:i})}),[]),[s,o]=p.useState(void 0),a=s?n[s]:void 0;return{holderExperience:a?r.jsx(a,{holder:t,pump:e,onComplete:()=>{o(void 0)}}):void 0,setHolderExperience:o,currentExperienceId:s}},Kt=p.createContext(void 0),sa=({children:t,value:e})=>r.jsx(Kt.Provider,{value:e,children:t}),oa=t=>({HolderContent:void 0}),Ut=(t,e=oa)=>{const n=p.useContext(Kt);return e=(n==null?void 0:n.actionFactory)||e,e(t)},zt=()=>{const t=N.IngredientSummary.type;return u.useKosModel({modelId:t,modelType:N.IngredientSummary.type,options:{}})};function ra(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,ingredientSummary:n})})}}const Zt=()=>{const t=N.MacroAssignment.type;return u.useKosModel({modelId:t,modelType:N.MacroAssignment.type,options:{}})};function Ds(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Zt();return r.jsx(o,{...s,children:r.jsx(t,{...e,macroAssignment:n})})}}const Ht=t=>{const e=t;return u.useKosModel({modelId:e,modelType:N.NetworkTest.type,options:{}})};function aa(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Ht(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,networkTest:s})})}}const Wt=()=>{const t=N.NetworkTestContainer.type;return u.useKosModel({modelId:t,modelType:N.NetworkTestContainer.type,options:{}})};function Os(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Wt();return r.jsx(o,{...s,children:r.jsx(t,{...e,networkTestContainer:n})})}}const Ls=()=>{const t=N.NutritiveSweetener.type;return u.useKosModel({modelId:t,modelType:N.NutritiveSweetener.type,options:{}})};function ia(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ls();return r.jsx(o,{...s,children:r.jsx(t,{...e,nutritiveSweetener:n})})}}const Rs=()=>{const t=N.PlainWater.type;return u.useKosModel({modelId:t,modelType:N.PlainWater.type,options:{},destroyOnUnmount:!0})};function ca(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Rs();return r.jsx(o,{...s,children:r.jsx(t,{...e,plainWater:n})})}}const la=t=>{switch(t.type){case"fcm":return K.FcmPump.type;case"lfcv":return K.LfcvPump.type;case"micro":return K.SpmPump.type;case"cgp":return K.CgpPump.type;default:return}},ee="pluginVisibility",We=new Map;u.registerExtensionPoint(ee,{register:(t,e)=>{var n;We.has(t)||We.set(t,[]),(n=We.get(t))==null||n.push(e)},execute:(t,e,n)=>{const s=We.get(t);if(!s)return!0;const o=s.map(a=>a(e,n));return o.length===0?!0:!o.includes(!1)}});class Fs{constructor(e,n){M(this,"core");M(this,"dispense");this.core=e,this.dispense=n}registerDashboardVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}registerNavVisibilityFilter(e){return u.ExtensionManager[ee].register(ee,e),this}}class da{constructor(){M(this,"dispense");M(this,"core");M(this,"plugin");this.dispense=new Dt.DispenseExtensionManager,this.core=new u.CoreExtensionManager,this.plugin=new Fs(this.core,this.dispense)}}const Re=t=>t?Ms(t.type):{action:"",label:"",progress:"",summary:""},Ms=t=>{const e=`troubles:troubles.${t}`;return{action:`${e}.action`,label:`${e}.label`,progress:`${e}.progress`,summary:`${e}.summary`}},Fe=t=>{const e=ae.useReactiveExtensionRegistry(),[,n]=p.useState({}),[s]=p.useState(new Set);return p.useEffect(()=>{const a=[];return s.forEach(c=>{const i=e.subscribe(c,()=>{n({})});a.push(i)}),()=>{a.forEach(c=>c())}},[e,s]),{getExtensions:p.useCallback(a=>(s.add(a),Object.values(e.getExtensions(a,!1)).filter(d=>{const m=d.id;return u.ExtensionManager[ee].execute(ee,m,t)})),[e,t,s])}},mt=()=>{const t=N.Reboot.type;return u.useKosModel({modelId:t,modelType:N.Reboot.type,options:{}})};function ua(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=mt();return r.jsx(o,{...s,children:r.jsx(t,{...e,reboot:n})})}}const pt=()=>{const t=N.Settings.type;return u.useKosModel({modelId:t,modelType:N.Settings.type,options:{}})};function Xt(t){return e=>{const{model:n,status:s,KosModelLoader:o}=pt();return r.jsx(o,{...s,children:r.jsx(t,{...e,settings:n})})}}const qt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:N.SetupStep.type,options:{}})};function ma(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=qt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,setupStep:s})})}}const Gt=()=>{const t=N.SetupStepContainer.type;return u.useKosModel({modelId:t,modelType:N.SetupStepContainer.type,options:{}})};function Vs(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Gt();return r.jsx(o,{...s,children:r.jsx(t,{...e,setupStepContainer:n})})}}const Bs=t=>{const[e,n]=p.useState(),[s,o]=ce(t),a=e&&e>0;return p.useEffect(()=>{async function c(){if((t==null?void 0:t.ingredientId)!==void 0){const i=await(t==null?void 0:t.resolveIntentVolume("CALIBRATE"));n(Math.round(i.volume))}}c()},[t,t==null?void 0:t.ingredientId]),{calibrateVolume:e,canCalibrate:a,action:s,handleAction:o}},$s=()=>{const t=N.Start.type;return u.useKosModel({modelId:t,modelType:N.Start.type,options:{}})};function pa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=$s();return r.jsx(o,{...s,children:r.jsx(t,{...e,start:n})})}}const Yt=()=>{const t=N.TroubleActionManager.type,{getExtensions:e}=Fe(),n=e(Qe.id).map(o=>o.data);return u.useKosModel({modelId:t,modelType:N.TroubleActionManager.type,options:{definitions:n}})};function ha(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Yt();return r.jsx(o,{...s,children:r.jsx(t,{...e,troubleAction:n})})}}const ht=t=>{const[e,n]=p.useState({});return p.useEffect(()=>{async function s(){if(t){const o=await u.troubleDataFactory(t);n(o)}}s()},[t]),e},fa=t=>!t||t==="white",ga=t=>t?void 0:"white",Ks=t=>{if(!u.isTroubleAware(t))return{};const e=t,{visibleTroubles:n,initialized:s}=we(e),o=(n==null?void 0:n.length)??0,a=n==null?void 0:n[0],c=o>0,i=c?`${a==null?void 0:a.color}`:void 0,d=fa(i),m=c?ga(d):void 0;return{backgroundColor:i,fontColor:m,highestTrouble:a,initialized:s,troubleCount:o,hasTroubles:c}},xa=({troubleType:t,condition:e})=>{const{model:n}=u.useTroubleContainerModel(),[s,o]=p.useState(!1),[a,c]=p.useState([]);return p.useEffect(()=>u.kosAutoEffect(()=>{const d=(t?n==null?void 0:n.troubles.getIndexByKey("byType",t):n==null?void 0:n.troubles.data)||[],m=e?d.filter(e):d;o(m.length>0),c(m)}),[e,n,t]),[s,a.length>0?a[0]:void 0,a]},Jt=t=>{const e=t;return u.useKosModel({modelId:e,modelType:N.Utilities.type,options:{}})};function va(t){return e=>n=>{const{model:s,status:o,KosModelLoader:a}=Jt(e);return r.jsx(a,{...o,children:r.jsx(t,{...n,utilities:s})})}}const Qt=()=>{const t=N.UtilitiesContainer.type;return u.useKosModel({modelId:t,modelType:N.UtilitiesContainer.type,options:{}})};function ya(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Qt();return r.jsx(o,{...s,children:r.jsx(t,{...e,utilitiesContainer:n})})}}const Us=u.withDevice(u.kosComponent(({device:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),s=t.serialNumber==="unassigned"?void 0:t.serialNumber;return r.jsx(l.InfoCard,{label:e("dispenser-serial"),value:s})})),ba=Ts(u.kosComponent(({dispenserInfo:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile");return r.jsxs(r.Fragment,{children:[r.jsx(fs,{label:e("dispenser-name","Dispenser Name"),configProperty:t.name}),r.jsx(Us,{})]})})),Ca=Xt(u.kosComponent(({settings:t})=>{const{t:e}=u.useKosTranslation("dispenser-profile"),n=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return r.jsxs(r.Fragment,{children:[r.jsx(tt,{closeButtonLabel:e("close","Close")||void 0,configProperty:t==null?void 0:t.name,isValid:n,label:e("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),r.jsx(bs,{label:e("activate-and-reboot-time"),configProperty:t.activateAndRebootTime})]})})),zs=S(l.LabelDate)`
165
165
  color: var(--ddk-generic-color-grey-60);
166
166
  font-size: var(--ddk-component-enjoy-by-font-size-small);
167
167
  font-weight: var(--ddk-component-enjoy-by-font-weight-small);
168
- `,Ca=S(l.LabelDate)`
168
+ `,wa=S(l.LabelDate)`
169
169
  color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
170
- `,wa=S(Us)`
170
+ `,_a=S(zs)`
171
171
  color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
172
- `,en=({holder:t,size:e})=>{const{t:n}=u.useKosTranslation("common"),{regionModel:s}=u.useKosRegions(),o=!!t.enjoyByDate,a=t.enjoyByDate??new Date,{formattedDate:c}=u.useFormattedDate({year:a.getFullYear(),month:a.getMonth(),day:a.getDate(),formatString:(s==null?void 0:s.selectedDateFormat)||""}),i=t.hasEnjoyByWarning?e==="small"?wa:Ca:e==="small"?Us:l.LabelDate;return o&&r.jsx(i,{children:n("enjoy-by",{data:{date:c}})})},_a=({item:t,valueKey:e})=>{const{t:n}=u.useKosTranslation("hardware-info"),{linked:s}=t;if(e==="link.serialNum"&&!s)return r.jsx(l.LabelInformationExtraSmall,{children:n("not-connected")});const o=l.getItemData(t,e);return o||"—"},ka=S(l.Table)`
172
+ `,en=({holder:t,size:e})=>{const{t:n}=u.useKosTranslation("common"),{regionModel:s}=u.useKosRegions(),o=!!t.enjoyByDate,a=t.enjoyByDate??new Date,{formattedDate:c}=u.useFormattedDate({year:a.getFullYear(),month:a.getMonth(),day:a.getDate(),formatString:(s==null?void 0:s.selectedDateFormat)||""}),i=t.hasEnjoyByWarning?e==="small"?_a:wa:e==="small"?zs:l.LabelDate;return o&&r.jsx(i,{children:n("enjoy-by",{data:{date:c}})})},ka=({item:t,valueKey:e})=>{const{t:n}=u.useKosTranslation("hardware-info"),{linked:s}=t;if(e==="link.serialNum"&&!s)return r.jsx(l.LabelInformationExtraSmall,{children:n("not-connected")});const o=l.getItemData(t,e);return o||"—"},Sa=S(l.Table)`
173
173
  & ul {
174
174
  list-style-type: none;
175
175
  margin: 0;
176
176
  padding: 0;
177
177
  }
178
- `,Sa=u.kosComponent(()=>{const{model:t}=Dt.useBoardContainer(),{t:e}=u.useKosTranslation("hardware-info"),n=(t==null?void 0:t.boardList.map(s=>{var o,a,c;return{...s,link:{...s.link,firmwareVersions:(o=s.link)!=null&&o.firmwareVersions&&s.link.firmwareVersions.length>0?r.jsx("ul",{children:(c=(a=s.link)==null?void 0:a.firmwareVersions)==null?void 0:c.map((i,d)=>r.jsx("li",{children:i},d))}):"—"}}}))||[];return t&&t.boardList&&r.jsx(ka,{CellRenderer:_a,data:n,dataKeys:["name","type","link.hardwareVersion","link.serialNum","link.firmwareVersions"],headers:[e("name"),e("type"),e("revision"),e("serial-number"),e("firmware")],heading:e("tower")||void 0})}),ce=({disabled:t,model:e,onPour:n,onPourCancel:s,...o})=>{const{t:a}=u.useKosTranslation("common"),[c,i]=p.useState(e.isPouring?"halt":"idle"),d=p.useRef(),m=p.useRef(!1),f=250;p.useEffect(()=>u.kosAutoEffect(()=>{e.isPouring||(m.current=!1,clearTimeout(d.current),d.current=void 0,i("idle"))}),[e]),p.useEffect(()=>()=>{e.isPouring&&e.cancelPour()},[e]);const h=p.useCallback(()=>{e&&(t||e.isPouring||(e.performIntent("HOLD_TO_POUR"),d.current=setTimeout(()=>{m.current=!0,d.current=void 0,i("run")},f)))},[t,e]),g=p.useCallback(()=>{e&&(m.current?(e.cancelPour(),m.current=!1,i("idle")):d.current?(clearTimeout(d.current),d.current=void 0,i("halt")):e.isPouring&&(e.cancelPour(),i("idle")))},[e]),y=p.useCallback(()=>{c!=="halt"&&g()},[g,c]);return r.jsx(l.TapAndHoldButton,{disabled:t,mode:"primary",onPointerCancel:g,onPointerDown:h,onPointerOut:y,onPointerUp:g,...o,state:c,children:a(a(c==="idle"?"tapOrHoldToPour":c==="run"?"releaseToStop":"stop"))})},tn=p.createContext(void 0),Ta=({children:t})=>{const{model:e,ready:n}=Ft(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(tn.Provider,{value:s,children:t})},ja=()=>{const t=p.useContext(tn);if(!t)throw new Error("useAnimationContext must be used within a AnimationProvider");return t},Ia=_s(({animation:t,animationOverrides:e,children:n,componentModeOverride:s,modalModeOverride:o})=>{const[a,c]=p.useState(!0),[i,d]=p.useState(!0),[m,f]=p.useState(!0);return p.useEffect(()=>{const h=u.kosAutoEffect(()=>{const g=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableDial))&&!!(!t.disableAll.value&&t.enableDial.value),y=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableModal))&&!!(!t.disableAll.value&&t.enableModal.value),b=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableSideBar))&&!!(!t.disableAll.value&&t.enableSideBar.value);c(g),d(y),f(b)});return()=>{h()}},[t,e==null?void 0:e.disableAll,e==null?void 0:e.enableDial,e==null?void 0:e.enableModal,e==null?void 0:e.enableSideBar]),r.jsx(l.ComponentConfigurationProvider,{value:{componentModeOverride:s,enableDialAnimation:a,enableModalAnimation:i,enableSidebarAnimation:m,modalModeOverride:o},children:n})}),nn=p.createContext(void 0),Ea=({children:t})=>{const{model:e,ready:n}=Le(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(nn.Provider,{value:s,children:t})},ft=()=>{const t=p.useContext(nn);if(!t)throw new Error("useApplicationContext must be used within a ApplicationProvider");return t},sn=p.createContext(void 0),Pa=({children:t})=>{const{model:e,ready:n}=Mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(sn.Provider,{value:s,children:t})},Aa=()=>{const t=p.useContext(sn);if(!t)throw new Error("useDashboardOperationsContext must be used within a DashboardOperationsProvider");return t},on=p.createContext(void 0),Na=({children:t})=>{const{model:e,ready:n}=Bt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(on.Provider,{value:s,children:t})},Da=()=>{const t=p.useContext(on);if(!t)throw new Error("useDispenserInfoContext must be used within a DispenserInfoProvider");return t},rn=p.createContext(void 0),Oa=({children:t})=>{const{model:e,ready:n}=zt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(rn.Provider,{value:s,children:t})},La=()=>{const t=p.useContext(rn);if(!t)throw new Error("useIngredientSummaryContext must be used within a IngredientSummaryProvider");return t},an=p.createContext(void 0),Ra=({children:t})=>{const{model:e,ready:n}=Zt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(an.Provider,{value:s,children:t})},Fa=()=>{const t=p.useContext(an);if(!t)throw new Error("useMacroAssignmentContext must be used within a MacroAssignmentProvider");return t},cn=p.createContext(void 0),Ma=({children:t,id:e})=>{const{model:n,ready:s}=Ht(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return r.jsx(cn.Provider,{value:o,children:t})},Ba=()=>{const t=p.useContext(cn);if(!t)throw new Error("useNetworkTestContext must be used within a NetworkTestProvider");return t},ln=p.createContext(void 0),Va=({children:t})=>{const{model:e,ready:n}=Wt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(ln.Provider,{value:s,children:t})},$a=()=>{const t=p.useContext(ln);if(!t)throw new Error("useNetworkTestContainerContext must be used within a NetworkTestContainerProvider");return t},dn=p.createContext(void 0),Ka=({children:t})=>{const{model:e,ready:n}=mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(dn.Provider,{value:s,children:t})},Ua=()=>{const t=p.useContext(dn);if(!t)throw new Error("useRebootContext must be used within a RebootProvider");return t},un=p.createContext(void 0),za=({children:t})=>{const{model:e,ready:n}=pt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(un.Provider,{value:s,children:t})},Za=()=>{const t=p.useContext(un);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t},mn=p.createContext(void 0),Ha=({children:t,id:e})=>{const{model:n,ready:s}=qt(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return r.jsx(mn.Provider,{value:o,children:t})},Wa=()=>{const t=p.useContext(mn);if(!t)throw new Error("useSetupStepContext must be used within a SetupStepProvider");return t},pn=p.createContext(void 0),Xa=({children:t})=>{const{model:e,ready:n}=Gt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(pn.Provider,{value:s,children:t})},qa=()=>{const t=p.useContext(pn);if(!t)throw new Error("useSetupStepContainerContext must be used within a SetupStepContainerProvider");return t},hn=p.createContext(void 0),Ga=({children:t,id:e})=>{const{model:n,ready:s}=Jt(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return r.jsx(hn.Provider,{value:o,children:t})},Ya=()=>{const t=p.useContext(hn);if(!t)throw new Error("useUtilitiesContext must be used within a UtilitiesProvider");return t},fn=p.createContext(void 0),Ja=({children:t})=>{const{model:e,ready:n}=Qt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(fn.Provider,{value:s,children:t})},Qa=()=>{const t=p.useContext(fn);if(!t)throw new Error("useUtilitiesContainerContext must be used within a UtilitiesContainerProvider");return t},we=t=>{const{model:e}=ft(),[n,s]=p.useState(),o=e==null?void 0:e.currentRole,a=!!n;return p.useLayoutEffect(()=>{const c=u.kosAutoEffect(()=>{const i=t.troubles.filter(D.troubleVisibilityFilter(o));s(d=>{const m=d??[];return i.length!==m.length||i.some(f=>!m.includes(f))?i:m})});return()=>{c()}},[t,o]),{visibleTroubles:n,initialized:a}},zs=u.KosLog.createLogger({name:"holder-group-view"});zs.debug("holder-group-view component loaded");const Zn=S.div`
178
+ `,Ta=u.kosComponent(()=>{const{model:t}=Dt.useBoardContainer(),{t:e}=u.useKosTranslation("hardware-info"),n=(t==null?void 0:t.boardList.map(s=>{var o,a,c;return{...s,link:{...s.link,firmwareVersions:(o=s.link)!=null&&o.firmwareVersions&&s.link.firmwareVersions.length>0?r.jsx("ul",{children:(c=(a=s.link)==null?void 0:a.firmwareVersions)==null?void 0:c.map((i,d)=>r.jsx("li",{children:i},d))}):"—"}}}))||[];return t&&t.boardList&&r.jsx(Sa,{CellRenderer:ka,data:n,dataKeys:["name","type","link.hardwareVersion","link.serialNum","link.firmwareVersions"],headers:[e("name"),e("type"),e("revision"),e("serial-number"),e("firmware")],heading:e("tower")||void 0})}),le=({disabled:t,model:e,onPour:n,onPourCancel:s,...o})=>{const{t:a}=u.useKosTranslation("common"),[c,i]=p.useState(e.isPouring?"halt":"idle"),d=p.useRef(),m=p.useRef(!1),f=250;p.useEffect(()=>u.kosAutoEffect(()=>{e.isPouring||(m.current=!1,clearTimeout(d.current),d.current=void 0,i("idle"))}),[e]),p.useEffect(()=>()=>{e.isPouring&&e.cancelPour()},[e]);const h=p.useCallback(()=>{e&&(t||e.isPouring||(e.performIntent("HOLD_TO_POUR"),d.current=setTimeout(()=>{m.current=!0,d.current=void 0,i("run")},f)))},[t,e]),g=p.useCallback(()=>{e&&(m.current?(e.cancelPour(),m.current=!1,i("idle")):d.current?(clearTimeout(d.current),d.current=void 0,i("halt")):e.isPouring&&(e.cancelPour(),i("idle")))},[e]),y=p.useCallback(()=>{c!=="halt"&&g()},[g,c]);return r.jsx(l.TapAndHoldButton,{disabled:t,mode:"primary",onPointerCancel:g,onPointerDown:h,onPointerOut:y,onPointerUp:g,...o,state:c,children:a(a(c==="idle"?"tapOrHoldToPour":c==="run"?"releaseToStop":"stop"))})},tn=p.createContext(void 0),ja=({children:t})=>{const{model:e,ready:n}=Ft(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(tn.Provider,{value:s,children:t})},Ia=()=>{const t=p.useContext(tn);if(!t)throw new Error("useAnimationContext must be used within a AnimationProvider");return t},Ea=_s(({animation:t,animationOverrides:e,children:n,componentModeOverride:s,modalModeOverride:o})=>{const[a,c]=p.useState(!0),[i,d]=p.useState(!0),[m,f]=p.useState(!0);return p.useEffect(()=>{const h=u.kosAutoEffect(()=>{const g=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableDial))&&!!(!t.disableAll.value&&t.enableDial.value),y=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableModal))&&!!(!t.disableAll.value&&t.enableModal.value),b=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableSideBar))&&!!(!t.disableAll.value&&t.enableSideBar.value);c(g),d(y),f(b)});return()=>{h()}},[t,e==null?void 0:e.disableAll,e==null?void 0:e.enableDial,e==null?void 0:e.enableModal,e==null?void 0:e.enableSideBar]),r.jsx(l.ComponentConfigurationProvider,{value:{componentModeOverride:s,enableDialAnimation:a,enableModalAnimation:i,enableSidebarAnimation:m,modalModeOverride:o},children:n})}),nn=p.createContext(void 0),Pa=({children:t})=>{const{model:e,ready:n}=Le(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(nn.Provider,{value:s,children:t})},ft=()=>{const t=p.useContext(nn);if(!t)throw new Error("useApplicationContext must be used within a ApplicationProvider");return t},sn=p.createContext(void 0),Aa=({children:t})=>{const{model:e,ready:n}=Mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(sn.Provider,{value:s,children:t})},Na=()=>{const t=p.useContext(sn);if(!t)throw new Error("useDashboardOperationsContext must be used within a DashboardOperationsProvider");return t},on=p.createContext(void 0),Da=({children:t})=>{const{model:e,ready:n}=Vt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(on.Provider,{value:s,children:t})},Oa=()=>{const t=p.useContext(on);if(!t)throw new Error("useDispenserInfoContext must be used within a DispenserInfoProvider");return t},rn=p.createContext(void 0),La=({children:t})=>{const{model:e,ready:n}=zt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(rn.Provider,{value:s,children:t})},Ra=()=>{const t=p.useContext(rn);if(!t)throw new Error("useIngredientSummaryContext must be used within a IngredientSummaryProvider");return t},an=p.createContext(void 0),Fa=({children:t})=>{const{model:e,ready:n}=Zt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(an.Provider,{value:s,children:t})},Ma=()=>{const t=p.useContext(an);if(!t)throw new Error("useMacroAssignmentContext must be used within a MacroAssignmentProvider");return t},cn=p.createContext(void 0),Va=({children:t,id:e})=>{const{model:n,ready:s}=Ht(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return r.jsx(cn.Provider,{value:o,children:t})},Ba=()=>{const t=p.useContext(cn);if(!t)throw new Error("useNetworkTestContext must be used within a NetworkTestProvider");return t},ln=p.createContext(void 0),$a=({children:t})=>{const{model:e,ready:n}=Wt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(ln.Provider,{value:s,children:t})},Ka=()=>{const t=p.useContext(ln);if(!t)throw new Error("useNetworkTestContainerContext must be used within a NetworkTestContainerProvider");return t},dn=p.createContext(void 0),Ua=({children:t})=>{const{model:e,ready:n}=mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(dn.Provider,{value:s,children:t})},za=()=>{const t=p.useContext(dn);if(!t)throw new Error("useRebootContext must be used within a RebootProvider");return t},un=p.createContext(void 0),Za=({children:t})=>{const{model:e,ready:n}=pt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(un.Provider,{value:s,children:t})},Ha=()=>{const t=p.useContext(un);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t},mn=p.createContext(void 0),Wa=({children:t,id:e})=>{const{model:n,ready:s}=qt(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return r.jsx(mn.Provider,{value:o,children:t})},Xa=()=>{const t=p.useContext(mn);if(!t)throw new Error("useSetupStepContext must be used within a SetupStepProvider");return t},pn=p.createContext(void 0),qa=({children:t})=>{const{model:e,ready:n}=Gt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(pn.Provider,{value:s,children:t})},Ga=()=>{const t=p.useContext(pn);if(!t)throw new Error("useSetupStepContainerContext must be used within a SetupStepContainerProvider");return t},hn=p.createContext(void 0),Ya=({children:t,id:e})=>{const{model:n,ready:s}=Jt(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return r.jsx(hn.Provider,{value:o,children:t})},Ja=()=>{const t=p.useContext(hn);if(!t)throw new Error("useUtilitiesContext must be used within a UtilitiesProvider");return t},fn=p.createContext(void 0),Qa=({children:t})=>{const{model:e,ready:n}=Qt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return r.jsx(fn.Provider,{value:s,children:t})},ei=()=>{const t=p.useContext(fn);if(!t)throw new Error("useUtilitiesContainerContext must be used within a UtilitiesContainerProvider");return t},we=t=>{const{model:e}=ft(),[n,s]=p.useState(),o=e==null?void 0:e.currentRole,a=!!n;return p.useLayoutEffect(()=>{const c=u.kosAutoEffect(()=>{const i=t.troubles.filter(N.troubleVisibilityFilter(o));s(d=>{const m=d??[];return i.length!==m.length||i.some(f=>!m.includes(f))?i:m})});return()=>{c()}},[t,o]),{visibleTroubles:n,initialized:a}},Zs=u.KosLog.createLogger({name:"holder-group-view"});Zs.debug("holder-group-view component loaded");const Zn=S.div`
179
179
  align-items: start;
180
180
 
181
181
  display: flex;
@@ -185,15 +185,15 @@
185
185
  text-overflow: ellipsis;
186
186
  width: 100%;
187
187
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
188
- `,ei=S.div`
188
+ `,ti=S.div`
189
189
  display: flex;
190
190
  align-items: center;
191
191
  justify-content: center;
192
192
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
193
- `,ti=S.div`
193
+ `,ni=S.div`
194
194
  font-size: var(--ddk-component-holder-card-footer-font-size);
195
195
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
196
- `,ni=t=>!t||t==="white",si=t=>t?void 0:"white",oi=(t,e)=>e&&e.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":t?void 0:"white",Zs=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s})=>{const{model:o}=Le(),{visibleTroubles:a,initialized:c}=we(t),i=o==null?void 0:o.currentRole,{t:d}=u.useKosTranslation("troubles"),{t:m}=u.useKosTranslation("common"),{componentModeOverride:f}=l.useComponentConfigurationContext(),h=f==="compact",{getExtensions:g}=Fe();let y=!1;const b=u.getKosCompanionModel(t,K.FreestyleHolder.type);b!=null&&b.isRemote&&(zs.warn("Holder is remote, skipping rendering"),y=!0);const[v,w]=p.useState(!1),P=!!t.ingredientId,O=p.useCallback(()=>{w(!1)},[]),E=(a==null?void 0:a.length)??0,j=a==null?void 0:a[0],_=E>0,$=ht(j),z=t.hasFuelGuage,Y=t.fillPercent,Be=t.removed?"var(--ddk-component-dashboard-card-background-color-unassigned)":y?"var(--ddk-generic-color-grey-50)":_?`${j==null?void 0:j.color}`:P?void 0:"var(--ddk-component-dashboard-card-background-color-unassigned)",xt=t.removed?"var(--ddk-component-dashboard-card-header-background-color)":void 0,Ve=ni(Be),le=y?"white":t.unassigned?"var(--ddk-generic-color-grey-30)":_?si(Ve):P?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",$e=y?"white":_?oi(Ve,t):P?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",xn=l.useAbbreviation(t.name,h),_e=y?m("disabled"):t.removed?m(t.previousIngredientName):t.unassigned?m("unassigned"):m(t.ingredientName),Ke=r.jsx(Zn,{color:le,children:_e}),Ue=r.jsx(ei,{color:le,children:xn}),vt=r.jsxs(Zn,{children:[t.name," ",_e]}),ze=P&&z&&!_&&c?s??r.jsx(l.FuelGauge,{color:_?"var(--ddk-generic-color-white)":void 0,size:"small",value:Y}):null,yt=P&&z&&!_&&c&&l.getFillColor(Y)||void 0,ke=u.ExtensionManager.executeDashboardKeyFactory(t)||"",Ze=p.useMemo(()=>g(Oe.id),[g]),Se=p.useMemo(()=>Ze.filter(re=>!!re.data).reduce((re,yn)=>{const lo=yn.data;return re[lo.dashboardKey]=yn.data,re},{}),[Ze]),Te=!!Se[ke],{HolderContent:de,modalOptions:ue}=Ut(t),me=ae.useExtensionComponent(Oe),bt=p.useMemo(()=>{var re;return de?r.jsx(de,{holder:t,onComplete:O}):Te&&me?r.jsx(me,{module:(re=Se[ke])==null?void 0:re.id,holder:t}):void 0},[de,O,Se,Te,t,ke,me]),ro=Re(j),ao=r.jsx(ti,{color:_?le:$e,children:b!=null&&b.isRemote?m("remote-nns-active"):_?d(ro.summary,{context:j!=null&&j.deferred?"queued":void 0,data:$}):!h&&r.jsx(en,{size:"small",holder:t})}),{holderExperience:io,setHolderExperience:vn}=Ce(t),{future:He}=G(j),co=p.useCallback(()=>{y||t.sortedPumps.length<=0||(i==="technician"?w(!0):t.unassigned||t.removed?vn("rfid-override"):_&&(e==null||e(t)))},[y,t,i,vn,_,e]);return r.jsxs(r.Fragment,{children:[r.jsxs(l.Modal,{contain:!h,...ue,show:v,onClose:O,children:[r.jsx(l.Header,{contain:h,showCloseButton:!0,title:vt,onClose:O,CloseButton:h?l.BackButton:void 0}),bt]}),r.jsx(p.Suspense,{children:io}),r.jsx(l.HolderDashboardCard,{avatar:Ue,headerBackgroundColor:xt,backgroundColor:Be,footer:ao,cardId:t.path,errors:E,title:Ke,indicatorColor:yt,disabled:y,body:ze,showNavIcon:n,onCardSelect:co},t.path),(j==null?void 0:j.future)&&r.jsx(V,{title:Ke,future:He,failureMessage:d(`troubles.${j.type}.error`,{context:He==null?void 0:He.reason})})]})}),gn=S.div`
196
+ `,si=t=>!t||t==="white",oi=t=>t?void 0:"white",ri=(t,e)=>e&&e.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":t?void 0:"white",Hs=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s})=>{const{model:o}=Le(),{visibleTroubles:a,initialized:c}=we(t),i=o==null?void 0:o.currentRole,{t:d}=u.useKosTranslation("troubles"),{t:m}=u.useKosTranslation("common"),{componentModeOverride:f}=l.useComponentConfigurationContext(),h=f==="compact",{getExtensions:g}=Fe();let y=!1;const b=u.getKosCompanionModel(t,K.FreestyleHolder.type);b!=null&&b.isRemote&&(Zs.warn("Holder is remote, skipping rendering"),y=!0);const[v,_]=p.useState(!1),O=!!t.ingredientId,D=p.useCallback(()=>{_(!1)},[]),I=(a==null?void 0:a.length)??0,T=a==null?void 0:a[0],C=I>0,$=ht(T),z=t.hasFuelGuage,Y=t.fillPercent,Ve=t.removed?"var(--ddk-component-dashboard-card-background-color-unassigned)":y?"var(--ddk-generic-color-grey-50)":C?`${T==null?void 0:T.color}`:O?void 0:"var(--ddk-component-dashboard-card-background-color-unassigned)",xt=t.removed?"var(--ddk-component-dashboard-card-header-background-color)":void 0,Be=si(Ve),de=y?"white":t.unassigned?"var(--ddk-generic-color-grey-30)":C?oi(Be):O?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",$e=y?"white":C?ri(Be,t):O?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",xn=l.useAbbreviation(t.name,h),_e=y?m("disabled"):t.removed?m(t.previousIngredientName):t.unassigned?m("unassigned"):m(t.ingredientName),Ke=r.jsx(Zn,{color:de,children:_e}),Ue=r.jsx(ti,{color:de,children:xn}),vt=r.jsxs(Zn,{children:[t.name," ",_e]}),ze=O&&z&&!C&&c?s??r.jsx(l.FuelGauge,{color:C?"var(--ddk-generic-color-white)":void 0,size:"small",value:Y}):null,yt=O&&z&&!C&&c&&l.getFillColor(Y)||void 0,ke=u.ExtensionManager.executeDashboardKeyFactory(t)||"",Ze=p.useMemo(()=>g(Oe.id),[g]),Se=p.useMemo(()=>Ze.filter(re=>!!re.data).reduce((re,yn)=>{const uo=yn.data;return re[uo.dashboardKey]=yn.data,re},{}),[Ze]),Te=!!Se[ke],{HolderContent:ue,modalOptions:me}=Ut(t),pe=ae.useExtensionComponent(Oe),bt=p.useMemo(()=>{var re;return ue?r.jsx(ue,{holder:t,onComplete:D}):Te&&pe?r.jsx(pe,{module:(re=Se[ke])==null?void 0:re.id,holder:t}):void 0},[ue,D,Se,Te,t,ke,pe]),ao=Re(T),io=r.jsx(ni,{color:C?de:$e,children:b!=null&&b.isRemote?m("remote-nns-active"):C?d(ao.summary,{context:T!=null&&T.deferred?"queued":void 0,data:$}):!h&&r.jsx(en,{size:"small",holder:t})}),{holderExperience:co,setHolderExperience:vn}=Ce(t),{future:He}=G(T),lo=p.useCallback(()=>{y||t.sortedPumps.length<=0||(i==="technician"?_(!0):t.unassigned||t.removed?vn("rfid-override"):C&&(e==null||e(t)))},[y,t,i,vn,C,e]);return r.jsxs(r.Fragment,{children:[r.jsxs(l.Modal,{contain:!h,...me,show:v,onClose:D,children:[r.jsx(l.Header,{contain:h,showCloseButton:!0,title:vt,onClose:D,CloseButton:h?l.BackButton:void 0}),bt]}),r.jsx(p.Suspense,{children:co}),r.jsx(l.HolderDashboardCard,{avatar:Ue,headerBackgroundColor:xt,backgroundColor:Ve,footer:io,cardId:t.path,errors:I,title:Ke,indicatorColor:yt,disabled:y,body:ze,showNavIcon:n,onCardSelect:lo},t.path),(T==null?void 0:T.future)&&r.jsx(B,{title:Ke,future:He,failureMessage:d(`troubles.${T.type}.error`,{context:He==null?void 0:He.reason})})]})}),gn=S.div`
197
197
  display: flex;
198
198
  flex-direction: var(--ddk-component-dashboard-card-flex-direction);
199
199
  flex-wrap: nowrap;
@@ -202,7 +202,7 @@
202
202
  height: 100%;
203
203
  user-select: none;
204
204
  overflow: visible;
205
- `,ri=u.kosComponent(({holder:t,showNavIcons:e})=>{const n=t.troubles[0],s=()=>{n!=null&&n.resolvable&&n.resolve()};return r.jsx(Zs,{holder:t,showNavIcon:e,onHolderSelect:s},t.id)}),ai=u.kosComponent(({holders:t,showNavIcons:e,...n})=>{const s=p.useMemo(()=>t.map(o=>r.jsx(ri,{holder:o,showNavIcons:!!e},o.id)),[t,e]);return r.jsx(gn,{...n,children:s})}),ii=u.KosLog.createLogger({name:"holder-group-view"});ii.debug("holder-group-view component loaded");const Hn=["water","carb","ns","nns"],ci=S.div`
205
+ `,ai=u.kosComponent(({holder:t,showNavIcons:e})=>{const n=t.troubles[0],s=()=>{n!=null&&n.resolvable&&n.resolve()};return r.jsx(Hs,{holder:t,showNavIcon:e,onHolderSelect:s},t.id)}),ii=u.kosComponent(({holders:t,showNavIcons:e,...n})=>{const s=p.useMemo(()=>t.map(o=>r.jsx(ai,{holder:o,showNavIcons:!!e},o.id)),[t,e]);return r.jsx(gn,{...n,children:s})}),ci=u.KosLog.createLogger({name:"holder-group-view"});ci.debug("holder-group-view component loaded");const Hn=["water","carb","ns","nns"],li=S.div`
206
206
  display: flex;
207
207
  flex-direction: column;
208
208
  overflow-y: auto;
@@ -219,25 +219,25 @@
219
219
  text-overflow: ellipsis;
220
220
  width: 100%;
221
221
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
222
- `,li=S.div`
222
+ `,di=S.div`
223
223
  display: flex;
224
224
  align-items: center;
225
225
  justify-content: center;
226
226
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
227
- `,di=S.div`
227
+ `,ui=S.div`
228
228
  font-size: var(--ddk-component-holder-card-footer-font-size);
229
229
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
230
- `,ui=t=>!t||t==="white",mi=t=>t?void 0:"white",Hs=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n})=>{var Te,de;const{model:s}=Le(),{visibleTroubles:o,initialized:a}=we(t),{t:c}=u.useKosTranslation(["troubles","common"]),{componentModeOverride:i}=l.useComponentConfigurationContext(),d=i==="compact",{getExtensions:m}=Fe(),f=(Te=s==null?void 0:s.currentRole)==null?void 0:Te.toLowerCase(),[h,g]=p.useState(!1),y=!!t.ingredientId,b=(o==null?void 0:o.length)??0,v=o==null?void 0:o[0],w=o?o.length>0:!1,P=w?`${v==null?void 0:v.color}`:void 0,O=ui(P),E=w?mi(O):y?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",j=l.useAbbreviation(t.name,i==="compact"),_=c(`common:macros.${t.name}`),$=c(`common:${t.ingredientName}`),z=y?Hn.includes(t.name)?"":` ${$}`:` ${c("common:macros.unassigned")}`,Y=`${_}${z}`,Be=d?Hn.includes(t.name)?_:z:`${_} ${z}`,xt=i==="compact"&&r.jsx(li,{color:E,children:j}),Ve=r.jsx(Wn,{color:E,children:Be}),le=r.jsx(Wn,{children:Y}),$e=u.ExtensionManager.executeDashboardKeyFactory(t)||"",_e=m(Oe.id).filter(ue=>!!ue.data).reduce((ue,me)=>{const bt=me.data;return ue[bt.dashboardKey]=me.data,ue},{}),Ke=!!_e[$e],{HolderContent:Ue,modalOptions:vt}=Ut(t),ze=ae.useExtensionComponent(Oe),yt=Ue?r.jsx(Ue,{holder:t,onComplete:()=>g(!1)}):Ke&&ze?r.jsx(ze,{module:(de=_e[$e])==null?void 0:de.id,holder:t}):null,ke=Re(v),Ze=w?r.jsx(di,{color:E,children:c(ke.summary)}):null,Se=p.useCallback(()=>{t.sortedPumps.length>0&&(f==="technician"?g(!0):w&&(e==null||e(t)))},[w,t,e,f]);return r.jsxs(r.Fragment,{children:[r.jsx(l.HolderDashboardCard,{avatar:xt,backgroundColor:P,body:w?null:r.jsx(l.StatusIndicator,{size:"small",status:w?"pending":"completed"}),footer:Ze,cardId:t.path,errors:b,title:Ve,showNavIcon:n,onCardSelect:Se},t.path),r.jsx(l.Modal,{contain:i!=="compact",...vt,show:h,onClose:()=>g(!1),children:r.jsxs(ci,{children:[r.jsx(l.Header,{contain:i==="compact",showCloseButton:!0,title:le,onClose:()=>g(!1),CloseButton:i==="compact"?l.BackButton:void 0}),yt]})}),(v==null?void 0:v.future)&&r.jsx(V,{title:le,future:v==null?void 0:v.future})]})}),pi=u.kosComponent(({holders:t,showNavIcons:e,...n})=>r.jsx(gn,{...n,children:t.map(s=>{const o=s.troubles[0];return r.jsx(Hs,{holder:s,showNavIcon:e,onHolderSelect:()=>{o.resolvable&&o.resolve()}},s.id)})})),hi=S(ye.MessageInformationIconWithBackground)`
230
+ `,mi=t=>!t||t==="white",pi=t=>t?void 0:"white",Ws=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n})=>{var Te,ue;const{model:s}=Le(),{visibleTroubles:o,initialized:a}=we(t),{t:c}=u.useKosTranslation(["troubles","common"]),{componentModeOverride:i}=l.useComponentConfigurationContext(),d=i==="compact",{getExtensions:m}=Fe(),f=(Te=s==null?void 0:s.currentRole)==null?void 0:Te.toLowerCase(),[h,g]=p.useState(!1),y=!!t.ingredientId,b=(o==null?void 0:o.length)??0,v=o==null?void 0:o[0],_=o?o.length>0:!1,O=_?`${v==null?void 0:v.color}`:void 0,D=mi(O),I=_?pi(D):y?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",T=l.useAbbreviation(t.name,i==="compact"),C=c(`common:macros.${t.name}`),$=c(`common:${t.ingredientName}`),z=y?Hn.includes(t.name)?"":` ${$}`:` ${c("common:macros.unassigned")}`,Y=`${C}${z}`,Ve=d?Hn.includes(t.name)?C:z:`${C} ${z}`,xt=i==="compact"&&r.jsx(di,{color:I,children:T}),Be=r.jsx(Wn,{color:I,children:Ve}),de=r.jsx(Wn,{children:Y}),$e=u.ExtensionManager.executeDashboardKeyFactory(t)||"",_e=m(Oe.id).filter(me=>!!me.data).reduce((me,pe)=>{const bt=pe.data;return me[bt.dashboardKey]=pe.data,me},{}),Ke=!!_e[$e],{HolderContent:Ue,modalOptions:vt}=Ut(t),ze=ae.useExtensionComponent(Oe),yt=Ue?r.jsx(Ue,{holder:t,onComplete:()=>g(!1)}):Ke&&ze?r.jsx(ze,{module:(ue=_e[$e])==null?void 0:ue.id,holder:t}):null,ke=Re(v),Ze=_?r.jsx(ui,{color:I,children:c(ke.summary)}):null,Se=p.useCallback(()=>{t.sortedPumps.length>0&&(f==="technician"?g(!0):_&&(e==null||e(t)))},[_,t,e,f]);return r.jsxs(r.Fragment,{children:[r.jsx(l.HolderDashboardCard,{avatar:xt,backgroundColor:O,body:_?null:r.jsx(l.StatusIndicator,{size:"small",status:_?"pending":"completed"}),footer:Ze,cardId:t.path,errors:b,title:Be,showNavIcon:n,onCardSelect:Se},t.path),r.jsx(l.Modal,{contain:i!=="compact",...vt,show:h,onClose:()=>g(!1),children:r.jsxs(li,{children:[r.jsx(l.Header,{contain:i==="compact",showCloseButton:!0,title:de,onClose:()=>g(!1),CloseButton:i==="compact"?l.BackButton:void 0}),yt]})}),(v==null?void 0:v.future)&&r.jsx(B,{title:de,future:v==null?void 0:v.future})]})}),hi=u.kosComponent(({holders:t,showNavIcons:e,...n})=>r.jsx(gn,{...n,children:t.map(s=>{const o=s.troubles[0];return r.jsx(Ws,{holder:s,showNavIcon:e,onHolderSelect:()=>{o.resolvable&&o.resolve()}},s.id)})})),fi=S(be.MessageInformationIconWithBackground)`
231
231
  width: var(--ddk-component-macro-card-unavailable-icon-size);
232
232
  height: var(--ddk-component-macro-card-unavailable-icon-size);
233
- `,fi=S(l.UtilityModalHeading)`
233
+ `,gi=S(l.UtilityModalHeading)`
234
234
  text-align: center;
235
235
  font-size: var(--ddk-component-sub-modal-heading-font-size-medium);
236
- `,gi=S.div`
236
+ `,xi=S.div`
237
237
  height: 100%;
238
238
  overflow-y: auto;
239
239
  width: 100%;
240
- `,xi=S.div`
240
+ `,vi=S.div`
241
241
  display: grid;
242
242
  gap: var(--ddk-component-macro-setup-card-gap);
243
243
 
@@ -247,7 +247,7 @@
247
247
  justify-content: center;
248
248
  width: 100%;
249
249
  user-select: none;
250
- `,vi=t=>{const{componentModeOverride:e}=l.useComponentConfigurationContext();return r.jsx(xi,{compact:e==="compact",...t})},yi=S.div`
250
+ `,yi=t=>{const{componentModeOverride:e}=l.useComponentConfigurationContext();return r.jsx(vi,{compact:e==="compact",...t})},bi=S.div`
251
251
  align-items: center;
252
252
 
253
253
  background: ${t=>t.selected?"var(--ddk-generic-color-grey-5)":"var(--ddk-generic-color-white)"};
@@ -270,14 +270,14 @@
270
270
  overflow-wrap: anywhere;
271
271
  padding: var(--ddk-component-macro-setup-card-header-padding-md);
272
272
  text-align: center;
273
- `,bi=S.div`
273
+ `,Ci=S.div`
274
274
  align-items: center;
275
275
  display: flex;
276
276
  flex-direction: column;
277
277
  gap: 32px;
278
278
  height: 100%;
279
279
  justify-content: center;
280
- `,Ci=S.div`
280
+ `,wi=S.div`
281
281
  color: var(--ddk-component-macro-card-unavailable-font-color);
282
282
  font-size: var(--ddk-component-macro-card-unavailable-font-size);
283
283
  font-weight: var(--ddk-component-macro-card-unavailable-font-weight);
@@ -286,16 +286,16 @@
286
286
  flex-direction: column;
287
287
  gap: 24px;
288
288
  height: 100%;
289
- `;return r.jsxs(m,{children:[r.jsx(l.Content,{children:n.hasMacroIngredients?r.jsxs(r.Fragment,{children:[c==="standard"&&r.jsx(fi,{children:o("select-and-assign-ingredients-for",{data:{name:a(`macros.${t.name}`)}})}),r.jsx(gi,{children:r.jsx(vi,{children:n.macroIngredients.map(f=>r.jsx(yi,{selected:(i==null?void 0:i.id)===f.id,onPointerDown:()=>{i===f||d(f)},children:f.name},f.id))})})]}):r.jsxs(bi,{children:[r.jsx(hi,{}),r.jsx(Ci,{children:o("no-ingredients-available-for-assignment")})]})}),r.jsx(l.Footer,{children:n.hasMacroIngredients?r.jsxs(r.Fragment,{children:[c==="standard"&&s&&r.jsx(l.Button,{onPointerDown:()=>{e==null||e()},children:a("close")}),r.jsx(l.Button,{mode:"primary",disabled:!i||i.id===t.ingredientId,onPointerDown:async()=>{await t.assignIngredient(i==null?void 0:i.id),e==null||e()},children:a("assignIngredient")})]}):s!==!1&&r.jsx(l.Button,{mode:"primary",onPointerDown:()=>{e==null||e()},children:a("proceed")})})]})}),wi=u.kosComponent(({cardModel:t})=>{u.KosLog.debug("Agitator",t.path);const{t:e}=u.useKosTranslation(["agitator","common"]),n=p.useCallback(c=>{c==="agitate"?t==null||t.testAgitate():c==="gate"?t==null||t.testGate():c==="pour"?t==null||t.pourIce():c==="cancelPour"&&(t==null||t.cancelIceDispense())},[t]),s=[{name:e("agitator:agitation-duration"),value:t.durationSec.displayValue},{name:e("agitator:ice-max-dispense"),value:t.maxDispenseSec.displayValue},{name:e("agitator:agitate-after"),value:`${e("agitator:agitate-after-inactive",{data:{value:t.inactivitySec.displayValue}})},
290
- ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue}})}`},{name:e("agitator:ice-type"),value:t.type.displayValue}],o=t.isAgitating||t.isIceChuteOpen,a=t.agitateIsRunning||t.gateIsRunning;return r.jsxs(r.Fragment,{children:[r.jsxs(l.Content,{children:[r.jsx(l.FrameContainer,{name:"Ice Properties",children:r.jsx(l.FrameBody,{keyList:["name","value"],tableData:s})}),r.jsx(l.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")}),r.jsx(l.InfoCard,{label:"Ice Chute Open",value:t.isIceChuteOpen?e("common:yes"):e("common:no")})]}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:o,onPointerDown:()=>n("agitate"),children:e("action.label",{context:"agitator"})}),r.jsx(l.Button,{disabled:o,onPointerDown:()=>n("gate"),children:e("action.label",{context:"gate"})}),r.jsx(l.Button,{disabled:a,onPointerUp:()=>n("cancelPour"),onPointerDown:()=>n("pour"),children:e("action.label",{context:"pour"})})]}),t.agitateFuture&&r.jsx(V,{title:e("testing"),future:t.agitateFuture}),t.gateFuture&&r.jsx(V,{title:e("testing"),future:t.gateFuture})]})}),_i=S.div`
289
+ `;return r.jsxs(m,{children:[r.jsx(l.Content,{children:n.hasMacroIngredients?r.jsxs(r.Fragment,{children:[c==="standard"&&r.jsx(gi,{children:o("select-and-assign-ingredients-for",{data:{name:a(`macros.${t.name}`)}})}),r.jsx(xi,{children:r.jsx(yi,{children:n.macroIngredients.map(f=>r.jsx(bi,{selected:(i==null?void 0:i.id)===f.id,onPointerDown:()=>{i===f||d(f)},children:f.name},f.id))})})]}):r.jsxs(Ci,{children:[r.jsx(fi,{}),r.jsx(wi,{children:o("no-ingredients-available-for-assignment")})]})}),r.jsx(l.Footer,{children:n.hasMacroIngredients?r.jsxs(r.Fragment,{children:[c==="standard"&&s&&r.jsx(l.Button,{onPointerDown:()=>{e==null||e()},children:a("close")}),r.jsx(l.Button,{mode:"primary",disabled:!i||i.id===t.ingredientId,onPointerDown:async()=>{await t.assignIngredient(i==null?void 0:i.id),e==null||e()},children:a("assignIngredient")})]}):s!==!1&&r.jsx(l.Button,{mode:"primary",onPointerDown:()=>{e==null||e()},children:a("proceed")})})]})}),_i=u.kosComponent(({cardModel:t})=>{u.KosLog.debug("Agitator",t.path);const{t:e}=u.useKosTranslation(["agitator","common"]),n=p.useCallback(c=>{c==="agitate"?t==null||t.testAgitate():c==="gate"?t==null||t.testGate():c==="pour"?t==null||t.pourIce():c==="cancelPour"&&(t==null||t.cancelIceDispense())},[t]),s=[{name:e("agitator:agitation-duration"),value:t.durationSec.displayValue},{name:e("agitator:ice-max-dispense"),value:t.maxDispenseSec.displayValue},{name:e("agitator:agitate-after"),value:`${e("agitator:agitate-after-inactive",{data:{value:t.inactivitySec.displayValue}})},
290
+ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue}})}`},{name:e("agitator:ice-type"),value:t.type.displayValue}],o=t.isAgitating||t.isIceChuteOpen,a=t.agitateIsRunning||t.gateIsRunning;return r.jsxs(r.Fragment,{children:[r.jsxs(l.Content,{children:[r.jsx(l.FrameContainer,{name:"Ice Properties",children:r.jsx(l.FrameBody,{keyList:["name","value"],tableData:s})}),r.jsx(l.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")}),r.jsx(l.InfoCard,{label:"Ice Chute Open",value:t.isIceChuteOpen?e("common:yes"):e("common:no")})]}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:o,onPointerDown:()=>n("agitate"),children:e("action.label",{context:"agitator"})}),r.jsx(l.Button,{disabled:o,onPointerDown:()=>n("gate"),children:e("action.label",{context:"gate"})}),r.jsx(l.Button,{disabled:a,onPointerUp:()=>n("cancelPour"),onPointerDown:()=>n("pour"),children:e("action.label",{context:"pour"})})]}),t.agitateFuture&&r.jsx(B,{title:e("testing"),future:t.agitateFuture}),t.gateFuture&&r.jsx(B,{title:e("testing"),future:t.gateFuture})]})}),ki=S.div`
291
291
  font-size: var(--ddk-component-holder-card-footer-font-size);
292
292
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
293
- `,ki=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=u.useKosTranslation("common");return r.jsxs(r.Fragment,{children:[r.jsx(l.StatusIndicator,{size:"small",status:"completed"}),r.jsx(_i,{style:{visibility:t.cardModel.isAgitating?"visible":"hidden"},children:e("agitating")})]})}),Si=S.div`
293
+ `,Si=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=u.useKosTranslation("common");return r.jsxs(r.Fragment,{children:[r.jsx(l.StatusIndicator,{size:"small",status:"completed"}),r.jsx(ki,{style:{visibility:t.cardModel.isAgitating?"visible":"hidden"},children:e("agitating")})]})}),Ti=S.div`
294
294
  display: flex;
295
295
  flex-direction: column;
296
296
  gap: 24px;
297
297
  padding: 24px;
298
- `,Ti=Dt.withAssembly(({assembly:t,showHeading:e})=>r.jsx(Ws,{iceAgitator:t.iceAgitator,showHeading:e})),Ws=u.kosComponent(({iceAgitator:t,showHeading:e})=>{const{t:n}=u.useKosTranslation("about"),s=qn.useLocation(),{componentModeOverride:o}=l.useComponentConfigurationContext(),a=(t==null?void 0:t.iceTypes.map(i=>({id:i,label:i})))||[],c=p.useCallback(async()=>{(t==null?void 0:t.type.value)!==void 0&&(t==null||t.updateIceType(t.type.value))},[t]);return t?r.jsxs(l.TabContainer,{children:[e&&r.jsx(l.SettingsSubheading,{children:n("ice-settings","Ice Settings")}),o==="compact"?r.jsx(vs,{configProperty:t.type,onChange:i=>t.updateIceType(i),options:a,label:n("ice-type","Ice Type")}):r.jsx(nt,{configProperty:t.type,onSave:i=>t.updateIceType(i),items:a,label:n("ice-type","Ice Type")||void 0}),r.jsx(he,{configProperty:t.durationSec,label:n("agitation-duration","Agitation duration")||void 0}),r.jsx(he,{configProperty:t.inactivitySec,label:n("agitate-inactivity","Agitate after inactivity")||void 0}),r.jsx(he,{configProperty:t.volWithoutIceMl,label:n("agitate-without-ice","Agitate after poured without ice")||void 0}),o!=="compact"&&(s==null?void 0:s.pathname.includes("/settings"))&&r.jsx(l.Footer,{children:r.jsx(l.Button,{onPointerDown:c,children:n("reset")})})]}):"Ice model not loaded..."}),ji=u.kosComponent(({showHeading:t})=>{var d,m,f,h,g,y,b,v;const{t:e}=u.useKosTranslation("region"),{model:n}=pt(),{regionModel:s}=u.useKosRegions(),o=p.useCallback(w=>({id:w,label:e(`locale.country.${w}`)}),[e]),{selectedRegion:a,updateRegion:c,regionSelectProps:i}=u.useKosRegions(o);return r.jsxs(l.TabContainer,{children:[t&&r.jsx(l.SettingsSubheading,{children:e("localization","Localization")}),r.jsx(l.PickerCard,{cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,closeButtonLabel:e("close","Close")||void 0,displayValue:e(`locale.country.${a}`)||void 0,items:i.options,label:e("country","Country"),loop:!1,onSave:w=>c(w),proceedButtonLabel:e("save","Save")||void 0,selectedItemId:a}),((d=s==null?void 0:s.unitSystemOptions)==null?void 0:d.length)&&r.jsx(l.SwitchCard,{label:e("units-of-measurement","Units of Measurement"),options:(m=s==null?void 0:s.unitSystemOptions)==null?void 0:m.map(w=>({id:w.id,label:`${e(`locale.unit.${w.id}`)}/${e(`locale.units.${w.id}`)}`})),onChange:w=>s==null?void 0:s.setSelectedUnitSystem(String(w)),value:String(s==null?void 0:s.selectedUnitSystem).toLowerCase()}),r.jsx(l.PickerCard,{cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,closeButtonLabel:e("close","Close")||void 0,displayValue:(f=n==null?void 0:n.ncuiLanguage)!=null&&f.displayValue?e(`locale-ncui-language.${(h=n==null?void 0:n.ncuiLanguage)==null?void 0:h.displayValue}`):void 0,items:(b=(y=(g=n==null?void 0:n.ncuiLanguageData)==null?void 0:g.data)==null?void 0:y.languages)==null?void 0:b.map(({locale:w,name:P})=>({id:w,label:P})),label:e("non-consumer-language","Non-Consumer Language"),loop:!1,onSave:w=>{var P;return(P=n==null?void 0:n.ncuiLanguage)==null?void 0:P.updateProperty(w)},proceedButtonLabel:e("save","Save")||void 0,selectedItemId:(v=n==null?void 0:n.ncuiLanguage)==null?void 0:v.displayValue})]})});S.div`
298
+ `,ji=Dt.withAssembly(({assembly:t,showHeading:e})=>r.jsx(Xs,{iceAgitator:t.iceAgitator,showHeading:e})),Xs=u.kosComponent(({iceAgitator:t,showHeading:e})=>{const{t:n}=u.useKosTranslation("about"),s=qn.useLocation(),{componentModeOverride:o}=l.useComponentConfigurationContext(),a=(t==null?void 0:t.iceTypes.map(i=>({id:i,label:i})))||[],c=p.useCallback(async()=>{(t==null?void 0:t.type.value)!==void 0&&(t==null||t.updateIceType(t.type.value))},[t]);return t?r.jsxs(l.TabContainer,{children:[e&&r.jsx(l.SettingsSubheading,{children:n("ice-settings","Ice Settings")}),o==="compact"?r.jsx(vs,{configProperty:t.type,onChange:i=>t.updateIceType(i),options:a,label:n("ice-type","Ice Type")}):r.jsx(nt,{configProperty:t.type,onSave:i=>t.updateIceType(i),items:a,label:n("ice-type","Ice Type")||void 0}),r.jsx(fe,{configProperty:t.durationSec,label:n("agitation-duration","Agitation duration")||void 0}),r.jsx(fe,{configProperty:t.inactivitySec,label:n("agitate-inactivity","Agitate after inactivity")||void 0}),r.jsx(fe,{configProperty:t.volWithoutIceMl,label:n("agitate-without-ice","Agitate after poured without ice")||void 0}),o!=="compact"&&(s==null?void 0:s.pathname.includes("/settings"))&&r.jsx(l.Footer,{children:r.jsx(l.Button,{onPointerDown:c,children:n("reset")})})]}):"Ice model not loaded..."}),Ii=u.kosComponent(({showHeading:t})=>{var d,m,f,h,g,y,b,v;const{t:e}=u.useKosTranslation("region"),{model:n}=pt(),{regionModel:s}=u.useKosRegions(),o=p.useCallback(_=>({id:_,label:e(`locale.country.${_}`)}),[e]),{selectedRegion:a,updateRegion:c,regionSelectProps:i}=u.useKosRegions(o);return r.jsxs(l.TabContainer,{children:[t&&r.jsx(l.SettingsSubheading,{children:e("localization","Localization")}),r.jsx(l.PickerCard,{cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,closeButtonLabel:e("close","Close")||void 0,displayValue:e(`locale.country.${a}`)||void 0,items:i.options,label:e("country","Country"),loop:!1,onSave:_=>c(_),proceedButtonLabel:e("save","Save")||void 0,selectedItemId:a}),((d=s==null?void 0:s.unitSystemOptions)==null?void 0:d.length)&&r.jsx(l.SwitchCard,{label:e("units-of-measurement","Units of Measurement"),options:(m=s==null?void 0:s.unitSystemOptions)==null?void 0:m.map(_=>({id:_.id,label:`${e(`locale.unit.${_.id}`)}/${e(`locale.units.${_.id}`)}`})),onChange:_=>s==null?void 0:s.setSelectedUnitSystem(String(_)),value:String(s==null?void 0:s.selectedUnitSystem).toLowerCase()}),r.jsx(l.PickerCard,{cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,closeButtonLabel:e("close","Close")||void 0,displayValue:(f=n==null?void 0:n.ncuiLanguage)!=null&&f.displayValue?e(`locale-ncui-language.${(h=n==null?void 0:n.ncuiLanguage)==null?void 0:h.displayValue}`):void 0,items:(b=(y=(g=n==null?void 0:n.ncuiLanguageData)==null?void 0:g.data)==null?void 0:y.languages)==null?void 0:b.map(({locale:_,name:O})=>({id:_,label:O})),label:e("non-consumer-language","Non-Consumer Language"),loop:!1,onSave:_=>{var O;return(O=n==null?void 0:n.ncuiLanguage)==null?void 0:O.updateProperty(_)},proceedButtonLabel:e("save","Save")||void 0,selectedItemId:(v=n==null?void 0:n.ncuiLanguage)==null?void 0:v.displayValue})]})});S.div`
299
299
  display: flex;
300
300
  font-size: var(--ddk-generic-font-size-x-small);
301
301
  font-weight: normal;
@@ -329,11 +329,11 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
329
329
  display: flex;
330
330
  justify-content: flex-end;
331
331
  }
332
- `;const Ii=S.div`
332
+ `;const Ei=S.div`
333
333
  display: flex;
334
334
  align-items: center;
335
335
  justify-content: flex-end;
336
- `,Ei=({item:t,valueKey:e})=>{const{label:n,value:s}=t;if(e==="label")return r.jsx("div",{children:r.jsx("b",{children:n})});if(e==="value")return r.jsx(Ii,{children:s})},Pi=({groupName:t,networkTestContainer:e})=>{var s;const{t:n}=u.useKosTranslation("connectivity");return((s=e==null?void 0:e.models.getIndexByKey("group",t))==null?void 0:s.map(o=>{const a=t==="interface",c=a?o.results.map(i=>({label:i.name,value:i.val})):[];return a?r.jsx(l.Table,{CellRenderer:Ei,data:c,dataKeys:["label","value"],heading:o.name}):r.jsx(l.StatusCard,{leftLabel:n(`${o.name}`),rightLabel:o.inProgress?n("inProgress"):o.timestamp?o.passed?n("success"):n("Fail"):n("testNotRun"),type:o.inProgress?"InProgress":o.timestamp?o.passed?"Success":"Fail":"Default",failureMessage:n("failureMessage"),lastSuccess:o==null?void 0:o.timestamp,lastSuccessful:n("lastSuccessful")},o.id)}))||[]},Ai=Os(Pi),Ni=S.div`
336
+ `,Pi=({item:t,valueKey:e})=>{const{label:n,value:s}=t;if(e==="label")return r.jsx("div",{children:r.jsx("b",{children:n})});if(e==="value")return r.jsx(Ei,{children:s})},Ai=({groupName:t,networkTestContainer:e})=>{var s;const{t:n}=u.useKosTranslation("connectivity");return((s=e==null?void 0:e.models.getIndexByKey("group",t))==null?void 0:s.map(o=>{const a=t==="interface",c=a?o.results.map(i=>({label:i.name,value:i.val})):[];return a?r.jsx(l.Table,{CellRenderer:Pi,data:c,dataKeys:["label","value"],heading:o.name}):r.jsx(l.StatusCard,{leftLabel:n(`${o.name}`),rightLabel:o.inProgress?n("inProgress"):o.timestamp?o.passed?n("success"):n("Fail"):n("testNotRun"),type:o.inProgress?"InProgress":o.timestamp?o.passed?"Success":"Fail":"Default",failureMessage:n("failureMessage"),lastSuccess:o==null?void 0:o.timestamp,lastSuccessful:n("lastSuccessful")},o.id)}))||[]},Ni=Os(Ai),Di=S.div`
337
337
  background-color: var(--ddk-generic-color-grey-80);
338
338
  color: var(--ddk-generic-color-grey-5);
339
339
  border-radius: 5px;
@@ -342,14 +342,14 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
342
342
  align-items: center;
343
343
  justify-content: center;
344
344
  font-size: var(--ddk-generic-font-size-xx-small);
345
- `,Xs=u.kosComponent(({showAction:t=!0,trouble:e,showHolder:n})=>{var w;const{t:s}=u.useKosTranslation(["troubles"]),{model:o}=ft(),a=o==null?void 0:o.currentRole,c=ht(e),{action:i,label:d,progress:m}=Re(e),f=e.resolvable??!1,{future:h}=G(e),g=(w=e==null?void 0:e.data)!=null&&w.holderNames&&e.data.holderNames.length>0?r.jsx(Ni,{children:e.data.holderNames[0]}):null,y=(e==null?void 0:e.color)??"orange",b=(e==null?void 0:e.shouldDefer)??!1,v=(e==null?void 0:e.deferred)??!1;return r.jsxs(r.Fragment,{children:[r.jsx(l.NotificationCard,{label:s(d,{context:a==null?void 0:a.toLowerCase(),data:c}),indicatorColor:y,buttonLabel:t?v?"Queued":b?"Queue":s(i,{context:a,defaultValue:""}):void 0,date:e.createTime,prefix:n?g:void 0,onAction:t&&f&&!v?()=>{e.resolve()}:void 0}),h&&r.jsx(V,{title:s(m,{context:a}),future:v?void 0:h,failureMessage:s(`troubles.${e.type}.error`,{context:h!=null&&h.reason?"reason":void 0,data:{reason:h!=null&&h.reason?`__troubles.errors.${h==null?void 0:h.reason}__`:void 0}})})]})}),Di=({viewContainerId:t,extensionPointId:e,tabs:n,...s})=>{const{getExtensions:o}=ae.useKosPluginsContext(),a=o(t),c=o(e).reduce((h,g)=>(h[g.id]=g,h),{}),i=a.map(h=>h.data.namespace),{t:d}=u.useKosTranslation(["",...new Set(i)]),m=a.map(h=>{const g=h.data,y=[...g.settings].map(b=>{const v=c[b],w=v.data;return r.jsxs(l.TabContainer,{children:[r.jsx(l.SettingsSubheading,{children:d(`${w.namespace}:${w.title}`)}),r.jsx(ae.DynamicComponent,{extension:e,module:b})]},v.id)});return{id:h.id,label:d(`${g.namespace}:${g.title}`),content:r.jsx(l.TabViewLayout,{children:y})}}),f=[...n,...m];return r.jsx(l.TabRouter,{...s,tabs:f})},Me=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),{componentModeOverride:n}=l.useComponentConfigurationContext(),s=n==="compact",{visibleTroubles:o,initialized:a}=we(t),i=((o==null?void 0:o.length)??0)>0,d=!!t.troublesByType.FlushTrouble,m=!!t.troublesByType.PrimeTrouble,f=!!t.troublesByType.PurgeTrouble,h=d?t.troublesByType.FlushTrouble[0]:m?t.troublesByType.PrimeTrouble[0]:f?t.troublesByType.PurgeTrouble[0]:null,g=(h==null?void 0:h.shouldDefer)??!1,y=(h==null?void 0:h.deferred)??!1,[b,v]=be(t),w=p.useCallback(P=>{g?h==null||h.resolve():v(P)},[v,g,h]);return i&&a&&s?r.jsxs(r.Fragment,{children:[d?r.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>w("flush"),children:e("flush",{context:y?"queued":""})}):f?r.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>w("purge"),children:e("purge",{context:y?"queued":""})}):m?r.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>w("prime"),children:e("prime",{context:y?"queued":""})}):null,b&&r.jsx(V,{...b})]}):null}),oe=({holder:t,filter:e})=>{const{componentModeOverride:n}=l.useComponentConfigurationContext(),s=n==="standard",{visibleTroubles:o,initialized:a}=we(t),c=e?o==null?void 0:o.filter(e):o;return((c==null?void 0:c.length)??0)>0&&a&&(o==null?void 0:o.map(m=>r.jsx(Xs,{showAction:s,trouble:m},m.id)))},Oi=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=be(t),[o,a]=p.useState();p.useEffect(()=>{async function b(){if(t.ingredientId!==void 0){const v=await t.resolveIntentVolume("CALIBRATE");a(Math.round(v.volume))}}b()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0,{holderExperience:d,setHolderExperience:m,currentExperienceId:f}=Ce(t),h=c||f==="replace-line",g=t.pumps.data[0],y=u.getKosCompanionModel(g,K.CgpPump.type);return h?r.jsxs(r.Fragment,{children:[r.jsxs(l.Content,{contain:!0,children:[r.jsx(oe,{holder:t}),r.jsx(Li,{children:r.jsx(Lt,{probeAware:y})})]}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),r.jsx(l.Button,{onPointerDown:()=>m("replace-line"),children:e("replace-line")}),r.jsx(ce,{disabled:!c,model:t}),r.jsx(Me,{holder:t})]}),r.jsx(p.Suspense,{children:d}),n&&r.jsx(V,{...n})]}):r.jsx(gt,{showCloseButton:!1,holder:t})}),Li=S.div`
345
+ `,qs=u.kosComponent(({showAction:t=!0,trouble:e,showHolder:n})=>{var _;const{t:s}=u.useKosTranslation(["troubles"]),{model:o}=ft(),a=o==null?void 0:o.currentRole,c=ht(e),{action:i,label:d,progress:m}=Re(e),f=e.resolvable??!1,{future:h}=G(e),g=(_=e==null?void 0:e.data)!=null&&_.holderNames&&e.data.holderNames.length>0?r.jsx(Di,{children:e.data.holderNames[0]}):null,y=(e==null?void 0:e.color)??"orange",b=(e==null?void 0:e.shouldDefer)??!1,v=(e==null?void 0:e.deferred)??!1;return r.jsxs(r.Fragment,{children:[r.jsx(l.NotificationCard,{label:s(d,{context:a==null?void 0:a.toLowerCase(),data:c}),indicatorColor:y,buttonLabel:t?v?"Queued":b?"Queue":s(i,{context:a,defaultValue:""}):void 0,date:e.createTime,prefix:n?g:void 0,onAction:t&&f&&!v?()=>{e.resolve()}:void 0}),h&&r.jsx(B,{title:s(m,{context:a}),future:v?void 0:h,failureMessage:s(`troubles.${e.type}.error`,{context:h!=null&&h.reason?"reason":void 0,data:{reason:h!=null&&h.reason?`__troubles.errors.${h==null?void 0:h.reason}__`:void 0}})})]})}),Oi=({viewContainerId:t,extensionPointId:e,tabs:n,...s})=>{const{getExtensions:o}=ae.useKosPluginsContext(),a=o(t),c=o(e).reduce((h,g)=>(h[g.id]=g,h),{}),i=a.map(h=>h.data.namespace),{t:d}=u.useKosTranslation(["",...new Set(i)]),m=a.map(h=>{const g=h.data,y=[...g.settings].map(b=>{const v=c[b],_=v.data;return r.jsxs(l.TabContainer,{children:[r.jsx(l.SettingsSubheading,{children:d(`${_.namespace}:${_.title}`)}),r.jsx(ae.DynamicComponent,{extension:e,module:b})]},v.id)});return{id:h.id,label:d(`${g.namespace}:${g.title}`),content:r.jsx(l.TabViewLayout,{children:y})}}),f=[...n,...m];return r.jsx(l.TabRouter,{...s,tabs:f})},Me=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),{componentModeOverride:n}=l.useComponentConfigurationContext(),s=n==="compact",{visibleTroubles:o,initialized:a}=we(t),i=((o==null?void 0:o.length)??0)>0,d=!!t.troublesByType.FlushTrouble,m=!!t.troublesByType.PrimeTrouble,f=!!t.troublesByType.PurgeTrouble,h=d?t.troublesByType.FlushTrouble[0]:m?t.troublesByType.PrimeTrouble[0]:f?t.troublesByType.PurgeTrouble[0]:null,g=(h==null?void 0:h.shouldDefer)??!1,y=(h==null?void 0:h.deferred)??!1,[b,v]=ce(t),_=p.useCallback(O=>{g?h==null||h.resolve():v(O)},[v,g,h]);return i&&a&&s?r.jsxs(r.Fragment,{children:[d?r.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>_("flush"),children:e("flush",{context:y?"queued":""})}):f?r.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>_("purge"),children:e("purge",{context:y?"queued":""})}):m?r.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>_("prime"),children:e("prime",{context:y?"queued":""})}):null,b&&r.jsx(B,{...b})]}):null}),oe=({holder:t,filter:e})=>{const{componentModeOverride:n}=l.useComponentConfigurationContext(),s=n==="standard",{visibleTroubles:o,initialized:a}=we(t),c=e?o==null?void 0:o.filter(e):o;return((c==null?void 0:c.length)??0)>0&&a&&(o==null?void 0:o.map(m=>r.jsx(qs,{showAction:s,trouble:m},m.id)))},Li=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=ce(t),[o,a]=p.useState();p.useEffect(()=>{async function b(){if(t.ingredientId!==void 0){const v=await t.resolveIntentVolume("CALIBRATE");a(Math.round(v.volume))}}b()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0,{holderExperience:d,setHolderExperience:m,currentExperienceId:f}=Ce(t),h=c||f==="replace-line",g=t.pumps.data[0],y=u.getKosCompanionModel(g,K.CgpPump.type);return h?r.jsxs(r.Fragment,{children:[r.jsxs(l.Content,{contain:!0,children:[r.jsx(oe,{holder:t}),r.jsx(Ri,{children:r.jsx(Lt,{probeAware:y})})]}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),r.jsx(l.Button,{onPointerDown:()=>m("replace-line"),children:e("replace-line")}),r.jsx(le,{disabled:!c,model:t}),r.jsx(Me,{holder:t})]}),r.jsx(p.Suspense,{children:d}),n&&r.jsx(B,{...n})]}):r.jsx(gt,{showCloseButton:!1,holder:t})}),Ri=S.div`
346
346
  width: 100%;
347
347
  height: 100%;
348
348
  display: flex;
349
349
  justify-content: center;
350
350
  align-items: center;
351
351
  padding: 32px 0px;
352
- `,Ri=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=be(t),[o,a]=p.useState();p.useEffect(()=>{async function g(){if(t.ingredientId!==void 0){const y=await t.resolveIntentVolume("CALIBRATE");a(Math.round(y.volume))}}g()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0,{holderExperience:d,setHolderExperience:m,currentExperienceId:f}=Ce(t);return c||f==="replace-line"?r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{contain:!0,children:r.jsx(oe,{holder:t})}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),r.jsx(l.Button,{onPointerDown:()=>m("replace-line"),children:e("replace-line")}),r.jsx(ce,{disabled:!c,model:t}),r.jsx(Me,{holder:t})]}),r.jsx(p.Suspense,{children:d}),n&&r.jsx(V,{...n})]}):r.jsx(gt,{showCloseButton:!1,holder:t})}),Fi=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=be(t),[o,a]=p.useState();p.useEffect(()=>{async function d(){if(t.ingredientId!==void 0){const m=await t.resolveIntentVolume("CALIBRATE");a(Math.round(m.volume))}}d()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0;return c?r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{contain:!0,children:r.jsx(oe,{holder:t})}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),r.jsx(ce,{disabled:!c,model:t}),r.jsx(Me,{holder:t})]}),n&&r.jsx(V,{...n})]}):r.jsx(gt,{showCloseButton:!1,holder:t})}),Mi=S.div`
352
+ `,Fi=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=ce(t),[o,a]=p.useState();p.useEffect(()=>{async function g(){if(t.ingredientId!==void 0){const y=await t.resolveIntentVolume("CALIBRATE");a(Math.round(y.volume))}}g()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0,{holderExperience:d,setHolderExperience:m,currentExperienceId:f}=Ce(t);return c||f==="replace-line"?r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{contain:!0,children:r.jsx(oe,{holder:t})}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),r.jsx(l.Button,{onPointerDown:()=>m("replace-line"),children:e("replace-line")}),r.jsx(le,{disabled:!c,model:t}),r.jsx(Me,{holder:t})]}),r.jsx(p.Suspense,{children:d}),n&&r.jsx(B,{...n})]}):r.jsx(gt,{showCloseButton:!1,holder:t})}),Mi=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=ce(t),[o,a]=p.useState();p.useEffect(()=>{async function d(){if(t.ingredientId!==void 0){const m=await t.resolveIntentVolume("CALIBRATE");a(Math.round(m.volume))}}d()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0;return c?r.jsxs(r.Fragment,{children:[r.jsx(l.Content,{contain:!0,children:r.jsx(oe,{holder:t})}),r.jsxs(l.Footer,{children:[r.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),r.jsx(le,{disabled:!c,model:t}),r.jsx(Me,{holder:t})]}),n&&r.jsx(B,{...n})]}):r.jsx(gt,{showCloseButton:!1,holder:t})}),Vi=S.div`
353
353
  display: flex;
354
354
  flex-direction: column;
355
355
  gap: var(--ddk-component-super-pump-container-gap);
@@ -357,50 +357,50 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
357
357
  display: flex;
358
358
  flex-direction: column;
359
359
  gap: var(--ddk-component-cartridge-container-gap);
360
- `,qs=u.kosComponent(({holder:t})=>{const e=K.useFreestyleAssemblyContext(),{t:n}=u.useKosTranslation("common"),[s,o]=p.useState("all"),a=e==null?void 0:e.cartridgeAgitatorModels[0],c=!!t.ingredientId,i=t.pumps.getModel(s),d=u.getKosCompanionModel(t,K.FreestyleHolder.type),m=!!(d!=null&&d.agitated),{holderExperience:f,setHolderExperience:h}=Ce(t,i),g=p.useCallback(P=>{o(P.id)},[]),y=t.hasFuelGuage,b=t.fillPercent,{future:v}=G(a),w=p.useCallback(P=>P.data.pumpPath===(i==null?void 0:i.path),[i==null?void 0:i.path]);return r.jsxs(r.Fragment,{children:[r.jsxs(Mi,{children:[r.jsxs(l.Content,{contain:!0,children:[c&&y&&r.jsxs(Bi,{children:[r.jsx(l.FuelGauge,{size:"large",value:b,showBarsOverride:!0}),r.jsx(en,{holder:t})]}),r.jsx(l.Tabs,{activeTab:s,contain:!1,tabs:[{id:"all",label:n("all"),content:r.jsx(oe,{holder:t})},...t.pumps.data.filter(P=>!P.virtual).map(P=>({id:P.id,label:n(`macros.${P.name}`),content:r.jsx(oe,{holder:P,filter:w})}))],onChange:g,showBackground:!1})]}),r.jsxs(l.Footer,{children:[i?r.jsxs(r.Fragment,{children:[r.jsx(l.Button,{onPointerDown:()=>h("replace-pump"),children:n("replace-pump")}),r.jsx(l.Button,{onPointerDown:()=>h("calibrateSPM"),children:n("calibrate")})]}):r.jsxs(r.Fragment,{children:[!c&&r.jsx(l.Button,{onPointerDown:()=>h("rfid-override"),children:n("rfid-override")}),r.jsx(l.Button,{onPointerDown:()=>h("replace-line"),children:n("replace-line")}),m&&r.jsx(l.Button,{onPointerDown:()=>a==null?void 0:a.testAgitate(),children:n("agitate")})]}),r.jsx(ce,{disabled:!c,model:i||t})]})]}),r.jsx(p.Suspense,{children:f}),v&&r.jsx(V,{title:n("agitating"),future:v})]})}),Vi=u.kosComponent(({holder:t})=>r.jsxs(r.Fragment,{children:[r.jsx(oe,{holder:t}),r.jsxs(l.Footer,{children:[r.jsx(ce,{model:t}),r.jsx(Me,{holder:t})]})]})),$i=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=be(t),{holderExperience:o,setHolderExperience:a}=Ce(t);return r.jsxs(r.Fragment,{children:[r.jsx(oe,{holder:t}),r.jsxs(l.Footer,{children:[r.jsx(ce,{model:t}),r.jsx(l.Button,{onPointerDown:()=>s("high-flow-test"),children:e("high-flow-test")}),r.jsx(l.Button,{onPointerDown:()=>s("low-flow-test"),children:e("low-flow-test")}),r.jsx(l.Button,{onPointerDown:()=>a("diagnostics"),children:e("diagnostics")}),r.jsx(l.Button,{onPointerDown:()=>a("calibrate"),children:e("calibrate")})]}),r.jsx(p.Suspense,{children:o}),n&&r.jsx(V,{...n})]})}),Ki=S.section`
360
+ `,Gs=u.kosComponent(({holder:t})=>{const e=K.useFreestyleAssemblyContext(),{t:n}=u.useKosTranslation("common"),[s,o]=p.useState("all"),a=e==null?void 0:e.cartridgeAgitatorModels[0],c=!!t.ingredientId,i=t.pumps.getModel(s),d=u.getKosCompanionModel(t,K.FreestyleHolder.type),m=!!(d!=null&&d.agitated),{holderExperience:f,setHolderExperience:h}=Ce(t,i),{calibrateVolume:g,canCalibrate:y,action:b,handleAction:v}=Bs(i),_=p.useCallback(C=>{o(C.id)},[]),O=t.hasFuelGuage,D=t.fillPercent,{future:I}=G(a),T=p.useCallback(C=>C.data.pumpPath===(i==null?void 0:i.path),[i==null?void 0:i.path]);return r.jsxs(r.Fragment,{children:[r.jsxs(Vi,{children:[r.jsxs(l.Content,{contain:!0,children:[c&&O&&r.jsxs(Bi,{children:[r.jsx(l.FuelGauge,{size:"large",value:D,showBarsOverride:!0}),r.jsx(en,{holder:t})]}),r.jsx(l.Tabs,{activeTab:s,contain:!1,tabs:[{id:"all",label:n("all"),content:r.jsx(oe,{holder:t})},...t.pumps.data.filter(C=>!C.virtual).map(C=>({id:C.id,label:n(`macros.${C.name}`),content:r.jsx(oe,{holder:C,filter:T})}))],onChange:_,showBackground:!1})]}),r.jsxs(l.Footer,{children:[i?r.jsxs(r.Fragment,{children:[r.jsx(l.Button,{onPointerDown:()=>h("replace-pump"),children:n("replace-pump")}),r.jsx(l.Button,{onPointerDown:()=>h("calibrateSPM"),children:n("calibrate")}),y&&r.jsx(l.Button,{disabled:!y,onPointerDown:()=>v("calibrate"),children:n("intentPour",{data:{volume:g}})})]}):r.jsxs(r.Fragment,{children:[!c&&r.jsx(l.Button,{onPointerDown:()=>h("rfid-override"),children:n("rfid-override")}),r.jsx(l.Button,{onPointerDown:()=>h("replace-line"),children:n("replace-line")}),m&&r.jsx(l.Button,{onPointerDown:()=>a==null?void 0:a.testAgitate(),children:n("agitate")})]}),r.jsx(le,{disabled:!c,model:i||t})]})]}),r.jsx(p.Suspense,{children:f}),I&&r.jsx(B,{title:n("agitating"),future:I}),b&&r.jsx(B,{...b})]})}),$i=u.kosComponent(({holder:t})=>r.jsxs(r.Fragment,{children:[r.jsx(oe,{holder:t}),r.jsxs(l.Footer,{children:[r.jsx(le,{model:t}),r.jsx(Me,{holder:t})]})]})),Ki=u.kosComponent(({holder:t})=>{const{t:e}=u.useKosTranslation("common"),[n,s]=ce(t),{holderExperience:o,setHolderExperience:a}=Ce(t);return r.jsxs(r.Fragment,{children:[r.jsx(oe,{holder:t}),r.jsxs(l.Footer,{children:[r.jsx(le,{model:t}),r.jsx(l.Button,{onPointerDown:()=>s("high-flow-test"),children:e("high-flow-test")}),r.jsx(l.Button,{onPointerDown:()=>s("low-flow-test"),children:e("low-flow-test")}),r.jsx(l.Button,{onPointerDown:()=>a("diagnostics"),children:e("diagnostics")}),r.jsx(l.Button,{onPointerDown:()=>a("calibrate"),children:e("calibrate")})]}),r.jsx(p.Suspense,{children:o}),n&&r.jsx(B,{...n})]})}),Ui=S.section`
361
361
  align-items: center;
362
362
  display: flex;
363
363
  flex-direction: column;
364
364
  gap: 32px;
365
365
  height: 100%;
366
366
  justify-content: space-between;
367
- `,Ui=S.div`
367
+ `,zi=S.div`
368
368
  display: flex;
369
369
  gap: 32px;
370
370
  flex-direction: column;
371
371
  align-items: center;
372
372
  padding: 32px;
373
- `,zi=S.div`
373
+ `,Zi=S.div`
374
374
  display: flex;
375
375
  flex-direction: column;
376
376
  gap: 12px;
377
377
  text-align: center;
378
- `,Zi=({onComplete:t})=>{const{t:e}=u.useKosTranslation("reboot"),[n,s]=p.useState(!1),{model:o}=mt(),{componentModeOverride:a}=l.useComponentConfigurationContext();return r.jsxs(l.Modal,{show:!n,onClose:()=>s(!0),onClosed:t,contain:a!=="compact",children:[a==="compact"&&r.jsx(l.Header,{title:e("reboot"),showCloseButton:!0,onClose:()=>s(!0),CloseButton:l.CompactCloseButton}),r.jsxs(Ki,{children:[r.jsxs(Ui,{children:[r.jsx(l.QuestionIconStyle,{}),r.jsx(zi,{children:r.jsx(l.UtilityModalHeading,{children:e("modal-heading","Are you sure you want to reboot dispenser?")})})]}),r.jsx(l.CancelProceedFooter,{cancelLabel:`${e("cancel","Cancel")}`,proceedLabel:`${e("reboot","Reboot")}`,onCancel:()=>s(!0),onProceed:()=>o==null?void 0:o.completeReboot()})]})]})},je=S(l.LabelInformation)`
378
+ `,Hi=({onComplete:t})=>{const{t:e}=u.useKosTranslation("reboot"),[n,s]=p.useState(!1),{model:o}=mt(),{componentModeOverride:a}=l.useComponentConfigurationContext();return r.jsxs(l.Modal,{show:!n,onClose:()=>s(!0),onClosed:t,contain:a!=="compact",children:[a==="compact"&&r.jsx(l.Header,{title:e("reboot"),showCloseButton:!0,onClose:()=>s(!0),CloseButton:l.CompactCloseButton}),r.jsxs(Ui,{children:[r.jsxs(zi,{children:[r.jsx(l.QuestionIconStyle,{}),r.jsx(Zi,{children:r.jsx(l.UtilityModalHeading,{children:e("modal-heading","Are you sure you want to reboot dispenser?")})})]}),r.jsx(l.CancelProceedFooter,{cancelLabel:`${e("cancel","Cancel")}`,proceedLabel:`${e("reboot","Reboot")}`,onCancel:()=>s(!0),onProceed:()=>o==null?void 0:o.completeReboot()})]})]})},je=S(l.LabelInformation)`
379
379
  text-align: center;
380
- `,Hi=u.kosComponent(({remoteTray:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"remote-nns"}),[s,o]=p.useState("idle"),[a,c]=p.useState({}),[i,d]=p.useState({}),f=t.holder.pumps.data.filter(O=>O.childPump),h=t.remoteTrayEnabled.value===!0,g=()=>f.every(O=>{const E=a[O.name];return E!=null&&E!==""}),y=p.useCallback((O,E)=>{c(j=>({...j,[O]:E}))},[]),b=p.useCallback(O=>(E="")=>{y(O,E)},[y]),v=p.useCallback(async()=>{t.remoteTrayEnabled.updateProperty(!h),o(h?"disableSuccess":"success")},[h,t.remoteTrayEnabled]),w=p.useCallback(async()=>{o("progress"),d({});let O=!1;await Promise.all(f.map(async E=>{try{const j=u.getKosCompanionModel(E,K.FreestylePump.type),[_]=await j.replacePump(a[E.name]);_&&(d($=>({...$,[E.name]:_})),O=!0)}catch(j){console.error(j),d(_=>({..._,[E.name]:"unknownError"})),O=!0}})),O?o("pump"):v()},[h,a,f,t.remoteTrayEnabled,v]),P=p.useMemo(()=>({idle:{title:n(h?"disable-title":"idle-title"),information:r.jsx(je,{children:n(h?"disable-info":"idle-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>{h?v():o("pump")},children:n(h?"disable":"enable")}),status:"information"},pump:{title:n("pump-title"),information:r.jsxs(r.Fragment,{children:[r.jsx(je,{children:n("pump-info")}),f.map(O=>r.jsx(l.ErrorInputCard,{layout:"hex",description:i[O.name]?n(`errors.${i[O.name]}`):"",value:a[O.name]??"",label:n(`pumps.${O.name}`),onChange:b(O.name)},O.name))]}),footer:r.jsxs(r.Fragment,{children:[r.jsx(l.Button,{disabled:!g(),onPointerDown:w,children:n("enter")}),r.jsx(l.Button,{onPointerDown:e,children:n("cancel")})]})},progress:{title:n("progress-title"),information:r.jsx(je,{children:n("progress-info")}),status:"loading"},success:{title:n("success-title"),information:r.jsx(je,{children:n("success-info")}),status:"success"},disableSuccess:{title:n("disable-success-title"),information:r.jsx(je,{children:n("disable-success-info")}),status:"success"}}),[y,h,e,a,i,f,w,n]);return r.jsx(l.WorkflowModal,{...P[s],onClose:()=>e()})}),Wi=u.kosComponent(({cardModel:t})=>(u.KosLog.debug("RemoteTray",t.name),r.jsx(qs,{holder:t.holder}))),Xi=S.div`
380
+ `,Wi=u.kosComponent(({remoteTray:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"remote-nns"}),[s,o]=p.useState("idle"),[a,c]=p.useState({}),[i,d]=p.useState({}),f=t.holder.pumps.data.filter(D=>D.childPump),h=t.remoteTrayEnabled.value===!0,g=()=>f.every(D=>{const I=a[D.name];return I!=null&&I!==""}),y=p.useCallback((D,I)=>{c(T=>({...T,[D]:I}))},[]),b=p.useCallback(D=>(I="")=>{y(D,I)},[y]),v=p.useCallback(async()=>{t.remoteTrayEnabled.updateProperty(!h),o(h?"disableSuccess":"success")},[h,t.remoteTrayEnabled]),_=p.useCallback(async()=>{o("progress"),d({});let D=!1;await Promise.all(f.map(async I=>{try{const T=u.getKosCompanionModel(I,K.FreestylePump.type),[C]=await T.replacePump(a[I.name]);C&&(d($=>({...$,[I.name]:C})),D=!0)}catch(T){console.error(T),d(C=>({...C,[I.name]:"unknownError"})),D=!0}})),D?o("pump"):v()},[h,a,f,t.remoteTrayEnabled,v]),O=p.useMemo(()=>({idle:{title:n(h?"disable-title":"idle-title"),information:r.jsx(je,{children:n(h?"disable-info":"idle-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>{h?v():o("pump")},children:n(h?"disable":"enable")}),status:"information"},pump:{title:n("pump-title"),information:r.jsxs(r.Fragment,{children:[r.jsx(je,{children:n("pump-info")}),f.map(D=>r.jsx(l.ErrorInputCard,{layout:"hex",description:i[D.name]?n(`errors.${i[D.name]}`):"",value:a[D.name]??"",label:n(`pumps.${D.name}`),onChange:b(D.name)},D.name))]}),footer:r.jsxs(r.Fragment,{children:[r.jsx(l.Button,{disabled:!g(),onPointerDown:_,children:n("enter")}),r.jsx(l.Button,{onPointerDown:e,children:n("cancel")})]})},progress:{title:n("progress-title"),information:r.jsx(je,{children:n("progress-info")}),status:"loading"},success:{title:n("success-title"),information:r.jsx(je,{children:n("success-info")}),status:"success"},disableSuccess:{title:n("disable-success-title"),information:r.jsx(je,{children:n("disable-success-info")}),status:"success"}}),[y,h,e,a,i,f,_,n]);return r.jsx(l.WorkflowModal,{...O[s],onClose:()=>e()})}),Xi=u.kosComponent(({cardModel:t})=>(u.KosLog.debug("RemoteTray",t.name),r.jsx(Gs,{holder:t.holder}))),qi=S.div`
381
381
  font-size: var(--ddk-component-holder-card-footer-font-size);
382
382
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
383
383
  position: absolute;
384
384
  bottom: 6px;
385
- `,qi=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.name}`);const{t:e}=u.useKosTranslation("troubles"),n=t.cardModel,{hasTroubles:s,highestTrouble:o}=$s(n),a=Re(o),c=ht(o);return s?r.jsx(Xi,{children:e(a.summary,{context:o!=null&&o.deferred?"queued":void 0,data:c})}):r.jsx(l.StatusIndicator,{size:"small",status:"completed"})}),Gs=u.kosComponent(({holder:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("replace-line"),[s,o]=p.useState(),[a,c]=p.useState();p.useEffect(()=>{t.replaceLine().then(()=>{o("success")})},[t]);const i=()=>{if(a){o(void 0);return}e()};return r.jsx(l.StatusBar,{show:s!==void 0,onClose:i,children:s==="failure"?r.jsx(Ee,{children:n(a||"unknownError")}):s==="success"?r.jsx(et,{children:n("success")}):null})}),Gi=S.div`
385
+ `,Gi=u.kosComponent(t=>{u.KosLog.debug(`summary component loaded for holder ${t}`),u.KosLog.info(`render agitator summary for holder ${t.cardModel.name}`);const{t:e}=u.useKosTranslation("troubles"),n=t.cardModel,{hasTroubles:s,highestTrouble:o}=Ks(n),a=Re(o),c=ht(o);return s?r.jsx(qi,{children:e(a.summary,{context:o!=null&&o.deferred?"queued":void 0,data:c})}):r.jsx(l.StatusIndicator,{size:"small",status:"completed"})}),Ys=u.kosComponent(({holder:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("replace-line"),[s,o]=p.useState(),[a,c]=p.useState();p.useEffect(()=>{t.replaceLine().then(()=>{o("success")})},[t]);const i=()=>{if(a){o(void 0);return}e()};return r.jsx(l.StatusBar,{show:s!==void 0,onClose:i,children:s==="failure"?r.jsx(Ee,{children:n(a||"unknownError")}):s==="success"?r.jsx(et,{children:n("success")}):null})}),Yi=S.div`
386
386
  display: flex;
387
387
  flex-direction: column;
388
388
  overflow-y: auto;
389
389
  overflow-x: hidden;
390
390
  gap: 32px;
391
391
  height: 100%;
392
- `,Ys=u.kosComponent(({pump:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=u.useKosTranslation("replace-pump"),{componentModeOverride:a}=l.useComponentConfigurationContext(),[c,i]=p.useState(),[d,m]=p.useState(),[f,h]=p.useState(),g=u.getKosCompanionModel(t,K.FreestylePump.type),y=t.name,b=p.useCallback(P=>{if(P!==void 0&&P.length===0)return o("pump-calibration-length-error")},[o]),v=p.useCallback(async()=>{if(c===void 0)return;const[P]=await g.replacePump(c);P?(m("failure"),h(P)):m("success")},[g,c]),w=()=>{if(f){m(void 0);return}s(!0)};return r.jsxs(r.Fragment,{children:[r.jsx(l.Modal,{contain:a!=="compact",onClosed:e,show:!n,children:r.jsxs(Gi,{children:[r.jsx(l.Header,{contain:a==="compact",showCloseButton:!0,title:y?o("label-replace-pump",{label:y}):o("replace-pump"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:a==="compact"?l.BackButton:void 0}),r.jsx(l.Content,{align:"top",children:r.jsx(l.InputCard,{isValid:b,label:o("enter-pump-calibration-code"),layout:"hex",value:c,onChange:P=>{h(void 0),i(P)}})}),r.jsx(l.Footer,{children:r.jsx(l.Button,{mode:"primary",disabled:!c||!!f,onPointerDown:v,children:o("replace-pump")})})]})}),r.jsx(l.StatusBar,{show:d!==void 0,onClose:w,children:d==="failure"?r.jsx(Ee,{children:o(f||"unknownError")}):d==="success"?r.jsx(et,{children:o("success")}):null})]})}),Yi=/^[0-9a-fA-F]+$/,Xn=t=>Yi.test(t),Ji=S.div`
392
+ `,Js=u.kosComponent(({pump:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=u.useKosTranslation("replace-pump"),{componentModeOverride:a}=l.useComponentConfigurationContext(),[c,i]=p.useState(),[d,m]=p.useState(),[f,h]=p.useState(),g=u.getKosCompanionModel(t,K.FreestylePump.type),y=t.name,b=p.useCallback(O=>{if(O!==void 0&&O.length===0)return o("pump-calibration-length-error")},[o]),v=p.useCallback(async()=>{if(c===void 0)return;const[O]=await g.replacePump(c);O?(m("failure"),h(O)):m("success")},[g,c]),_=()=>{if(f){m(void 0);return}s(!0)};return r.jsxs(r.Fragment,{children:[r.jsx(l.Modal,{contain:a!=="compact",onClosed:e,show:!n,children:r.jsxs(Yi,{children:[r.jsx(l.Header,{contain:a==="compact",showCloseButton:!0,title:y?o("label-replace-pump",{label:y}):o("replace-pump"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:a==="compact"?l.BackButton:void 0}),r.jsx(l.Content,{align:"top",children:r.jsx(l.InputCard,{isValid:b,label:o("enter-pump-calibration-code"),layout:"hex",value:c,onChange:O=>{h(void 0),i(O)}})}),r.jsx(l.Footer,{children:r.jsx(l.Button,{mode:"primary",disabled:!c||!!f,onPointerDown:v,children:o("replace-pump")})})]})}),r.jsx(l.StatusBar,{show:d!==void 0,onClose:_,children:d==="failure"?r.jsx(Ee,{children:o(f||"unknownError")}):d==="success"?r.jsx(et,{children:o("success")}):null})]})}),Ji=/^[0-9a-fA-F]+$/,Xn=t=>Ji.test(t),Qi=S.div`
393
393
  display: flex;
394
394
  flex-direction: column;
395
395
  overflow-y: auto;
396
396
  overflow-x: hidden;
397
397
  height: 100%;
398
- `,Js=u.kosComponent(({holder:t,onComplete:e})=>{const n=t.name,[s,o]=p.useState(!1),{t:a}=u.useKosTranslation("rfid-override"),{componentModeOverride:c}=l.useComponentConfigurationContext(),[i,d]=p.useState(),[m,f]=p.useState(),[h,g]=p.useState(),[y,b]=p.useState(),[v,w]=p.useState(),P=j=>{if(j!==void 0&&j.length!==12)return a("errIdLen");if(!Xn(j))return a("errIdFormat")},O=j=>{if(j!==void 0&&j.length!==8)return a("errCodeLen");if(!Xn(j))return a("errCodeFormat")},E=async()=>{try{await t.overrideRfidCode({stickerId:i,stickerCode:m}),o(!0)}catch(j){switch(j.type){case"errIdLen":case"errIdFormat":b(j.type);break;case"errCodeLen":case"errCodeFormat":w(j.type);break;case"errVerify":case"errBadJson":g(j.type);break}}};return r.jsxs(l.Modal,{contain:c!=="compact",mode:"maximized",onClosed:e,show:!s,children:[r.jsx(l.Header,{contain:c==="compact",showCloseButton:!0,title:n?a("label-rfid-override",{label:n}):a("rfid-override"),showOpenButton:!1,onClose:()=>o(!0),CloseButton:c==="compact"?l.BackButton:void 0}),r.jsxs(Ji,{children:[r.jsxs(l.Content,{align:"top",children:[r.jsx(l.InfoContainer,{children:a("info")}),r.jsx(l.ErrorInputCard,{isValid:P,description:y?a(y):void 0,label:a("enter-cartridge-id"),layout:"hex",value:i,onChange:j=>{b(void 0),d(j)}}),r.jsx(l.ErrorInputCard,{isValid:O,description:v?a(v):void 0,label:a("enter-code"),layout:"hex",value:m,onChange:j=>{w(void 0),f(j)}})]}),r.jsx(l.Footer,{children:r.jsx(l.Button,{mode:"primary",disabled:!i||!m,onPointerDown:E,children:a("override")})}),h&&r.jsx(l.ProgressBar,{onClose:()=>g(void 0),renderFailure:r.jsx(l.FailureCard,{heading:a("rfid-override"),message:a(h,{holder:t.name})}),show:!0,status:"failure",title:"",value:0})]})]})}),Qi=u.kosComponent(({setupPath:t})=>{const{model:e}=ft(),[n,s]=p.useState(!1),[o]=qn.useSearchParams(),a=!!o.get("skipSetup"),c=l.useNavigate();return p.useEffect(()=>{!n&&(e!=null&&e.setupRequired)&&(s(!0),a||c(t))},[e==null?void 0:e.setupRequired,n,c,t,a]),null}),Qs=S.div`
398
+ `,Qs=u.kosComponent(({holder:t,onComplete:e})=>{const n=t.name,[s,o]=p.useState(!1),{t:a}=u.useKosTranslation("rfid-override"),{componentModeOverride:c}=l.useComponentConfigurationContext(),[i,d]=p.useState(),[m,f]=p.useState(),[h,g]=p.useState(),[y,b]=p.useState(),[v,_]=p.useState(),O=T=>{if(T!==void 0&&T.length!==12)return a("errIdLen");if(!Xn(T))return a("errIdFormat")},D=T=>{if(T!==void 0&&T.length!==8)return a("errCodeLen");if(!Xn(T))return a("errCodeFormat")},I=async()=>{try{await t.overrideRfidCode({stickerId:i,stickerCode:m}),o(!0)}catch(T){switch(T.type){case"errIdLen":case"errIdFormat":b(T.type);break;case"errCodeLen":case"errCodeFormat":_(T.type);break;case"errVerify":case"errBadJson":g(T.type);break}}};return r.jsxs(l.Modal,{contain:c!=="compact",mode:"maximized",onClosed:e,show:!s,children:[r.jsx(l.Header,{contain:c==="compact",showCloseButton:!0,title:n?a("label-rfid-override",{label:n}):a("rfid-override"),showOpenButton:!1,onClose:()=>o(!0),CloseButton:c==="compact"?l.BackButton:void 0}),r.jsxs(Qi,{children:[r.jsxs(l.Content,{align:"top",children:[r.jsx(l.InfoContainer,{children:a("info")}),r.jsx(l.ErrorInputCard,{isValid:O,description:y?a(y):void 0,label:a("enter-cartridge-id"),layout:"hex",value:i,onChange:T=>{b(void 0),d(T)}}),r.jsx(l.ErrorInputCard,{isValid:D,description:v?a(v):void 0,label:a("enter-code"),layout:"hex",value:m,onChange:T=>{_(void 0),f(T)}})]}),r.jsx(l.Footer,{children:r.jsx(l.Button,{mode:"primary",disabled:!i||!m,onPointerDown:I,children:a("override")})}),h&&r.jsx(l.ProgressBar,{onClose:()=>g(void 0),renderFailure:r.jsx(l.FailureCard,{heading:a("rfid-override"),message:a(h,{holder:t.name})}),show:!0,status:"failure",title:"",value:0})]})]})}),ec=u.kosComponent(({setupPath:t})=>{const{model:e}=ft(),[n,s]=p.useState(!1),[o]=qn.useSearchParams(),a=!!o.get("skipSetup"),c=l.useNavigate();return p.useEffect(()=>{!n&&(e!=null&&e.setupRequired)&&(s(!0),a||c(t))},[e==null?void 0:e.setupRequired,n,c,t,a]),null}),eo=S.div`
399
399
  cursor: pointer;
400
400
  display: flex;
401
401
  gap: 8px;
402
402
  align-items: center;
403
- `,eo=S.div`
403
+ `,to=S.div`
404
404
  color: var(--ddk-generic-color-grey-100, #171717);
405
405
  font-size: var(--ddk-component-sidebar-font-size-medium);
406
406
  font-style: normal;
@@ -409,18 +409,18 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
409
409
  letter-spacing: 0.44px;
410
410
  white-space: nowrap;
411
411
  overflow: hidden;
412
- `,to=u.kosComponent(({setupStepContainer:t,onStepSelected:e,...n})=>{const{t:s,labelMap:o}=Ns({defaultNamespace:"setup",extensionPoint:$t.id}),a=t==null?void 0:t.currentStep,c=(t==null?void 0:t.data.map(i=>r.jsxs(Qs,{onPointerDown:()=>{t.setCurrentStep(i.id),e(i.id)},children:[r.jsx(l.StatusIndicator,{size:"large",status:a===i?"active":i.complete?"completed":"pending"}),r.jsx(eo,{children:s(o[i.name]??i.titleKey)})]},i.id)))||[];return r.jsx(l.Sidebar,{...n,children:c})}),ec=Bs(to),tc=u.kosComponent(()=>{const{model:t}=u.useSoftwareInfo();return(t==null?void 0:t.nodes)&&t.nodes.map((e,n)=>r.jsxs(l.FrameContainer,{name:e.nodeName,children:[r.jsx("div",{children:r.jsx(l.FrameBody,{keyList:[],tableHead:`KOS Release Version: ${e.kosVersion}`,tableData:[],tableLayout:"fixed"})},"kosVersion"),Object.keys(e.group).map((s,o)=>r.jsx("div",{children:r.jsx(l.FrameBody,{keyList:["name","version"],tableHead:s==="undefined"?"Apps":s,tableData:e.group[s],tableLayout:"fixed"})},o))]},n))}),St=S(l.LabelInformation)`
412
+ `,no=u.kosComponent(({setupStepContainer:t,onStepSelected:e,...n})=>{const{t:s,labelMap:o}=Ns({defaultNamespace:"setup",extensionPoint:$t.id}),a=t==null?void 0:t.currentStep,c=(t==null?void 0:t.data.map(i=>r.jsxs(eo,{onPointerDown:()=>{t.setCurrentStep(i.id),e(i.id)},children:[r.jsx(l.StatusIndicator,{size:"large",status:a===i?"active":i.complete?"completed":"pending"}),r.jsx(to,{children:s(o[i.name]??i.titleKey)})]},i.id)))||[];return r.jsx(l.Sidebar,{...n,children:c})}),tc=Vs(no),nc=u.kosComponent(()=>{const{model:t}=u.useSoftwareInfo();return(t==null?void 0:t.nodes)&&t.nodes.map((e,n)=>r.jsxs(l.FrameContainer,{name:e.nodeName,children:[r.jsx("div",{children:r.jsx(l.FrameBody,{keyList:[],tableHead:`KOS Release Version: ${e.kosVersion}`,tableData:[],tableLayout:"fixed"})},"kosVersion"),Object.keys(e.group).map((s,o)=>r.jsx("div",{children:r.jsx(l.FrameBody,{keyList:["name","version"],tableHead:s==="undefined"?"Apps":s,tableData:e.group[s],tableLayout:"fixed"})},o))]},n))}),St=S(l.LabelInformation)`
413
413
  white-space: pre-wrap;
414
- `,no=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"spm-field-calibration"}),[s,o]=p.useState("preparation-idle"),[a,c]=p.useState(),[i,d]=p.useState(),[m,f]=p.useState(),{clearFuture:h,future:g}=G(t);p.useEffect(()=>{switch(g==null?void 0:g.endState){case"CANCEL":switch(s){case"preparation-in-progress":o("preparation-idle");break;default:c("calibration-canceled"),o("failure")}break;case"SUCCESS":switch(s){case"preparation-in-progress":o("preparation-success");break;case"calibration-in-progress":o("calibration-input");break;case"verification-in-progress":o("verification-input");break}break;case"FAIL":case"ABORT":c(""),o("failure");break}},[g==null?void 0:g.endState,g==null?void 0:g.reason,s]);const y=p.useMemo(()=>({"preparation-idle":{information:r.jsx(St,{children:n("preparation-idle-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>{h(),t.performPreCalibrate(),o("preparation-in-progress")},children:n("preparation-action")}),status:"information"},"preparation-in-progress":{information:r.jsx(l.LabelInformation,{children:n("preparation-progress-info")}),footer:r.jsx(l.Button,{disabled:!0,children:n("preparation-action")}),status:"loading"},"preparation-success":{information:r.jsx(l.LabelInformation,{children:n("preparation-success-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>o("calibration-idle"),children:n("preparation-success-action")}),status:"success"},"preparation-failed":{},"calibration-idle":{information:r.jsx(St,{children:n("calibration-idle-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>{h(),t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:r.jsx(l.LabelInformation,{children:n("calibration-progress-info")}),status:"loading"},"calibration-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("calibration-input-info")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&d(v)},value:i!==void 0?i:""})]}),footer:r.jsx(l.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:r.jsx(St,{children:n("verification-idle-info")}),footer:r.jsx(l.Button,{onPointerDown:async()=>{i!==void 0&&(h(),t.performVerify(i,g==null?void 0:g.clientData),o("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:r.jsx(l.LabelInformation,{children:n("verification-progress-info")}),status:"loading"},"verification-trouble":{},"verification-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("verification-input-info")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&f(v)},value:m!==void 0?m:""})]}),footer:r.jsx(l.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;h();const[v,w]=await t.performComplete(i,m,g==null?void 0:g.clientData);v?(c(v),o("failure")):o("verification-success")},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:r.jsx(l.LabelInformation,{children:n("verification-success-info")}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:r.jsx(l.LabelInformation,{children:n("verification-failed-info",{data:{ingredient:t.name}})}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("calibration-failed")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a||"unknownError"}`)})]}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[h,a,g==null?void 0:g.clientData,e,t,n,i,m]);let b;switch(s){case"preparation-in-progress":b="preparation-progress-title";break;case"calibration-in-progress":b="calibration-progress-title";break;case"verification-in-progress":b="verification-progress-title";break;default:b="initiating"}return r.jsxs(r.Fragment,{children:[r.jsx(l.WorkflowModal,{title:n("title",{data:{ingredient:t.name}}),...y[s],onClose:()=>e()}),g&&r.jsx(V,{title:n(b),future:g})]})}),nc=u.KosLog.createLogger({name:"state-experience"});nc.debug("state-experience component loaded");const sc=S.div``,oc=u.kosComponent(()=>{const{getExtensions:t}=Fe(),{model:e}=Yt(),[n,s]=p.useState(null);return p.useEffect(()=>u.kosAutoEffect(()=>{const a=t(Qe.id),c=y=>{const b=a.find(w=>w.data.troubleType===y),v=b==null?void 0:b.data;return b?v.stateKey??v.troubleType:void 0},i=a.reduce((y,b)=>{const v=b.data,w=v.stateKey??v.troubleType;return y[w]={extension:Qe.id,module:b.id,namespace:v.namespace,title:v.title,stateValue:v.stateValue??v.troubleType},y},{}),d=e==null?void 0:e.activeTroubleType,m=e==null?void 0:e.activeTrouble,f=d?c(d):void 0,h=f?i[f]:void 0,g=h?r.jsx(ae.DynamicComponent,{...h,props:{trouble:m}}):null;s(g)}),[t,e]),r.jsx(sc,{children:n})}),rc=[0,6],so=()=>{const{regionModel:t}=u.useKosRegions(),{model:e}=u.useKosTime(),[n,s]=p.useState(new Date),o=n.getFullYear(),a=u.useDateProps({formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(t==null?void 0:t.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:rc,yearsRange:[o-10,o+10]}}),c=p.useCallback((m,f)=>{switch(m){case"year":a.dateActions.setYear(f.id);break;case"month":a.dateActions.setMonth(f.id);break;case"day":a.dateActions.setDay(f.id);break}},[a.dateActions]),i=p.useCallback(()=>{a.dateActions.setYear(n.getFullYear()),a.dateActions.setMonth(n.getMonth()),a.dateActions.setDay(n.getDate())},[n,a.dateActions]),d=p.useCallback(async({day:m,month:f,year:h})=>{a.dateActions.setYear(h),a.dateActions.setMonth(f),a.dateActions.setDay(m),await(e==null?void 0:e.updateSystemDate({day:m,month:f,year:h})),s(new Date)},[a.dateActions,e]);return r.jsx(Cs,{onDiscard:i,onChange:c,onSave:d})},oo=u.kosComponent(({...t})=>{var i;const{regionModel:e}=u.useKosRegions(),{model:n}=u.useKosTime(),{t:s}=u.useKosTranslation("common"),o=e==null?void 0:e.allTimeZones.map(d=>({id:d,label:d.replace(/_/g," ")})),a=(i=e==null?void 0:e.timeZones)==null?void 0:i.map(d=>({id:d,label:d.replace(/_/g," ")})),c=[{id:"region",label:s("suggested"),items:a||[]},{id:"all",label:s("all"),items:o||[]}];return r.jsx(l.SwitchPickerCard,{...t,label:s("time-zone"),data:c,displayValue:(n==null?void 0:n.timezone).replace("_"," "),loop:!1,selectedItemId:n==null?void 0:n.timezone,onSave:n==null?void 0:n.updateSystemTimezone,closeButtonLabel:s("close","Close")||void 0,cancelButtonLabel:s("discard-changes","Discard Changes")||void 0,proceedButtonLabel:s("save","Save")||void 0})}),ac=u.kosComponent(({showHeading:t})=>{var y,b,v,w,P,O,E,j;const{t:e}=u.useKosTranslation("region"),{regionModel:n}=u.useKosRegions(),{model:s}=u.useKosTime(),{amPmOptions:o,formattedTime:a,hourOptions:c,minuteOptions:i,setTime:d,time:m}=u.useRegionTimeProps(),f=m.getHours(),h=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f<12?f:f-12,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0},{id:"ampm",items:o,selectedItemId:f<12?"AM":"PM"}],[o,c,i,m,f]),g=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0}],[c,i,m,f]);return p.useEffect(()=>{const _=setInterval(()=>{d(new Date)},3e4);return()=>{clearInterval(_)}},[d]),r.jsxs(l.TabContainer,{children:[t&&r.jsx(l.SettingsSubheading,{children:e("time-settings","Time Settings")}),((y=n==null?void 0:n.dateFormatOptions)==null?void 0:y.length)&&r.jsx(l.SwitchCard,{label:e("date-format","Date Format"),value:(v=(b=n==null?void 0:n.dateFormatOptions)==null?void 0:b.find(_=>_.format===n.selectedDateFormat))==null?void 0:v.id,options:(w=n==null?void 0:n.dateFormatOptions)==null?void 0:w.map(_=>({label:_.format.toUpperCase(),..._})),onChange:_=>_&&(n==null?void 0:n.setSelectedDateFormat(String(_)))}),r.jsx(so,{}),r.jsx(oo,{}),((P=n==null?void 0:n.timeFormatOptions)==null?void 0:P.length)&&r.jsx(l.SwitchCard,{label:e("time-format","Time Format"),value:(E=(O=n==null?void 0:n.timeFormatOptions)==null?void 0:O.find(_=>_.format===n.selectedTimeFormat))==null?void 0:E.id,options:(j=n==null?void 0:n.timeFormatOptions)==null?void 0:j.map(_=>({label:_!=null&&_.ampm?"12 HR":"24 HR",..._})).reverse(),onChange:_=>_&&(n==null?void 0:n.setSelectedTimeFormat(String(_)))}),r.jsx(l.MultiPickerCard,{data:n!=null&&n.is12HourTimeFormat?h:g,icon:ye.TimeIcon,displayValue:a,label:e("current-time","Current Time"),closeButtonLabel:e("close","Close")||void 0,cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,proceedButtonLabel:e("save","Save")||void 0,onSave:_=>{const $=n!=null&&n.is12HourTimeFormat?_.ampm==="AM"?_.hr:_.hr+12:_.hr,z=_.min,Y=new Date(m);Y.setHours($),Y.setMinutes(z),d(Y),s==null||s.updateSystemTime({hour:$,min:z,sec:0})}})]})}),ic=Xt(u.kosComponent(({settings:t,showHeading:e})=>{const{t:n}=u.useKosTranslation("dispenser-profile");return r.jsxs(l.TabContainer,{children:[e&&r.jsx(l.SettingsSubheading,{children:n("water-settings","Water Settings")}),r.jsx(Pe,{label:n("plain-water","Plain Water"),configProperty:t.hidePlainWaterBev}),r.jsx(Pe,{label:n("carbonated-water","Carbonated Water"),configProperty:t.hideCarbWaterBev})]})})),cc=S.div`
414
+ `,so=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"spm-field-calibration"}),[s,o]=p.useState("preparation-idle"),[a,c]=p.useState(),[i,d]=p.useState(),[m,f]=p.useState(),{clearFuture:h,future:g}=G(t);p.useEffect(()=>{switch(g==null?void 0:g.endState){case"CANCEL":switch(s){case"preparation-in-progress":o("preparation-idle");break;default:c("calibration-canceled"),o("failure")}break;case"SUCCESS":switch(s){case"preparation-in-progress":o("preparation-success");break;case"calibration-in-progress":o("calibration-input");break;case"verification-in-progress":o("verification-input");break}break;case"FAIL":case"ABORT":c(""),o("failure");break}},[g==null?void 0:g.endState,g==null?void 0:g.reason,s]);const y=p.useMemo(()=>({"preparation-idle":{information:r.jsx(St,{children:n("preparation-idle-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>{h(),t.performPreCalibrate(),o("preparation-in-progress")},children:n("preparation-action")}),status:"information"},"preparation-in-progress":{information:r.jsx(l.LabelInformation,{children:n("preparation-progress-info")}),footer:r.jsx(l.Button,{disabled:!0,children:n("preparation-action")}),status:"loading"},"preparation-success":{information:r.jsx(l.LabelInformation,{children:n("preparation-success-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>o("calibration-idle"),children:n("preparation-success-action")}),status:"success"},"preparation-failed":{},"calibration-idle":{information:r.jsx(St,{children:n("calibration-idle-info")}),footer:r.jsx(l.Button,{onPointerDown:()=>{h(),t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:r.jsx(l.LabelInformation,{children:n("calibration-progress-info")}),status:"loading"},"calibration-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("calibration-input-info")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&d(v)},value:i!==void 0?i:""})]}),footer:r.jsx(l.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:r.jsx(St,{children:n("verification-idle-info")}),footer:r.jsx(l.Button,{onPointerDown:async()=>{i!==void 0&&(h(),t.performVerify(i,g==null?void 0:g.clientData),o("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:r.jsx(l.LabelInformation,{children:n("verification-progress-info")}),status:"loading"},"verification-trouble":{},"verification-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("verification-input-info")}),r.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&f(v)},value:m!==void 0?m:""})]}),footer:r.jsx(l.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;h();const[v,_]=await t.performComplete(i,m,g==null?void 0:g.clientData);v?(c(v),o("failure")):o("verification-success")},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:r.jsx(l.LabelInformation,{children:n("verification-success-info")}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:r.jsx(l.LabelInformation,{children:n("verification-failed-info",{data:{ingredient:t.name}})}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(l.LabelInformation,{children:n("calibration-failed")}),r.jsx(l.BodyMediumInformation,{children:n(`error.${a||"unknownError"}`)})]}),footer:r.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[h,a,g==null?void 0:g.clientData,e,t,n,i,m]);let b;switch(s){case"preparation-in-progress":b="preparation-progress-title";break;case"calibration-in-progress":b="calibration-progress-title";break;case"verification-in-progress":b="verification-progress-title";break;default:b="initiating"}return r.jsxs(r.Fragment,{children:[r.jsx(l.WorkflowModal,{title:n("title",{data:{ingredient:t.name}}),...y[s],onClose:()=>e()}),g&&r.jsx(B,{title:n(b),future:g})]})}),sc=u.KosLog.createLogger({name:"state-experience"});sc.debug("state-experience component loaded");const oc=S.div``,rc=u.kosComponent(()=>{const{getExtensions:t}=Fe(),{model:e}=Yt(),[n,s]=p.useState(null);return p.useEffect(()=>u.kosAutoEffect(()=>{const a=t(Qe.id),c=y=>{const b=a.find(_=>_.data.troubleType===y),v=b==null?void 0:b.data;return b?v.stateKey??v.troubleType:void 0},i=a.reduce((y,b)=>{const v=b.data,_=v.stateKey??v.troubleType;return y[_]={extension:Qe.id,module:b.id,namespace:v.namespace,title:v.title,stateValue:v.stateValue??v.troubleType},y},{}),d=e==null?void 0:e.activeTroubleType,m=e==null?void 0:e.activeTrouble,f=d?c(d):void 0,h=f?i[f]:void 0,g=h?r.jsx(ae.DynamicComponent,{...h,props:{trouble:m}}):null;s(g)}),[t,e]),r.jsx(oc,{children:n})}),ac=[0,6],oo=()=>{const{regionModel:t}=u.useKosRegions(),{model:e}=u.useKosTime(),[n,s]=p.useState(new Date),o=n.getFullYear(),a=u.useDateProps({formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(t==null?void 0:t.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:ac,yearsRange:[o-10,o+10]}}),c=p.useCallback((m,f)=>{switch(m){case"year":a.dateActions.setYear(f.id);break;case"month":a.dateActions.setMonth(f.id);break;case"day":a.dateActions.setDay(f.id);break}},[a.dateActions]),i=p.useCallback(()=>{a.dateActions.setYear(n.getFullYear()),a.dateActions.setMonth(n.getMonth()),a.dateActions.setDay(n.getDate())},[n,a.dateActions]),d=p.useCallback(async({day:m,month:f,year:h})=>{a.dateActions.setYear(h),a.dateActions.setMonth(f),a.dateActions.setDay(m),await(e==null?void 0:e.updateSystemDate({day:m,month:f,year:h})),s(new Date)},[a.dateActions,e]);return r.jsx(Cs,{onDiscard:i,onChange:c,onSave:d})},ro=u.kosComponent(({...t})=>{var i;const{regionModel:e}=u.useKosRegions(),{model:n}=u.useKosTime(),{t:s}=u.useKosTranslation("common"),o=e==null?void 0:e.allTimeZones.map(d=>({id:d,label:d.replace(/_/g," ")})),a=(i=e==null?void 0:e.timeZones)==null?void 0:i.map(d=>({id:d,label:d.replace(/_/g," ")})),c=[{id:"region",label:s("suggested"),items:a||[]},{id:"all",label:s("all"),items:o||[]}];return r.jsx(l.SwitchPickerCard,{...t,label:s("time-zone"),data:c,displayValue:(n==null?void 0:n.timezone).replace("_"," "),loop:!1,selectedItemId:n==null?void 0:n.timezone,onSave:n==null?void 0:n.updateSystemTimezone,closeButtonLabel:s("close","Close")||void 0,cancelButtonLabel:s("discard-changes","Discard Changes")||void 0,proceedButtonLabel:s("save","Save")||void 0})}),ic=u.kosComponent(({showHeading:t})=>{var y,b,v,_,O,D,I,T;const{t:e}=u.useKosTranslation("region"),{regionModel:n}=u.useKosRegions(),{model:s}=u.useKosTime(),{amPmOptions:o,formattedTime:a,hourOptions:c,minuteOptions:i,setTime:d,time:m}=u.useRegionTimeProps(),f=m.getHours(),h=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f<12?f:f-12,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0},{id:"ampm",items:o,selectedItemId:f<12?"AM":"PM"}],[o,c,i,m,f]),g=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0}],[c,i,m,f]);return p.useEffect(()=>{const C=setInterval(()=>{d(new Date)},3e4);return()=>{clearInterval(C)}},[d]),r.jsxs(l.TabContainer,{children:[t&&r.jsx(l.SettingsSubheading,{children:e("time-settings","Time Settings")}),((y=n==null?void 0:n.dateFormatOptions)==null?void 0:y.length)&&r.jsx(l.SwitchCard,{label:e("date-format","Date Format"),value:(v=(b=n==null?void 0:n.dateFormatOptions)==null?void 0:b.find(C=>C.format===n.selectedDateFormat))==null?void 0:v.id,options:(_=n==null?void 0:n.dateFormatOptions)==null?void 0:_.map(C=>({label:C.format.toUpperCase(),...C})),onChange:C=>C&&(n==null?void 0:n.setSelectedDateFormat(String(C)))}),r.jsx(oo,{}),r.jsx(ro,{}),((O=n==null?void 0:n.timeFormatOptions)==null?void 0:O.length)&&r.jsx(l.SwitchCard,{label:e("time-format","Time Format"),value:(I=(D=n==null?void 0:n.timeFormatOptions)==null?void 0:D.find(C=>C.format===n.selectedTimeFormat))==null?void 0:I.id,options:(T=n==null?void 0:n.timeFormatOptions)==null?void 0:T.map(C=>({label:C!=null&&C.ampm?"12 HR":"24 HR",...C})).reverse(),onChange:C=>C&&(n==null?void 0:n.setSelectedTimeFormat(String(C)))}),r.jsx(l.MultiPickerCard,{data:n!=null&&n.is12HourTimeFormat?h:g,icon:be.TimeIcon,displayValue:a,label:e("current-time","Current Time"),closeButtonLabel:e("close","Close")||void 0,cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,proceedButtonLabel:e("save","Save")||void 0,onSave:C=>{const $=n!=null&&n.is12HourTimeFormat?C.ampm==="AM"?C.hr:C.hr+12:C.hr,z=C.min,Y=new Date(m);Y.setHours($),Y.setMinutes(z),d(Y),s==null||s.updateSystemTime({hour:$,min:z,sec:0})}})]})}),cc=Xt(u.kosComponent(({settings:t,showHeading:e})=>{const{t:n}=u.useKosTranslation("dispenser-profile");return r.jsxs(l.TabContainer,{children:[e&&r.jsx(l.SettingsSubheading,{children:n("water-settings","Water Settings")}),r.jsx(Pe,{label:n("plain-water","Plain Water"),configProperty:t.hidePlainWaterBev}),r.jsx(Pe,{label:n("carbonated-water","Carbonated Water"),configProperty:t.hideCarbWaterBev})]})})),lc=S.div`
415
415
  display: flex;
416
416
  flex-direction: column;
417
417
  gap: 12px;
418
- `,lc=S.div`
418
+ `,dc=S.div`
419
419
  display: flex;
420
420
  flex-direction: row;
421
421
  gap: 12px;
422
422
  align-items: center;
423
423
  justify-content: center;
424
- `,dc=S(l.Button)`
424
+ `,uc=S(l.Button)`
425
425
  display: block;
426
- `;exports.ActionButton=dc;exports.ActionContainer=cc;exports.ActionRow=lc;exports.AgitationControlView=Co;exports.AgitatorDetail=To;exports.AgitatorModal=cs;exports.AgitatorSummary=Io;exports.AnimationContext=tn;exports.AnimationProvider=Ta;exports.ApplicationComponentConfigurationProvider=Ia;exports.ApplicationContext=nn;exports.ApplicationProvider=Ea;exports.CGPPumpCard=Oi;exports.CalibrateAction=Gn;exports.CalibrateModal=ms;exports.CarbTankDetail=_o;exports.CarbTankSummary=So;exports.ConfigPropInfoCard=fs;exports.ConfigPropInputCard=tt;exports.ConfigPropInputRangeCard=he;exports.ConfigPropMultiInputEnableCard=xs;exports.ConfigPropPickerCard=nt;exports.ConfigPropSingleInputEnableCard=Vo;exports.ConfigPropSwitchCard=vs;exports.ConfigPropTimePickerCard=bs;exports.ConfigPropToggleCard=Pe;exports.CuiExtension=As;exports.DashboardDetailExtension=Ar;exports.DashboardOperationsContext=sn;exports.DashboardOperationsProvider=Pa;exports.DashboardPumpDetailExtension=Oe;exports.DashboardSummaryExtension=jr;exports.DatePickerCard=Cs;exports.DiagnosticsModal=ws;exports.DispenserInfoContext=on;exports.DispenserInfoProvider=Na;exports.DispenserInfoSettings=ya;exports.DispenserSerialNumber=Ks;exports.DispenserSettings=ba;exports.EXTENSION_PLUGIN_VISIBILITY=ee;exports.EXTENSION_POINT_CUI=Mr;exports.EXTENSION_POINT_CUI_DEF=Br;exports.EXTENSION_POINT_CUI_VIEW=Vr;exports.EXTENSION_POINT_DASHBOARD_DETAIL=Nr;exports.EXTENSION_POINT_DASHBOARD_DETAIL_DEF=Dr;exports.EXTENSION_POINT_DASHBOARD_DETAIL_VIEW=Or;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL=Lr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF=Rr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW=Fr;exports.EXTENSION_POINT_DASHBOARD_SUMMARY=Ir;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_DEF=Er;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW=Pr;exports.EXTENSION_POINT_NAV_VIEW=Kr;exports.EXTENSION_POINT_NAV_VIEW_DEF=Ur;exports.EXTENSION_POINT_NAV_VIEW_VIEW=zr;exports.EXTENSION_POINT_SETUP=Zr;exports.EXTENSION_POINT_SETUP_DEF=Hr;exports.EXTENSION_POINT_SETUP_VIEW=Wr;exports.EXTENSION_POINT_TROUBLE_ACTION=Xr;exports.EXTENSION_POINT_TROUBLE_ACTION_DEF=qr;exports.EXTENSION_POINT_TROUBLE_ACTION_VIEW=Gr;exports.EXTENSION_POINT_VIEW=Jr;exports.EXTENSION_POINT_VIEW_DEF=Qr;exports.EXTENSION_POINT_VIEW_VIEW=ea;exports.EnjoyByDate=en;exports.FailureMessage=Ee;exports.Fixed45FlowTestAction=Yn;exports.FlushAction=Jn;exports.FutureProgressBar=V;exports.GenericTroubleAction=is;exports.HardwareInfo=Sa;exports.HighFlowTestAction=Qn;exports.HoldToPourAction=es;exports.HoldToPourButton=ce;exports.HolderActions=Me;exports.HolderCard=Zs;exports.HolderContentContext=Kt;exports.HolderContentProvider=na;exports.HolderGroup=gn;exports.HolderGroupView=ai;exports.HolderNotifications=oe;exports.IceAgitatorDetail=wi;exports.IceAgitatorSettings=Ws;exports.IceAgitatorSettingsContainer=Si;exports.IceAgitatorSettingsView=Ti;exports.IceAgitatorSummary=ki;exports.IngredientSummaryContext=rn;exports.IngredientSummaryProvider=Oa;exports.IntentAction=H;exports.KosPluginExtensionManager=la;exports.LFCVPumpCard=Ri;exports.LocalizationSettings=ji;exports.LowFlowTestAction=ts;exports.MSVPumpCard=Fi;exports.MSVResetAction=ss;exports.MacroAssignmentContext=an;exports.MacroAssignmentProvider=Ra;exports.MacroHolderCard=Hs;exports.MacroHolderGroupView=pi;exports.MacroSetupStepCard=gt;exports.ManualOverrideAction=ns;exports.NavViewExtension=$r;exports.NetworkTestContainerContext=ln;exports.NetworkTestContainerProvider=Va;exports.NetworkTestContext=cn;exports.NetworkTestProvider=Ma;exports.NetworkTestResults=Ai;exports.NotificationCardView=Xs;exports.PluginExtensionManager=Fs;exports.PluginTabs=Di;exports.PrimeAction=os;exports.ProbeView=Lt;exports.PurgeAction=rs;exports.RFIDOverride=Js;exports.RebootContext=dn;exports.RebootProvider=Ka;exports.RebootView=Zi;exports.RemoteNNSModal=Hi;exports.RemoteTrayDetail=Wi;exports.RemoteTraySummary=qi;exports.ReplaceLine=Gs;exports.ReplacePump=Ys;exports.SPMFieldCalibrationModal=no;exports.SettingsContext=un;exports.SettingsProvider=za;exports.SetupExtension=$t;exports.SetupRequired=Qi;exports.SetupSidebar=ec;exports.SetupSidebarComp=to;exports.SetupStepContainerContext=pn;exports.SetupStepContainerProvider=Xa;exports.SetupStepContext=mn;exports.SetupStepProvider=Ha;exports.Software=tc;exports.StagedChangesProvider=hs;exports.StateExperience=oc;exports.StepItem=Qs;exports.StepTitle=eo;exports.SuccessMessage=et;exports.SuperPumpCard=qs;exports.SystemDatePickerCard=so;exports.TROUBLE_PRIME=po;exports.TROUBLE_PURGE=ho;exports.TimePickerCard=ys;exports.TimeSettings=ac;exports.TimeZonePickerCard=oo;exports.TroubleAction=as;exports.TroubleActionExtension=Qe;exports.UtilitiesContainerContext=fn;exports.UtilitiesContainerProvider=Ja;exports.UtilitiesContext=hn;exports.UtilitiesProvider=Ga;exports.ValveCard=Vi;exports.ViewExtension=Yr;exports.WaterPumpCard=$i;exports.WaterSettings=ic;exports.pumpTypeFactory=ca;exports.troubleLabelByType=Ms;exports.troubleLabelFactory=Re;exports.useAgitationControl=Ot;exports.useAnimation=Ft;exports.useAnimationContext=ja;exports.useApplication=Le;exports.useApplicationContext=ft;exports.useCarbWater=ks;exports.useCombinedActions=Ko;exports.useCopyLogs=Ss;exports.useDashboardOperations=Mt;exports.useDashboardOperationsContext=Aa;exports.useDispenserInfo=Bt;exports.useDispenserInfoContext=Da;exports.useDoor=js;exports.useFutureContainer=G;exports.useHolderContent=Ut;exports.useHolderExperience=Ce;exports.useIngredientSummary=zt;exports.useIngredientSummaryContext=La;exports.useMacroAssignment=Zt;exports.useMacroAssignmentContext=Fa;exports.useNetworkTest=Ht;exports.useNetworkTestContainer=Wt;exports.useNetworkTestContainerContext=$a;exports.useNetworkTestContext=Ba;exports.useNutritiveSweetener=Ls;exports.usePlainWater=Rs;exports.usePluginExtensions=Fe;exports.usePumpAction=be;exports.useReboot=mt;exports.useRebootContext=Ua;exports.useSettings=pt;exports.useSettingsContext=Za;exports.useSetupStep=qt;exports.useSetupStepContainer=Gt;exports.useSetupStepContainerContext=qa;exports.useSetupStepContext=Wa;exports.useStagedChanges=Rt;exports.useStart=Vs;exports.useTroubleAction=Wo;exports.useTroubleActionState=Yt;exports.useTroubleData=ht;exports.useTroubleDecoration=$s;exports.useTroubleVisibility=ga;exports.useUtilities=Jt;exports.useUtilitiesContainer=Qt;exports.useUtilitiesContainerContext=Qa;exports.useUtilitiesContext=Ya;exports.useViewExtensions=Ns;exports.useVisibleTroubles=we;exports.withAgitationControl=Xo;exports.withAnimation=_s;exports.withApplication=qo;exports.withCarbWater=Go;exports.withCopyLogs=Yo;exports.withDashboardOperations=Jo;exports.withDispenserInfo=Ts;exports.withDoor=Qo;exports.withIngredientSummary=oa;exports.withMacroAssignment=Ds;exports.withNetworkTest=ra;exports.withNetworkTestContainer=Os;exports.withNutritiveSweetener=aa;exports.withPlainWater=ia;exports.withReboot=da;exports.withSettings=Xt;exports.withSetupStep=ua;exports.withSetupStepContainer=Bs;exports.withStagedChanges=Po;exports.withStart=ma;exports.withTroubleAction=pa;exports.withUtilities=xa;exports.withUtilitiesContainer=va;
426
+ `;exports.ActionButton=uc;exports.ActionContainer=lc;exports.ActionRow=dc;exports.AgitationControlView=wo;exports.AgitatorDetail=jo;exports.AgitatorModal=cs;exports.AgitatorSummary=Eo;exports.AnimationContext=tn;exports.AnimationProvider=ja;exports.ApplicationComponentConfigurationProvider=Ea;exports.ApplicationContext=nn;exports.ApplicationProvider=Pa;exports.CGPPumpCard=Li;exports.CalibrateAction=Gn;exports.CalibrateModal=ms;exports.CarbTankDetail=ko;exports.CarbTankSummary=To;exports.ConfigPropInfoCard=fs;exports.ConfigPropInputCard=tt;exports.ConfigPropInputRangeCard=fe;exports.ConfigPropMultiInputEnableCard=xs;exports.ConfigPropPickerCard=nt;exports.ConfigPropSingleInputEnableCard=$o;exports.ConfigPropSwitchCard=vs;exports.ConfigPropTimePickerCard=bs;exports.ConfigPropToggleCard=Pe;exports.CuiExtension=As;exports.DashboardDetailExtension=Nr;exports.DashboardOperationsContext=sn;exports.DashboardOperationsProvider=Aa;exports.DashboardPumpDetailExtension=Oe;exports.DashboardSummaryExtension=Ir;exports.DatePickerCard=Cs;exports.DiagnosticsModal=ws;exports.DispenserInfoContext=on;exports.DispenserInfoProvider=Da;exports.DispenserInfoSettings=ba;exports.DispenserSerialNumber=Us;exports.DispenserSettings=Ca;exports.EXTENSION_PLUGIN_VISIBILITY=ee;exports.EXTENSION_POINT_CUI=Vr;exports.EXTENSION_POINT_CUI_DEF=Br;exports.EXTENSION_POINT_CUI_VIEW=$r;exports.EXTENSION_POINT_DASHBOARD_DETAIL=Dr;exports.EXTENSION_POINT_DASHBOARD_DETAIL_DEF=Or;exports.EXTENSION_POINT_DASHBOARD_DETAIL_VIEW=Lr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL=Rr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF=Fr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW=Mr;exports.EXTENSION_POINT_DASHBOARD_SUMMARY=Er;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_DEF=Pr;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW=Ar;exports.EXTENSION_POINT_NAV_VIEW=Ur;exports.EXTENSION_POINT_NAV_VIEW_DEF=zr;exports.EXTENSION_POINT_NAV_VIEW_VIEW=Zr;exports.EXTENSION_POINT_SETUP=Hr;exports.EXTENSION_POINT_SETUP_DEF=Wr;exports.EXTENSION_POINT_SETUP_VIEW=Xr;exports.EXTENSION_POINT_TROUBLE_ACTION=qr;exports.EXTENSION_POINT_TROUBLE_ACTION_DEF=Gr;exports.EXTENSION_POINT_TROUBLE_ACTION_VIEW=Yr;exports.EXTENSION_POINT_VIEW=Qr;exports.EXTENSION_POINT_VIEW_DEF=ea;exports.EXTENSION_POINT_VIEW_VIEW=ta;exports.EnjoyByDate=en;exports.FailureMessage=Ee;exports.Fixed45FlowTestAction=Yn;exports.FlushAction=Jn;exports.FutureProgressBar=B;exports.GenericTroubleAction=is;exports.HardwareInfo=Ta;exports.HighFlowTestAction=Qn;exports.HoldToPourAction=es;exports.HoldToPourButton=le;exports.HolderActions=Me;exports.HolderCard=Hs;exports.HolderContentContext=Kt;exports.HolderContentProvider=sa;exports.HolderGroup=gn;exports.HolderGroupView=ii;exports.HolderNotifications=oe;exports.IceAgitatorDetail=_i;exports.IceAgitatorSettings=Xs;exports.IceAgitatorSettingsContainer=Ti;exports.IceAgitatorSettingsView=ji;exports.IceAgitatorSummary=Si;exports.IngredientSummaryContext=rn;exports.IngredientSummaryProvider=La;exports.IntentAction=H;exports.KosPluginExtensionManager=da;exports.LFCVPumpCard=Fi;exports.LocalizationSettings=Ii;exports.LowFlowTestAction=ts;exports.MSVPumpCard=Mi;exports.MSVResetAction=ss;exports.MacroAssignmentContext=an;exports.MacroAssignmentProvider=Fa;exports.MacroHolderCard=Ws;exports.MacroHolderGroupView=hi;exports.MacroSetupStepCard=gt;exports.ManualOverrideAction=ns;exports.NavViewExtension=Kr;exports.NetworkTestContainerContext=ln;exports.NetworkTestContainerProvider=$a;exports.NetworkTestContext=cn;exports.NetworkTestProvider=Va;exports.NetworkTestResults=Ni;exports.NotificationCardView=qs;exports.PluginExtensionManager=Fs;exports.PluginTabs=Oi;exports.PrimeAction=os;exports.ProbeView=Lt;exports.PurgeAction=rs;exports.RFIDOverride=Qs;exports.RebootContext=dn;exports.RebootProvider=Ua;exports.RebootView=Hi;exports.RemoteNNSModal=Wi;exports.RemoteTrayDetail=Xi;exports.RemoteTraySummary=Gi;exports.ReplaceLine=Ys;exports.ReplacePump=Js;exports.SPMFieldCalibrationModal=so;exports.SettingsContext=un;exports.SettingsProvider=Za;exports.SetupExtension=$t;exports.SetupRequired=ec;exports.SetupSidebar=tc;exports.SetupSidebarComp=no;exports.SetupStepContainerContext=pn;exports.SetupStepContainerProvider=qa;exports.SetupStepContext=mn;exports.SetupStepProvider=Wa;exports.Software=nc;exports.StagedChangesProvider=hs;exports.StateExperience=rc;exports.StepItem=eo;exports.StepTitle=to;exports.SuccessMessage=et;exports.SuperPumpCard=Gs;exports.SystemDatePickerCard=oo;exports.TROUBLE_PRIME=ho;exports.TROUBLE_PURGE=fo;exports.TimePickerCard=ys;exports.TimeSettings=ic;exports.TimeZonePickerCard=ro;exports.TroubleAction=as;exports.TroubleActionExtension=Qe;exports.UtilitiesContainerContext=fn;exports.UtilitiesContainerProvider=Qa;exports.UtilitiesContext=hn;exports.UtilitiesProvider=Ya;exports.ValveCard=$i;exports.ViewExtension=Jr;exports.WaterPumpCard=Ki;exports.WaterSettings=cc;exports.pumpTypeFactory=la;exports.troubleLabelByType=Ms;exports.troubleLabelFactory=Re;exports.useAgitationControl=Ot;exports.useAnimation=Ft;exports.useAnimationContext=Ia;exports.useApplication=Le;exports.useApplicationContext=ft;exports.useCarbWater=ks;exports.useCombinedActions=Uo;exports.useCopyLogs=Ss;exports.useDashboardOperations=Mt;exports.useDashboardOperationsContext=Na;exports.useDispenserInfo=Vt;exports.useDispenserInfoContext=Oa;exports.useDoor=js;exports.useFutureContainer=G;exports.useHolderContent=Ut;exports.useHolderExperience=Ce;exports.useIngredientSummary=zt;exports.useIngredientSummaryContext=Ra;exports.useMacroAssignment=Zt;exports.useMacroAssignmentContext=Ma;exports.useNetworkTest=Ht;exports.useNetworkTestContainer=Wt;exports.useNetworkTestContainerContext=Ka;exports.useNetworkTestContext=Ba;exports.useNutritiveSweetener=Ls;exports.usePlainWater=Rs;exports.usePluginExtensions=Fe;exports.usePumpAction=ce;exports.usePumpCalibration=Bs;exports.useReboot=mt;exports.useRebootContext=za;exports.useSettings=pt;exports.useSettingsContext=Ha;exports.useSetupStep=qt;exports.useSetupStepContainer=Gt;exports.useSetupStepContainerContext=Ga;exports.useSetupStepContext=Xa;exports.useStagedChanges=Rt;exports.useStart=$s;exports.useTroubleAction=Xo;exports.useTroubleActionState=Yt;exports.useTroubleData=ht;exports.useTroubleDecoration=Ks;exports.useTroubleVisibility=xa;exports.useUtilities=Jt;exports.useUtilitiesContainer=Qt;exports.useUtilitiesContainerContext=ei;exports.useUtilitiesContext=Ja;exports.useViewExtensions=Ns;exports.useVisibleTroubles=we;exports.withAgitationControl=qo;exports.withAnimation=_s;exports.withApplication=Go;exports.withCarbWater=Yo;exports.withCopyLogs=Jo;exports.withDashboardOperations=Qo;exports.withDispenserInfo=Ts;exports.withDoor=er;exports.withIngredientSummary=ra;exports.withMacroAssignment=Ds;exports.withNetworkTest=aa;exports.withNetworkTestContainer=Os;exports.withNutritiveSweetener=ia;exports.withPlainWater=ca;exports.withReboot=ua;exports.withSettings=Xt;exports.withSetupStep=ma;exports.withSetupStepContainer=Vs;exports.withStagedChanges=Ao;exports.withStart=pa;exports.withTroubleAction=ha;exports.withUtilities=va;exports.withUtilitiesContainer=ya;