PageSourceSearch

https://www.gimmemorethaimd.com/_next/static/chunks/pages/food-truck-schedule/admin-a4d91b16389413fc.js

js gimmemorethaimd.com collected 2026-09-24 11:05:02 UTC 139,012 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9141],{72344:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/food-truck-schedule/admin",function(){return r(15070)}])},19806:function(e,t,r){"use strict";r.d(t,{u:function(){return s}});var a=r(85893),n=r(67294),l=r(66908),i=r(96331);let s=n.forwardRef((e,t)=>{let{children:r,content:n,sideOffset:s=4,delayDuration:o=300,className:d,side:c="top",align:u="center",open:m,onOpenChange:x,asChild:p=!1,...h}=e,f={delayDuration:o,...void 0!==m?{open:m}:{},...void 0!==x?{onOpenChange:x}:{}};return(0,a.jsx)(l.pn,{children:(0,a.jsxs)(l.u,{...f,children:[(0,a.jsx)(l.aJ,{asChild:p,children:r}),(0,a.jsx)(l.h_,{children:(0,a.jsxs)(l._v,{ref:t,side:c,align:u,sideOffset:s,className:(0,i.cn)("z-[70] rounded-lg text-sm bg-[#323232] px-2 py-1.5 text-white","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2","origin-[--radix-tooltip-content-transform-origin]","max-w-[260px] text-[14px] break-words leading-[20px] rounded-sm shadow-md",d),...h,children:[n,(0,a.jsx)(l.Eh,{className:"fill-[#323232] drop-shadow-[0_1px_1px_rgba(0,0,0,0.2)]"})]})})]})})});s.displayName="Tooltip"},96331:function(e,t,r){"use strict";r.d(t,{cn:function(){return l}});var a=r(90512),n=r(98388);function l(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.m6)((0,a.W)(t))}},11339:function(e,t,r){"use strict";var a=r(67294),n=r(25877);t.Z=e=>{let t={method:"get",manual:!0,...e},[r,l]=(0,a.useState)(),[i,s]=(0,a.useState)(!1),[o,d]=(0,a.useState)(),c=async(e,r)=>{let a={...t,...r,headers:{...t.headers||{},...(null==r?void 0:r.headers)||{}}};if(!a.url)throw Error("useScheduleRequest: missing url");s(!0),d(void 0);try{let t=await n.ZP[a.method](a.url,e||a.params||{},a.headers,{isTips:void 0===a.isTips||a.isTips,cancelPrevious:void 0!==a.cancelPrevious&&a.cancelPrevious});a.uncached||l(t);let r={data:null==t?void 0:t.result,status:null==t?void 0:t.status,more:null==t?void 0:t.more,pageInfo:null==t?void 0:t.pageInfo,loading:!1,error:void 0,send:c};return s(!1),r}catch(e){throw d(e),s(!1),e}};return(0,a.useEffect)(()=>{t.manual||c(t.params)},[]),{data:null==r?void 0:r.result,pageInfo:null==r?void 0:r.pageInfo,more:null==r?void 0:r.more,status:null==r?void 0:r.status,loading:i,error:o,send:c}}},73830:function(e,t,r){"use strict";r.d(t,{DL:function(){return C},GT:function(){return i},KD:function(){return j},Qr:function(){return c},Wo:function(){return d},cj:function(){return s},e2:function(){return v},fo:function(){return x},h2:function(){return g},iz:function(){return k},kg:function(){return N},lK:function(){return y},ns:function(){return p},y4:function(){return w}});var a,n,l=r(30120);
1let i=200,s=500,o="America/New_York",d=e=>Array.from(e).length,c=(e,t)=>Array.from(e).slice(0,t).join(""),u=e=>{if(null==e||Number.isNaN(e))return"";let t=Math.max(0,Math.min(1439,e));return"".concat(String(Math.floor(t/60)).padStart(2,"0"),":").concat(String(t%60).padStart(2,"0"))},m=e=>{if(null==e||Number.isNaN(e))return"";let t=Math.max(0,Math.min(1439,e)),r=Math.floor(t/60);return"".concat(String(r%12||12).padStart(2,"0"),":").concat(String(t%60).padStart(2,"0")," ").concat(r>=12?"PM":"AM")},x=e=>{let[t,r]=e.split(":"),a=Number(t),n=Number(r);return Number.isFinite(a)&&Number.isFinite(n)?Math.max(0,Math.min(1439,60*a+n)):0},p=(e,t)=>void 0===e||void 0===t?"-":"".concat(m(e)," - ").concat(m(t)),h=()=>new Date().toISOString().slice(0,10),f=e=>{let t=(e||o).trim();return l.ou.now().setZone(t).isValid?t:o},b=e=>l.ou.now().setZone(f(e)),g=e=>b(e).toFormat("yyyy-MM-dd"),v=(e,t,r)=>{let a=l.ou.fromISO(e,{zone:f(r)});return a.isValid?a.setLocale("en-US").toLocaleString(t):""},y=()=>({localId:"".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2)),date:"",startTime:"",endTime:"",locationName:"",address:"",status:1,isRemoved:!1}),w=e=>({localId:String(e.id||"".concat(e.date,"-").concat(e.startTime,"-").concat(e.endTime)),id:String(e.id),date:e.date||h(),startTime:u(e.startTime),endTime:u(e.endTime),locationName:c(e.locationName||"",i),address:c(e.address||"",s),status:null!==(a=e.status)&&void 0!==a?a:null,isRemoved:!1}),j=(e,t)=>({id:e.id,date:e.date,startTime:x(e.startTime),endTime:x(e.endTime),locationName:c(e.locationName.trim(),i),address:c(e.address.trim(),s),status:void 0!==t?t:void 0!==e.status?e.status:1,isRemoved:!!e.isRemoved}),N=e=>null==e?"":String(e),k=e=>(e||[]).map(e=>({...e,shopId:N(e.shopId),status:null!==(n=e.status)&&void 0!==n?n:null,entries:(e.entries||[]).map(e=>({...e,id:N(e.id),startTime:Number(e.startTime||0),endTime:Number(e.endTime||0)}))})),C=e=>null==e||1===e?"Draft":2===e?"Published":"Status ".concat(e)},15070:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return rV}});var a=r(85893),n=r(12332),l=r.n(n),i=r(67294),s=r(11163),o=r(8971),d=r(31012),c=r(73696),u=r(28142),m=r(13025),x=r(41352),p=r(34701),h=r(11339),f=r(96331),b=r(25675),g=r.n(b);let v=e=>{let{src:t,component:r,className:n,size:l=16,unit:i="px",color:s,onClick:o,style:d,...c}=e,u="rem"===i?"".concat(l,"rem"):"".concat(l,"px"),m="rem"===i?16*l:l;return t?(0,a.jsx)("span",{className:(0,f.cn)("inline-flex items-center justify-center",o?"cursor-pointer":"cursor-default",n),style:{width:u,height:u,color:s,...d},onClick:o,...c,children:(0,a.jsx)(g(),{src:t,alt:"icon",width:m,height:m,style:{width:"100%",height:"100%",objectFit:"contain",filter:s?"drop-shadow(0 0 0 ".concat(s,")"):void 0}})}):r?(0,a.jsx)("span",{className:(0,f.cn)("inline-flex items-center justify-center",o?"cursor-pointer":"cursor-default",n),style:{width:u,height:u,...d},onClick:o,...c,children:(0,a.jsx)(r,{size:m,color:s,style:{width:"100%",height:"100%"}})}):null},y={white:"var(--grayscale-bright-tone-b1-ffffff)",b4:"var(--grayscale-bright-tone-b4-f2f2f2)",b5:"var(--grayscale-bright-tone-b5-e6e6e6)",b6:"var(--grayscale-bright-tone-b6-d7d7d7)",m2:"var(--grayscale-mid-tone-m2-bbbbbb)",d3:"var(--grayscale-dark-tone-d3-393939)",d4:"var(--grayscale-dark-tone-d4-2c2c2c)",black:"var(--grayscale-dark-tone-d6-000000)",danger:"var(--colors-functional-danger)",dangerHover:"var(--colors-functional-danger-hover)",dangerActive:"var(--colors-functional-danger-active)",link:"var(--colors-functional-link)",linkTransHover:"var(--colors-functional-link-trans-hover)",linkTransActive:"var(--colors-functional-link-trans-active)"},w={fontSize:"var(--typeface-font-size-small)",lineHeight:"var(--typeface-line-height-small)",fontWeight:"var(--typeface-font-weight-medium)",borderRadius:"var(--sizing-border-radius-s6)",heightL:"var(--sizing-basic-l44)",heightM:"var(--sizing-basic-m40)",heightS:"var(--sizing-basic-m36)",heightXS:"var(--sizing-basic-m32)",spacingM32:"var(--sizing-spacing-m32)",spacingM16:"var(--sizing-spacing-m16)",spacingS12:"var(--sizing-spacing-s12)",spacingS8:"var(--sizing-spacing-s8)"},j={fontSize:w.fontSize,lineHeight:w.lineHeight,iconSize:"16",borderRadius:w.borderRadius,fontWeight:w.fontWeight},N={L:{height:w.heightL,padding:"0px ".concat(w.spacingM32),...j},M:{height:w.heightM,padding:"0px ".concat(w.spacingM16),...j},S:{height:w.heightS,padding:"0px ".concat(w.spacingS12),...j}
1,XS:{height:w.heightXS,padding:"0px ".concat(w.spacingS8),...j}},k={default:{primary:y.black,secondary:y.white,hoverPrimary:y.d4,hoverSecondary:y.white,activePrimary:y.d3,activeSecondary:y.white,loadingPrimary:y.d3,loadingSecondary:y.white,disabledPrimary:y.b4,disabledSecondary:y.m2},secondary:{primary:y.b4,secondary:y.black,hoverPrimary:y.b5,hoverSecondary:y.black,activePrimary:y.b6,activeSecondary:y.black,loadingPrimary:y.b6,loadingSecondary:y.black,disabledPrimary:y.b4,disabledSecondary:y.m2},outline:{primary:y.white,secondary:y.black,border:y.b5,hoverPrimary:y.b5,hoverSecondary:y.black,hoverBorder:y.b5,activePrimary:y.b6,activeSecondary:y.black,activeBorder:y.b5,loadingPrimary:y.b6,loadingSecondary:y.black,loadingBorder:y.b6,disabledPrimary:"transparent",disabledSecondary:y.m2,disabledBorder:y.b5},destructive:{primary:y.danger,secondary:y.white,hoverPrimary:y.dangerHover,hoverSecondary:y.white,activePrimary:y.dangerActive,activeSecondary:y.white,loadingPrimary:y.dangerActive,loadingSecondary:y.white,disabledPrimary:y.b4,disabledSecondary:y.m2},link:{primary:y.white,secondary:y.link,hoverPrimary:y.linkTransHover,hoverSecondary:y.link,activePrimary:y.linkTransActive,activeSecondary:y.link,loadingPrimary:y.linkTransActive,loadingSecondary:y.link,disabledPrimary:y.white,disabledSecondary:y.m2},ghost:{primary:"transparent",secondary:y.black,border:"transparent",hoverPrimary:y.b5,hoverSecondary:y.black,hoverBorder:"transparent",activePrimary:y.b6,activeSecondary:y.black,activeBorder:"transparent",loadingPrimary:y.b6,loadingSecondary:y.black,loadingBorder:"transparent",disabledPrimary:y.white,disabledSecondary:y.m2,disabledBorder:"transparent"}},C=e=>{let t=k[e]||k.default;switch(e){case"default":case"secondary":case"destructive":case"link":default:return{backgroundColor:t.primary,color:t.secondary,border:"none","&:hover":{backgroundColor:t.hoverPrimary,color:t.hoverSecondary,border:"none"},"&:active":{backgroundColor:t.activePrimary,color:t.activeSecondary,border:"none"},"&:focus":{backgroundColor:t.hoverPrimary,color:t.hoverSecondary,border:"none"}};case"outline":return{backgroundColor:"transparent",color:t.secondary,border:"1px solid ".concat(t.border),"&:hover":{backgroundColor:t.hoverPrimary,color:t.hoverSecondary,border:"1px solid ".concat(t.hoverBorder)},"&:active":{backgroundColor:t.activePrimary,color:t.activeSecondary,border:"1px solid ".concat(t.activeBorder)},"&:focus":{backgroundColor:t.hoverPrimary,color:t.hoverSecondary,border:"1px solid ".concat(t.hoverBorder)}};case"ghost":return{backgroundColor:"transparent",color:t.secondary,border:"1px solid transparent","&:hover":{backgroundColor:t.hoverPrimary,color:t.hoverSecondary,border:"none"},"&:active":{backgroundColor:t.activePrimary,color:t.activeSecondary,border:"none"},"&:focus":{backgroundColor:t.hoverPrimary,color:t.hoverSecondary,border:"none"}}}},S=e=>{let{size:t="16px"}=e;return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:"animate-spin",children:(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32"})})},E=(e,t,r)=>{if(!r)return t;switch(e){case"left":return(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[r,t]});case"right":return(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[t,r]});case"only":return(0,a.jsx)("div",{className:"flex items-center",children:r});default:return t}},F=(e,t,r,a,n)=>["button inline-flex items-center justify-center font-medium transition-all duration-200 cursor-pointer select-none whitespace-nowrap gap-2","button-".concat(e),"button-".concat(t),a?"button-disabled cursor-not-allowed ":"",n?"button-loading":"",r].filter(Boolean).join(" "),M=e=>{let t=k[e]||k.default,r=e=>e&&"none"!==e&&"transparent"!==e?"border-color: ".concat(e," !important;"):"";return"ghost"===e?"\n      .button-ghost {\n        color: ".concat(t.secondary," !important;\n        outline: none !important;\n      }\n      .button-ghost:hover {\n        background-color: ").concat(t.hoverPrimary," !important;\n        color: ").concat(t.hoverSecondary," !important;\n      }\n      .button-ghost:active {\n        background-color: ").concat(t.activePrimary," !important;\n        color: ").concat(t.activeSecondary," !important;\n      }\n      .button-ghost.button-disabled {\n        background-color: transparent !important;\n        color: ").concat(t.disabledSecondary," !important;\n      }\n      .button-ghost.button-loading {\n        background-color: ").concat(t.loadingPrimary," !important;\n        color: ").concat(t.loadingSecondary," !important;\n      }\n    "):"\n         .button-".concat(e," {\n          color: ").concat(t.secondary," !important;\n          ").concat(r(t.border),"\n          outline: none !important;\n        }\n        .button-").concat(e,":hover {\n          background-color: ").concat(t.hoverPrimary," !important;\n          color: ").concat(t.hoverSecondary," !important;\n          ").concat(r(t.hoverBorder),"\n        }\n        .button-").concat(e,":active {\n          background-color: ").concat(t.activePrimary," !important;\n          color: ").concat(t.activeSecondary," !important;\n          ").concat(r(t.activeBorder),"\n        }\n        .button-").concat(e,":focus {\n          outline: none !important;\n        }\n        .button-").concat(e,".button-disabled {\n          background-color: ").concat(t.disabledPrimary," !important;\n          color: ").concat(t.disabledSecondary," !important;\n          ").concat(r(t.disabledBorder),"\n        }\n        .button-").concat(e,".button-loading {\n          background-color: ").concat(t.loadingPrimary," !important;\n          color: ").concat(t.loadingSecondary," !important;\n          ").concat(r(t.loadingBorder||t.border),"\n        }\n      ")},D=i.forwardRef((e,t)=>
1{let{children:r,onClick:n,disabled:l=!1,loading:s=!1,type:o="default",size:d="M",icon:c,iconPosition:u="left",className:m="",fullWidth:x=!1,href:p,target:h,...f}=e,b=C(o),g=k[o]||k.default,y=c&&(!r||""===r),w={L:{width:"44px",height:"44px"},M:{width:"40px",height:"40px"},S:{width:"36px",height:"36px"},XS:{width:"32px",height:"32px"}},j={...N[d],backgroundColor:l?"ghost"===o?"transparent":g.disabledPrimary:s?g.loadingPrimary:b.backgroundColor,color:l?g.disabledSecondary:s?g.loadingSecondary:b.color,border:"none"===b.border?"1px solid transparent":b.border,boxSizing:"border-box",width:x?"100%":y?w[d].width:"auto",height:y?w[d].height:N[d].height,cursor:l?"not-allowed":"pointer",transition:"background-color 0.2s ease-in-out, color 0.2s ease-in-out",outline:"none",padding:y?"0":N[d].padding},D=F(o,d,m,l,s);(0,i.useEffect)(()=>{let e="button-".concat(o,"-styles"),t=document.getElementById(e);return t||((t=document.createElement("style")).id=e,t.textContent=M(o),document.head.appendChild(t)),()=>{}},[o]);let Z=()=>{if(!c)return null;if("object"==typeof c&&"component"in c){let e=y?16:parseInt(N[d].iconSize);return(0,a.jsx)(v,{component:c.component,size:c.size||e,color:c.color,className:c.className,style:{cursor:"inherit"}})}return c},I=()=>{if(s)return c?E(u,r,(0,a.jsx)(S,{size:"16px"})):(0,a.jsx)(S,{size:"16px"});let e=Z();return E(u,r,e)};return p?(0,a.jsx)("a",{ref:t,href:p,target:h,className:D,style:j,onClick:l||s?void 0:n,children:I()}):(0,a.jsx)("div",{ref:t,onClick:l||s?void 0:n,className:D,style:j,role:"button",tabIndex:l||s?-1:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||l||s||(e.preventDefault(),null==n||n(e))},...f,children:I()})});D.displayName="Button";
1var Z=r(87536);let I=(0,i.createContext)({});var P=r(88426),R=r(49102),T=r(12003);let A=(0,T.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_=i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(R.f,{ref:t,className:(0,f.cn)(A(),r),...n})});_.displayName=R.f.displayName;let z=i.createContext({}),B=e=>{let{...t}=e;return(0,a.jsx)(z.Provider,{value:{name:t.name},children:(0,a.jsx)(Z.Qr,{...t})})},L=()=>{let e=i.useContext(z),t=i.useContext(O),{getFieldState:r,formState:a}=(0,Z.Gc)(),n=r(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:l}=t;return{id:l,name:e.name,formItemId:"".concat(l,"-form-item"),formDescriptionId:"".concat(l,"-form-item-description"),formMessageId:"".concat(l,"-form-item-message"),...n}},O=i.createContext({}),V=i.forwardRef((e,t)=>{let{className:r,...n}=e,l=i.useId();return(0,a.jsx)(O.Provider,{value:{id:l},children:(0,a.jsx)("div",{ref:t,className:(0,f.cn)(r),...n})})});V.displayName="FormItem";let W=i.forwardRef((e,t)=>{let{className:r,...n}=e,{formItemId:l}=L();return(0,a.jsx)(_,{ref:t,className:(0,f.cn)(r),htmlFor:l,...n})});W.displayName="FormLabel";let Y=i.forwardRef((e,t)=>{let{...r}=e,{error:n,formItemId:l,formDescriptionId:i,formMessageId:s}=L();return(0,a.jsx)(P.g7,{ref:t,id:l,"aria-describedby":n?"".concat(i," ").concat(s):"".concat(i),"aria-invalid":!!n,...r})});Y.displayName="FormControl";let H=i.forwardRef((e,t)=>{let{className:r,...n}=e,{formDescriptionId:l}=L();return(0,a.jsx)("p",{ref:t,id:l,className:(0,f.cn)("text-[0.8rem] text-muted-foreground",r),...n})});H.displayName="FormDescription";let q=i.forwardRef((e,t)=>{var r;let{className:n,children:l,...i}=e,{error:s,formMessageId:o}=L(),d=s?String(null!==(r=null==s?void 0:s.message)&&void 0!==r?r:""):l;return d?(0,a.jsx)("p",{ref:t,id:o,className:(0,f.cn)("text-[0.8rem] font-medium text-destructive",n),...i,children:d}):null});q.displayName="FormMessage";var U=r(19806),K=r(56989);let G=i.memo(e=>{var t;let{children:r,label:n,description:l,layout:s,labelWidth:o,className:d,required:c,disabled:u,name:m,rules:x,labelTooltip:p,labelIcon:h,labelClassName:b,labelAlign:g="right",showErrorMessage:v=!0,...y}=e,{layout:w,labelWidth:j,onFieldChange:N}=(0,i.useContext)(I),k=(0,i.useMemo)(()=>{if(void 0!==c)return c;if(x){if("boolean"==typeof x.required)return x.required;if("object"==typeof x.required&&null!==x.required)return x.required.value}return!1},[c,x]),C=null!==(t=null!=s?s:w)&&void 0!==t?t:"vertical",S=(0,i.useMemo)(()=>{let e=null!=o?o:j;return e?"number"==typeof e?"".concat(e,"px"):e.includes("px")?e:"".concat(e,"px"):""},[o,j]),E=(0,i.useMemo)(()=>{switch(C){case"horizontal":return(0,f.cn)("","flex flex-row space-x-3");case"inline":return(0,f.cn)("","inline-flex space-x-3");default:return""}},[C]),F=(0,i.useMemo)(()=>{let e="text-[14px] text-black font-normal inline-block flex items-center ";return"horizontal"===C||"inline"===C?(0,f.cn)(e,"flex-shrink-0 h-[40px] leading-[40px]","left"===g?"justify-start":"justify-end",b):e},[S,C,g,b]),M=(0,i.useMemo)(()=>(0,f.cn)("horizontal"===C&&"ml-0","inline"===C&&"ml-0","text-[12px] text-[#606060] font-normal"),[C]),D=(0,i.useCallback)((e,t)=>{var a,n;let l=r&&r.props||{},s=void 0!==l.value?l.value:null!==(a=e.value)&&void 0!==a?a:"",o=void 0!==u?u:null!==(n=l.disabled)&&void 0!==n?n:e.disabled;return i.cloneElement(r,{...e,...l,ref:t=>{let r=l.ref;"function"==typeof r?r(t):r&&"object"==typeof r&&(r.current=t);let a=e.ref;"function"==typeof a?a(t):a&&"object"==typeof a&&(a.current=t)},onChange:function(){for(var t,r,a,n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];if("function"==typeof l.onChange&&l.onChange(...i),"function"==typeof e.onChange&&e.onChange(...i),"function"==typeof N){let e=null!==(a=null===(r=i[0])||void 0===r?void 0:null===(t=r.target)||void 0===t?void 0:t.value)&&void 0!==a?a:i[0];N(m,e)}},onBlur:function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++)r[a]=arguments[a];"function"==typeof l.onBlur&&l.onBlur(...r),"function"==typeof e.onBlur&&e.onBlur(...r)},disabled:o,value:s,"data-has-error":!!(null==t?void 0:t.error)})},[r,u,N,m]);return(0,a.jsx)(B,{name:m,rules:x,...y,render:e=>{let{field:t,fieldState:r}=e;return(0,a.jsxs)(V,{className:(0,f.cn)(E,"vertical"===C?"space-y-2":"",d),...y,children:[n&&(0,a.jsxs)(W,{className:F,style:"horizontal"===C||"inline"===C?{width:S}:void 0,children:[(0,a.jsx)("span",{children:n}),k&&(0,a.jsx)("span",{className:"text-[#BB8544] ml-1 mr-1",children:"*"}),p&&(0,a.jsx)(U.u,{content:p,delayDuration:100,asChild:!0,children:(0,a.jsx)("span",{className:"ml-2",children:h||(0,a.jsx)(K.Z,{className:"cursor-pointer w-[14px] h-[14px]"})})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(Y,{className:"",children:D(t,r)}),l&&(0,a.jsx)(H,{className:M,children:l}),v&&(0,a.jsx)(q,{className:"text-[12px] text-[#D2322D] font-normal mt-[4px]"})]})]})}})});G.displayName="FormItem";let J=i.memo(e=>{var t;let{children:r,label:n,description:l,layout:s,labelWidth:o,className:d,required:c,disabled:u,name:m,rules:x,labelTooltip:p,labelIcon:h,labelAlign:b="right",labelClassName:g,showErrorMessage:v=!0,...y}=e,{control:w}=(0,Z.Gc)(),{layout:j,labelWidth:N}=(0,i.useContext)(I),k=(0,i.useMemo)(()=>
1{if(void 0!==c)return c;if(x){if("boolean"==typeof x.required)return x.required;if("object"==typeof x.required&&null!==x.required)return x.required.value}return!1},[c,x]),C=null!==(t=null!=s?s:j)&&void 0!==t?t:"vertical",S=(0,i.useMemo)(()=>{let e=null!=o?o:N;return e?"number"==typeof e?"".concat(e,"px"):e.includes("px")?e:"".concat(e,"px"):""},[o,N]),E=(0,Z.Dq)({control:w,name:m,rules:x}),F=(0,i.useMemo)(()=>{switch(C){case"horizontal":return(0,f.cn)("","flex flex-row items-baseline space-x-4");case"inline":return(0,f.cn)("","inline-flex items-baseline space-x-2");default:return""}},[C]),M=(0,i.useMemo)(()=>{let e="text-[14px] text-black font-medium inline-block flex items-center";return S&&("horizontal"===C||"inline"===C)?(0,f.cn)(e,"flex-shrink-0","left"===b?"justify-start":"justify-end",g):e},[S,C,b,g]),D=(0,i.useMemo)(()=>(0,f.cn)("horizontal"===C&&"ml-0","inline"===C&&"ml-0","text-[12px] text-[#606060] font-normal"),[C]);return(0,a.jsxs)(V,{className:(0,f.cn)(F,"vertical"===C?"space-y-2":"",d),children:[n&&(0,a.jsxs)(W,{className:M,style:"horizontal"===C||"inline"===C?{width:S}:void 0,children:[n,k&&(0,a.jsx)("span",{className:"text-[#BB8544] ml-1 mr-1",children:"*"}),p&&(0,a.jsx)(U.u,{content:p,delayDuration:100,asChild:!0,children:(0,a.jsx)("span",{children:h||(0,a.jsx)(K.Z,{className:"cursor-pointer w-[14px] h-[14px]"})})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(Y,{children:r(E)}),l&&(0,a.jsx)(H,{className:D,children:l}),v&&(0,a.jsx)(q,{className:"text-[12px] text-[#D2322D] font-normal mt-[8px]"})]})]})});J.displayName="FormList";let X=e=>{let{children:t,layout:r="vertical",labelWidth:n,className:l,form:s,onSubmit:o,onFieldChange:d,onDirtyChange:c,...u}=e,m=(0,i.useRef)(!1),x=(0,i.useCallback)((e,t)=>{m.current||(m.current=!0,null==c||c(!0)),null==d||d(e,t)},[d,c]),p=(0,i.useCallback)(()=>{m.current=!1},[]);s.resetDirtyState=p;let h=(0,i.useMemo)(()=>({layout:r,labelWidth:n,onFieldChange:x}),[r,n,x]);return(0,a.jsx)(I.Provider,{value:h,children:(0,a.jsx)(Z.RV,{...s,children:(0,a.jsx)("form",{className:l,onSubmit:o?s.handleSubmit(o):void 0,onReset:e=>{e.preventDefault(),s.reset(),m.current=!1,null==c||c(!1)},...u,children:t})})})};X.Item=G,X.List=J,X.useForm=e=>(0,Z.cI)(e);var Q=r(64712);let $={default:null,warning:(0,a.jsx)(e=>{let{className:t,...r}=e;return(0,a.jsx)("svg",{preserveAspectRatio:"none",width:"100%",height:"100%",overflow:"visible",style:{display:"block"},viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,...r,children:(0,a.jsx)("path",{d:"M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11ZM11.0098 14C11.5621 14 12.0098 14.4477 12.0098 15C12.0098 15.5523 11.5621 16 11.0098 16H11C10.4477 16 10 15.5523 10 15C10 14.4477 10.4477 14 11 14H11.0098ZM10 11V7C10 6.44772 10.4477 6 11 6C11.5523 6 12 6.44772 12 7V11C12 11.5523 11.5523 12 11 12C10.4477 12 10 11.5523 10 11ZM22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11Z",fill:"#A35F00"})})},{className:"w-[18px] h-[18px]","aria-label":"Warning"}),success:(0,a.jsx)(e=>{let{className:t,...r}=e;return(0,a.jsx)("svg",{preserveAspectRatio:"none",width:"100%",height:"100%",overflow:"visible",style:{display:"block"},viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,...r,children:(0,a.jsx)("path",{d:"M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11ZM13.293 8.29297C13.6835 7.90244 14.3165 7.90244 14.707 8.29297C15.0976 8.68349 15.0976 9.31651 14.707 9.70703L10.707 13.707C10.3165 14.0976 9.68349 14.0976 9.29297 13.707L7.29297 11.707C6.90244 11.3165 6.90244 10.6835 7.29297 10.293C7.68349 9.90244 8.31651 9.90244 8.70703 10.293L10 11.5859L13.293 8.29297ZM22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11Z",fill:"#248A3D"})})},{className:"w-[18px] h-[18px]","aria-label":"Success"}),error:(0,a.jsx)(e=>{let{className:t,...r}=e;return(0,a.jsx)("svg",{preserveAspectRatio:"none",width:"100%",height:"100%",overflow:"visible",style:{display:"block"},viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,...r,children:(0,a.jsx)("path",{d:"M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11ZM11.0098 14C11.5621 14 12.0098 14.4477 12.0098 15C12.0098 15.5523 11.5621 16 11.0098 16H11C10.4477 16 10 15.5523 10 15C10 14.4477 10.4477 14 11 14H11.0098ZM10 11V7C10 6.44772 10.4477 6 11 6C11.5523 6 12 6.44772 12 7V11C12 11.5523 11.5523 12 11 12C10.4477 12 10 11.5523 10 11ZM22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11Z",fill:"#D2322D"})})},{className:"w-[18px] h-[18px]","aria-label":"Error"})},ee={default:{bg:"bg-[#FFFFFF]",text:"text-[#000000]",buttonText:"text-[#007aff]"},warning:{bg:"bg-[#FFFFFF]",text:"text-[#000000]",buttonText:"text-[#007aff]"},success:{bg:"bg-[#FFFFFF]",text:"text-[#000000]",buttonText:"text-[#007aff]"},error:{bg:"bg-[#FFFFFF]",text:"text-[#000000]",buttonText:"text-[#007aff]"}};function et(e){let{id:t,type:r="default",title:n,description:l,closeButton:i=!1,dismissible:s=!0,leftIcon:o=!1,action:d,icon:c,testId:u,onAction:m,containerAriaLabel:p="Toast"}=e,h=null;null===c?h=null:c?h=c:o&&r&&(h=$[r]);let b=!!h,g=ee[r];return(0,a.jsxs)("div",{className:(0,f.cn)("relative rounded-[6px] w-auto max-w-[450px]",g.bg,"border border-[#
1E6E6E6]","pl-4 pr-8 py-4","box-border inline-flex flex-col gap-4 items-start min-h-[48px]","group","shadow-[0_4px_6px_-2px_rgba(0,0,0,0.05),0_10px_15px_-3px_rgba(0,0,0,0.1)]","!min-w-[300px]"),"data-testid":u,"aria-label":p,role:"alert","aria-live":"polite",children:[(0,a.jsxs)("div",{className:"flex gap-3 min-h-px relative items-start",children:[b&&(0,a.jsx)("div",{className:"relative shrink-0 w-[20px] h-[20px] flex items-center justify-center",children:h}),(0,a.jsxs)("div",{className:(0,f.cn)("flex flex-col gap-1 min-h-px relative",g.text),children:[!!n&&(0,a.jsx)("p",{className:(0,f.cn)("font-medium text-[18px] leading-[24px]",g.text),children:n}),(0,a.jsx)("div",{className:(0,f.cn)("flex flex-col justify-center min-h-px relative","font-normal text-[14px] leading-[20px]","opacity-90",g.text),children:"string"==typeof l?(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:l}):l})]})]}),!!d&&(0,a.jsx)("div",{className:"flex gap-0 items-center relative shrink-0 ml-1",children:(0,a.jsx)("div",{className:"bg-transparent box-border flex gap-[6px] h-[32px] items-center justify-center px-2 py-0 relative rounded-[6px]",children:"string"==typeof d?(0,a.jsx)("button",{className:(0,f.cn)("font-medium leading-[20px] relative shrink-0 text-[14px] text-center bg-transparent border-none cursor-pointer",g.buttonText),onClick:()=>{null==m||m()},children:d}):d})}),i&&s&&(0,a.jsx)("div",{className:"absolute right-2 top-2 flex items-center justify-center opacity-0 group-hover:opacity-50 transition-opacity",children:(0,a.jsx)("button",{className:"relative shrink-0 w-[24px] h-[24px] flex items-center justify-center bg-transparent border-none cursor-pointer p-1 rounded-[6px]",onClick:()=>{Q.Am.dismiss(t)},"aria-label":"Close toast",children:(0,a.jsx)(x.Z,{className:"w-full h-full text-[#18181B]",strokeWidth:2})})})]})}function er(e){var t;let r=e.id||Math.random().toString(36).substr(2,9);return Q.Am.custom(t=>(0,a.jsx)(et,{id:t,type:e.type||"default",title:e.title,description:e.description,closeButton:e.closeButton,dismissible:e.dismissible,leftIcon:e.leftIcon,action:e.action,icon:e.icon,testId:e.testId,onAction:e.onAction,containerAriaLabel:e.containerAriaLabel}),{style:{width:"fit-content",maxWidth:"min(450px, calc(100vw - 32px))",minWidth:"300px  !important"},duration:null!==(t=e.duration)&&void 0!==t?t:4e3,onAutoClose:e.onAutoClose,onDismiss:e.onDismiss,id:r,position:e.position||"top-center"})}let ea=Object.assign(e=>"string"==typeof e||i.isValidElement(e)?er({type:"default",description:e,leftIcon:!0}):"object"==typeof e&&null!==e&&"description"in e?er({...e,leftIcon:!0}):er({type:"default",description:e,leftIcon:!0}),{success:(e,t)=>er({type:"success",description:e,leftIcon:!0,...t}),error:(e,t)=>er({type:"error",description:e,leftIcon:!0,...t}),warning:(e,t)=>er({type:"warning",description:e,leftIcon:!0,...t}),default:(e,t)=>er({type:"default",description:e,leftIcon:!0,...t}),custom:er,dismiss:e=>Q.Am.dismiss(e),dismissAll:()=>Q.Am.dismiss()});Q.x7;let en={display:{large:"text-[36px] leading-[48px] font-semibold",medium:"text-[28px] leading-[40px] font-semibold"},title:{large:"text-[24px] leading-[32px] font-medium",medium:"text-[20px] leading-[28px] font-medium",small:"text-[18px] leading-[24px] font-medium"},label:{large:"text-[16px] leading-[24px] font-medium",medium:"text-[14px] leading-[20px] font-medium",small:"text-[12px] leading-[16px] font-medium"},body:{large:"text-[16px] leading-[24px] font-normal",medium:"text-[14px] leading-[20px] font-normal",small:"text-[12px] leading-[16px] font-normal"}},el="text-[#000000] tracking-[0px] break-words",ei=i.forwardRef((e,t)=>{let{children:r,className:n,size:l,ellipsis:i,as:s="h1",...o}=e;return(0,a.jsx)(s,{ref:t,className:(0,f.cn)(el,en.display[l||"large"],i&&"truncate",n),...o,children:r})});ei.displayName="Display";let es=i.forwardRef((e,t)=>{let{children:r,className:n,size:l,ellipsis:i,as:s="h2",...o}=e;return(0,a.jsx)(s,{ref:t,className:(0,f.cn)(el,en.title[l||"large"],i&&"truncate",n),...o,children:r})});es.displayName="Title";let eo=i.forwardRef((e,t)=>{let{children:r,className:n,size:l,ellipsis:i,as:s="span",...o}=e;return(0,a.jsx)(s,{ref:t,className:(0,f.cn)(el,en.label[l||"large"],i&&"truncate",n),...o,children:r})});eo.displayName="Label";let ed=i.forwardRef((e,t)=>
1{let{children:r,className:n,size:l,ellipsis:i,as:s="p",...o}=e;return(0,a.jsx)(s,{ref:t,className:(0,f.cn)(el,en.body[l||"large"],i&&"truncate",n),...o,children:r})});ed.displayName="Body";var ec=r(32052),eu=r(73830),em=r(73510),ex=r(42297),ep=r(11607),eh=r(34464),ef=r(40934),eb=r(36316),eg=r(198),ev=r(61108);let ey={small:"h-9 leading-[20px]",large:"h-10 leading-[20px]"},ew=i.forwardRef((e,t)=>{let{className:r,type:n,clearable:l=!1,maxSize:s,trimOnBlur:o=!0,showCharCount:d=!1,value:c,onChange:u,onBlur:m,label:x,required:p,labelTooltip:h,labelIcon:b,description:g,prefix:y,suffix:w,size:j="large",disabled:N,...k}=e,[C,S]=i.useState(!1),[E,F]=i.useState(0),M=i.useRef(null),D=k["data-has-error"],Z=()=>{u&&u({target:{value:""},currentTarget:{value:""}})},I=null!=c&&String(c).length>0,P=y&&y.content,R=w&&w.content,T=c?String(c).length:0,A=R?"gap-0":"gap-2",_=i.useMemo(()=>!!d&&!N&&(!0===d||"always"===d||"threshold"===d&&!!s&&T>=.8*s),[d,N,s,T]),z=i.useCallback(()=>{if(M.current){let e=M.current.offsetWidth;F(e)}},[]);i.useEffect(()=>{let e=requestAnimationFrame(z);return()=>cancelAnimationFrame(e)},[l,I,_,R,T,s,z]),i.useEffect(()=>{var e;let t=null===(e=M.current)||void 0===e?void 0:e.parentElement;if(!t)return;let r=new IntersectionObserver(e=>{var t;(null===(t=e[0])||void 0===t?void 0:t.isIntersecting)&&requestAnimationFrame(z)},{threshold:.1});return r.observe(t),()=>r.disconnect()},[z]);let B=()=>{if(!R)return null;let{content:e,className:t}=w;return(0,a.jsx)("div",{className:(0,f.cn)("flex items-center justify-center pr-3 pl-3 text-gray-60 bg-basic-front border border-l-0 rounded-r-ra-6",D?"border-fn-danger":"border-bdr-low",N&&"bg-dim-low",t,ey[null!=j?j:"large"]),children:(0,a.jsx)(eo,{size:"medium",className:(0,f.cn)("text-txt-high",N&&"text-txt-low"),children:e})})};return(0,a.jsx)("div",{className:(0,f.cn)("relative flex flex-col gap-2",r),children:(0,a.jsxs)("div",{className:(0,f.cn)("relative flex items-center rounded-ra-6 transition-all duration-200",(P||R)&&!D&&!N&&"hover:ring-2 hover:ring-grayscale-m7",(P||R)&&C&&!D&&"ring-2 ring-bdr-mid",(P||R)&&"overflow-hidden"),children:[(()=>{if(!P)return null;let{content:e,className:t}=y;return(0,a.jsx)("div",{className:(0,f.cn)("flex items-center justify-center pr-3 pl-3 text-gray-60 bg-basic-front border border-r-0 rounded-l-ra-6",ey[null!=j?j:"large"],D?"border-fn-danger":"border-bdr-low",N&&"bg-dim-low",t),children:(0,a.jsx)(eo,{size:"medium",className:(0,f.cn)("text-txt-high",N&&"text-txt-low"),children:e})})})(),(0,a.jsx)("input",{type:n,className:(0,f.cn)("flex w-full bg-transparent py-0 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-txt-high focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-dim-low disabled:placeholder:text-txt-low disabled:text-txt-mid placeholder:text-txt-low placeholder:font-normal transition-[color,background-color,border-color,box-shadow] duration-200 caret-current",ey[null!=j?j:"large"],!P&&!R&&"px-3 border-input",!P&&!R&&!D&&!N&&"hover:ring-2 hover:ring-grayscale-m7",!P&&!R&&!D&&"focus-visible:border-bdr-low focus-visible:ring-2 focus-visible:ring-bdr-mid",(P||R)&&"focus-visible:ring-0",P&&!R?"border border-l-0 rounded-r-ra-6":R&&!P?"border rounded-ra-6 pl-3":P&&R?"border border-l-0 border-r-0 rounded-none":"border rounded-ra-6",D?"border-fn-danger focus-visible:border-fn-danger":"border-bdr-low",!P&&!R&&D&&"focus-visible:ring-0 focus-visible:border-fn-danger"),style:{paddingRight:E>0?"".concat(E+8,"px"):void 0,...P&&R?{borderRadius:0}:{},...P&&!R?{borderTopLeftRadius:0,borderBottomLeftRadius:0}:{},...R&&!P?{borderTopRightRadius:0,borderBottomRightRadius:0}:{}},ref:t,value:c,onChange:u,onFocus:e=>{S(!0),k.onFocus&&k.onFocus(e)},onBlur:e=>{if(S(!1),o&&c&&"string"==typeof c&&u){let e=c.trim();e!==c&&u({target:{value:e},currentTarget:{value:e}})}m&&m(e)},maxLength:s,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:N,...k}),(0,a.jsxs)("div",{ref:M,className:(0,f.cn)("absolute top-1/2 -translate-y-1/2 flex items-center",A,R?"right-0":"right-2"),style:{visibility:"hidden",position:"absolute",pointerEvents:"none"},children:[l&&I&&!N&&(0,a.jsx)("div",{className:"cursor-pointer flex items-center justify-center w-4 h-4",onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),null==Z||Z()}
1,children:(0,a.jsx)(v,{component:ev.Z,size:16,className:"text-txt-low cursor-pointer"})}),_&&(0,a.jsx)("div",{className:"text-xs text-gray-60 pointer-events-none whitespace-nowrap",children:s?"".concat(T,"/").concat(s):T}),B()]}),(0,a.jsxs)("div",{className:(0,f.cn)("absolute top-1/2 -translate-y-1/2 flex items-center",A,R?"right-0":"right-2"),children:[l&&I&&!N&&(0,a.jsx)("div",{className:"cursor-pointer flex items-center justify-center w-4 h-4 z-10",onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),null==Z||Z()},children:(0,a.jsx)(v,{component:ev.Z,size:16,className:"text-txt-low cursor-pointer"})}),_&&(0,a.jsx)("div",{className:"text-xs text-gray-60 pointer-events-none whitespace-nowrap z-10",children:s?"".concat(T,"/").concat(s):T}),B()]})]})})});ew.displayName="Input";let ej=e=>{let{onRefresh:t}=e;return(0,a.jsx)("section",{className:"flex min-h-[420px] items-center justify-center rounded-[12px] border border-[#E6E6E6] bg-white px-5 py-10",children:(0,a.jsxs)("div",{className:"flex max-w-[520px] flex-col items-center text-center",children:[(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[#FFF1F0] text-[#D5103F]",children:(0,a.jsx)(em.Z,{className:"h-6 w-6"})}),(0,a.jsx)("h1",{className:"mt-5 text-[24px] font-semibold leading-8 tracking-[0px]",children:"Food Truck Schedule is not enabled"}),(0,a.jsx)("p",{className:"mt-3 text-sm leading-6 text-[#606060]",children:"Please try again later. Or contact Peblla Customer Support."}),(0,a.jsxs)("button",{type:"button",className:"mt-6 inline-flex h-10 items-center justify-center gap-1.5 rounded-[6px] px-4 text-sm font-medium leading-5 text-white transition-opacity hover:opacity-90 active:opacity-80",style:{backgroundColor:"var(--color-primary, #000000)"},onClick:t,children:[(0,a.jsx)(ex.Z,{className:"h-4 w-4","aria-hidden":!0}),"Refresh page"]})]})})},eN=e=>{let{enterpriseName:t,pin:r,verifying:n,onPinChange:l,onVerify:s}=e,[o,d]=(0,i.useState)(!1),c=o?ep.Z:eh.Z;return(0,a.jsx)("section",{className:"flex min-h-[420px] items-center justify-center rounded-[12px] border border-[#E6E6E6] bg-white px-5 py-10",children:(0,a.jsxs)("div",{className:"w-full max-w-[420px]",children:[(0,a.jsx)("div",{className:"mb-5 flex justify-center",children:(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[#FFF5F7] text-[#D5103F]",children:(0,a.jsx)(ef.Z,{className:"h-6 w-6"})})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h1",{className:"text-[24px] font-semibold leading-8 tracking-[0px]",children:"Enter Access PIN"}),(0,a.jsxs)("p",{className:"mt-2 text-sm leading-6 text-[#606060]",children:["Access is required before maintaining ",t,"'s food truck schedule."]})]}),(0,a.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,a.jsx)(ew,{type:o?"text":"password",value:r,placeholder:"Access PIN",clearable:!0,suffix:{content:(0,a.jsx)("button",{type:"button",className:"flex h-4 w-4 items-center justify-center text-[#606060]","aria-label":o?"Hide access PIN":"Show access PIN","aria-pressed":o,onPointerDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),e.stopPropagation(),d(e=>!e)},children:(0,a.jsx)(c,{className:"h-4 w-4","aria-hidden":!0})}),className:"!bg-white !px-3"},onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&s()}}),(0,a.jsx)("button",{type:"button",className:"inline-flex h-10 w-full items-center justify-center rounded-[6px] px-4 text-sm font-medium leading-5 text-white transition-opacity hover:opacity-90 active:opacity-80 disabled:cursor-not-allowed disabled:opacity-60",style:{backgroundColor:"var(--color-primary, #000000)"},disabled:n,onClick:s,children:n?(0,a.jsx)(eb.Z,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):"Continue"})]}),(0,a.jsxs)("div",{className:"mt-5 flex items-start gap-2 rounded-[8px] bg-[#F7F7F8] px-3 py-3 text-left text-xs leading-5 text-[#606060]",children:[(0,a.jsx)(eg.Z,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:"After verification, you can manage drafts, publish customer-visible schedules, and review past entr
1ies for each truck."})]})]})})},ek=e=>{let{enterpriseName:t,logoUrl:r}=e;return(0,a.jsxs)("div",{className:"flex min-h-[80px] w-full items-start gap-3 border-b border-[#E6E6E6] bg-white p-4",children:[(0,a.jsx)("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-[8px] ".concat(r?"bg-white":"bg-[#BEBEBE]"),children:r?(0,a.jsx)("img",{src:r,alt:t?"".concat(t," logo"):"Enterprise logo",className:"h-full w-full object-contain"}):null}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center self-stretch",children:[(0,a.jsx)("div",{className:"truncate text-[20px] font-medium leading-7 text-black",children:"Truck Schedules"}),(0,a.jsx)("div",{className:"truncate text-[14px] font-normal leading-5 text-[#606060]",children:t?"".concat(t," \xb7 Food"):"Food Truck Schedule"})]})]})};var eC=r(64998);function eS(e){let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,f.cn)("animate-pulse rounded-md bg-primary/10",t),...r})}eS.displayName="Skeleton";let eE=e=>{let{count:t=2}=e;return(0,a.jsx)("div",{className:"space-y-2 px-4 pb-3 pt-2",children:Array.from({length:t}).map((e,t)=>(0,a.jsxs)("div",{className:"min-h-[72px] rounded-[8px] border border-[#E6E6E6] p-3",children:[(0,a.jsx)(eS,{className:"h-4 w-3/4 rounded-[4px] bg-[#EDEDF0]"}),(0,a.jsx)(eS,{className:"mt-3 h-5 w-20 rounded-full bg-[#F1F1F3]"})]},t))})},eF=()=>(0,a.jsx)("div",{className:"space-y-9",children:[{title:"Draft",count:2,titleWidth:"w-20",rowClassName:"bg-[#FBFBFB]"},{title:"Published",count:1,titleWidth:"w-32",rowClassName:"bg-white"}].map(e=>{let{title:t,count:r,titleWidth:n,rowClassName:l}=e;return(0,a.jsxs)("section",{children:[(0,a.jsx)(eS,{className:"mb-4 h-7 ".concat(n," rounded-[4px] bg-[#EDEDF0]")}),(0,a.jsx)("div",{className:"space-y-3",children:Array.from({length:r}).map((e,t)=>(0,a.jsx)("div",{className:"rounded-[8px] border border-[#E6E6E6] px-3 py-3 md:px-4 md:py-5 ".concat(l),children:(0,a.jsxs)("div",{className:"grid gap-2 [@media(min-width:1100px)]:gap-3 [@media(min-width:1800px)]:grid-cols-[170px_242px_242px_minmax(220px,1fr)_minmax(220px,1fr)_40px] [@media(min-width:1800px)]:items-start",children:[(0,a.jsxs)("div",{className:"grid gap-2 [@media(min-width:1100px)]:grid-cols-3 [@media(min-width:1100px)]:gap-3 [@media(min-width:1100px)]:items-start [@media(min-width:1800px)]:contents",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(eS,{className:"mb-2 hidden h-4 w-7 rounded-[4px] bg-[#F1F1F3] lg:block"}),(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0]"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(eS,{className:"mb-2 h-4 w-16 rounded-[4px] bg-[#F1F1F3]"}),(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0]"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(eS,{className:"mb-2 h-4 w-14 rounded-[4px] bg-[#F1F1F3]"}),(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0]"})]})]}),(0,a.jsxs)("div",{className:"grid gap-2 [@media(min-width:1100px)]:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_40px] [@media(min-width:1100px)]:gap-3 [@media(min-width:1100px)]:items-start [@media(min-width:1800px)]:contents",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(eS,{className:"mb-2 hidden h-4 w-24 rounded-[4px] bg-[#F1F1F3] lg:block"}),(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0]"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(eS,{className:"mb-2 hidden h-4 w-14 rounded-[4px] bg-[#F1F1F3] lg:block"}),(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0]"})]}),(0,a.jsx)(eS,{className:"h-4 w-4 justify-self-end rounded-[4px] bg-[#F1F1F3] [@media(min-width:1100px)]:mt-9 [@media(min-width:1100px)]:justify-self-center"})]})]})},t))})]},t)})}),eM=()=>(0,a.jsx)("div",{className:"mt-4 space-y-3",children:Array.from({length:1}).map((e,t)=>(0,a.jsx)("div",{className:"grid gap-4 rounded-[8px] border border-dashed border-[#E6E6E6] bg-[#FBFBFB] px-4 py-3 lg:grid-cols-2 [@media(min-width:1355px)]:grid-cols-4",children:Array.from({length:4}).map((e,t)=>(0,a.jsxs)("div",{children:[(0,a.jsx)(eS,{className:"mb-2 h-4 w-20 rounded-[4px] bg-[#EDEDF0]"}),(0,a.jsx)(eS,{className:"h-4 w-4/5 rounded-[4px] bg-[#F1F1F3]"})]},t))},t))}),eD=()=>(0,a.jsxs)("main",{className:"flex min-h-screen flex-col bg-white md:flex-row",children:[(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsxs)("div",{className:"flex min-h-[80px] gap-3 border-b border-[#
1E6E6E6] p-4",children:[(0,a.jsx)(eS,{className:"h-12 w-12 rounded-[8px] bg-[#BEBEBE]"}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col justify-center",children:[(0,a.jsx)(eS,{className:"h-6 w-40 rounded-[4px] bg-[#EDEDF0]"}),(0,a.jsx)(eS,{className:"mt-2 h-4 w-32 rounded-[4px] bg-[#F1F1F3]"})]})]})}),(0,a.jsxs)("aside",{className:"hidden w-[340px] shrink-0 border-r border-[#E6E6E6] bg-white md:block",children:[(0,a.jsxs)("div",{className:"flex min-h-[80px] gap-3 border-b border-[#E6E6E6] p-4",children:[(0,a.jsx)(eS,{className:"h-12 w-12 rounded-[8px] bg-[#BEBEBE]"}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col justify-center",children:[(0,a.jsx)(eS,{className:"h-6 w-40 rounded-[4px] bg-[#EDEDF0]"}),(0,a.jsx)(eS,{className:"mt-2 h-4 w-32 rounded-[4px] bg-[#F1F1F3]"})]})]}),(0,a.jsx)(eS,{className:"mx-4 mb-3 mt-4 h-6 w-28 rounded-[4px] bg-[#EDEDF0]"}),(0,a.jsx)(eE,{})]}),(0,a.jsxs)("section",{className:"min-w-0 flex-1 px-4 pb-8 pt-0 md:px-[clamp(32px,calc(8vw_-_80px),64px)] md:pb-20 md:pt-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-4 md:mb-6 md:gap-6",children:[(0,a.jsxs)("div",{className:"border-b border-[#E6E6E6] py-3 md:border-b-0 md:py-0",children:[(0,a.jsx)(eS,{className:"h-10 w-44 rounded-[6px] bg-[#EDEDF0]"}),(0,a.jsx)(eS,{className:"mt-2 h-5 w-28 rounded-[4px] bg-[#F1F1F3] md:w-11 md:rounded-full"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-[repeat(3,minmax(0,1fr))_40px] items-center gap-2 md:flex md:flex-wrap md:justify-end",children:[(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0] md:w-20"}),(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0] md:w-24"}),(0,a.jsx)(eS,{className:"h-10 w-full rounded-[6px] bg-[#EDEDF0] md:w-28"}),(0,a.jsx)(eS,{className:"h-10 w-10 rounded-[6px] bg-[#EDEDF0]"})]})]}),(0,a.jsx)(eF,{}),(0,a.jsxs)("div",{className:"mt-10 border-t border-[#E6E6E6] pt-8",children:[(0,a.jsx)(eS,{className:"h-7 w-44 rounded-[4px] bg-[#EDEDF0]"}),(0,a.jsx)(eM,{})]})]})]}),eZ=e=>String(e).padStart(2,"0"),eI=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],eP=e=>{let[t,r,a]=e.split("-").map(Number);if(t&&r&&a)return new Date(t,r-1,a)},eR=(e,t)=>{let r=eP(e);if(!r)return e||"-";let a="".concat(eI[r.getMonth()]," ").concat(eZ(r.getDate()),", ").concat(r.getFullYear());return t?"".concat(t,", ").concat(a):a},eT=e=>{let{label:t,value:r}=e;return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"mb-2 text-[14px] font-normal leading-5 text-[#606060]",children:[t,":"]}),(0,a.jsx)("div",{className:"min-w-0 truncate text-[14px] font-normal leading-5 text-black",children:r||"-"})]})},eA=e=>{let{history:t,historyTotal:r,historyPage:n,historyTotalPages:l,pageSize:i,isLoading:s,isExpanded:d,onExpandedChange:c,onPreviousPage:u,onNextPage:m}=e;return(0,a.jsxs)("div",{className:"mt-10 border-t border-[#E6E6E6] bg-white pt-8",children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>c(!d),children:[(0,a.jsxs)("h2",{className:"min-w-0 flex-1 text-[20px] font-medium leading-7 text-black",children:["Past schedule (",r,")"]}),d?(0,a.jsx)(o.Z,{className:"h-4 w-4 shrink-0 text-black transition-transform duration-200"}):(0,a.jsx)(eC.Z,{className:"h-4 w-4 shrink-0 text-black transition-transform duration-200"})]}),(0,a.jsx)("div",{className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out ".concat(d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:(0,a.jsxs)("div",{className:"min-h-0 overflow-hidden",children:[s?(0,a.jsx)(eM,{}):t.length?(0,a.jsx)("div",{className:"mt-4 space-y-3",children:t.map(e=>(0,a.jsxs)("div",{className:"grid gap-4 rounded-[8px] border border-dashed border-[#E6E6E6] bg-[#FBFBFB] px-4 py-3 lg:grid-cols-2 [@media(min-width:1355px)]:grid-cols-4",children:[(0,a.jsx)(eT,{label:"Date",value:eR(e.date,e.dayOfWeek)}),(0,a.jsx)(eT,{label:"Time",value:(0,eu.ns)(e.startTime,e.endTime)}),(0,a.jsx)(eT,{label:"Location name",value:e.locationName}),(0,a.jsx)(eT,{label:"Address",value:e.address})]},e.id))}):(0,a.jsx)("div",{className:"mt-4 flex min-h-[132px] items-center justify-center rounded-[8px] border border-dashed border-[#
1E6E6E6] bg-[#FBFBFB] px-5 py-10 text-center text-[14px] leading-5 text-[#606060]",children:"No history schedules."}),r>i&&(0,a.jsxs)("div",{className:"mt-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"text-[12px] leading-5 text-[#878787]",children:["Page ",n+1," of ",l]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(D,{type:"outline",size:"S",disabled:n<=0||s,onClick:u,children:"Previous"}),(0,a.jsx)(D,{type:"outline",size:"S",disabled:n+1>=l||s,onClick:m,children:"Next"})]})]})]})})]})};var e_=r(13671),ez=r(30120),eB=r(98814),eL=r(34622),eO=r(21860),eV=r(45063),eW=r(57783);let eY=i.forwardRef((e,t)=>{let{className:r,type:n,clearable:l=!1,maxSize:i,trimOnBlur:s=!0,showCharCount:o=!1,value:d,onChange:c,onBlur:u,...m}=e,p=null!=d&&String(d).length>0,h=d?String(d).length:0;return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:n,className:(0,f.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-gray-60 focus-visible:outline-none focus-visible:border-gray-60 focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50",l&&"pr-8",o&&!l&&"pr-12",l&&o&&"pr-20",r),ref:t,value:d,onChange:c,onBlur:e=>{if(s&&d&&"string"==typeof d&&c){let e=d.trim();e!==d&&c({target:{value:e},currentTarget:{value:e}})}u&&u(e)},maxLength:i,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",...m}),l&&p&&(0,a.jsx)("button",{type:"button",onClick:()=>{c&&c({target:{value:""},currentTarget:{value:""}})},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded-sm text-gray-60 hover:text-gray-80 hover:bg-gray-4 transition-colors focus:outline-none focus:ring-0","aria-label":"Clear input",children:(0,a.jsx)(x.Z,{className:"h-4 w-4"})}),o&&(0,a.jsx)("div",{className:(0,f.cn)("absolute ml-4 top-1/2 -translate-y-1/2 text-xs text-gray-60 pointer-events-none",l&&p?"right-8":"right-2"),children:i?"".concat(h,"/").concat(i):h})]})});eY.displayName="Input";var eH=r(6162),eq=r(81330),eU=r(87764);let eK=i.forwardRef((e,t)=>{let{className:r,filter:n,...l}=e;return(0,a.jsx)(eq.mY,{ref:t,className:(0,f.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground focus-visible:outline-none",r),filter:null!=n?n:(e,t)=>e.toLowerCase().includes(t.toLowerCase())?1:0,...l})});eK.displayName=eq.mY.displayName;let eG=i.forwardRef((e,t)=>{let{className:r,clearable:n=!1,...l}=e,s=i.useRef(null),{value:o}=l;return i.useImperativeHandle(t,()=>s.current,[]),(0,a.jsxs)("div",{className:"flex items-center border-b p-3 h-auto gap-2","cmdk-input-wrapper":"",children:[(0,a.jsx)(eU.Z,{className:"h-4 w-4 shrink-0 text-[#949494]"}),(0,a.jsx)(eq.mY.Input,{ref:s,value:o,className:(0,f.cn)("flex w-full rounded-md bg-transparent text-sm outline-none placeholder:text-[#949494] disabled:cursor-not-allowed disabled:opacity-50",r),...l}),n&&(0,a.jsx)("div",{className:"cursor-pointer flex items-center justify-center",onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),s.current){var t;let e=null===(t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))||void 0===t?void 0:t.set;null==e||e.call(s.current,""),s.current.dispatchEvent(new Event("input",{bubbles:!0})),s.current.focus()}},children:(0,a.jsx)(v,{component:ev.Z,size:16,color:"#949494",className:"cursor-pointer"})})]})});eG.displayName=eq.mY.Input.displayName;let eJ=i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(eq.mY.List,{ref:t,className:(0,f.cn)("overflow-y-auto overflow-x-hidden focus-visible:outline-none",r),...n})});eJ.displayName=eq.mY.List.displayName;let eX=i.forwardRef((e,t)=>(0,a.jsx)(eq.mY.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));eX.displayName=eq.mY.Empty.displayName;let eQ=i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(eq.mY.Group,{ref:t,className:(0,f.cn)("overflow-hidden text-foreground focus-visible:outline-none [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",r),...n})});eQ.displayName=eq.mY.Group.displayName;let e$=i.forwardRef((e,t)=>
1{let{className:r,...n}=e;return(0,a.jsx)(eq.mY.Separator,{ref:t,className:(0,f.cn)("-mx-1 h-px bg-border",r),...n})});e$.displayName=eq.mY.Separator.displayName;let e0=i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(eq.mY.Item,{ref:t,className:(0,f.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-[#F2F2F2] data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r),...n})});e0.displayName=eq.mY.Item.displayName;var e1=r(77796),e2=r(84979),e4=r(13742);let e6=e1.fC,e3=e1.ZA,e5=e1.B4,e9=i.forwardRef((e,t)=>{let{className:r,children:n,clearable:l,onClear:s,isFormMode:d,size:c="large",triggerIcon:u,...m}=e,[x,p]=i.useState(!1),h=i.useRef(null);return i.useImperativeHandle(t,()=>h.current,[]),i.useEffect(()=>{let e=h.current;if(!e)return;let t=new MutationObserver(()=>{p(!e.hasAttribute("data-placeholder"))});return t.observe(e,{attributes:!0,attributeFilter:["data-placeholder"]}),p(!e.hasAttribute("data-placeholder")),()=>t.disconnect()},[]),(0,a.jsxs)(e1.xz,{ref:h,className:(0,f.cn)("flex w-full items-center justify-between whitespace-nowrap rounded-ra-6 border border-bdr-low bg-transparent text-sm shadow-none transition-[border-color,background-color] duration-200 ring-0 focus:outline-none disabled:cursor-not-allowed [&>span]:line-clamp-1","hover:border-bdr-mid hover:ring-1 hover:ring-bdr-mid","data-[disabled]:cursor-not-allowed data-[disabled]:bg-dim-low data-[disabled]:!border-bdr-low","data-[disabled]:hover:!border-bdr-low data-[disabled]:hover:!ring-0","data-[placeholder]:text-txt-mid",r),...m,children:[n,(0,a.jsxs)("div",{className:(0,f.cn)("flex flex-row justify-center items-center pointer-events-none","mini"===c?"ml-px gap-sp-4":"ml-sp-8 gap-sp-8"),children:[l&&x&&(0,a.jsx)("div",{className:(0,f.cn)("pointer-events-auto cursor-pointer flex items-center justify-center shrink-0",d&&"opacity-0 transition-opacity group-hover/clear-trigger:opacity-100"),onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),null==s||s(e)},children:(0,a.jsx)(ev.Z,{className:"h-4 w-4 text-txt-low"})}),(0,a.jsx)(e1.JO,{asChild:!0,children:null!=u?u:(0,a.jsx)(o.Z,{className:"h-4 w-4 shrink-0 text-txt-mid"})})]})]})});e9.displayName=e1.xz.displayName;let e7=i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(e1.u_,{ref:t,className:(0,f.cn)("flex cursor-default items-center justify-center py-sp-4",r),...n,children:(0,a.jsx)(e2.Z,{className:"h-4 w-4"})})});e7.displayName=e1.u_.displayName;let e8=i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(e1.$G,{ref:t,className:(0,f.cn)("flex cursor-default items-center justify-center py-sp-4",r),...n,children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})});e8.displayName=e1.$G.displayName;let te=i.forwardRef((e,t)=>{let{className:r,children:n,position:l="popper",...i}=e;return(0,a.jsx)(e1.h_,{children:(0,a.jsxs)(e1.VY,{ref:t,className:(0,f.cn)("relative z-[100] max-h-96 min-w-[8rem] overflow-hidden rounded-ra-6 border border-bdr-low bg-basic-front text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:l,...i,children:[(0,a.jsx)(e7,{}),(0,a.jsx)(e1.l_,{className:(0,f.cn)("p-sp-4","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),(0,a.jsx)(e8,{})]})})});te.displayName=e1.VY.displayName;let tt=i.forwardRef((e,t)=>{let{className:r,labelLines:n=1,...l}=e;return(0,a.jsx)(e1.__,{ref:t,className:(0,f.cn)("px-sp-8 py-sp-6 text-body-medium font-medium",1===n&&"line-clamp-1",2===n&&"line-clamp-2",3===n&&"line-clamp-3",r),...l})});tt.displayName=e1.__.displayName;let tr=i.forwardRef((e,t)=>
1{let{className:r,children:n,labelLines:l=1,...i}=e;return(0,a.jsxs)(e1.ck,{ref:t,className:(0,f.cn)("relative flex w-full cursor-default select-none items-center rounded-ra-2 py-sp-6 pl-sp-8 pr-sp-32 text-body-medium outline-none focus:bg-dim-low focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",1===l&&"[&>span]:line-clamp-1",2===l&&"[&>span]:line-clamp-2",3===l&&"[&>span]:line-clamp-3",r),...i,children:[(0,a.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(e1.wU,{children:(0,a.jsx)(e4.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(e1.eT,{children:n})]})});tr.displayName=e1.ck.displayName;let ta=i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(e1.Z0,{ref:t,className:(0,f.cn)("-mx-1 my-1 h-px bg-muted",r),...n})});ta.displayName=e1.Z0.displayName;var tn=r(86419);let tl=tn.fC,ti=tn.xz;tn.ee,tn.x8;let ts=i.forwardRef((e,t)=>{let{className:r,align:n="center",sideOffset:l=4,usePortal:i=!0,...s}=e,o=(0,a.jsx)(tn.VY,{ref:t,align:n,sideOffset:l,className:(0,f.cn)("z-[100] w-72 rounded-md border bg-white p-4 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2","origin-[--radix-popover-content-transform-origin]",r),...s});return i?(0,a.jsx)(tn.h_,{children:o}):o});ts.displayName=tn.VY.displayName;let to=e=>{let{children:t,type:r="default",style:n,status:l="display",className:i="",handleRemove:s,item:o}=e,d={default:{background:"#393939",color:"#FFFFFF"},secondary:{background:"#E6E6E6",color:"#000000"},success:{background:"rgba(52, 199, 89, 0.12)",color:"#248A3D"},warning:{background:"rgba(255, 149, 0, 0.12)",color:"#A35F00"},error:{background:"rgba(210, 50, 45, 0.08)",color:"#D2322D"},primary:{background:"rgba(0, 122, 255, 0.08)",color:"#0056B2"}}[r];if("input"===l)return(0,a.jsxs)("div",{className:"h-6 px-2 rounded-[4px] inline-flex items-center gap-1.5 bg-[#F2F2F2] hover:bg-[#E6E6E6] text-[#000] ".concat(i),style:{...n},children:[(0,a.jsx)(ed,{size:"small",className:"text-[#000]",children:t}),s&&(0,a.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),s(o)},className:"flex items-center justify-center",children:(0,a.jsx)(v,{component:x.Z,size:12,color:"#949494",className:"cursor-pointer"})})]});let c=(null==n?void 0:n.backgroundColor)||("string"==typeof(null==n?void 0:n.background)?n.background:void 0),u="string"==typeof(null==n?void 0:n.color)?n.color:void 0,m={...n};return"background"in m&&delete m.background,"backgroundColor"in m&&delete m.backgroundColor,"color"in m&&delete m.color,(0,a.jsx)("div",{className:"h-[20px] px-2 rounded-[1000px] inline-flex items-center ".concat(i),style:{backgroundColor:c||d.background,...m},children:(0,a.jsx)("span",{className:"text-[12px] leading-[16px] font-normal tracking-[0px]",style:{color:u||d.color},children:t})})},td=e=>{let{opacity:t=1}=e;return(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{opacity:t},children:[(0,a.jsx)("g",{clipPath:"url(#clip0_860_1166)",children:(0,a.jsx)("path",{d:"M14.4 2.4C14.4 1.95817 14.0418 1.6 13.6 1.6H2.4C1.95817 1.6 1.6 1.95817 1.6 2.4V13.6C1.6 14.0418 1.95817 14.4 2.4 14.4H13.6C14.0418 14.4 14.4 14.0418 14.4 13.6V2.4ZM16 13.6C16 14.9255 14.9255 16 13.6 16H2.4C1.07452 16 0 14.9255 0 13.6V2.4C0 1.07452 1.07452 0 2.4 0H13.6C14.9255 0 16 1.07452 16 2.4V13.6Z",fill:"black"})}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_860_1166",children:(0,a.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})},tc=e=>{let{opacity:t=1}=e;return(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{opacity:t},children:[(0,a.jsxs)("g",{clipPath:"url(#clip0_860_1165)",children:[(0,a.jsx)("path",{d:"M13.6 16C14.9255 16 16 14.9255 16 13.6V2.4C16 1.07452 14.9255 0 13.6 0H2.4C1.07452 0 0 1.07452 0 2.4V13.6C0 14.9255 1.07452 16 2.4 16H13.6Z",fill:"black"}),(0,a.jsx)("path",{d:"M10.5028 5.42367C10.7996 5.12544 11.2807 5.12544 11.5775 5.42367C11.8743 5.72189 11.8743 6.2053 11.5775 6.50352L7.52408 
110.5763C7.22727 10.8746 6.74618 10.8746 6.44937 10.5763L4.42268 8.53993C4.12587 8.2417 4.12587 7.7583 4.42268 7.46007C4.71948 7.16185 5.20058 7.16185 5.49738 7.46007L6.98672 8.95655L10.5028 5.42367Z",fill:"white"})]}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_860_1165",children:(0,a.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})},tu=e=>{let{opacity:t=1}=e;return(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{opacity:t},children:[(0,a.jsxs)("g",{clipPath:"url(#clip0_860_1163)",children:[(0,a.jsx)("path",{d:"M14.4 2.4C14.4 1.95817 14.0418 1.6 13.6 1.6H2.4C1.95817 1.6 1.6 1.95817 1.6 2.4V13.6C1.6 14.0418 1.95817 14.4 2.4 14.4H13.6C14.0418 14.4 14.4 14.0418 14.4 13.6V2.4ZM16 13.6C16 14.9255 14.9255 16 13.6 16H2.4C1.07452 16 0 14.9255 0 13.6V2.4C0 1.07452 1.07452 0 2.4 0H13.6C14.9255 0 16 1.07452 16 2.4V13.6Z",fill:"black"}),(0,a.jsx)("path",{d:"M11 4.4C11.3314 4.4 11.6 4.66863 11.6 5V11C11.6 11.3314 11.3314 11.6 11 11.6H5C4.66863 11.6 4.4 11.3314 4.4 11V5C4.4 4.66863 4.66863 4.4 5 4.4H11Z",fill:"black"})]}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_860_1163",children:(0,a.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})},tm=i.forwardRef((e,t)=>{let{className:r,disabled:n,checked:l,defaultChecked:s,onCheckedChange:o,onClick:d,value:c,name:u,required:m,...x}=e,p=void 0!==l,[h,b]=i.useState(null!=s&&s),g=p?l:h,v=!0===g,y="indeterminate"===g;return(0,a.jsxs)("button",{ref:t,type:"button",role:"checkbox","aria-checked":y?"mixed":v,"aria-required":m||void 0,"data-state":y?"indeterminate":v?"checked":"unchecked",disabled:n,onClick:e=>{if(null==d||d(e),e.defaultPrevented||n)return;let t=!v;p||b(t),null==o||o(t)},className:(0,f.cn)("relative peer h-4 w-4 shrink-0 inline-flex items-center justify-center border-none rounded-sm shadow-none outline-none focus-visible:ring-1 focus-visible:ring-ring",n?"cursor-not-allowed":"cursor-pointer",r),...x,children:[(0,a.jsx)("span",{className:(0,f.cn)("absolute inset-0 inline-flex items-center justify-center pointer-events-none",(v||y)&&"hidden"),children:(0,a.jsx)(td,{opacity:n?.42:1})}),(0,a.jsx)("span",{className:(0,f.cn)("absolute inset-0 inline-flex items-center justify-center pointer-events-none",!v&&"hidden"),children:(0,a.jsx)(tc,{opacity:n?.42:1})}),(0,a.jsx)("span",{className:(0,f.cn)("absolute inset-0 inline-flex items-center justify-center pointer-events-none",!y&&"hidden"),"aria-hidden":!0,children:(0,a.jsx)(tu,{opacity:n?.42:1})}),u&&(0,a.jsx)("input",{type:"checkbox",name:u,value:null!=c?c:"on",checked:v,required:m,disabled:n,tabIndex:-1,readOnly:!0,"aria-hidden":!0,className:"absolute inset-0 opacity-0 pointer-events-none"})]})});tm.displayName="Checkbox";let tx=i.forwardRef((e,t)=>{let{id:r,value:n,onValueChange:l,onChange:s,disabled:o=!1,label:d,className:c,...u}=e,m=i.useId(),x=r||"checkbox-".concat(m);return(0,a.jsxs)("div",{className:(0,f.cn)("flex items-start",d&&"gap-2",c),children:[(0,a.jsx)(tm,{id:x,ref:t,checked:n,onCheckedChange:e=>{null==l||l(e),null==s||s(e)},disabled:o,className:"m-0.5",...u}),(0,a.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:d&&(0,a.jsx)("label",{htmlFor:x,className:(0,f.cn)("text-sm font-normal cursor-pointer select-none",o&&"cursor-not-allowed text-grayscale-m5"),children:d})})]})});tx.displayName="CheckboxComponent";let tp={large:"h-10 py-sp-8 pl-sp-12 pr-sp-8",small:"h-9 py-sp-6 pl-sp-12 pr-sp-8",mini:"h-8 py-sp-6 pl-sp-12 pr-sp-8"},th=i.forwardRef((e,t)=>{let{className:r,value:n,onChange:l,options:s,placeholder:d="Please select",disabled:c=!1,label:u,size:m="large",labelLines:x=1,showGroup:p,clearable:h,searchable:b=!1,searchPlaceholder:g="Search to find more",emptyText:v,noDataText:y="No data.",popoverWidth:w,popoverMinWidth:j,popoverMaxWidth:N,popoverAlign:k="start",maxHeight:C=500,isFormMode:S=!1,triggerIcon:E,...F}=e,M=F["data-has-error"],D=null!=n&&""!==n?String(n):""===n?"":void 0,Z=e=>{null==e||e.preventDefault(),null==e||e.stopPropagation(),null==l||l("")},I=e=>{s.length&&(null==l||l(e))},[P,R]=i.useState(!1),T=tp[m],A=e=>{I(e),R(!1)};return b?(0,a.jsx)("div",{className:(0,f.cn)("relative flex flex-col gap-2",r),children:(0,a.jsxs)(tl,{open:P,onOpenChange:e=>!c&&R(e),children:[(0,a.jsx)(ti,{asChild:!0,children:(0,a.jsxs)("div",{ref:t,role:"combobox","aria-expanded":P,"aria-controls":"selector-options",className:(0,f.cn)("flex h-10 w-full cursor-pointer items-center justify-between rounded-ra-6 border border-bdr-low bg-transparent px-3 py-2 text-sm shadow-none transition-[border-color,background-color] duration-200 ring-0",S&&"group/clear-trigger",T,c&&"cursor-not-allowed bg-dim-low !border-bdr-low text-txt-mid",c&&"hover:!border-bdr-low hover:!ring-0",!c&&"hover:border-bdr-mid hover:ring-1 hover:ring-bdr-mid","focus-visible:border-bdr-low focus-visible:outline-none focus-visible:outline-offset-0","focus:border-bdr-low focus:outline-none focus:outline-offset-0",M&&"!border-fn-danger !focus-visible:outline-0 !focus-visible:border-fn-danger",P&&!c&&"border-bdr-mid ring-1 ring-bdr-mid"),onClick:()=>!c&&R(!0),children:[u&&(0,a.jsxs)("div",{className:"flex items-center shrink-0",children:[(0,a.jsx)(ed,{size:"medium",className:D?"text-txt-high":"text-txt-mid",children:u}),D&&(0,a.jsx)("div",{className:"mx-sp-8 h-5 w-px bg-bdr-low"})]}),(0,a.jsx)("div",{className:(0,f.cn)("flex-1 overflow-hidden min-w-0",u&&D?"!bg-dim-low rounded-ra-4 px-sp-8 py-sp-2 text-body-small h-6 flex items-center justify-start":"bg-transparent flex items-center justify-start"),children:(0,a.jsx)("span",{className:(0,f.cn)("truncate",D?"text-txt-high":"text-txt-mid"),children:D?(()=>{if(!D)return"";if(p)for(let t of s){var e;let r=null===(e=t.children)||void 0===e?void 0:e.find(e=>String(e.value)===D);if(r)return r.label}else{let e=s.find(e=>String(e.value)===D);if(e)return e.label}return""})():u?"":d})}),(0,a.jsxs)("div",{className:(0,f.cn)("flex flex-row justify-center items-center pointer-events-none","mini"===m?"ml-px ga
1p-sp-4":"ml-sp-8 gap-sp-8"),children:[h&&D&&!c&&(0,a.jsx)("div",{className:(0,f.cn)("pointer-events-auto cursor-pointer flex items-center justify-center shrink-0",S&&"opacity-0 transition-opacity group-hover/clear-trigger:opacity-100"),onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:Z,children:(0,a.jsx)(ev.Z,{className:"h-4 w-4 text-txt-low"})}),(0,a.jsx)(o.Z,{className:"h-4 w-4 shrink-0 text-txt-mid"})]})]})}),(0,a.jsx)(ts,{className:(0,f.cn)("p-0",!w&&"w-[var(--radix-popover-trigger-width)]","center"===k&&"data-[side=bottom]:translate-x-[-50%]","end"===k&&"data-[side=bottom]:translate-x-[-100%]"),align:"start",style:{minWidth:j,maxWidth:N,width:w},children:(0,a.jsxs)(eK,{className:"w-full",id:"selector-options",children:[(0,a.jsx)(eG,{placeholder:g||"Search..."}),(0,a.jsx)(eX,{children:v||"No data."}),0===s.length?(0,a.jsx)("div",{className:"py-6 text-center text-body-medium text-txt-mid",children:y}):(0,a.jsx)("div",{className:(0,f.cn)("overflow-y-auto !px-sp-4 !py-sp-8"),style:{overflowY:"auto",WebkitOverflowScrolling:"touch",maxHeight:"number"==typeof C?"".concat(C,"px"):C},onWheel:e=>e.stopPropagation(),children:p?(0,a.jsx)(a.Fragment,{children:s.map(e=>{var t;return(0,a.jsxs)(eQ,{children:[(0,a.jsx)("div",{className:"px-sp-8 py-sp-6 text-body-small text-txt-mid",children:e.label}),null===(t=e.children)||void 0===t?void 0:t.map(e=>(0,a.jsx)(e0,{value:e.label,onSelect:()=>A(String(e.value)),className:(0,f.cn)("flex cursor-pointer items-center gap-sp-8 rounded-ra-2 !px-sp-12",D===String(e.value)&&"bg-dim-low"),children:(0,a.jsx)("span",{className:(0,f.cn)("text-body-medium text-txt-high",1===x&&"line-clamp-1",2===x&&"line-clamp-2",3===x&&"line-clamp-3",4===x&&"line-clamp-4",5===x&&"line-clamp-5",6===x&&"line-clamp-6"),children:e.label})},e.value))]},e.value)})}):(0,a.jsx)(eQ,{children:s.map(e=>(0,a.jsx)(e0,{value:e.label,onSelect:()=>A(String(e.value)),className:(0,f.cn)("flex cursor-pointer items-center gap-sp-8 rounded-ra-2 !px-sp-12",D===String(e.value)&&"bg-dim-low"),children:(0,a.jsx)("span",{className:(0,f.cn)("text-body-medium text-txt-high",1===x&&"line-clamp-1",2===x&&"line-clamp-2",3===x&&"line-clamp-3",4===x&&"line-clamp-4",5===x&&"line-clamp-5",6===x&&"line-clamp-6"),children:e.label})},e.value))})})]})})]})}):(0,a.jsx)("div",{className:(0,f.cn)("relative flex flex-col gap-2",r),children:(0,a.jsxs)(e6,{value:D,onValueChange:I,disabled:c,children:[(0,a.jsxs)(e9,{ref:t,className:(0,f.cn)("flex w-full rounded-ra-6 border border-bdr-low bg-transparent text-sm shadow-none transition-[border-color,background-color] duration-200 ring-0",T,S&&!c&&"group/clear-trigger","data-[disabled]:cursor-not-allowed data-[disabled]:bg-dim-low data-[disabled]:!border-bdr-low data-[disabled]:text-txt-mid","data-[disabled]:hover:!border-bdr-low data-[disabled]:hover:!ring-0","hover:border-bdr-mid hover:ring-1 hover:ring-bdr-mid","focus-visible:border-bdr-low focus-visible:outline-none focus-visible:outline-offset-0","focus:border-bdr-low focus:outline-none focus:outline-offset-0","data-[placeholder]:text-txt-mid data-[placeholder]:font-normal data-[placeholder]:text-sm","data-[disabled]:data-[placeholder]:!text-txt-low",M&&"!border-fn-danger !focus-visible:outline-0 !focus-visible:border-fn-danger"),clearable:h,onClear:Z,isFormMode:S,size:m,triggerIcon:E,children:[u&&(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(ed,{size:"medium",className:D?"text-txt-high":"text-txt-mid",children:u}),D&&(0,a.jsx)("div",{className:"mx-sp-8 h-5 w-px bg-bdr-low"})]}),(0,a.jsx)("div",{className:(0,f.cn)("flex-1 overflow-hidden",u&&n?"!bg-dim-low rounded-ra-4 px-sp-8 py-sp-2 text-body-small h-6 flex items-center justify-start":"bg-transparent flex items-center justify-start"),children:(0,a.jsx)(e5,{placeholder:u&&!D?"":d,className:(0,f.cn)(D?"text-txt-high":"text-txt-low","truncate")})})]}),(0,a.jsx)(te,{className:(0,f.cn)("p-1","center"===k&&"data-[side=bottom]:translate-x-[-50%]","end"===k&&"data-[side=bottom]:translate-x-[-100%]",void 0!==C&&"[&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-basic-back [&::-webkit-scrollbar-thumb]:bg-bdr-low [&::-webkit-scrollbar-thumb]:rounded-ra-full overflow-y-auto"),style:{minWidth:j,maxWidth:N,width:w,maxHeight:void 0!==C?"number"==typeof C?"".concat(C,"px"):C:void 0,...void 0!==C?{scrollbarWidth:"thin",scrollbarColor:"var(--colors-border-color-basic-low-contrast) var(--colors-background-color-basic-back)"}:{}},children:0===s.length?(0,a.jsx)("div",{className:"py-6 text-center text-body-medium text-txt-mid",children:y}):p?(0,a.jsx)(e3,{children:s.map(e=>{var t;return(0,a.jsxs)("div",{children:[(0,a.jsx)(tt,{className:"!font-normal text-body-small text-txt-mid",labelLines:x,children:e.label}),null===(t=e.children)||void 0===t?void 0:t.map(e=>(0,a.jsx)(tr,{value:String(e.value),className:"!text-body-medium !font-normal cursor-pointer rounded-ra-2 text-txt-high focus:bg-dim-low hover:bg-dim-low",labelLines:x,disabled:e.disabled,children:e.label},e.value))]},e.value+e.label)})}):s.map(e=>(0,a.jsx)(tr,{value:String(e.value),className:"!text-body-medium !font-normal cursor-pointer rounded-ra-2 text-txt-high focus:bg-dim-low hover:bg-dim-low",labelLines:x,disabled:e.disabled,children:e.label},e.value))})]})})});th.displayName="Selector";let tf={January:"Jan",February:"Feb",March:"Mar",April:"Apr",May:"May",June:"Jun",July:"Jul",August:"Aug",September:"Sep",October:"Oct",November:"Nov",December:"Dec"},tb=e=>{let{variant:t}=e;return(0,f.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"}[t||"default"])};function tg(e){let{className:t,classNames:r,showOutsideDays:n=!0,...l}=e,s=i.useMemo(()=>void 0!==l.fromYear&&void 0!==l.toYear,[l.fromYear,l.toYear]);return(0,a.jsx)(eH._W,{showOutsideDays:n,className:(0,f.cn)("",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
1ace-x-4 sm:space-y-0 p-3",month:"flex flex-col gap-4",caption:"relative flex h-7 items-center justify-center",caption_label:(0,f.cn)("text-sm font-medium text-high-emphasis",s&&"hidden"),vhidden:s?"hidden":"",caption_dropdowns:"flex items-center gap-1 justify-center w-[calc(100% - 64px - 4px)]",nav:"flex items-center",nav_button:(0,f.cn)(tb({variant:"outline"}),"h-7 w-7 border-bdr-low bg-transparent p-0 text-txt-mid shadow-none"),nav_button_previous:"absolute left-0 !w-8 !h-8",nav_button_next:"absolute right-0 !w-8 !h-8",table:"w-full border-collapse space-y-4",head_row:"flex",head_cell:"text-medium-emphasis rounded-md w-9 font-normal text-xs",row:"flex w-full mt-2",cell:(0,f.cn)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20","range"===l.mode?"[&:has([aria-selected].day-range-start)]:bg-dim-low-contrast [&:has([aria-selected].day-range-end)]:bg-dim-low-contrast [&:has([aria-selected].day-range-middle)]:bg-dim-low-contrast [&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md":"[&:has([aria-selected])]:rounded-md"),day:(0,f.cn)(tb({variant:"ghost"}),"h-9 w-9 p-0 font-normal text-sm text-high-emphasis hover:bg-black/[0.04] aria-selected:opacity-100 rounded-md"),day_range_start:"day-range-start rounded-md bg-high-emphasis text-white hover:bg-high-emphasis hover:text-white",day_range_end:"day-range-end rounded-md bg-high-emphasis text-white hover:bg-high-emphasis hover:text-white",day_selected:"bg-high-emphasis text-white hover:bg-high-emphasis hover:text-white focus:bg-high-emphasis focus:text-white rounded-md",day_today:"bg-black/[0.04] text-high-emphasis font-medium",day_outside:"day-outside text-low-contrast opacity-50 aria-selected:bg-dim-low-contrast aria-selected:text-low-contrast",day_disabled:"text-low-contrast opacity-30",day_range_middle:"day-range-middle aria-selected:bg-dim-low-contrast aria-selected:text-high-emphasis rounded-none",day_hidden:"invisible",...r},components:{IconLeft:e=>(0,a.jsx)(eB.Z,{...e,className:"h-4 w-4"}),IconRight:e=>(0,a.jsx)(eC.Z,{...e,className:"h-4 w-4"}),Dropdown:e=>{let{...t}=e,{children:r=[],value:n,onChange:l,name:s}=t,o=i.useCallback(e=>{let t=Number(e);if(isNaN(t)){console.warn("Invalid number conversion for dropdown value: ".concat(e));return}null==l||l({target:{value:t}})},[l]),d=[];return i.Children.forEach(r,e=>{if(i.isValidElement(e)){var t;let r=e.props;d.push({label:"months"===s&&null!==(t=tf[r.children])&&void 0!==t?t:r.children,value:r.value})}}),(0,a.jsx)(th,{size:"mini",className:"w-20",options:d,value:null==n?void 0:n.toString(),onChange:o})}},...l,captionLayout:"dropdown-buttons"})}tg.displayName="Calendar";var tv=r(32276),ty=r(10146),tw=r(71041),tj=r(12092),tN=r(49315),tk=r(12592),tC=r(29893),tS=r(96241),tE=r(53170),tF=r(37692),tM=r(82727),tD=r(86300),tZ=r(64369),tI=r(2582),tP=r(80554),tR=r(94080);let tT=e=>{let{value:t,onChange:r,onBlur:n,min:l,max:s,className:o,disabled:d}=e,c=i.useRef(null),u=i.useRef(null),m=i.useRef(null),x=i.useRef(null),p=e=>e&&(0,tZ.Z)(e)?{month:(0,eV.ZP)(e,"MM"),day:(0,eV.ZP)(e,"dd"),year:(0,eV.ZP)(e,"yyyy")}:{month:"",day:"",year:""},[h,b]=i.useState(p(t).month),[g,v]=i.useState(p(t).day),[y,w]=i.useState(p(t).year);i.useEffect(()=>{let e=p(t);b(e.month),v(e.day),w(e.year)},[t]);let j=function(e,t,a){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e&&!t&&!a){null==r||r(void 0),i&&(null==n||n());return}if(e&&t&&a&&!(a.length<4))try{let o=parseInt(e),d=parseInt(t),c=parseInt(a);if(o<1||o>12)return;let u=(0,tR.Z)(new Date(c,o-1));if(d<1||d>u)return;let m="".concat(e.padStart(2,"0"),"/").concat(t.padStart(2,"0"),"/").concat(a),x=(0,tD.ZP)(m,"MM/dd/yyyy",new Date);if((0,tZ.Z)(x)){if(l){let e=(0,tI.Z)(l),t=(0,tI.Z)(x);if(t<e)return}if(s){let e=(0,tP.Z)(s),t=(0,tP.Z)(x);if(t>e)return}null==r||r(x),i&&(null==n||n())}}catch(e){}},N=(e,t)=>{var r,a,n,l,i,s;if("Backspace"===e.key){let n=e.currentTarget;""===n.value&&(e.preventDefault(),"day"===t?null===(r=c.current)||void 0===r||r.focus():"year"===t&&(null===(a=u.current)||void 0===a||a.focus()))}"ArrowLeft"===e.key&&(e.preventDefault(),"day"===t?null===(n=c.current)||void 0===n||n.focus():"year"===t&&(null===(l=u.current)||void 0===l||l.focus())),"ArrowRight"===e.key&&(e.preventDefault(),"month"===t?null===(i=u.current)||void 0===i||i.focus():"day"===t&&(null===(s=m.current)||void 0===s||s.focus()))},[k,C]=i.useState(!1),S=()=>C(!0),E=e=>{setTimeout(()=>{var e;let t=document.activeElement,r=(null===(e=x.current)||void 0===e?void 0:e.contains(t))||t===c.current||t===u.current||t===m.current;r||(C(!1),null==n||n())},0)};return i.useEffect(()=>{let e=e=>{if(x.current&&!x.current.contains(e.target)){let e=document.activeElement,l=e===c.current||e===u.current||e===m.current;if(l){var t,r,a;null===(t=c.current)||void 0===t||t.blur(),null===(r=u.current)||void 0===r||r.blur(),null===(a=m.current)||void 0===a||a.blur(),C(!1),null==n||n()}}};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[n]),(0,a.jsxs)("div",{ref:x,className:(0,f.cn)("flex items-center w-full h-10 rounded-ra-6 px-3 py-2","border transition-colors",!k&&!d&&"border-bdr-low",k&&!d&&"ring-1 ring-bdr-mid border-bdr-mid",d&&"bg-dim-low text-txt-high cursor-not-allowed opacity-60 border-bdr-low",o),children:[(0,a.jsxs)("div",{className:"flex flex-1 items-center",children:[(0,a.jsx)(eY,{ref:c,type:"text",inputMode:"numeric",placeholder:"MM",value:h,onChange:e=>{let t=e.target.value.replace(/\D/g,"");if(t.length>2&&(t=parseInt(t).toString()),2===t.length){let e=parseInt(t);e>12?t="12":e<1&&(t="01")}if(b(t),2===t.length){var r,a;null===(r=u.current)||void 0===r||r.focus(),null===(a=u.current)||void 0===a||a.select()}j(t,g,y)},onKeyDown:e=>N(e,"month"),onFocus:e=>{e.target.select(),S()},onBlur:e=>
1{E(e);let t=e.target.value.replace(/\D/g,"");if(t.length>2&&(t=parseInt(t).toString()),t&&1===t.length){let e=parseInt(t);e>=1&&e<=9&&(t=t.padStart(2,"0"))}if(t&&t.length>0){let e=parseInt(t);e>12?t="12":e<1&&(t=1===t.length?"01":"")}if(t!==h&&b(t),t&&2===t.length&&y&&4===y.length){let e=parseInt(t),r=parseInt(y);if(e>=1&&e<=12){let a=(0,tR.Z)(new Date(r,e-1));if(g&&g.length>0){let e=parseInt(g);if(e>a||e<1){let e=a.toString().padStart(2,"0");v(e),j(t,e,y,!1)}else j(t,g,y,!1)}else j(t,g,y,!1)}}else j(t,g,y,!1)},disabled:d,maxLength:3,className:(0,f.cn)("w-[24px] h-auto px-0 py-0 text-center shrink-0","border-0 shadow-none focus-visible:ring-0 focus-visible:outline-none","bg-transparent",d&&"cursor-not-allowed")}),(0,a.jsx)("span",{className:"text-txt-high text-[14px] shrink-0",children:"/"}),(0,a.jsx)(eY,{ref:u,type:"text",inputMode:"numeric",placeholder:"dd",value:g,onChange:e=>{let t=e.target.value.replace(/\D/g,"");if(t.length>2&&(t=parseInt(t).toString()),2===t.length){let e=parseInt(t);if(h&&y&&4===y.length){let r=parseInt(h);if(r>=1&&r<=12){let a=(0,tR.Z)(new Date(parseInt(y),r-1));e>a?t=a.toString().padStart(2,"0"):e<1&&(t="01")}else e>31?t="31":e<1&&(t="01")}else e>31?t="31":e<1&&(t="01")}if(v(t),2===t.length){var r,a;null===(r=m.current)||void 0===r||r.focus(),null===(a=m.current)||void 0===a||a.select()}j(h,t,y)},onKeyDown:e=>N(e,"day"),onFocus:e=>{e.target.select(),S()},onBlur:E,disabled:d,maxLength:3,className:(0,f.cn)("w-[24px] h-auto px-0 py-0 text-center shrink-0","border-0 shadow-none focus-visible:ring-0 focus-visible:outline-none","bg-transparent",d&&"cursor-not-allowed")}),(0,a.jsx)("span",{className:"text-txt-high text-[14px] shrink-0",children:"/"}),(0,a.jsx)(eY,{ref:m,type:"text",inputMode:"numeric",placeholder:"yyyy",value:y,onChange:e=>{let t=e.target.value.replace(/\D/g,"");t.length>4&&(t=t.slice(0,4)),w(t),4===t.length?j(h,g,t,!0):j(h,g,t)},onKeyDown:e=>N(e,"year"),onFocus:e=>{e.target.select(),S()},onBlur:e=>{E(e);let t=e.target.value.replace(/\D/g,"");if(t.length>4&&(t=t.slice(0,4)),t!==y&&w(t),t&&4===t.length&&h&&2===h.length){let e=parseInt(h),r=parseInt(t);if(e>=1&&e<=12){let a=(0,tR.Z)(new Date(r,e-1));if(g&&g.length>0){let e=parseInt(g);if(e>a||e<1){let e=a.toString().padStart(2,"0");v(e),j(h,e,t,!1)}else j(h,g,t,!1)}else j(h,g,t,!1)}}else j(h,g,t,!1)},disabled:d,maxLength:4,className:(0,f.cn)("w-[40px] h-auto px-0 py-0 text-center shrink-0","border-0 shadow-none focus-visible:ring-0 focus-visible:outline-none","bg-transparent",d&&"cursor-not-allowed")})]}),(0,a.jsx)(eL.Z,{className:"h-4 w-4 text-txt-low shrink-0"})]})},tA=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t},t_=e=>{let t=new Date(e);return t.setHours(23,59,59,999),t},tz=()=>{let e=new Date;return[{label:"Today",value:[tA(e),t_(e)]},{label:"Yesterday",value:[tA((0,eW.Z)(e,1)),t_((0,eW.Z)(e,1))]},{label:"This Week",value:[tA((0,tE.Z)(e,{weekStartsOn:0})),t_(e)]},{label:"Last Week",value:[tA((0,tE.Z)((0,tM.Z)(e,1),{weekStartsOn:0})),t_((0,tj.Z)((0,tM.Z)(e,1),{weekStartsOn:0}))]},{label:"This Month",value:[tA((0,tS.Z)(e)),t_(e)]},{label:"Last Month",value:[tA((0,tS.Z)((0,tF.Z)(e,1))),t_((0,tw.Z)((0,tF.Z)(e,1)))]},{label:"Custom",value:[e,e]}]},tB=(e,t)=>i.useMemo(()=>e||(t?tz():[]),[e,t]),tL=(e,t)=>!!e&&!!t&&(0,tC.Z)(e[0],t[0])&&(0,tC.Z)(e[1],t[1]),tO=function(e){let{placeholder:t,className:r,disabled:n=!1,disabledDate:l,"data-has-error":s=!1,dateFormat:o="MMM dd, yyyy",clearable:d=!1,size:c="large",dateMode:u="default",captionLayout:m="buttons",label:x,dateShift:p=!1,value:h,onChange:b}=e,[g,v]=i.useState(!1),[y,w]=i.useState(h||new Date);i.useEffect(()=>{g&&w(h||new Date)},[g,h]);let j=i.useCallback(()=>h?(0,eV.ZP)(h,o):t||"MMM dd, yyyy",[h,o,t]),N=e=>{e&&(null==b||b(e),v(!1))},k=e=>{e.stopPropagation(),null==b||b(void 0)},C=i.useMemo(()=>{if("buttons"===m)return;let e=new Date().getFullYear();return{fromYear:e-100,toYear:e+100}},[m]),S=!!h,E=e=>!!l&&("boolean"==typeof l?l:"function"==typeof l&&l(e)),F=e=>{if(!h)return;let t="left"===e?(0,eW.Z)(h,1):(0,eO.Z)(h,1);null==b||b(t)},M=e=>{if(!h)return!0;let t="left"===e?(0,eW.Z)(h,1):(0,eO.Z)(h,1);return E(t)},D="small"===c?"h-9 w-9":"h-10 w-10",Z=e=>(0,a.jsx)("button",{type:"button",disabled:n||M(e),onClick:()=>F(e),className:(0,f.cn)("flex items-center justify-center shrink-0 rounded-ra-6 border border-bdr-low",D,"transition-all duration-200","hover:ring-2 hover:ring-bdr-mid","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:ring-0"),"aria-label":"left"===e?"Previous date":"Next date",children:"left"===e?(0,a.jsx)(eB.Z,{className:"h-4 w-4"}):(0,a.jsx)(eC.Z,{className:"h-4 w-4"})}),I=(0,f.cn)("w-full justify-between font-normal text-left rounded-ra-6 shadow-none","px-3 py-2","small"===c?"h-9":"h-10",!S&&"!text-txt-low",S&&"text-txt-high",!s&&!n&&!g&&"border border-bdr-low transition-all duration-200",!s&&!n&&g&&"ring-2 ring-bdr-mid transition-all duration-200",!s&&!n&&!g&&"hover:ring-2 hover:ring-bdr-mid",!s&&!n&&"focu
1s-visible:outline-none focus-visible:ring-0 focus-visible:ring-2 focus-visible:ring-bdr-mid",s&&!g&&"border border-fn-danger",s&&"focus-visible:border-fn-danger focus-visible:outline-none focus-visible:ring-0",s&&g&&"border border-fn-danger",n&&"bg-dim-low text-txt-high cursor-not-allowed opacity-60 border-bdr-low",r);if("tag"===u&&S){let e=j();return(0,a.jsxs)(tl,{open:g,onOpenChange:v,children:[(0,a.jsxs)("div",{className:(0,f.cn)(p?"flex items-center gap-2":"",r),children:[p&&Z("left"),(0,a.jsxs)("div",{className:(0,f.cn)("relative",p?"flex-1 min-w-0":"w-full"),children:[(0,a.jsx)(ti,{asChild:!0,children:(0,a.jsx)(eY,{readOnly:!0,disabled:n,value:"",placeholder:"",className:(0,f.cn)(I,"!text-sm","pr-10",d&&S&&!n&&"pr-20"),"data-has-error":s,onClick:()=>{n||v(!0)}})}),(0,a.jsxs)("div",{className:"absolute inset-0 flex items-center gap-2 px-3 pointer-events-none",children:[x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[14px] text-txt-high font-normal shrink-0",children:x}),(0,a.jsx)("div",{className:"h-[50%] w-px bg-dim-mid shrink-0"})]}),(0,a.jsx)("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:(0,a.jsx)(to,{status:"input",type:"default",children:e})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pointer-events-auto",children:[d&&S&&!n&&(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),k(e)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},className:"rounded-sm opacity-70 hover:opacity-100 transition-opacity","aria-label":"Clear selection",children:(0,a.jsx)(ev.Z,{className:"h-4 w-4"})}),(0,a.jsx)(eL.Z,{className:"h-4 w-4 text-txt-low"})]})]})]}),p&&Z("right")]}),(0,a.jsx)(ts,{className:"w-auto p-0",align:"start",onOpenAutoFocus:e=>{e.preventDefault()},children:(0,a.jsx)(tg,{mode:"single",selected:h,onSelect:N,disabled:l,month:y,onMonthChange:w,captionLayout:m,...C})})]})}return(0,a.jsxs)(tl,{open:g,onOpenChange:v,children:[(0,a.jsxs)("div",{className:(0,f.cn)(p?"flex items-center gap-2":"",r),children:[p&&Z("left"),(0,a.jsxs)("div",{className:(0,f.cn)("relative",p?"flex-1 min-w-0":"w-full"),children:[(0,a.jsx)(ti,{asChild:!0,children:(0,a.jsx)(eY,{readOnly:!0,disabled:n,value:j(),placeholder:t||"MMM dd, yyyy",className:(0,f.cn)(I,"!text-sm","pr-10",d&&S&&!n&&"pr-20"),"data-has-error":s,onClick:()=>{n||v(!0)}})}),(0,a.jsxs)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2 pointer-events-none",children:[d&&S&&!n&&(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),k(e)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},className:"rounded-sm opacity-70 hover:opacity-100 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-events-auto","aria-label":"Clear selection",children:(0,a.jsx)(ev.Z,{className:"h-4 w-4"})}),(0,a.jsx)(eL.Z,{className:"h-4 w-4 text-txt-low"})]})]}),p&&Z("right")]}),(0,a.jsx)(ts,{className:"w-auto p-0",align:"start",onOpenAutoFocus:e=>{e.preventDefault()},children:(0,a.jsx)(tg,{mode:"single",selected:h,onSelect:N,disabled:l,month:y,onMonthChange:w,captionLayout:m,...C})})]})};tO.RangePicker=function(e){let{placeholder:t="Select date range",className:r,disabled:n=!1,disabledDate:l,"data-has-error":s=!1,dateFormat:o="MMM dd, yyyy",clearable:d=!1,size:c="large",dateMode:u="default",label:m,value:x,onChange:p,quickSelect:h=!1,presets:b,tagUpdateLabel:g,maxRange:v,dateShift:y=!1}=e,[w,j]=i.useState(!1),[N,k]=i.useState((null==x?void 0:x[0])||new Date),[,C]=i.useReducer(e=>e+1,0),S=i.useRef(w),E=i.useRef(void 0),F=i.useRef(void 0),M=i.useRef("none"),[Z,I]=i.useState(null),[P,R]=i.useState(void 0),[T,A]=i.useState(void 0),_=tB(b,h);i.useEffect(()=>{w&&!S.current&&(M.current="none",x&&x[0]&&x[1]?(E.current=x[0],F.current=x[1],R(x[0]),A(x[1])):(E.current=void 0,F.current=void 0,R(void 0),A(void 0)),k((null==x?void 0:x[0])||new Date),C()),S.current=w},[w,x]),i.useEffect(()=>{if(x&&x[0]&&x[1]){let e=_.find(e=>"Custom"===e.label||"Custom Range"===e.label);e&&(e.value=[x[0],x[1]]);let t=_.find(e=>"Custom"!==e.label&&"Custom Range"!==e.label&&tL(x,e.value));t?I(t):e?I(e):I(null)}},[x,_]);let z=e=>{if(!e)return;let t=tA(e);if("none"===M.current){E.current=t,F.current=void 0,R(t),A(void 0),M.current="start",C();return}if("start"===M.current){let e=E.current,r=t_(t);(0,tk.Z)(r,e)&&([e,r]=[r,e],e=tA(e),r=t_(r)),E.current=e,F.current=r,R(e),A(r),M.current="end",C(),null==p||p([e,r]),j(!1)}},B=e=>{if(I(e),"Custom"===e.label||"Custom Range"===e.label){x&&x[0]&&x[1]?(R(x[0]),A(x[1])):(R(void 0),A(void 0));return}null==p||p(e.value),j(!1)},L=()=>
1{if(P&&T){let e=tA(P),t=t_(T);(0,tk.Z)(t,e)&&([e,t]=[t,e],e=tA(e),t=t_(t)),E.current=e,F.current=t,M.current="end",null==p||p([e,t]),j(!1)}},O=()=>w?E.current&&F.current?{from:E.current,to:F.current}:E.current?{from:E.current,to:void 0}:void 0:x&&x[0]&&x[1]?{from:x[0],to:x[1]}:void 0,V=i.useCallback(()=>{if(!x||!x[0]||!x[1])return"";let e=(0,eV.ZP)(x[0],o),t=(0,eV.ZP)(x[1],o);return"".concat(e," - ").concat(t)},[x,o]),W=e=>{e.stopPropagation(),null==p||p(void 0),I(null)},Y=!!(x&&x[0]&&x[1]),H="small"===c?"h-9":"h-10",q=()=>{if(!v||"start"!==M.current||!E.current)return l;let e=E.current,t=t=>{if("number"==typeof v||"days"in v){let r="number"==typeof v?v:v.days;return Math.abs((0,ty.Z)(t,e))>=r}let r=(0,tF.Z)(e,v.months),a=(0,tv.Z)(e,v.months);return(0,tk.Z)(t,r)||(0,tN.Z)(t,a)};return l?"function"==typeof l?e=>l(e)||t(e):[l,t]:t},U=e=>!!l&&("boolean"==typeof l?l:"function"==typeof l&&l(e)),K=(e,t)=>1===e.getDate()&&(0,tC.Z)(t,(0,tw.Z)(e)),G=e=>{if(!x||!x[0]||!x[1])return;let[t,r]=x;if(K(t,r)){let r="left"===e?(0,tF.Z)(t,1):(0,tv.Z)(t,1);null==p||p([tA((0,tS.Z)(r)),t_((0,tw.Z)(r))]);return}let a=(0,ty.Z)(r,t)+1,n="left"===e?tA((0,eW.Z)(t,a)):tA((0,eO.Z)(t,a)),l="left"===e?t_((0,eW.Z)(r,a)):t_((0,eO.Z)(r,a));null==p||p([n,l])},J=e=>{let t,r;if(!x||!x[0]||!x[1])return!0;let[a,n]=x;if(K(a,n)){let n="left"===e?(0,tF.Z)(a,1):(0,tv.Z)(a,1);t=(0,tS.Z)(n),r=(0,ty.Z)((0,tw.Z)(n),t)+1}else r=(0,ty.Z)(n,a)+1,t="left"===e?(0,eW.Z)(a,r):(0,eO.Z)(a,r);for(let e=0;e<r;e++)if(U(tA((0,eO.Z)(t,e))))return!0;return!1},X="small"===c?"h-9 w-9":"h-10 w-10",Q=e=>(0,a.jsx)("button",{type:"button",disabled:n||J(e),onClick:()=>G(e),className:(0,f.cn)("flex items-center justify-center shrink-0 rounded-ra-6 border border-bdr-low",X,"transition-all duration-200","hover:ring-2 hover:ring-bdr-mid","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:ring-0"),"aria-label":"left"===e?"Previous range":"Next range",children:"left"===e?(0,a.jsx)(eB.Z,{className:"h-4 w-4"}):(0,a.jsx)(eC.Z,{className:"h-4 w-4"})}),$=()=>{let e=_.length>0,t=(null==Z?void 0:Z.label)==="Custom"||(null==Z?void 0:Z.label)==="Custom Range";return(0,a.jsxs)("div",{className:"flex flex-col rounded-ra-6 bg-basic-front",children:[(0,a.jsxs)("div",{className:"flex gap-4 p-4",children:[e&&(0,a.jsx)("div",{className:"flex flex-col gap-1 border-r border-bdr-low px-0 py-2 w-[169px] max-h-[500px] overflow-y-auto",children:_.map(e=>{let t=(null==Z?void 0:Z.label)===e.label,r=(()=>{if(("Custom"===e.label||"Custom Range"===e.label)&&x&&x[0]&&x[1]){let e=x[0].getFullYear(),t=x[1].getFullYear(),r=e===t?(0,eV.ZP)(x[0],"MMM dd"):(0,eV.ZP)(x[0],"MMM dd, yyyy"),a=(0,eV.ZP)(x[1],"MMM dd, yyyy");return"".concat(r," - ").concat(a)}return"Custom"===e.label||"Custom Range"===e.label?"":"".concat((0,eV.ZP)(e.value[0],"MMM dd")," - ").concat((0,eV.ZP)(e.value[1],"MMM dd, yyyy"))})();return(0,a.jsxs)("button",{onClick:()=>B(e),className:(0,f.cn)("flex items-center px-3 py-sp-6 text-left rounded-ra-4 transition-colors w-full min-h-[48px]","hover:bg-black/[0.04]",t&&"bg-black/[0.04]"),children:[(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-1 ",children:[(0,a.jsx)("span",{className:"text-body-medium text-txt-high",children:e.label}),r&&(0,a.jsx)("span",{className:"text-body-small text-txt-low",children:r})]}),t&&(0,a.jsx)(e4.Z,{className:"h-4 w-4 text-txt-high shrink-0"})]},e.label)})}),(0,a.jsx)(tg,{mode:"range",selected:O(),disabled:q(),month:N,onMonthChange:k,numberOfMonths:2,onDayClick:z,captionLayout:"dropdown",classNames:{months:"flex flex-row gap-6 items-start",month:(0,f.cn)("space-y-4 relative","[&:first-child]:after:content-[''] [&:first-child]:after:absolute [&:first-child]:after:right-[-12px] [&:first-child]:after:top-0 [&:first-child]:after:bottom-0 [&:first-child]:after:w-px [&:first-child]:after:bg-dim-mid")}})]}),t&&(0,a.jsxs)("div",{className:"flex justify-end items-end gap-3 px-6 py-6 border-t border-bdr-low",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 w-[160px]",children:[(0,a.jsx)("label",{className:"text-body-medium text-txt-high",children:"Start date"}),(0,a.jsx)(tT,{value:P,onChange:e=>{R(e)},disabled:n,className:"w-full"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 w-[160px]",children:[(0,a.jsx)("label",{className:"text-body-medium text-txt-high",children:"End date"}),(0,a.jsx)(tT,{value:T,onChange:e=>{A(e)},min:P,disabled:n,className:"w-full"})]}),(0,a.jsx)(D,{onClick:L,disabled:!P||!T||P&&T&&(0,tk.Z)(T,P),type:"default",size:"M",children:"Apply"})]})]})};if("tag"===u){let e=Y?V():"",l=null==Z?void 0:Z.label,i=g?l||m:m||l,o=(0,f.cn)("inline-flex items-center gap-2 font-normal text-left rounded-ra-6","px-3 py-2",H,Y?"text-txt-high":"text-txt-low",!s&&!n&&"border transition-all duration-200",!s&&!n&&!w&&"border-bdr-low",!s&&!n&&w&&"border-bdr-low ring-2 ring-bdr-mid",!s&&!n&&!w&&"hover:ring-2 hover:ring-bdr-mid",!s&&!n&&"focu
1s-visible:outline-none focus-visible:ring-0 focus-visible:ring-2 focus-visible:ring-bdr-mid",s&&"border border-fn-danger",s&&"focus-visible:border-fn-danger focus-visible:outline-none focus-visible:ring-0",n&&"bg-dim-low text-txt-high cursor-not-allowed opacity-60 border-bdr-low","w-auto");return(0,a.jsxs)(tl,{open:w,onOpenChange:j,children:[(0,a.jsxs)("div",{className:(0,f.cn)(y?"flex items-center gap-2":"",r),children:[y&&Q("left"),(0,a.jsx)("div",{className:(0,f.cn)(y?"inline-block":"relative inline-block"),children:(0,a.jsx)(ti,{asChild:!0,children:(0,a.jsx)("button",{type:"button",disabled:n,className:o,"data-has-error":s,onClick:()=>{n||j(!0)},children:Y?(0,a.jsxs)(a.Fragment,{children:[i&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[14px] text-txt-high font-normal shrink-0 whitespace-nowrap",children:i}),(0,a.jsx)("div",{className:"h-[50%] w-px bg-dim-mid shrink-0"})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,a.jsx)(to,{status:"input",type:"default",children:e})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[d&&!n&&(0,a.jsx)("span",{role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),W(e)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),W(e))},className:"rounded-sm hover:opacity-100 transition-opacity pointer-events-auto cursor-pointer","aria-label":"Clear selection",children:(0,a.jsx)(ev.Z,{className:"h-4 w-4 text-txt-low"})}),(0,a.jsx)(eL.Z,{className:"h-4 w-4 text-txt-low"})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[14px] text-txt-mid whitespace-nowrap",children:t}),(0,a.jsx)(eL.Z,{className:"h-4 w-4 text-txt-low"})]})})})}),y&&Q("right")]}),(0,a.jsx)(ts,{className:"w-auto p-0",align:"start",onOpenAutoFocus:e=>{e.preventDefault()},children:$()})]})}let ee=()=>{let e=(null==x?void 0:x[0])?(0,eV.ZP)(x[0],o):"Start date",l=(null==x?void 0:x[1])?(0,eV.ZP)(x[1],o):"End date",i="".concat(e," - ").concat(l),c=(0,f.cn)("w-full justify-between font-normal text-left rounded-ra-6","px-3 py-2",H,Y&&"text-txt-high",!Y&&"!text-txt-low",!s&&!n&&!w&&"border border-bdr-low transition-all duration-200",!s&&!n&&w&&"ring-2 ring-bdr-mid transition-all duration-200",!s&&!n&&!w&&"hover:ring-2 hover:ring-bdr-mid",!s&&!n&&"focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-2 focus-visible:ring-bdr-mid",s&&!w&&"border border-fn-danger",s&&"focus-visible:border-fn-danger focus-visible:outline-none focus-visible:ring-0",s&&w&&"border border-fn-danger",n&&"bg-dim-low text-txt-high cursor-not-allowed opacity-60 border-bdr-low");return(0,a.jsxs)("div",{className:(0,f.cn)("relative w-full",r),children:[(0,a.jsx)(ti,{asChild:!0,children:(0,a.jsx)(eY,{readOnly:!0,disabled:n,value:Y?i:t,className:(0,f.cn)(c,"!text-sm","pr-10",d&&Y&&!n&&"pr-20"),"data-has-error":s,onClick:()=>{n||j(!0)}})}),(0,a.jsxs)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2 pointer-events-none",children:[d&&Y&&!n&&(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),W(e)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},className:"rounded-sm opacity-70 hover:opacity-100 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-events-auto","aria-label":"Clear selection",children:(0,a.jsx)(ev.Z,{className:"h-4 w-4 text-txt-low"})}),(0,a.jsx)(eL.Z,{className:"h-4 w-4 text-txt-low"})]})]})};return(0,a.jsxs)(tl,{open:w,onOpenChange:j,children:[y?(0,a.jsxs)("div",{className:(0,f.cn)("flex items-center gap-2",r),children:[Q("left"),(0,a.jsx)("div",{className:"relative flex-1 min-w-0",children:ee()}),Q("right")]}):(0,a.jsx)("div",{className:(0,f.cn)("relative w-full",r),children:ee()}),(0,a.jsx)(ts,{className:"w-auto p-0",align:"start",onOpenAutoFocus:e=>{e.preventDefault()},children:$()})]})};var tV=r(45077);let tW=function(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e)return"";if(!a&&e.length<2)return e;let n=Number(e);return Number.isNaN(n)?e:void 0!==t&&n<t?String(t).padStart(2,"0"):void 0!==r&&n>r?String(r).padStart(2,"0"):a?e.padStart(2,"0"):e},tY=i.forwardRef((e,t)=>
1{let{value:r,placeholder:n,disabled:l,onValueChange:i,min:s,max:o,onComplete:d,className:c,style:u}=e;return(0,a.jsx)("div",{className:(0,f.cn)(u?"w-[var(--time-picker-input-width)]":"w-[88px]",c),style:u,children:(0,a.jsx)(ew,{ref:t,inputMode:"numeric",disabled:l,value:r,placeholder:n,trimOnBlur:!1,onChange:e=>{if(l)return;let t=e.target.value,r=t.replace(/\s+/g,""),a=r.replace(/\D+/g,"");i(a=a.slice(0,2)),2===a.length&&d&&setTimeout(()=>{d()},0)},onBlur:()=>{if(!r)return;let e=tW(r.replace(/\D+/g,"").slice(0,2),s,o,!0);e!==r&&i(e)},onFocus:e=>{e.currentTarget.select()},className:"w-full",size:"large"})})});tY.displayName="TimeUnitInput";let tH=e=>{let{value:t,disabled:r,onChange:n}=e,l=e=>{r||e===t||n(e)},i=e=>{let n=t===e;return(0,a.jsx)("button",{type:"button",onClick:()=>l(e),className:(0,f.cn)("py-sp-6 px-sp-8 h-[36px] w-[40px] rounded-ra-6 text-body-medium transition-colors",n?(0,f.cn)("bg-basic-front shadow-sm",r?"text-txt-min cursor-not-allowed":"text-txt-high"):r?"text-txt-min cursor-not-allowed":"text-txt-low"),children:e})};return(0,a.jsxs)("div",{className:(0,f.cn)("inline-flex items-center px-sp-2 rounded-ra-6 bg-dim-low h-[40px] text-body-medium",r&&"cursor-not-allowed"),children:[i("AM"),i("PM")]})},tq=e=>e.toString().padStart(2,"0");function tU(e,t){return 60*("AM"===t?12===e?0:e:12===e?12:e+12)}function tK(e,t){return t.some(t=>{let[r,a]=t;return e>=r&&e<=a})}function tG(e,t,r){for(let a=e;a<=t;a++)if(!tK(a,r))return!1;return!0}
1function tJ(e){let{colKey:t,options:r,selected:n,setSelected:l,locked:s,lockedSet:o,isMeridiem:d,selectedRefs:c,itemBase:u,itemActive:m,itemLockedSelected:x,itemLockedAll:p}=e,h=i.useRef(null);return i.useEffect(()=>{let e=h.current;if(!e)return;let t=t=>{t.preventDefault(),t.stopPropagation(),e.scrollTop+=t.deltaY};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[]),(0,a.jsx)("div",{ref:h,className:(0,f.cn)("flex flex-col overflow-x-clip overflow-y-auto overscroll-contain min-h-0 h-full items-center shrink-0 bg-basic-front text-body-medium","[&::-webkit-scrollbar]:w-[8px] [&::-webkit-scrollbar]:[background:transparent]","[&::-webkit-scrollbar-track]:[background:transparent]","[&::-webkit-scrollbar-thumb]:[border-radius:99px] [&::-webkit-scrollbar-thumb]:[background:var(--colors-background-color-dim-mid-contrast)]",d?"p-sp-2 shadow-[inset_1px_0px_0px_0px_var(--colors-border-color-basic-low-contrast)]":"pl-sp-2 pr-sp-4 py-sp-2"),children:r.map(e=>{let r=n===e,i=s||!!(null==o?void 0:o.has(e));return(0,a.jsx)("div",{ref:e=>{r&&(c.current[t]=e)},role:"button",tabIndex:i?-1:0,onClick:()=>!i&&l(e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||i||(t.preventDefault(),l(e))},className:(0,f.cn)(u,d&&"justify-center",!i&&"cursor-pointer",r&&(i?x:m),i&&p),children:e},e)})})}function tX(e){var t,r,n;let{type:l,value:s,disabled:o,disabledHour:d,disabledMinute:c,disabledSecond:u,disabledMeridiem:m,disabledRanges:x,onChange:p,onApply:h,onClose:f,footerVariant:b="clearApply"}=e,[g,v]=i.useState(s);i.useEffect(()=>v(s),[s]);let y="h"!==l,w="hms"===l,j=!!(o||d),N=!!(o||c),k=!!(o||u),C=!!(o||m),S=i.useMemo(()=>(function(e,t,r){let a={hours:new Set,minutes:new Set,seconds:new Set,meridiems:new Set};if(!t||0===t.length)return a;for(let r=1;r<=12;r++){let n=tU(r,e.meridiem);tG(n,n+59,t)&&a.hours.add(tq(r))}if("h"!==r){if(e.hour){let r=parseInt(e.hour);if(!isNaN(r)&&r>=1&&r<=12){let n=tU(r,e.meridiem);for(let e=0;e<60;e++)tK(n+e,t)&&a.minutes.add(tq(e))}}else for(let e=0;e<60;e++)a.minutes.add(tq(e))}if("hms"===r&&e.hour&&e.minute){let r=parseInt(e.hour),n=parseInt(e.minute);if(!isNaN(r)&&!isNaN(n)){let l=tU(r,e.meridiem)+n;if(tK(l,t))for(let e=0;e<60;e++)a.seconds.add(tq(e))}}return tG(0,719,t)&&a.meridiems.add("AM"),tG(720,1439,t)&&a.meridiems.add("PM"),a})(g,null!=x?x:[],l),[g,x,l]),E=S.hours,F=S.minutes,M=S.seconds,Z=S.meridiems,I=["12",...Array.from({length:11},(e,t)=>tq(t+1))],P=Array.from({length:60},(e,t)=>tq(t)),R=Array.from({length:60},(e,t)=>tq(t)),T=null!==(t=g.hour)&&void 0!==t?t:"",A=null!==(r=g.minute)&&void 0!==r?r:"",_=null!==(n=g.second)&&void 0!==n?n:"",z=e=>{var t,r,a;let n={hour:null!==(t=e.hour)&&void 0!==t?t:"",meridiem:e.meridiem||"AM"};"h"!==l&&(n.minute=null!==(r=e.minute)&&void 0!==r?r:""),"hms"===l&&(n.second=null!==(a=e.second)&&void 0!==a?a:""),p(n)},B=(()=>{if(o||!g.hour)return!0;if(x&&x.length>0){let e=parseInt(g.hour,10);if(!isNaN(e)&&e>=1&&e<=12){let t=g.minute?parseInt(g.minute,10):0,r=tU(e,g.meridiem)+(isNaN(t)?0:t);if(tK(r,x))return!0}}return!1})(),L=e=>e||"--",O="h"===l?L(T):"hm"===l?"".concat(L(T),":").concat(L(A)):"".concat(L(T),":").concat(L(A),":").concat(L(_)),V=i.useRef({});i.useEffect(()=>{requestAnimationFrame(()=>{Object.values(V.current).forEach(e=>{null==e||e.scrollIntoView({block:"center",behavior:"instant"})})})},[]);let W=(e,t,r,n,l,i,s)=>(0,a.jsx)(tJ,{colKey:e,options:t,selected:r,setSelected:n,locked:l,lockedSet:i,isMeridiem:s,selectedRefs:V,itemBase:"h-[28px] px-sp-16 text-body-medium leading-[28px] text-center select-none flex items-center justify-center whitespace-nowrap rounded-ra-6 hover:bg-dim-mid",itemActive:"bg-dim-low text-txt-high",itemLockedSelected:"bg-dim-low text-txt-mid",
1itemLockedAll:"pointer-events-none cursor-not-allowed text-txt-low"},e);return(0,a.jsxs)("div",{className:"flex flex-col rounded-ra-6 bg-basic-front shadow-md border border-bdr-low overflow-clip h-[300px]",children:[(0,a.jsx)("div",{className:"py-sp-8 flex items-center justify-center text-label-medium text-txt-high shrink-0",children:O}),(0,a.jsxs)("div",{className:"flex flex-1 min-h-0 overflow-clip",children:[W("hour",I,T,e=>v(t=>({...t,hour:e})),j,E),y&&W("minute",P,A,e=>v(t=>({...t,minute:e})),N,F),w&&W("second",R,_,e=>v(t=>({...t,second:e})),k,M),W("meridiem",["AM","PM"],g.meridiem,e=>v(t=>({...t,meridiem:e})),C,Z,!0)]}),(0,a.jsx)("div",{className:"border-t border-bdr-low shrink-0"}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-sp-8 shrink-0",children:[(0,a.jsx)("div",{className:"flex-1 flex items-start",children:(0,a.jsx)(D,{type:"outline",size:"XS",disabled:o,onClick:"cancelApply"===b?f:()=>{let e={hour:"",meridiem:"AM"};"h"!==l&&(e.minute=""),"hms"===l&&(e.second=""),v(e),z(e)},children:"cancelApply"===b?"Cancel":"Clear"})}),(0,a.jsx)("div",{className:"flex-1 flex items-end justify-end",children:(0,a.jsx)(D,{type:"default",size:"XS",disabled:B,onClick:()=>{var e,t,r;let a={hour:null!==(e=g.hour)&&void 0!==e?e:"",meridiem:g.meridiem||"AM"};"h"!==l&&(a.minute=null!==(t=g.minute)&&void 0!==t?t:""),"hms"===l&&(a.second=null!==(r=g.second)&&void 0!==r?r:""),p(a),h(a),f()},children:"Apply"})})]})]})}function tQ(e){var t,r;let{type:n,value:l,disabled:s,disabledHour:o,disabledMinute:d,disabledSecond:c,disabledMeridiem:u,onChange:m,compact:x,inputWidth:p,inputClassName:h}=e,f=null!=h?h:x?"w-[56px]":void 0,b=void 0!==p?{"--time-picker-input-width":"number"==typeof p?"".concat(p,"px"):p}:void 0,g="h"!==n,v="hms"===n,y=i.useRef(null),w=i.useRef(null),j=i.useRef(null),N=!l.hour,k=N?"":null!==(t=l.minute)&&void 0!==t?t:"",C=N?"":null!==(r=l.second)&&void 0!==r?r:"";return(0,a.jsxs)("div",{className:"flex items-center gap-sp-6",children:[(0,a.jsx)(tY,{ref:y,value:l.hour,placeholder:"00",disabled:s||o,min:1,max:12,onValueChange:e=>{m({...l,hour:e})},onComplete:()=>{g&&w.current&&w.current.focus()},className:f,style:b}),g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-txt-mid select-none",children:":"}),(0,a.jsx)(tY,{ref:w,value:k,placeholder:"00",disabled:s||d,min:0,max:59,onValueChange:e=>{m({...l,minute:e})},onComplete:()=>{v&&j.current&&j.current.focus()},className:f,style:b})]}),v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-txt-mid select-none",children:":"}),(0,a.jsx)(tY,{ref:j,value:C,placeholder:"00",disabled:s||c,min:0,max:59,onValueChange:e=>{m({...l,second:e})},className:f,style:b})]}),(0,a.jsx)(tH,{value:l.meridiem,disabled:s||u,onChange:e=>m({...l,meridiem:e})})]})}let t$=i.forwardRef((e,t)=>{var r,n;let{variant:l="timeInput",type:s="hm",value:o,defaultValue:d,onChange:c,label:u,description:m,disabled:x,disabledHour:p,disabledMinute:h,disabledSecond:b,disabledMeridiem:g,disabledRanges:v,inputWidth:y,inputClassName:w,className:j,...N}=e,k=i.useMemo(()=>{var e,t,r;let a=null!=d?d:"h"===s?{hour:"12",meridiem:"AM"}:"hm"===s?{hour:"12",minute:"00",meridiem:"AM"}:{hour:"12",minute:"00",second:"00",meridiem:"AM"};return"h"===s?{...a,minute:void 0,second:void 0}:"hm"===s?{...a,minute:null!==(e=a.minute)&&void 0!==e?e:"00",second:void 0}:{...a,minute:null!==(t=a.minute)&&void 0!==t?t:"00",second:null!==(r=a.second)&&void 0!==r?r:"00"}},[d,s]),[C,S]=i.useState(k);i.useEffect(()=>{o&&S(o)},[o]);let E=null!=o?o:C,[F,M]=i.useState(!1),D=e=>{var t,r,a;let n={meridiem:null!==(t=e.meridiem)&&void 0!==t?t:"AM",hour:e.hour||""};"h"!==s&&(n.minute=null!==(r=e.minute)&&void 0!==r?r:"00"),"hms"===s&&(n.second=null!==(a=e.second)&&void 0!==a?a:"00"),o||S(n),null==c||c(n)},Z=!!E.hour,I=Z?"".concat(E.hour,":").concat(null!==(r=E.minute)&&void 0!==r?r:"00").concat("hms"===s?":".concat(null!==(n=E.second)&&void 0!==n?n:"00"):""," ").concat(E.meridiem):"Custom Hours",P=(0,a.jsxs)("div",{className:"flex flex-col gap-sp-8",children:[u?(0,a.jsx)("div",{className:"text-label-medium text-txt-high",children:u}):null,(0,a.jsx)(tQ,{type:s,value:E,disabled:x,disabledHour:p,disabledMinute:h,disabledSecond:b,disabledMeridiem:g,onChange:D,compact:"timePicker"===l,inputWidth:y,inputClassName:w}),m?(0,a.jsx)("div",{className:"text-body-medium text-txt-mid",children:m}):null]});return"timePicker"===l?(0,a.jsxs)("div",{ref:t,className:(0,f.cn)("w-fit",j),...N,children:[u?(0,a.jsx)("div",{className:"text-label-medium text-txt-high mb-sp-8",children:u}):null,(0,a.jsxs)(tl,{children:[x?(0,a.jsxs)("div",{role:"button","aria-disabled":!0,className:(0,f.cn)("group flex items-center gap-sp-8 w-fit cursor-not-allowed","h-[40px] rounded-ra-6 border border-bdr-low bg-dim-low px-sp-12","text-body-medium text-left text-txt-low"),children:[(0,a.jsx)("span",{className:"text-body-medium",children:I}),(0,a.jsx)(tV.Z,{className:"size-4 shrink-0 text-txt-low","aria-hidden":!0})]}):(0,a.jsx)(ti,{asChild:!0,children:(0,a.jsxs)("div",{role:"button",tabIndex:0,onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.currentTarget.click())},className:(0,f.cn)("group flex items-center gap-sp-8 w-fit cursor-pointer","h-[40px] rounded-ra-6 border border-bdr-low bg-basic-front px-sp-12","text-body-medium text-left outline-none",Z?"text-txt-high":"text-txt-low"),children:[(0,a.jsx)("span",{className:"text-body-medium",children:I}),(0,a.jsx)(tV.Z,{className:"size-4 shrink-0 text-txt-mid","aria-hidden":!0})]})}),(0,a.jsx)(ts,{align:"start",className:"w-auto p-sp-16",children:P})]})]}):"timePickerDropdown"===l?(0,a.jsxs)("div",{ref:t,className:(0,f.cn)("w-fit",j),...N,children:[u?(0,a.jsx)("div",{className:"text-label-medium text-txt-high mb-sp-8",children:u}):null,(0,a.jsxs)(tl,{open:F,onOpenChange:M,children:[x?(0,a.jsxs)("div",{role:"button","aria-disabled":!0,className:(0,f.cn)("group flex items-center gap-sp-8 w-fit cursor-not-allowed","h-[40px] rounded-ra-6 border border-bdr-low bg-dim-low px-sp-12","text-body-medium text-left text-txt-low"),children:[(0,a.jsx)("span",{className:"text-body-medium",children:I}),(0,a.jsx)(tV.Z,{className:"size-4 shrink-0 text-txt-low","aria-hidden":!0})]}):(0,a.jsx)(ti,{asChild:!0,children:(0,a.jsxs)("div",{role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.currentTarget.click())},className:(0,f.cn)("group flex items-center gap-sp-8 w-fit cursor-pointer","h-[40px] rounded-ra-6 border border-bdr-low bg-basic-front px-sp-12","text-body-medium text-left outline-none",Z?"text-txt-high":"text-txt-low"),children:[(0,a.jsx)("span",{className:"text-body-medium",children:I}),(0,a.jsx)(tV.Z,{className:"size-4 shrink-0 text-txt-mid","aria-hidden":!0})]})}),(0,a.jsx)(ts,{align:"start",className:"w-auto p-0 border-0 bg-transparent",children:(0,a.jsx)(tX,{type:s,value:E,disabled:x,disabledHour:p,disabledMinute:h,disabledSecond:b,disabledMeridiem:g,disabledRanges:v,onChange:D,onApply:()=>{},onClose:()=>M(!1)})})]}),m?(0,a.jsx)("div",{className:"text-body-medium text-txt-mid mt-sp-8",children:m}):null]}):(0,a.jsx)("div",{ref:t,className:(0,f.cn)("w-fit",j),...N,children:P})});t$.displayName="TimePicker";
1let t0="America/New_York",t1="Time overlaps with another schedule entry.",t2="max(68px, calc((100% - 106px) / 2))",t4="!w-full [&>div]:!w-full [&>div>div]:!w-full [&_input]:!bg-white [&_input]:!font-normal",t6=e=>String(e).padStart(2,"0"),t3=["date","timeRange","locationName","address"],t5=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"hm",t={hour:"",meridiem:"AM"};return"h"!==e&&(t.minute=""),"hms"===e&&(t.second=""),t},t9=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hm";return!!e.hour&&!(e.hour.length<2)&&("h"===t||!!e.minute&&!(e.minute.length<2))&&("hms"!==t||!!e.second&&!(e.second.length<2))},t7=(e,t,r)=>{let a=(null!=e?e:"").replace(/\D+/g,"").slice(0,2);if(!a)return"";let n=Number(a);return Number.isFinite(n)?t6(Math.max(t,Math.min(r,n))):""},t8=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hm",r=t7(e.hour,1,12),a={hour:r,meridiem:e.meridiem||"AM"};return"h"!==t&&(a.minute=r?t7(e.minute||"00",0,59):""),"hms"===t&&(a.second=r?t7(e.second||"00",0,59):""),a},re=(0,i.forwardRef)((e,t)=>{let{value:r,onChange:n,pickerValue:l,onPickerChange:s,type:o="hm",onFocus:d,onBlur:c,...u}=e,m=null!=l?l:t5(o),[x,p]=(0,i.useState)(m),[h,f]=(0,i.useState)(!1),b=(0,i.useRef)(m);return(0,i.useEffect)(()=>{h||(p(m),b.current=m)},[m.hour,m.minute,m.second,m.meridiem,h]),(0,a.jsx)(t$,{ref:t,type:o,value:x,onChange:e=>{p(e),b.current=e,t9(e,o)&&(null==s||s(e))},onFocus:e=>{f(!0),null==d||d(e)},onBlur:e=>{let t=e.relatedTarget,r=t instanceof Node&&e.currentTarget.contains(t);if(!r){f(!1);let e=t8(b.current,o);if(t9(e,o))p(e),b.current=e,null==s||s(e);else{let e=t5(o);p(e),b.current=e,null==s||s(e)}}null==c||c(e)},...u})});re.displayName="ScheduleTimeField";let rt=e=>{let[t,r,a]=e.split("-").map(Number);if(t&&r&&a)return new Date(t,r-1,a)},rr=e=>"".concat(e.getFullYear(),"-").concat(t6(e.getMonth()+1),"-").concat(t6(e.getDate())),ra=e=>{let t=e||t0;return ez.ou.now().setZone(t).isValid?t:t0},rn=e=>ez.ou.now().setZone(ra(e)),rl=e=>rn(e).toFormat("yyyy-MM-dd"),ri=e=>{let t=rn(e);return 60*t.hour+t.minute},rs=(e,t)=>rr(e)<rl(t),ro=(e,t)=>!!e&&e===rl(t),rd=e=>{if(!e)return{hour:"",minute:"",meridiem:"AM"};let[t,r]=e.split(":"),a=Number(t),n=Number(r),l=Number.isFinite(a)?Math.max(0,Math.min(23,a)):0,i=Number.isFinite(n)?Math.max(0,Math.min(59,n)):0;return{hour:t6(l%12||12),minute:t6(i),meridiem:l>=12?"PM":"AM"}},rc=e=>{if(!e.hour||!e.minute)return"";let t=Number(e.hour),r=Number(e.minute);if(!Number.isFinite(t))return"";let a="PM"===e.meridiem?12===t?12:t+12:12===t?0:t;return"".concat(t6(a),":").concat(t6(Number.isFinite(r)?r:0))},ru=e=>{if(!e)return null;let[t,r]=e.split(":"),a=Number(t),n=Number(r);return Number.isFinite(a)&&Number.isFinite(n)?Math.max(0,Math.min(1439,60*a+n)):null},rm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=t.timeZone,n=e.locationName.trim(),l=e.address.trim();return e.date?e.date<rl(a)&&(r.date="Date cannot be in the past."):r.date="Please select a date.",e.startTime&&e.endTime?ro(e.date,a)&&(0,eu.fo)(e.endTime)<ri(a)?r.timeRange="Time cannot be earlier than the store's current time.":(0,eu.fo)(e.endTime)<=(0,eu.fo)(e.startTime)&&(r.timeRange="End time must be later than start time."):r.timeRange="Please select start and end time.",n?(0,eu.Wo)(n)>eu.GT&&(r.locationName="Location name cannot exceed ".concat(eu.GT," characters.")):r.locationName="Please enter location name.",l?(0,eu.Wo)(l)>eu.cj&&(r.address="Address cannot exceed ".concat(eu.cj," characters.")):r.address="Please enter address.",r},rx=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.filter(e=>!e.isRemoved),a=r.reduce((e,r)=>{let a=rm(r,t);return Object.keys(a).length&&(e[r.localId]=a),e},{}),n=r.map(e=>{let t=ru(e.startTime),r=ru(e.endTime);return{entry:e,startMinute:t,endMinute:r}}).filter(e=>!!e.entry.date&&null!==e.startMinute&&null!==e.endMinute&&e.endMinute>e.startMinute).sort((e,t)=>{let r=e.entry.date.localeCompare(t.entry.date);return r||e.startMinute-t.startMinute||e.endMinute-t.endMinute});
1return n.forEach((e,t)=>{for(let i=t+1;i<n.length;i+=1){var r,l;let t=n[i];if(t.entry.date!==e.entry.date||e.endMinute<=t.startMinute)break;(null===(r=a[e.entry.localId])||void 0===r?void 0:r.timeRange)||(a[e.entry.localId]={...a[e.entry.localId],timeRange:t1}),(null===(l=a[t.entry.localId])||void 0===l?void 0:l.timeRange)||(a[t.entry.localId]={...a[t.entry.localId],timeRange:t1})}}),a},rp=e=>Object.values(e).some(e=>Object.keys(e).length>0),rh=(e,t)=>"scheduleEntries.".concat(e,".").concat(t),rf=(e,t)=>"timeRange"===t?"".concat(e.startTime||"","-").concat(e.endTime||""):e[t]||"",rb=e=>{let t=[];return void 0!==e.date&&t.push("date"),(void 0!==e.startTime||void 0!==e.endTime)&&t.push("timeRange"),void 0!==e.locationName&&t.push("locationName"),void 0!==e.address&&t.push("address"),t},rg=e=>[{status:1,title:"Draft",entries:e.filter(e=>2!==e.status)},{status:2,title:"Published",entries:e.filter(e=>2===e.status)}].filter(e=>e.entries.length),rv=e=>{let{form:t,isLoading:r,timeZone:n,visibleDrafts:l,unsavedEntryLocalIds:s,onAddEntry:o,onRemoveEntry:d,onUpdateDraft:c}=e,u=(0,i.useMemo)(()=>rg(l),[l]);return(0,a.jsx)("div",{className:"bg-white",children:r?(0,a.jsx)(eF,{}):l.length?(0,a.jsx)(X,{form:t,className:"contents",children:(0,a.jsx)("div",{className:"space-y-9",children:u.map(e=>(0,a.jsxs)("section",{children:[(0,a.jsx)("div",{className:"mb-4 flex items-center gap-2",children:(0,a.jsxs)("h2",{className:"text-[18px] font-medium leading-6 text-black md:text-[20px] md:leading-7",children:[e.title," (",e.entries.length,")"]})}),(0,a.jsx)("div",{className:"space-y-3",children:e.entries.map(t=>{let r=s.has(t.localId),l=r?"bg-[#FFF3DF]":1===e.status?"bg-[#FBFBFB]":"bg-white";return(0,a.jsx)("div",{className:"rounded-[8px] border border-[#E6E6E6] px-3 py-3 md:px-4 md:py-5 ".concat(l),children:(0,a.jsxs)("div",{className:"grid gap-2 [@media(min-width:1100px)]:gap-3 [@media(min-width:1800px)]:grid-cols-[170px_242px_242px_minmax(220px,1fr)_minmax(220px,1fr)_40px] [@media(min-width:1800px)]:items-start",children:[(0,a.jsxs)("div",{className:"grid gap-2 [@media(min-width:1100px)]:grid-cols-3 [@media(min-width:1100px)]:gap-3 [@media(min-width:1100px)]:items-start [@media(min-width:1800px)]:contents",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"mb-2 hidden text-[12px] font-medium leading-4 text-black lg:block",children:"Date"}),(0,a.jsx)(X.Item,{name:rh(t.localId,"date"),className:"space-y-0",rules:{validate:()=>rm(t,{timeZone:n}).date||!0},children:(0,a.jsx)(tO,{value:rt(t.date),onChange:e=>{c(t.localId,{date:e?rr(e):""})},dateFormat:"EEE, MMM dd, yyyy",placeholder:"Select Date",captionLayout:"dropdown",disabledDate:e=>rs(e,n),size:"large",className:"w-full [&_input]:!bg-white [&_input]:!font-normal"})})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"mb-2 text-[12px] font-medium leading-4 text-black",children:"Start Time"}),(0,a.jsx)(X.Item,{name:rh(t.localId,"timeRange"),className:"min-w-0 w-full space-y-0",rules:{validate:()=>rm(t,{timeZone:n}).timeRange||!0},children:(0,a.jsx)(re,{type:"hm",variant:"timeInput",pickerValue:rd(t.startTime),disabled:!t.date,inputWidth:t2,className:t4,onPickerChange:e=>{let r=rc(e);c(t.localId,{startTime:r})}})})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"mb-2 text-[12px] font-medium leading-4 text-black",children:"End time"}),(0,a.jsx)(re,{type:"hm",variant:"timeInput",pickerValue:rd(t.endTime),disabled:!t.date,inputWidth:t2,className:t4,onPickerChange:e=>{let r=rc(e);c(t.localId,{endTime:r})}})]})]}),(0,a.jsxs)("div",{className:"grid gap-2 [@media(min-width:1100px)]:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_40px] [@media(min-width:1100px)]:gap-3 [@media(min-width:1100px)]:items-start [@media(min-width:1800px)]:contents",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"mb-2 hidden text-[12px] font-medium leading-4 text-black lg:block",children:"Location name"}),(0,a.jsx)(X.Item,{name:rh(t.localId,"locationName"),className:"space-y-0",rules:{validate:()=>rm(t,{timeZone:n}).locationName||!0},children:(0,a.jsx)(ew,{value:t.locationName,maxSize:eu.GT,placeholder:"Location name (e.g. Pasaden
1a near Trader Joe's)",className:"w-full [&_input]:!bg-white [&_input]:!font-normal [&_input]:placeholder:!font-normal",onChange:e=>c(t.localId,{locationName:(0,eu.Qr)(e.target.value,eu.GT)})})})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"mb-2 hidden text-[12px] font-medium leading-4 text-black lg:block",children:"Address"}),(0,a.jsx)(X.Item,{name:rh(t.localId,"address"),className:"space-y-0",rules:{validate:()=>rm(t,{timeZone:n}).address||!0},children:(0,a.jsx)(ew,{value:t.address,maxSize:eu.cj,placeholder:"Address",className:"w-full [&_input]:!bg-white [&_input]:!font-normal [&_input]:placeholder:!font-normal",onChange:e=>c(t.localId,{address:(0,eu.Qr)(e.target.value,eu.cj)})})})]}),(0,a.jsx)(D,{type:"ghost",size:"M",icon:{component:e_.Z},iconPosition:"only",className:"justify-self-end !bg-transparent [@media(min-width:1100px)]:mt-6","aria-label":"Remove schedule entry",onClick:()=>d(t.localId)})]})]})},t.localId)})})]},e.status))})}):(0,a.jsxs)("div",{className:"flex min-h-[164px] flex-col items-center justify-center gap-3 rounded-[8px] border border-[#E6E6E6] px-5 py-10 text-center",children:[(0,a.jsx)("div",{className:"text-[15px] font-semibold",children:"No schedule entries"}),(0,a.jsx)(D,{type:"outline",size:"S",onClick:o,children:"Add"})]})})},ry=e=>{let{status:t}=e,r=2===t,n=1===t||null==t;return(0,a.jsx)("span",{className:"inline-flex h-5 items-center rounded-full px-2 text-[12px] font-normal leading-5 ".concat(r?"bg-[rgba(52,199,89,0.12)] text-[#248A3D]":n?"bg-[rgba(255,149,0,0.12)] text-[#A35F00]":"bg-[#F2F2F2] text-[#606060]"),children:(0,eu.DL)(t)})},rw=e=>{let{shops:t,selectedShopId:r,unsavedShopIds:n,isLoading:l,showTimeZone:i=!1,onSelectShop:s}=e;return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-white",children:[(0,a.jsxs)("div",{className:"flex h-11 shrink-0 items-center px-4 pt-3 text-[18px] font-medium leading-6 text-black",children:["All Store (",t.length,")"]}),l&&!t.length?(0,a.jsx)(eE,{}):(0,a.jsx)("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-4 pb-3 pt-2",children:t.map(e=>{let t=(0,eu.kg)(e.shopId),l=t===r,o=!!(null==n?void 0:n.has(t)),d=(e.timeZone||"").trim();return(0,a.jsxs)("button",{type:"button",className:"flex min-h-[72px] w-full flex-col items-start justify-center gap-2 rounded-[8px] border border-[#E6E6E6] px-4 py-3 text-left transition-colors ".concat(l?"bg-[#F2F2F2]":"bg-white hover:bg-[#FAFAFA]"),onClick:()=>s(e.shopId),children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[14px] font-medium leading-5 text-black",children:e.shopName}),(0,a.jsxs)("span",{className:"flex max-w-full flex-wrap items-center gap-2",children:[(0,a.jsx)(ry,{status:e.status}),o?(0,a.jsx)("span",{className:"text-[12px] font-normal leading-5 text-[#A6A6A6]",children:"Unsaved"}):null,i&&d?(0,a.jsx)("span",{className:"max-w-full truncate rounded-full bg-[#F5F5F5] px-2 py-[2px] text-[12px] font-normal leading-4 text-[#606060]",children:d}):null]})]},e.shopId)})})]})},rj=e=>"".concat("foodTruckScheduleAccessToken",":").concat((0,eu.kg)(e)),rN=e=>e&&window.localStorage.getItem(rj(e))||"",rk=(e,t)=>{e&&t&&window.localStorage.setItem(rj(e),t)},rC=e=>{e&&window.localStorage.removeItem(rj(e))},rS=e=>{ea.success(e,{duration:2200})},rE=e=>{ea.error(e,{duration:2200})},rF=e=>(e||"").trim(),rM=e=>(e||"").split(" traceId:")[0].trim(),rD=(e,t)=>{var r,a;return 0===Number(null==e?void 0:null===(r=e.status)||void 0===r?void 0:r.code)?"":rM(null==e?void 0:null===(a=e.status)||void 0===a?void 0:a.msg)||t},rZ=(e,t)=>{var r;return"string"==typeof e?rM(e)||t:rM(null==e?void 0:null===(r=e.status)||void 0===r?void 0:r.msg)||rM(null==e?void 0:e.msg)||rM(null==e?void 0:e.message)||t},rI=e=>{if(!e)return"";let t=e.match(/filename\*=UTF-8''([^;]+)/i);if(null==t?void 0:t[1])try{return decodeURIComponent(t[1])}catch(e){return t[1]}let r=e.match(/filename="?([^";]+)"?/i);return(null==r?void 0:r[1])||""},rP=e=>e.trim().replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-").toLowerCase(),rR=e=>{var t;return String((null==e?void 0:e.logoUrl)||(null==e?void 0:e.appIconUrl)||(null==e?void 0:null===(t=e.browserInfo)||void 0===t?void 0:t.favicon)||"")},rT=e=>{"undefined"!=typeof document&&e&&["icon","shortcut icon","apple-touch-icon"].forEach(t=>{let r=document.head.querySelector('link[rel="'.concat(t,'"]'));r||((r=document.createElement("link")).rel=t,document.head.appendChild(r)),r.href=e,r.removeAttribute("type")})},rA=(e,t)=>
1{let r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(r)},r_=(e,t,r,a)=>{let n=(0,eu.KD)(e,a);return{...n,id:n.id||r[t]||e.localId}},rz=e=>({...e,...void 0!==e.locationName?{locationName:(0,eu.Qr)(e.locationName,eu.GT)}:{},...void 0!==e.address?{address:(0,eu.Qr)(e.address,eu.cj)}:{}}),rB=(e,t)=>{let r=(0,eu.kg)(e.id);if(r)return t.find(e=>(0,eu.kg)(e.id)===r)},rL=(e,t)=>{let r=rB(e,t);return!r||!!e.isRemoved||e.date!==r.date||e.startTime!==r.startTime||e.endTime!==r.endTime||e.locationName.trim()!==r.locationName.trim()||e.address.trim()!==r.address.trim()},rO=(e,t,r)=>{if("publish"===t)return 2;let a=rB(e,r);return rL(e,r)?1:(null==a?void 0:a.status)!==void 0?a.status:void 0!==e.status?e.status:1};function rV(){let e=(0,s.useRouter)(),t=String(e.query.orgId||""),r=X.useForm({mode:"onSubmit",reValidateMode:"onChange"}),[n,f]=(0,i.useState)(""),[b,g]=(0,i.useState)(""),[v,y]=(0,i.useState)(""),[w,j]=(0,i.useState)(!1),[N,k]=(0,i.useState)(""),[C,S]=(0,i.useState)(!0),[E,F]=(0,i.useState)([]),[M,Z]=(0,i.useState)(""),[I,P]=(0,i.useState)([]),[R,T]=(0,i.useState)([]),[A,_]=(0,i.useState)([]),[z,B]=(0,i.useState)(0),[L,O]=(0,i.useState)(0),[V,W]=(0,i.useState)(!1),[Y,H]=(0,i.useState)(!1),[q,U]=(0,i.useState)(!1),[K,G]=(0,i.useState)(!1),[J,$]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[er,en]=(0,i.useState)(!1),[el,ei]=(0,i.useState)(!1),eo=(0,h.Z)({url:ec.xW.appInfo,method:"get",manual:!0,headers:(0,ec.bE)(t),isTips:!1,uncached:!0}),ed=(0,h.Z)({url:ec.xW.check(t),method:"get",manual:!0,headers:(0,ec.bE)(t),isTips:!1}),em=(0,h.Z)({url:ec.xW.verifyPin,method:"post",manual:!0,headers:(0,ec.bE)(t),isTips:!1}),ex=(0,h.Z)({url:ec.xW.entries,method:"post",manual:!0,headers:(0,ec.bE)(t,void 0,N),isTips:!1}),ep=(0,h.Z)({url:ec.xW.shopStatus(t),method:"get",manual:!0,headers:(0,ec.bE)(t,void 0,N),isTips:!1}),eh=(0,h.Z)({url:ec.xW.pastEntries,method:"post",manual:!0,headers:(0,ec.bE)(t,void 0,N),isTips:!1}),ef=(0,h.Z)({url:ec.xW.save,method:"post",manual:!0,headers:(0,ec.bE)(t,M,N),isTips:!1}),eb=(0,i.useMemo)(()=>E.find(e=>(0,eu.kg)(e.shopId)===M)||null,[M,E]),eg=(null==eb?void 0:eb.timeZone)||void 0,ev=(0,i.useMemo)(()=>I.filter(e=>!e.isRemoved),[I]),ey=(0,i.useMemo)(()=>ev.filter(e=>2!==e.status),[ev]),ew=(0,i.useMemo)(()=>new Set(ev.filter(e=>rL(e,R)).map(e=>e.localId)),[R,ev]),eC=(0,i.useMemo)(()=>I.some(e=>rL(e,R)),[I,R]),eS=(0,i.useMemo)(()=>M&&eC?new Set([M]):new Set,[eC,M]),eF=(0,i.useMemo)(()=>ey.some(e=>ew.has(e.localId)),[ey,ew]),eM=ey.length>0,eZ=eF?"default":"outline",eI=eM?"default":"outline",eP=(0,i.useMemo)(()=>new Set(E.map(e=>rF(e.timeZone)).filter(Boolean)).size>1,[E]),eR=e=>{t3.forEach(t=>{r.setValue(rh(e.localId,t),rf(e,t),{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1})})},eT=e=>{t3.forEach(t=>{r.clearErrors(rh(e,t))})},e_=()=>{r.clearErrors()},ez=e=>{e_();let t=rx(e,{timeZone:eg});return Object.entries(t).forEach(e=>{let[t,a]=e;Object.entries(a).forEach(e=>{let[a,n]=e;n&&r.setError(rh(t,a),{type:"manual",message:n})})}),rp(t)},eB=(e,t)=>{let a=e.filter(e=>!e.isRemoved),n=rx(a,{timeZone:eg});a.forEach(e=>{var a;let l=rh(e.localId,"timeRange"),i=null===(a=n[e.localId])||void 0===a?void 0:a.timeRange,s=!!r.getFieldState(l).error,o=!!(e.date&&e.startTime&&e.endTime);(e.localId===t||s||o)&&(i?r.setError(l,{type:"manual",message:i}):r.clearErrors(l))})};(0,i.useEffect)(()=>{ev.forEach(eR)},[ev]),(0,i.useEffect)(()=>{if(!el)return;let{body:e,documentElement:t}=document,r=window.scrollY,a={left:e.style.left,overflow:e.style.overflow,position:e.style.position,right:e.style.right,top:e.style.top,width:e.style.width},n=t.style.overflow;return t.style.overflow="hidden",e.style.overflow="hidden",e.style.position="fixed",e.style.top="-".concat(r,"px"),e.style.left="0",e.style.right="0",e.style.width="100%",()=>{t.style.overflow=n,e.style.overflow=a.overflow,e.style.position=a.position,e.style.top=a.top,e.style.left=a.left,e.style.right=a.right,e.style.width=a.width,window.scrollTo(0,r)}},[el]);let eL=()=>{rC(t),k(""),j(!1),y(""),F([]),Z(""),P([]),T([]),_([]),B(0),O(0),G(!1),e_()},eO=()=>{eL(),f("")},eV=e=>{eL(),rE((e||"Access expired. Please verify the PIN again.").split(" traceId:")[0])},eW=e=>{var t,r;return 100072===Number(null==e?void 0:null===(t=e.status)||void 0===t?void 0:t.code)&&(eV(null==e?void 0:null===(r=e.status)||void 0===r?void 0:r.msg),!0)},eY=async()=>
1{if(!t){g("");return}g("");try{let e=await eo.send({orgId:t},{headers:(0,ec.bE)(t),isTips:!1}),r=null==e?void 0:e.data;g(rR(r))}catch(e){g("")}},eH=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e){U(!0);try{var a;let n=await eh.send({pageNo:r,pageSize:10,shopId:e},{headers:(0,ec.bE)(t,e,N),isTips:!1});if(eW(n))return;let l=((null==n?void 0:n.data)||[]).map(e=>({...e,id:String(e.id)})),i=null==n?void 0:null===(a=n.pageInfo)||void 0===a?void 0:a.totalElements;_(l),O(null==i?l.length:Number(i)),B(r)}catch(e){_([]),O(0)}finally{U(!1)}}},eq=async e=>{if(e){H(!0),ea.dismissAll();try{var r,a,n;let[l]=await Promise.all([ex.send((0,ec.iz)({shopId:e}),{headers:(0,ec.bE)(t,e,N),isTips:!1}),eH(e)]);if(eW(l))return;let i=(0,eu.iz)(null==l?void 0:null===(r=l.data)||void 0===r?void 0:r.shops)[0]||null,s=(null==i?void 0:null===(a=i.entries)||void 0===a?void 0:a.map(eu.y4))||[];P(s),T(s),e_(),F(t=>t.map(t=>(0,eu.kg)(t.shopId)===e?{...t,status:null!==(n=null==i?void 0:i.status)&&void 0!==n?n:t.status,entries:(null==i?void 0:i.entries)||[]}:t))}catch(e){P([]),T([]),e_(),rE("Unable to load this store schedule. Please try again.")}finally{H(!1)}}},eU=async e=>{let t=(0,eu.kg)(null==e?void 0:e.shopId);Z(t),P([]),T([]),_([]),B(0),O(0),W(!1),e_(),t&&await eq(t)},eK=async function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r&&G(!0),H(!0),ea.dismissAll();try{let r=await ep.send(void 0,{headers:(0,ec.bE)(t,void 0,N),isTips:!1});if(eW(r))return;let a=((null==r?void 0:r.data)||[]).map(e=>({...e,entries:[]}));if(!a.length){eO();return}F(a);let n=a.find(t=>(0,eu.kg)(t.shopId)===e)||a.find(e=>(0,eu.kg)(e.shopId)===M)||a[0]||null;await eU(n)}catch(e){F([]),Z(""),P([]),T([]),e_(),rE("Unable to load stores. Please try again.")}finally{H(!1),r&&G(!1)}},eG=async()=>{S(!0);try{let e=await ed.send(void 0,{headers:(0,ec.bE)(t),isTips:!1}),r=String((null==e?void 0:e.data)||""),a=r?rN(t):"";f(r),k(a),j(!!a),G(!!a)}catch(e){f(""),j(!1),k(""),G(!1)}finally{S(!1)}};(0,i.useEffect)(()=>{t&&(eY(),eG())},[t]),(0,i.useEffect)(()=>{rT(b)},[b]),(0,i.useEffect)(()=>{w&&t&&N&&eK(void 0,!0)},[w,t,N]);let eJ=async()=>{if(!v.trim()){rE("Please enter the access PIN.");return}ea.dismissAll();try{let e=await em.send((0,ec.Yc)({enterpriseId:t,accessPin:v.trim()}),{headers:(0,ec.bE)(t),isTips:!1}),r=String((null==e?void 0:e.data)||"");r?(rk(t,r),k(r),G(!0),j(!0),ea.dismissAll()):rE("Invalid access PIN.")}catch(e){rE("PIN verification failed.")}},eX=async e=>{let t=(0,eu.kg)(e),r=E.find(e=>(0,eu.kg)(e.shopId)===t)||null;await eU(r)},eQ=()=>{let e=(0,eu.lK)();P(t=>[...t,e])},e$=async e=>{if(!e)return!0;try{var r,a;let[n,l]=await Promise.all([ep.send(void 0,{headers:(0,ec.bE)(t,void 0,N),isTips:!1}),ex.send((0,ec.iz)({shopId:e}),{headers:(0,ec.bE)(t,e,N),isTips:!1})]);if(eW(n)||eW(l))return!1;let i=((null==n?void 0:n.data)||[]).map(e=>({...e,entries:[]})),s=(0,eu.iz)(null==l?void 0:null===(r=l.data)||void 0===r?void 0:r.shops).find(t=>(0,eu.kg)(t.shopId)===e)||null,o=(null==s?void 0:null===(a=s.entries)||void 0===a?void 0:a.map(eu.y4))||[];return i.length?F(t=>i.map(r=>{let a=t.find(e=>(0,eu.kg)(e.shopId)===(0,eu.kg)(r.shopId));return(0,eu.kg)(r.shopId)===e?{...r,entries:(null==s?void 0:s.entries)||(null==a?void 0:a.entries)||[]}:{...r,entries:(null==a?void 0:a.entries)||[]}})):s&&F(t=>t.map(t=>(0,eu.kg)(t.shopId)===e?{...t,status:s.status,entries:s.entries||[]}:t)),s&&(P(o),T(o),e_()),!0}catch(e){return!0}},e0=(e,t,r)=>{F(a=>a.map(a=>(0,eu.kg)(a.shopId)===e?{...a,status:t.status,entries:r}:a));let a=r.map(eu.y4);P(a),T(a),e_()},e1=async e=>{if(!M){rE("Please select a store.");return}if(0===ev.length){rE("Please save at least one schedule entry.");return}if(ez(ev))return;let r="publish"===e?2:1,a="publish"===e?et:$;a(!0),ea.dismissAll();try{var n;let a=await ef.send({shopId:M,entries:I.filter(e=>e.id||!e.isRemoved).map(t=>(0,eu.KD)(t,rO(t,e,R)))},{headers:(0,ec.bE)(t,M,N),isTips:!1});if(eW(a))return;let l=rD(a,"publish"===e?"Publish failed.":"Save failed.");if(l){rE(l);return}let i=(null==a?void 0:a.data)||{success:!0,savedEntryIds:[],status:r},s={...i,status:null!==(n=i.status)&&void 0!==n?n:r},o=ev.map((t,r)=>r_(t,r,(null==s?void 0:s.savedEntryIds)||[],rO(t,e,R)));e0(M,s,o);let d=await e$(M);if(!d)return;rS("publish"===e?"Published.":"Saved."),eH(M)}catch(t){rE(rZ(t,"publish"===e?"Publish failed.":"Save failed."))}finally{a(!1)}},e2=async()=>
1{if(!t){rE("Unable to export CSV.");return}en(!0),ea.dismissAll();try{let l=ec.xW.csvExport({enterpriseId:t}),i=p.Dj?"".concat(p.Dj).concat(l):l,s=await fetch(i,{method:"GET",headers:{Accept:"text/csv,application/octet-stream,*/*",...(0,ec.bE)(t,void 0,N)}});if(!s.ok)throw Error("CSV export failed.");let o=s.headers.get("content-type")||"";if(o.includes("application/json")){var e,r,a;let t=await s.json();if(100072===Number(null==t?void 0:null===(e=t.status)||void 0===e?void 0:e.code)){eV(null==t?void 0:null===(a=t.status)||void 0===a?void 0:a.msg);return}throw Error((null==t?void 0:null===(r=t.status)||void 0===r?void 0:r.msg)||"CSV export failed.")}let d=await s.blob(),c=rI(s.headers.get("content-disposition")),u="".concat(rP(n||"food-truck-schedule")||"food-truck-schedule","-schedule.csv");rA(d,c||u),rS("CSV downloaded.")}catch(e){rE(e instanceof Error?e.message:"CSV export failed.")}finally{en(!1)}};return C||K?(0,a.jsx)(eD,{}):(0,a.jsxs)("main",{className:"jsx-7a1499607cacc290 min-h-screen bg-white text-black",children:[(0,a.jsx)(Q.x7,{richColors:!0,className:"food-truck-schedule-toaster"}),(0,a.jsx)(l(),{id:"7a1499607cacc290",children:'.food-truck-schedule-toaster[data-sonner-toaster][data-x-position="center"]{left:50%!important;right:auto!important;width:min(300px,-webkit-calc(100vw - 32px))!important;width:min(300px,-moz-calc(100vw - 32px))!important;width:min(300px,calc(100vw - 32px))!important;-webkit-transform:translatex(-50%)!important;-moz-transform:translatex(-50%)!important;-ms-transform:translatex(-50%)!important;-o-transform:translatex(-50%)!important;transform:translatex(-50%)!important}.food-truck-schedule-toaster[data-x-position="center"] [data-sonner-toast]{left:0!important;right:auto!important;width:100%!important;-webkit-transform:var(--y)!important;-moz-transform:var(--y)!important;-ms-transform:var(--y)!important;-o-transform:var(--y)!important;transform:var(--y)!important}.food-truck-schedule-toaster[data-x-position="center"] [data-sonner-toast]>*{width:100%!important;min-width:0!important;max-width:100%!important}'}),!w&&(0,a.jsxs)("div",{className:"jsx-7a1499607cacc290 mx-auto flex w-full max-w-[520px] flex-col gap-5 px-4 py-6",children:[!n&&(0,a.jsx)(ej,{onRefresh:()=>{window.location.reload()}}),n&&!w&&(0,a.jsx)(eN,{enterpriseName:n,pin:v,verifying:em.loading,onPinChange:y,onVerify:eJ})]}),w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"jsx-7a1499607cacc290 flex min-h-screen flex-col bg-white md:flex-row",children:[(0,a.jsx)("div",{className:"jsx-7a1499607cacc290 md:hidden",children:(0,a.jsx)(ek,{enterpriseName:n,logoUrl:b})}),(0,a.jsxs)("aside",{className:"jsx-7a1499607cacc290 hidden w-[340px] shrink-0 border-r border-[#E6E6E6] bg-white md:sticky md:top-0 md:flex md:h-screen md:flex-col md:overflow-hidden",children:[(0,a.jsx)(ek,{enterpriseName:n,logoUrl:b}),(0,a.jsx)(rw,{shops:E,selectedShopId:M,unsavedShopIds:eS,isLoading:Y,showTimeZone:eP,onSelectShop:eX})]}),(0,a.jsxs)("section",{className:"jsx-7a1499607cacc290 min-w-0 flex-1 px-4 pb-8 pt-0 md:px-[clamp(32px,calc(8vw_-_80px),64px)] md:pb-20 md:pt-6",children:[(0,a.jsxs)("div",{className:"jsx-7a1499607cacc290 mb-4 flex flex-col gap-4 md:mb-6 md:gap-6",children:[(0,a.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>ei(!0),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),ei(!0))},className:"jsx-7a1499607cacc290 flex min-h-[64px] w-full cursor-pointer items-center gap-3 border-b border-[#E6E6E6] bg-white pt-4 pb-3 text-left outline-none focus-visible:ring-2 focus-visible:ring-[#BDBDBD] md:hidden",children:[(0,a.jsx)("div",{className:"jsx-7a1499607cacc290 min-w-0 flex-1",children:(0,a.jsx)(es,{size:"large",as:"h1",ellipsis:!0,children:(null==eb?void 0:eb.shopName)||"Schedule"})}),(0,a.jsx)("span",{className:"jsx-7a1499607cacc290 flex h-11 w-11 shrink-0 items-center justify-center rounded-[6px] bg-white text-black",children:(0,a.jsx)(o.Z,{className:"h-4 w-4","aria-hidden":!0})})]}),(0,a.jsxs)("div",{className:"jsx-7a1499607cacc290 hidden min-w-0 md:block",children:[(0,a.jsx)("h1",{className:"jsx-7a1499607cacc290 truncate text-[28px] font-semibold leading-10 tracking-[0px] text-black",children:(null==eb?void 0:eb.shopName)||"Schedule"}),(0,a.jsx)("div",{className:"jsx-7a1499607cacc290 mt-2",children:eb&&(0,a.jsx)(ry,{status:eb.status})})]}),(0,a.jsxs)("div",{className:"jsx-7a1499607cacc290 grid grid-cols-[repeat(3,minmax(0,1fr))_40px] items-center gap-2 md:flex md:flex-wrap md:justify-end",children:[(0,a.jsx)(D,{type:"outline",size:"M",icon:{component:d.Z},className:"max-md:!w-full max-md:!bg-white",onClick:eQ,children:"Add"}),(0,a.jsx)(D,{type:eZ,size:"M",icon:{component:c.Z},className:"max-md:!w-full ".concat("outline"===eZ?"!bg-white":""),loading:J,onClick:()=>e1("save"),children:"Save"}),(0,a.jsx)(D,{type:eI,size:"M",icon:{component:u.Z},className:"max-md:!w-full ".concat("outline"===eI?"!bg-white":""),loading:ee,onClick:()=>e1("publish"),children:"Publish"}),(0,a.jsx)(D,{type:"outline",size:"M",icon:{component:m.Z},iconPosition:"only",className:"max-md:!h-10 max-md:!w-10 max-md:!bg-white",loading:er,"aria-label":"Download all schedules as CSV",onClick:e2})]})]}),(0,a.jsx)(rv,{form:r,isLoading:Y,timeZone:eg,visibleDrafts:ev,unsavedEntryLocalIds:ew,onAddEntry:eQ,onRemoveEntry:e=>{P(t=>{let r=t.find(t=>t.localId===e);return(null==r?void 0:r.id)?(eT(e),t.map(t=>t.localId===e?{...t,isRemoved:!0}:t)):(eT(e),t.filter(t=>t.localId!==e))})},onUpdateDraft:(e,t)=>{let a=rz(t),n=I.find(t=>t.localId===e),l=n?{...n,...a}:null,i=I.map(t=>t.localId===e?{...t,...a}:t),s=rb(a);if(P(i),!l)return;eR(l);let o=rm(l,{timeZone:eg});
1s.forEach(t=>{let a=rh(e,t),n=o[t];n?r.setError(a,{type:"manual",message:n}):r.clearErrors(a)}),(s.includes("date")||s.includes("timeRange"))&&eB(i,e)}}),(0,a.jsx)(eA,{history:A,historyTotal:L,historyPage:z,historyTotalPages:Math.max(1,Math.ceil(L/10)),pageSize:10,isLoading:q,isExpanded:V,onExpandedChange:W,onPreviousPage:()=>eH(M,z-1),onNextPage:()=>eH(M,z+1)})]})]}),el&&(0,a.jsxs)("div",{className:"jsx-7a1499607cacc290 fixed inset-0 z-50 overflow-y-auto overscroll-contain bg-white md:hidden",children:[(0,a.jsxs)("div",{className:"jsx-7a1499607cacc290 flex min-h-[64px] items-center gap-3 px-4 py-2",children:[(0,a.jsxs)(es,{size:"large",as:"h2",className:"min-w-0 flex-1",ellipsis:!0,children:["All Store (",E.length,")"]}),(0,a.jsx)("button",{type:"button","aria-label":"Close store list",onClick:()=>ei(!1),className:"jsx-7a1499607cacc290 flex h-11 w-11 shrink-0 items-center justify-center rounded-[6px] bg-white text-black",children:(0,a.jsx)(x.Z,{className:"h-5 w-5","aria-hidden":!0})})]}),(0,a.jsx)("div",{className:"jsx-7a1499607cacc290 space-y-2 px-3 pb-[calc(env(safe-area-inset-bottom)+24px)] pt-3",children:Y&&!E.length?(0,a.jsx)(eE,{count:4}):E.map(e=>{let t=(0,eu.kg)(e.shopId),r=t===M,n=eS.has(t),l=rF(e.timeZone);return(0,a.jsxs)("button",{type:"button",onClick:()=>{ei(!1),eX(e.shopId)},className:"jsx-7a1499607cacc290 "+"relative flex min-h-[80px] w-full flex-col items-start justify-center gap-2 rounded-[8px] border border-[#E6E6E6] px-4 py-4 pr-8 text-left ".concat(r?"bg-[#FFF5F6]":"bg-white"),children:[r?(0,a.jsx)("span",{className:"jsx-7a1499607cacc290 absolute right-4 top-1/2 h-[5px] w-[5px] -translate-y-1/2 rounded-full bg-[#D10F2F]"}):null,(0,a.jsx)("span",{className:"jsx-7a1499607cacc290 max-w-full truncate text-[14px] font-medium leading-5 text-black",children:e.shopName}),(0,a.jsxs)("span",{className:"jsx-7a1499607cacc290 flex max-w-full flex-wrap items-center gap-2",children:[(0,a.jsx)(ry,{status:e.status}),n?(0,a.jsx)("span",{className:"jsx-7a1499607cacc290 text-[12px] font-normal leading-5 text-[#A6A6A6]",children:"Unsaved"}):null,eP&&l?(0,a.jsx)("span",{className:"jsx-7a1499607cacc290 max-w-full truncate rounded-full bg-[#F5F5F5] px-2 py-[2px] text-[12px] font-normal leading-4 text-[#606060]",children:l}):null]})]},e.shopId)})})]})]})]})}}},function(e){e.O(0,[79033,68557,49774,92888,40179],function(){return e(e.s=72344)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.