@kosdev-code/kos-ddk-model-components 2.1.0 → 2.1.1

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 co=Object.defineProperty;var lo=(t,e,n)=>e in t?co(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var M=(t,e,n)=>(lo(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@kosdev-code/kos-ui-sdk"),a=require("@emotion/react/jsx-runtime"),j=require("@emotion/styled"),l=require("@kosdev-code/kos-ddk-components"),p=require("react"),E=require("@kosdev-code/kos-ddk-models"),xe=require("@kosdev-code/kos-ddk-styles"),jt=require("@kosdev-code/kos-dispense-sdk"),Te=require("@kosdev-code/kos-freestyle-sdk"),oe=require("@kosdev-code/kos-ui-plugin"),I=require("@kosdev-code/kos-ui-plugin/utilities"),zn=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=m.FutureManager.getFuture(e.tracker))}}class Hn extends H{constructor(e){super(e,{title:"Calibrate",intent:"CALIBRATE",successMessage:"Calibrate Complete",failureMessage:"Calibrate Failed"})}enabled(){return!0}}class Wn 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 Xn 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 Gn extends H{constructor(e){super(e,{title:"Hold to Pour",intent:"HOLD_TO_POUR",successMessage:"Pour Complete",failureMessage:"Pour Failed"})}enabled(){return!0}}class Yn 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 Jn extends H{constructor(e){super(e,{title:"Manual Override",intent:"SOFT_START",successMessage:"Manual Override Complete",failureMessage:"Manual Override Failed"})}enabled(){return!0}}class Qn extends H{constructor(e){super(e,{title:"Reset",intent:"MSV_RESET",successMessage:"Reset Complete",failureMessage:"Reset Failed"})}enabled(){return!0}}class es extends H{constructor(e){super(e,{title:"Prime",intent:"PRIME",successMessage:"Prime Complete",failureMessage:"Prime Failed"})}enabled(){return!0}}class ts extends H{constructor(e){super(e,{title:"Purge",intent:"PURGE",successMessage:"Purge Complete",failureMessage:"Purge Failed"})}enabled(){return!0}}class ns{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=m.FutureManager.getFuture(s.tracker))}}class ss extends ns{constructor(e,n){super(e,{trouble:n})}enabled(){return!0}}const uo="PrimeTrouble",mo="PurgeTrouble",po=j.div`
1
+ "use strict";var ro=Object.defineProperty;var ao=(t,e,n)=>e in t?ro(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var M=(t,e,n)=>(ao(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@kosdev-code/kos-ui-sdk"),a=require("@emotion/react/jsx-runtime"),I=require("@emotion/styled"),d=require("@kosdev-code/kos-ddk-components"),p=require("react"),E=require("@kosdev-code/kos-ddk-models"),xe=require("@kosdev-code/kos-ddk-styles"),jt=require("@kosdev-code/kos-dispense-sdk"),Te=require("@kosdev-code/kos-freestyle-sdk"),oe=require("@kosdev-code/kos-ui-plugin"),j=require("@kosdev-code/kos-ui-plugin/utilities"),Zn=require("react-router-dom");class z{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=m.FutureManager.getFuture(e.tracker))}}class zn extends z{constructor(e){super(e,{title:"Calibrate",intent:"CALIBRATE",successMessage:"Calibrate Complete",failureMessage:"Calibrate Failed"})}enabled(){return!0}}class Hn extends z{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 Wn extends z{constructor(e){super(e,{title:"Flush",intent:"FLUSH",successMessage:"Flush Complete",failureMessage:"Flush Failed"})}enabled(){return!0}}class Xn extends z{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 qn extends z{constructor(e){super(e,{title:"Hold to Pour",intent:"HOLD_TO_POUR",successMessage:"Pour Complete",failureMessage:"Pour Failed"})}enabled(){return!0}}class Gn extends z{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 Yn extends z{constructor(e){super(e,{title:"Manual Override",intent:"SOFT_START",successMessage:"Manual Override Complete",failureMessage:"Manual Override Failed"})}enabled(){return!0}}class Jn extends z{constructor(e){super(e,{title:"Reset",intent:"MSV_RESET",successMessage:"Reset Complete",failureMessage:"Reset Failed"})}enabled(){return!0}}class Qn extends z{constructor(e){super(e,{title:"Prime",intent:"PRIME",successMessage:"Prime Complete",failureMessage:"Prime Failed"})}enabled(){return!0}}class es extends z{constructor(e){super(e,{title:"Purge",intent:"PURGE",successMessage:"Purge Complete",failureMessage:"Purge Failed"})}enabled(){return!0}}class ts{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=m.FutureManager.getFuture(s.tracker))}}class ns extends ts{constructor(e,n){super(e,{trouble:n})}enabled(){return!0}}const io="PrimeTrouble",co="PurgeTrouble",lo=I.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
- `,os=m.kosComponent(({holder:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=m.useKosTranslation("common"),{componentModeOverride:r}=l.useComponentConfigurationContext(),c=t.data.agitated;return a.jsx(l.Modal,{contain:r!=="compact",onClosed:e,show:!n,children:a.jsxs(po,{children:[a.jsx(l.Header,{contain:r==="compact",showCloseButton:!0,title:o("shelf-agitator"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:r==="compact"?l.BackButton:void 0}),a.jsx(l.Content,{align:"top",children:a.jsx(l.InfoCard,{label:o("agitating"),padding:"x-large",value:o(c?"no":"yes")})}),a.jsx(l.Footer,{children:a.jsx(l.Button,{mode:"primary",disabled:c,onPointerDown:()=>console.log("agitate!"),children:o("test-shelf-agitator")})})]})})}),Et=()=>{const t=E.AgitationControl.type;return m.useKosModel({modelId:t,modelType:E.AgitationControl.type,options:{}})},ne=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=m.kosAutoEffect(()=>{const u=t==null?void 0:t.futureHandler.future;n(u),o(u==null?void 0:u.endState)});return()=>{d(),t==null||t.futureHandler.removeFuture()}},[t==null?void 0:t.futureHandler]);const r=p.useCallback(()=>{t==null||t.futureHandler.removeFuture()},[t==null?void 0:t.futureHandler]);return{future:e,clearFuture:r,success:s===m.FutureEndState.Success,failure:s&&s!==m.FutureEndState.Success}},ho=m.KosLog.createLogger({name:"future-progress-bar"}),rs=j(l.CloseButton)`
8
+ `,ss=m.kosComponent(({holder:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=m.useKosTranslation("common"),{componentModeOverride:r}=d.useComponentConfigurationContext(),c=t.data.agitated;return a.jsx(d.Modal,{contain:r!=="compact",onClosed:e,show:!n,children:a.jsxs(lo,{children:[a.jsx(d.Header,{contain:r==="compact",showCloseButton:!0,title:o("shelf-agitator"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:r==="compact"?d.BackButton:void 0}),a.jsx(d.Content,{align:"top",children:a.jsx(d.InfoCard,{label:o("agitating"),padding:"x-large",value:o(c?"no":"yes")})}),a.jsx(d.Footer,{children:a.jsx(d.Button,{mode:"primary",disabled:c,onPointerDown:()=>console.log("agitate!"),children:o("test-shelf-agitator")})})]})})}),Et=()=>{const t=E.AgitationControl.type;return m.useKosModel({modelId:t,modelType:E.AgitationControl.type,options:{}})},ne=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 l=m.kosAutoEffect(()=>{const u=t==null?void 0:t.futureHandler.future;n(u),o(u==null?void 0:u.endState)});return()=>{l(),t==null||t.futureHandler.removeFuture()}},[t==null?void 0:t.futureHandler]);const r=p.useCallback(()=>{t==null||t.futureHandler.removeFuture()},[t==null?void 0:t.futureHandler]);return{future:e,clearFuture:r,success:s===m.FutureEndState.Success,failure:s&&s!==m.FutureEndState.Success}},uo=m.KosLog.createLogger({name:"future-progress-bar"}),os=I(d.CloseButton)`
9
9
  --ddk-component-icon-button-icon-color-active: var(
10
10
  --ddk-component-progress-bar-close-button-color-active
11
11
  );
@@ -18,12 +18,12 @@
18
18
  --ddk-component-icon-button-icon-color-hover: var(
19
19
  --ddk-component-progress-bar-close-button-color-hover
20
20
  );
21
- `,fo=j.div`
21
+ `,mo=I.div`
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  width: 100%;
25
25
  gap: 8px;
26
- `,as=j.div`
26
+ `,rs=I.div`
27
27
  align-items: var(--ddk-component-progress-bar-message-align-items);
28
28
  color: var(--ddk-component-progress-bar-message-color);
29
29
  display: flex;
@@ -31,18 +31,18 @@
31
31
  gap: var(--ddk-component-progress-bar-message-gap);
32
32
  justify-content: space-between;
33
33
  width: 100%;
34
- `,is=j.div`
34
+ `,as=I.div`
35
35
  display: flex;
36
36
  gap: var(--ddk-component-status-bar-gap);
37
37
  align-items: center;
38
- `,go=j.div`
38
+ `,po=I.div`
39
39
  border-top: solid 1px #888888;
40
40
  padding-top: 8px;
41
41
  width: calc(100% - 10px);
42
- `,Ie=({children:t,onPointerDown:e,title:n,subtitle:s})=>{const{componentModeOverride:o}=l.useComponentConfigurationContext(),{t:r}=m.useKosTranslation("common"),c=n??t;return a.jsxs(as,{children:[a.jsxs(fo,{children:[a.jsxs(is,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[a.jsx(xe.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),c]}),s&&a.jsx(go,{children:s})]}),o==="compact"?a.jsx(l.Button,{mode:"primary",onPointerDown:e,children:r("close","Close")}):a.jsx(rs,{label:!1,size:"large",onPointerDown:e})]})},Qe=({children:t,onPointerDown:e})=>{const{componentModeOverride:n}=l.useComponentConfigurationContext(),{t:s}=m.useKosTranslation("common");return a.jsxs(as,{children:[a.jsxs(is,{children:[a.jsx(xe.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),t]}),n==="compact"?a.jsx(l.Button,{mode:"primary",onPointerDown:e,children:s("close","Close")}):a.jsx(rs,{label:!1,size:"large",onPointerDown:e})]})},fn=t=>(t==null?void 0:t.title)&&(t==null?void 0:t.subtitle),V=m.kosComponent(({title:t,future:e,failureMessage:n,successMessage:s,cancelMessage:o,isCancelable:r=!0,onSuccess:c,onClose:i})=>{const{t:d}=m.useKosTranslation("common"),[u,f]=p.useState(!0),[h,g]=p.useState(),y=`${e==null?void 0:e.timeRemaining} ${d("remaining","remaining")}`,v=p.useCallback(()=>{h!=="in-progress"&&(i==null||i(),f(!1))},[i,h]),C=p.useCallback(()=>{v(),c==null||c()},[v,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||(v(),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&&ho.error("unknown status",e==null?void 0:e.status)},[n,e,e==null?void 0:e.status,s,o,v,c]);const T=fn(n)?n.subtitle:void 0,N=fn(n)?n.title:n??d("something-went-wrong","Something went wrong");return e&&a.jsx(l.ProgressBar,{isCancelable:r,onCancel:()=>{e.cancelFuture()},blocked:h==="in-progress",onClose:v,renderFailure:n&&a.jsx(Ie,{subtitle:T,onPointerDown:v,children:N}),renderCancel:o&&a.jsx(Ie,{onPointerDown:v,children:o}),renderSuccess:s&&a.jsx(Qe,{onPointerDown:C,children:s}),show:u,status:h,subtitle:y,title:t,value:e.progress})}),xo=m.KosLog.createLogger({name:"agitation-control-view"});xo.debug("agitation-control-view component loaded");const yo=j.div``,vo=m.kosComponent(()=>{const{model:t}=Et(),{t:e,i18n:n}=m.useKosTranslation("troubles"),{future:s,failure:o}=ne(t),r=p.useCallback(()=>{t&&t.clearAll()},[t]),c=s==null?void 0:s.reason,i=c?`__troubles.errors.${c}__`:void 0,d="troubles.agitation.error",u=n.exists(`troubles.errors.${c}`);return a.jsx(yo,{children:a.jsx(V,{title:e("troubles.agitation.title"),future:s,isCancelable:!0,onClose:r,failureMessage:e(d,{context:i&&u?"reason":void 0,data:{reason:i}})})})}),cs=m.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,o]=p.useState("high-flow-test-idle"),[r,c]=p.useState(),[i,d]=p.useState(),[u,f]=p.useState(),{future:h}=ne(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:a.jsx(l.LabelInformation,{children:n("high-flow-test-idle-information")}),footer:a.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:a.jsx(l.LabelInformation,{children:n("high-flow-test-in-progress-information")}),footer:a.jsx(l.Button,{disabled:!0,children:n("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:a.jsx(l.LabelInformation,{children:n("high-flow-test-success-information")}),footer:a.jsx(l.Button,{onPointerDown:()=>o("calibration-idle"),children:n("proceed")}),status:"success"},"calibration-idle":{information:a.jsx(l.BodyMediumInformation,{children:n("calibration-idle-information")}),footer:a.jsx(l.Button,{onPointerDown:()=>{t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:a.jsx(l.LabelInformation,{children:n("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(l.BodyMediumInformation,{children:n("calibration-input-information")}),a.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&d(y)},value:i!==void 0?i:""})]}),footer:a.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:a.jsx(l.BodyMediumInformation,{children:n("verification-idle-information")}),footer:a.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:a.jsx(l.LabelInformation,{children:n("verification-in-progress-information")}),status:"loading"},"verification-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(l.BodyMediumInformation,{children:n("verification-input-information")}),a.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&f(y)},value:u!==void 0?u:""})]}),footer:a.jsx(l.Button,{disabled:u===void 0,onPointerDown:async()=>{if(i===void 0||u===void 0)return;const y=await t.performComplete(i,u);y==="success"?o("verification-success"):(c(y),o(y==="errBadPump"?"verification-failure":"failure"))},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:a.jsx(l.LabelInformation,{children:n("verification-success-information")}),footer:a.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:a.jsx(l.LabelInformation,{children:n(`error.${r}`)}),footer:a.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:a.jsxs(a.Fragment,{children:[a.jsx(l.LabelInformation,{children:n("calibration-failed")}),a.jsx(l.BodyMediumInformation,{children:n(`error.${r||"unknownError"}`)})]}),footer:a.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[r,e,t,n,i,u]);return a.jsxs(a.Fragment,{children:[a.jsx(l.WorkflowModal,{title:n(t.name),...g[s],onClose:()=>e()}),h&&a.jsx(V,{title:n("initiating"),future:h})]})}),bo=m.kosComponent(({cardModel:t})=>{m.KosLog.debug("Agitator",t.path);const{t:e}=m.useKosTranslation(["agitator","common"]),{future:n}=ne(t),s=p.useCallback(o=>{o==="agitate"&&(t==null||t.testAgitate())},[t]);return a.jsxs(a.Fragment,{children:[a.jsx(l.Content,{children:a.jsx(l.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")})}),a.jsx(l.Footer,{children:a.jsx(l.Button,{onPointerDown:()=>s("agitate"),children:e("action.label",{context:"agitator"})})}),n&&a.jsx(V,{title:e("testing"),future:n})]})}),Co=j.div`
42
+ `,Ie=({children:t,onPointerDown:e,title:n,subtitle:s})=>{const{componentModeOverride:o}=d.useComponentConfigurationContext(),{t:r}=m.useKosTranslation("common"),c=n??t;return a.jsxs(rs,{children:[a.jsxs(mo,{children:[a.jsxs(as,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[a.jsx(xe.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),c]}),s&&a.jsx(po,{children:s})]}),o==="compact"?a.jsx(d.Button,{mode:"primary",onPointerDown:e,children:r("close","Close")}):a.jsx(os,{label:!1,size:"large",onPointerDown:e})]})},Qe=({children:t,onPointerDown:e})=>{const{componentModeOverride:n}=d.useComponentConfigurationContext(),{t:s}=m.useKosTranslation("common");return a.jsxs(rs,{children:[a.jsxs(as,{children:[a.jsx(xe.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),t]}),n==="compact"?a.jsx(d.Button,{mode:"primary",onPointerDown:e,children:s("close","Close")}):a.jsx(os,{label:!1,size:"large",onPointerDown:e})]})},fn=t=>(t==null?void 0:t.title)&&(t==null?void 0:t.subtitle),V=m.kosComponent(({title:t,future:e,failureMessage:n,successMessage:s,cancelMessage:o,isCancelable:r=!0,onSuccess:c,onClose:i})=>{const{t:l}=m.useKosTranslation("common"),[u,f]=p.useState(!0),[h,g]=p.useState(),y=`${e==null?void 0:e.timeRemaining} ${l("remaining","remaining")}`,v=p.useCallback(()=>{h!=="in-progress"&&(i==null||i(),f(!1))},[i,h]),C=p.useCallback(()=>{v(),c==null||c()},[v,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||(v(),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&&uo.error("unknown status",e==null?void 0:e.status)},[n,e,e==null?void 0:e.status,s,o,v,c]);const T=fn(n)?n.subtitle:void 0,A=fn(n)?n.title:n??l("something-went-wrong","Something went wrong");return e&&a.jsx(d.ProgressBar,{isCancelable:r,onCancel:()=>{e.cancelFuture()},blocked:h==="in-progress",onClose:v,renderFailure:n&&a.jsx(Ie,{subtitle:T,onPointerDown:v,children:A}),renderCancel:o&&a.jsx(Ie,{onPointerDown:v,children:o}),renderSuccess:s&&a.jsx(Qe,{onPointerDown:C,children:s}),show:u,status:h,subtitle:y,title:t,value:e.progress})}),ho=m.KosLog.createLogger({name:"agitation-control-view"});ho.debug("agitation-control-view component loaded");const fo=I.div``,go=m.kosComponent(()=>{const{model:t}=Et(),{t:e,i18n:n}=m.useKosTranslation("troubles"),{future:s,failure:o}=ne(t),r=p.useCallback(()=>{t&&t.clearAll()},[t]),c=s==null?void 0:s.reason,i=c?`__troubles.errors.${c}__`:void 0,l="troubles.agitation.error",u=n.exists(`troubles.errors.${c}`);return a.jsx(fo,{children:a.jsx(V,{title:e("troubles.agitation.title"),future:s,isCancelable:!0,onClose:r,failureMessage:e(l,{context:i&&u?"reason":void 0,data:{reason:i}})})})}),is=m.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,o]=p.useState("high-flow-test-idle"),[r,c]=p.useState(),[i,l]=p.useState(),[u,f]=p.useState(),{future:h}=ne(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:a.jsx(d.LabelInformation,{children:n("high-flow-test-idle-information")}),footer:a.jsx(d.Button,{onPointerDown:()=>{t.performPreCalibrate(),o("high-flow-test-in-progress")},children:n("initiate-high-flow-test")}),status:"information"},"high-flow-test-in-progress":{information:a.jsx(d.LabelInformation,{children:n("high-flow-test-in-progress-information")}),footer:a.jsx(d.Button,{disabled:!0,children:n("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:a.jsx(d.LabelInformation,{children:n("high-flow-test-success-information")}),footer:a.jsx(d.Button,{onPointerDown:()=>o("calibration-idle"),children:n("proceed")}),status:"success"},"calibration-idle":{information:a.jsx(d.BodyMediumInformation,{children:n("calibration-idle-information")}),footer:a.jsx(d.Button,{onPointerDown:()=>{t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:a.jsx(d.LabelInformation,{children:n("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(d.BodyMediumInformation,{children:n("calibration-input-information")}),a.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&l(y)},value:i!==void 0?i:""})]}),footer:a.jsx(d.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:a.jsx(d.BodyMediumInformation,{children:n("verification-idle-information")}),footer:a.jsx(d.Button,{onPointerDown:async()=>{i!==void 0&&(t.performVerify(i),o("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:a.jsx(d.LabelInformation,{children:n("verification-in-progress-information")}),status:"loading"},"verification-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(d.BodyMediumInformation,{children:n("verification-input-information")}),a.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:y=>{y!==void 0&&f(y)},value:u!==void 0?u:""})]}),footer:a.jsx(d.Button,{disabled:u===void 0,onPointerDown:async()=>{if(i===void 0||u===void 0)return;const y=await t.performComplete(i,u);y==="success"?o("verification-success"):(c(y),o(y==="errBadPump"?"verification-failure":"failure"))},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:a.jsx(d.LabelInformation,{children:n("verification-success-information")}),footer:a.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:a.jsx(d.LabelInformation,{children:n(`error.${r}`)}),footer:a.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:a.jsxs(a.Fragment,{children:[a.jsx(d.LabelInformation,{children:n("calibration-failed")}),a.jsx(d.BodyMediumInformation,{children:n(`error.${r||"unknownError"}`)})]}),footer:a.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[r,e,t,n,i,u]);return a.jsxs(a.Fragment,{children:[a.jsx(d.WorkflowModal,{title:n(t.name),...g[s],onClose:()=>e()}),h&&a.jsx(V,{title:n("initiating"),future:h})]})}),xo=m.kosComponent(({cardModel:t})=>{m.KosLog.debug("Agitator",t.path);const{t:e}=m.useKosTranslation(["agitator","common"]),{future:n}=ne(t),s=p.useCallback(o=>{o==="agitate"&&(t==null||t.testAgitate())},[t]);return a.jsxs(a.Fragment,{children:[a.jsx(d.Content,{children:a.jsx(d.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")})}),a.jsx(d.Footer,{children:a.jsx(d.Button,{onPointerDown:()=>s("agitate"),children:e("action.label",{context:"agitator"})})}),n&&a.jsx(V,{title:e("testing"),future:n})]})}),yo=I.div`
43
43
  font-size: var(--ddk-component-holder-card-footer-font-size);
44
44
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
45
- `,_o=m.kosComponent(t=>{m.KosLog.debug(`summary component loaded for holder ${t}`),m.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=m.useKosTranslation("common");return a.jsxs(a.Fragment,{children:[a.jsx(l.StatusIndicator,{size:"small",status:"completed"}),t.cardModel.isAgitating&&a.jsx(Co,{children:e("agitating")})]})}),wo={getStagedChange:void 0,updateStagedChange:void 0,saveChanges:void 0,clearStagedChanges:void 0},ls=p.createContext(wo),ds=({children:t})=>{const[e,n]=p.useState({}),s=i=>e[i],o=(i,d)=>{n(u=>({...u,[i]:d}))},r=()=>n({}),c=async()=>{for(const i in e)e[i].configProperty.updateProperty(e[i].value);r()};return a.jsx(ls.Provider,{value:{getStagedChange:s,updateStagedChange:o,saveChanges:c,clearStagedChanges:r},children:t})},Pt=()=>p.useContext(ls),ko=t=>e=>a.jsx(ds,{children:a.jsx(t,{...e})}),us=({label:t,configProperty:e})=>{const{value:n}=m.useConfigProperty({configProperty:e});return a.jsx(l.InfoCard,{label:t,value:n})},et=({configProperty:t,hideUnits:e,isValid:n,...s})=>{var f,h;const{t:o}=m.useKosTranslation("common",{keyPrefix:"validation"}),{significantValue:r}=m.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,u=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 a.jsx(l.InputCard,{...s,isValid:u,onChange:c,unitValue:e?void 0:t.unit,value:r})},me=({configProperty:t,label:e,onChange:n,...s})=>{var c,i;const{t:o}=m.useKosTranslation(["config-properties","common"]),r=m.useConfigProperty({configProperty:t});return a.jsx(l.InputRangeCard,{...s,label:e??o(t.id),layout:"num",maxValue:(c=r.displayOptions)==null?void 0:c.max,minValue:(i=r.displayOptions)==null?void 0:i.min,onChange:d=>t.updateProperty(d),unitValue:r.unit,value:r.significantValue})},je=({configProperty:t,overrideChecked:e,...n})=>{var d;const{getStagedChange:s,updateStagedChange:o}=Pt(),{value:r}=m.useConfigProperty({configProperty:t}),c=((d=s==null?void 0:s(t.id))==null?void 0:d.value)??r,i=u=>{o?o(t.id,{configProperty:t,value:u}):t.updateProperty(u)};return a.jsx(l.ToggleCard,{toggleLabel:c==="true"?"Enabled":"Disabled",...n,onChange:i,checked:e!==void 0?e:c==="true"})},So=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],tt=({collapse:t,cancelButtonLabel:e,configProperty:n,displayMode:s="raw",displayValue:o,float:r,items:c,label:i,onChange:d,onSave:u,proceedButtonLabel:f,selectedItemId:h,unitValue:g,...y})=>{const{t:v}=m.useKosTranslation(["config-properties","common"]),C=m.useConfigProperty({configProperty:n,optionsTransformer:So});return a.jsx(l.PickerCard,{...y,cancelButtonLabel:e??(v("discard-changes",{defaultValue:"Discard Changes",ns:"common"})||void 0),collapse:t,displayValue:o??s==="raw"?C.value:C.displayValue,float:r,items:c??C.mappedOptions,label:i??v(n.id),onSave:T=>u?u(T):n.updateProperty(T),proceedButtonLabel:f??(v("save",{defaultValue:"Save",ns:"common"})||void 0),selectedItemId:h??C.value,unitValue:g??C.unit})},To=j(et)`
45
+ `,vo=m.kosComponent(t=>{m.KosLog.debug(`summary component loaded for holder ${t}`),m.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=m.useKosTranslation("common");return a.jsxs(a.Fragment,{children:[a.jsx(d.StatusIndicator,{size:"small",status:"completed"}),t.cardModel.isAgitating&&a.jsx(yo,{children:e("agitating")})]})}),bo={getStagedChange:void 0,updateStagedChange:void 0,saveChanges:void 0,clearStagedChanges:void 0},cs=p.createContext(bo),ds=({children:t})=>{const[e,n]=p.useState({}),s=i=>e[i],o=(i,l)=>{n(u=>({...u,[i]:l}))},r=()=>n({}),c=async()=>{for(const i in e)e[i].configProperty.updateProperty(e[i].value);r()};return a.jsx(cs.Provider,{value:{getStagedChange:s,updateStagedChange:o,saveChanges:c,clearStagedChanges:r},children:t})},Pt=()=>p.useContext(cs),Co=t=>e=>a.jsx(ds,{children:a.jsx(t,{...e})}),ls=({label:t,configProperty:e})=>{const{value:n}=m.useConfigProperty({configProperty:e});return a.jsx(d.InfoCard,{label:t,value:n})},et=({configProperty:t,hideUnits:e,isValid:n,...s})=>{var f,h;const{t:o}=m.useKosTranslation("common",{keyPrefix:"validation"}),{significantValue:r}=m.useConfigProperty({configProperty:t}),c=g=>{g||(g=""),t.updateProperty(g)},i=(f=t.displayOptions)==null?void 0:f.max,l=(h=t.displayOptions)==null?void 0:h.min,u=p.useCallback(g=>{const y=n==null?void 0:n(g);return y||(Number(g)<l?o("minValue",{data:{minValue:l}}):Number(g)>i?o("maxValue",{data:{maxValue:i}}):void 0)},[n,i,l,o]);return a.jsx(d.InputCard,{...s,isValid:u,onChange:c,unitValue:e?void 0:t.unit,value:r})},me=({configProperty:t,label:e,onChange:n,...s})=>{var c,i;const{t:o}=m.useKosTranslation(["config-properties","common"]),r=m.useConfigProperty({configProperty:t});return a.jsx(d.InputRangeCard,{...s,label:e??o(t.id),layout:"num",maxValue:(c=r.displayOptions)==null?void 0:c.max,minValue:(i=r.displayOptions)==null?void 0:i.min,onChange:l=>t.updateProperty(l),unitValue:r.unit,value:r.significantValue})},je=({configProperty:t,overrideChecked:e,...n})=>{var l;const{getStagedChange:s,updateStagedChange:o}=Pt(),{value:r}=m.useConfigProperty({configProperty:t}),c=((l=s==null?void 0:s(t.id))==null?void 0:l.value)??r,i=u=>{o?o(t.id,{configProperty:t,value:u}):t.updateProperty(u)};return a.jsx(d.ToggleCard,{toggleLabel:c==="true"?"Enabled":"Disabled",...n,onChange:i,checked:e!==void 0?e:c==="true"})},_o=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],tt=({collapse:t,cancelButtonLabel:e,configProperty:n,displayMode:s="raw",displayValue:o,float:r,items:c,label:i,onChange:l,onSave:u,proceedButtonLabel:f,selectedItemId:h,unitValue:g,...y})=>{const{t:v}=m.useKosTranslation(["config-properties","common"]),C=m.useConfigProperty({configProperty:n,optionsTransformer:_o});return a.jsx(d.PickerCard,{...y,cancelButtonLabel:e??(v("discard-changes",{defaultValue:"Discard Changes",ns:"common"})||void 0),collapse:t,displayValue:o??s==="raw"?C.value:C.displayValue,float:r,items:c??C.mappedOptions,label:i??v(n.id),onSave:T=>u?u(T):n.updateProperty(T),proceedButtonLabel:f??(v("save",{defaultValue:"Save",ns:"common"})||void 0),selectedItemId:h??C.value,unitValue:g??C.unit})},wo=I(et)`
46
46
  border-top: var(--ddk-component-input-enable-card-input-container-border);
47
47
  border-radius: 0;
48
48
  cursor: pointer;
@@ -78,7 +78,7 @@
78
78
  --ddk-component-input-enable-card-input-font-weight
79
79
  );
80
80
  }
81
- `,Io=j(tt)`
81
+ `,ko=I(tt)`
82
82
  border-top: var(--ddk-component-input-enable-card-input-container-border);
83
83
  border-radius: 0;
84
84
  cursor: pointer;
@@ -115,14 +115,14 @@
115
115
  --ddk-component-input-enable-card-input-font-weight
116
116
  );
117
117
  }
118
- `,jo=(t,e,n,s,o)=>{let r;const c=o==="compact"?To:et,i=o==="compact"?Io:tt,d=s.label??n(t.id);switch(t.schemaType){case"boolean":r=a.jsx(je,{configProperty:t,...s,label:d});break;case"double":r=a.jsx(me,{configProperty:t,...s,label:d});break;case"int":r=a.jsx(me,{configProperty:t,...s,label:d});break;case"String":r=a.jsx(c,{configProperty:t,...s,label:d});break;case"enum":r=a.jsx(i,{configProperty:t,...s,label:d});break}return r},Eo=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],ms=({configProperty:t,factory:e,mappedOptions:n,t:s,...o})=>{const{t:r}=m.useKosTranslation(["config-properties","common"]),{componentModeOverride:c}=l.useComponentConfigurationContext(),i=m.useConfigProperty({configProperty:t,optionsTransformer:Eo});return e=e??jo,e(t,{...i,mappedOptions:n??i.mappedOptions},s??r,o,c)},Po=j(l.Card)`
118
+ `,So=(t,e,n,s,o)=>{let r;const c=o==="compact"?wo:et,i=o==="compact"?ko:tt,l=s.label??n(t.id);switch(t.schemaType){case"boolean":r=a.jsx(je,{configProperty:t,...s,label:l});break;case"double":r=a.jsx(me,{configProperty:t,...s,label:l});break;case"int":r=a.jsx(me,{configProperty:t,...s,label:l});break;case"String":r=a.jsx(c,{configProperty:t,...s,label:l});break;case"enum":r=a.jsx(i,{configProperty:t,...s,label:l});break}return r},To=t=>(t==null?void 0:t.map(e=>({id:e.value,label:e.label})))||[],us=({configProperty:t,factory:e,mappedOptions:n,t:s,...o})=>{const{t:r}=m.useKosTranslation(["config-properties","common"]),{componentModeOverride:c}=d.useComponentConfigurationContext(),i=m.useConfigProperty({configProperty:t,optionsTransformer:To});return e=e??So,e(t,{...i,mappedOptions:n??i.mappedOptions},s??r,o,c)},Io=I(d.Card)`
119
119
  align-items: ${t=>t.mode==="compact"?"flex-start":void 0};
120
120
  flex-direction: var(
121
121
  --ddk-component-input-enable-card-container-flex-direction
122
122
  );
123
123
  padding: var(--ddk-component-input-enable-card-container-padding);
124
124
  gap: var(--ddk-component-input-enable-card-container-gap);
125
- `,No=j.div`
125
+ `,jo=I.div`
126
126
  box-sizing: border-box;
127
127
  display: flex;
128
128
  flex-direction: var(
@@ -130,27 +130,27 @@
130
130
  );
131
131
  gap: var(--ddk-component-input-enable-card-input-container-gap);
132
132
  width: 100%;
133
- `,Ao=j(ms)`
133
+ `,Eo=I(us)`
134
134
  width: 100%;
135
- `,Do=j.div`
135
+ `,Po=I.div`
136
136
  box-sizing: border-box;
137
137
  padding: ${t=>t.compact?"var(--ddk-component-input-enable-card-toggle-container-padding)":"0"};
138
138
  width: var(--ddk-component-input-enable-card-toggle-container-width);
139
- `,ps=({configProperties:t,disabled:e,enabledConfigProperty:n})=>{const{value:s}=m.useConfigProperty({configProperty:n}),o=s==="true",{componentModeOverride:r}=l.useComponentConfigurationContext(),c=t.length===1,i=c?Ao:ms;return a.jsxs(Po,{disabled:!o||e,mode:r,children:[a.jsx(No,{children:t.map(d=>a.jsx(i,{disabled:!o||e,label:d.options?d.options.label:void 0,configProperty:d.configProperty,collapse:!c&&r==="standard",layout:d.options?d.options.layout:void 0,float:!0,hideUnits:d.options?d.options.hideUnits:void 0},d.configProperty.id))}),a.jsx(Do,{compact:!c||r==="compact",children:a.jsx(je,{alwaysShowLabel:!0,collapse:!0,configProperty:n,disabled:e,stretch:r==="compact"})})]})},Oo=({configProperty:t,disabled:e,enabledConfigProperty:n,options:s})=>{const o=p.useMemo(()=>[{configProperty:t,options:s}],[t,s]);return a.jsx(ps,{configProperties:o,disabled:e,enabledConfigProperty:n})},hs=({configProperty:t,...e})=>{const{value:n}=m.useConfigProperty({configProperty:t}),s=o=>{o!==void 0&&(t==null||t.updateProperty(String(o)))};return a.jsx(l.SwitchCard,{...e,onChange:s,value:n})},fs=({description:t,float:e,label:n,modalTitle:s,onSave:o,time:r,...c})=>{const{regionModel:i}=m.useKosRegions(),{t:d}=m.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:u,formattedTime:f,hourOptions:h,minuteOptions:g,setTime:y,time:v}=m.useRegionTimeProps({initialDate:r}),C=v.getHours(),T=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:C<12?C:C-12,loop:!0},{id:"min",items:g,selectedItemId:v.getMinutes(),loop:!0},{id:"ampm",items:u,selectedItemId:C<12?"AM":"PM"}],[u,h,g,v,C]),N=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:C,loop:!0},{id:"min",items:g,selectedItemId:v.getMinutes(),loop:!0}],[h,g,v,C]);return a.jsx(l.MultiPickerCard,{...c,cancelButtonLabel:d("discard-changes","Discard Changes")||void 0,closeButtonLabel:d("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?T:N,description:t,displayValue:f,float:e,icon:xe.TimeIcon,label:n,modalTitle:s,proceedButtonLabel:d("save","Save")||void 0,onSave:O=>{const P=i!=null&&i.is12HourTimeFormat?O.ampm==="AM"?O.hr:O.hr+12:O.hr,S=O.min,_=new Date(v);_.setHours(P),_.setMinutes(S),y(_),o==null||o({hours:P,minutes:S})}})},gs=({configProperty:t,...e})=>{var f;const{getStagedChange:n,updateStagedChange:s}=Pt(),{value:o}=m.useConfigProperty({configProperty:t}),r=((f=n==null?void 0:n(t.id))==null?void 0:f.value)??o,{hours:c,minutes:i}=E.toTimeComponents(Number(r)),d=new Date;d.setHours(c),d.setMinutes(i);const u=h=>{const g=E.toSeconds(h.hours,h.minutes);s?s(t.id,{configProperty:t,value:g}):t.updateProperty(g)};return a.jsx(fs,{...e,onSave:u,time:d})},Ro=[0,6],xs=({day:t=new Date().getDate(),month:e=new Date().getMonth(),onSave:n,year:s=new Date().getFullYear(),...o})=>{var y,v,C,T,N,O;const{t:r}=m.useKosTranslation("region"),{regionModel:c}=m.useKosRegions(),i=m.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:Ro,yearsRange:[s-10,s+10]}}),d=p.useMemo(()=>{var P,S;return(S=(P=i==null?void 0:i.dateState)==null?void 0:P.yearsOptionsArray)==null?void 0:S.map(_=>({id:_.value,label:_.label}))},[(y=i==null?void 0:i.dateState)==null?void 0:y.yearsOptionsArray]),u=p.useMemo(()=>{var P,S;return(S=(P=i==null?void 0:i.dateState)==null?void 0:P.daysOptionsArray)==null?void 0:S.map(_=>({id:_.value,label:_.label}))},[(v=i==null?void 0:i.dateState)==null?void 0:v.daysOptionsArray]),f=p.useMemo(()=>{var P,S;return(S=(P=i==null?void 0:i.dateState)==null?void 0:P.monthsOptionsArray)==null?void 0:S.map(_=>({id:_.value,label:String(_.label)}))},[(C=i==null?void 0:i.dateState)==null?void 0:C.monthsOptionsArray]),h=p.useMemo(()=>{const P=[];return c==null||c.selectedDateOrder.split("").forEach(S=>{var _,$,U;S==="y"?P.push({id:"year",items:d,selectedItemId:(_=i==null?void 0:i.dateState)==null?void 0:_.year,loop:!1}):S==="m"?P.push({id:"month",items:f,selectedItemId:($=i==null?void 0:i.dateState)==null?void 0:$.month}):S==="d"&&P.push({id:"day",items:u,selectedItemId:(U=i==null?void 0:i.dateState)==null?void 0:U.day,loop:!1})}),P},[(T=i==null?void 0:i.dateState)==null?void 0:T.day,(N=i==null?void 0:i.dateState)==null?void 0:N.month,(O=i==null?void 0:i.dateState)==null?void 0:O.year,u,f,c==null?void 0:c.selectedDateOrder,d]),g=p.useCallback(async P=>{const _=new Date(P.year,P.month+1,0).getDate(),$=P.day>_?1:P.day;n({day:$,month:P.month,year:P.year})},[n]);return a.jsx(l.MultiPickerCard,{cancelButtonLabel:r("discard-changes","Discard Changes")||void 0,closeButtonLabel:r("close","Close")||void 0,data:h,displayValue:i.dateState.formattedDate,icon:xe.CalendarIcon,label:r("todays-date","Today's Date"),onSave:g,proceedButtonLabel:r("save","Save")||void 0,...o})},ys=m.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,o]=p.useState("idle"),[r,c]=p.useState(),i=p.useCallback(async()=>{o("test"),c(void 0);const u=await t.performElectricalTest();u.error?(c(u.error),o("failure")):u.result==="errEEPROM"?(c("errEEPROM"),o("failure")):o("success")},[t]),d=p.useMemo(()=>({idle:{information:a.jsx(l.LabelInformation,{children:n("perform-electrical-test")}),footer:a.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")})},test:{information:a.jsx(l.LabelInformation,{children:n("testing")}),footer:a.jsx(l.Button,{disabled:!0,children:n("electrical-test")}),status:"loading"},success:{information:a.jsx(l.LabelInformation,{children:n("electrical-test-success-header")}),footer:a.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"success"},failure:{information:a.jsxs(a.Fragment,{children:[a.jsx(l.LabelInformation,{children:n("electrical-test-failure-header")}),a.jsx(l.BodyMediumInformation,{children:n(`error.${r}`)})]}),footer:a.jsx(l.Button,{onPointerDown:i,children:n("electrical-test")}),status:"information"}}),[r,n,i]);return a.jsx(l.WorkflowModal,{title:n(t.name),...d[s],onClose:()=>e()})}),Ct={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Lo=t=>{const[e,n]=p.useState(null),[s,o]=p.useState(Ct),r=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(Ct))},[...r,t]),[e,s]},Fo=t=>{switch(t){case"calibrate":return Hn;case"fixed-45":return Wn;case"flush":return Xn;case"high-flow-test":return qn;case"hold-to-pour":return Gn;case"low-flow-test":return Yn;case"manual-override":return Jn;case"msv-reset":return Qn;case"prime":return es;case"purge":return ts;default:return}},Mo=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`)}),De=(t,e=Fo)=>{const{t:n}=m.useKosTranslation("troubles"),[s,o]=p.useState(null),[r,c]=p.useState(Ct),i=p.useCallback(async d=>{const u=e(d);if(u){const f=Mo(n)(d);c(f);const h=new u(t);await h.performAction(),o(h)}},[e,t,n]);return[s,i,r]},Bo=t=>(m.KosLog.debug(`pumpActionFactory: actionId=${t}`),ss),Vo=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`)}),$o=(t,e,n=Bo)=>{const{t:s}=m.useKosTranslation("troubles"),[o,r]=p.useState(null),[c]=p.useState(Vo(s)(e)),i=p.useCallback(async()=>{const d=n(e);if(d){const u=new d(t,e);await u.performAction(),r(u)}},[n,t,e]);return[o,i,c]};function Ko(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Et();return a.jsx(o,{...s,children:a.jsx(t,{...e,agitationControl:n})})}}const Nt=()=>{const t=E.Animation.type;return m.useKosModel({modelId:t,modelType:E.Animation.type,options:{}})};function vs(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Nt();return a.jsx(o,{...s,children:a.jsx(t,{...e,animation:n})})}}const Oe=()=>{const t=E.Application.type;return m.useKosModel({modelId:t,modelType:E.Application.type,options:{}})};function Uo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Oe();return a.jsx(o,{...s,children:a.jsx(t,{...e,application:n})})}}const bs=()=>{const t=E.CarbWater.type;return m.useKosModel({modelId:t,modelType:E.CarbWater.type,options:{}})};function Zo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=bs();return a.jsx(o,{...s,children:a.jsx(t,{...e,carbWater:n})})}}const Cs=()=>{const t=E.CopyLogs.type;return m.useKosModel({modelId:t,modelType:E.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function zo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Cs();return a.jsx(o,{...s,children:a.jsx(t,{...e,copyLogs:n})})}}const At=()=>{const t=E.DashboardOperations.type;return m.useKosModel({modelId:t,modelType:E.DashboardOperations.type,options:{}})};function Ho(t){return e=>{const{model:n,status:s,KosModelLoader:o}=At();return a.jsx(o,{...s,children:a.jsx(t,{...e,dashboardOperations:n})})}}const Dt=()=>{const t=E.DispenserInfo.type;return m.useKosModel({modelId:t,modelType:E.DispenserInfo.type,options:{}})};function _s(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Dt();return a.jsx(o,{...s,children:a.jsx(t,{...e,dispenserInfo:n})})}}const ws=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.Door.type,options:{}})};function Wo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=ws(e.id);return a.jsx(o,{...s,children:a.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 r={};for(const c of o)r[c]=c;return r},t.getValidEnumValues=o=>{const r=t.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),c={};for(const i of r)c[i]=o[i];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(r){return o[r]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const r=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&r.push(c);return r},t.find=(o,r)=>{for(const c of o)if(r(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,r=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(r)}t.joinValues=s,t.jsonStringifyReplacer=(o,r)=>typeof r=="bigint"?r.toString():r})(F||(F={}));var gn;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(gn||(gn={}));const w=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G=t=>{switch(typeof t){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(t)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(t)?w.array:t===null?w.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?w.promise:typeof Map<"u"&&t instanceof Map?w.map:typeof Set<"u"&&t instanceof Set?w.set:typeof Date<"u"&&t instanceof Date?w.date:w.object;default:return w.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 X 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(r){return r.message},s={_errors:[]},o=r=>{for(const c of r.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 u=c.path[d];d===c.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(n(c))):i[u]=i[u]||{_errors:[]},i=i[u],d++}}};return o(this),s}static assert(e){if(!(e instanceof X))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 r=o.path[0];n[r]=n[r]||[],n[r].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}X.create=t=>new X(t);const _t=(t,e)=>{let n;switch(t.code){case x.invalid_type:t.received===w.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 Xo=_t;function qo(){return Xo}const Go=t=>{const{data:e,path:n,errorMaps:s,issueData:o}=t,r=[...n,...o.path||[]],c={...o,path:r};if(o.message!==void 0)return{...o,path:r,message:o.message};let i="";const d=s.filter(u=>!!u).slice().reverse();for(const u of d)i=u(c,{data:e,defaultError:i}).message;return{...o,path:r,message:i}};function b(t,e){const n=qo(),s=Go({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===_t?void 0:_t].filter(o=>!!o)});t.common.issues.push(s)}class K{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 r=await o.key,c=await o.value;s.push({key:r,value:c})}return K.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const o of n){const{key:r,value:c}=o;if(r.status==="aborted"||c.status==="aborted")return A;r.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(s[r.value]=c.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),Se=t=>({status:"dirty",value:t}),Z=t=>({status:"valid",value:t}),xn=t=>t.status==="aborted",yn=t=>t.status==="dirty",pe=t=>t.status==="valid",We=t=>typeof Promise<"u"&&t instanceof Promise;var k;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(k||(k={}));class ee{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 vn=(t,e)=>{if(pe(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 X(t.common.issues);return this._error=n,this._error}}};function R(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 L{get description(){return this._def.description}_getType(e){return G(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new K,ctx:{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(We(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:G(e)},o=this._parseSync({data:e,path:s.path,parent:s});return vn(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:G(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return pe(r)?{value:r.value}:{issues:n.common.issues}}catch(r){(o=(s=r==null?void 0:r.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(r=>pe(r)?{value:r.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:G(e)},o=this._parse({data:e,path:s.path,parent:s}),r=await(We(o)?o:Promise.resolve(o));return vn(s,r)}refine(e,n){const s=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,r)=>{const c=e(o),i=()=>r.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 fe({schema:this,typeName:D.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 Q.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return Ye.create(this,this._def)}or(e){return qe.create([this,e],this._def)}and(e){return Ge.create(this,e,this._def)}transform(e){return new fe({...R(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new St({...R(this._def),innerType:this,defaultValue:n,typeName:D.ZodDefault})}brand(){return new vr({typeName:D.ZodBranded,type:this,...R(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Tt({...R(this._def),innerType:this,catchValue:n,typeName:D.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ot.create(this,e)}readonly(){return It.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Yo=/^c[^\s-]{8,}$/i,Jo=/^[0-9a-z]+$/,Qo=/^[0-9A-HJKMNP-TV-Z]{26}$/i,er=/^[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,tr=/^[a-z0-9_-]{21}$/i,nr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sr=/^[-+]?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)?)??$/,or=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let vt;const ar=/^(?:(?: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])$/,ir=/^(?:(?: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])$/,cr=/^(([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]))$/,lr=/^(([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])$/,dr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ur=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ks="((\\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])))",mr=new RegExp(`^${ks}$`);function Ss(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 pr(t){return new RegExp(`^${Ss(t)}$`)}function hr(t){let e=`${ks}T${Ss(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 fr(t,e){return!!((e==="v4"||!e)&&ar.test(t)||(e==="v6"||!e)&&cr.test(t))}function gr(t,e){if(!nr.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 xr(t,e){return!!((e==="v4"||!e)&&ir.test(t)||(e==="v6"||!e)&&lr.test(t))}class Y extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_type,expected:w.string,received:r.parsedType}),A}const s=new K;let o;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),s.dirty());else if(r.kind==="max")e.data.length>r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),s.dirty());else if(r.kind==="length"){const c=e.data.length>r.value,i=e.data.length<r.value;(c||i)&&(o=this._getOrReturnCtx(e,o),c?b(o,{code:x.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&b(o,{code:x.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),s.dirty())}else if(r.kind==="email")or.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"email",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="emoji")vt||(vt=new RegExp(rr,"u")),vt.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"emoji",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="uuid")er.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"uuid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="nanoid")tr.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"nanoid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="cuid")Yo.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cuid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="cuid2")Jo.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cuid2",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="ulid")Qo.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"ulid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),b(o,{validation:"url",code:x.invalid_string,message:r.message}),s.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"regex",code:x.invalid_string,message:r.message}),s.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),s.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:{startsWith:r.value},message:r.message}),s.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:{endsWith:r.value},message:r.message}),s.dirty()):r.kind==="datetime"?hr(r).test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:"datetime",message:r.message}),s.dirty()):r.kind==="date"?mr.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:"date",message:r.message}),s.dirty()):r.kind==="time"?pr(r).test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:"time",message:r.message}),s.dirty()):r.kind==="duration"?sr.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"duration",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="ip"?fr(e.data,r.version)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"ip",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="jwt"?gr(e.data,r.alg)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"jwt",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="cidr"?xr(e.data,r.version)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cidr",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="base64"?dr.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"base64",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="base64url"?ur.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"base64url",code:x.invalid_string,message:r.message}),s.dirty()):F.assertNever(r);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(o=>e.test(o),{validation:n,code:x.invalid_string,...k.errToObj(s)})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.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,...k.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,...k.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...k.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...k.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...k.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...k.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...k.errToObj(n)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new Y({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Y({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Y({...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}}Y.create=t=>new Y({checks:[],typeName:D.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});function yr(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=n>s?n:s,r=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return r%c/10**o}class Ee extends L{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)!==w.number){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_type,expected:w.number,received:r.parsedType}),A}let s;const o=new K;for(const r of this._def.checks)r.kind==="int"?F.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{code:x.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()):r.kind==="multipleOf"?yr(e.data,r.value)!==0&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{code:x.not_finite,message:r.message}),o.dirty()):F.assertNever(r);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,k.toString(n))}gt(e,n){return this.setLimit("min",e,!1,k.toString(n))}lte(e,n){return this.setLimit("max",e,!0,k.toString(n))}lt(e,n){return this.setLimit("max",e,!1,k.toString(n))}setLimit(e,n,s,o){return new Ee({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:k.toString(o)}]})}_addCheck(e){return new Ee({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.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)}}Ee.create=t=>new Ee({checks:[],typeName:D.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class Pe extends L{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)!==w.bigint)return this._getInvalidInput(e);let s;const o=new K;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):F.assertNever(r);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return b(n,{code:x.invalid_type,expected:w.bigint,received:n.parsedType}),A}gte(e,n){return this.setLimit("min",e,!0,k.toString(n))}gt(e,n){return this.setLimit("min",e,!1,k.toString(n))}lte(e,n){return this.setLimit("max",e,!0,k.toString(n))}lt(e,n){return this.setLimit("max",e,!1,k.toString(n))}setLimit(e,n,s,o){return new Pe({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:k.toString(o)}]})}_addCheck(e){return new Pe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:k.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}}Pe.create=t=>new Pe({checks:[],typeName:D.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});class bn extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.boolean,received:s.parsedType}),A}return Z(e.data)}}bn.create=t=>new bn({typeName:D.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class Xe extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_type,expected:w.date,received:r.parsedType}),A}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_date}),A}const s=new K;let o;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),s.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),s.dirty()):F.assertNever(r);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xe({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:k.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}}Xe.create=t=>new Xe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:D.ZodDate,...R(t)});class Cn extends L{_parse(e){if(this._getType(e)!==w.symbol){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.symbol,received:s.parsedType}),A}return Z(e.data)}}Cn.create=t=>new Cn({typeName:D.ZodSymbol,...R(t)});class _n extends L{_parse(e){if(this._getType(e)!==w.undefined){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.undefined,received:s.parsedType}),A}return Z(e.data)}}_n.create=t=>new _n({typeName:D.ZodUndefined,...R(t)});class wn extends L{_parse(e){if(this._getType(e)!==w.null){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.null,received:s.parsedType}),A}return Z(e.data)}}wn.create=t=>new wn({typeName:D.ZodNull,...R(t)});class kn extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}kn.create=t=>new kn({typeName:D.ZodAny,...R(t)});class Sn extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}Sn.create=t=>new Sn({typeName:D.ZodUnknown,...R(t)});class te extends L{_parse(e){const n=this._getOrReturnCtx(e);return b(n,{code:x.invalid_type,expected:w.never,received:n.parsedType}),A}}te.create=t=>new te({typeName:D.ZodNever,...R(t)});class Tn extends L{_parse(e){if(this._getType(e)!==w.undefined){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.void,received:s.parsedType}),A}return Z(e.data)}}Tn.create=t=>new Tn({typeName:D.ZodVoid,...R(t)});class W extends L{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),o=this._def;if(n.parsedType!==w.array)return b(n,{code:x.invalid_type,expected:w.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)&&(b(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&&(b(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&&(b(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 ee(n,c,n.path,i)))).then(c=>K.mergeArray(s,c));const r=[...n.data].map((c,i)=>o.type._parseSync(new ee(n,c,n.path,i)));return K.mergeArray(s,r)}get element(){return this._def.type}min(e,n){return new W({...this._def,minLength:{value:e,message:k.toString(n)}})}max(e,n){return new W({...this._def,maxLength:{value:e,message:k.toString(n)}})}length(e,n){return new W({...this._def,exactLength:{value:e,message:k.toString(n)}})}nonempty(e){return this.min(1,e)}}W.create=(t,e)=>new W({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...R(e)});function ue(t){if(t instanceof B){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=Q.create(ue(s))}return new B({...t._def,shape:()=>e})}else return t instanceof W?new W({...t._def,type:ue(t.element)}):t instanceof Q?Q.create(ue(t.unwrap())):t instanceof ge?ge.create(ue(t.unwrap())):t instanceof re?re.create(t.items.map(e=>ue(e))):t}class B extends L{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)!==w.object){const u=this._getOrReturnCtx(e);return b(u,{code:x.invalid_type,expected:w.object,received:u.parsedType}),A}const{status:s,ctx:o}=this._processInputParams(e),{shape:r,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof te&&this._def.unknownKeys==="strip"))for(const u in o.data)c.includes(u)||i.push(u);const d=[];for(const u of c){const f=r[u],h=o.data[u];d.push({key:{status:"valid",value:u},value:f._parse(new ee(o,h,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof te){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of i)d.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(u==="strict")i.length>0&&(b(o,{code:x.unrecognized_keys,keys:i}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of i){const h=o.data[f];d.push({key:{status:"valid",value:f},value:u._parse(new ee(o,h,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of d){const h=await f.key,g=await f.value;u.push({key:h,value:g,alwaysSet:f.alwaysSet})}return u}).then(u=>K.mergeObjectSync(s,u)):K.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new B({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var r,c;const o=((c=(r=this._def).errorMap)==null?void 0:c.call(r,n,s).message)??s.defaultError;return n.code==="unrecognized_keys"?{message:k.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:D.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 ue(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 r=this.shape[s];for(;r instanceof Q;)r=r._def.innerType;n[s]=r}return new B({...this._def,shape:()=>n})}keyof(){return Ts(F.objectKeys(this.shape))}}B.create=(t,e)=>new B({shape:()=>t,unknownKeys:"strip",catchall:te.create(),typeName:D.ZodObject,...R(e)});B.strictCreate=(t,e)=>new B({shape:()=>t,unknownKeys:"strict",catchall:te.create(),typeName:D.ZodObject,...R(e)});B.lazycreate=(t,e)=>new B({shape:t,unknownKeys:"strip",catchall:te.create(),typeName:D.ZodObject,...R(e)});class qe extends L{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function o(r){for(const i of r)if(i.result.status==="valid")return i.result;for(const i of r)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;const c=r.map(i=>new X(i.ctx.common.issues));return b(n,{code:x.invalid_union,unionErrors:c}),A}if(n.common.async)return Promise.all(s.map(async r=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await r._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let r;const c=[];for(const d of s){const u={...n,common:{...n.common,issues:[]},parent:null},f=d._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!r&&(r={result:f,ctx:u}),u.common.issues.length&&c.push(u.common.issues)}if(r)return n.common.issues.push(...r.ctx.common.issues),r.result;const i=c.map(d=>new X(d));return b(n,{code:x.invalid_union,unionErrors:i}),A}}get options(){return this._def.options}}qe.create=(t,e)=>new qe({options:t,typeName:D.ZodUnion,...R(e)});function wt(t,e){const n=G(t),s=G(e);if(t===e)return{valid:!0,data:t};if(n===w.object&&s===w.object){const o=F.objectKeys(e),r=F.objectKeys(t).filter(i=>o.indexOf(i)!==-1),c={...t,...e};for(const i of r){const d=wt(t[i],e[i]);if(!d.valid)return{valid:!1};c[i]=d.data}return{valid:!0,data:c}}else if(n===w.array&&s===w.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let r=0;r<t.length;r++){const c=t[r],i=e[r],d=wt(c,i);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===w.date&&s===w.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ge extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=(r,c)=>{if(xn(r)||xn(c))return A;const i=wt(r.value,c.value);return i.valid?((yn(r)||yn(c))&&n.dirty(),{status:n.value,value:i.data}):(b(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(([r,c])=>o(r,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}))}}Ge.create=(t,e,n)=>new Ge({left:t,right:e,typeName:D.ZodIntersection,...R(n)});class re extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==w.array)return b(s,{code:x.invalid_type,expected:w.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return b(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&&(b(s,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const r=[...s.data].map((c,i)=>{const d=this._def.items[i]||this._def.rest;return d?d._parse(new ee(s,c,s.path,i)):null}).filter(c=>!!c);return s.common.async?Promise.all(r).then(c=>K.mergeArray(n,c)):K.mergeArray(n,r)}get items(){return this._def.items}rest(e){return new re({...this._def,rest:e})}}re.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new re({items:t,typeName:D.ZodTuple,rest:null,...R(e)})};class In extends L{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!==w.map)return b(s,{code:x.invalid_type,expected:w.map,received:s.parsedType}),A;const o=this._def.keyType,r=this._def.valueType,c=[...s.data.entries()].map(([i,d],u)=>({key:o._parse(new ee(s,i,s.path,[u,"key"])),value:r._parse(new ee(s,d,s.path,[u,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const d of c){const u=await d.key,f=await d.value;if(u.status==="aborted"||f.status==="aborted")return A;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(u.value,f.value)}return{status:n.value,value:i}})}else{const i=new Map;for(const d of c){const u=d.key,f=d.value;if(u.status==="aborted"||f.status==="aborted")return A;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(u.value,f.value)}return{status:n.value,value:i}}}}In.create=(t,e,n)=>new In({valueType:e,keyType:t,typeName:D.ZodMap,...R(n)});class Ne extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==w.set)return b(s,{code:x.invalid_type,expected:w.set,received:s.parsedType}),A;const o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(b(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&&(b(s,{code:x.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const r=this._def.valueType;function c(d){const u=new Set;for(const f of d){if(f.status==="aborted")return A;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}const i=[...s.data.values()].map((d,u)=>r._parse(new ee(s,d,s.path,u)));return s.common.async?Promise.all(i).then(d=>c(d)):c(i)}min(e,n){return new Ne({...this._def,minSize:{value:e,message:k.toString(n)}})}max(e,n){return new Ne({...this._def,maxSize:{value:e,message:k.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Ne.create=(t,e)=>new Ne({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...R(e)});class jn extends L{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})}}jn.create=(t,e)=>new jn({getter:t,typeName:D.ZodLazy,...R(e)});class kt extends L{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return b(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}}kt.create=(t,e)=>new kt({value:t,typeName:D.ZodLiteral,...R(e)});function Ts(t,e){return new he({values:t,typeName:D.ZodEnum,...R(e)})}class he extends L{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return b(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 b(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 he.create(e,{...this._def,...n})}exclude(e,n=this._def){return he.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}he.create=Ts;class En extends L{_parse(e){const n=F.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==w.string&&s.parsedType!==w.number){const o=F.objectValues(n);return b(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 b(s,{received:s.data,code:x.invalid_enum_value,options:o}),A}return Z(e.data)}get enum(){return this._def.values}}En.create=(t,e)=>new En({values:t,typeName:D.ZodNativeEnum,...R(e)});class Ye extends L{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==w.promise&&n.common.async===!1)return b(n,{code:x.invalid_type,expected:w.promise,received:n.parsedType}),A;const s=n.parsedType===w.promise?n.data:Promise.resolve(n.data);return Z(s.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ye.create=(t,e)=>new Ye({type:t,typeName:D.ZodPromise,...R(e)});class fe extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:c=>{b(s,c),c.fatal?n.abort():n.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){const c=o.transform(s.data,r);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"?Se(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"?Se(i.value):i}}if(o.type==="refinement"){const c=i=>{const d=o.refinement(i,r);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(!pe(c))return A;const i=o.transform(c.value,r);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=>pe(c)?Promise.resolve(o.transform(c.value,r)).then(i=>({status:n.value,value:i})):A);F.assertNever(o)}}fe.create=(t,e,n)=>new fe({schema:t,typeName:D.ZodEffects,effect:e,...R(n)});fe.createWithPreprocess=(t,e,n)=>new fe({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...R(n)});class Q extends L{_parse(e){return this._getType(e)===w.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Q.create=(t,e)=>new Q({innerType:t,typeName:D.ZodOptional,...R(e)});class ge extends L{_parse(e){return this._getType(e)===w.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ge.create=(t,e)=>new ge({innerType:t,typeName:D.ZodNullable,...R(e)});class St extends L{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===w.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}St.create=(t,e)=>new St({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class Tt extends L{_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 We(o)?o.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new X(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new X(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Tt.create=(t,e)=>new Tt({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class Pn extends L{_parse(e){if(this._getType(e)!==w.nan){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.nan,received:s.parsedType}),A}return{status:"valid",value:e.data}}}Pn.create=t=>new Pn({typeName:D.ZodNaN,...R(t)});class vr extends L{_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 Ot extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?A:r.status==="dirty"?(n.dirty(),Se(r.value)):this._def.out._parseAsync({data:r.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 Ot({in:e,out:n,typeName:D.ZodPipeline})}}class It extends L{_parse(e){const n=this._def.innerType._parse(e),s=o=>(pe(o)&&(o.value=Object.freeze(o.value)),o);return We(n)?n.then(o=>s(o)):s(n)}unwrap(){return this._def.innerType}}It.create=(t,e)=>new It({innerType:t,typeName:D.ZodReadonly,...R(e)});var D;(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"})(D||(D={}));const z=Y.create;te.create;W.create;qe.create;Ge.create;re.create;const nt=kt.create,br=he.create;Ye.create;Q.create;ge.create;const Nn=I.createExtensionSchema({utilDescriptor:z().min(1,"Utility descriptor is required").describe("Descriptor used to identify and categorize the utility")},{rankable:!0}),Is=I.extensionPointId("ddk","ncui","utilities"),js=I.defineExtensionPoint({id:Is,contributionKey:"utilities",displayName:"Utilities",description:"Extension point for utility plugin configurations with view support",hasView:!0,isRankable:!0,schema:Nn,metadata:{exportName:"UtilitiesExtension",category:"Utilities",tags:["utilities","tools","helpers"]},validate:(t,e)=>{I.validateWithSchema(Nn,t,e)&&(I.validateDescriptorFormat("Utility descriptor",t.utilDescriptor,e),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Cr=Is,An=I.createExtensionSchema({type:nt("dashboard.summary").describe("Extension type, must be 'dashboard.summary'"),dashboardKey:z().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this summary belongs to")},{rankable:!0}),st=I.extensionPointId("ddk","dashboard","summary"),_r=I.defineExtensionPoint({id:st,contributionKey:"dashboardSummary",displayName:"Dashboard Summary",description:"Extension point for dashboard summary plugin configurations with view support",hasView:!0,isRankable:!0,schema:An,metadata:{exportName:"DashboardSummaryExtension",category:"Dashboard",tags:["dashboard","summary","visualization"]},validate:(t,e)=>{I.validateWithSchema(An,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),wr=st,kr=`${st}.def`,Sr=`${st}.view`,Dn=I.createExtensionSchema({type:nt("dashboard.detail").describe("Extension type, must be 'dashboard.detail'"),dashboardKey:z().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this detail belongs to")},{rankable:!0}),ot=I.extensionPointId("ddk","dashboard","detail"),Tr=I.defineExtensionPoint({id:ot,contributionKey:"dashboardDetail",displayName:"Dashboard Detail",description:"Extension point for dashboard detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Dn,metadata:{exportName:"DashboardDetailExtension",category:"Dashboard",tags:["dashboard","detail","visualization"]},validate:(t,e)=>{I.validateWithSchema(Dn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Ir=ot,jr=`${ot}.def`,Er=`${ot}.view`,On=I.createExtensionSchema({type:nt("dashboard.detail.pump").describe("Extension type, must be 'dashboard.detail.pump'"),dashboardKey:z().min(1,"Dashboard key is required").describe("Key used to match this extension with specific dashboard pumps")},{rankable:!0}),rt=I.extensionPointId("ddk","dashboard","pump-detail"),Ae=I.defineExtensionPoint({id:rt,contributionKey:"dashboardPumpDetail",displayName:"Dashboard Pump Detail",description:"Extension point for dashboard pump detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:On,metadata:{exportName:"DashboardPumpDetailExtension"},validate:(t,e)=>{I.validateWithSchema(On,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Pr=rt,Nr=`${rt}.def`,Ar=`${rt}.view`,Rn=I.createExtensionSchema({cuiDescriptor:z().min(1,"CUI descriptor is required").describe("Descriptor used to identify and categorize the CUI functionality"),modalMode:br(["fullscreen","maximized"]).optional().describe("Modal display mode for the CUI interface")}),at=I.extensionPointId("ddk","cui"),Es=I.defineExtensionPoint({id:at,contributionKey:"cui",displayName:"CUI (Consumer User Interface)",description:"Extension point for CUI plugin configurations with view support",hasView:!0,isRankable:!1,schema:Rn,metadata:{exportName:"CuiExtension",category:"Interface",tags:["cui","user-interface","consumer"]},validate:(t,e)=>{I.validateWithSchema(Rn,t,e)&&I.validateDescriptorFormat("CUI descriptor",t.cuiDescriptor,e)},transform:I.createViewAwareTransform()}),Dr=at,Or=`${at}.def`,Rr=`${at}.view`,Ln=I.createExtensionSchema({navDescriptor:z().min(1,"Navigation descriptor is required").describe("Descriptor used to identify and map the navigation functionality")}),it=I.extensionPointId("ddk","nav","view"),Lr=I.defineExtensionPoint({id:it,contributionKey:"navViews",displayName:"Navigation Views",description:"Extension point for navigation view plugin configurations with view support",hasView:!0,isRankable:!1,schema:Ln,metadata:{exportName:"NavViewExtension",category:"Navigation",tags:["navigation","nav","views","routing"]},validate:(t,e)=>{I.validateWithSchema(Ln,t,e)&&I.validateDescriptorFormat("Navigation descriptor",t.navDescriptor,e)},transform:I.createViewAwareTransform()}),Fr=it,Mr=`${it}.def`,Br=`${it}.view`,Fn=I.createExtensionSchema({setupDescriptor:z().min(1,"Setup descriptor is required").describe("Descriptor used to identify and categorize the setup step")},{rankable:!0}),ct=I.extensionPointId("ddk","setup"),Rt=I.defineExtensionPoint({id:ct,contributionKey:"setupStep",displayName:"Setup Steps",description:"Extension point for setup step plugin configurations with view support",hasView:!0,isRankable:!0,schema:Fn,metadata:{exportName:"SetupExtension",category:"Setup",tags:["setup","configuration","steps","wizard"]},validate:(t,e)=>{I.validateWithSchema(Fn,t,e)&&(I.validateDescriptorFormat("Setup descriptor",t.setupDescriptor,e),I.validateRankIfPresent(t,e))},transform:I.createViewAwareTransform()}),Vr=ct,$r=`${ct}.def`,Kr=`${ct}.view`,Mn=I.createExtensionSchema({type:nt("trouble.action").describe("Extension type, must be 'trouble.action'"),troubleType:z().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:z().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:z().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}),lt=I.extensionPointId("ddk","trouble","action"),Je=I.defineExtensionPoint({id:lt,contributionKey:"troubleActions",displayName:"Trouble Actions",description:"Extension point for trouble action plugin configurations with view support",hasView:!0,isRankable:!0,schema:Mn,metadata:{exportName:"TroubleActionExtension",category:"Trouble Management",tags:["trouble","action","state","error-handling"]},validate:(t,e)=>{I.validateWithSchema(Mn,t,e)&&I.validateRankIfPresent(t,e)},transform:I.createViewAwareTransform()}),Ur=lt,Zr=`${lt}.def`,zr=`${lt}.view`,Bn=I.createExtensionSchema({viewKey:z().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}),dt=I.extensionPointId("ddk","view"),Hr=I.defineExtensionPoint({id:dt,contributionKey:"views",displayName:"Views",description:"Extension point for view plugin configurations with regional rendering support",hasView:!0,isRankable:!0,schema:Bn,metadata:{exportName:"ViewExtension",category:"UI Layout",tags:["views","ui","rendering","layout","regions"]},validate:(t,e)=>{I.validateWithSchema(Bn,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()}),Wr=dt,Xr=`${dt}.def`,qr=`${dt}.view`,Vn={[Rt.id]:"setupDescriptor",[Es.id]:"cuiDescriptor",[js.id]:"utilDescriptor"},Ps=({defaultNamespace:t,extensionPoint:e})=>{const{getExtensions:n}=oe.useKosPluginsContext(),s=n(e),o=s.map(d=>d.data.namespace)||[],{t:r}=m.useKosTranslation([t,...new Set(o)]),c=s.reduce((d,u)=>{const f=u;return d[f.data[Vn[e]]]={extension:e,module:f.id,namespace:f.data.namespace,title:f.data.title},d},{}),i=s.reduce((d,u)=>{const f=u;return d[f.data[Vn[e]]]=`${f.data.namespace}:${f.data.title}`,d},{});return{namespaces:o,t:r,labelMap:i,contributionMap:c}},Re=(t,e)=>{const n=p.useMemo(()=>({agitate:os,calibrate:({holder:c,pump:i,onComplete:d})=>{const u=m.getKosCompanionModel(i??c.pumps.data[0],E.FcmPump.type);return a.jsx(cs,{pump:u,onComplete:d})},calibrateSPM:({holder:c,pump:i,onComplete:d})=>{const u=m.getKosCompanionModel(i??c.pumps.data[0],E.SpmPump.type);return a.jsx(eo,{pump:u,onComplete:d})},diagnostics:({holder:c,pump:i,onComplete:d})=>{const u=m.getKosCompanionModel(i??c.pumps.data[0],E.FcmPump.type);return a.jsx(ys,{pump:u,onComplete:d})},"replace-pump":({holder:c,pump:i,onComplete:d})=>a.jsx(qs,{pump:i??c.pumps.data[0],onComplete:d}),"rfid-override":Gs,"replace-line":({holder:c,onComplete:i})=>a.jsx(Xs,{holder:c,onComplete:i})}),[]),[s,o]=p.useState(void 0),r=s?n[s]:void 0;return{holderExperience:r?a.jsx(r,{holder:t,pump:e,onComplete:()=>{o(void 0)}}):void 0,setHolderExperience:o,currentExperienceId:s}},Lt=p.createContext(void 0),Gr=({children:t,value:e})=>a.jsx(Lt.Provider,{value:e,children:t}),Yr=t=>({HolderContent:void 0}),Ft=(t,e=Yr)=>{const n=p.useContext(Lt);return e=(n==null?void 0:n.actionFactory)||e,e(t)},Mt=()=>{const t=E.IngredientSummary.type;return m.useKosModel({modelId:t,modelType:E.IngredientSummary.type,options:{}})};function Jr(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=Mt();return a.jsx(o,{...s,children:a.jsx(t,{...e,ingredientSummary:n})})}}const Bt=()=>{const t=E.MacroAssignment.type;return m.useKosModel({modelId:t,modelType:E.MacroAssignment.type,options:{}})};function Ns(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Bt();return a.jsx(o,{...s,children:a.jsx(t,{...e,macroAssignment:n})})}}const Vt=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.NetworkTest.type,options:{}})};function Qr(t){return e=>n=>{const{model:s,status:o,KosModelLoader:r}=Vt(e);return a.jsx(r,{...o,children:a.jsx(t,{...n,networkTest:s})})}}const $t=()=>{const t=E.NetworkTestContainer.type;return m.useKosModel({modelId:t,modelType:E.NetworkTestContainer.type,options:{}})};function As(t){return e=>{const{model:n,status:s,KosModelLoader:o}=$t();return a.jsx(o,{...s,children:a.jsx(t,{...e,networkTestContainer:n})})}}const Ds=()=>{const t=E.NutritiveSweetener.type;return m.useKosModel({modelId:t,modelType:E.NutritiveSweetener.type,options:{}})};function ea(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ds();return a.jsx(o,{...s,children:a.jsx(t,{...e,nutritiveSweetener:n})})}}const Os=()=>{const t=E.PlainWater.type;return m.useKosModel({modelId:t,modelType:E.PlainWater.type,options:{},destroyOnUnmount:!0})};function ta(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Os();return a.jsx(o,{...s,children:a.jsx(t,{...e,plainWater:n})})}}const na=t=>{switch(t.type){case"fcm":return E.FcmPump.type;case"lfcv":return E.LfcvPump.type;case"micro":return E.SpmPump.type;default:return}},J="pluginVisibility",He=new Map;m.registerExtensionPoint(J,{register:(t,e)=>{var n;He.has(t)||He.set(t,[]),(n=He.get(t))==null||n.push(e)},execute:(t,e,n)=>{const s=He.get(t);if(!s)return!0;const o=s.map(r=>r(e,n));return o.length===0?!0:!o.includes(!1)}});class Rs{constructor(e,n){M(this,"core");M(this,"dispense");this.core=e,this.dispense=n}registerDashboardVisibilityFilter(e){return m.ExtensionManager[J].register(J,e),this}registerNavVisibilityFilter(e){return m.ExtensionManager[J].register(J,e),this}}class sa{constructor(){M(this,"dispense");M(this,"core");M(this,"plugin");this.dispense=new jt.DispenseExtensionManager,this.core=new m.CoreExtensionManager,this.plugin=new Rs(this.core,this.dispense)}}const Le=t=>t?Ls(t.type):{action:"",label:"",progress:"",summary:""},Ls=t=>{const e=`troubles:troubles.${t}`;return{action:`${e}.action`,label:`${e}.label`,progress:`${e}.progress`,summary:`${e}.summary`}},Fe=t=>{const{getExtensions:e}=oe.useKosPluginsContext();return{getExtensions:p.useCallback(s=>e(s).filter(c=>{const i=c.id;return m.ExtensionManager[J].execute(J,i,t)}),[e,t])}},ut=()=>{const t=E.Reboot.type;return m.useKosModel({modelId:t,modelType:E.Reboot.type,options:{}})};function oa(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=ut();return a.jsx(o,{...s,children:a.jsx(t,{...e,reboot:n})})}}const mt=()=>{const t=E.Settings.type;return m.useKosModel({modelId:t,modelType:E.Settings.type,options:{}})};function Kt(t){return e=>{const{model:n,status:s,KosModelLoader:o}=mt();return a.jsx(o,{...s,children:a.jsx(t,{...e,settings:n})})}}const Ut=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.SetupStep.type,options:{}})};function ra(t){return e=>n=>{const{model:s,status:o,KosModelLoader:r}=Ut(e);return a.jsx(r,{...o,children:a.jsx(t,{...n,setupStep:s})})}}const Zt=()=>{const t=E.SetupStepContainer.type;return m.useKosModel({modelId:t,modelType:E.SetupStepContainer.type,options:{}})};function Fs(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Zt();return a.jsx(o,{...s,children:a.jsx(t,{...e,setupStepContainer:n})})}}const Ms=()=>{const t=E.Start.type;return m.useKosModel({modelId:t,modelType:E.Start.type,options:{}})};function aa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ms();return a.jsx(o,{...s,children:a.jsx(t,{...e,start:n})})}}const zt=()=>{const t=E.TroubleActionManager.type,{getExtensions:e}=Fe(),n=e(Je.id).map(o=>o.data);return m.useKosModel({modelId:t,modelType:E.TroubleActionManager.type,options:{definitions:n}})};function ia(t){return e=>{const{model:n,status:s,KosModelLoader:o}=zt();return a.jsx(o,{...s,children:a.jsx(t,{...e,troubleAction:n})})}}const pt=t=>{const[e,n]=p.useState({});return p.useEffect(()=>{async function s(){if(t){const o=await m.troubleDataFactory(t);n(o)}}s()},[t]),e},ca=t=>!t||t==="white",la=t=>t?void 0:"white",Bs=t=>{if(!m.isTroubleAware(t))return{};const e=t,{visibleTroubles:n,initialized:s}=ve(e),o=(n==null?void 0:n.length)??0,r=n==null?void 0:n[0],c=o>0,i=c?`${r==null?void 0:r.color}`:void 0,d=ca(i),u=c?la(d):void 0;return{backgroundColor:i,fontColor:u,highestTrouble:r,initialized:s,troubleCount:o,hasTroubles:c}},da=({troubleType:t,condition:e})=>{const{model:n}=m.useTroubleContainerModel(),[s,o]=p.useState(!1),[r,c]=p.useState([]);return p.useEffect(()=>m.kosAutoEffect(()=>{const d=(t?n==null?void 0:n.troubles.getIndexByKey("byType",t):n==null?void 0:n.troubles.data)||[],u=e?d.filter(e):d;o(u.length>0),c(u)}),[e,n,t]),[s,r.length>0?r[0]:void 0,r]},Ht=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.Utilities.type,options:{}})};function ua(t){return e=>n=>{const{model:s,status:o,KosModelLoader:r}=Ht(e);return a.jsx(r,{...o,children:a.jsx(t,{...n,utilities:s})})}}const Wt=()=>{const t=E.UtilitiesContainer.type;return m.useKosModel({modelId:t,modelType:E.UtilitiesContainer.type,options:{}})};function ma(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Wt();return a.jsx(o,{...s,children:a.jsx(t,{...e,utilitiesContainer:n})})}}const Vs=m.withDevice(m.kosComponent(({device:t})=>{const{t:e}=m.useKosTranslation("dispenser-profile"),s=t.serialNumber==="unassigned"?void 0:t.serialNumber;return a.jsx(l.InfoCard,{label:e("dispenser-serial"),value:s})})),pa=_s(m.kosComponent(({dispenserInfo:t})=>{const{t:e}=m.useKosTranslation("dispenser-profile");return a.jsxs(a.Fragment,{children:[a.jsx(us,{label:e("dispenser-name","Dispenser Name"),configProperty:t.name}),a.jsx(Vs,{})]})})),ha=Kt(m.kosComponent(({settings:t})=>{const{t:e}=m.useKosTranslation("dispenser-profile"),n=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return a.jsxs(a.Fragment,{children:[a.jsx(et,{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}),a.jsx(gs,{label:e("activate-and-reboot-time"),configProperty:t.activateAndRebootTime})]})})),$s=j(l.LabelDate)`
139
+ `,ms=({configProperties:t,disabled:e,enabledConfigProperty:n})=>{const{value:s}=m.useConfigProperty({configProperty:n}),o=s==="true",{componentModeOverride:r}=d.useComponentConfigurationContext(),c=t.length===1,i=c?Eo:us;return a.jsxs(Io,{disabled:!o||e,mode:r,children:[a.jsx(jo,{children:t.map(l=>a.jsx(i,{disabled:!o||e,label:l.options?l.options.label:void 0,configProperty:l.configProperty,collapse:!c&&r==="standard",layout:l.options?l.options.layout:void 0,float:!0,hideUnits:l.options?l.options.hideUnits:void 0},l.configProperty.id))}),a.jsx(Po,{compact:!c||r==="compact",children:a.jsx(je,{alwaysShowLabel:!0,collapse:!0,configProperty:n,disabled:e,stretch:r==="compact"})})]})},Ao=({configProperty:t,disabled:e,enabledConfigProperty:n,options:s})=>{const o=p.useMemo(()=>[{configProperty:t,options:s}],[t,s]);return a.jsx(ms,{configProperties:o,disabled:e,enabledConfigProperty:n})},ps=({configProperty:t,...e})=>{const{value:n}=m.useConfigProperty({configProperty:t}),s=o=>{o!==void 0&&(t==null||t.updateProperty(String(o)))};return a.jsx(d.SwitchCard,{...e,onChange:s,value:n})},hs=({description:t,float:e,label:n,modalTitle:s,onSave:o,time:r,...c})=>{const{regionModel:i}=m.useKosRegions(),{t:l}=m.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:u,formattedTime:f,hourOptions:h,minuteOptions:g,setTime:y,time:v}=m.useRegionTimeProps({initialDate:r}),C=v.getHours(),T=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:C<12?C:C-12,loop:!0},{id:"min",items:g,selectedItemId:v.getMinutes(),loop:!0},{id:"ampm",items:u,selectedItemId:C<12?"AM":"PM"}],[u,h,g,v,C]),A=p.useMemo(()=>[{id:"hr",items:h,selectedItemId:C,loop:!0},{id:"min",items:g,selectedItemId:v.getMinutes(),loop:!0}],[h,g,v,C]);return a.jsx(d.MultiPickerCard,{...c,cancelButtonLabel:l("discard-changes","Discard Changes")||void 0,closeButtonLabel:l("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?T:A,description:t,displayValue:f,float:e,icon:xe.TimeIcon,label:n,modalTitle:s,proceedButtonLabel:l("save","Save")||void 0,onSave:O=>{const P=i!=null&&i.is12HourTimeFormat?O.ampm==="AM"?O.hr:O.hr+12:O.hr,S=O.min,_=new Date(v);_.setHours(P),_.setMinutes(S),y(_),o==null||o({hours:P,minutes:S})}})},fs=({configProperty:t,...e})=>{var f;const{getStagedChange:n,updateStagedChange:s}=Pt(),{value:o}=m.useConfigProperty({configProperty:t}),r=((f=n==null?void 0:n(t.id))==null?void 0:f.value)??o,{hours:c,minutes:i}=E.toTimeComponents(Number(r)),l=new Date;l.setHours(c),l.setMinutes(i);const u=h=>{const g=E.toSeconds(h.hours,h.minutes);s?s(t.id,{configProperty:t,value:g}):t.updateProperty(g)};return a.jsx(hs,{...e,onSave:u,time:l})},No=[0,6],gs=({day:t=new Date().getDate(),month:e=new Date().getMonth(),onSave:n,year:s=new Date().getFullYear(),...o})=>{var y,v,C,T,A,O;const{t:r}=m.useKosTranslation("region"),{regionModel:c}=m.useKosRegions(),i=m.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:No,yearsRange:[s-10,s+10]}}),l=p.useMemo(()=>{var P,S;return(S=(P=i==null?void 0:i.dateState)==null?void 0:P.yearsOptionsArray)==null?void 0:S.map(_=>({id:_.value,label:_.label}))},[(y=i==null?void 0:i.dateState)==null?void 0:y.yearsOptionsArray]),u=p.useMemo(()=>{var P,S;return(S=(P=i==null?void 0:i.dateState)==null?void 0:P.daysOptionsArray)==null?void 0:S.map(_=>({id:_.value,label:_.label}))},[(v=i==null?void 0:i.dateState)==null?void 0:v.daysOptionsArray]),f=p.useMemo(()=>{var P,S;return(S=(P=i==null?void 0:i.dateState)==null?void 0:P.monthsOptionsArray)==null?void 0:S.map(_=>({id:_.value,label:String(_.label)}))},[(C=i==null?void 0:i.dateState)==null?void 0:C.monthsOptionsArray]),h=p.useMemo(()=>{const P=[];return c==null||c.selectedDateOrder.split("").forEach(S=>{var _,$,U;S==="y"?P.push({id:"year",items:l,selectedItemId:(_=i==null?void 0:i.dateState)==null?void 0:_.year,loop:!1}):S==="m"?P.push({id:"month",items:f,selectedItemId:($=i==null?void 0:i.dateState)==null?void 0:$.month}):S==="d"&&P.push({id:"day",items:u,selectedItemId:(U=i==null?void 0:i.dateState)==null?void 0:U.day,loop:!1})}),P},[(T=i==null?void 0:i.dateState)==null?void 0:T.day,(A=i==null?void 0:i.dateState)==null?void 0:A.month,(O=i==null?void 0:i.dateState)==null?void 0:O.year,u,f,c==null?void 0:c.selectedDateOrder,l]),g=p.useCallback(async P=>{const _=new Date(P.year,P.month+1,0).getDate(),$=P.day>_?1:P.day;n({day:$,month:P.month,year:P.year})},[n]);return a.jsx(d.MultiPickerCard,{cancelButtonLabel:r("discard-changes","Discard Changes")||void 0,closeButtonLabel:r("close","Close")||void 0,data:h,displayValue:i.dateState.formattedDate,icon:xe.CalendarIcon,label:r("todays-date","Today's Date"),onSave:g,proceedButtonLabel:r("save","Save")||void 0,...o})},xs=m.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,o]=p.useState("idle"),[r,c]=p.useState(),i=p.useCallback(async()=>{o("test"),c(void 0);const u=await t.performElectricalTest();u.error?(c(u.error),o("failure")):u.result==="errEEPROM"?(c("errEEPROM"),o("failure")):o("success")},[t]),l=p.useMemo(()=>({idle:{information:a.jsx(d.LabelInformation,{children:n("perform-electrical-test")}),footer:a.jsx(d.Button,{onPointerDown:i,children:n("electrical-test")})},test:{information:a.jsx(d.LabelInformation,{children:n("testing")}),footer:a.jsx(d.Button,{disabled:!0,children:n("electrical-test")}),status:"loading"},success:{information:a.jsx(d.LabelInformation,{children:n("electrical-test-success-header")}),footer:a.jsx(d.Button,{onPointerDown:i,children:n("electrical-test")}),status:"success"},failure:{information:a.jsxs(a.Fragment,{children:[a.jsx(d.LabelInformation,{children:n("electrical-test-failure-header")}),a.jsx(d.BodyMediumInformation,{children:n(`error.${r}`)})]}),footer:a.jsx(d.Button,{onPointerDown:i,children:n("electrical-test")}),status:"information"}}),[r,n,i]);return a.jsx(d.WorkflowModal,{title:n(t.name),...l[s],onClose:()=>e()})}),Ct={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Do=t=>{const[e,n]=p.useState(null),[s,o]=p.useState(Ct),r=t.map(c=>{const[i,,l]=c;return[i==null?void 0:i.future,i,l]}).flat();return p.useEffect(()=>{const c=t.find(i=>{const[l]=i;return!!(l!=null&&l.future)});c?(n(c[0]),o(c[2])):(n(null),o(Ct))},[...r,t]),[e,s]},Oo=t=>{switch(t){case"calibrate":return zn;case"fixed-45":return Hn;case"flush":return Wn;case"high-flow-test":return Xn;case"hold-to-pour":return qn;case"low-flow-test":return Gn;case"manual-override":return Yn;case"msv-reset":return Jn;case"prime":return Qn;case"purge":return es;default:return}},Ro=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`)}),De=(t,e=Oo)=>{const{t:n}=m.useKosTranslation("troubles"),[s,o]=p.useState(null),[r,c]=p.useState(Ct),i=p.useCallback(async l=>{const u=e(l);if(u){const f=Ro(n)(l);c(f);const h=new u(t);await h.performAction(),o(h)}},[e,t,n]);return[s,i,r]},Lo=t=>(m.KosLog.debug(`pumpActionFactory: actionId=${t}`),ns),Fo=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`)}),Mo=(t,e,n=Lo)=>{const{t:s}=m.useKosTranslation("troubles"),[o,r]=p.useState(null),[c]=p.useState(Fo(s)(e)),i=p.useCallback(async()=>{const l=n(e);if(l){const u=new l(t,e);await u.performAction(),r(u)}},[n,t,e]);return[o,i,c]};function Bo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Et();return a.jsx(o,{...s,children:a.jsx(t,{...e,agitationControl:n})})}}const At=()=>{const t=E.Animation.type;return m.useKosModel({modelId:t,modelType:E.Animation.type,options:{}})};function ys(t){return e=>{const{model:n,status:s,KosModelLoader:o}=At();return a.jsx(o,{...s,children:a.jsx(t,{...e,animation:n})})}}const Oe=()=>{const t=E.Application.type;return m.useKosModel({modelId:t,modelType:E.Application.type,options:{}})};function Vo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Oe();return a.jsx(o,{...s,children:a.jsx(t,{...e,application:n})})}}const vs=()=>{const t=E.CarbWater.type;return m.useKosModel({modelId:t,modelType:E.CarbWater.type,options:{}})};function $o(t){return e=>{const{model:n,status:s,KosModelLoader:o}=vs();return a.jsx(o,{...s,children:a.jsx(t,{...e,carbWater:n})})}}const bs=()=>{const t=E.CopyLogs.type;return m.useKosModel({modelId:t,modelType:E.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function Ko(t){return e=>{const{model:n,status:s,KosModelLoader:o}=bs();return a.jsx(o,{...s,children:a.jsx(t,{...e,copyLogs:n})})}}const Nt=()=>{const t=E.DashboardOperations.type;return m.useKosModel({modelId:t,modelType:E.DashboardOperations.type,options:{}})};function Uo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Nt();return a.jsx(o,{...s,children:a.jsx(t,{...e,dashboardOperations:n})})}}const Dt=()=>{const t=E.DispenserInfo.type;return m.useKosModel({modelId:t,modelType:E.DispenserInfo.type,options:{}})};function Cs(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Dt();return a.jsx(o,{...s,children:a.jsx(t,{...e,dispenserInfo:n})})}}const _s=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.Door.type,options:{}})};function Zo(t){return e=>{const{model:n,status:s,KosModelLoader:o}=_s(e.id);return a.jsx(o,{...s,children:a.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 r={};for(const c of o)r[c]=c;return r},t.getValidEnumValues=o=>{const r=t.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),c={};for(const i of r)c[i]=o[i];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(r){return o[r]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const r=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&r.push(c);return r},t.find=(o,r)=>{for(const c of o)if(r(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,r=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(r)}t.joinValues=s,t.jsonStringifyReplacer=(o,r)=>typeof r=="bigint"?r.toString():r})(F||(F={}));var gn;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(gn||(gn={}));const w=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G=t=>{switch(typeof t){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(t)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(t)?w.array:t===null?w.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?w.promise:typeof Map<"u"&&t instanceof Map?w.map:typeof Set<"u"&&t instanceof Set?w.set:typeof Date<"u"&&t instanceof Date?w.date:w.object;default:return w.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 X 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(r){return r.message},s={_errors:[]},o=r=>{for(const c of r.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,l=0;for(;l<c.path.length;){const u=c.path[l];l===c.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(n(c))):i[u]=i[u]||{_errors:[]},i=i[u],l++}}};return o(this),s}static assert(e){if(!(e instanceof X))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 r=o.path[0];n[r]=n[r]||[],n[r].push(e(o))}else s.push(e(o));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}X.create=t=>new X(t);const _t=(t,e)=>{let n;switch(t.code){case x.invalid_type:t.received===w.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 zo=_t;function Ho(){return zo}const Wo=t=>{const{data:e,path:n,errorMaps:s,issueData:o}=t,r=[...n,...o.path||[]],c={...o,path:r};if(o.message!==void 0)return{...o,path:r,message:o.message};let i="";const l=s.filter(u=>!!u).slice().reverse();for(const u of l)i=u(c,{data:e,defaultError:i}).message;return{...o,path:r,message:i}};function b(t,e){const n=Ho(),s=Wo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===_t?void 0:_t].filter(o=>!!o)});t.common.issues.push(s)}class K{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 N;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 r=await o.key,c=await o.value;s.push({key:r,value:c})}return K.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const o of n){const{key:r,value:c}=o;if(r.status==="aborted"||c.status==="aborted")return N;r.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(s[r.value]=c.value)}return{status:e.value,value:s}}}const N=Object.freeze({status:"aborted"}),Se=t=>({status:"dirty",value:t}),Z=t=>({status:"valid",value:t}),xn=t=>t.status==="aborted",yn=t=>t.status==="dirty",pe=t=>t.status==="valid",We=t=>typeof Promise<"u"&&t instanceof Promise;var k;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(k||(k={}));class ee{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 vn=(t,e)=>{if(pe(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 X(t.common.issues);return this._error=n,this._error}}};function R(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:l}=t;return c.code==="invalid_enum_value"?{message:l??i.defaultError}:typeof i.data>"u"?{message:l??s??i.defaultError}:c.code!=="invalid_type"?{message:i.defaultError}:{message:l??n??i.defaultError}},description:o}}class L{get description(){return this._def.description}_getType(e){return G(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new K,ctx:{common:e.parent.common,data:e.data,parsedType:G(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(We(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:G(e)},o=this._parseSync({data:e,path:s.path,parent:s});return vn(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:G(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return pe(r)?{value:r.value}:{issues:n.common.issues}}catch(r){(o=(s=r==null?void 0:r.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(r=>pe(r)?{value:r.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:G(e)},o=this._parse({data:e,path:s.path,parent:s}),r=await(We(o)?o:Promise.resolve(o));return vn(s,r)}refine(e,n){const s=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,r)=>{const c=e(o),i=()=>r.addIssue({code:x.custom,...s(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(l=>l?!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 fe({schema:this,typeName:D.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 Q.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return H.create(this)}promise(){return Ye.create(this,this._def)}or(e){return qe.create([this,e],this._def)}and(e){return Ge.create(this,e,this._def)}transform(e){return new fe({...R(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new St({...R(this._def),innerType:this,defaultValue:n,typeName:D.ZodDefault})}brand(){return new gr({typeName:D.ZodBranded,type:this,...R(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Tt({...R(this._def),innerType:this,catchValue:n,typeName:D.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ot.create(this,e)}readonly(){return It.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xo=/^c[^\s-]{8,}$/i,qo=/^[0-9a-z]+$/,Go=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yo=/^[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,Jo=/^[a-z0-9_-]{21}$/i,Qo=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,er=/^[-+]?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)?)??$/,tr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let vt;const sr=/^(?:(?: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])$/,or=/^(?:(?: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])$/,rr=/^(([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]))$/,ar=/^(([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])$/,ir=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ws="((\\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])))",dr=new RegExp(`^${ws}$`);function ks(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 lr(t){return new RegExp(`^${ks(t)}$`)}function ur(t){let e=`${ws}T${ks(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 mr(t,e){return!!((e==="v4"||!e)&&sr.test(t)||(e==="v6"||!e)&&rr.test(t))}function pr(t,e){if(!Qo.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 hr(t,e){return!!((e==="v4"||!e)&&or.test(t)||(e==="v6"||!e)&&ar.test(t))}class Y extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_type,expected:w.string,received:r.parsedType}),N}const s=new K;let o;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),s.dirty());else if(r.kind==="max")e.data.length>r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),s.dirty());else if(r.kind==="length"){const c=e.data.length>r.value,i=e.data.length<r.value;(c||i)&&(o=this._getOrReturnCtx(e,o),c?b(o,{code:x.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&b(o,{code:x.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),s.dirty())}else if(r.kind==="email")tr.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"email",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="emoji")vt||(vt=new RegExp(nr,"u")),vt.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"emoji",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="uuid")Yo.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"uuid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="nanoid")Jo.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"nanoid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="cuid")Xo.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cuid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="cuid2")qo.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cuid2",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="ulid")Go.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"ulid",code:x.invalid_string,message:r.message}),s.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),b(o,{validation:"url",code:x.invalid_string,message:r.message}),s.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"regex",code:x.invalid_string,message:r.message}),s.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),s.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:{startsWith:r.value},message:r.message}),s.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:{endsWith:r.value},message:r.message}),s.dirty()):r.kind==="datetime"?ur(r).test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:"datetime",message:r.message}),s.dirty()):r.kind==="date"?dr.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:"date",message:r.message}),s.dirty()):r.kind==="time"?lr(r).test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:x.invalid_string,validation:"time",message:r.message}),s.dirty()):r.kind==="duration"?er.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"duration",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="ip"?mr(e.data,r.version)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"ip",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="jwt"?pr(e.data,r.alg)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"jwt",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="cidr"?hr(e.data,r.version)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cidr",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="base64"?ir.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"base64",code:x.invalid_string,message:r.message}),s.dirty()):r.kind==="base64url"?cr.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"base64url",code:x.invalid_string,message:r.message}),s.dirty()):F.assertNever(r);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(o=>e.test(o),{validation:n,code:x.invalid_string,...k.errToObj(s)})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.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,...k.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,...k.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...k.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...k.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...k.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...k.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...k.errToObj(n)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new Y({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Y({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Y({...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}}Y.create=t=>new Y({checks:[],typeName:D.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});function fr(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,o=n>s?n:s,r=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return r%c/10**o}class Ee extends L{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)!==w.number){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_type,expected:w.number,received:r.parsedType}),N}let s;const o=new K;for(const r of this._def.checks)r.kind==="int"?F.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{code:x.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()):r.kind==="multipleOf"?fr(e.data,r.value)!==0&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{code:x.not_finite,message:r.message}),o.dirty()):F.assertNever(r);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,k.toString(n))}gt(e,n){return this.setLimit("min",e,!1,k.toString(n))}lte(e,n){return this.setLimit("max",e,!0,k.toString(n))}lt(e,n){return this.setLimit("max",e,!1,k.toString(n))}setLimit(e,n,s,o){return new Ee({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:k.toString(o)}]})}_addCheck(e){return new Ee({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.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)}}Ee.create=t=>new Ee({checks:[],typeName:D.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class Pe extends L{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)!==w.bigint)return this._getInvalidInput(e);let s;const o=new K;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),b(s,{code:x.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):F.assertNever(r);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return b(n,{code:x.invalid_type,expected:w.bigint,received:n.parsedType}),N}gte(e,n){return this.setLimit("min",e,!0,k.toString(n))}gt(e,n){return this.setLimit("min",e,!1,k.toString(n))}lte(e,n){return this.setLimit("max",e,!0,k.toString(n))}lt(e,n){return this.setLimit("max",e,!1,k.toString(n))}setLimit(e,n,s,o){return new Pe({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:k.toString(o)}]})}_addCheck(e){return new Pe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:k.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}}Pe.create=t=>new Pe({checks:[],typeName:D.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});class bn extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.boolean,received:s.parsedType}),N}return Z(e.data)}}bn.create=t=>new bn({typeName:D.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class Xe extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_type,expected:w.date,received:r.parsedType}),N}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return b(r,{code:x.invalid_date}),N}const s=new K;let o;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),s.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:x.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),s.dirty()):F.assertNever(r);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xe({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:k.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}}Xe.create=t=>new Xe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:D.ZodDate,...R(t)});class Cn extends L{_parse(e){if(this._getType(e)!==w.symbol){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.symbol,received:s.parsedType}),N}return Z(e.data)}}Cn.create=t=>new Cn({typeName:D.ZodSymbol,...R(t)});class _n extends L{_parse(e){if(this._getType(e)!==w.undefined){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.undefined,received:s.parsedType}),N}return Z(e.data)}}_n.create=t=>new _n({typeName:D.ZodUndefined,...R(t)});class wn extends L{_parse(e){if(this._getType(e)!==w.null){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.null,received:s.parsedType}),N}return Z(e.data)}}wn.create=t=>new wn({typeName:D.ZodNull,...R(t)});class kn extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}kn.create=t=>new kn({typeName:D.ZodAny,...R(t)});class Sn extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}Sn.create=t=>new Sn({typeName:D.ZodUnknown,...R(t)});class te extends L{_parse(e){const n=this._getOrReturnCtx(e);return b(n,{code:x.invalid_type,expected:w.never,received:n.parsedType}),N}}te.create=t=>new te({typeName:D.ZodNever,...R(t)});class Tn extends L{_parse(e){if(this._getType(e)!==w.undefined){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.void,received:s.parsedType}),N}return Z(e.data)}}Tn.create=t=>new Tn({typeName:D.ZodVoid,...R(t)});class H extends L{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),o=this._def;if(n.parsedType!==w.array)return b(n,{code:x.invalid_type,expected:w.array,received:n.parsedType}),N;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,i=n.data.length<o.exactLength.value;(c||i)&&(b(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&&(b(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&&(b(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 ee(n,c,n.path,i)))).then(c=>K.mergeArray(s,c));const r=[...n.data].map((c,i)=>o.type._parseSync(new ee(n,c,n.path,i)));return K.mergeArray(s,r)}get element(){return this._def.type}min(e,n){return new H({...this._def,minLength:{value:e,message:k.toString(n)}})}max(e,n){return new H({...this._def,maxLength:{value:e,message:k.toString(n)}})}length(e,n){return new H({...this._def,exactLength:{value:e,message:k.toString(n)}})}nonempty(e){return this.min(1,e)}}H.create=(t,e)=>new H({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...R(e)});function ue(t){if(t instanceof B){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=Q.create(ue(s))}return new B({...t._def,shape:()=>e})}else return t instanceof H?new H({...t._def,type:ue(t.element)}):t instanceof Q?Q.create(ue(t.unwrap())):t instanceof ge?ge.create(ue(t.unwrap())):t instanceof re?re.create(t.items.map(e=>ue(e))):t}class B extends L{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)!==w.object){const u=this._getOrReturnCtx(e);return b(u,{code:x.invalid_type,expected:w.object,received:u.parsedType}),N}const{status:s,ctx:o}=this._processInputParams(e),{shape:r,keys:c}=this._getCached(),i=[];if(!(this._def.catchall instanceof te&&this._def.unknownKeys==="strip"))for(const u in o.data)c.includes(u)||i.push(u);const l=[];for(const u of c){const f=r[u],h=o.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new ee(o,h,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof te){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of i)l.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(u==="strict")i.length>0&&(b(o,{code:x.unrecognized_keys,keys:i}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of i){const h=o.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new ee(o,h,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const h=await f.key,g=await f.value;u.push({key:h,value:g,alwaysSet:f.alwaysSet})}return u}).then(u=>K.mergeObjectSync(s,u)):K.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new B({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{var r,c;const o=((c=(r=this._def).errorMap)==null?void 0:c.call(r,n,s).message)??s.defaultError;return n.code==="unrecognized_keys"?{message:k.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:D.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 ue(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 r=this.shape[s];for(;r instanceof Q;)r=r._def.innerType;n[s]=r}return new B({...this._def,shape:()=>n})}keyof(){return Ss(F.objectKeys(this.shape))}}B.create=(t,e)=>new B({shape:()=>t,unknownKeys:"strip",catchall:te.create(),typeName:D.ZodObject,...R(e)});B.strictCreate=(t,e)=>new B({shape:()=>t,unknownKeys:"strict",catchall:te.create(),typeName:D.ZodObject,...R(e)});B.lazycreate=(t,e)=>new B({shape:t,unknownKeys:"strip",catchall:te.create(),typeName:D.ZodObject,...R(e)});class qe extends L{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function o(r){for(const i of r)if(i.result.status==="valid")return i.result;for(const i of r)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;const c=r.map(i=>new X(i.ctx.common.issues));return b(n,{code:x.invalid_union,unionErrors:c}),N}if(n.common.async)return Promise.all(s.map(async r=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await r._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let r;const c=[];for(const l of s){const u={...n,common:{...n.common,issues:[]},parent:null},f=l._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!r&&(r={result:f,ctx:u}),u.common.issues.length&&c.push(u.common.issues)}if(r)return n.common.issues.push(...r.ctx.common.issues),r.result;const i=c.map(l=>new X(l));return b(n,{code:x.invalid_union,unionErrors:i}),N}}get options(){return this._def.options}}qe.create=(t,e)=>new qe({options:t,typeName:D.ZodUnion,...R(e)});function wt(t,e){const n=G(t),s=G(e);if(t===e)return{valid:!0,data:t};if(n===w.object&&s===w.object){const o=F.objectKeys(e),r=F.objectKeys(t).filter(i=>o.indexOf(i)!==-1),c={...t,...e};for(const i of r){const l=wt(t[i],e[i]);if(!l.valid)return{valid:!1};c[i]=l.data}return{valid:!0,data:c}}else if(n===w.array&&s===w.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let r=0;r<t.length;r++){const c=t[r],i=e[r],l=wt(c,i);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===w.date&&s===w.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ge extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=(r,c)=>{if(xn(r)||xn(c))return N;const i=wt(r.value,c.value);return i.valid?((yn(r)||yn(c))&&n.dirty(),{status:n.value,value:i.data}):(b(s,{code:x.invalid_intersection_types}),N)};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(([r,c])=>o(r,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}))}}Ge.create=(t,e,n)=>new Ge({left:t,right:e,typeName:D.ZodIntersection,...R(n)});class re extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==w.array)return b(s,{code:x.invalid_type,expected:w.array,received:s.parsedType}),N;if(s.data.length<this._def.items.length)return b(s,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&s.data.length>this._def.items.length&&(b(s,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const r=[...s.data].map((c,i)=>{const l=this._def.items[i]||this._def.rest;return l?l._parse(new ee(s,c,s.path,i)):null}).filter(c=>!!c);return s.common.async?Promise.all(r).then(c=>K.mergeArray(n,c)):K.mergeArray(n,r)}get items(){return this._def.items}rest(e){return new re({...this._def,rest:e})}}re.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new re({items:t,typeName:D.ZodTuple,rest:null,...R(e)})};class In extends L{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!==w.map)return b(s,{code:x.invalid_type,expected:w.map,received:s.parsedType}),N;const o=this._def.keyType,r=this._def.valueType,c=[...s.data.entries()].map(([i,l],u)=>({key:o._parse(new ee(s,i,s.path,[u,"key"])),value:r._parse(new ee(s,l,s.path,[u,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const l of c){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return N;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(u.value,f.value)}return{status:n.value,value:i}})}else{const i=new Map;for(const l of c){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return N;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),i.set(u.value,f.value)}return{status:n.value,value:i}}}}In.create=(t,e,n)=>new In({valueType:e,keyType:t,typeName:D.ZodMap,...R(n)});class Ae extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==w.set)return b(s,{code:x.invalid_type,expected:w.set,received:s.parsedType}),N;const o=this._def;o.minSize!==null&&s.data.size<o.minSize.value&&(b(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&&(b(s,{code:x.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const r=this._def.valueType;function c(l){const u=new Set;for(const f of l){if(f.status==="aborted")return N;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}const i=[...s.data.values()].map((l,u)=>r._parse(new ee(s,l,s.path,u)));return s.common.async?Promise.all(i).then(l=>c(l)):c(i)}min(e,n){return new Ae({...this._def,minSize:{value:e,message:k.toString(n)}})}max(e,n){return new Ae({...this._def,maxSize:{value:e,message:k.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Ae.create=(t,e)=>new Ae({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...R(e)});class jn extends L{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})}}jn.create=(t,e)=>new jn({getter:t,typeName:D.ZodLazy,...R(e)});class kt extends L{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return b(n,{received:n.data,code:x.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}}kt.create=(t,e)=>new kt({value:t,typeName:D.ZodLiteral,...R(e)});function Ss(t,e){return new he({values:t,typeName:D.ZodEnum,...R(e)})}class he extends L{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return b(n,{expected:F.joinValues(s),received:n.parsedType,code:x.invalid_type}),N}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 b(n,{received:n.data,code:x.invalid_enum_value,options:s}),N}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 he.create(e,{...this._def,...n})}exclude(e,n=this._def){return he.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}he.create=Ss;class En extends L{_parse(e){const n=F.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==w.string&&s.parsedType!==w.number){const o=F.objectValues(n);return b(s,{expected:F.joinValues(o),received:s.parsedType,code:x.invalid_type}),N}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=F.objectValues(n);return b(s,{received:s.data,code:x.invalid_enum_value,options:o}),N}return Z(e.data)}get enum(){return this._def.values}}En.create=(t,e)=>new En({values:t,typeName:D.ZodNativeEnum,...R(e)});class Ye extends L{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==w.promise&&n.common.async===!1)return b(n,{code:x.invalid_type,expected:w.promise,received:n.parsedType}),N;const s=n.parsedType===w.promise?n.data:Promise.resolve(n.data);return Z(s.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ye.create=(t,e)=>new Ye({type:t,typeName:D.ZodPromise,...R(e)});class fe extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:c=>{b(s,c),c.fatal?n.abort():n.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){const c=o.transform(s.data,r);if(s.common.async)return Promise.resolve(c).then(async i=>{if(n.value==="aborted")return N;const l=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return l.status==="aborted"?N:l.status==="dirty"||n.value==="dirty"?Se(l.value):l});{if(n.value==="aborted")return N;const i=this._def.schema._parseSync({data:c,path:s.path,parent:s});return i.status==="aborted"?N:i.status==="dirty"||n.value==="dirty"?Se(i.value):i}}if(o.type==="refinement"){const c=i=>{const l=o.refinement(i,r);if(s.common.async)return Promise.resolve(l);if(l 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"?N:(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"?N:(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(!pe(c))return N;const i=o.transform(c.value,r);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=>pe(c)?Promise.resolve(o.transform(c.value,r)).then(i=>({status:n.value,value:i})):N);F.assertNever(o)}}fe.create=(t,e,n)=>new fe({schema:t,typeName:D.ZodEffects,effect:e,...R(n)});fe.createWithPreprocess=(t,e,n)=>new fe({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...R(n)});class Q extends L{_parse(e){return this._getType(e)===w.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Q.create=(t,e)=>new Q({innerType:t,typeName:D.ZodOptional,...R(e)});class ge extends L{_parse(e){return this._getType(e)===w.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ge.create=(t,e)=>new ge({innerType:t,typeName:D.ZodNullable,...R(e)});class St extends L{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===w.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}St.create=(t,e)=>new St({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class Tt extends L{_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 We(o)?o.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new X(s.common.issues)},input:s.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new X(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Tt.create=(t,e)=>new Tt({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class Pn extends L{_parse(e){if(this._getType(e)!==w.nan){const s=this._getOrReturnCtx(e);return b(s,{code:x.invalid_type,expected:w.nan,received:s.parsedType}),N}return{status:"valid",value:e.data}}}Pn.create=t=>new Pn({typeName:D.ZodNaN,...R(t)});class gr extends L{_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 Ot extends L{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?N:r.status==="dirty"?(n.dirty(),Se(r.value)):this._def.out._parseAsync({data:r.value,path:s.path,parent:s})})();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?N: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 Ot({in:e,out:n,typeName:D.ZodPipeline})}}class It extends L{_parse(e){const n=this._def.innerType._parse(e),s=o=>(pe(o)&&(o.value=Object.freeze(o.value)),o);return We(n)?n.then(o=>s(o)):s(n)}unwrap(){return this._def.innerType}}It.create=(t,e)=>new It({innerType:t,typeName:D.ZodReadonly,...R(e)});var D;(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"})(D||(D={}));const W=Y.create;te.create;H.create;qe.create;Ge.create;re.create;const nt=kt.create,xr=he.create;Ye.create;Q.create;ge.create;const An=j.createExtensionSchema({type:nt("dashboard.summary").describe("Extension type, must be 'dashboard.summary'"),dashboardKey:W().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this summary belongs to")},{rankable:!0}),st=j.extensionPointId("ddk","dashboard","summary"),yr=j.defineExtensionPoint({id:st,contributionKey:"dashboardSummary",displayName:"Dashboard Summary",description:"Extension point for dashboard summary plugin configurations with view support",hasView:!0,isRankable:!0,schema:An,metadata:{exportName:"DashboardSummaryExtension",category:"Dashboard",tags:["dashboard","summary","visualization"]},validate:(t,e)=>{j.validateWithSchema(An,t,e)&&j.validateRankIfPresent(t,e)},transform:j.createViewAwareTransform()}),vr=st,br=`${st}.def`,Cr=`${st}.view`,Nn=j.createExtensionSchema({type:nt("dashboard.detail").describe("Extension type, must be 'dashboard.detail'"),dashboardKey:W().min(1,"Dashboard key is required").describe("Key used to identify which dashboard this detail belongs to")},{rankable:!0}),ot=j.extensionPointId("ddk","dashboard","detail"),_r=j.defineExtensionPoint({id:ot,contributionKey:"dashboardDetail",displayName:"Dashboard Detail",description:"Extension point for dashboard detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Nn,metadata:{exportName:"DashboardDetailExtension",category:"Dashboard",tags:["dashboard","detail","visualization"]},validate:(t,e)=>{j.validateWithSchema(Nn,t,e)&&j.validateRankIfPresent(t,e)},transform:j.createViewAwareTransform()}),wr=ot,kr=`${ot}.def`,Sr=`${ot}.view`,Dn=j.createExtensionSchema({type:nt("dashboard.detail.pump").describe("Extension type, must be 'dashboard.detail.pump'"),dashboardKey:W().min(1,"Dashboard key is required").describe("Key used to match this extension with specific dashboard pumps")},{rankable:!0}),rt=j.extensionPointId("ddk","dashboard","pump-detail"),Ne=j.defineExtensionPoint({id:rt,contributionKey:"dashboardPumpDetail",displayName:"Dashboard Pump Detail",description:"Extension point for dashboard pump detail plugin configurations with view support",hasView:!0,isRankable:!0,schema:Dn,metadata:{exportName:"DashboardPumpDetailExtension"},validate:(t,e)=>{j.validateWithSchema(Dn,t,e)&&j.validateRankIfPresent(t,e)},transform:j.createViewAwareTransform()}),Tr=rt,Ir=`${rt}.def`,jr=`${rt}.view`,On=j.createExtensionSchema({cuiDescriptor:W().min(1,"CUI descriptor is required").describe("Descriptor used to identify and categorize the CUI functionality"),modalMode:xr(["fullscreen","maximized"]).optional().describe("Modal display mode for the CUI interface")}),at=j.extensionPointId("ddk","cui"),Ts=j.defineExtensionPoint({id:at,contributionKey:"cui",displayName:"CUI (Consumer User Interface)",description:"Extension point for CUI plugin configurations with view support",hasView:!0,isRankable:!1,schema:On,metadata:{exportName:"CuiExtension",category:"Interface",tags:["cui","user-interface","consumer"]},validate:(t,e)=>{j.validateWithSchema(On,t,e)&&j.validateDescriptorFormat("CUI descriptor",t.cuiDescriptor,e)},transform:j.createViewAwareTransform()}),Er=at,Pr=`${at}.def`,Ar=`${at}.view`,Rn=j.createExtensionSchema({navDescriptor:W().min(1,"Navigation descriptor is required").describe("Descriptor used to identify and map the navigation functionality")}),it=j.extensionPointId("ddk","nav","view"),Nr=j.defineExtensionPoint({id:it,contributionKey:"navViews",displayName:"Navigation Views",description:"Extension point for navigation view plugin configurations with view support",hasView:!0,isRankable:!1,schema:Rn,metadata:{exportName:"NavViewExtension",category:"Navigation",tags:["navigation","nav","views","routing"]},validate:(t,e)=>{j.validateWithSchema(Rn,t,e)&&j.validateDescriptorFormat("Navigation descriptor",t.navDescriptor,e)},transform:j.createViewAwareTransform()}),Dr=it,Or=`${it}.def`,Rr=`${it}.view`,Ln=j.createExtensionSchema({setupDescriptor:W().min(1,"Setup descriptor is required").describe("Descriptor used to identify and categorize the setup step")},{rankable:!0}),ct=j.extensionPointId("ddk","setup"),Rt=j.defineExtensionPoint({id:ct,contributionKey:"setupStep",displayName:"Setup Steps",description:"Extension point for setup step plugin configurations with view support",hasView:!0,isRankable:!0,schema:Ln,metadata:{exportName:"SetupExtension",category:"Setup",tags:["setup","configuration","steps","wizard"]},validate:(t,e)=>{j.validateWithSchema(Ln,t,e)&&(j.validateDescriptorFormat("Setup descriptor",t.setupDescriptor,e),j.validateRankIfPresent(t,e))},transform:j.createViewAwareTransform()}),Lr=ct,Fr=`${ct}.def`,Mr=`${ct}.view`,Fn=j.createExtensionSchema({type:nt("trouble.action").describe("Extension type, must be 'trouble.action'"),troubleType:W().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:W().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:W().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=j.extensionPointId("ddk","trouble","action"),Je=j.defineExtensionPoint({id:dt,contributionKey:"troubleActions",displayName:"Trouble Actions",description:"Extension point for trouble action plugin configurations with view support",hasView:!0,isRankable:!0,schema:Fn,metadata:{exportName:"TroubleActionExtension",category:"Trouble Management",tags:["trouble","action","state","error-handling"]},validate:(t,e)=>{j.validateWithSchema(Fn,t,e)&&j.validateRankIfPresent(t,e)},transform:j.createViewAwareTransform()}),Br=dt,Vr=`${dt}.def`,$r=`${dt}.view`,Mn=j.createExtensionSchema({viewKey:W().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}),lt=j.extensionPointId("ddk","view"),Kr=j.defineExtensionPoint({id:lt,contributionKey:"views",displayName:"Views",description:"Extension point for view plugin configurations with regional rendering support",hasView:!0,isRankable:!0,schema:Mn,metadata:{exportName:"ViewExtension",category:"UI Layout",tags:["views","ui","rendering","layout","regions"]},validate:(t,e)=>{j.validateWithSchema(Mn,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'`)),j.validateRankIfPresent(t,e))},transform:j.createViewAwareTransform()}),Ur=lt,Zr=`${lt}.def`,zr=`${lt}.view`,Hr="ddk.ncui.utilities",Bn={[Rt.id]:"setupDescriptor",[Ts.id]:"cuiDescriptor",[Hr]:"utilDescriptor"},Is=({defaultNamespace:t,extensionPoint:e})=>{const{getExtensions:n}=oe.useKosPluginsContext(),s=n(e),o=s.map(l=>l.data.namespace)||[],{t:r}=m.useKosTranslation([t,...new Set(o)]),c=s.reduce((l,u)=>{const f=u;return l[f.data[Bn[e]]]={extension:e,module:f.id,namespace:f.data.namespace,title:f.data.title},l},{}),i=s.reduce((l,u)=>{const f=u;return l[f.data[Bn[e]]]=`${f.data.namespace}:${f.data.title}`,l},{});return{namespaces:o,t:r,labelMap:i,contributionMap:c}},Re=(t,e)=>{const n=p.useMemo(()=>({agitate:ss,calibrate:({holder:c,pump:i,onComplete:l})=>{const u=m.getKosCompanionModel(i??c.pumps.data[0],E.FcmPump.type);return a.jsx(is,{pump:u,onComplete:l})},calibrateSPM:({holder:c,pump:i,onComplete:l})=>{const u=m.getKosCompanionModel(i??c.pumps.data[0],E.SpmPump.type);return a.jsx(Ys,{pump:u,onComplete:l})},diagnostics:({holder:c,pump:i,onComplete:l})=>{const u=m.getKosCompanionModel(i??c.pumps.data[0],E.FcmPump.type);return a.jsx(xs,{pump:u,onComplete:l})},"replace-pump":({holder:c,pump:i,onComplete:l})=>a.jsx(Hs,{pump:i??c.pumps.data[0],onComplete:l}),"rfid-override":Ws,"replace-line":({holder:c,onComplete:i})=>a.jsx(zs,{holder:c,onComplete:i})}),[]),[s,o]=p.useState(void 0),r=s?n[s]:void 0;return{holderExperience:r?a.jsx(r,{holder:t,pump:e,onComplete:()=>{o(void 0)}}):void 0,setHolderExperience:o,currentExperienceId:s}},Lt=p.createContext(void 0),Wr=({children:t,value:e})=>a.jsx(Lt.Provider,{value:e,children:t}),Xr=t=>({HolderContent:void 0}),Ft=(t,e=Xr)=>{const n=p.useContext(Lt);return e=(n==null?void 0:n.actionFactory)||e,e(t)},Mt=()=>{const t=E.IngredientSummary.type;return m.useKosModel({modelId:t,modelType:E.IngredientSummary.type,options:{}})};function qr(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=Mt();return a.jsx(o,{...s,children:a.jsx(t,{...e,ingredientSummary:n})})}}const Bt=()=>{const t=E.MacroAssignment.type;return m.useKosModel({modelId:t,modelType:E.MacroAssignment.type,options:{}})};function js(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Bt();return a.jsx(o,{...s,children:a.jsx(t,{...e,macroAssignment:n})})}}const Vt=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.NetworkTest.type,options:{}})};function Gr(t){return e=>n=>{const{model:s,status:o,KosModelLoader:r}=Vt(e);return a.jsx(r,{...o,children:a.jsx(t,{...n,networkTest:s})})}}const $t=()=>{const t=E.NetworkTestContainer.type;return m.useKosModel({modelId:t,modelType:E.NetworkTestContainer.type,options:{}})};function Es(t){return e=>{const{model:n,status:s,KosModelLoader:o}=$t();return a.jsx(o,{...s,children:a.jsx(t,{...e,networkTestContainer:n})})}}const Ps=()=>{const t=E.NutritiveSweetener.type;return m.useKosModel({modelId:t,modelType:E.NutritiveSweetener.type,options:{}})};function Yr(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Ps();return a.jsx(o,{...s,children:a.jsx(t,{...e,nutritiveSweetener:n})})}}const As=()=>{const t=E.PlainWater.type;return m.useKosModel({modelId:t,modelType:E.PlainWater.type,options:{},destroyOnUnmount:!0})};function Jr(t){return e=>{const{model:n,status:s,KosModelLoader:o}=As();return a.jsx(o,{...s,children:a.jsx(t,{...e,plainWater:n})})}}const Qr=t=>{switch(t.type){case"fcm":return E.FcmPump.type;case"lfcv":return E.LfcvPump.type;case"micro":return E.SpmPump.type;default:return}},J="pluginVisibility",He=new Map;m.registerExtensionPoint(J,{register:(t,e)=>{var n;He.has(t)||He.set(t,[]),(n=He.get(t))==null||n.push(e)},execute:(t,e,n)=>{const s=He.get(t);if(!s)return!0;const o=s.map(r=>r(e,n));return o.length===0?!0:!o.includes(!1)}});class Ns{constructor(e,n){M(this,"core");M(this,"dispense");this.core=e,this.dispense=n}registerDashboardVisibilityFilter(e){return m.ExtensionManager[J].register(J,e),this}registerNavVisibilityFilter(e){return m.ExtensionManager[J].register(J,e),this}}class ea{constructor(){M(this,"dispense");M(this,"core");M(this,"plugin");this.dispense=new jt.DispenseExtensionManager,this.core=new m.CoreExtensionManager,this.plugin=new Ns(this.core,this.dispense)}}const Le=t=>t?Ds(t.type):{action:"",label:"",progress:"",summary:""},Ds=t=>{const e=`troubles:troubles.${t}`;return{action:`${e}.action`,label:`${e}.label`,progress:`${e}.progress`,summary:`${e}.summary`}},Fe=t=>{const{getExtensions:e}=oe.useKosPluginsContext();return{getExtensions:p.useCallback(s=>e(s).filter(c=>{const i=c.id;return m.ExtensionManager[J].execute(J,i,t)}),[e,t])}},ut=()=>{const t=E.Reboot.type;return m.useKosModel({modelId:t,modelType:E.Reboot.type,options:{}})};function ta(t){return()=>e=>{const{model:n,status:s,KosModelLoader:o}=ut();return a.jsx(o,{...s,children:a.jsx(t,{...e,reboot:n})})}}const mt=()=>{const t=E.Settings.type;return m.useKosModel({modelId:t,modelType:E.Settings.type,options:{}})};function Kt(t){return e=>{const{model:n,status:s,KosModelLoader:o}=mt();return a.jsx(o,{...s,children:a.jsx(t,{...e,settings:n})})}}const Ut=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.SetupStep.type,options:{}})};function na(t){return e=>n=>{const{model:s,status:o,KosModelLoader:r}=Ut(e);return a.jsx(r,{...o,children:a.jsx(t,{...n,setupStep:s})})}}const Zt=()=>{const t=E.SetupStepContainer.type;return m.useKosModel({modelId:t,modelType:E.SetupStepContainer.type,options:{}})};function Os(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Zt();return a.jsx(o,{...s,children:a.jsx(t,{...e,setupStepContainer:n})})}}const Rs=()=>{const t=E.Start.type;return m.useKosModel({modelId:t,modelType:E.Start.type,options:{}})};function sa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Rs();return a.jsx(o,{...s,children:a.jsx(t,{...e,start:n})})}}const zt=()=>{const t=E.TroubleActionManager.type,{getExtensions:e}=Fe(),n=e(Je.id).map(o=>o.data);return m.useKosModel({modelId:t,modelType:E.TroubleActionManager.type,options:{definitions:n}})};function oa(t){return e=>{const{model:n,status:s,KosModelLoader:o}=zt();return a.jsx(o,{...s,children:a.jsx(t,{...e,troubleAction:n})})}}const pt=t=>{const[e,n]=p.useState({});return p.useEffect(()=>{async function s(){if(t){const o=await m.troubleDataFactory(t);n(o)}}s()},[t]),e},ra=t=>!t||t==="white",aa=t=>t?void 0:"white",Ls=t=>{if(!m.isTroubleAware(t))return{};const e=t,{visibleTroubles:n,initialized:s}=ve(e),o=(n==null?void 0:n.length)??0,r=n==null?void 0:n[0],c=o>0,i=c?`${r==null?void 0:r.color}`:void 0,l=ra(i),u=c?aa(l):void 0;return{backgroundColor:i,fontColor:u,highestTrouble:r,initialized:s,troubleCount:o,hasTroubles:c}},ia=({troubleType:t,condition:e})=>{const{model:n}=m.useTroubleContainerModel(),[s,o]=p.useState(!1),[r,c]=p.useState([]);return p.useEffect(()=>m.kosAutoEffect(()=>{const l=(t?n==null?void 0:n.troubles.getIndexByKey("byType",t):n==null?void 0:n.troubles.data)||[],u=e?l.filter(e):l;o(u.length>0),c(u)}),[e,n,t]),[s,r.length>0?r[0]:void 0,r]},Ht=t=>{const e=t;return m.useKosModel({modelId:e,modelType:E.Utilities.type,options:{}})};function ca(t){return e=>n=>{const{model:s,status:o,KosModelLoader:r}=Ht(e);return a.jsx(r,{...o,children:a.jsx(t,{...n,utilities:s})})}}const Wt=()=>{const t=E.UtilitiesContainer.type;return m.useKosModel({modelId:t,modelType:E.UtilitiesContainer.type,options:{}})};function da(t){return e=>{const{model:n,status:s,KosModelLoader:o}=Wt();return a.jsx(o,{...s,children:a.jsx(t,{...e,utilitiesContainer:n})})}}const Fs=m.withDevice(m.kosComponent(({device:t})=>{const{t:e}=m.useKosTranslation("dispenser-profile"),s=t.serialNumber==="unassigned"?void 0:t.serialNumber;return a.jsx(d.InfoCard,{label:e("dispenser-serial"),value:s})})),la=Cs(m.kosComponent(({dispenserInfo:t})=>{const{t:e}=m.useKosTranslation("dispenser-profile");return a.jsxs(a.Fragment,{children:[a.jsx(ls,{label:e("dispenser-name","Dispenser Name"),configProperty:t.name}),a.jsx(Fs,{})]})})),ua=Kt(m.kosComponent(({settings:t})=>{const{t:e}=m.useKosTranslation("dispenser-profile"),n=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return a.jsxs(a.Fragment,{children:[a.jsx(et,{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}),a.jsx(fs,{label:e("activate-and-reboot-time"),configProperty:t.activateAndRebootTime})]})})),Ms=I(d.LabelDate)`
140
140
  color: var(--ddk-generic-color-grey-60);
141
141
  font-size: var(--ddk-component-enjoy-by-font-size-small);
142
142
  font-weight: var(--ddk-component-enjoy-by-font-weight-small);
143
- `,fa=j(l.LabelDate)`
143
+ `,ma=I(d.LabelDate)`
144
144
  color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
145
- `,ga=j($s)`
145
+ `,pa=I(Ms)`
146
146
  color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
147
- `,Xt=({holder:t,size:e})=>{const{t:n}=m.useKosTranslation("common"),{regionModel:s}=m.useKosRegions(),o=!!t.enjoyByDate,r=t.enjoyByDate??new Date,{formattedDate:c}=m.useFormattedDate({year:r.getFullYear(),month:r.getMonth(),day:r.getDate(),formatString:(s==null?void 0:s.selectedDateFormat)||""}),i=t.hasEnjoyByWarning?e==="small"?ga:fa:e==="small"?$s:l.LabelDate;return o&&a.jsx(i,{children:n("enjoy-by",{data:{date:c}})})},xa=({item:t,valueKey:e})=>{const{t:n}=m.useKosTranslation("hardware-info"),{linked:s}=t;if(e==="link.serialNum"&&!s)return a.jsx(l.LabelInformationExtraSmall,{children:n("not-connected")});const o=l.getItemData(t,e);return o||"—"},ya=j(l.Table)`
147
+ `,Xt=({holder:t,size:e})=>{const{t:n}=m.useKosTranslation("common"),{regionModel:s}=m.useKosRegions(),o=!!t.enjoyByDate,r=t.enjoyByDate??new Date,{formattedDate:c}=m.useFormattedDate({year:r.getFullYear(),month:r.getMonth(),day:r.getDate(),formatString:(s==null?void 0:s.selectedDateFormat)||""}),i=t.hasEnjoyByWarning?e==="small"?pa:ma:e==="small"?Ms:d.LabelDate;return o&&a.jsx(i,{children:n("enjoy-by",{data:{date:c}})})},ha=({item:t,valueKey:e})=>{const{t:n}=m.useKosTranslation("hardware-info"),{linked:s}=t;if(e==="link.serialNum"&&!s)return a.jsx(d.LabelInformationExtraSmall,{children:n("not-connected")});const o=d.getItemData(t,e);return o||"—"},fa=I(d.Table)`
148
148
  & ul {
149
149
  list-style-type: none;
150
150
  margin: 0;
151
151
  padding: 0;
152
152
  }
153
- `,va=m.kosComponent(()=>{const{model:t}=jt.useBoardContainer(),{t:e}=m.useKosTranslation("hardware-info"),n=(t==null?void 0:t.boardList.map(s=>{var o,r,c;return{...s,link:{...s.link,firmwareVersions:(o=s.link)!=null&&o.firmwareVersions&&s.link.firmwareVersions.length>0?a.jsx("ul",{children:(c=(r=s.link)==null?void 0:r.firmwareVersions)==null?void 0:c.map((i,d)=>a.jsx("li",{children:i},d))}):"—"}}}))||[];return t&&t.boardList&&a.jsx(ya,{CellRenderer:xa,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})}),ye=({disabled:t,model:e,onPour:n,onPourCancel:s,...o})=>{const{t:r}=m.useKosTranslation("common"),[c,i]=p.useState(e.isPouring?"halt":"idle"),d=p.useRef(),u=p.useRef(!1),f=250;p.useEffect(()=>m.kosAutoEffect(()=>{e.isPouring||(u.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(()=>{u.current=!0,d.current=void 0,i("run")},f)))},[t,e]),g=p.useCallback(()=>{e&&(u.current?(e.cancelPour(),u.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 a.jsx(l.TapAndHoldButton,{disabled:t,mode:"primary",onPointerCancel:g,onPointerDown:h,onPointerOut:y,onPointerUp:g,...o,state:c,children:r(r(c==="idle"?"tapOrHoldToPour":c==="run"?"releaseToStop":"stop"))})},qt=p.createContext(void 0),ba=({children:t})=>{const{model:e,ready:n}=Nt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(qt.Provider,{value:s,children:t})},Ca=()=>{const t=p.useContext(qt);if(!t)throw new Error("useAnimationContext must be used within a AnimationProvider");return t},_a=vs(({animation:t,animationOverrides:e,children:n,componentModeOverride:s,modalModeOverride:o})=>{const[r,c]=p.useState(!0),[i,d]=p.useState(!0),[u,f]=p.useState(!0);return p.useEffect(()=>{const h=m.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),v=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableSideBar))&&!!(!t.disableAll.value&&t.enableSideBar.value);c(g),d(y),f(v)});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]),a.jsx(l.ComponentConfigurationProvider,{value:{componentModeOverride:s,enableDialAnimation:r,enableModalAnimation:i,enableSidebarAnimation:u,modalModeOverride:o},children:n})}),Gt=p.createContext(void 0),wa=({children:t})=>{const{model:e,ready:n}=Oe(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Gt.Provider,{value:s,children:t})},ht=()=>{const t=p.useContext(Gt);if(!t)throw new Error("useApplicationContext must be used within a ApplicationProvider");return t},Yt=p.createContext(void 0),ka=({children:t})=>{const{model:e,ready:n}=At(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Yt.Provider,{value:s,children:t})},Sa=()=>{const t=p.useContext(Yt);if(!t)throw new Error("useDashboardOperationsContext must be used within a DashboardOperationsProvider");return t},Jt=p.createContext(void 0),Ta=({children:t})=>{const{model:e,ready:n}=Dt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Jt.Provider,{value:s,children:t})},Ia=()=>{const t=p.useContext(Jt);if(!t)throw new Error("useDispenserInfoContext must be used within a DispenserInfoProvider");return t},Qt=p.createContext(void 0),ja=({children:t})=>{const{model:e,ready:n}=Mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Qt.Provider,{value:s,children:t})},Ea=()=>{const t=p.useContext(Qt);if(!t)throw new Error("useIngredientSummaryContext must be used within a IngredientSummaryProvider");return t},en=p.createContext(void 0),Pa=({children:t})=>{const{model:e,ready:n}=Bt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(en.Provider,{value:s,children:t})},Na=()=>{const t=p.useContext(en);if(!t)throw new Error("useMacroAssignmentContext must be used within a MacroAssignmentProvider");return t},tn=p.createContext(void 0),Aa=({children:t,id:e})=>{const{model:n,ready:s}=Vt(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return a.jsx(tn.Provider,{value:o,children:t})},Da=()=>{const t=p.useContext(tn);if(!t)throw new Error("useNetworkTestContext must be used within a NetworkTestProvider");return t},nn=p.createContext(void 0),Oa=({children:t})=>{const{model:e,ready:n}=$t(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(nn.Provider,{value:s,children:t})},Ra=()=>{const t=p.useContext(nn);if(!t)throw new Error("useNetworkTestContainerContext must be used within a NetworkTestContainerProvider");return t},sn=p.createContext(void 0),La=({children:t})=>{const{model:e,ready:n}=ut(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(sn.Provider,{value:s,children:t})},Fa=()=>{const t=p.useContext(sn);if(!t)throw new Error("useRebootContext must be used within a RebootProvider");return t},on=p.createContext(void 0),Ma=({children:t})=>{const{model:e,ready:n}=mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(on.Provider,{value:s,children:t})},Ba=()=>{const t=p.useContext(on);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t},rn=p.createContext(void 0),Va=({children:t,id:e})=>{const{model:n,ready:s}=Ut(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return a.jsx(rn.Provider,{value:o,children:t})},$a=()=>{const t=p.useContext(rn);if(!t)throw new Error("useSetupStepContext must be used within a SetupStepProvider");return t},an=p.createContext(void 0),Ka=({children:t})=>{const{model:e,ready:n}=Zt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(an.Provider,{value:s,children:t})},Ua=()=>{const t=p.useContext(an);if(!t)throw new Error("useSetupStepContainerContext must be used within a SetupStepContainerProvider");return t},cn=p.createContext(void 0),Za=({children:t,id:e})=>{const{model:n,ready:s}=Ht(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return a.jsx(cn.Provider,{value:o,children:t})},za=()=>{const t=p.useContext(cn);if(!t)throw new Error("useUtilitiesContext must be used within a UtilitiesProvider");return t},ln=p.createContext(void 0),Ha=({children:t})=>{const{model:e,ready:n}=Wt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(ln.Provider,{value:s,children:t})},Wa=()=>{const t=p.useContext(ln);if(!t)throw new Error("useUtilitiesContainerContext must be used within a UtilitiesContainerProvider");return t},ve=t=>{const{model:e}=ht(),[n,s]=p.useState(),o=e==null?void 0:e.currentRole,r=!!n;return p.useLayoutEffect(()=>{const c=m.kosAutoEffect(()=>{const i=t.troubles.filter(E.troubleVisibilityFilter(o));s(d=>{const u=d??[];return i.length!==u.length||i.some(f=>!u.includes(f))?i:u})});return()=>{c()}},[t,o]),{visibleTroubles:n,initialized:r}},Ks=m.KosLog.createLogger({name:"holder-group-view"});Ks.debug("holder-group-view component loaded");const $n=j.div`
153
+ `,ga=m.kosComponent(()=>{const{model:t}=jt.useBoardContainer(),{t:e}=m.useKosTranslation("hardware-info"),n=(t==null?void 0:t.boardList.map(s=>{var o,r,c;return{...s,link:{...s.link,firmwareVersions:(o=s.link)!=null&&o.firmwareVersions&&s.link.firmwareVersions.length>0?a.jsx("ul",{children:(c=(r=s.link)==null?void 0:r.firmwareVersions)==null?void 0:c.map((i,l)=>a.jsx("li",{children:i},l))}):"—"}}}))||[];return t&&t.boardList&&a.jsx(fa,{CellRenderer:ha,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})}),ye=({disabled:t,model:e,onPour:n,onPourCancel:s,...o})=>{const{t:r}=m.useKosTranslation("common"),[c,i]=p.useState(e.isPouring?"halt":"idle"),l=p.useRef(),u=p.useRef(!1),f=250;p.useEffect(()=>m.kosAutoEffect(()=>{e.isPouring||(u.current=!1,clearTimeout(l.current),l.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"),l.current=setTimeout(()=>{u.current=!0,l.current=void 0,i("run")},f)))},[t,e]),g=p.useCallback(()=>{e&&(u.current?(e.cancelPour(),u.current=!1,i("idle")):l.current?(clearTimeout(l.current),l.current=void 0,i("halt")):e.isPouring&&(e.cancelPour(),i("idle")))},[e]),y=p.useCallback(()=>{c!=="halt"&&g()},[g,c]);return a.jsx(d.TapAndHoldButton,{disabled:t,mode:"primary",onPointerCancel:g,onPointerDown:h,onPointerOut:y,onPointerUp:g,...o,state:c,children:r(r(c==="idle"?"tapOrHoldToPour":c==="run"?"releaseToStop":"stop"))})},qt=p.createContext(void 0),xa=({children:t})=>{const{model:e,ready:n}=At(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(qt.Provider,{value:s,children:t})},ya=()=>{const t=p.useContext(qt);if(!t)throw new Error("useAnimationContext must be used within a AnimationProvider");return t},va=ys(({animation:t,animationOverrides:e,children:n,componentModeOverride:s,modalModeOverride:o})=>{const[r,c]=p.useState(!0),[i,l]=p.useState(!0),[u,f]=p.useState(!0);return p.useEffect(()=>{const h=m.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),v=!!(!(e!=null&&e.disableAll)&&(e!=null&&e.enableSideBar))&&!!(!t.disableAll.value&&t.enableSideBar.value);c(g),l(y),f(v)});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]),a.jsx(d.ComponentConfigurationProvider,{value:{componentModeOverride:s,enableDialAnimation:r,enableModalAnimation:i,enableSidebarAnimation:u,modalModeOverride:o},children:n})}),Gt=p.createContext(void 0),ba=({children:t})=>{const{model:e,ready:n}=Oe(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Gt.Provider,{value:s,children:t})},ht=()=>{const t=p.useContext(Gt);if(!t)throw new Error("useApplicationContext must be used within a ApplicationProvider");return t},Yt=p.createContext(void 0),Ca=({children:t})=>{const{model:e,ready:n}=Nt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Yt.Provider,{value:s,children:t})},_a=()=>{const t=p.useContext(Yt);if(!t)throw new Error("useDashboardOperationsContext must be used within a DashboardOperationsProvider");return t},Jt=p.createContext(void 0),wa=({children:t})=>{const{model:e,ready:n}=Dt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Jt.Provider,{value:s,children:t})},ka=()=>{const t=p.useContext(Jt);if(!t)throw new Error("useDispenserInfoContext must be used within a DispenserInfoProvider");return t},Qt=p.createContext(void 0),Sa=({children:t})=>{const{model:e,ready:n}=Mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(Qt.Provider,{value:s,children:t})},Ta=()=>{const t=p.useContext(Qt);if(!t)throw new Error("useIngredientSummaryContext must be used within a IngredientSummaryProvider");return t},en=p.createContext(void 0),Ia=({children:t})=>{const{model:e,ready:n}=Bt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(en.Provider,{value:s,children:t})},ja=()=>{const t=p.useContext(en);if(!t)throw new Error("useMacroAssignmentContext must be used within a MacroAssignmentProvider");return t},tn=p.createContext(void 0),Ea=({children:t,id:e})=>{const{model:n,ready:s}=Vt(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return a.jsx(tn.Provider,{value:o,children:t})},Pa=()=>{const t=p.useContext(tn);if(!t)throw new Error("useNetworkTestContext must be used within a NetworkTestProvider");return t},nn=p.createContext(void 0),Aa=({children:t})=>{const{model:e,ready:n}=$t(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(nn.Provider,{value:s,children:t})},Na=()=>{const t=p.useContext(nn);if(!t)throw new Error("useNetworkTestContainerContext must be used within a NetworkTestContainerProvider");return t},sn=p.createContext(void 0),Da=({children:t})=>{const{model:e,ready:n}=ut(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(sn.Provider,{value:s,children:t})},Oa=()=>{const t=p.useContext(sn);if(!t)throw new Error("useRebootContext must be used within a RebootProvider");return t},on=p.createContext(void 0),Ra=({children:t})=>{const{model:e,ready:n}=mt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(on.Provider,{value:s,children:t})},La=()=>{const t=p.useContext(on);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t},rn=p.createContext(void 0),Fa=({children:t,id:e})=>{const{model:n,ready:s}=Ut(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return a.jsx(rn.Provider,{value:o,children:t})},Ma=()=>{const t=p.useContext(rn);if(!t)throw new Error("useSetupStepContext must be used within a SetupStepProvider");return t},an=p.createContext(void 0),Ba=({children:t})=>{const{model:e,ready:n}=Zt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(an.Provider,{value:s,children:t})},Va=()=>{const t=p.useContext(an);if(!t)throw new Error("useSetupStepContainerContext must be used within a SetupStepContainerProvider");return t},cn=p.createContext(void 0),$a=({children:t,id:e})=>{const{model:n,ready:s}=Ht(e),o=p.useMemo(()=>s&&n?{model:n}:{},[s,n]);return a.jsx(cn.Provider,{value:o,children:t})},Ka=()=>{const t=p.useContext(cn);if(!t)throw new Error("useUtilitiesContext must be used within a UtilitiesProvider");return t},dn=p.createContext(void 0),Ua=({children:t})=>{const{model:e,ready:n}=Wt(),s=p.useMemo(()=>n&&e?{model:e}:{},[n,e]);return a.jsx(dn.Provider,{value:s,children:t})},Za=()=>{const t=p.useContext(dn);if(!t)throw new Error("useUtilitiesContainerContext must be used within a UtilitiesContainerProvider");return t},ve=t=>{const{model:e}=ht(),[n,s]=p.useState(),o=e==null?void 0:e.currentRole,r=!!n;return p.useLayoutEffect(()=>{const c=m.kosAutoEffect(()=>{const i=t.troubles.filter(E.troubleVisibilityFilter(o));s(l=>{const u=l??[];return i.length!==u.length||i.some(f=>!u.includes(f))?i:u})});return()=>{c()}},[t,o]),{visibleTroubles:n,initialized:r}},Bs=m.KosLog.createLogger({name:"holder-group-view"});Bs.debug("holder-group-view component loaded");const Vn=I.div`
154
154
  align-items: start;
155
155
 
156
156
  display: flex;
@@ -160,29 +160,29 @@
160
160
  text-overflow: ellipsis;
161
161
  width: 100%;
162
162
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
163
- `,Xa=j.div`
163
+ `,za=I.div`
164
164
  display: flex;
165
165
  align-items: center;
166
166
  justify-content: center;
167
167
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
168
- `,qa=j.div`
168
+ `,Ha=I.div`
169
169
  font-size: var(--ddk-component-holder-card-footer-font-size);
170
170
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
171
- `,Ga=t=>!t||t==="white",Ya=t=>t?void 0:"white",Ja=(t,e)=>e&&e.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":t?void 0:"white",Us=m.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s})=>{const{model:o}=Oe(),{visibleTroubles:r,initialized:c}=ve(t),i=o==null?void 0:o.currentRole,{t:d}=m.useKosTranslation("troubles"),{t:u}=m.useKosTranslation("common"),{componentModeOverride:f}=l.useComponentConfigurationContext(),h=f==="compact",{getExtensions:g}=Fe();let y=!1;const v=m.getKosCompanionModel(t,Te.FreestyleHolder.type);v!=null&&v.isRemote&&(Ks.warn("Holder is remote, skipping rendering"),y=!0);const[C,T]=p.useState(!1),N=!!t.ingredientId,O=p.useCallback(()=>{T(!1)},[]),P=(r==null?void 0:r.length)??0,S=r==null?void 0:r[0],_=P>0,$=pt(S),U=t.hasFuelGuage,q=t.fillPercent,Me=t.removed?"var(--ddk-component-dashboard-card-background-color-unassigned)":y?"var(--ddk-generic-color-grey-50)":_?`${S==null?void 0:S.color}`:N?void 0:"var(--ddk-component-dashboard-card-background-color-unassigned)",gt=t.removed?"var(--ddk-component-dashboard-card-header-background-color)":void 0,Be=Ga(Me),ie=y?"white":t.unassigned?"var(--ddk-generic-color-grey-30)":_?Ya(Be):N?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",Ve=y?"white":_?Ja(Be,t):N?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",mn=l.useAbbreviation(t.name,h),be=y?u("disabled"):t.removed?u(t.previousIngredientName):t.unassigned?u("unassigned"):u(t.ingredientName),$e=a.jsx($n,{color:ie,children:be}),Ke=a.jsx(Xa,{color:ie,children:mn}),xt=a.jsxs($n,{children:[t.name," ",be]}),Ue=N&&U&&!_&&c?s??a.jsx(l.FuelGauge,{color:_?"var(--ddk-generic-color-white)":void 0,size:"small",value:q}):null,yt=N&&U&&!_&&c&&l.getFillColor(q)||void 0,Ce=m.ExtensionManager.executeDashboardKeyFactory(t)||"",Ze=p.useMemo(()=>g(Ae.id),[g]),_e=p.useMemo(()=>Ze.filter(se=>!!se.data).reduce((se,hn)=>(se[hn.data.dashboardKey]=hn.data,se),{}),[Ze]),we=!!_e[Ce],{HolderContent:ce,modalOptions:le}=Ft(t),de=oe.useExtensionComponent(Ae),so=p.useMemo(()=>{var se;return ce?a.jsx(ce,{holder:t,onComplete:O}):we&&de?a.jsx(de,{module:(se=_e[Ce])==null?void 0:se.id,holder:t}):void 0},[ce,O,_e,we,t,Ce,de]),oo=Le(S),ro=a.jsx(qa,{color:_?ie:Ve,children:v!=null&&v.isRemote?u("remote-nns-active"):_?d(oo.summary,{context:S!=null&&S.deferred?"queued":void 0,data:$}):!h&&a.jsx(Xt,{size:"small",holder:t})}),{holderExperience:ao,setHolderExperience:pn}=Re(t),{future:ze}=ne(S),io=p.useCallback(()=>{y||t.sortedPumps.length<=0||(i==="technician"?T(!0):t.unassigned||t.removed?pn("rfid-override"):_&&(e==null||e(t)))},[y,t,i,pn,_,e]);return a.jsxs(a.Fragment,{children:[a.jsxs(l.Modal,{contain:!h,...le,show:C,onClose:O,children:[a.jsx(l.Header,{contain:h,showCloseButton:!0,title:xt,onClose:O,CloseButton:h?l.BackButton:void 0}),so]}),a.jsx(p.Suspense,{children:ao}),a.jsx(l.HolderDashboardCard,{avatar:Ke,headerBackgroundColor:gt,backgroundColor:Me,footer:ro,cardId:t.path,errors:P,title:$e,indicatorColor:yt,disabled:y,body:Ue,showNavIcon:n,onCardSelect:io},t.path),(S==null?void 0:S.future)&&a.jsx(V,{title:$e,future:ze,failureMessage:d(`troubles.${S.type}.error`,{context:ze==null?void 0:ze.reason})})]})}),dn=j.div`
171
+ `,Wa=t=>!t||t==="white",Xa=t=>t?void 0:"white",qa=(t,e)=>e&&e.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":t?void 0:"white",Vs=m.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s})=>{const{model:o}=Oe(),{visibleTroubles:r,initialized:c}=ve(t),i=o==null?void 0:o.currentRole,{t:l}=m.useKosTranslation("troubles"),{t:u}=m.useKosTranslation("common"),{componentModeOverride:f}=d.useComponentConfigurationContext(),h=f==="compact",{getExtensions:g}=Fe();let y=!1;const v=m.getKosCompanionModel(t,Te.FreestyleHolder.type);v!=null&&v.isRemote&&(Bs.warn("Holder is remote, skipping rendering"),y=!0);const[C,T]=p.useState(!1),A=!!t.ingredientId,O=p.useCallback(()=>{T(!1)},[]),P=(r==null?void 0:r.length)??0,S=r==null?void 0:r[0],_=P>0,$=pt(S),U=t.hasFuelGuage,q=t.fillPercent,Me=t.removed?"var(--ddk-component-dashboard-card-background-color-unassigned)":y?"var(--ddk-generic-color-grey-50)":_?`${S==null?void 0:S.color}`:A?void 0:"var(--ddk-component-dashboard-card-background-color-unassigned)",gt=t.removed?"var(--ddk-component-dashboard-card-header-background-color)":void 0,Be=Wa(Me),ie=y?"white":t.unassigned?"var(--ddk-generic-color-grey-30)":_?Xa(Be):A?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",Ve=y?"white":_?qa(Be,t):A?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",mn=d.useAbbreviation(t.name,h),be=y?u("disabled"):t.removed?u(t.previousIngredientName):t.unassigned?u("unassigned"):u(t.ingredientName),$e=a.jsx(Vn,{color:ie,children:be}),Ke=a.jsx(za,{color:ie,children:mn}),xt=a.jsxs(Vn,{children:[t.name," ",be]}),Ue=A&&U&&!_&&c?s??a.jsx(d.FuelGauge,{color:_?"var(--ddk-generic-color-white)":void 0,size:"small",value:q}):null,yt=A&&U&&!_&&c&&d.getFillColor(q)||void 0,Ce=m.ExtensionManager.executeDashboardKeyFactory(t)||"",Ze=p.useMemo(()=>g(Ne.id),[g]),_e=p.useMemo(()=>Ze.filter(se=>!!se.data).reduce((se,hn)=>(se[hn.data.dashboardKey]=hn.data,se),{}),[Ze]),we=!!_e[Ce],{HolderContent:ce,modalOptions:de}=Ft(t),le=oe.useExtensionComponent(Ne),eo=p.useMemo(()=>{var se;return ce?a.jsx(ce,{holder:t,onComplete:O}):we&&le?a.jsx(le,{module:(se=_e[Ce])==null?void 0:se.id,holder:t}):void 0},[ce,O,_e,we,t,Ce,le]),to=Le(S),no=a.jsx(Ha,{color:_?ie:Ve,children:v!=null&&v.isRemote?u("remote-nns-active"):_?l(to.summary,{context:S!=null&&S.deferred?"queued":void 0,data:$}):!h&&a.jsx(Xt,{size:"small",holder:t})}),{holderExperience:so,setHolderExperience:pn}=Re(t),{future:ze}=ne(S),oo=p.useCallback(()=>{y||t.sortedPumps.length<=0||(i==="technician"?T(!0):t.unassigned||t.removed?pn("rfid-override"):_&&(e==null||e(t)))},[y,t,i,pn,_,e]);return a.jsxs(a.Fragment,{children:[a.jsxs(d.Modal,{contain:!h,...de,show:C,onClose:O,children:[a.jsx(d.Header,{contain:h,showCloseButton:!0,title:xt,onClose:O,CloseButton:h?d.BackButton:void 0}),eo]}),a.jsx(p.Suspense,{children:so}),a.jsx(d.HolderDashboardCard,{avatar:Ke,headerBackgroundColor:gt,backgroundColor:Me,footer:no,cardId:t.path,errors:P,title:$e,indicatorColor:yt,disabled:y,body:Ue,showNavIcon:n,onCardSelect:oo},t.path),(S==null?void 0:S.future)&&a.jsx(V,{title:$e,future:ze,failureMessage:l(`troubles.${S.type}.error`,{context:ze==null?void 0:ze.reason})})]})}),ln=I.div`
172
172
  display: flex;
173
173
  flex-direction: var(--ddk-component-dashboard-card-flex-direction);
174
174
  row-gap: var(--ddk-component-dashboard-row-gap);
175
175
  column-gap: var(--ddk-component-dashboard-column-gap);
176
176
  height: 100%;
177
177
  user-select: none;
178
- `,Qa=m.kosComponent(({holder:t,showNavIcons:e})=>{const n=t.troubles[0],s=()=>{n!=null&&n.resolvable&&n.resolve()};return a.jsx(Us,{holder:t,showNavIcon:e,onHolderSelect:s},t.id)}),ei=m.kosComponent(({holders:t,showNavIcons:e,...n})=>{const s=p.useMemo(()=>t.map(o=>a.jsx(Qa,{holder:o,showNavIcons:!!e},o.id)),[t,e]);return a.jsx(dn,{...n,children:s})}),ti=m.KosLog.createLogger({name:"holder-group-view"});ti.debug("holder-group-view component loaded");const Kn=["water","carb","ns","nns"],ni=j.div`
178
+ `,Ga=m.kosComponent(({holder:t,showNavIcons:e})=>{const n=t.troubles[0],s=()=>{n!=null&&n.resolvable&&n.resolve()};return a.jsx(Vs,{holder:t,showNavIcon:e,onHolderSelect:s},t.id)}),Ya=m.kosComponent(({holders:t,showNavIcons:e,...n})=>{const s=p.useMemo(()=>t.map(o=>a.jsx(Ga,{holder:o,showNavIcons:!!e},o.id)),[t,e]);return a.jsx(ln,{...n,children:s})}),Ja=m.KosLog.createLogger({name:"holder-group-view"});Ja.debug("holder-group-view component loaded");const $n=["water","carb","ns","nns"],Qa=I.div`
179
179
  display: flex;
180
180
  flex-direction: column;
181
181
  overflow-y: auto;
182
182
  overflow-x: hidden;
183
183
  justify-content: space-between;
184
184
  height: 100%;
185
- `,Un=j.div`
185
+ `,Kn=I.div`
186
186
  align-items: start;
187
187
 
188
188
  display: flex;
@@ -192,25 +192,25 @@
192
192
  text-overflow: ellipsis;
193
193
  width: 100%;
194
194
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
195
- `,si=j.div`
195
+ `,ei=I.div`
196
196
  display: flex;
197
197
  align-items: center;
198
198
  justify-content: center;
199
199
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
200
- `,oi=j.div`
200
+ `,ti=I.div`
201
201
  font-size: var(--ddk-component-holder-card-footer-font-size);
202
202
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
203
- `,ri=t=>!t||t==="white",ai=t=>t?void 0:"white",Zs=m.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n})=>{var we,ce;const{model:s}=Oe(),{visibleTroubles:o,initialized:r}=ve(t),{t:c}=m.useKosTranslation(["troubles","common"]),{componentModeOverride:i}=l.useComponentConfigurationContext(),d=i==="compact",{getExtensions:u}=Fe(),f=(we=s==null?void 0:s.currentRole)==null?void 0:we.toLowerCase(),[h,g]=p.useState(!1),y=!!t.ingredientId,v=(o==null?void 0:o.length)??0,C=o==null?void 0:o[0],T=o?o.length>0:!1,N=T?`${C==null?void 0:C.color}`:void 0,O=ri(N),P=T?ai(O):y?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",S=l.useAbbreviation(t.name,i==="compact"),_=c(`common:macros.${t.name}`),$=c(`common:${t.ingredientName}`),U=y?Kn.includes(t.name)?"":` ${$}`:` ${c("common:macros.unassigned")}`,q=`${_}${U}`,Me=d?Kn.includes(t.name)?_:U:`${_} ${U}`,gt=i==="compact"&&a.jsx(si,{color:P,children:S}),Be=a.jsx(Un,{color:P,children:Me}),ie=a.jsx(Un,{children:q}),Ve=m.ExtensionManager.executeDashboardKeyFactory(t)||"",be=u(Ae.id).filter(le=>!!le.data).reduce((le,de)=>(le[de.data.dashboardKey]=de.data,le),{}),$e=!!be[Ve],{HolderContent:Ke,modalOptions:xt}=Ft(t),Ue=oe.useExtensionComponent(Ae),yt=Ke?a.jsx(Ke,{holder:t,onComplete:()=>g(!1)}):$e&&Ue?a.jsx(Ue,{module:(ce=be[Ve])==null?void 0:ce.id,holder:t}):null,Ce=Le(C),Ze=T?a.jsx(oi,{color:P,children:c(Ce.summary)}):null,_e=p.useCallback(()=>{t.sortedPumps.length>0&&(f==="technician"?g(!0):T&&(e==null||e(t)))},[T,t,e,f]);return a.jsxs(a.Fragment,{children:[a.jsx(l.HolderDashboardCard,{avatar:gt,backgroundColor:N,body:T?null:a.jsx(l.StatusIndicator,{size:"small",status:T?"pending":"completed"}),footer:Ze,cardId:t.path,errors:v,title:Be,showNavIcon:n,onCardSelect:_e},t.path),a.jsx(l.Modal,{contain:i!=="compact",...xt,show:h,onClose:()=>g(!1),children:a.jsxs(ni,{children:[a.jsx(l.Header,{contain:i==="compact",showCloseButton:!0,title:ie,onClose:()=>g(!1),CloseButton:i==="compact"?l.BackButton:void 0}),yt]})}),(C==null?void 0:C.future)&&a.jsx(V,{title:ie,future:C==null?void 0:C.future})]})}),ii=m.kosComponent(({holders:t,showNavIcons:e,...n})=>a.jsx(dn,{...n,children:t.map(s=>{const o=s.troubles[0];return a.jsx(Zs,{holder:s,showNavIcon:e,onHolderSelect:()=>{o.resolvable&&o.resolve()}},s.id)})})),ci=j(xe.MessageInformationIconWithBackground)`
203
+ `,ni=t=>!t||t==="white",si=t=>t?void 0:"white",$s=m.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n})=>{var we,ce;const{model:s}=Oe(),{visibleTroubles:o,initialized:r}=ve(t),{t:c}=m.useKosTranslation(["troubles","common"]),{componentModeOverride:i}=d.useComponentConfigurationContext(),l=i==="compact",{getExtensions:u}=Fe(),f=(we=s==null?void 0:s.currentRole)==null?void 0:we.toLowerCase(),[h,g]=p.useState(!1),y=!!t.ingredientId,v=(o==null?void 0:o.length)??0,C=o==null?void 0:o[0],T=o?o.length>0:!1,A=T?`${C==null?void 0:C.color}`:void 0,O=ni(A),P=T?si(O):y?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",S=d.useAbbreviation(t.name,i==="compact"),_=c(`common:macros.${t.name}`),$=c(`common:${t.ingredientName}`),U=y?$n.includes(t.name)?"":` ${$}`:` ${c("common:macros.unassigned")}`,q=`${_}${U}`,Me=l?$n.includes(t.name)?_:U:`${_} ${U}`,gt=i==="compact"&&a.jsx(ei,{color:P,children:S}),Be=a.jsx(Kn,{color:P,children:Me}),ie=a.jsx(Kn,{children:q}),Ve=m.ExtensionManager.executeDashboardKeyFactory(t)||"",be=u(Ne.id).filter(de=>!!de.data).reduce((de,le)=>(de[le.data.dashboardKey]=le.data,de),{}),$e=!!be[Ve],{HolderContent:Ke,modalOptions:xt}=Ft(t),Ue=oe.useExtensionComponent(Ne),yt=Ke?a.jsx(Ke,{holder:t,onComplete:()=>g(!1)}):$e&&Ue?a.jsx(Ue,{module:(ce=be[Ve])==null?void 0:ce.id,holder:t}):null,Ce=Le(C),Ze=T?a.jsx(ti,{color:P,children:c(Ce.summary)}):null,_e=p.useCallback(()=>{t.sortedPumps.length>0&&(f==="technician"?g(!0):T&&(e==null||e(t)))},[T,t,e,f]);return a.jsxs(a.Fragment,{children:[a.jsx(d.HolderDashboardCard,{avatar:gt,backgroundColor:A,body:T?null:a.jsx(d.StatusIndicator,{size:"small",status:T?"pending":"completed"}),footer:Ze,cardId:t.path,errors:v,title:Be,showNavIcon:n,onCardSelect:_e},t.path),a.jsx(d.Modal,{contain:i!=="compact",...xt,show:h,onClose:()=>g(!1),children:a.jsxs(Qa,{children:[a.jsx(d.Header,{contain:i==="compact",showCloseButton:!0,title:ie,onClose:()=>g(!1),CloseButton:i==="compact"?d.BackButton:void 0}),yt]})}),(C==null?void 0:C.future)&&a.jsx(V,{title:ie,future:C==null?void 0:C.future})]})}),oi=m.kosComponent(({holders:t,showNavIcons:e,...n})=>a.jsx(ln,{...n,children:t.map(s=>{const o=s.troubles[0];return a.jsx($s,{holder:s,showNavIcon:e,onHolderSelect:()=>{o.resolvable&&o.resolve()}},s.id)})})),ri=I(xe.MessageInformationIconWithBackground)`
204
204
  width: var(--ddk-component-macro-card-unavailable-icon-size);
205
205
  height: var(--ddk-component-macro-card-unavailable-icon-size);
206
- `,li=j(l.UtilityModalHeading)`
206
+ `,ai=I(d.UtilityModalHeading)`
207
207
  text-align: center;
208
208
  font-size: var(--ddk-component-sub-modal-heading-font-size-medium);
209
- `,di=j.div`
209
+ `,ii=I.div`
210
210
  height: 100%;
211
211
  overflow-y: auto;
212
212
  width: 100%;
213
- `,ui=j.div`
213
+ `,ci=I.div`
214
214
  display: grid;
215
215
  gap: var(--ddk-component-macro-setup-card-gap);
216
216
 
@@ -220,7 +220,7 @@
220
220
  justify-content: center;
221
221
  width: 100%;
222
222
  user-select: none;
223
- `,mi=t=>{const{componentModeOverride:e}=l.useComponentConfigurationContext();return a.jsx(ui,{compact:e==="compact",...t})},pi=j.div`
223
+ `,di=t=>{const{componentModeOverride:e}=d.useComponentConfigurationContext();return a.jsx(ci,{compact:e==="compact",...t})},li=I.div`
224
224
  align-items: center;
225
225
 
226
226
  background: ${t=>t.selected?"var(--ddk-generic-color-grey-5)":"var(--ddk-generic-color-white)"};
@@ -243,32 +243,32 @@
243
243
  overflow-wrap: anywhere;
244
244
  padding: var(--ddk-component-macro-setup-card-header-padding-md);
245
245
  text-align: center;
246
- `,hi=j.div`
246
+ `,ui=I.div`
247
247
  align-items: center;
248
248
  display: flex;
249
249
  flex-direction: column;
250
250
  gap: 32px;
251
251
  height: 100%;
252
252
  justify-content: center;
253
- `,fi=j.div`
253
+ `,mi=I.div`
254
254
  color: var(--ddk-component-macro-card-unavailable-font-color);
255
255
  font-size: var(--ddk-component-macro-card-unavailable-font-size);
256
256
  font-weight: var(--ddk-component-macro-card-unavailable-font-weight);
257
- `,un=Ns(({holder:t,onComplete:e,macroAssignment:n,showCloseButton:s=!0})=>{const{t:o}=m.useKosTranslation("setup"),{t:r}=m.useKosTranslation("common"),{componentModeOverride:c}=l.useComponentConfigurationContext(),[i,d]=p.useState(t.ingredient),u=j.div`
257
+ `,un=js(({holder:t,onComplete:e,macroAssignment:n,showCloseButton:s=!0})=>{const{t:o}=m.useKosTranslation("setup"),{t:r}=m.useKosTranslation("common"),{componentModeOverride:c}=d.useComponentConfigurationContext(),[i,l]=p.useState(t.ingredient),u=I.div`
258
258
  display: flex;
259
259
  flex-direction: column;
260
260
  gap: 24px;
261
261
  height: 100%;
262
- `;return a.jsxs(u,{children:[a.jsx(l.Content,{children:n.hasMacroIngredients?a.jsxs(a.Fragment,{children:[c==="standard"&&a.jsx(li,{children:o("select-and-assign-ingredients-for",{data:{name:r(`macros.${t.name}`)}})}),a.jsx(di,{children:a.jsx(mi,{children:n.macroIngredients.map(f=>a.jsx(pi,{selected:(i==null?void 0:i.id)===f.id,onPointerDown:()=>{i===f||d(f)},children:f.name},f.id))})})]}):a.jsxs(hi,{children:[a.jsx(ci,{}),a.jsx(fi,{children:o("no-ingredients-available-for-assignment")})]})}),a.jsx(l.Footer,{children:n.hasMacroIngredients?a.jsxs(a.Fragment,{children:[c==="standard"&&s&&a.jsx(l.Button,{onPointerDown:()=>{e==null||e()},children:r("close")}),a.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:r("assignIngredient")})]}):s!==!1&&a.jsx(l.Button,{mode:"primary",onPointerDown:()=>{e==null||e()},children:r("proceed")})})]})}),gi=j.div`
262
+ `;return a.jsxs(u,{children:[a.jsx(d.Content,{children:n.hasMacroIngredients?a.jsxs(a.Fragment,{children:[c==="standard"&&a.jsx(ai,{children:o("select-and-assign-ingredients-for",{data:{name:r(`macros.${t.name}`)}})}),a.jsx(ii,{children:a.jsx(di,{children:n.macroIngredients.map(f=>a.jsx(li,{selected:(i==null?void 0:i.id)===f.id,onPointerDown:()=>{i===f||l(f)},children:f.name},f.id))})})]}):a.jsxs(ui,{children:[a.jsx(ri,{}),a.jsx(mi,{children:o("no-ingredients-available-for-assignment")})]})}),a.jsx(d.Footer,{children:n.hasMacroIngredients?a.jsxs(a.Fragment,{children:[c==="standard"&&s&&a.jsx(d.Button,{onPointerDown:()=>{e==null||e()},children:r("close")}),a.jsx(d.Button,{mode:"primary",disabled:!i||i.id===t.ingredientId,onPointerDown:async()=>{await t.assignIngredient(i==null?void 0:i.id),e==null||e()},children:r("assignIngredient")})]}):s!==!1&&a.jsx(d.Button,{mode:"primary",onPointerDown:()=>{e==null||e()},children:r("proceed")})})]})}),pi=I.div`
263
263
  display: flex;
264
264
  flex-direction: column;
265
265
  gap: 24px;
266
266
  padding: 24px;
267
- `,xi=jt.withAssembly(({assembly:t,showHeading:e})=>a.jsx(zs,{iceAgitator:t.iceAgitator,showHeading:e})),zs=m.kosComponent(({iceAgitator:t,showHeading:e})=>{const{t:n}=m.useKosTranslation("about"),s=zn.useLocation(),{componentModeOverride:o}=l.useComponentConfigurationContext(),r=(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?a.jsxs(l.TabContainer,{children:[e&&a.jsx(l.SettingsSubheading,{children:n("ice-settings","Ice Settings")}),o==="compact"?a.jsx(hs,{configProperty:t.type,onChange:i=>t.updateIceType(i),options:r,label:n("ice-type","Ice Type")}):a.jsx(tt,{configProperty:t.type,onSave:i=>t.updateIceType(i),items:r,label:n("ice-type","Ice Type")||void 0}),a.jsx(me,{configProperty:t.durationSec,label:n("agitation-duration","Agitation duration")||void 0}),a.jsx(me,{configProperty:t.inactivitySec,label:n("agitate-inactivity","Agitate after inactivity")||void 0}),a.jsx(me,{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"))&&a.jsx(l.Footer,{children:a.jsx(l.Button,{onPointerDown:c,children:n("reset")})})]}):"Ice model not loaded..."}),yi=m.kosComponent(({cardModel:t})=>{m.KosLog.debug("Agitator",t.path);const{t:e}=m.useKosTranslation(["agitator","common"]),n=p.useCallback(r=>{r==="agitate"?t==null||t.testAgitate():r==="gate"?t==null||t.testGate():r==="pour"?t==null||t.pourIce():r==="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}})},
268
- ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue}})}`},{name:e("agitator:ice-type"),value:t.type.displayValue}],o=t.isAgitating||t.isIceChuteOpen;return a.jsxs(a.Fragment,{children:[a.jsxs(l.Content,{children:[a.jsx(l.FrameContainer,{name:"Ice Properties",children:a.jsx(l.FrameBody,{keyList:["name","value"],tableData:s})}),a.jsx(l.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")}),a.jsx(l.InfoCard,{label:"Ice Chute Open",value:t.isIceChuteOpen?e("common:yes"):e("common:no")})]}),a.jsxs(l.Footer,{children:[a.jsx(l.Button,{disabled:o,onPointerDown:()=>n("agitate"),children:e("action.label",{context:"agitator"})}),a.jsx(l.Button,{disabled:o,onPointerDown:()=>n("gate"),children:e("action.label",{context:"gate"})}),a.jsx(l.Button,{disabled:o,onPointerUp:()=>n("cancelPour"),onPointerDown:()=>n("pour"),children:e("action.label",{context:"pour"})})]}),t.agitateFuture&&a.jsx(V,{title:e("testing"),future:t.agitateFuture}),t.gateFuture&&a.jsx(V,{title:e("testing"),future:t.gateFuture})]})}),vi=j.div`
267
+ `,hi=jt.withAssembly(({assembly:t,showHeading:e})=>a.jsx(Ks,{iceAgitator:t.iceAgitator,showHeading:e})),Ks=m.kosComponent(({iceAgitator:t,showHeading:e})=>{const{t:n}=m.useKosTranslation("about"),s=Zn.useLocation(),{componentModeOverride:o}=d.useComponentConfigurationContext(),r=(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?a.jsxs(d.TabContainer,{children:[e&&a.jsx(d.SettingsSubheading,{children:n("ice-settings","Ice Settings")}),o==="compact"?a.jsx(ps,{configProperty:t.type,onChange:i=>t.updateIceType(i),options:r,label:n("ice-type","Ice Type")}):a.jsx(tt,{configProperty:t.type,onSave:i=>t.updateIceType(i),items:r,label:n("ice-type","Ice Type")||void 0}),a.jsx(me,{configProperty:t.durationSec,label:n("agitation-duration","Agitation duration")||void 0}),a.jsx(me,{configProperty:t.inactivitySec,label:n("agitate-inactivity","Agitate after inactivity")||void 0}),a.jsx(me,{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"))&&a.jsx(d.Footer,{children:a.jsx(d.Button,{onPointerDown:c,children:n("reset")})})]}):"Ice model not loaded..."}),fi=m.kosComponent(({cardModel:t})=>{m.KosLog.debug("Agitator",t.path);const{t:e}=m.useKosTranslation(["agitator","common"]),n=p.useCallback(r=>{r==="agitate"?t==null||t.testAgitate():r==="gate"?t==null||t.testGate():r==="pour"?t==null||t.pourIce():r==="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}})},
268
+ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue}})}`},{name:e("agitator:ice-type"),value:t.type.displayValue}],o=t.isAgitating||t.isIceChuteOpen;return a.jsxs(a.Fragment,{children:[a.jsxs(d.Content,{children:[a.jsx(d.FrameContainer,{name:"Ice Properties",children:a.jsx(d.FrameBody,{keyList:["name","value"],tableData:s})}),a.jsx(d.InfoCard,{label:"Agitating",value:t.isAgitating?e("common:yes"):e("common:no")}),a.jsx(d.InfoCard,{label:"Ice Chute Open",value:t.isIceChuteOpen?e("common:yes"):e("common:no")})]}),a.jsxs(d.Footer,{children:[a.jsx(d.Button,{disabled:o,onPointerDown:()=>n("agitate"),children:e("action.label",{context:"agitator"})}),a.jsx(d.Button,{disabled:o,onPointerDown:()=>n("gate"),children:e("action.label",{context:"gate"})}),a.jsx(d.Button,{disabled:o,onPointerUp:()=>n("cancelPour"),onPointerDown:()=>n("pour"),children:e("action.label",{context:"pour"})})]}),t.agitateFuture&&a.jsx(V,{title:e("testing"),future:t.agitateFuture}),t.gateFuture&&a.jsx(V,{title:e("testing"),future:t.gateFuture})]})}),gi=I.div`
269
269
  font-size: var(--ddk-component-holder-card-footer-font-size);
270
270
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
271
- `,bi=m.kosComponent(t=>{m.KosLog.debug(`summary component loaded for holder ${t}`),m.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=m.useKosTranslation("common");return a.jsxs(a.Fragment,{children:[a.jsx(l.StatusIndicator,{size:"small",status:"completed"}),t.cardModel.isAgitating&&a.jsx(vi,{children:e("agitating")})]})}),Ci=m.kosComponent(({showHeading:t})=>{var d,u,f,h,g,y,v,C;const{t:e}=m.useKosTranslation("region"),{model:n}=mt(),{regionModel:s}=m.useKosRegions(),o=p.useCallback(T=>({id:T,label:e(`locale.country.${T}`)}),[e]),{selectedRegion:r,updateRegion:c,regionSelectProps:i}=m.useKosRegions(o);return a.jsxs(l.TabContainer,{children:[t&&a.jsx(l.SettingsSubheading,{children:e("localization","Localization")}),a.jsx(l.PickerCard,{cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,closeButtonLabel:e("close","Close")||void 0,displayValue:e(`locale.country.${r}`)||void 0,items:i.options,label:e("country","Country"),loop:!1,onSave:T=>c(T),proceedButtonLabel:e("save","Save")||void 0,selectedItemId:r}),((d=s==null?void 0:s.unitSystemOptions)==null?void 0:d.length)&&a.jsx(l.SwitchCard,{label:e("units-of-measurement","Units of Measurement"),options:(u=s==null?void 0:s.unitSystemOptions)==null?void 0:u.map(T=>({id:T.id,label:`${e(`locale.unit.${T.id}`)}/${e(`locale.units.${T.id}`)}`})),onChange:T=>s==null?void 0:s.setSelectedUnitSystem(String(T)),value:String(s==null?void 0:s.selectedUnitSystem).toLowerCase()}),a.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:(v=(y=(g=n==null?void 0:n.ncuiLanguageData)==null?void 0:g.data)==null?void 0:y.languages)==null?void 0:v.map(({locale:T,name:N})=>({id:T,label:N})),label:e("non-consumer-language","Non-Consumer Language"),loop:!1,onSave:T=>{var N;return(N=n==null?void 0:n.ncuiLanguage)==null?void 0:N.updateProperty(T)},proceedButtonLabel:e("save","Save")||void 0,selectedItemId:(C=n==null?void 0:n.ncuiLanguage)==null?void 0:C.displayValue})]})});j.div`
271
+ `,xi=m.kosComponent(t=>{m.KosLog.debug(`summary component loaded for holder ${t}`),m.KosLog.info(`render agitator summary for holder ${t.cardModel.path}`);const{t:e}=m.useKosTranslation("common");return a.jsxs(a.Fragment,{children:[a.jsx(d.StatusIndicator,{size:"small",status:"completed"}),t.cardModel.isAgitating&&a.jsx(gi,{children:e("agitating")})]})}),yi=m.kosComponent(({showHeading:t})=>{var l,u,f,h,g,y,v,C;const{t:e}=m.useKosTranslation("region"),{model:n}=mt(),{regionModel:s}=m.useKosRegions(),o=p.useCallback(T=>({id:T,label:e(`locale.country.${T}`)}),[e]),{selectedRegion:r,updateRegion:c,regionSelectProps:i}=m.useKosRegions(o);return a.jsxs(d.TabContainer,{children:[t&&a.jsx(d.SettingsSubheading,{children:e("localization","Localization")}),a.jsx(d.PickerCard,{cancelButtonLabel:e("discard-changes","Discard Changes")||void 0,closeButtonLabel:e("close","Close")||void 0,displayValue:e(`locale.country.${r}`)||void 0,items:i.options,label:e("country","Country"),loop:!1,onSave:T=>c(T),proceedButtonLabel:e("save","Save")||void 0,selectedItemId:r}),((l=s==null?void 0:s.unitSystemOptions)==null?void 0:l.length)&&a.jsx(d.SwitchCard,{label:e("units-of-measurement","Units of Measurement"),options:(u=s==null?void 0:s.unitSystemOptions)==null?void 0:u.map(T=>({id:T.id,label:`${e(`locale.unit.${T.id}`)}/${e(`locale.units.${T.id}`)}`})),onChange:T=>s==null?void 0:s.setSelectedUnitSystem(String(T)),value:String(s==null?void 0:s.selectedUnitSystem).toLowerCase()}),a.jsx(d.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:(v=(y=(g=n==null?void 0:n.ncuiLanguageData)==null?void 0:g.data)==null?void 0:y.languages)==null?void 0:v.map(({locale:T,name:A})=>({id:T,label:A})),label:e("non-consumer-language","Non-Consumer Language"),loop:!1,onSave:T=>{var A;return(A=n==null?void 0:n.ncuiLanguage)==null?void 0:A.updateProperty(T)},proceedButtonLabel:e("save","Save")||void 0,selectedItemId:(C=n==null?void 0:n.ncuiLanguage)==null?void 0:C.displayValue})]})});I.div`
272
272
  display: flex;
273
273
  font-size: var(--ddk-generic-font-size-x-small);
274
274
  font-weight: normal;
@@ -302,11 +302,11 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
302
302
  display: flex;
303
303
  justify-content: flex-end;
304
304
  }
305
- `;const _i=j.div`
305
+ `;const vi=I.div`
306
306
  display: flex;
307
307
  align-items: center;
308
308
  justify-content: flex-end;
309
- `,wi=({item:t,valueKey:e})=>{const{label:n,value:s}=t;if(e==="label")return a.jsx("div",{children:a.jsx("b",{children:n})});if(e==="value")return a.jsx(_i,{children:s})},ki=({groupName:t,networkTestContainer:e})=>{var s;const{t:n}=m.useKosTranslation("connectivity");return((s=e==null?void 0:e.models.getIndexByKey("group",t))==null?void 0:s.map(o=>{const r=t==="interface",c=r?o.results.map(i=>({label:i.name,value:i.val})):[];return r?a.jsx(l.Table,{CellRenderer:wi,data:c,dataKeys:["label","value"],heading:o.name}):a.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)}))||[]},Si=As(ki),Ti=j.div`
309
+ `,bi=({item:t,valueKey:e})=>{const{label:n,value:s}=t;if(e==="label")return a.jsx("div",{children:a.jsx("b",{children:n})});if(e==="value")return a.jsx(vi,{children:s})},Ci=({groupName:t,networkTestContainer:e})=>{var s;const{t:n}=m.useKosTranslation("connectivity");return((s=e==null?void 0:e.models.getIndexByKey("group",t))==null?void 0:s.map(o=>{const r=t==="interface",c=r?o.results.map(i=>({label:i.name,value:i.val})):[];return r?a.jsx(d.Table,{CellRenderer:bi,data:c,dataKeys:["label","value"],heading:o.name}):a.jsx(d.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)}))||[]},_i=Es(Ci),wi=I.div`
310
310
  background-color: var(--ddk-generic-color-grey-80);
311
311
  color: var(--ddk-generic-color-grey-5);
312
312
  border-radius: 5px;
@@ -315,58 +315,58 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
315
315
  align-items: center;
316
316
  justify-content: center;
317
317
  font-size: var(--ddk-generic-font-size-xx-small);
318
- `,Hs=m.kosComponent(({showAction:t=!0,trouble:e,showHolder:n})=>{var T;const{t:s}=m.useKosTranslation(["troubles"]),{model:o}=ht(),r=o==null?void 0:o.currentRole,c=pt(e),{action:i,label:d,progress:u}=Le(e),f=e.resolvable??!1,{future:h}=ne(e),g=(T=e==null?void 0:e.data)!=null&&T.holderNames&&e.data.holderNames.length>0?a.jsx(Ti,{children:e.data.holderNames[0]}):null,y=(e==null?void 0:e.color)??"orange",v=(e==null?void 0:e.shouldDefer)??!1,C=(e==null?void 0:e.deferred)??!1;return a.jsxs(a.Fragment,{children:[a.jsx(l.NotificationCard,{label:s(d,{context:r==null?void 0:r.toLowerCase(),data:c}),indicatorColor:y,buttonLabel:t?C?"Queued":v?"Queue":s(i,{context:r,defaultValue:""}):void 0,date:e.createTime,prefix:n?g:void 0,onAction:t&&f&&!C?()=>{e.resolve()}:void 0}),h&&a.jsx(V,{title:s(u,{context:r}),future:C?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}})})]})}),Ii=({viewContainerId:t,extensionPointId:e,tabs:n,...s})=>{const{getExtensions:o}=oe.useKosPluginsContext(),r=o(t),c=o(e).reduce((h,g)=>(h[g.id]=g,h),{}),i=r.map(h=>h.data.namespace),{t:d}=m.useKosTranslation(["",...new Set(i)]),u=r.map(h=>{const g=[...h.data.settings].map(y=>{const v=c[y];return a.jsxs(l.TabContainer,{children:[a.jsx(l.SettingsSubheading,{children:d(`${v.data.namespace}:${v.data.title}`)}),a.jsx(oe.DynamicComponent,{extension:e,module:y})]},v.id)});return{id:h.id,label:d(`${h.data.namespace}:${h.data.title}`),content:a.jsx(l.TabViewLayout,{children:g})}}),f=[...n,...u];return a.jsx(l.TabRouter,{...s,tabs:f})},ft=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),{componentModeOverride:n}=l.useComponentConfigurationContext(),s=n==="compact",{visibleTroubles:o,initialized:r}=ve(t),i=((o==null?void 0:o.length)??0)>0,d=!!t.troublesByType.FlushTrouble,u=!!t.troublesByType.PrimeTrouble,f=!!t.troublesByType.PurgeTrouble,h=d?t.troublesByType.FlushTrouble[0]:u?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,[v,C]=De(t),T=p.useCallback(N=>{g?h==null||h.resolve():C(N)},[C,g,h]);return i&&r&&s?a.jsxs(a.Fragment,{children:[d?a.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>T("flush"),children:e("flush",{context:y?"queued":""})}):f?a.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>T("purge"),children:e("purge",{context:y?"queued":""})}):u?a.jsx(l.Button,{disabled:y,mode:"primary",onPointerDown:()=>T("prime"),children:e("prime",{context:y?"queued":""})}):null,v&&a.jsx(V,{...v})]}):null}),ae=({holder:t,filter:e})=>{const{componentModeOverride:n}=l.useComponentConfigurationContext(),s=n==="standard",{visibleTroubles:o,initialized:r}=ve(t),c=e?o==null?void 0:o.filter(e):o;return((c==null?void 0:c.length)??0)>0&&r&&(o==null?void 0:o.map(u=>a.jsx(Hs,{showAction:s,trouble:u},u.id)))},ji=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),[n,s]=De(t),[o,r]=p.useState();p.useEffect(()=>{async function g(){if(t.ingredientId!==void 0){const y=await t.resolveIntentVolume("CALIBRATE");r(Math.round(y.volume))}}g()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0,{holderExperience:d,setHolderExperience:u,currentExperienceId:f}=Re(t);return c||f==="replace-line"?a.jsxs(a.Fragment,{children:[a.jsx(l.Content,{contain:!0,children:a.jsx(ae,{holder:t})}),a.jsxs(l.Footer,{children:[a.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),a.jsx(l.Button,{onPointerDown:()=>u("replace-line"),children:e("replace-line")}),a.jsx(ye,{disabled:!c,model:t}),a.jsx(ft,{holder:t})]}),a.jsx(p.Suspense,{children:d}),n&&a.jsx(V,{...n})]}):a.jsx(un,{showCloseButton:!1,holder:t})}),Ei=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),[n,s]=De(t),[o,r]=p.useState();p.useEffect(()=>{async function d(){if(t.ingredientId!==void 0){const u=await t.resolveIntentVolume("CALIBRATE");r(Math.round(u.volume))}}d()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0;return c?a.jsxs(a.Fragment,{children:[a.jsx(l.Content,{contain:!0,children:a.jsx(ae,{holder:t})}),a.jsxs(l.Footer,{children:[a.jsx(l.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),a.jsx(ye,{disabled:!c,model:t}),a.jsx(ft,{holder:t})]}),n&&a.jsx(V,{...n})]}):a.jsx(un,{showCloseButton:!1,holder:t})}),Pi=j.div`
318
+ `,Us=m.kosComponent(({showAction:t=!0,trouble:e,showHolder:n})=>{var T;const{t:s}=m.useKosTranslation(["troubles"]),{model:o}=ht(),r=o==null?void 0:o.currentRole,c=pt(e),{action:i,label:l,progress:u}=Le(e),f=e.resolvable??!1,{future:h}=ne(e),g=(T=e==null?void 0:e.data)!=null&&T.holderNames&&e.data.holderNames.length>0?a.jsx(wi,{children:e.data.holderNames[0]}):null,y=(e==null?void 0:e.color)??"orange",v=(e==null?void 0:e.shouldDefer)??!1,C=(e==null?void 0:e.deferred)??!1;return a.jsxs(a.Fragment,{children:[a.jsx(d.NotificationCard,{label:s(l,{context:r==null?void 0:r.toLowerCase(),data:c}),indicatorColor:y,buttonLabel:t?C?"Queued":v?"Queue":s(i,{context:r,defaultValue:""}):void 0,date:e.createTime,prefix:n?g:void 0,onAction:t&&f&&!C?()=>{e.resolve()}:void 0}),h&&a.jsx(V,{title:s(u,{context:r}),future:C?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}})})]})}),ki=({viewContainerId:t,extensionPointId:e,tabs:n,...s})=>{const{getExtensions:o}=oe.useKosPluginsContext(),r=o(t),c=o(e).reduce((h,g)=>(h[g.id]=g,h),{}),i=r.map(h=>h.data.namespace),{t:l}=m.useKosTranslation(["",...new Set(i)]),u=r.map(h=>{const g=[...h.data.settings].map(y=>{const v=c[y];return a.jsxs(d.TabContainer,{children:[a.jsx(d.SettingsSubheading,{children:l(`${v.data.namespace}:${v.data.title}`)}),a.jsx(oe.DynamicComponent,{extension:e,module:y})]},v.id)});return{id:h.id,label:l(`${h.data.namespace}:${h.data.title}`),content:a.jsx(d.TabViewLayout,{children:g})}}),f=[...n,...u];return a.jsx(d.TabRouter,{...s,tabs:f})},ft=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),{componentModeOverride:n}=d.useComponentConfigurationContext(),s=n==="compact",{visibleTroubles:o,initialized:r}=ve(t),i=((o==null?void 0:o.length)??0)>0,l=!!t.troublesByType.FlushTrouble,u=!!t.troublesByType.PrimeTrouble,f=!!t.troublesByType.PurgeTrouble,h=l?t.troublesByType.FlushTrouble[0]:u?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,[v,C]=De(t),T=p.useCallback(A=>{g?h==null||h.resolve():C(A)},[C,g,h]);return i&&r&&s?a.jsxs(a.Fragment,{children:[l?a.jsx(d.Button,{disabled:y,mode:"primary",onPointerDown:()=>T("flush"),children:e("flush",{context:y?"queued":""})}):f?a.jsx(d.Button,{disabled:y,mode:"primary",onPointerDown:()=>T("purge"),children:e("purge",{context:y?"queued":""})}):u?a.jsx(d.Button,{disabled:y,mode:"primary",onPointerDown:()=>T("prime"),children:e("prime",{context:y?"queued":""})}):null,v&&a.jsx(V,{...v})]}):null}),ae=({holder:t,filter:e})=>{const{componentModeOverride:n}=d.useComponentConfigurationContext(),s=n==="standard",{visibleTroubles:o,initialized:r}=ve(t),c=e?o==null?void 0:o.filter(e):o;return((c==null?void 0:c.length)??0)>0&&r&&(o==null?void 0:o.map(u=>a.jsx(Us,{showAction:s,trouble:u},u.id)))},Si=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),[n,s]=De(t),[o,r]=p.useState();p.useEffect(()=>{async function g(){if(t.ingredientId!==void 0){const y=await t.resolveIntentVolume("CALIBRATE");r(Math.round(y.volume))}}g()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0,{holderExperience:l,setHolderExperience:u,currentExperienceId:f}=Re(t);return c||f==="replace-line"?a.jsxs(a.Fragment,{children:[a.jsx(d.Content,{contain:!0,children:a.jsx(ae,{holder:t})}),a.jsxs(d.Footer,{children:[a.jsx(d.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),a.jsx(d.Button,{onPointerDown:()=>u("replace-line"),children:e("replace-line")}),a.jsx(ye,{disabled:!c,model:t}),a.jsx(ft,{holder:t})]}),a.jsx(p.Suspense,{children:l}),n&&a.jsx(V,{...n})]}):a.jsx(un,{showCloseButton:!1,holder:t})}),Ti=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),[n,s]=De(t),[o,r]=p.useState();p.useEffect(()=>{async function l(){if(t.ingredientId!==void 0){const u=await t.resolveIntentVolume("CALIBRATE");r(Math.round(u.volume))}}l()},[t,t.ingredientId]);const c=t.ingredientId!==void 0,i=o&&o>0;return c?a.jsxs(a.Fragment,{children:[a.jsx(d.Content,{contain:!0,children:a.jsx(ae,{holder:t})}),a.jsxs(d.Footer,{children:[a.jsx(d.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?e("intentPour",{data:{volume:o}}):e("calibrate")}),a.jsx(ye,{disabled:!c,model:t}),a.jsx(ft,{holder:t})]}),n&&a.jsx(V,{...n})]}):a.jsx(un,{showCloseButton:!1,holder:t})}),Ii=I.div`
319
319
  display: flex;
320
320
  flex-direction: column;
321
321
  gap: var(--ddk-component-super-pump-container-gap);
322
- `,Ni=j.div`
322
+ `,ji=I.div`
323
323
  display: flex;
324
324
  flex-direction: column;
325
325
  gap: var(--ddk-component-cartridge-container-gap);
326
- `,Ws=m.kosComponent(({holder:t})=>{const e=Te.useFreestyleAssemblyContext(),{t:n}=m.useKosTranslation("common"),[s,o]=p.useState("all"),r=e==null?void 0:e.cartridgeAgitatorModels[0],c=!!t.ingredientId,i=t.pumps.getModel(s),d=m.getKosCompanionModel(t,Te.FreestyleHolder.type),u=!!(d!=null&&d.agitated),{holderExperience:f,setHolderExperience:h}=Re(t,i),g=p.useCallback(N=>{o(N.id)},[]),y=t.hasFuelGuage,v=t.fillPercent,{future:C}=ne(r),T=p.useCallback(N=>N.data.pumpPath===(i==null?void 0:i.path),[i==null?void 0:i.path]);return a.jsxs(a.Fragment,{children:[a.jsxs(Pi,{children:[a.jsxs(l.Content,{contain:!0,children:[c&&y&&a.jsxs(Ni,{children:[a.jsx(l.FuelGauge,{size:"large",value:v,showBarsOverride:!0}),a.jsx(Xt,{holder:t})]}),a.jsx(l.Tabs,{activeTab:s,contain:!1,tabs:[{id:"all",label:n("all"),content:a.jsx(ae,{holder:t})},...t.pumps.data.filter(N=>!N.virtual).map(N=>({id:N.id,label:n(`macros.${N.name}`),content:a.jsx(ae,{holder:N,filter:T})}))],onChange:g,showBackground:!1})]}),a.jsxs(l.Footer,{children:[i?a.jsxs(a.Fragment,{children:[a.jsx(l.Button,{onPointerDown:()=>h("replace-pump"),children:n("replace-pump")}),a.jsx(l.Button,{onPointerDown:()=>h("calibrateSPM"),children:n("calibrate")})]}):a.jsxs(a.Fragment,{children:[!c&&a.jsx(l.Button,{onPointerDown:()=>h("rfid-override"),children:n("rfid-override")}),a.jsx(l.Button,{onPointerDown:()=>h("replace-line"),children:n("replace-line")}),u&&a.jsx(l.Button,{onPointerDown:()=>r==null?void 0:r.testAgitate(),children:n("agitate")})]}),a.jsx(ye,{disabled:!c,model:i||t})]})]}),a.jsx(p.Suspense,{children:f}),C&&a.jsx(V,{title:n("agitating"),future:C})]})}),Ai=m.kosComponent(({holder:t})=>a.jsxs(a.Fragment,{children:[a.jsx(ae,{holder:t}),a.jsxs(l.Footer,{children:[a.jsx(ye,{model:t}),a.jsx(ft,{holder:t})]})]})),Di=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),[n,s]=De(t),{holderExperience:o,setHolderExperience:r}=Re(t);return a.jsxs(a.Fragment,{children:[a.jsx(ae,{holder:t}),a.jsxs(l.Footer,{children:[a.jsx(ye,{model:t}),a.jsx(l.Button,{onPointerDown:()=>s("high-flow-test"),children:e("high-flow-test")}),a.jsx(l.Button,{onPointerDown:()=>s("low-flow-test"),children:e("low-flow-test")}),a.jsx(l.Button,{onPointerDown:()=>r("diagnostics"),children:e("diagnostics")}),a.jsx(l.Button,{onPointerDown:()=>r("calibrate"),children:e("calibrate")})]}),a.jsx(p.Suspense,{children:o}),n&&a.jsx(V,{...n})]})}),Oi=j.section`
326
+ `,Zs=m.kosComponent(({holder:t})=>{const e=Te.useFreestyleAssemblyContext(),{t:n}=m.useKosTranslation("common"),[s,o]=p.useState("all"),r=e==null?void 0:e.cartridgeAgitatorModels[0],c=!!t.ingredientId,i=t.pumps.getModel(s),l=m.getKosCompanionModel(t,Te.FreestyleHolder.type),u=!!(l!=null&&l.agitated),{holderExperience:f,setHolderExperience:h}=Re(t,i),g=p.useCallback(A=>{o(A.id)},[]),y=t.hasFuelGuage,v=t.fillPercent,{future:C}=ne(r),T=p.useCallback(A=>A.data.pumpPath===(i==null?void 0:i.path),[i==null?void 0:i.path]);return a.jsxs(a.Fragment,{children:[a.jsxs(Ii,{children:[a.jsxs(d.Content,{contain:!0,children:[c&&y&&a.jsxs(ji,{children:[a.jsx(d.FuelGauge,{size:"large",value:v,showBarsOverride:!0}),a.jsx(Xt,{holder:t})]}),a.jsx(d.Tabs,{activeTab:s,contain:!1,tabs:[{id:"all",label:n("all"),content:a.jsx(ae,{holder:t})},...t.pumps.data.filter(A=>!A.virtual).map(A=>({id:A.id,label:n(`macros.${A.name}`),content:a.jsx(ae,{holder:A,filter:T})}))],onChange:g,showBackground:!1})]}),a.jsxs(d.Footer,{children:[i?a.jsxs(a.Fragment,{children:[a.jsx(d.Button,{onPointerDown:()=>h("replace-pump"),children:n("replace-pump")}),a.jsx(d.Button,{onPointerDown:()=>h("calibrateSPM"),children:n("calibrate")})]}):a.jsxs(a.Fragment,{children:[!c&&a.jsx(d.Button,{onPointerDown:()=>h("rfid-override"),children:n("rfid-override")}),a.jsx(d.Button,{onPointerDown:()=>h("replace-line"),children:n("replace-line")}),u&&a.jsx(d.Button,{onPointerDown:()=>r==null?void 0:r.testAgitate(),children:n("agitate")})]}),a.jsx(ye,{disabled:!c,model:i||t})]})]}),a.jsx(p.Suspense,{children:f}),C&&a.jsx(V,{title:n("agitating"),future:C})]})}),Ei=m.kosComponent(({holder:t})=>a.jsxs(a.Fragment,{children:[a.jsx(ae,{holder:t}),a.jsxs(d.Footer,{children:[a.jsx(ye,{model:t}),a.jsx(ft,{holder:t})]})]})),Pi=m.kosComponent(({holder:t})=>{const{t:e}=m.useKosTranslation("common"),[n,s]=De(t),{holderExperience:o,setHolderExperience:r}=Re(t);return a.jsxs(a.Fragment,{children:[a.jsx(ae,{holder:t}),a.jsxs(d.Footer,{children:[a.jsx(ye,{model:t}),a.jsx(d.Button,{onPointerDown:()=>s("high-flow-test"),children:e("high-flow-test")}),a.jsx(d.Button,{onPointerDown:()=>s("low-flow-test"),children:e("low-flow-test")}),a.jsx(d.Button,{onPointerDown:()=>r("diagnostics"),children:e("diagnostics")}),a.jsx(d.Button,{onPointerDown:()=>r("calibrate"),children:e("calibrate")})]}),a.jsx(p.Suspense,{children:o}),n&&a.jsx(V,{...n})]})}),Ai=I.section`
327
327
  align-items: center;
328
328
  display: flex;
329
329
  flex-direction: column;
330
330
  gap: 32px;
331
331
  height: 100%;
332
332
  justify-content: space-between;
333
- `,Ri=j.div`
333
+ `,Ni=I.div`
334
334
  display: flex;
335
335
  gap: 32px;
336
336
  flex-direction: column;
337
337
  align-items: center;
338
338
  padding: 32px;
339
- `,Li=j.div`
339
+ `,Di=I.div`
340
340
  display: flex;
341
341
  flex-direction: column;
342
342
  gap: 12px;
343
343
  text-align: center;
344
- `,Fi=({onComplete:t})=>{const{t:e}=m.useKosTranslation("reboot"),[n,s]=p.useState(!1),{model:o}=ut(),{componentModeOverride:r}=l.useComponentConfigurationContext();return a.jsxs(l.Modal,{show:!n,onClose:()=>s(!0),onClosed:t,contain:r!=="compact",children:[r==="compact"&&a.jsx(l.Header,{title:e("reboot"),showCloseButton:!0,onClose:()=>s(!0),CloseButton:l.CompactCloseButton}),a.jsxs(Oi,{children:[a.jsxs(Ri,{children:[a.jsx(l.QuestionIconStyle,{}),a.jsx(Li,{children:a.jsx(l.UtilityModalHeading,{children:e("modal-heading","Are you sure you want to reboot dispenser?")})})]}),a.jsx(l.CancelProceedFooter,{cancelLabel:`${e("cancel","Cancel")}`,proceedLabel:`${e("reboot","Reboot")}`,onCancel:()=>s(!0),onProceed:()=>o==null?void 0:o.completeReboot()})]})]})},ke=j(l.LabelInformation)`
344
+ `,Oi=({onComplete:t})=>{const{t:e}=m.useKosTranslation("reboot"),[n,s]=p.useState(!1),{model:o}=ut(),{componentModeOverride:r}=d.useComponentConfigurationContext();return a.jsxs(d.Modal,{show:!n,onClose:()=>s(!0),onClosed:t,contain:r!=="compact",children:[r==="compact"&&a.jsx(d.Header,{title:e("reboot"),showCloseButton:!0,onClose:()=>s(!0),CloseButton:d.CompactCloseButton}),a.jsxs(Ai,{children:[a.jsxs(Ni,{children:[a.jsx(d.QuestionIconStyle,{}),a.jsx(Di,{children:a.jsx(d.UtilityModalHeading,{children:e("modal-heading","Are you sure you want to reboot dispenser?")})})]}),a.jsx(d.CancelProceedFooter,{cancelLabel:`${e("cancel","Cancel")}`,proceedLabel:`${e("reboot","Reboot")}`,onCancel:()=>s(!0),onProceed:()=>o==null?void 0:o.completeReboot()})]})]})},ke=I(d.LabelInformation)`
345
345
  text-align: center;
346
- `,Mi=m.kosComponent(({remoteTray:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"remote-nns"}),[s,o]=p.useState("idle"),[r,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 P=r[O.name];return P!=null&&P!==""}),y=p.useCallback((O,P)=>{c(S=>({...S,[O]:P}))},[]),v=p.useCallback(O=>(P="")=>{y(O,P)},[y]),C=p.useCallback(async()=>{t.remoteTrayEnabled.updateProperty(!h),o(h?"disableSuccess":"success")},[h,t.remoteTrayEnabled]),T=p.useCallback(async()=>{o("progress"),d({});let O=!1;await Promise.all(f.map(async P=>{try{const S=m.getKosCompanionModel(P,Te.FreestylePump.type),[_]=await S.replacePump(r[P.name]);_&&(d($=>({...$,[P.name]:_})),O=!0)}catch(S){console.error(S),d(_=>({..._,[P.name]:"unknownError"})),O=!0}})),O?o("pump"):C()},[h,r,f,t.remoteTrayEnabled,C]),N=p.useMemo(()=>({idle:{title:n(h?"disable-title":"idle-title"),information:a.jsx(ke,{children:n(h?"disable-info":"idle-info")}),footer:a.jsx(l.Button,{onPointerDown:()=>{h?C():o("pump")},children:n(h?"disable":"enable")}),status:"information"},pump:{title:n("pump-title"),information:a.jsxs(a.Fragment,{children:[a.jsx(ke,{children:n("pump-info")}),f.map(O=>a.jsx(l.ErrorInputCard,{layout:"hex",description:i[O.name]?n(`errors.${i[O.name]}`):"",value:r[O.name]??"",label:n(`pumps.${O.name}`),onChange:v(O.name)},O.name))]}),footer:a.jsxs(a.Fragment,{children:[a.jsx(l.Button,{disabled:!g(),onPointerDown:T,children:n("enter")}),a.jsx(l.Button,{onPointerDown:e,children:n("cancel")})]})},progress:{title:n("progress-title"),information:a.jsx(ke,{children:n("progress-info")}),status:"loading"},success:{title:n("success-title"),information:a.jsx(ke,{children:n("success-info")}),status:"success"},disableSuccess:{title:n("disable-success-title"),information:a.jsx(ke,{children:n("disable-success-info")}),status:"success"}}),[y,h,e,r,i,f,T,n]);return a.jsx(l.WorkflowModal,{...N[s],onClose:()=>e()})}),Bi=m.kosComponent(({cardModel:t})=>(m.KosLog.debug("RemoteTray",t.name),a.jsx(Ws,{holder:t.holder}))),Vi=j.div`
346
+ `,Ri=m.kosComponent(({remoteTray:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"remote-nns"}),[s,o]=p.useState("idle"),[r,c]=p.useState({}),[i,l]=p.useState({}),f=t.holder.pumps.data.filter(O=>O.childPump),h=t.remoteTrayEnabled.value===!0,g=()=>f.every(O=>{const P=r[O.name];return P!=null&&P!==""}),y=p.useCallback((O,P)=>{c(S=>({...S,[O]:P}))},[]),v=p.useCallback(O=>(P="")=>{y(O,P)},[y]),C=p.useCallback(async()=>{t.remoteTrayEnabled.updateProperty(!h),o(h?"disableSuccess":"success")},[h,t.remoteTrayEnabled]),T=p.useCallback(async()=>{o("progress"),l({});let O=!1;await Promise.all(f.map(async P=>{try{const S=m.getKosCompanionModel(P,Te.FreestylePump.type),[_]=await S.replacePump(r[P.name]);_&&(l($=>({...$,[P.name]:_})),O=!0)}catch(S){console.error(S),l(_=>({..._,[P.name]:"unknownError"})),O=!0}})),O?o("pump"):C()},[h,r,f,t.remoteTrayEnabled,C]),A=p.useMemo(()=>({idle:{title:n(h?"disable-title":"idle-title"),information:a.jsx(ke,{children:n(h?"disable-info":"idle-info")}),footer:a.jsx(d.Button,{onPointerDown:()=>{h?C():o("pump")},children:n(h?"disable":"enable")}),status:"information"},pump:{title:n("pump-title"),information:a.jsxs(a.Fragment,{children:[a.jsx(ke,{children:n("pump-info")}),f.map(O=>a.jsx(d.ErrorInputCard,{layout:"hex",description:i[O.name]?n(`errors.${i[O.name]}`):"",value:r[O.name]??"",label:n(`pumps.${O.name}`),onChange:v(O.name)},O.name))]}),footer:a.jsxs(a.Fragment,{children:[a.jsx(d.Button,{disabled:!g(),onPointerDown:T,children:n("enter")}),a.jsx(d.Button,{onPointerDown:e,children:n("cancel")})]})},progress:{title:n("progress-title"),information:a.jsx(ke,{children:n("progress-info")}),status:"loading"},success:{title:n("success-title"),information:a.jsx(ke,{children:n("success-info")}),status:"success"},disableSuccess:{title:n("disable-success-title"),information:a.jsx(ke,{children:n("disable-success-info")}),status:"success"}}),[y,h,e,r,i,f,T,n]);return a.jsx(d.WorkflowModal,{...A[s],onClose:()=>e()})}),Li=m.kosComponent(({cardModel:t})=>(m.KosLog.debug("RemoteTray",t.name),a.jsx(Zs,{holder:t.holder}))),Fi=I.div`
347
347
  font-size: var(--ddk-component-holder-card-footer-font-size);
348
348
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
349
349
  position: absolute;
350
350
  bottom: 6px;
351
- `,$i=m.kosComponent(t=>{m.KosLog.debug(`summary component loaded for holder ${t}`),m.KosLog.info(`render agitator summary for holder ${t.cardModel.name}`);const{t:e}=m.useKosTranslation("troubles"),n=t.cardModel,{hasTroubles:s,highestTrouble:o}=Bs(n),r=Le(o),c=pt(o);return s?a.jsx(Vi,{children:e(r.summary,{context:o!=null&&o.deferred?"queued":void 0,data:c})}):a.jsx(l.StatusIndicator,{size:"small",status:"completed"})}),Xs=m.kosComponent(({holder:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("replace-line"),[s,o]=p.useState(),[r,c]=p.useState();p.useEffect(()=>{t.replaceLine().then(()=>{o("success")})},[t]);const i=()=>{if(r){o(void 0);return}e()};return a.jsx(l.StatusBar,{show:s!==void 0,onClose:i,children:s==="failure"?a.jsx(Ie,{children:n(r||"unknownError")}):s==="success"?a.jsx(Qe,{children:n("success")}):null})}),Ki=j.div`
351
+ `,Mi=m.kosComponent(t=>{m.KosLog.debug(`summary component loaded for holder ${t}`),m.KosLog.info(`render agitator summary for holder ${t.cardModel.name}`);const{t:e}=m.useKosTranslation("troubles"),n=t.cardModel,{hasTroubles:s,highestTrouble:o}=Ls(n),r=Le(o),c=pt(o);return s?a.jsx(Fi,{children:e(r.summary,{context:o!=null&&o.deferred?"queued":void 0,data:c})}):a.jsx(d.StatusIndicator,{size:"small",status:"completed"})}),zs=m.kosComponent(({holder:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("replace-line"),[s,o]=p.useState(),[r,c]=p.useState();p.useEffect(()=>{t.replaceLine().then(()=>{o("success")})},[t]);const i=()=>{if(r){o(void 0);return}e()};return a.jsx(d.StatusBar,{show:s!==void 0,onClose:i,children:s==="failure"?a.jsx(Ie,{children:n(r||"unknownError")}):s==="success"?a.jsx(Qe,{children:n("success")}):null})}),Bi=I.div`
352
352
  display: flex;
353
353
  flex-direction: column;
354
354
  overflow-y: auto;
355
355
  overflow-x: hidden;
356
356
  gap: 32px;
357
357
  height: 100%;
358
- `,qs=m.kosComponent(({pump:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=m.useKosTranslation("replace-pump"),{componentModeOverride:r}=l.useComponentConfigurationContext(),[c,i]=p.useState(),[d,u]=p.useState(),[f,h]=p.useState(),g=m.getKosCompanionModel(t,Te.FreestylePump.type),y=t.name,v=p.useCallback(N=>{if(N!==void 0&&N.length===0)return o("pump-calibration-length-error")},[o]),C=p.useCallback(async()=>{if(c===void 0)return;const[N]=await g.replacePump(c);N?(u("failure"),h(N)):u("success")},[g,c]),T=()=>{if(f){u(void 0);return}s(!0)};return a.jsxs(a.Fragment,{children:[a.jsx(l.Modal,{contain:r!=="compact",onClosed:e,show:!n,children:a.jsxs(Ki,{children:[a.jsx(l.Header,{contain:r==="compact",showCloseButton:!0,title:y?o("label-replace-pump",{label:y}):o("replace-pump"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:r==="compact"?l.BackButton:void 0}),a.jsx(l.Content,{align:"top",children:a.jsx(l.InputCard,{isValid:v,label:o("enter-pump-calibration-code"),layout:"hex",value:c,onChange:N=>{h(void 0),i(N)}})}),a.jsx(l.Footer,{children:a.jsx(l.Button,{mode:"primary",disabled:!c||!!f,onPointerDown:C,children:o("replace-pump")})})]})}),a.jsx(l.StatusBar,{show:d!==void 0,onClose:T,children:d==="failure"?a.jsx(Ie,{children:o(f||"unknownError")}):d==="success"?a.jsx(Qe,{children:o("success")}):null})]})}),Ui=/^[0-9a-fA-F]+$/,Zn=t=>Ui.test(t),Zi=j.div`
358
+ `,Hs=m.kosComponent(({pump:t,onComplete:e})=>{const[n,s]=p.useState(!1),{t:o}=m.useKosTranslation("replace-pump"),{componentModeOverride:r}=d.useComponentConfigurationContext(),[c,i]=p.useState(),[l,u]=p.useState(),[f,h]=p.useState(),g=m.getKosCompanionModel(t,Te.FreestylePump.type),y=t.name,v=p.useCallback(A=>{if(A!==void 0&&A.length===0)return o("pump-calibration-length-error")},[o]),C=p.useCallback(async()=>{if(c===void 0)return;const[A]=await g.replacePump(c);A?(u("failure"),h(A)):u("success")},[g,c]),T=()=>{if(f){u(void 0);return}s(!0)};return a.jsxs(a.Fragment,{children:[a.jsx(d.Modal,{contain:r!=="compact",onClosed:e,show:!n,children:a.jsxs(Bi,{children:[a.jsx(d.Header,{contain:r==="compact",showCloseButton:!0,title:y?o("label-replace-pump",{label:y}):o("replace-pump"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:r==="compact"?d.BackButton:void 0}),a.jsx(d.Content,{align:"top",children:a.jsx(d.InputCard,{isValid:v,label:o("enter-pump-calibration-code"),layout:"hex",value:c,onChange:A=>{h(void 0),i(A)}})}),a.jsx(d.Footer,{children:a.jsx(d.Button,{mode:"primary",disabled:!c||!!f,onPointerDown:C,children:o("replace-pump")})})]})}),a.jsx(d.StatusBar,{show:l!==void 0,onClose:T,children:l==="failure"?a.jsx(Ie,{children:o(f||"unknownError")}):l==="success"?a.jsx(Qe,{children:o("success")}):null})]})}),Vi=/^[0-9a-fA-F]+$/,Un=t=>Vi.test(t),$i=I.div`
359
359
  display: flex;
360
360
  flex-direction: column;
361
361
  overflow-y: auto;
362
362
  overflow-x: hidden;
363
363
  height: 100%;
364
- `,Gs=m.kosComponent(({holder:t,onComplete:e})=>{const n=t.name,[s,o]=p.useState(!1),{t:r}=m.useKosTranslation("rfid-override"),{componentModeOverride:c}=l.useComponentConfigurationContext(),[i,d]=p.useState(),[u,f]=p.useState(),[h,g]=p.useState(),[y,v]=p.useState(),[C,T]=p.useState(),N=S=>{if(S!==void 0&&S.length!==12)return r("errIdLen");if(!Zn(S))return r("errIdFormat")},O=S=>{if(S!==void 0&&S.length!==8)return r("errCodeLen");if(!Zn(S))return r("errCodeFormat")},P=async()=>{try{await t.overrideRfidCode({stickerId:i,stickerCode:u}),o(!0)}catch(S){switch(S.type){case"errIdLen":case"errIdFormat":v(S.type);break;case"errCodeLen":case"errCodeFormat":T(S.type);break;case"errVerify":case"errBadJson":g(S.type);break}}};return a.jsxs(l.Modal,{contain:c!=="compact",mode:"maximized",onClosed:e,show:!s,children:[a.jsx(l.Header,{contain:c==="compact",showCloseButton:!0,title:n?r("label-rfid-override",{label:n}):r("rfid-override"),showOpenButton:!1,onClose:()=>o(!0),CloseButton:c==="compact"?l.BackButton:void 0}),a.jsxs(Zi,{children:[a.jsxs(l.Content,{align:"top",children:[a.jsx(l.InfoContainer,{children:r("info")}),a.jsx(l.ErrorInputCard,{isValid:N,description:y?r(y):void 0,label:r("enter-cartridge-id"),layout:"hex",value:i,onChange:S=>{v(void 0),d(S)}}),a.jsx(l.ErrorInputCard,{isValid:O,description:C?r(C):void 0,label:r("enter-code"),layout:"hex",value:u,onChange:S=>{T(void 0),f(S)}})]}),a.jsx(l.Footer,{children:a.jsx(l.Button,{mode:"primary",disabled:!i||!u,onPointerDown:P,children:r("override")})}),h&&a.jsx(l.ProgressBar,{onClose:()=>g(void 0),renderFailure:a.jsx(l.FailureCard,{heading:r("rfid-override"),message:r(h,{holder:t.name})}),show:!0,status:"failure",title:"",value:0})]})]})}),zi=m.kosComponent(({setupPath:t})=>{const{model:e}=ht(),[n,s]=p.useState(!1),[o]=zn.useSearchParams(),r=!!o.get("skipSetup"),c=l.useNavigate();return p.useEffect(()=>{!n&&(e!=null&&e.setupRequired)&&(s(!0),r||c(t))},[e==null?void 0:e.setupRequired,n,c,t,r]),null}),Ys=j.div`
364
+ `,Ws=m.kosComponent(({holder:t,onComplete:e})=>{const n=t.name,[s,o]=p.useState(!1),{t:r}=m.useKosTranslation("rfid-override"),{componentModeOverride:c}=d.useComponentConfigurationContext(),[i,l]=p.useState(),[u,f]=p.useState(),[h,g]=p.useState(),[y,v]=p.useState(),[C,T]=p.useState(),A=S=>{if(S!==void 0&&S.length!==12)return r("errIdLen");if(!Un(S))return r("errIdFormat")},O=S=>{if(S!==void 0&&S.length!==8)return r("errCodeLen");if(!Un(S))return r("errCodeFormat")},P=async()=>{try{await t.overrideRfidCode({stickerId:i,stickerCode:u}),o(!0)}catch(S){switch(S.type){case"errIdLen":case"errIdFormat":v(S.type);break;case"errCodeLen":case"errCodeFormat":T(S.type);break;case"errVerify":case"errBadJson":g(S.type);break}}};return a.jsxs(d.Modal,{contain:c!=="compact",mode:"maximized",onClosed:e,show:!s,children:[a.jsx(d.Header,{contain:c==="compact",showCloseButton:!0,title:n?r("label-rfid-override",{label:n}):r("rfid-override"),showOpenButton:!1,onClose:()=>o(!0),CloseButton:c==="compact"?d.BackButton:void 0}),a.jsxs($i,{children:[a.jsxs(d.Content,{align:"top",children:[a.jsx(d.InfoContainer,{children:r("info")}),a.jsx(d.ErrorInputCard,{isValid:A,description:y?r(y):void 0,label:r("enter-cartridge-id"),layout:"hex",value:i,onChange:S=>{v(void 0),l(S)}}),a.jsx(d.ErrorInputCard,{isValid:O,description:C?r(C):void 0,label:r("enter-code"),layout:"hex",value:u,onChange:S=>{T(void 0),f(S)}})]}),a.jsx(d.Footer,{children:a.jsx(d.Button,{mode:"primary",disabled:!i||!u,onPointerDown:P,children:r("override")})}),h&&a.jsx(d.ProgressBar,{onClose:()=>g(void 0),renderFailure:a.jsx(d.FailureCard,{heading:r("rfid-override"),message:r(h,{holder:t.name})}),show:!0,status:"failure",title:"",value:0})]})]})}),Ki=m.kosComponent(({setupPath:t})=>{const{model:e}=ht(),[n,s]=p.useState(!1),[o]=Zn.useSearchParams(),r=!!o.get("skipSetup"),c=d.useNavigate();return p.useEffect(()=>{!n&&(e!=null&&e.setupRequired)&&(s(!0),r||c(t))},[e==null?void 0:e.setupRequired,n,c,t,r]),null}),Xs=I.div`
365
365
  cursor: pointer;
366
366
  display: flex;
367
367
  gap: 8px;
368
368
  align-items: center;
369
- `,Js=j.div`
369
+ `,qs=I.div`
370
370
  color: var(--ddk-generic-color-grey-100, #171717);
371
371
  font-size: var(--ddk-component-sidebar-font-size-medium);
372
372
  font-style: normal;
@@ -375,18 +375,18 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
375
375
  letter-spacing: 0.44px;
376
376
  white-space: nowrap;
377
377
  overflow: hidden;
378
- `,Qs=m.kosComponent(({setupStepContainer:t,onStepSelected:e,...n})=>{const{t:s,labelMap:o}=Ps({defaultNamespace:"setup",extensionPoint:Rt.id}),r=t==null?void 0:t.currentStep,c=(t==null?void 0:t.data.map(i=>a.jsxs(Ys,{onPointerDown:()=>{t.setCurrentStep(i.id),e(i.id)},children:[a.jsx(l.StatusIndicator,{size:"large",status:r===i?"active":i.complete?"completed":"pending"}),a.jsx(Js,{children:s(o[i.name]??i.titleKey)})]},i.id)))||[];return a.jsx(l.Sidebar,{...n,children:c})}),Hi=Fs(Qs),Wi=m.kosComponent(()=>{const{model:t}=m.useSoftwareInfo();return(t==null?void 0:t.nodes)&&t.nodes.map((e,n)=>a.jsxs(l.FrameContainer,{name:e.nodeName,children:[a.jsx("div",{children:a.jsx(l.FrameBody,{keyList:[],tableHead:`KOS Release Version: ${e.kosVersion}`,tableData:[]})},"kosVersion"),Object.keys(e.group).map((s,o)=>a.jsx("div",{children:a.jsx(l.FrameBody,{keyList:["name","version"],tableHead:s==="undefined"?"":s,tableData:e.group[s]})},o))]},n))}),bt=j(l.LabelInformation)`
378
+ `,Gs=m.kosComponent(({setupStepContainer:t,onStepSelected:e,...n})=>{const{t:s,labelMap:o}=Is({defaultNamespace:"setup",extensionPoint:Rt.id}),r=t==null?void 0:t.currentStep,c=(t==null?void 0:t.data.map(i=>a.jsxs(Xs,{onPointerDown:()=>{t.setCurrentStep(i.id),e(i.id)},children:[a.jsx(d.StatusIndicator,{size:"large",status:r===i?"active":i.complete?"completed":"pending"}),a.jsx(qs,{children:s(o[i.name]??i.titleKey)})]},i.id)))||[];return a.jsx(d.Sidebar,{...n,children:c})}),Ui=Os(Gs),Zi=m.kosComponent(()=>{const{model:t}=m.useSoftwareInfo();return(t==null?void 0:t.nodes)&&t.nodes.map((e,n)=>a.jsxs(d.FrameContainer,{name:e.nodeName,children:[a.jsx("div",{children:a.jsx(d.FrameBody,{keyList:[],tableHead:`KOS Release Version: ${e.kosVersion}`,tableData:[]})},"kosVersion"),Object.keys(e.group).map((s,o)=>a.jsx("div",{children:a.jsx(d.FrameBody,{keyList:["name","version"],tableHead:s==="undefined"?"":s,tableData:e.group[s]})},o))]},n))}),bt=I(d.LabelInformation)`
379
379
  white-space: pre-wrap;
380
- `,eo=m.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"spm-field-calibration"}),[s,o]=p.useState("preparation-idle"),[r,c]=p.useState(),[i,d]=p.useState(),[u,f]=p.useState(),{clearFuture:h,future:g}=ne(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:a.jsx(bt,{children:n("preparation-idle-info")}),footer:a.jsx(l.Button,{onPointerDown:()=>{h(),t.performPreCalibrate(),o("preparation-in-progress")},children:n("preparation-action")}),status:"information"},"preparation-in-progress":{information:a.jsx(l.LabelInformation,{children:n("preparation-progress-info")}),footer:a.jsx(l.Button,{disabled:!0,children:n("preparation-action")}),status:"loading"},"preparation-success":{information:a.jsx(l.LabelInformation,{children:n("preparation-success-info")}),footer:a.jsx(l.Button,{onPointerDown:()=>o("calibration-idle"),children:n("preparation-success-action")}),status:"success"},"preparation-failed":{},"calibration-idle":{information:a.jsx(bt,{children:n("calibration-idle-info")}),footer:a.jsx(l.Button,{onPointerDown:()=>{h(),t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:a.jsx(l.LabelInformation,{children:n("calibration-progress-info")}),status:"loading"},"calibration-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(l.LabelInformation,{children:n("calibration-input-info")}),a.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:C=>{C!==void 0&&d(C)},value:i!==void 0?i:""})]}),footer:a.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:a.jsx(bt,{children:n("verification-idle-info")}),footer:a.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:a.jsx(l.LabelInformation,{children:n("verification-progress-info")}),status:"loading"},"verification-trouble":{},"verification-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(l.LabelInformation,{children:n("verification-input-info")}),a.jsx(l.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:C=>{C!==void 0&&f(C)},value:u!==void 0?u:""})]}),footer:a.jsx(l.Button,{disabled:u===void 0,onPointerDown:async()=>{if(i===void 0||u===void 0)return;h();const[C,T]=await t.performComplete(i,u,g==null?void 0:g.clientData);C?(c(C),o("failure")):o("verification-success")},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:a.jsx(l.LabelInformation,{children:n("verification-success-info")}),footer:a.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:a.jsx(l.LabelInformation,{children:n("verification-failed-info",{data:{ingredient:t.name}})}),footer:a.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:a.jsxs(a.Fragment,{children:[a.jsx(l.LabelInformation,{children:n("calibration-failed")}),a.jsx(l.BodyMediumInformation,{children:n(`error.${r||"unknownError"}`)})]}),footer:a.jsx(l.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[h,r,g==null?void 0:g.clientData,e,t,n,i,u]);let v;switch(s){case"preparation-in-progress":v="preparation-progress-title";break;case"calibration-in-progress":v="calibration-progress-title";break;case"verification-in-progress":v="verification-progress-title";break;default:v="initiating"}return a.jsxs(a.Fragment,{children:[a.jsx(l.WorkflowModal,{title:n("title",{data:{ingredient:t.name}}),...y[s],onClose:()=>e()}),g&&a.jsx(V,{title:n(v),future:g})]})}),Xi=m.KosLog.createLogger({name:"state-experience"});Xi.debug("state-experience component loaded");const qi=j.div``,Gi=m.kosComponent(()=>{const{getExtensions:t}=Fe(),{model:e}=zt(),[n,s]=p.useState(null);return p.useEffect(()=>m.kosAutoEffect(()=>{const r=t(Je.id),c=y=>{const v=r.find(C=>C.data.troubleType===y);return v?v.data.stateKey??v.data.troubleType:void 0},i=r.reduce((y,v)=>{const C=v.data.stateKey??v.data.troubleType;return y[C]={extension:Je.id,module:v.id,namespace:v.data.namespace,title:v.data.title,stateValue:v.data.stateValue??v.data.troubleType},y},{}),d=e==null?void 0:e.activeTroubleType,u=e==null?void 0:e.activeTrouble,f=d?c(d):void 0,h=f?i[f]:void 0,g=h?a.jsx(oe.DynamicComponent,{...h,props:{trouble:u}}):null;s(g)}),[t,e]),a.jsx(qi,{children:n})}),Yi=[0,6],to=()=>{const{regionModel:t}=m.useKosRegions(),{model:e}=m.useKosTime(),[n,s]=p.useState(new Date),o=n.getFullYear(),r=m.useDateProps({formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(t==null?void 0:t.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:Yi,yearsRange:[o-10,o+10]}}),c=p.useCallback((u,f)=>{switch(u){case"year":r.dateActions.setYear(f.id);break;case"month":r.dateActions.setMonth(f.id);break;case"day":r.dateActions.setDay(f.id);break}},[r.dateActions]),i=p.useCallback(()=>{r.dateActions.setYear(n.getFullYear()),r.dateActions.setMonth(n.getMonth()),r.dateActions.setDay(n.getDate())},[n,r.dateActions]),d=p.useCallback(async({day:u,month:f,year:h})=>{r.dateActions.setYear(h),r.dateActions.setMonth(f),r.dateActions.setDay(u),await(e==null?void 0:e.updateSystemDate({day:u,month:f,year:h})),s(new Date)},[r.dateActions,e]);return a.jsx(xs,{onDiscard:i,onChange:c,onSave:d})},no=m.kosComponent(({...t})=>{var i;const{regionModel:e}=m.useKosRegions(),{model:n}=m.useKosTime(),{t:s}=m.useKosTranslation("common"),o=e==null?void 0:e.allTimeZones.map(d=>({id:d,label:d.replace(/_/g," ")})),r=(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:r||[]},{id:"all",label:s("all"),items:o||[]}];return a.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})}),Ji=m.kosComponent(({showHeading:t})=>{var y,v,C,T,N,O,P,S;const{t:e}=m.useKosTranslation("region"),{regionModel:n}=m.useKosRegions(),{model:s}=m.useKosTime(),{amPmOptions:o,formattedTime:r,hourOptions:c,minuteOptions:i,setTime:d,time:u}=m.useRegionTimeProps(),f=u.getHours(),h=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f<12?f:f-12,loop:!0},{id:"min",items:i,selectedItemId:u.getMinutes(),loop:!0},{id:"ampm",items:o,selectedItemId:f<12?"AM":"PM"}],[o,c,i,u,f]),g=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f,loop:!0},{id:"min",items:i,selectedItemId:u.getMinutes(),loop:!0}],[c,i,u,f]);return p.useEffect(()=>{const _=setInterval(()=>{d(new Date)},3e4);return()=>{clearInterval(_)}},[d]),a.jsxs(l.TabContainer,{children:[t&&a.jsx(l.SettingsSubheading,{children:e("time-settings","Time Settings")}),((y=n==null?void 0:n.dateFormatOptions)==null?void 0:y.length)&&a.jsx(l.SwitchCard,{label:e("date-format","Date Format"),value:(C=(v=n==null?void 0:n.dateFormatOptions)==null?void 0:v.find(_=>_.format===n.selectedDateFormat))==null?void 0:C.id,options:(T=n==null?void 0:n.dateFormatOptions)==null?void 0:T.map(_=>({label:_.format.toUpperCase(),..._})),onChange:_=>_&&(n==null?void 0:n.setSelectedDateFormat(String(_)))}),a.jsx(to,{}),a.jsx(no,{}),((N=n==null?void 0:n.timeFormatOptions)==null?void 0:N.length)&&a.jsx(l.SwitchCard,{label:e("time-format","Time Format"),value:(P=(O=n==null?void 0:n.timeFormatOptions)==null?void 0:O.find(_=>_.format===n.selectedTimeFormat))==null?void 0:P.id,options:(S=n==null?void 0:n.timeFormatOptions)==null?void 0:S.map(_=>({label:_!=null&&_.ampm?"12 HR":"24 HR",..._})).reverse(),onChange:_=>_&&(n==null?void 0:n.setSelectedTimeFormat(String(_)))}),a.jsx(l.MultiPickerCard,{data:n!=null&&n.is12HourTimeFormat?h:g,icon:xe.TimeIcon,displayValue:r,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,U=_.min,q=new Date(u);q.setHours($),q.setMinutes(U),d(q),s==null||s.updateSystemTime({hour:$,min:U,sec:0})}})]})}),Qi=Kt(m.kosComponent(({settings:t,showHeading:e})=>{const{t:n}=m.useKosTranslation("dispenser-profile");return a.jsxs(l.TabContainer,{children:[e&&a.jsx(l.SettingsSubheading,{children:n("water-settings","Water Settings")}),a.jsx(je,{label:n("plain-water","Plain Water"),configProperty:t.hidePlainWaterBev}),a.jsx(je,{label:n("carbonated-water","Carbonated Water"),configProperty:t.hideCarbWaterBev})]})})),ec=j.div`
380
+ `,Ys=m.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=m.useKosTranslation("common",{keyPrefix:"spm-field-calibration"}),[s,o]=p.useState("preparation-idle"),[r,c]=p.useState(),[i,l]=p.useState(),[u,f]=p.useState(),{clearFuture:h,future:g}=ne(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:a.jsx(bt,{children:n("preparation-idle-info")}),footer:a.jsx(d.Button,{onPointerDown:()=>{h(),t.performPreCalibrate(),o("preparation-in-progress")},children:n("preparation-action")}),status:"information"},"preparation-in-progress":{information:a.jsx(d.LabelInformation,{children:n("preparation-progress-info")}),footer:a.jsx(d.Button,{disabled:!0,children:n("preparation-action")}),status:"loading"},"preparation-success":{information:a.jsx(d.LabelInformation,{children:n("preparation-success-info")}),footer:a.jsx(d.Button,{onPointerDown:()=>o("calibration-idle"),children:n("preparation-success-action")}),status:"success"},"preparation-failed":{},"calibration-idle":{information:a.jsx(bt,{children:n("calibration-idle-info")}),footer:a.jsx(d.Button,{onPointerDown:()=>{h(),t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:a.jsx(d.LabelInformation,{children:n("calibration-progress-info")}),status:"loading"},"calibration-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(d.LabelInformation,{children:n("calibration-input-info")}),a.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:C=>{C!==void 0&&l(C)},value:i!==void 0?i:""})]}),footer:a.jsx(d.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:a.jsx(bt,{children:n("verification-idle-info")}),footer:a.jsx(d.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:a.jsx(d.LabelInformation,{children:n("verification-progress-info")}),status:"loading"},"verification-trouble":{},"verification-input":{information:a.jsxs(a.Fragment,{children:[a.jsx(d.LabelInformation,{children:n("verification-input-info")}),a.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:C=>{C!==void 0&&f(C)},value:u!==void 0?u:""})]}),footer:a.jsx(d.Button,{disabled:u===void 0,onPointerDown:async()=>{if(i===void 0||u===void 0)return;h();const[C,T]=await t.performComplete(i,u,g==null?void 0:g.clientData);C?(c(C),o("failure")):o("verification-success")},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:a.jsx(d.LabelInformation,{children:n("verification-success-info")}),footer:a.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:a.jsx(d.LabelInformation,{children:n("verification-failed-info",{data:{ingredient:t.name}})}),footer:a.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:a.jsxs(a.Fragment,{children:[a.jsx(d.LabelInformation,{children:n("calibration-failed")}),a.jsx(d.BodyMediumInformation,{children:n(`error.${r||"unknownError"}`)})]}),footer:a.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[h,r,g==null?void 0:g.clientData,e,t,n,i,u]);let v;switch(s){case"preparation-in-progress":v="preparation-progress-title";break;case"calibration-in-progress":v="calibration-progress-title";break;case"verification-in-progress":v="verification-progress-title";break;default:v="initiating"}return a.jsxs(a.Fragment,{children:[a.jsx(d.WorkflowModal,{title:n("title",{data:{ingredient:t.name}}),...y[s],onClose:()=>e()}),g&&a.jsx(V,{title:n(v),future:g})]})}),zi=m.KosLog.createLogger({name:"state-experience"});zi.debug("state-experience component loaded");const Hi=I.div``,Wi=m.kosComponent(()=>{const{getExtensions:t}=Fe(),{model:e}=zt(),[n,s]=p.useState(null);return p.useEffect(()=>m.kosAutoEffect(()=>{const r=t(Je.id),c=y=>{const v=r.find(C=>C.data.troubleType===y);return v?v.data.stateKey??v.data.troubleType:void 0},i=r.reduce((y,v)=>{const C=v.data.stateKey??v.data.troubleType;return y[C]={extension:Je.id,module:v.id,namespace:v.data.namespace,title:v.data.title,stateValue:v.data.stateValue??v.data.troubleType},y},{}),l=e==null?void 0:e.activeTroubleType,u=e==null?void 0:e.activeTrouble,f=l?c(l):void 0,h=f?i[f]:void 0,g=h?a.jsx(oe.DynamicComponent,{...h,props:{trouble:u}}):null;s(g)}),[t,e]),a.jsx(Hi,{children:n})}),Xi=[0,6],Js=()=>{const{regionModel:t}=m.useKosRegions(),{model:e}=m.useKosTime(),[n,s]=p.useState(new Date),o=n.getFullYear(),r=m.useDateProps({formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(t==null?void 0:t.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:Xi,yearsRange:[o-10,o+10]}}),c=p.useCallback((u,f)=>{switch(u){case"year":r.dateActions.setYear(f.id);break;case"month":r.dateActions.setMonth(f.id);break;case"day":r.dateActions.setDay(f.id);break}},[r.dateActions]),i=p.useCallback(()=>{r.dateActions.setYear(n.getFullYear()),r.dateActions.setMonth(n.getMonth()),r.dateActions.setDay(n.getDate())},[n,r.dateActions]),l=p.useCallback(async({day:u,month:f,year:h})=>{r.dateActions.setYear(h),r.dateActions.setMonth(f),r.dateActions.setDay(u),await(e==null?void 0:e.updateSystemDate({day:u,month:f,year:h})),s(new Date)},[r.dateActions,e]);return a.jsx(gs,{onDiscard:i,onChange:c,onSave:l})},Qs=m.kosComponent(({...t})=>{var i;const{regionModel:e}=m.useKosRegions(),{model:n}=m.useKosTime(),{t:s}=m.useKosTranslation("common"),o=e==null?void 0:e.allTimeZones.map(l=>({id:l,label:l.replace(/_/g," ")})),r=(i=e==null?void 0:e.timeZones)==null?void 0:i.map(l=>({id:l,label:l.replace(/_/g," ")})),c=[{id:"region",label:s("suggested"),items:r||[]},{id:"all",label:s("all"),items:o||[]}];return a.jsx(d.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})}),qi=m.kosComponent(({showHeading:t})=>{var y,v,C,T,A,O,P,S;const{t:e}=m.useKosTranslation("region"),{regionModel:n}=m.useKosRegions(),{model:s}=m.useKosTime(),{amPmOptions:o,formattedTime:r,hourOptions:c,minuteOptions:i,setTime:l,time:u}=m.useRegionTimeProps(),f=u.getHours(),h=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f<12?f:f-12,loop:!0},{id:"min",items:i,selectedItemId:u.getMinutes(),loop:!0},{id:"ampm",items:o,selectedItemId:f<12?"AM":"PM"}],[o,c,i,u,f]),g=p.useMemo(()=>[{id:"hr",items:c,selectedItemId:f,loop:!0},{id:"min",items:i,selectedItemId:u.getMinutes(),loop:!0}],[c,i,u,f]);return p.useEffect(()=>{const _=setInterval(()=>{l(new Date)},3e4);return()=>{clearInterval(_)}},[l]),a.jsxs(d.TabContainer,{children:[t&&a.jsx(d.SettingsSubheading,{children:e("time-settings","Time Settings")}),((y=n==null?void 0:n.dateFormatOptions)==null?void 0:y.length)&&a.jsx(d.SwitchCard,{label:e("date-format","Date Format"),value:(C=(v=n==null?void 0:n.dateFormatOptions)==null?void 0:v.find(_=>_.format===n.selectedDateFormat))==null?void 0:C.id,options:(T=n==null?void 0:n.dateFormatOptions)==null?void 0:T.map(_=>({label:_.format.toUpperCase(),..._})),onChange:_=>_&&(n==null?void 0:n.setSelectedDateFormat(String(_)))}),a.jsx(Js,{}),a.jsx(Qs,{}),((A=n==null?void 0:n.timeFormatOptions)==null?void 0:A.length)&&a.jsx(d.SwitchCard,{label:e("time-format","Time Format"),value:(P=(O=n==null?void 0:n.timeFormatOptions)==null?void 0:O.find(_=>_.format===n.selectedTimeFormat))==null?void 0:P.id,options:(S=n==null?void 0:n.timeFormatOptions)==null?void 0:S.map(_=>({label:_!=null&&_.ampm?"12 HR":"24 HR",..._})).reverse(),onChange:_=>_&&(n==null?void 0:n.setSelectedTimeFormat(String(_)))}),a.jsx(d.MultiPickerCard,{data:n!=null&&n.is12HourTimeFormat?h:g,icon:xe.TimeIcon,displayValue:r,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,U=_.min,q=new Date(u);q.setHours($),q.setMinutes(U),l(q),s==null||s.updateSystemTime({hour:$,min:U,sec:0})}})]})}),Gi=Kt(m.kosComponent(({settings:t,showHeading:e})=>{const{t:n}=m.useKosTranslation("dispenser-profile");return a.jsxs(d.TabContainer,{children:[e&&a.jsx(d.SettingsSubheading,{children:n("water-settings","Water Settings")}),a.jsx(je,{label:n("plain-water","Plain Water"),configProperty:t.hidePlainWaterBev}),a.jsx(je,{label:n("carbonated-water","Carbonated Water"),configProperty:t.hideCarbWaterBev})]})})),Yi=I.div`
381
381
  display: flex;
382
382
  flex-direction: column;
383
383
  gap: 12px;
384
- `,tc=j.div`
384
+ `,Ji=I.div`
385
385
  display: flex;
386
386
  flex-direction: row;
387
387
  gap: 12px;
388
388
  align-items: center;
389
389
  justify-content: center;
390
- `,nc=j(l.Button)`
390
+ `,Qi=I(d.Button)`
391
391
  display: block;
392
- `;exports.ActionButton=nc;exports.ActionContainer=ec;exports.ActionRow=tc;exports.AgitationControlView=vo;exports.AgitatorDetail=bo;exports.AgitatorModal=os;exports.AgitatorSummary=_o;exports.AnimationContext=qt;exports.AnimationProvider=ba;exports.ApplicationComponentConfigurationProvider=_a;exports.ApplicationContext=Gt;exports.ApplicationProvider=wa;exports.CalibrateAction=Hn;exports.CalibrateModal=cs;exports.ConfigPropInfoCard=us;exports.ConfigPropInputCard=et;exports.ConfigPropInputRangeCard=me;exports.ConfigPropMultiInputEnableCard=ps;exports.ConfigPropPickerCard=tt;exports.ConfigPropSingleInputEnableCard=Oo;exports.ConfigPropSwitchCard=hs;exports.ConfigPropTimePickerCard=gs;exports.ConfigPropToggleCard=je;exports.CuiExtension=Es;exports.DashboardDetailExtension=Tr;exports.DashboardOperationsContext=Yt;exports.DashboardOperationsProvider=ka;exports.DashboardPumpDetailExtension=Ae;exports.DashboardSummaryExtension=_r;exports.DatePickerCard=xs;exports.DiagnosticsModal=ys;exports.DispenserInfoContext=Jt;exports.DispenserInfoProvider=Ta;exports.DispenserInfoSettings=pa;exports.DispenserSerialNumber=Vs;exports.DispenserSettings=ha;exports.EXTENSION_PLUGIN_VISIBILITY=J;exports.EXTENSION_POINT_CUI=Dr;exports.EXTENSION_POINT_CUI_DEF=Or;exports.EXTENSION_POINT_CUI_VIEW=Rr;exports.EXTENSION_POINT_DASHBOARD_DETAIL=Ir;exports.EXTENSION_POINT_DASHBOARD_DETAIL_DEF=jr;exports.EXTENSION_POINT_DASHBOARD_DETAIL_VIEW=Er;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL=Pr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF=Nr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW=Ar;exports.EXTENSION_POINT_DASHBOARD_SUMMARY=wr;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_DEF=kr;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW=Sr;exports.EXTENSION_POINT_NAV_VIEW=Fr;exports.EXTENSION_POINT_NAV_VIEW_DEF=Mr;exports.EXTENSION_POINT_NAV_VIEW_VIEW=Br;exports.EXTENSION_POINT_SETUP=Vr;exports.EXTENSION_POINT_SETUP_DEF=$r;exports.EXTENSION_POINT_SETUP_VIEW=Kr;exports.EXTENSION_POINT_TROUBLE_ACTION=Ur;exports.EXTENSION_POINT_TROUBLE_ACTION_DEF=Zr;exports.EXTENSION_POINT_TROUBLE_ACTION_VIEW=zr;exports.EXTENSION_POINT_UTIL=Cr;exports.EXTENSION_POINT_VIEW=Wr;exports.EXTENSION_POINT_VIEW_DEF=Xr;exports.EXTENSION_POINT_VIEW_VIEW=qr;exports.EnjoyByDate=Xt;exports.FailureMessage=Ie;exports.Fixed45FlowTestAction=Wn;exports.FlushAction=Xn;exports.FutureProgressBar=V;exports.GenericTroubleAction=ss;exports.HardwareInfo=va;exports.HighFlowTestAction=qn;exports.HoldToPourAction=Gn;exports.HoldToPourButton=ye;exports.HolderActions=ft;exports.HolderCard=Us;exports.HolderContentContext=Lt;exports.HolderContentProvider=Gr;exports.HolderGroup=dn;exports.HolderGroupView=ei;exports.HolderNotifications=ae;exports.IceAgitatorDetail=yi;exports.IceAgitatorSettings=zs;exports.IceAgitatorSettingsContainer=gi;exports.IceAgitatorSettingsView=xi;exports.IceAgitatorSummary=bi;exports.IngredientSummaryContext=Qt;exports.IngredientSummaryProvider=ja;exports.IntentAction=H;exports.KosPluginExtensionManager=sa;exports.LFCVPumpCard=ji;exports.LocalizationSettings=Ci;exports.LowFlowTestAction=Yn;exports.MSVPumpCard=Ei;exports.MSVResetAction=Qn;exports.MacroAssignmentContext=en;exports.MacroAssignmentProvider=Pa;exports.MacroHolderCard=Zs;exports.MacroHolderGroupView=ii;exports.MacroSetupStepCard=un;exports.ManualOverrideAction=Jn;exports.NavViewExtension=Lr;exports.NetworkTestContainerContext=nn;exports.NetworkTestContainerProvider=Oa;exports.NetworkTestContext=tn;exports.NetworkTestProvider=Aa;exports.NetworkTestResults=Si;exports.NotificationCardView=Hs;exports.PluginExtensionManager=Rs;exports.PluginTabs=Ii;exports.PrimeAction=es;exports.PurgeAction=ts;exports.RFIDOverride=Gs;exports.RebootContext=sn;exports.RebootProvider=La;exports.RebootView=Fi;exports.RemoteNNSModal=Mi;exports.RemoteTrayDetail=Bi;exports.RemoteTraySummary=$i;exports.ReplaceLine=Xs;exports.ReplacePump=qs;exports.SPMFieldCalibrationModal=eo;exports.SettingsContext=on;exports.SettingsProvider=Ma;exports.SetupExtension=Rt;exports.SetupRequired=zi;exports.SetupSidebar=Hi;exports.SetupSidebarComp=Qs;exports.SetupStepContainerContext=an;exports.SetupStepContainerProvider=Ka;exports.SetupStepContext=rn;exports.SetupStepProvider=Va;exports.Software=Wi;exports.StagedChangesProvider=ds;exports.StateExperience=Gi;exports.StepItem=Ys;exports.StepTitle=Js;exports.SuccessMessage=Qe;exports.SuperPumpCard=Ws;exports.SystemDatePickerCard=to;exports.TROUBLE_PRIME=uo;exports.TROUBLE_PURGE=mo;exports.TimePickerCard=fs;exports.TimeSettings=Ji;exports.TimeZonePickerCard=no;exports.TroubleAction=ns;exports.TroubleActionExtension=Je;exports.UtilitiesContainerContext=ln;exports.UtilitiesContainerProvider=Ha;exports.UtilitiesContext=cn;exports.UtilitiesExtension=js;exports.UtilitiesProvider=Za;exports.ValveCard=Ai;exports.ViewExtension=Hr;exports.WaterPumpCard=Di;exports.WaterSettings=Qi;exports.pumpTypeFactory=na;exports.troubleLabelByType=Ls;exports.troubleLabelFactory=Le;exports.useAgitationControl=Et;exports.useAnimation=Nt;exports.useAnimationContext=Ca;exports.useApplication=Oe;exports.useApplicationContext=ht;exports.useCarbWater=bs;exports.useCombinedActions=Lo;exports.useCopyLogs=Cs;exports.useDashboardOperations=At;exports.useDashboardOperationsContext=Sa;exports.useDispenserInfo=Dt;exports.useDispenserInfoContext=Ia;exports.useDoor=ws;exports.useFutureContainer=ne;exports.useHolderContent=Ft;exports.useHolderExperience=Re;exports.useIngredientSummary=Mt;exports.useIngredientSummaryContext=Ea;exports.useMacroAssignment=Bt;exports.useMacroAssignmentContext=Na;exports.useNetworkTest=Vt;exports.useNetworkTestContainer=$t;exports.useNetworkTestContainerContext=Ra;exports.useNetworkTestContext=Da;exports.useNutritiveSweetener=Ds;exports.usePlainWater=Os;exports.usePluginExtensions=Fe;exports.usePumpAction=De;exports.useReboot=ut;exports.useRebootContext=Fa;exports.useSettings=mt;exports.useSettingsContext=Ba;exports.useSetupStep=Ut;exports.useSetupStepContainer=Zt;exports.useSetupStepContainerContext=Ua;exports.useSetupStepContext=$a;exports.useStagedChanges=Pt;exports.useStart=Ms;exports.useTroubleAction=$o;exports.useTroubleActionState=zt;exports.useTroubleData=pt;exports.useTroubleDecoration=Bs;exports.useTroubleVisibility=da;exports.useUtilities=Ht;exports.useUtilitiesContainer=Wt;exports.useUtilitiesContainerContext=Wa;exports.useUtilitiesContext=za;exports.useViewExtensions=Ps;exports.useVisibleTroubles=ve;exports.withAgitationControl=Ko;exports.withAnimation=vs;exports.withApplication=Uo;exports.withCarbWater=Zo;exports.withCopyLogs=zo;exports.withDashboardOperations=Ho;exports.withDispenserInfo=_s;exports.withDoor=Wo;exports.withIngredientSummary=Jr;exports.withMacroAssignment=Ns;exports.withNetworkTest=Qr;exports.withNetworkTestContainer=As;exports.withNutritiveSweetener=ea;exports.withPlainWater=ta;exports.withReboot=oa;exports.withSettings=Kt;exports.withSetupStep=ra;exports.withSetupStepContainer=Fs;exports.withStagedChanges=ko;exports.withStart=aa;exports.withTroubleAction=ia;exports.withUtilities=ua;exports.withUtilitiesContainer=ma;
392
+ `;exports.ActionButton=Qi;exports.ActionContainer=Yi;exports.ActionRow=Ji;exports.AgitationControlView=go;exports.AgitatorDetail=xo;exports.AgitatorModal=ss;exports.AgitatorSummary=vo;exports.AnimationContext=qt;exports.AnimationProvider=xa;exports.ApplicationComponentConfigurationProvider=va;exports.ApplicationContext=Gt;exports.ApplicationProvider=ba;exports.CalibrateAction=zn;exports.CalibrateModal=is;exports.ConfigPropInfoCard=ls;exports.ConfigPropInputCard=et;exports.ConfigPropInputRangeCard=me;exports.ConfigPropMultiInputEnableCard=ms;exports.ConfigPropPickerCard=tt;exports.ConfigPropSingleInputEnableCard=Ao;exports.ConfigPropSwitchCard=ps;exports.ConfigPropTimePickerCard=fs;exports.ConfigPropToggleCard=je;exports.CuiExtension=Ts;exports.DashboardDetailExtension=_r;exports.DashboardOperationsContext=Yt;exports.DashboardOperationsProvider=Ca;exports.DashboardPumpDetailExtension=Ne;exports.DashboardSummaryExtension=yr;exports.DatePickerCard=gs;exports.DiagnosticsModal=xs;exports.DispenserInfoContext=Jt;exports.DispenserInfoProvider=wa;exports.DispenserInfoSettings=la;exports.DispenserSerialNumber=Fs;exports.DispenserSettings=ua;exports.EXTENSION_PLUGIN_VISIBILITY=J;exports.EXTENSION_POINT_CUI=Er;exports.EXTENSION_POINT_CUI_DEF=Pr;exports.EXTENSION_POINT_CUI_VIEW=Ar;exports.EXTENSION_POINT_DASHBOARD_DETAIL=wr;exports.EXTENSION_POINT_DASHBOARD_DETAIL_DEF=kr;exports.EXTENSION_POINT_DASHBOARD_DETAIL_VIEW=Sr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL=Tr;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_DEF=Ir;exports.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL_VIEW=jr;exports.EXTENSION_POINT_DASHBOARD_SUMMARY=vr;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_DEF=br;exports.EXTENSION_POINT_DASHBOARD_SUMMARY_VIEW=Cr;exports.EXTENSION_POINT_NAV_VIEW=Dr;exports.EXTENSION_POINT_NAV_VIEW_DEF=Or;exports.EXTENSION_POINT_NAV_VIEW_VIEW=Rr;exports.EXTENSION_POINT_SETUP=Lr;exports.EXTENSION_POINT_SETUP_DEF=Fr;exports.EXTENSION_POINT_SETUP_VIEW=Mr;exports.EXTENSION_POINT_TROUBLE_ACTION=Br;exports.EXTENSION_POINT_TROUBLE_ACTION_DEF=Vr;exports.EXTENSION_POINT_TROUBLE_ACTION_VIEW=$r;exports.EXTENSION_POINT_VIEW=Ur;exports.EXTENSION_POINT_VIEW_DEF=Zr;exports.EXTENSION_POINT_VIEW_VIEW=zr;exports.EnjoyByDate=Xt;exports.FailureMessage=Ie;exports.Fixed45FlowTestAction=Hn;exports.FlushAction=Wn;exports.FutureProgressBar=V;exports.GenericTroubleAction=ns;exports.HardwareInfo=ga;exports.HighFlowTestAction=Xn;exports.HoldToPourAction=qn;exports.HoldToPourButton=ye;exports.HolderActions=ft;exports.HolderCard=Vs;exports.HolderContentContext=Lt;exports.HolderContentProvider=Wr;exports.HolderGroup=ln;exports.HolderGroupView=Ya;exports.HolderNotifications=ae;exports.IceAgitatorDetail=fi;exports.IceAgitatorSettings=Ks;exports.IceAgitatorSettingsContainer=pi;exports.IceAgitatorSettingsView=hi;exports.IceAgitatorSummary=xi;exports.IngredientSummaryContext=Qt;exports.IngredientSummaryProvider=Sa;exports.IntentAction=z;exports.KosPluginExtensionManager=ea;exports.LFCVPumpCard=Si;exports.LocalizationSettings=yi;exports.LowFlowTestAction=Gn;exports.MSVPumpCard=Ti;exports.MSVResetAction=Jn;exports.MacroAssignmentContext=en;exports.MacroAssignmentProvider=Ia;exports.MacroHolderCard=$s;exports.MacroHolderGroupView=oi;exports.MacroSetupStepCard=un;exports.ManualOverrideAction=Yn;exports.NavViewExtension=Nr;exports.NetworkTestContainerContext=nn;exports.NetworkTestContainerProvider=Aa;exports.NetworkTestContext=tn;exports.NetworkTestProvider=Ea;exports.NetworkTestResults=_i;exports.NotificationCardView=Us;exports.PluginExtensionManager=Ns;exports.PluginTabs=ki;exports.PrimeAction=Qn;exports.PurgeAction=es;exports.RFIDOverride=Ws;exports.RebootContext=sn;exports.RebootProvider=Da;exports.RebootView=Oi;exports.RemoteNNSModal=Ri;exports.RemoteTrayDetail=Li;exports.RemoteTraySummary=Mi;exports.ReplaceLine=zs;exports.ReplacePump=Hs;exports.SPMFieldCalibrationModal=Ys;exports.SettingsContext=on;exports.SettingsProvider=Ra;exports.SetupExtension=Rt;exports.SetupRequired=Ki;exports.SetupSidebar=Ui;exports.SetupSidebarComp=Gs;exports.SetupStepContainerContext=an;exports.SetupStepContainerProvider=Ba;exports.SetupStepContext=rn;exports.SetupStepProvider=Fa;exports.Software=Zi;exports.StagedChangesProvider=ds;exports.StateExperience=Wi;exports.StepItem=Xs;exports.StepTitle=qs;exports.SuccessMessage=Qe;exports.SuperPumpCard=Zs;exports.SystemDatePickerCard=Js;exports.TROUBLE_PRIME=io;exports.TROUBLE_PURGE=co;exports.TimePickerCard=hs;exports.TimeSettings=qi;exports.TimeZonePickerCard=Qs;exports.TroubleAction=ts;exports.TroubleActionExtension=Je;exports.UtilitiesContainerContext=dn;exports.UtilitiesContainerProvider=Ua;exports.UtilitiesContext=cn;exports.UtilitiesProvider=$a;exports.ValveCard=Ei;exports.ViewExtension=Kr;exports.WaterPumpCard=Pi;exports.WaterSettings=Gi;exports.pumpTypeFactory=Qr;exports.troubleLabelByType=Ds;exports.troubleLabelFactory=Le;exports.useAgitationControl=Et;exports.useAnimation=At;exports.useAnimationContext=ya;exports.useApplication=Oe;exports.useApplicationContext=ht;exports.useCarbWater=vs;exports.useCombinedActions=Do;exports.useCopyLogs=bs;exports.useDashboardOperations=Nt;exports.useDashboardOperationsContext=_a;exports.useDispenserInfo=Dt;exports.useDispenserInfoContext=ka;exports.useDoor=_s;exports.useFutureContainer=ne;exports.useHolderContent=Ft;exports.useHolderExperience=Re;exports.useIngredientSummary=Mt;exports.useIngredientSummaryContext=Ta;exports.useMacroAssignment=Bt;exports.useMacroAssignmentContext=ja;exports.useNetworkTest=Vt;exports.useNetworkTestContainer=$t;exports.useNetworkTestContainerContext=Na;exports.useNetworkTestContext=Pa;exports.useNutritiveSweetener=Ps;exports.usePlainWater=As;exports.usePluginExtensions=Fe;exports.usePumpAction=De;exports.useReboot=ut;exports.useRebootContext=Oa;exports.useSettings=mt;exports.useSettingsContext=La;exports.useSetupStep=Ut;exports.useSetupStepContainer=Zt;exports.useSetupStepContainerContext=Va;exports.useSetupStepContext=Ma;exports.useStagedChanges=Pt;exports.useStart=Rs;exports.useTroubleAction=Mo;exports.useTroubleActionState=zt;exports.useTroubleData=pt;exports.useTroubleDecoration=Ls;exports.useTroubleVisibility=ia;exports.useUtilities=Ht;exports.useUtilitiesContainer=Wt;exports.useUtilitiesContainerContext=Za;exports.useUtilitiesContext=Ka;exports.useViewExtensions=Is;exports.useVisibleTroubles=ve;exports.withAgitationControl=Bo;exports.withAnimation=ys;exports.withApplication=Vo;exports.withCarbWater=$o;exports.withCopyLogs=Ko;exports.withDashboardOperations=Uo;exports.withDispenserInfo=Cs;exports.withDoor=Zo;exports.withIngredientSummary=qr;exports.withMacroAssignment=js;exports.withNetworkTest=Gr;exports.withNetworkTestContainer=Es;exports.withNutritiveSweetener=Yr;exports.withPlainWater=Jr;exports.withReboot=ta;exports.withSettings=Kt;exports.withSetupStep=na;exports.withSetupStepContainer=Os;exports.withStagedChanges=Co;exports.withStart=sa;exports.withTroubleAction=oa;exports.withUtilities=ca;exports.withUtilitiesContainer=da;