1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0f424-0226-0000-d9cc-5d4541f5bf4a";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="4e3173e6-d976-bade-a337-9e3d72cd89e9")}catch(e){}}();;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="4e3173e6-d976-bade-a337-9e3d72cd89e9")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,418094,e=>{"use strict";var t=e.i(271645),r=e.i(820783),n=e.i(843476),a=Symbol.for("react.lazy"),s=t[" use ".trim().toString()];function i(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===a&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}function l(e){var a;let l,o=(a=e,(l=t.forwardRef((e,n)=>{let{children:a,...l}=e;if(i(a)&&"function"==typeof s&&(a=s(a._payload)),t.isValidElement(a)){var o;let e,s,i=(o=a,(s=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),d=function(e,t){let r={...t};for(let n in t){let a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{let t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(l,a.props);return a.type!==t.Fragment&&(d.ref=n?(0,r.composeRefs)(n,i):i),t.cloneElement(a,d)}return t.Children.count(a)>1?t.Children.only(null):null})).displayName=`${a}.SlotClone`,l),d=t.forwardRef((e,r)=>{let{children:a,...l}=e;i(a)&&"function"==typeof s&&(a=s(a._payload));let d=t.Children.toArray(a),u=d.find(c);if(u){let e=u.props.children,a=d.map(r=>r!==u?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,n.jsx)(o,{...l,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,a):null})}return(0,n.jsx)(o,{...l,ref:r,children:a})});return d.displayName=`${e}.Slot`,d}var o=l("Slot"),d=Symbol("radix.slottable");function c(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===d}e.s(["Slot",0,o,"createSlot",0,l])},582629,e=>{"use strict";let t=()=>"/customer/explore",r=e=>e?.expandAll?"/customer?booking_status=in_cart&expand_all=true":"/customer?booking_status=in_cart",n=e=>`/customer?focus=${e.userAddressId}&tab=checkout`,a=()=>"/customer/company",s=()=>"/supplier/listings";e.s(["routeCallDetail",0,e=>`/crm/calls/history/${e.callId}`,"routeCalls",0,()=>"/crm/calls/history","routeCallsAnalytics",0,()=>"/crm/calls/analytics","routeCrmCartPipeline",0,()=>"/crm/cart-pipeline","routeCrmHome",0,()=>"/crm","routeCrmNotifications",0,()=>"/crm/notifications","routeCustomerBooking",0,e=>`/customer/booking/${e.orderGroupId}`,"routeCustomerCart",0,r,"routeCustomerCartEntry",0,e=>e?.userAddressId?n({userAddressId:e.userAddressId}):r(),"routeCustomerCartProject",0,n,"routeCustomerCategory",0,e=>`/customer/category/${e.categorySlug}`,"routeCustomerCategoryGroup",0,e=>`/customer/category-group/${e.groupSlug}`,"routeCustomerCheckoutSuccess",0,e=>`/customer/checkout/${e.userAddressId}/success`,"routeCustomerCompany",0,a,"routeCustomerCompanyDetail",0,e=>`/customer/company/${e.userGroupId}`,"routeCustomerCompanyInsurance",0,()=>"/customer/company/insurance","routeCustomerCompanyNew",0,()=>a(),"routeCustomerCompanyTab",0,e=>`/customer/company?tab=${e.tab}`,"routeCustomerExplore",0,t,"routeCustomerForgeProgram",0,()=>"/customer/forge","routeCustomerForgePromo",0,()=>"/forge","routeCustomerGroupedInvoiceDetail",0,e=>`/customer/invoices/group/${e.invoiceId}`,"routeCustomerHome",0,()=>"/customer","routeCustomerIndustry",0,e=>`/customer/industries/${e.industrySlug}`,"routeCustomerInvoiceDetail",0,e=>`/customer/invoice/${e.invoiceId}`,"routeCustomerInvoices",0,()=>"/customer/invoices","routeCustomerLocationDetail",0,e=>`/customer?focus=${encodeURIComponent(e.locationId)}`,"routeCustomerLocationNew",0,e=>
2e?.from?`/customer/location/new?from=${e.from}`:"/customer/location/new","routeCustomerOrder",0,e=>`/customer/order/${e.orderId}`,"routeCustomerOrderNew",0,()=>t(),"routeCustomerOrderNewSuppliers",0,()=>"/customer/order/new/suppliers","routeCustomerProfile",0,()=>"/customer/profile","routeCustomerProfileFinancialConnections",0,()=>"/customer/profile/financial-connections","routeCustomerProfileNotifications",0,()=>"/customer/profile/notifications","routeCustomerProjectPlan",0,e=>`/customer?focus=${e.userAddressId}&tab=plan`,"routeCustomerProjectPlanQuote",0,e=>`/customer/project/${e.userAddressId}/plan-quote?s=${encodeURIComponent(e.serializedSelections)}${e.crm?"&crm=1":""}`,"routeCustomerProjects",0,()=>"/customer","routeCustomerRequestIncrease",0,()=>"/customer/request-increase","routeCustomerSearch",0,()=>"/customer/search","routeCustomerSupplierDetail",0,e=>`/customer/suppliers/${e.sellerLocationId}`,"routeCustomerSupplierStorefront",0,e=>`/customer/suppliers/${e.sellerLocationId}/storefront`,"routeCustomerSuppliers",0,()=>"/customer/suppliers","routeCustomerUserDetail",0,e=>`/customer/user/${e.userId}`,"routeCustomerUsers",0,()=>"/customer/users","routeDocs",0,()=>"/docs","routeDocsDetail",0,e=>`/docs/${e.id}`,"routeOnboarding",0,()=>"/onboarding","routePodcast",0,()=>"/podcast","routePodcastEpisode",0,e=>`/podcast/episode/${e.slug}`,"routePodcastList",0,()=>"/podcast/list","routePrivacyPolicy",0,()=>"/privacy-policy","routeRoot",0,()=>"/","routeSalesDialer",0,()=>"/crm/calls","routeSitemap",0,()=>"/site-map","routeSupplierBranchDetail",0,e=>`/supplier/branch/${e.branchId}`,"routeSupplierBranches",0,()=>"/supplier/branches","routeSupplierCompanies",0,()=>"/supplier/companies","routeSupplierCompany",0,()=>"/supplier/company","routeSupplierCompanyNew",0,()=>"/supplier/company/new","routeSupplierCompanySettings",0,()=>"/supplier/company-settings","routeSupplierCompanySettingsBrand",0,()=>"/supplier/company-settings/brand-settings","routeSupplierCompanySettingsCommunication",0,()=>"/supplier/company-settings/communication-settings","routeSupplierCompanySettingsInformation",0,()=>"/supplier/company-settings/company-information","routeSupplierCompanySettingsInsurance",0,()=>"/supplier/company-settings/insurance","routeSupplierHome",0,()=>"/supplier","routeSupplierListingDetail",0,e=>`/supplier/listing/${e.listingId}`,"routeSupplierListings",0,s,"routeSupplierListingsMap",0,()=>s(),"routeSupplierOnboarding",0,()=>"/onboarding/supplier","routeSupplierOrderDetail",0,e=>`/supplier/order/${e.orderId}`,"routeSupplierOrders",0,()=>"/supplier/orders","routeSupplierPayoutDetail",0,e=>`/supplier/payout/${e.payoutId}`,"routeSupplierPayouts",0,()=>"/supplier/payouts","routeSupplierProducts",0,()=>"/supplier/products","routeSupplierProductsBranches",0,e=>`/supplier/products/branches/${e.mainProductId}`,"routeSupplierProductsCategory",0,e=>`/supplier/products/category/${e.categoryId}`,"routeSupplierProfile",0,()=>"/supplier/profile","routeSupplierRecap",0,()=>"/supplier/recap","routeSupplierReceivedInvoiceDetail",0,e=>`/supplier/received_invoice/${e.invoiceId}`,"routeSupplierReceivedInvoices",0,()=>"/supplier/received_invoices","routeSupplierUserDetail",0,e=>`/supplier/user/${e.userId}`,"routeSupplierUsers",0,()=>"/supplier/users","routeTaskDetail",0,e=>`/crm/tasks/${e.taskId}`,"routeTermsOfService",0,()=>"/terms-of-service","routeUserGroupInvitation",0,()=>"/invitation"])},225437,e=>{"use strict";e.i(135163);var t=e.i(797881);e.s(["useEffectiveUser",0,function(e){let r=(0,t.useEffectiveProfile)(e);return{profile:r.data??null,isLoading:r.isLoading,isError:r.isError,refetch:r.refetch}}])},692250,e=>{"use strict";e.i(924856);var t=e.i(581847),r=e.i(225437),n=e.i(162441),a=e.i(85205);function s(e){let s=(0,t.useAuthUser)(),i=(0,r.useEffectiveUser)(e),{impersonatedUserId:l}=(0,n.useImpersonation)(),o=(0,a.useImpersonationScope)();return{...function({authUserId:e,effectiveUserId:t,requestedImpersonatedUserId:r,impersonationEnabled:n}){if(n&&r)return{isImpersonating:!0,effectiveUserId:r};let a=!!(e&&t&&e!==t);return{isImpersonating:a,effectiveUserId:a?t??null:null}}({authUserId:s.profile?.id,effectiveUserId:i.profile?.id,requestedImpersonatedUserId:l,impersonationEnabled:o}),isLoading:s.isLoading||i.isLoading,isError:s.isError||i.isError}}e.s(["useImpersonationStatus",0,s,"useIsImpersonating",0,function(e){return s(e).isImpersonating}],692250)},371561,e=>{"use strict";e.i(540259);var t=e.i(911860);let r=new Map;e.s(["getStripe",0,e=>{if(!e)return Promise.resolve(null);let n=r.get(e);if(n)return n;let a=(0,t.loadStripe)(e);return r.set(e,a),a}])},728515,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.s(["ClearableTextField",0,function({hint:e="",labelText:n,title:a,minLines:s,maxLines:i,inputFormatters:l=[],textStyle:o,keyboardType:d="text",textInputAction:c="none",value:u,keepHint:p=!1,hasHeight:m=!0,isReadOnly:f=!1,enabled:h=!0,clearButtonVisibility:x=!0,onEditingComplete:g,onFieldSubmitted:y,validator:b,onChanged:v,className:j,style:w}){let N=u??"",[C,S]=(0,r.useState)(N),[k,_]=(0,r.useState)(N),[P,E]=(0,r.useState)(),[T,M]=(0,r.useState)(!1),I=(0,r.useRef)(null);N!==k&&(_(N),S(N));let D=(i??s??1)>1;return(0,t.jsxs)("div",{className:["flex flex-col gap-1.5",j].filter(
2Boolean).join(" "),style:w,children:[a?(0,t.jsx)("div",{className:"text-xs font-medium text-foreground",children:a}):null,(0,t.jsxs)("label",{className:"relative flex items-center rounded-lg border border-border bg-background",children:[n?(0,t.jsx)("span",{className:"pl-3 text-xs text-muted-foreground",children:n}):null,(0,t.jsx)(D?"textarea":"input",{ref:I,className:"z-10 flex-1 border-0 bg-transparent p-3 text-sm font-sans outline-none disabled:cursor-not-allowed disabled:bg-muted/40",placeholder:p?"":e,value:C,onChange:e=>{let t;return t=e.target.value,void(l.forEach(e=>{t=e(t)}),S(t),E(b?b(t):void 0),v?.(t),M(!!t))},onBlur:g,onKeyDown:e=>{"Enter"===e.key&&y?.(C)},readOnly:f,disabled:!h,style:o,minLength:s,rows:D?Math.max(s??1,1):void 0,maxLength:i,type:D?void 0:d}),p?(0,t.jsx)("div",{className:"pointer-events-none absolute left-3 right-9 z-0 flex gap-0.5 text-sm text-[rgba(2,15,22,0.4)]","aria-hidden":!0,children:e.split("").map((e,r)=>(0,t.jsx)("span",{className:["transition-opacity",r<C.length?"opacity-20":"opacity-100"].join(" "),children:e},r))}):null,x&&T&&!f?(0,t.jsx)("button",{type:"button",className:"absolute right-2 top-1/2 z-20 h-7 w-7 -translate-y-1/2 rounded-full border-0 bg-muted/40 text-foreground shadow-sm transition hover:brightness-95",onClick:()=>{S(""),E(void 0),v?.(""),M(!1),I.current?.focus()},"aria-label":"Clear input",children:"Ã"}):null]}),P?(0,t.jsx)("div",{className:"text-xs text-destructive",children:P}):null]})}])},221642,e=>{"use strict";var t=e.i(843476);e.s(["DashSeparator",0,function({height:e=1,color:r="hsl(var(--foreground))",dashWidth:n=10,gapWidth:a=10,className:s,style:i}){let l={"--dash-color":r,"--dash-width":`${n}px`,"--dash-gap":`${a}px`,height:e,backgroundImage:"repeating-linear-gradient(to right, var(--dash-color), var(--dash-color) var(--dash-width), transparent var(--dash-width), transparent calc(var(--dash-width) + var(--dash-gap)))",backgroundRepeat:"repeat-x",backgroundSize:"calc(var(--dash-width) + var(--dash-gap)) 100%",...i};return(0,t.jsx)("div",{className:["w-full",s].filter(Boolean).join(" "),"aria-hidden":!0,style:l})}])},953421,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(131128),a=e.i(127890);function s({firstDay:e,focusedDay:i,selectedStartDate:l,selectedEndDate:o,unavailableDates:d=[],title:c,buttonTextFirst:u="Apply",buttonTextSecond:p="Clear",dateSelectorWarningText:m,hasTimeSlots:f=!0,timeSlots:h=[],selectedTimeSlotId:x,onTimeSlotSelected:g,allowSaturday:y=!0,allowSunday:b=!1,allowAllDates:v=!1,onDaySelected:j}){let[w,N]=(0,r.useState)(l),[C,S]=(0,r.useState)(o),k=(0,r.useMemo)(()=>d.map(e=>e.toDateString()),[d]),_=t=>!v&&(!y&&6===t.getDay()||!b&&0===t.getDay()||!!e&&t<e||k.includes(t.toDateString())),P=h.map(e=>({label:e.label,value:e.id}));return(0,t.jsxs)("div",{className:"grid gap-3 rounded-xl border border-border bg-white p-3",children:[c?(0,t.jsx)("div",{className:"text-lg font-bold text-foreground",children:c}):null,(0,t.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(220px,1fr))] gap-2",children:[(0,t.jsxs)("label",{className:"grid gap-1 text-sm text-foreground",children:[(0,t.jsx)("span",{children:"Start date"}),(0,t.jsx)("input",{type:"date",value:w?w.toISOString().slice(0,10):"",min:e?e.toISOString().slice(0,10):void 0,onChange:e=>{let t=e.target.value?new Date(e.target.value):void 0;t&&_(t)||N(t)},className:"rounded-lg border border-border p-2.5 text-sm outline-none"})]}),(0,t.jsxs)("label",{className:"grid gap-1 text-sm text-foreground",children:[(0,t.jsx)("span",{children:"End date"}),(0,t.jsx)("input",{type:"date",value:C?C.toISOString().slice(0,10):"",min:w?w.toISOString().slice(0,10):e?.toISOString().slice(0,10),onChange:e=>{let t=e.target.value?new Date(e.target.value):void 0;t&&_(t)||S(t)},className:"rounded-lg border border-border p-2.5 text-sm outline-none"})]})]}),f&&h.length>0?(0,t.jsx)("div",{className:"grid gap-2",children:(0,t.jsx)(n.DsDropdown,{items:P,value:x,onChange:e=>{"string"==typeof e&&g?.(e)},hintText:"Select a time"})}):null,m?(0,t.jsx)("div",{className:"text-[13px] text-destructive",children:m}):null,(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(a.DsButton,{size:"big",label:p,color:"outlineSecondary",onTap:()=>{N(void 0),S(void 0)}}),(0,t.jsx)(a.DsButton,{size:"big",label:u,onTap:()=>{w&&j?.(w,C)},disabled:!w})]})]})}e.s(["DateRangeSelector",0,function(e){let r=`${e.selectedStartDate?.toISOString()??"none"}|${e.selectedEndDate?.toISOString()??"none"}`;return(0,t.jsx)(s,{...e},r)}])},127890,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(952789);
2let a={active:{background:n.dsBackgroundColors.primaryButton,foreground:n.dsTextColors.contrast,stroke:null},activeSecondary:{background:n.dsBackgroundColors.secondaryButton,foreground:n.dsTextColors.contrast,stroke:null},active10:{background:n.dsBackgroundColors.primaryButton10,foreground:n.dsTextColors.accent,stroke:null},success:{background:n.dsBackgroundColors.success,foreground:n.dsTextColors.contrast,stroke:null},contrast:{background:n.dsBackgroundColors.primaryThemed,foreground:n.dsTextColors.accent,stroke:null},white:{background:n.dsBackgroundColors.buttonContrast,foreground:n.dsTextColors.accent,stroke:null},disabled:{background:n.dsBackgroundColors.tertiaryThemed,foreground:n.dsTextColors.secondaryThemed,stroke:null},outline:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.accent,stroke:n.dsStrokeColors.focus},outlineSecondary:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.accent,stroke:n.dsStrokeColors.neutral},outlineNeutral:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.primaryThemed,stroke:n.dsStrokeColors.neutral},outlineSuccess:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.success,stroke:n.dsStrokeColors.success},outlineCritical:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.danger,stroke:n.dsStrokeColors.critical},transparent:{background:n.dsBackgroundColors.actionTertiary,foreground:n.dsTextColors.accent,stroke:null},noBackground:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.accent,stroke:null},bgFinal:{background:n.dsBackgroundColors.finalAction,foreground:n.dsTextColors.contrast,stroke:null},critical:{background:n.dsBackgroundColors.critical,foreground:n.dsTextColors.contrast,stroke:null}},s={small:32,big:48},i={small:"0 12px",big:"0 16px"};e.s(["DsButton",0,function({size:e,icon:n,label:l,onTap:o,buttonType:d="button",color:c="active",borderWidth:u=1,borderRadius:p=8,shadowColor:m="transparent",fixedSize:f,padding:h,className:x,style:g,disabled:y,title:b,ariaLabel:v}){let[j,w]=(0,r.useState)(!1);if(!n&&!l)throw Error("DsButton must have either an icon or a label");let N=a[c]??a.active,C=a.disabled,S=y||"button"===d&&!o,{background:k,foreground:_,stroke:P}=S?C:N,E=(0,r.useMemo)(()=>f?{width:f,height:f}:{height:s[e]},[f,e]),T=async()=>{if(!S&&!j&&o)try{w(!0),await o()}finally{w(!1)}};return(0,t.jsx)("button",{type:d,onClick:T,disabled:S||j,title:b,"aria-label":v,className:["inline-flex items-center justify-center gap-2 font-semibold leading-none","small"===e?"text-sm":"text-base","transition-transform duration-150 ease-out","focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-500",S||j?"cursor-not-allowed opacity-80":"cursor-pointer active:translate-y-px",x].filter(Boolean).join(" "),"data-variant":c,"data-size":e,"aria-busy":j,style:{background:k,color:_,border:P?`${u}px solid ${S?C.background:P}`:"none",borderRadius:p,boxShadow:"transparent"===m?void 0:`0 2px 6px ${m}`,padding:f?0:h??i[e],...E,...g},children:j?(0,t.jsx)("span",{className:"h-4 w-4 rounded-full border-[3px] border-current border-t-transparent animate-spin","aria-hidden":!0}):(0,t.jsxs)("span",{className:"inline-flex items-center justify-center gap-2",children:[n?(0,t.jsx)("span",{"aria-hidden":!0,children:n}):null,l?(0,t.jsx)("span",{className:"whitespace-nowrap",children:l}):null]})})}],127890)},678055,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.s(["DsCarouselSlider",0,function({items:e,itemBuilder:n,onPageChanged:a,aspectRatio:s=16/9,viewportFraction:i=.8,autoPlay:l=!1,autoPlayIntervalMs:o=3e3,infinite:d=!1,className:c,style:u}){let[p,m]=(0,r.useState)(0),f=(0,r.useRef)(null),h=Math.max(1,Math.min(3,Math.round(1/i))),x=(0,r.useMemo)(()=>e.map((e,t)=>({item:e,idx:t})),[e]);(0,r.useEffect)(()=>{if(l&&!(e.length<=1))return f.current=window.setInterval(()=>{m(t=>{let r=t+1;return r>=e.length?d?0:t:r}),a?.((p+1)%e.length,"auto")},o),()=>{null!==f.current&&window.clearInterval(f.current)}},[l,o,e.length,d,a,p]);let g=(e,t)=>{m(e),a?.(e,t)};return(0,t.jsxs)("div",{className:["relative w-full overflow-hidden",c].filter(
2Boolean).join(" "),style:{aspectRatio:s,...u},children:[(0,t.jsx)("div",{className:"flex gap-3 overflow-x-auto pb-2 transition-transform duration-300 ease-out snap-x snap-mandatory [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{"--viewport-fraction":i},children:x.map(({item:e,idx:r})=>(0,t.jsx)("div",{className:"snap-center transition-transform duration-200 ease-out data-[active=true]:scale-[1.02]","data-active":r===p,style:{flex:`0 0 ${100*i}%`},onClick:()=>g(r,"manual"),children:n(r,e)},r))}),(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-2 flex justify-center gap-1.5",children:x.slice(0,h?void 0:x.length).map(({idx:e})=>(0,t.jsx)("button",{type:"button",className:"h-2.5 w-2.5 rounded-full border-0 bg-black/40 transition-colors data-[active=true]:bg-primary","data-active":e===p,onClick:()=>g(e,"manual"),"aria-label":`Go to slide ${e+1}`},e))})]})}])},890261,e=>{"use strict";var t=e.i(843476);e.s(["DsCheckbox",0,function({text:e,onChanged:r,isSelected:n=!1,isFullWidth:a=!1,isCheckBoxLocatedLeft:s=!0,isSpaceBetween:i=!1,multiLineText:l=!1,hasDivider:o=!1,isDisabled:d=!1,contentPadding:c=0,iconSize:u=24,textPadding:p=8,hasText:m=!0,className:f,style:h}){let x=()=>{d||r(!n)},g=(0,t.jsx)("span",{className:["inline-flex items-center justify-center rounded-lg border",n?"border-primary bg-primary text-white":"border-border bg-transparent text-white",d?"border-border bg-muted/40":null].filter(Boolean).join(" "),"aria-hidden":!0,style:{width:u,height:u},"data-checked":n,"data-disabled":d,children:n?(0,t.jsx)("svg",{viewBox:"0 0 24 24",width:u,height:u,fill:"none",stroke:"currentColor",strokeWidth:"3",children:(0,t.jsx)("polyline",{points:"4 12 10 18 20 6"})}):null}),y=m?(0,t.jsx)("span",{className:"font-sans text-sm text-foreground",children:e}):null,b=(0,t.jsxs)("div",{className:"inline-flex items-center",style:{justifyContent:i?"space-between":"flex-start",gap:p},children:[s?g:y,a||l?(0,t.jsx)("span",{className:"inline-flex flex-1",children:y}):y,s?null:g]});return(0,t.jsxs)("div",{className:["inline-flex flex-col select-none",d?"cursor-not-allowed opacity-70":"cursor-pointer",f].filter(Boolean).join(" "),role:"checkbox","aria-checked":n,tabIndex:0,onClick:x,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),x())},"data-disabled":d,style:{padding:c,...h},children:[b,o?(0,t.jsx)("div",{className:"mt-2 h-px w-full bg-black/40"}):null]})}])},138995,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(926805),a=e.i(401851),s=e.i(826514),i=e.i(368977);e.i(986823);var l=e.i(113827),o=e.i(499971),d=e.i(645636),c=e.i(35695);let u=e=>{if(!e)return null;let t=Array.isArray(e)?e[0]:String(e),r=(0,s.parseISO)(t);return(0,i.isValid)(r)?r:null},p=e=>e?(0,a.format)(e,"yyyy-MM-dd"):"",m=(0,r.forwardRef)(function({label:e,helperText:s,error:i,containerClassName:m,labelClassName:f,buttonClassName:h,helperTextClassName:x,errorClassName:g,placeholder:y="Select date",isDateDisabled:b,id:v,name:j,value:w,defaultValue:N,disabled:C,min:S,max:k,onChange:_,...P},E){let T=v??j,M=s&&T?`${T}-helper`:void 0,I=i&&T?`${T}-error`:void 0,D=[M,I].filter(Boolean).join(" ")||void 0,R=void 0!==w,[$,A]=(0,r.useState)(()=>p(u(N))),L=R?String(w??""):$,O=(0,r.useMemo)(()=>u(L),[L]),B=(0,r.useMemo)(()=>u(S),[S]),z=(0,r.useMemo)(()=>u(k),[k]);return(0,t.jsxs)("div",{className:m,children:[e?(0,t.jsx)("label",{className:f??"text-sm font-semibold text-foreground",htmlFor:T,children:e}):null,j?(0,t.jsx)("input",{type:"hidden",name:j,value:L}):null,(0,t.jsxs)(c.Popover,{children:[(0,t.jsx)(c.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(o.Button,{ref:E,id:T,variant:"outline",disabled:C,"aria-invalid":!!i||void 0,"aria-describedby":D,className:(0,l.cn)("w-full justify-start text-left font-normal border border-input bg-background px-3 py-2 text-sm shadow-none",!O&&"text-muted-foreground",i&&"border-destructive","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",h),children:[(0,t.jsx)(n.CalendarIcon,{className:"mr-2 h-4 w-4"}),O?(0,a.format)(O,"MMM d, yyyy"):(0,t.jsx)("span",{children:y})]})}),(0,t.jsx)(c.PopoverContent,{className:"w-auto p-0",align:"start",children:(0,t.jsx)(d.
2Calendar,{mode:"single",selected:O??void 0,onSelect:e=>{let t;return t=p(e??void 0??null),void(!R&&A(t),_&&_({target:{value:t,name:j,id:T}}))},disabled:e=>!!(B&&e<B||z&&e>z||b&&b(e)),className:"pointer-events-auto"})})]}),s?(0,t.jsx)("p",{id:M,className:x??"text-xs text-muted-foreground",children:s}):null,i?(0,t.jsx)("p",{id:I,className:g??"text-xs text-destructive",role:"alert",children:i}):null]})});e.s(["DsDatePicker",0,m])},1455,e=>{"use strict";var t=e.i(843476),r=e.i(418883),n=e.i(138995),a=e.i(776553);function s(e){let[t="",r=""]=e.split("T");return{date:t,time:r}}e.s(["DsDateTimePicker",0,function({id:e,label:i,value:l,disabled:o,minDate:d,datePlaceholder:c="Select date",timePlaceholder:u="--:--",dateButtonClassName:p,timeTriggerClassName:m,isTimeDisabled:f,onChange:h}){let{date:x,time:g}=s(l),y=`${e}-date`,b=`${e}-time`;return(0,t.jsxs)("div",{className:"space-y-2",children:[i?(0,t.jsx)(r.Label,{htmlFor:y,children:i}):null,(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(n.DsDatePicker,{id:y,value:x,disabled:o,min:d,placeholder:c,buttonClassName:p??"min-w-[10rem] flex-1",onChange:e=>{var t;(t=e.target.value)?h(`${t}T${g||(0,a.currentLocalTimeValue)()}`):h("")}}),(0,t.jsx)(a.DsTimePicker,{id:b,value:g,disabled:o,placeholder:u,triggerClassName:m,isTimeDisabled:f,onChange:e=>{h(`${x||(0,a.currentLocalDateValue)()}T${e}`)}})]})]})},"splitLocalDateTimeValue",0,s])},131128,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(689664);e.s(["DsDropdown",0,function({items:e,value:a,onChange:s,searchEnabled:i=!0,prefixIcon:l,suffixIcon:o,borderColor:d="hsl(var(--border))",borderRadius:c=8,backgroundColor:u="hsl(var(--card))",labelStyle:p,hintText:m,multi:f=!1,className:h,style:x}){let g=(0,r.useMemo)(()=>f?Array.isArray(a)?a:[]:a,[f,a]);return(0,t.jsxs)("div",{className:["grid gap-1 rounded-lg border bg-card p-2",h].filter(Boolean).join(" "),style:{borderColor:d,borderRadius:c,backgroundColor:u,...x},children:[(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[l?(0,t.jsx)("span",{className:"inline-flex items-center justify-center text-inherit",children:l}):null,(0,t.jsx)("input",{className:"flex-1 border-0 bg-transparent text-sm outline-none placeholder:text-slate-500",placeholder:m,readOnly:!i,"aria-label":"Search options"}),o?(0,t.jsx)("span",{className:"inline-flex items-center justify-center text-inherit",children:o}):null]}),(0,t.jsx)("div",{className:"grid gap-1",children:e.map(e=>{let r=f?g.some(t=>t===e.value):g===e.value;return(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm transition-colors data-[selected=true]:border-primary data-[selected=true]:bg-primary/10 data-[selected=true]:text-primary disabled:cursor-not-allowed disabled:opacity-60","data-selected":r,disabled:e.disabled,onClick:()=>(e=>{if(f){let t=Array.isArray(g)?g:[];s(t.some(t=>t===e)?t.filter(t=>t!==e):[...t,e])}else s(e)})(e.value),children:[(0,t.jsx)("span",{style:p,children:e.label}),r?(0,t.jsx)(n.Check,{className:"h-4 w-4 text-primary","aria-hidden":!0}):null]},String(e.value))})})]})}])},210572,e=>{"use strict";var t=e.i(843476);let r=(0,e.i(271645).forwardRef)(function({label:e,helperText:r,error:n,containerClassName:a,labelClassName:s,inputClassName:i,helperTextClassName:l,errorClassName:o,id:d,readOnly:c,...u},p){let m=d??u.name,f=r&&m?`${m}-helper`:void 0,h=n&&m?`${m}-error`:void 0,x=[f,h].filter(Boolean).join(" ")||void 0;return(0,t.jsxs)("div",{className:a,children:[e?(0,t.jsx)("label",{className:s??"text-sm font-semibold text-foreground",htmlFor:m,children:e}):null,(0,t.jsx)("input",{...u,id:m,ref:p,readOnly:c,"aria-invalid":!!n||void 0,"aria-describedby":x,className:["w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-primary/20 disabled:bg-muted/30 disabled:text-muted-foreground",c?"bg-muted/30 text-muted-foreground":"",i].filter(Boolean).join(" ")}),r?(0,t.jsx)("p",{id:f,className:l??"text-xs text-muted-foreground",children:r}):null,n?(0,t.jsx)("p",{id:h,className:o??"text-xs text-destructive",role:"alert",children:n}):null]})});e.s(["DsInput",0,r])},134047,e=>{"use strict";var t=e.i(843476);e.i(986823);var r=e.i(113827),n=e.i(749505);let a=(e,t,r)=>
2Math.min(Math.max(e,t),r);e.s(["DsPagination",0,function({page:e,pageSize:s,totalCount:i,onPageChange:l,className:o,disabled:d}){let c=Math.max(1,e),u=Math.max(0,i??0),p=Math.max(1,s?Math.ceil(u/s):1),m=function(e,t,r=1){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[1],s=a(e-r,2,t-1),i=a(e+r,2,t-1);s>2&&n.push("ellipsis");for(let e=s;e<=i;e+=1)n.push(e);return i<t-1&&n.push("ellipsis"),n.push(t),n}(c,p),f=c>1,h=c<p,x="pointer-events-none opacity-50",g=e=>t=>{t.preventDefault(),d||l(e)};return(0,t.jsx)(n.Pagination,{className:(0,r.cn)("justify-end",o),children:(0,t.jsxs)(n.PaginationContent,{children:[(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationPrevious,{href:"#",onClick:g(c-1),className:(0,r.cn)(!f||d?x:"")})}),m.map((e,a)=>"ellipsis"===e?(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationEllipsis,{})},`ellipsis-${a}`):(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationLink,{href:"#",onClick:g(e),isActive:e===c,className:(0,r.cn)(d?x:""),children:e})},e)),(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationNext,{href:"#",onClick:g(c+1),className:(0,r.cn)(!h||d?x:"")})})]})})}])},708789,e=>{"use strict";var t=e.i(843476);e.s(["DsRadio",0,function({text:e,onChanged:r,value:n,groupValue:a,widget:s,hasBorder:i=!0,isFullWidth:l=!1,textStyle:o,isTextOnRight:d=!0,className:c,style:u}){let p=n===a,m=()=>{p||r(n)},f=(0,t.jsx)("span",{className:["inline-flex h-6 w-6 items-center justify-center rounded-full border",p?"border-primary":"border-border"].join(" "),"aria-hidden":!0,children:p?(0,t.jsx)("span",{className:"h-3.5 w-3.5 rounded-full bg-primary"}):null}),h=(0,t.jsx)("span",{className:"font-sans text-sm text-foreground",style:o,children:s??e});return(0,t.jsxs)("div",{className:["inline-flex items-center gap-2 rounded-2xl p-2","cursor-pointer select-none",c].filter(Boolean).join(" "),role:"radio",tabIndex:0,"aria-checked":p,onClick:m,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),m())},style:{border:i?`0.5px solid ${p?"hsl(var(--primary))":"hsl(var(--border))"}`:void 0,...u},children:[d?f:h,l?(0,t.jsx)("span",{className:"flex-1"}):(0,t.jsx)("span",{className:"w-2"}),d?h:f]})}])},168299,e=>{"use strict";var t=e.i(843476);let r=(0,e.i(271645).forwardRef)(function({label:e,helperText:r,error:n,containerClassName:a,labelClassName:s,selectClassName:i,helperTextClassName:l,errorClassName:o,id:d,...c},u){let p=d??c.name,m=r&&p?`${p}-helper`:void 0,f=n&&p?`${p}-error`:void 0,h=[m,f].filter(Boolean).join(" ")||void 0;return(0,t.jsxs)("div",{className:a,children:[e?(0,t.jsx)("label",{className:s??"text-sm font-semibold text-foreground",htmlFor:p,children:e}):null,(0,t.jsx)("select",{...c,id:p,ref:u,"aria-invalid":!!n||void 0,"aria-describedby":h,className:["w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-primary/20 disabled:bg-muted/30 disabled:text-muted-foreground",i].filter(Boolean).join(" ")}),r?(0,t.jsx)("p",{id:m,className:l??"text-xs text-muted-foreground",children:r}):null,n?(0,t.jsx)("p",{id:f,className:o??"text-xs text-destructive",role:"alert",children:n}):null]})});e.s(["DsSelect",0,r])},129519,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(890261);let a={enabledColor:"hsl(var(--primary))",disabledColor:"hsl(var(--foreground) / 0.4)",iconSize:32,enabledTitleStyle:{fontWeight:700,fontSize:16,color:"hsl(var(--foreground))"},enabledSubTitleStyle:{fontWeight:400,fontSize:12,color:"hsl(var(--foreground) / 0.6)"},disabledTitleStyle:{fontWeight:700,fontSize:16,color:"hsl(var(--foreground) / 0.4)"},disabledSubTitleStyle:{fontWeight:400,fontSize:12,color:"hsl(var(--foreground) / 0.4)"},insidePadding:16,outsidePadding:16,buttonType:"switchButton",height:72,borderWidth:0,borderColor:"hsl(var(--foreground) / 0.6)",backgroundColor:"hsl(var(--card))"};e.s(["DsSwitch",0,function({icon:e,title:s,subtitle:i,infoText:l,enabled:o,checkBoxGroup:d=!1,onChanged:c,theme:u,buttonType:p,isSwitchLocatedLeft:m=!1,isDisabled:f=!1,className:h,style:x}){let[g,y]=(0,r.useState)(o),b={...a,...u??{},buttonType:p??u?.buttonType??a.buttonType};(0,r.useEffect)(()=>{d&&o!==g&&y(o)},[d,o,g]);let v=e=>{if(f)return;let t="boolean"==typeof e?e:!g;y(t),c?.(t)},j="switchButton"===b.buttonType?(0,t.jsxs)("label",{className:"relative inline-flex items-center",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("input",{type:"checkbox",checked:g,onChange:e=>{e.stopPropagation(),v(e.target.checked)},disabled:f,className:"sr-only"}),(0,t.jsx)("span",{className:"inline-flex h-7 w-12 items-center rounded-full px-1 transition-colors",style:{backgroundColor:g?b.enabledColor:b.disabledColor},children:(0,t.jsx)("span",{className:`h-5 w-5 rounded-full bg-card transition-transform ${g?"translate-x-5":""}`})})]}):(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,t.jsx)(n.DsCheckbox,{text:"",isSelected:g,onChanged:()=>v(),isDisabled:f})});return(0,t.jsx)("div",{className:["flex items-center rounded-2xl",f?"cursor-not-allowed opacity-70":"cursor-pointer",h].filter(
2Boolean).join(" "),style:{minHeight:b.height,border:b.borderWidth>0?`${b.borderWidth}px solid ${b.borderColor}`:void 0,backgroundColor:b.backgroundColor,padding:`${b.insidePadding}px`,...x},onClick:()=>v(),role:"switch","aria-checked":g,"aria-disabled":f,children:(0,t.jsxs)("div",{className:"flex w-full items-center gap-3",children:[m?j:null,(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[s?(0,t.jsxs)("div",{style:g?b.enabledTitleStyle:b.disabledTitleStyle,className:"inline-flex items-center gap-1.5",children:[s,l?(0,t.jsx)("span",{className:"text-xs text-primary",children:l}):null]}):null,i?(0,t.jsx)("div",{style:g?b.enabledSubTitleStyle:b.disabledSubTitleStyle,children:i}):null]}),e?(0,t.jsx)("div",{className:"inline-flex items-center justify-center",style:{width:b.iconSize,height:b.iconSize,color:g?b.enabledColor:b.disabledColor},children:e}):null,m?null:j]})})}])},782551,864256,e=>{"use strict";var t=e.i(843476),r=e.i(952789);e.i(924856);let n={titleBold:{fontSize:24,lineHeight:26,letterSpacing:0,fontWeight:700},title:{fontSize:24,lineHeight:26,letterSpacing:0,fontWeight:400},bodyBig:{fontSize:18,lineHeight:24,letterSpacing:0,fontWeight:400},bodyBigBold:{fontSize:18,lineHeight:24,letterSpacing:0,fontWeight:700},bodyMedium:{fontSize:16,lineHeight:20,letterSpacing:0,fontWeight:400},bodyMediumBold:{fontSize:16,lineHeight:20,letterSpacing:0,fontWeight:700},button:{fontSize:14,lineHeight:16,letterSpacing:0,fontWeight:700},bodyText:{fontSize:14,lineHeight:16,letterSpacing:0,fontWeight:400},bodyBoldText:{fontSize:14,lineHeight:16,letterSpacing:0,fontWeight:700},labelBold:{fontSize:12,lineHeight:16,letterSpacing:0,fontWeight:700},label:{fontSize:12,lineHeight:16,letterSpacing:0,fontWeight:400},widgetTitle:{fontSize:16,lineHeight:20,letterSpacing:0,fontWeight:700},headline:{fontSize:48,lineHeight:60,letterSpacing:0,fontWeight:500},eyebrow:{fontSize:12,lineHeight:14,letterSpacing:.08,fontWeight:700}},a="primaryThemed";e.s(["defaultTextColor",0,a],864256),e.s(["DsText",0,function({text:e,variant:s,color:i,customTextColor:l,maxLines:o,softWrap:d,textAlign:c,textDecoration:u,overflow:p="fade",selectable:m=!1,forceLineHeight:f=!1,className:h,style:x}){let g=n[s],y=l??r.dsTextColors[i??a],b=o&&o>0,v=["inline font-sans"];return h&&v.push(h),m&&v.push("select-text"),b&&v.push("overflow-hidden"),"fade"===p&&v.push("overflow-hidden"),!1===d&&v.push("whitespace-nowrap"),(0,t.jsx)("span",{className:v.join(" "),"data-variant":s,style:{color:y,fontSize:`${g.fontSize}px`,lineHeight:f?`${g.lineHeight}px`:void 0,letterSpacing:`${g.letterSpacing}px`,fontWeight:g.fontWeight,textAlign:c,textDecoration:u,overflow:b?"hidden":void 0,textOverflow:b?"ellipsis"===p?"ellipsis":"clip":void 0,...b?{WebkitLineClamp:o,WebkitBoxOrient:"vertical",display:"-webkit-box"}:{},..."fade"===p?{WebkitMaskImage:"linear-gradient(90deg, rgba(0, 0, 0, 1) 70%, transparent)",maskImage:"linear-gradient(90deg, rgba(0, 0, 0, 1) 70%, transparent)"}:{},...x},children:e})}],782551)},776553,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(986823);var n=e.i(113827),a=e.i(289954);function s(e){return String(e).padStart(2,"0")}function i(e){let[t,r]=e.split(":").map(Number);return Number.isNaN(t)||Number.isNaN(r)?0:60*t+r}function l(e){let t=Math.max(0,Math.min(1439,e));return`${s(Math.floor(t/60))}:${s(t%60)}`}function o(e){let[t,r]=e.split(":").map(Number);return Number.isNaN(t)||Number.isNaN(r)?e:`${t%12==0?12:t%12}:${s(r)} ${t<12?"AM":"PM"}`}function d(e=new Date){return`${e.getFullYear()}-${s(e.getMonth()+1)}-${s(e.getDate())}`}function c(e=new Date){return`${s(e.getHours())}:${s(e.getMinutes())}`}function u(e=new Date){return`${d(e)}T${c(e)}`}e.s(["DsTimePicker",0,function({id:e,value:s,disabled:d,placeholder:c="--:--",stepMinutes:u=15,includeValues:p=[],triggerClassName:m,contentClassName:f,isTimeDisabled:h,onChange:x}){let g=(0,r.useMemo)(()=>{let e=new Set,t=Math.max(1,u);for(let r=0;r<1440;r+=t)e.add(l(r));return s&&e.add(s),p.forEach(t=>{t&&e.add(t)}),Array.from(e).sort((e,t)=>i(e)-i(t)).map(e=>({value:e,label:o(e)}))},[p,u,s]);return(0,t.jsxs)(a.Select,{value:s||void 0,disabled:d,onValueChange:x,children:[(0,t.jsx)(a.SelectTrigger,{id:e,className:(0,n.cn)("w-28",m),children:(0,t.jsx)(a.SelectValue,{placeholder:c})}),(0,t.jsx)(a.SelectContent,{className:(0,n.cn)("max-h-64",f),children:g.map(e=>(0,t.jsx)(a.SelectItem,{value:e.value,disabled:h?.(e.value),children:e.label},e.value))})]})},"addMinutesToLocalDateTimeValue",0,function(e,t){let r=new Date(e);return Number.isNaN(r.getTime())?e:(r.setMinutes(r.getMinutes()+t),u(r))},"currentLocalDateTimeValue",0,u,"currentLocalDateValue",0,d,"currentLocalTimeValue",0,c,"formatTimeLabel",0,o,"minutesToTime",0,l,"timeToMinutes",0,i])},495002,57343,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(853138),a=e.i(146387),s=e.i(420865),i=e.i(882303);e.i(924856);let l=new Set(["high","medium"]),o={same_non_generic_domain:"Same company email domain",domain_alias:"Known matching company domain",same_phone:"Same company phone number",same_tax_id:"Same tax/legal identifier",normalized_name_and_location:"Similar company name and matching location",fuzzy_n
2ame_location_overlap:"Possibly similar company name and location",weak_fuzzy_name_location_overlap:"Weak company/location similarity"},d=e=>{let t=o[e];return t||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())},c={high:"High confidence",medium:"Medium confidence",low:"Low confidence"},u=e=>c[e]??"Match",p=e=>!!e&&l.has(e.confidence),m=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),f=e=>"string"==typeof e&&e.length>0?e:null,h=e=>"high"===e||"medium"===e||"low"===e?e:"medium",x=e=>"number"!=typeof e||!Number.isFinite(e)||e<0?null:Math.trunc(e),g=e=>{if(!m(e))return null;let t=f(e.account_hint);if(!t)return null;let r=Array.isArray(e.reasons)?e.reasons.filter(e=>"string"==typeof e):[];return{user_group_id:f(e.user_group_id),account_hint:t,location_hint:f(e.location_hint),confidence:h(e.confidence),reasons:r,llm_assessment:f(e.llm_assessment),team_size:(e=>{if(!m(e))return null;let t=x(e.active),r=x(e.total);return null===t&&null===r?null:{active:t??0,total:r??t??0}})(e.team_size)}};e.s(["formatDuplicateConfidence",0,u,"formatDuplicateReason",0,d,"isBlockingDuplicateAccountReview",0,p,"parseDuplicateAccountError",0,e=>{let t=(e=>{if(!m(e))return null;if("number"==typeof e.status)return e.status;let t=e.response;return m(t)&&"number"==typeof t.status?t.status:null})(e);if(null!==t&&400!==t)return null;let r=(e=>{if(!m(e))return null;let t=e.data;if(m(t))return t;let r=e.response;return m(r)&&m(r.data)?r.data:null})(e);if(!r)return null;let n=r.errors;if(!Array.isArray(n)||0===n.length)return null;let a=n[0];if(!m(a)||"possible_duplicate_account"!==a.code)return null;let s=m(r.duplicate_review)?r.duplicate_review:null,i=(s&&Array.isArray(s.candidates)?s.candidates:[]).map(g).filter(e=>null!==e);return{status:(s?f(s.status):null)??"needs_review",confidence:h(s?s.confidence:void 0),candidates:i}}],57343);var y=e.i(499971),b=e.i(308574),v=e.i(220624),j=e.i(418883),w=e.i(3321);e.i(49875);var N=e.i(583766);let C={high:"bg-destructive/10 text-destructive ring-1 ring-inset ring-destructive/20",medium:"bg-warning/10 text-warning ring-1 ring-inset ring-warning/20",low:"bg-muted text-muted-foreground ring-1 ring-inset ring-border"},S=({candidate:e})=>{var r;let n=e.reasons.map(d).join(" · ");return(0,t.jsx)("li",{className:"rounded-xl border border-border bg-card p-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:(0,t.jsx)(a.Building2,{className:"h-4 w-4","aria-hidden":!0})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[e.user_group_id?(0,t.jsx)(N.UserGroupText,{userGroupId:e.user_group_id,userGroupName:e.account_hint,href:`/crm/company/${e.user_group_id}`,className:"text-sm font-semibold text-foreground"}):(0,t.jsx)("p",{className:"truncate text-sm font-semibold text-foreground",children:e.account_hint}),(0,t.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[e.location_hint?(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(s.MapPin,{className:"h-3 w-3","aria-hidden":!0}),e.location_hint]}):null,e.team_size?(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(i.Users,{className:"h-3 w-3","aria-hidden":!0}),(r=e.team_size).total===r.active?1===r.total?"1 teammate":`${r.total} teammates`:`${r.active} active \xb7 ${r.total} total teammates`]}):null]})]}),(0,t.jsx)("span",{className:["shrink-0 rounded-full px-2 py-0.5 text-[11px] font-semibold",C[e.confidence]].join(" "),children:u(e.confidence)})]}),n?(0,t.jsxs)("p",{className:"mt-2 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Match: "}),n]}):null]})]})})};e.s(["DuplicateAccountDialog",0,function({open:e,onOpenChange:a,review:s,onCreateAnyway:i,onGoBack:l,isConfirming:o=!1,goBackLabel:d="Go back and edit",staffOverride:c}){let u=(0,r.useMemo)(()=>s?.candidates??[],[s]),m=p(s),f=1===u.length?"1 possible existing account":`${u.length} possible existing accounts`,h=m&&!!c;return(0,t.jsx)(v.Dialog,{open:e,onOpenChange:e=>{(!o||e)&&a(e)},children:(0,t.jsxs)(v.DialogContent,{className:"sm:max-w-[560px]",children:[(0,t.jsx)(v.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-warning/10 text-warning",children:(0,t.jsx)(n.AlertTriangle,{className:"h-5 w-5","aria-hidden":!0})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(v.DialogTitle,{className:"text-left",children:"This company may already exist"}),(0,t.jsx)(v.DialogDescription,{className:"mt-1 text-left",children:h?"Review the matching accounts below. Create this company separately only when you have confirmed it is not a duplicate.":m?"We found a likely existing account that matches this company. To avoid duplicate accounts, update the company details or use the existing account.":"We found a possible existing account that matches details from this company. To avoid creating duplicate accounts, check whether you should join the existing account instead."})]})]})}),m?(0,t.jsx)("div",{className:"rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-sm font-medium text-destructive",children:h?"Creating separately requires an explicit acknowledgement and a reason.":"Account creation is blocked until the existing account is resolved or the duplicate signals no longer apply."}):null,u.length>0?(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:f}),(0,t.jsx)("ul",{className:"space-y-2",children:u.map((e,r)=>(0,t.jsx)(S,{candidate:e},`${e.account_hint}-${r}`))})]}):(0,t.jsx)("div",{className:"mt-2 rounded-xl border border-border bg-muted/30 p-4",children:(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["We could not surface candidate details, but the system flagged this as a likely duplicate.",m?" Update the company details or use the existing account.":" Confirm with your team before creating a separate account."]})}),h&&c?(0,t.jsxs)("div",{className:"mt-4 space-y-4 border-t border-border pt-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(b.Checkbox,{id:"duplicate-override-confirmed",checked:c.confirmed,onCheckedChange:e=>c.onConfirmedChange(!0===e),disabled:o}),(0,t.jsx)(j.Label,{htmlFor:"duplicate-override-confirmed",className:"leading-relaxed",children:"I confirmed this should be a separate company."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(j.Label,{htmlFor:"duplicate-override-reason",children:["Reason for creating separately ",(0,t.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,t.jsx)(w.Textarea,{id:"duplicate-override-reason",value:c.reason,onChange:e=>c.onReasonChange(e.target.value),placeholder:"Explain why this is a separate company.",maxLength:500,rows:3,disabled:o})]})]}):null,(0,t.jsxs)(v.DialogFooter,{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:justify-end",children:[(0,t.jsx)(y.Button,{type:"button",variant:"outline",onClick:l,disabled:o,children:d}),!m||h?(0,t.jsx)(y.Button,{type:"button",variant:"destructive",onClick:i,disabled:o||h&&(!c?.confirmed||!c.reason.trim()),children:o?"Creating...":h?"Create separate account":"Create separate account anyway"}):null]})]})})}],495002)},39456,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.s(["FilterChip",0,function({label:e,summary:n,isActive:a=!1,badgeContent:s,align:i="left",onClear:l,onOpenChange:o,children:d,className:c,popoverClassName:u}){let[p,m]=(0,r.useState)(!1),f=(0,r.useRef)(null),h=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{h.current=o},[o]),(0,r.useEffect)(()=>{h.current?.(p)},[p]),(0,r.useEffect)(()=>{let e=e=>{p&&f.current&&!f.current.contains(e.target)&&m(!1)},t=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[p]);let x="number"==typeof s&&s>0;
2return(0,t.jsxs)("div",{ref:f,className:["relative",c].filter(Boolean).join(" "),children:[(0,t.jsxs)("button",{type:"button",className:["inline-flex min-h-[40px] items-center gap-2 rounded-full border px-3 py-2 text-sm font-semibold transition",a?"border-primary bg-primary/10 text-foreground shadow-[0_4px_10px_rgba(1,131,129,0.12)]":"border-border bg-card text-foreground hover:border-border"].join(" "),"aria-haspopup":"dialog","aria-expanded":p,onClick:()=>m(e=>!e),children:[(0,t.jsx)("span",{className:"whitespace-nowrap",children:e}),x?(0,t.jsx)("span",{className:"ml-1 inline-flex items-center justify-center rounded-full bg-primary px-2 py-0.5 text-xs font-bold text-white",children:s}):null,n?(0,t.jsx)("span",{className:"max-w-[160px] truncate text-xs font-semibold text-primary",children:n}):null,a&&l?(0,t.jsx)("span",{role:"button","aria-label":`Clear ${e} filter`,tabIndex:0,className:"ml-1 inline-flex h-5 w-5 items-center justify-center rounded-full text-base leading-none text-muted-foreground transition hover:bg-white/70",onClick:e=>{e.stopPropagation(),l()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),l())},children:"Ã"}):null]}),p?(0,t.jsx)("div",{className:["absolute z-30 mt-2 w-[320px] max-w-[calc(100vw-2rem)] rounded-2xl border border-border bg-card p-3 shadow-[0_12px_30px_rgba(13,20,28,0.12)]","right"===i?"right-0":"left-0",u].filter(Boolean).join(" "),role:"dialog",children:d({close:()=>m(!1)})}):null]})}])},610198,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(726909),a=e.i(162441),s=e.i(225437),i=e.i(692250),l=e.i(171869);e.s(["ImpersonationBanner",0,function(){let{clearImpersonation:e}=(0,a.useImpersonation)(),o=(0,r.useSyncExternalStore)(()=>()=>{},()=>!0,()=>!1),d=(0,s.useEffectiveUser)({enabled:o}),c=(0,i.useIsImpersonating)({enabled:o}),u=o&&c,p=(0,r.useRef)(null),m=d.profile?.name||d.profile?.email||"user";return((0,r.useLayoutEffect)(()=>{let e=document.documentElement;if(!u)return void e.style.removeProperty("--impersonation-banner-offset");let t=()=>{let t=p.current?.offsetHeight??0;e.style.setProperty("--impersonation-banner-offset",`${t}px`)};t();let r="u">typeof ResizeObserver?new ResizeObserver(t):null;return r&&p.current&&r.observe(p.current),window.addEventListener("resize",t),()=>{r?.disconnect(),window.removeEventListener("resize",t),e.style.removeProperty("--impersonation-banner-offset")}},[u]),u)?(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{ref:p,className:"fixed top-0 left-0 right-0 z-[9999] flex items-center justify-center gap-2 bg-destructive px-4 py-1.5 text-xs font-medium text-destructive-foreground md:hidden",children:[d.isLoading?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Skeleton,{className:"h-3 w-24 bg-white/30"}),(0,t.jsx)(l.Skeleton,{className:"h-3 w-16 bg-white/30"})]}):(0,t.jsxs)("span",{children:["Logged in as ",m]}),(0,t.jsxs)("button",{type:"button",onClick:e,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] font-semibold transition-colors hover:bg-white/20","aria-label":"Switch customer",children:[(0,t.jsx)(n.ArrowLeftRight,{className:"h-3 w-3","aria-hidden":!0}),"Switch"]})]})}):null}])},419739,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(522016),a=e.i(127890),s=e.i(210572);e.s(["InsurancePolicyCard",0,function({title:e,status:i,detailItems:l,documentUrl:o,processingNotice:d,upcomingNotice:c,onUpload:u,isUploading:p=!1,uploadError:m,className:f}){let h=(0,r.useId)(),x=(0,r.useRef)(null),[g,y]=(0,r.useState)(null);return(0,t.jsxs)("div",{className:["rounded-2xl border border-border bg-card p-4 shadow-sm",f].filter(Boolean).join(" "),children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground",children:e}),(0,t.jsxs)("p",{className:`mt-1 text-sm font-semibold ${i.tone}`,children:["Status: ",i.status]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i.detail})]}),o?(0,t.jsx)(n.default,{className:"text-xs font-semibold text-primary underline-offset-2 hover:underline",href:o,target:"_blank",rel:"noreferrer",children:"View document"}):null]}),d?(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:d}):null,c?(0,t.jsx)("div",{className:"mt-2 rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-[hsl(var(--secondary))]",children:c}):null,(0,t.jsx)("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:l.map(e=>(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e.label}),(0,t.jsx)("div",{className:"text-sm font-semibold text-foreground",children:e.value})]},e.label))}),u?(0,t.jsxs)("div",{className:"mt-4 grid gap-3",children:[(0,t.jsx)(s.DsInput,{id:`${h}-file`,ref:x,type:"file",accept:"application/pdf,image/*",label:"Upload policy file",onChange:e=>{y(e.target.files?.[0]??null)},disabled:p}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(a.DsButton,{size:"small",label:p?"Uploadingâ¦":"Upload",onTap:()=>{g&&(u?.(g),y(null),x.current&&(x.current.value=""))},disabled:p||!g}),m?(0,t.jsx)("span",{className:"text-xs text-destructive",children:m}):null]})]}):null]})}])},267486,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(986823);var n=e.i(113827);e.s(["MapSplitShell",0,function({map:e,controls:a,panelSummary:s,panelContent:i,panelToolbar:l,closedSummary:o,panelFooter:d,defaultPanelState:c="open",mapHeights:u,sectionClassName:p,mapClassName:m,panelClassName:f,openPanelClassName:h,expandedPanelClassName:x,closedPanelClassName:g}){let y=(0,r.useRef)(null),b=(0,r.useRef)(null),[v,j]=(0,r.useState)(c),[w,N]=(0,r.useState)(!1),[C,S]=(0,r.useState)(0),[k,_]=(0,r.useState)({top:64,left:0,right:0}),[P,E]=(0,r.useState)(!1),[T,M]=(0,r.useState)(null),I=(0,r.useRef)(null),D=(0,r.useRef)(!1),R=(0,r.useMemo)(()=>({open:P?u?.desktopOpen??u?.open??48:u?.open??44,expanded:P?u?.desktopExpanded??u?.expanded??36:u?.expanded??36,closed:P?u?.desktopClosed??u?.closed??82:u?.closed??78}),[P,u]);(0,r.useEffect)(()=>{let e=window.matchMedia("(min-width: 1024px)"),t=()=>E(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,r.useEffect)(()=>{let e=document.querySelector("main");if(!e)return;let t=()=>{S(Math.max(e.offsetWidth-e.clientWidth,0))};t();let r=new ResizeObserver(t);return r.observe(e),window.addEventListener("resize",t),()=>{r.disconnect(),window.removeEventListener("resize",t)}},[]),(0,r.useEffect)(()=>
2{if(!P){let e=window.setTimeout(()=>{_({top:0,left:0,right:0})},0);return()=>window.clearTimeout(e)}let e=null,t=null,r=null,n=[],a=()=>{let e=document.getElementById("navbar");if(!e)return;let t=e.getBoundingClientRect();_({top:Math.max(t.bottom,0),left:Math.max(t.left,0),right:Math.max(window.innerWidth-t.right,0)})},s=0,i=()=>{let r=document.getElementById("navbar");if(!r){s<30&&(s+=1,t=window.requestAnimationFrame(i));return}a(),(e=new ResizeObserver(a)).observe(r)};i(),window.addEventListener("resize",a),window.addEventListener("scroll",a,!0);let l=e=>{("transform"===e.propertyName||"height"===e.propertyName||"opacity"===e.propertyName)&&a()};return window.addEventListener("transitionend",l,!0),r=window.requestAnimationFrame(()=>{window.requestAnimationFrame(a)}),n.push(window.setTimeout(a,120)),n.push(window.setTimeout(a,320)),n.push(window.setTimeout(a,520)),()=>{null!==t&&window.cancelAnimationFrame(t),null!==r&&window.cancelAnimationFrame(r),n.forEach(e=>window.clearTimeout(e)),e?.disconnect(),window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0),window.removeEventListener("transitionend",l,!0)}},[P]),(0,r.useEffect)(()=>{let e=document.querySelector("main");if(!e)return;let t=()=>{if(!y.current||!b.current)return;let e=y.current.getBoundingClientRect(),t=b.current.getBoundingClientRect().top<=e.bottom+1;N(e=>e===t?e:t)};t();let r=0,n=()=>{r||(r=window.requestAnimationFrame(()=>{r=0,t()}))};return e.addEventListener("scroll",n,{passive:!0}),()=>{r&&window.cancelAnimationFrame(r),e.removeEventListener("scroll",n)}},[]),(0,r.useEffect)(()=>{let e=document.querySelector("main");if(!e)return;let t=e instanceof HTMLElement?e.style.overflowY:"",r=e instanceof HTMLElement?e.style.overscrollBehavior:"";return"closed"===v&&e instanceof HTMLElement&&(e.style.overflowY="hidden",e.style.overscrollBehavior="none"),()=>{e instanceof HTMLElement&&(e.style.overflowY=t,e.style.overscrollBehavior=r)}},[v]);let $=e=>"closed"===e?R.closed:"expanded"===e?R.expanded:R.open,A=e=>{let t=["expanded","open","closed"],r=t.indexOf(v),n="up"===e?Math.max(0,r-1):Math.min(t.length-1,r+1);j(t[n]),M(null),I.current=null},L=()=>{j("closed"===v?"expanded":"closed"),M(null),I.current=null},O="closed"===v?g:"expanded"===v?x:h;return(0,t.jsxs)("section",{className:(0,n.cn)("relative min-h-screen bg-background",p),children:[(0,t.jsx)("div",{className:(0,n.cn)("sticky top-0 z-0 transition-[height] duration-300",m,null!==T&&"duration-0"),style:{height:`${T??$(v)}vh`},children:e}),(0,t.jsxs)("div",{className:"relative z-10 min-h-screen pointer-events-none",children:[(0,t.jsx)("div",{ref:y,className:(0,n.cn)("fixed z-20 px-4 pt-3 pb-3 pointer-events-auto",w?"bg-background/95 backdrop-blur border-b border-border shadow-[0_6px_18px_rgba(15,23,42,0.06)]":"bg-transparent"),style:{top:P?`${k.top}px`:"var(--impersonation-banner-offset, 0px)",left:P?`${k.left}px`:0,right:P?`${k.right+C}px`:`${C}px`},children:a}),(0,t.jsxs)("div",{ref:b,className:(0,n.cn)("relative z-10 -mt-4 rounded-t-3xl bg-background shadow-[0_-4px_20px_rgba(0,0,0,0.08)] pointer-events-auto transition-all duration-300 overflow-x-hidden",null!==T&&"duration-0","closed"===v?"min-h-0":"min-h-[32vh] md:min-h-screen",f,O),children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-center rounded-t-3xl px-4 pt-3 pb-2",onPointerDown:e=>{if("mouse"===e.pointerType&&0!==e.button)return;let t=e.clientY,r=T??$(v);I.current=r,D.current=!1;let n=document.body.style.userSelect;document.body.style.userSelect="none";let a=e=>{let n,a=e.clientY-t;Math.abs(a)>4&&(D.current=!0);let s=(n=r+a/Math.max(window.innerHeight,1)*100,Math.min(R.closed,Math.max(R.expanded,n)));I.current=s,M(s)},s=()=>{var e;let t;document.body.style.userSelect=n,window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),e=I.current??r,j((t=[{state:"expanded",height:R.expanded},{state:"open",height:R.open},{state:"closed",height:R.closed}]).reduce((t,r)=>t?Math.abs(r.height-e)<Math.abs(t.height-e)?r:t:r,t[0]).state),M(null),I.current=null};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s)},onClick:()=>
2{if(D.current){D.current=!1;return}L()},style:{touchAction:"none"},role:"separator","aria-orientation":"horizontal","aria-label":"Resize results panel",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),L()),"ArrowUp"===e.key&&(e.preventDefault(),A("up")),"ArrowDown"===e.key&&(e.preventDefault(),A("down"))},children:[(0,t.jsx)("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/30"}),"closed"===v&&o?(0,t.jsx)("span",{className:"sr-only",children:o}):null]}),"closed"===v?(0,t.jsx)("div",{className:"pb-2"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-2",children:[(0,t.jsx)("div",{className:"min-w-0 flex-1",children:s}),l?(0,t.jsx)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:l}):null]}),i,d]})]})]})]})}])},649999,344691,868598,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(716327),a=e.i(632781),s=e.i(96315),i=e.i(515281),l=e.i(575387),o=e.i(272212),d=e.i(756202);e.i(924856);let c=({user:e,phone:t})=>{var r;return{id:e.id,user_group_id:(r=e.user_group)?"string"==typeof r?r:"object"==typeof r&&"id"in r?r.id??null:null:null,user_id:e.user_id??null,phone:t,phone_revealed:e.phone_revealed,phone_revealed_on:e.phone_revealed_on??null,email:e.email,push_id:e.push_id??null,date_joined:e.date_joined,first_name:e.first_name??null,last_name:e.last_name??null,username:e.username??null,photo_url:e.photo_url??null,is_onboarded:e.is_onboarded,is_admin:e.is_admin,is_archived:e.is_archived,is_active:e.is_active,source:e.source,terms_accepted:e.terms_accepted??null,last_active:e.last_active??null,timezone:e.timezone??null,role_id:(e=>{if(e){if("string"==typeof e)return e;if("object"==typeof e&&"id"in e)return e.id}})(e.role),send_new_invoice_emails:e.send_new_invoice_emails}};function u(e){return[e.first_name,e.last_name].filter(Boolean).join(" ").trim()||e.email||"Unknown contact"}e.s(["buildUserWriteRequest",0,c],344691),e.s(["formatOnSiteContactName",0,u],868598);var p=e.i(268531),m=e.i(499971),f=e.i(78135),h=e.i(594249),x=e.i(478736);e.i(556651);var g=e.i(367679);let y=(e,t)=>((e?.trim()?.[0]??"")+(t?.trim()?.[0]??"")).toUpperCase()||"?";e.s(["OnSiteContactDrawer",0,function({open:e,onOpenChange:n,value:b,contacts:v,onChange:j,currentUserId:w,isLoading:N=!1,onContactPhoneUpdated:C,enablePhoneEdit:S=!0}){let{permissions:k}=(0,g.useSupplierPermissions)(),{toast:_}=(0,d.useToast)(),[P,E]=(0,r.useState)(null),[T,M]=(0,r.useState)(""),[I,D]=(0,r.useState)(null),R=(0,o.useApiV1UsersUpdate)(),$=S&&k.canManageUsers,A=v.filter(e=>!!e.id),L=(0,r.useMemo)(()=>A.find(e=>e.id===P)??null,[A,P]),O=()=>{E(null),M(""),D(null)},B=async()=>{if(!L?.id)return;let e=T.trim(),t=e.length>0?e:null;if(t===(L.phone?.trim()||null))return void O();try{await R.mutateAsync({userId:L.id,data:c({user:L,phone:t})}),await C?.(L.id),_({title:"Phone number updated",description:"Contact phone number was updated successfully."}),O()}catch(e){console.error("Unable to update contact phone",e),D("Unable to update phone number. Please try again."),_({title:"Could not update phone number",description:"Please try again.",variant:"destructive"})}};return(0,t.jsx)(p.ResponsiveModal,{open:e,onOpenChange:n,title:"Select On-Site Contact",description:"Choose a contact who will be present on-site.",dialogContentProps:{className:"max-w-lg max-h-[90vh] flex flex-col p-0 overflow-hidden"},dialogHeaderProps:{className:"px-4 pt-4 text-left"},drawerContentProps:{className:"max-h-[90vh] flex flex-col p-0 overflow-hidden"},drawerHeaderProps:{className:"px-4 pt-4 text-left"},children:(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-x-hidden overflow-y-auto px-4 py-4 max-h-[60vh]",children:N?(0,t.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading contacts..."}):0===A.length?(0,t.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"No contacts available for this account."}):(0,t.jsx)(h.RadioGroup,{value:b??"",onValueChange:e=>{j(e||null),n(!1)},className:"min-w-0 space-y-2",children:A.map(e=>{let r=e.id??"",n=w&&e.id===w,o=b===r,d=!e.phone?.trim(),c=P===r;return(0,t.jsxs)("div",{className:["min-w-0 overflow-hidden rounded-lg border p-3 transition-colors",o?"border-primary bg-primary/5":"border-border bg-card",d?"cursor-not-allowed opacity-60":"cursor-pointer"].join(" "),children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[(0,t.jsx)(h.RadioGroupItem,{value:r,id:r,disabled:d,className:"mt-1 shrink-0"}),(0,t.jsxs)("label",{htmlFor:r,className:"flex w-0 min-w-0 flex-1 cursor-pointer items-start gap-2 overflow-hidden",children:[(0,t.jsxs)(x.Avatar,{className:"h-10 w-10 shrink-0",children:[(0,t.jsx)(x.AvatarImage,{src:void 0}),(0,t.jsx)(x.AvatarFallback,{className:"bg-primary/10 text-primary",children:y(e.first_name,e.last_name)})]}),(0,t.jsxs)("div",{className:"w-0 min-w-0 flex-1 overflow-hidden",children:[(0,t.jsxs)("p",{className:"truncate text-sm font-medium text-foreground",children:[u(e)," ",n?"(You)":""]}),e.email?(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1 text-sm text-muted-foreground",children:[(0,t.jsx)(s.Mail,{className:"h-3 w-3 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.email})]}):null,c?null:e.phone?(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1 text-sm text-muted-foreground",children:[(0,t.jsx)(l.Phone,{className:"h-3 w-3 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.phone})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Phone required to select"})]})]}),$?(0,t.jsxs)(m.Button,{type:"button",variant:"ghost",className:"h-8 w-8 shrink-0 px-0","aria-label":`Edit phone for ${u(e)}`,title:"Edit phone",onClick:e=>{let t;e.preventDefault(),e.stopPropagation(),(t=A.find(e=>e.id===r))&&(E(r),M(t.phone??""),D(null))},children:[(0,t.jsx)(i.Pencil,{className:"h-3.5 w-3.5","aria-hidden":!0}),(0,t.jsx)("span",{className:"sr-only",children:"Edit phone"})]}):null]}),$&&c?(0,t.jsxs)("form",{className:"mt-3 min-w-0 space-y-2 pl-7 sm:pl-8",onSubmit:e=>{e.preventDefault(),B()},children:[(0,t.jsx)(f.Input,{value:T,onChange:e=>{M(e.target.value),I&&D(null)},placeholder:"Enter phone number",className:"h-9",disabled:R.isPending}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.Button,{type:"submit",size:"sm",className:"h-8",disabled:R.isPending,children:R.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin","aria-hidden":!0}),"Saving..."]}):"Save"}),(0,t.jsx)(m.Button,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:R.isPending,onClick:e=>{e.preventDefault(),O()},children:"Cancel"})]}),I?(0,t.jsx)("p",{className:"text-xs text-destructive",children:I}):null]}):null]},r)})})})})},"OnSiteContactTrigger",0,function({selectedContact:e,currentUserId:r,onClick:a,disabled:s=!1,isLoading:i=!1}){let l=r&&e?.id===r;return(0,t.jsxs)("button",{type:"button",onClick:a,disabled:s||i,className:"flex min-w-0 max-w-full w-full items-center gap-3 overflow-hidden rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",children:[(0,t.jsxs)(x.Avatar,{className:"h-10 w-10 shrink-0",children:[(0,t.jsx)(x.AvatarImage,{src:void 0}),(0,t.jsx)(x.AvatarFallback,{className:"bg-primary/10 text-primary",children:e?y(e.first_name,e.last_name):"?"})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:i?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading contacts..."}):e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"truncate font-medium text-foreground",children:[u(e)," ",l?"(You)":""]}),(0,t.jsx)("p",{className:"truncate text-sm text-muted-foreground",children:e.phone||e.email||"No contact info"})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select on-site contact"})}),(0,t.jsx)(n.ChevronDown,{className:"h-5 w-5 shrink-0 text-muted-foreground","aria-hidden":!0})]})}],649999)},184158,e=>{"use strict";var t=e.i(843476),r=e.i(522016),n=e.i(618566),a=e.i(24071);e.s(["PageHeader",0,function({title:e,backHref:s,backBehavior:i="href",rightSlot:l}){let o=(0,n.useRouter)();return(0,t.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between border-b border-border bg-background px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[s?"href"===i?(0,t.jsx)(r.default,{href:s,className:"p-2 -ml-2 roun
2ded-full hover:bg-muted active:bg-muted/80 transition-colors","aria-label":"Back",children:(0,t.jsx)(a.ChevronLeft,{className:"h-6 w-6 text-foreground"})}):(0,t.jsx)("button",{type:"button",onClick:()=>{if("history-or-href"!==i){s&&o.push(s);return}{let e=document.referrer;if(e&&e.startsWith(window.location.origin)&&window.history.length>1)return void o.back()}s&&o.push(s)},className:"p-2 -ml-2 rounded-full hover:bg-muted active:bg-muted/80 transition-colors","aria-label":"Back",children:(0,t.jsx)(a.ChevronLeft,{className:"h-6 w-6 text-foreground"})}):null,(0,t.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:e})]}),l?(0,t.jsx)("div",{className:"flex items-center gap-2",children:l}):null]})}])},209126,475907,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(618566),a=e.i(667668),s=e.i(912598),i=e.i(272212),l=e.i(582629);async function o(e){return(0,i.apiV1PaymentMethodsDetachOneTimeCreate)({stripe_payment_method_id:e})}async function d(e){if(e)try{await o(e)}catch{}}e.s(["cleanupOneTimePaymentMethod",0,d],475907);var c=e.i(847565),u=e.i(627225),p=e.i(650782);e.i(398106);var m=e.i(429634),f=e.i(641881),h=e.i(893019),x=e.i(756202),g=e.i(371561);e.i(298820);var y=e.i(801579);e.i(504540);var b=e.i(670190),v=e.i(499971),j=e.i(308574),w=e.i(870387),N=e.i(226091),C=e.i(632781),S=e.i(77071),k=e.i(328623),_=e.i(786563),P=e.i(573474),E=e.i(882303),T=e.i(268531);e.i(467541);var M=e.i(779614);let I=(e,t)=>(0,y.getApiErrorMessage)(e,t),D=(e,t)=>{let r=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(!r)return t;let n=document.createElement("span");n.style.color=`hsl(${r})`,n.style.position="absolute",n.style.pointerEvents="none",n.style.opacity="0",document.body.appendChild(n);let a=window.getComputedStyle(n).color;return n.remove(),a||t},R=()=>({base:{fontSize:"16px",color:D("--foreground","#f3f6f8"),"::placeholder":{color:D("--muted-foreground","#9ca3af")},iconColor:D("--primary","#22c1c3")},invalid:{color:D("--destructive","#f87171"),iconColor:D("--destructive","#f87171")}}),$=e=>{let t=e.data;return t&&"object"==typeof t?{last4:"string"==typeof t.last4?t.last4:null,bankName:"string"==typeof t.bank_name?t.bank_name:null}:{last4:null,bankName:null}},A=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t?t.slice(-4):null},L=e=>{let{last4:t,bankName:r}=$(e);if("us_bank_account"===e.type){let e=r?`${r} \u00b7 `:"",n=t?`XXXX-${t}`:"XXXX";return`${e}${n}`}let n=e.card?.brand?e.card.brand.toUpperCase():"CARD",a=A(e.card?.number)??t;if("card"===e.type){let e=a?`XXXX-${a}`:"XXXX";return`${n} ${e}`}return e.type??"Payment method"},O=e=>{let t="us_bank_account"===e.type?"bank":"card"===e.type?"card":null;if(!t)return null;let{last4:r,bankName:n}=$(e),a=A(e.card?.number)??r??"0000";return{id:e.id,type:t,last4:a,brand:e.card?.brand??void 0,bankName:"bank"===t?n??"Bank Account":void 0}},B=e=>"bank"===e.type?`${e.bankName??"Bank Account"} \u2022\u2022\u2022\u2022 ${e.last4}`:"card"===e.type?`${(e.brand??"card").toUpperCase()} \u2022\u2022\u2022\u2022 ${e.last4}`:"Pay on Net Terms",z=e=>[...e.filter(e=>e.isDefault),...e.filter(e=>!e.isDefault)],U=({clientSecret:e,allowOneTimeUse:n,onSaved:s,onUseOnce:i,onError:l})=>{let o=(0,a.useStripe)(),d=(0,a.useElements)(),[c,u]=(0,r.useState)(!1),[p,m]=(0,r.useState)(R),[f,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{m(R());let e=new MutationObserver(()=>{m(R())});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]}),()=>e.disconnect()},[]);let x=async t=>{if(t.preventDefault(),!o||!d)return;let r=d.getElement(a.CardElement);if(r){u(!0);try{let t=await o.confirmCardSetup(e,{payment_method:{card:r,metadata:{downstream_save_on_file:f?"false":"true"}},return_url:window.location.href});if(t.error)throw Error(t.error.message||"Unable to add card");let n=t.setupIntent;if(n?.payment_method&&"string"==typeof n.payment_method)f?await i(n.payment_method):s(n.payment_method);else throw Error("Unable to save card")}catch(e){l(e.message||"Unable to add card")}finally{u(!1)}}};return(0,t.jsxs)("form",{onSubmit:x,className:"space-y-7",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-4 shadow-[inset_0_0_0_1px_hsl(var(--border)/0.35)]",children:(0,t.jsx)(a.CardElement,{options:{style:p}},p.base.color)}),n?(0,t.jsxs)("label",{className:"flex items-start gap-4 px-1 text-sm",children:[(0,t.jsx)(j.Checkbox,{checked:f,onCheckedChange:e=>h(!0===e),className:"mt-0.5 h-5 w-5 rounded-[5px] border-2 border-muted-foreground
2/70 data-[state=checked]:border-primary"}),(0,t.jsxs)("span",{className:"space-y-2",children:[(0,t.jsx)("span",{className:"block text-base font-semibold leading-tight text-foreground",children:"Do not save this payment method"}),(0,t.jsx)("span",{className:"block text-sm font-medium leading-relaxed text-muted-foreground",children:"Use this card for this payment only. It will not be stored for future payments."})]})]}):null,(0,t.jsx)(v.Button,{type:"submit",className:"h-11 w-full rounded-lg text-sm font-semibold",disabled:c,children:c?"Processing...":f?"Use card once":"Save payment method"})]})};function F({open:e,onOpenChange:o,selectedMethod:y,onSelectMethod:j,defaultPaymentMethodId:D=null,userGroupId:R,methods:$,allowAdd:A,allowRemove:W,closeOnSelect:H=!0,footer:V,hasCompany:q,companyName:G,creditLimit:K,creditUtilized:X,showRentNowPayLaterSection:Y=!0,hideThirdPartyWallets:Q=!1,allowOneTimeUse:J=!1,allowInactiveMethods:Z=!1,onAddCardOverride:ee}){let et=(0,n.useRouter)(),er=(0,n.usePathname)(),en=(0,n.useSearchParams)(),ea=(0,s.useQueryClient)(),{toast:es}=(0,x.useToast)(),{effectiveUserGroupId:ei}=(0,c.useEffectiveUserGroupId)(),el=(0,p.useEffectiveMe)(),eo=el.data?(0,M.toUserEntity)(el.data):null,ed=eo?.id,ec=(0,u.resolveEffectiveUserGroupId)(R,ei??eo?.userGroupId??null),eu=void 0!==$,ep=!!j,em=A??(!eu&&!ep),ef=W??(!eu&&!ep),eh=!eu&&!ep,ex=!eu&&!!ec,eg=(0,r.useRef)(null),ey=(0,r.useRef)(!1),eb=(0,r.useRef)(!1),ev=(0,r.useRef)(e),[ej,ew]=(0,r.useState)(null);(0,r.useEffect)(()=>{eg.current=y?.oneTimeStripePaymentMethodId??null},[y?.oneTimeStripePaymentMethodId]),(0,r.useEffect)(()=>()=>{d(eg.current)},[]);let eN=(0,r.useCallback)(e=>{let t=y?.oneTimeStripePaymentMethodId??eg.current;t&&e?.id!==t&&e?.oneTimeStripePaymentMethodId!==t&&d(t)},[y?.oneTimeStripePaymentMethodId]);(0,r.useEffect)(()=>{ev.current&&!e&&(ey.current?(ey.current=!1,eb.current=!1):eb.current?eb.current=!1:eN(null)),ev.current=e},[eN,e]);let[eC,eS]=(0,r.useState)(!1),[ek,e_]=(0,r.useState)(!1),[eP,eE]=(0,r.useState)(null),eT=(0,r.useRef)(null),eM=en.get("setup_intent_client_secret"),eI=(0,m.useSetupIntent)({user_group:ec??void 0},{enabled:ex&&(eC||!!eM)}),eD=(0,i.useApiV1UserGroupsRetrieve)(ec??"",{"expand[]":["credit_limit_utilized"]},{query:{enabled:ex}}),eR=(0,h.usePaymentMethods)({limit:100,user_group:ec??void 0},{enabled:ex}),e$=(0,r.useMemo)(()=>(eR.data?.data??[]).filter(e=>(0,b.isPaymentMethodSelectable)(e,{allowInactive:Z})),[Z,eR.data?.data]),eA=(0,r.useMemo)(()=>e$.filter(e=>"card"===e.type),[e$]),eL=(0,r.useMemo)(()=>e$.filter(e=>"us_bank_account"===e.type),[e$]),eO=D??eD.data?.default_payment_method??null,eB=(0,r.useMemo)(()=>eu?z(($??[]).filter(e=>"card"===e.type&&!!e.id&&(0,b.isPaymentMethodSelectable)(e,{allowInactive:Z})).map(e=>({id:e.id,label:B(e),subtitle:"Credit/Debit Card",value:e,isDefault:eO===e.id}))):z(eA.filter(e=>!(Q&&(e=>{let t=e.data;if(!t||"object"!=typeof t)return null;let r=t.wallet;if(!r||"object"!=typeof r)return null;let n=r.type;return"apple_pay"===n||"google_pay"===n?n:null})(e))).map(e=>{let t=O(e);return t&&t.id?{id:t.id,label:L(e),subtitle:"Credit/Debit Card",value:t,isDefault:eO===t.id,apiMethod:e}:null}).filter(e=>null!==e)),[Z,eO,Q,eu,eA,$]),ez=(0,r.useMemo)(()=>eu?z(($??[]).filter(e=>"bank"===e.type&&!!e.id&&(0,b.isPaymentMethodSelectable)(e,{allowInactive:Z})).map(e=>({id:e.id,label:B(e),subtitle:"Bank Account",value:e,isDefault:eO===e.id}))):z(eL.map(e=>{let t=O(e);return t&&t.id?{id:t.id,label:L(e),subtitle:"Bank Account",value:t,isDefault:eO===t.id,apiMethod:e}:null}).filter(e=>null!==e)),[Z,eO,eu,eL,$]),eU=(0,r.useMemo)(()=>{let e=y?.oneTimeStripePaymentMethodId,t=y?.id;if(!e||y?.type!=="card")return eB;let r=e=>!!(e.value.id&&ej&&!ej.has(e.value.id)),n=eB.find(r=>r.value.id===t||r.value.id===e)??eB.find(e=>r(e)&&(!ed||e.apiMethod?.user===ed))??eB.find(r)??null;if(n)return eB.map(t=>t.id!==n.id?t:{...t,value:{...t.value,oneTimeStripePaymentMethodId:e}});let a={...y,id:y.id??e,oneTimeStripePaymentMethodId:e};return[{id:`one-time-${e}`,label:"One-time card",subtitle:"Use once for this payment",value:a,isDefault:!1},...eB]},[eB,ed,ej,y]),eF=(0,i.useApiV1UserGroupsDefaultPaymentMethodUpdate)({mutation:{onSuccess:()=>{ec&&ea.invalidateQueries({queryKey:(0,i.getApiV1UserGroupsRetrieveQueryKey)(ec)})}}}),eW=(0,i.useApiV1PaymentMethodsCreate)({mutation:{onSuccess:()=>{ea.invalidateQueries({queryKey:(0,i.getApiV1PaymentMethodsListQueryKey)()})}}}),eH=(0,i.useApiV1PaymentMethodsDestroy)({mutation:{onSuccess:()=>{ea.invalidateQueries({queryKey:(0,i.getApiV1PaymentMethodsListQueryKey)()})}}}),eV=!!(eI.data?.client_secret&&eI.data?.publishable_key),eq=eC&&eI.data?.publishable_key?(0,g.getStripe)(eI.data.publishable_key):null,eG=(0,r.useCallback)(async(e,t)=>{if(!eo?.id)throw Error("Unable to resolve current user");eE(null),eW.reset(),await eW.mutateAsync({data:{user:eo.id,user_group:ec??null,stripe_id:e}}).finally(()=>(0,m.clearSetupIntentQueries)(ea)),eN(null),await ea.invalidateQueries({queryKey:(0,i.getApiV1PaymentMethodsListQueryKey)()}),await eR.refetch(),t?.replaceUrl&&et.replace(er),t?.closeDrawer&&eS(!1),t?.showSuccessToast&&es({title:"Card added",description:"Your card has been added successfully."})},[eN,eo,er,eW,eR,ea,et,es,ec]);(0,r.useEffect)(()=>{let e=eI.data;ex&&eM&&e?.publishable_key&&eT.current!==eM&&(eT.current=eM,(async()=>{let t=await (0,g.getStripe)(e.publishable_key);if(!t||!eo?.id)return;let{setupIntent:r,error:n}=await t.retrieveSetupIntent(eM);if(!n&&r&&("succeeded"===r.status||"processing"===r.status)&&r.payment_method&&"string"==typeof r.payment_method)try{await eG(r.payment_method,{closeDrawer:!0,replaceUrl:!0,showSuccessToast:!0})}catch(e){es({title:"Unable to save payment method",description:I(e,"Please try again."),variant:"destructive"})}})())},[eo?.id,er,eG,et,eI.data,eM,ex,es]);let eK=async e=>{try{await eG(e,{closeDrawer:!0,showSuccessToast:!0})}catch{}},eX=async e=>{let t=new Set(eA.map(e=>e.id));ew(t);let r=await eR.refetch(),n=r.data?.data??[],a=n.find(t=>
2t.id===e)??n.find(e=>"card"===e.type&&!t.has(e.id)),s=a?O(a):null,i={id:s?.id??e,type:"card",last4:s?.last4??"0000",brand:s?.brand??"Card",oneTimeStripePaymentMethodId:e};eN(i),j?.(i),eS(!1),(0,m.clearSetupIntentQueries)(ea),H&&(eb.current=!0,e8(!1)),es({title:"Card ready",description:"This card will be used for this payment only."})},eY=async()=>{e_(!0);try{if(!eo?.id)throw Error("Unable to resolve current user");let e=[eo.first_name,eo.last_name].filter(Boolean).join(" ").trim()||eo.email||"Account holder",t=await (0,f.connectBankAccount)({userGroupId:ec??void 0,billingName:e,billingEmail:eo.email??void 0});if(!t)return;await ea.invalidateQueries({queryKey:(0,i.getApiV1PaymentMethodsListQueryKey)()});let r=await eR.refetch();if("verified"===t.status){let e=r.data?.data.find(e=>e.id===t.payment_method),n=e?O(e):null;n&&j&&e7(n)}es("verified"===t.status?{title:"Bank connected",description:"Your bank account has been added successfully."}:{title:"Bank verification pending",description:"Finish verification in company billing before this account can be used."})}catch(e){await ea.invalidateQueries({queryKey:(0,i.getApiV1PaymentMethodsListQueryKey)()}),await eR.refetch(),es({title:"Connection failed",description:I(e,"Please try again."),variant:"destructive"})}finally{e_(!1)}},eQ=async(e,t)=>{if(ef){if(e$.length<=1)return void es({title:"Cannot remove",description:"You must have at least one payment method.",variant:"destructive"});try{await eH.mutateAsync({id:e});let r=e$.filter(t=>t.id!==e);t&&r.length&&ec&&eF.mutate({userGroupId:ec,data:{payment_method:r[0].id}}),es({title:"Payment method removed"})}catch(e){es({title:"Unable to remove payment method",description:I(e,"Please try again."),variant:"destructive"})}}},eJ=q??!!ec,eZ=G??eD.data?.name??"Downstream Systems, Inc",e0=K??eD.data?.credit_line_limit??0,e1=X??eD.data?.credit_limit_utilized??0,e2=!!(e0&&e0>0),e5=e2?e0-(e1??0):0,e4=e2&&(e1??0)>(e0??0),e3=e2?Math.min((e1??0)/(e0||1)*100,100):0,e6=y?.type==="net_terms",e8=e=>{e||(eb.current||eN(null),ey.current=!0),o(e)},e7=e=>{j&&(eN(e),j(e),H&&(eb.current=!!e.oneTimeStripePaymentMethodId,e8(!1)))},e9=(e,r)=>e.length?e.map(e=>{let r=y?.oneTimeStripePaymentMethodId??null,n=y?.id??null,a=ep?r?e.value.id===n||e.value.id===r||e.value.oneTimeStripePaymentMethodId===r:y?.id===e.value.id&&y?.type===e.value.type:e.isDefault,s=r&&(e.value.id===n||e.value.id===r)?{...e.value,oneTimeStripePaymentMethodId:r}:e.value;return(0,t.jsx)("div",{className:`group w-full p-4 rounded-xl border transition-all ${a?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50"}`,children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:()=>{ep&&e7(s)},className:"flex items-center gap-3 flex-1 text-left",children:[(0,t.jsx)("div",{className:"w-5 h-5 rounded-full border-2 border-primary flex items-center justify-center",children:a?(0,t.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-primary"}):null}),(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center overflow-hidden",children:"bank"===e.value.type?(0,t.jsx)(N.FileText,{className:"w-5 h-5 text-muted-foreground"}):(0,t.jsx)(w.CreditCard,{className:"w-5 h-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"text-left",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"font-semibold",children:e.label}),e.isDefault?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded bg-primary/10 text-primary",children:[(0,t.jsx)(_.Star,{className:"w-3 h-3 fill-primary","aria-hidden":"true"}),"Default"]}):null]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.subt
2itle})]})]}),eh&&e.apiMethod?.id?(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[e.isDefault?null:(0,t.jsxs)("button",{onClick:t=>{var r;t.stopPropagation(),r=e.apiMethod.id,ec&&eF.mutate({userGroupId:ec,data:{payment_method:r}})},className:"inline-flex items-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-muted-foreground opacity-0 transition-opacity hover:text-primary hover:bg-primary/10 focus-visible:opacity-100 group-hover:opacity-100",title:"Mark as default",children:[(0,t.jsx)(_.Star,{className:"w-3.5 h-3.5","aria-hidden":"true"}),"Mark as default"]}),ef?(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eQ(e.apiMethod.id,e.isDefault)},className:"p-2 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded-lg transition-colors",title:"Remove payment method",children:(0,t.jsx)(P.Trash2,{className:"w-4 h-4"})}):null]}):null]})},e.id)}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-3",children:r});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(T.ResponsiveModal,{open:e,onOpenChange:e8,title:"Select Payment Method",dialogContentProps:{className:"sm:max-w-[520px] p-0 max-h-[90vh] flex flex-col"},dialogHeaderProps:{className:"text-center px-4 pt-4 pb-2 shrink-0"},drawerContentProps:{className:"max-h-[90vh] flex flex-col"},drawerHeaderProps:{className:"text-center pb-2"},dialogFooterProps:{className:"border-t border-border bg-background p-4"},drawerFooterProps:{className:"border-t border-border bg-background p-4 pb-[calc(env(safe-area-inset-bottom)+1rem)]"},footer:V,children:(0,t.jsxs)("div",{className:"p-4 space-y-6 pb-8 overflow-y-auto",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:"Cards"}),em?(0,t.jsxs)(v.Button,{variant:"ghost",size:"sm",onClick:()=>{ee?ee():eS(!0)},className:"h-8 px-2 text-primary hover:bg-primary/5 hover:text-primary focus-visible:text-primary",children:[(0,t.jsx)(S.Plus,{className:"w-4 h-4 mr-1"}),"Add New Card"]}):null]}),(0,t.jsx)("div",{className:"space-y-2",children:e9(eU,"No cards added yet")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:"Bank Accounts"}),em?(0,t.jsxs)(v.Button,{variant:"ghost",size:"sm",onClick:eY,disabled:ek,className:"h-8 px-2 text-primary hover:bg-primary/5 hover:text-primary focus-visible:text-primary",children:[ek?(0,t.jsx)(C.Loader2,{className:"w-4 h-4 mr-1 animate-spin"}):(0,t.jsx)(S.Plus,{className:"w-4 h-4 mr-1"}),"Add New Bank Account"]}):null]}),(0,t.jsx)("div",{className:"space-y-2",children:e9(ez,"No bank accounts linked yet")})]}),Y?(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground mb-3",children:"Rent Now, Pay Later"}),ep?(0,t.jsxs)(t.Fragment,{children:[eJ?null:(0,t.jsx)("div",{className:"p-4 rounded-xl border border-dashed border-primary/50 bg-primary/5",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(E.Users,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Join a Company"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect to your company account to unlock net terms and team billing features."}),(0,t.jsx)(v.Button,{size:"sm",variant:"outline",className:"mt-3 border-primary text-primary hover:bg-primary/5",onClick:()=>{sessionStorage.setItem("companyCreateReturnUrl",window.location.pathname),e8(!1),window.location.href="/onboarding/company"},children:"Join Company"})]})]})}),eJ&&!e2?(0,t.jsx)("div",{className:"p-4 rounded-xl border border-dashed border-primary/50 bg-primary/5",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(k.Sparkles,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Rent Now. Pay Later."}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Get up to $50,000 in credit with net terms. Apply now and get approved in minutes."}),(0,t.jsx)(v.Button,{size:"sm",className:"mt-3",onClick:()=>{e8(!1),window.location.href=(0,l.routeCustomerRequestIncrease)()},children:"Apply for Net Terms"})]})]})}):null,eJ&&e2?(0,t.jsx)("button",{onClick:()=>{j&&(eN(null),j({id:null,type:"net_terms",last4:"0000"}),H&&e8(!1))},className:`w-full p-4 rounded-xl border transition-all text-left ${e6?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50"}`,children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-5 h-5 rounded-full border-2 border-primary flex items-center justify-center",children:e6?(0,t.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-primary"}):null}),(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,t.jsx)(N.FileText,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Pay on Net Terms"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:eZ}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Available Credit"}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",e5.toLocaleStr
2ing()," of $",(e0??0).toLocaleString()]})]}),(0,t.jsx)("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e4?"bg-destructive":e3>66?"bg-amber-500":"bg-primary"}`,style:{width:`${e3}%`}})})]})]})]})}):null]}):Y&&eJ?(0,t.jsx)("div",{className:"p-4 rounded-xl border border-dashed border-primary/50 bg-primary/5",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(k.Sparkles,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Rent Now. Pay Later."}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Use net terms with your company credit line."}),e0&&e0>0?(0,t.jsxs)("div",{className:"mt-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Available Credit"}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",e5.toLocaleString()," of $",e0.toLocaleString()]})]}),(0,t.jsx)("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e4?"bg-destructive":"bg-primary"}`,style:{width:`${e3}%`}})})]}):null]})]})}):null]}):null]})}),(0,t.jsx)(T.ResponsiveModal,{open:eC,onOpenChange:eS,title:"Add New Card",titleClassName:"text-lg font-semibold leading-none text-foreground",dialogContentProps:{className:"sm:max-w-[520px] p-0 max-h-[90vh] flex flex-col rounded-xl [&_[data-dialog-close]]:right-4 [&_[data-dialog-close]]:top-4 [&_[data-dialog-close]]:flex [&_[data-dialog-close]]:h-8 [&_[data-dialog-close]]:w-8 [&_[data-dialog-close]]:items-center [&_[data-dialog-close]]:justify-center [&_[data-dialog-close]]:rounded-full [&_[data-dialog-close]]:border-2 [&_[data-dialog-close]]:border-primary/70 [&_[data-dialog-close]]:text-muted-foreground [&_[data-dialog-close]]:opacity-100 [&_[data-dialog-close]_svg]:h-5 [&_[data-dialog-close]_svg]:w-5"},dialogHeaderProps:{className:"px-4 pt-4 pb-12 text-left"},drawerContentProps:{className:"max-h-[90vh] p-0"},drawerHeaderProps:{className:"px-4 pt-4 pb-8 text-left"},children:eC?(0,t.jsx)("div",{className:"px-4 pb-8 space-y-4",children:eI.isLoading?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Preparing Stripe\\u2026"}):eV&&eq?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Elements,{stripe:eq,options:{clientSecret:eI.data.client_secret},children:(0,t.jsx)(U,{clientSecret:eI.data.client_secret,allowOneTimeUse:J&&e2,onSaved:eK,onUseOnce:eX,onError:e=>eE(e)})}),eP?(0,t.jsx)("p",{className:"text-xs text-destructive",children:eP}):null,eW.isError?(0,t.jsx)("p",{className:"text-xs text-destructive",children:"Unable to save payment method. Please try again."}):null]}):(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm text-destructive",children:"Unable to load payment form."}),(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>eI.refetch(),children:"Retry"})]})}):null})]})}e.s(["PaymentMethodModal",0,F,"default",0,F],209126)},847240,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(657688),a=e.i(522016),s=e.i(203358),i=e.i(582629);e.i(632821);var l=e.i(559528),o=e.i(362474);let d=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString();e.s(["ProductCard",0,function({product:e,showFreeDelivery:c,revealDelayMs:u=0,onSelect:p}){let m,[f,h]=(0,r.useState)(!1),x=("string"==typeof(m=e.images?.[0])?m:m?.image)||e.image_del||'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300"><defs><linearGradient id="pbg" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" stop-color="%23f1f5f9"/><stop offset="100%25" stop-color="%23e2e8f0"/></linearGradient></defs><rect width="400" height="300" fill="url(%23pbg)"/><g transform="translate(170, 115)"><rect x="0" y="20" width="60" height="50" rx="4" fill="%23cbd5e1"/><polygon points="30,0 60,20 0,20" fill="%23b0bac9"/><line x1="30" y1="20" x2="30" y2="70" stroke="%23a1aab8" stroke-width="2"/><line x1="0" y1="45" x2="60" y2="45" stroke="%23a1aab8" stroke-width="2"/></g></svg>',g=e.id??"",y=g?`${(0,i.routeCustomerOrderNewSuppliers)()}?main_product_id=${g}`:(0,i.routeCustomerOrderNewSuppliers)(),b=()=>(0,l.track)(o.PRODUCT_VIEWED,{product_id:e.id,product_name:e.name}),v="group flex overflow-hidden rounded-xl border border-border bg-card text-left transition-all hover:-translate-y-0.5 hover:border-primary/30 animate-slide-up md:flex-col",j=u>0?{animationDelay:`${u}ms`}:void 0,w=(0,r.useMemo)(()=>(e.tags??[]).some(e=>{let t=e.name.toLowerCase();return t.includes("free delivery")||t.includes("free-delivery")}),[e.tags]),N=e.description||e.main_product_infos?.[0]?.description||"View available listings.",C=d(e.likes_count??0),S=d(e.listings_count??0),k=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"h-28 w-28 flex-shrink-0 overflow-hidden bg-muted md:h-auto md:w-full md:aspect-[16/9]",children:(0,t.jsx)(n.default,{src:x,alt:e.name,onLoad:()=>h(!0),width:400,height:300,className:`${f?"opacity-100":"opacity-0"} h-full w-full object-cover transition-all duration-500 group-hover:scale-105`,loading:"lazy",unoptimized:!0})}),(0,t.jsxs)("div",{className:"flex-1 p-4",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-card-foreground transition-colors group-hover:text-primary",children:e.name}),(0,t.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:N}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(s.ThumbsUp,{
2className:"h-3 w-3 text-primary","aria-hidden":!0}),(0,t.jsx)("span",{children:C})]}),(0,t.jsx)("span",{children:"â¢"}),(0,t.jsxs)("span",{children:[S," listings"]})]}),c&&w?(0,t.jsx)("span",{className:"mt-2 inline-flex items-center justify-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold text-primary",children:"Free Delivery"}):null]})]});return p&&g?(0,t.jsx)("button",{type:"button",className:v,style:j,onClick:()=>{b(),p(g)},children:k}):(0,t.jsx)(a.default,{href:y,className:v,style:j,onClick:b,children:k})}])},864086,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(566595),a=e.i(263676);e.i(986823);var s=e.i(113827);let i=(0,r.forwardRef)(function({value:e,onChange:r,onClear:i,showClear:l=!0,className:o,rootClassName:d,inputClassName:c,iconClassName:u,clearButtonClassName:p,placeholder:m="Search...",...f},h){let x=l&&e.trim().length>0;return(0,t.jsxs)("div",{className:(0,s.cn)("relative",d),children:[(0,t.jsx)(n.Search,{className:(0,s.cn)("absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",u),"aria-hidden":!0}),(0,t.jsx)("input",{...f,ref:h,type:"text",value:e,placeholder:m,className:(0,s.cn)("flex h-10 w-full rounded-md border border-input bg-background py-2 pl-9 pr-9 text-base ring-offset-background outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",o,c),onChange:e=>r(e.target.value)}),x?(0,t.jsx)("button",{type:"button",onClick:i??(()=>r("")),className:(0,s.cn)("absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",p),"aria-label":"Clear search",children:(0,t.jsx)(a.X,{className:"h-4 w-4"})}):null]})});e.s(["SearchField",0,i])},252946,626055,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(522016);e.i(924856);let a={privacy:{label:"Privacy Policy",href:"/privacy-policy"},terms:{label:"Terms of Service",href:"/terms-of-service"}},s={onboarding:"By checking this box, I agree to receive account and order-related text messages (such as booking, delivery, and pickup updates) from Downstream at the phone number above. Consent is not a condition of any purchase. Message and data rates may apply and message frequency varies. Reply STOP to unsubscribe or HELP for help. See our Privacy Policy and Terms of Service.",checkout:"By checking this box, I agree to receive text messages about this order â including delivery, pickup, and status updates â from Downstream at my account phone number. Consent is not a condition of this purchase. Message and data rates may apply and message frequency varies. Reply STOP to unsubscribe or HELP for help. See our Privacy Policy and Terms of Service."},i={onboarding:"Get account and order updates",checkout:"Text me updates about this order"};e.s(["SMS_CONSENT_DISCLOSURE",0,s,"SMS_CONSENT_POLICY_LINKS",0,a,"SMS_CONSENT_TITLE",0,i,"buildSmsConsentRequest",0,function(e){let t={phone_number:e.phoneNumber,disclosure_text:s[e.surface],method:"web_form"};return e.sourceUrl&&(t.source_url=e.sourceUrl.slice(0,512)),t}],626055);var l=e.i(308574);e.s(["SmsConsentField",0,function({surface:e,checked:o,onCheckedChange:d,disabled:c=!1,helperText:u,className:p}){var m;let f,h;return(0,t.jsxs)("div",{className:["rounded-xl border border-primary/30 bg-primary/[0.03] p-3 dark:bg-primary/5",p??""].join(" "),children:[(0,t.jsxs)("label",{className:["flex items-center gap-2.5",c?"cursor-not-allowed":"cursor-pointer"].join(" "),children:[(0,t.jsx)(l.Checkbox,{checked:o,onCheckedChange:e=>d(!0===e),disabled:c,"aria-label":i[e],className:"rounded-[5px]"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:i[e]})]}),(0,t.jsx)("p",{className:"mt-1 pl-[30px] text-xs leading-relaxed text-muted-foreground",children:(m=s[e],f=[a.privacy,a.terms],h=RegExp(`(${f.map(e=>e.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"g"),m.split(h).map((e,a)=>{let s=f.find(t=>t.label===e);return s?(0,t.jsx)(n.default,{href:s.href,target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",onClick:e=>e.stopPropagation(),children:e},a):(0,t.jsx)(r.Fragment,{children:e},a)}))}),u?(0,t.jsx)("p",{className:"mt-2 pl-[30px] text-xs text-muted-foreground",children:u}):null]})}],252946)},143566,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(221642),a=e.i(782551),s=e.i(864086);e.s(["DSFilterableListView",0,function({items:e,itemBuilder:i,filters:l,prefixIcon:o,filterIcon:d,selectedFilterIcon:c,filterBackgroun
2d:u="hsl(var(--card))",scrollDirection:p="vertical",noItemsMessage:m,title:f,actions:h,fillColor:x,hintText:g,suffixIcon:y,padding:b=0,searchFiledPadding:v=0,hasShadow:j=!0,isDesc:w=!1,reversed:N=!1,searchBarAction:C,itemToString:S}){let[k,_]=(0,r.useState)(""),[P,E]=(0,r.useState)(l),T=(0,r.useMemo)(()=>{let t=[...e];if(k.trim()){let e=k.toLowerCase();t=t.filter(t=>(S?S(t):JSON.stringify(t??{})).toLowerCase().includes(e))}return(P??[]).forEach(e=>{let r=e.options.filter(e=>e.isSelected);0!==r.length&&(t=t.filter(e=>r.every(t=>t.filter(e))))}),w&&(t=t.reverse()),N&&(t=t.reverse()),t},[e,P,k,S,w,N]),M=(P?.length??0)>0,I=(P??[]).some(e=>e.options.some(e=>e.isSelected));return(0,t.jsxs)("div",{className:"flex flex-col gap-3",style:{padding:b},children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",style:{padding:v},children:[f??(0,t.jsxs)("div",{className:["flex min-w-[200px] flex-1 items-center gap-2 rounded-lg border border-border bg-card px-3 py-2",j?"border-transparent shadow-[0_6px_20px_rgba(0,0,0,0.08)]":"",x?"bg-muted/40":""].filter(Boolean).join(" "),children:[(0,t.jsx)(s.SearchField,{rootClassName:"flex-1",value:k,onChange:_,placeholder:g??"Search",showClear:!1,className:"h-auto border-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",iconClassName:o?"hidden":"absolute left-0 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",inputClassName:o?"pl-0 pr-8 placeholder:text-slate-500":"pl-6 pr-8 placeholder:text-slate-500"}),k&&(0,t.jsx)("button",{type:"button",className:"border-0 bg-transparent text-base text-muted-foreground transition hover:opacity-80",onClick:()=>_(""),children:y??"Ã"})]}),C,h&&h.length>0&&(0,t.jsx)("div",{className:"inline-flex gap-1.5",children:h.map((e,r)=>(0,t.jsx)("button",{type:"button",onClick:e.onTap,className:"rounded-lg border-0 bg-muted/30 p-2 transition hover:brightness-95",children:e.icon},r))}),M&&(0,t.jsx)("div",{className:"inline-flex items-center justify-center rounded-lg border border-border p-2",style:{backgroundColor:u},children:I?c??d:d})]}),M&&(0,t.jsx)("div",{className:"grid gap-2 rounded-2xl border border-border bg-card p-3",children:(P??[]).map((e,r)=>(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(a.DsText,{variant:"labelBold",text:e.label}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2.5",children:e.options.map((n,a)=>(0,t.jsxs)("label",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,t.jsx)("input",{type:e.isMultiSelectable?"checkbox":"radio",name:e.label,checked:!!n.isSelected,onChange:()=>{E(e=>{var t;if(!e)return e;let n=[...e],s=n[r],i={...t=s.options[a],isSelected:!t.isSelected},l=[...s.options];return s.isMultiSelectable?l[a]=i:l=l.map((e,t)=>t===a?i:{...e,isSelected:!1}),n[r]={...s,options:l},s.onOptionChanged?.(),n})}}),(0,t.jsx)("span",{children:n.label})]},n.label))}),(0,t.jsx)(n.DashSeparator,{color:"hsl(var(--border))"})]},e.label))}),(0,t.jsx)("div",{className:["flex flex-wrap gap-2","vertical"===p?"flex-col":"flex-row"].join(" "),children:0===T.length?(0,t.jsx)("div",{className:"w-full rounded-lg border border-dashed border-border bg-muted/30 p-3",children:(0,t.jsx)(a.DsText,{variant:"bodyText",text:m??"No items"})}):T.map((e,r)=>(0,t.jsx)("div",{className:"w-full",children:i(e,r)},r))})]})}])},306630,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(143566);e.s(["DSFilterablePaginatedListView",0,function({items:e,pageSize:a=10,itemBuilder:s,filters:i,prefixIcon:l,filterIcon:o,selectedFilterIcon:d,filterBackground:c,noItemsMessage:u,title:p,actions:m,fillColor:f,hintText:h,suffixIcon:x,padding:g,searchFiledPadding:y,hasShadow:b,itemToString:v}){let[j,w]=(0,r.useState)(0),N=Math.max(1,Math.ceil(e.length/a)),C=(0,r.useMemo)(()=>{let t=j*a;return e.slice(t,t+a)},[e,j,a]),S=e=>{w(Math.min(Math.max(e,0),N-1))};return(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsx)(n.DSFilterableListView,{items:C,itemBuilder:s,filters:i,prefixIcon:l,filterIcon:o,selectedFilterIcon:d,filterBackground:c,noItemsMessage:u,title:p,actions:m,fillColor:f,hintText:h,suffixIcon:x,padding:g,searchFiledPadding:y,hasShadow:b,itemToString:v}),(0,t.jsxs)("div",{className:"inline-flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",className:"rounded-md border border-border bg-white px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>S(j-1),disabled:0===j,children:"Prev"}),(0,t.jsxs)("span",{className:"text-sm text-slate-700",children:["Page ",j+1," of ",N]}),(0,t.jsx)("button",{type:"button",className:"rounded-md border border-border bg-white px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>S(j+1),disabled:j>=N-1,children:"Next"})]})]})}])},418883,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(174080);var n=e.i(820783),a=Symbol.for("react.lazy"),s=r[" use ".trim().toString()];function i(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===a&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var l=Symbol("radix.slottable");function o(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l}var d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{var l,d;let c,u,p,m=(d=l=`Primitive.${a}`,(c=r.forwardRef((e,t)=>
2{let{children:a,...l}=e;if(i(a)&&"function"==typeof s&&(a=s(a._payload)),r.isValidElement(a)){var o;let e,s,i=(o=a,(s=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),d=function(e,t){let r={...t};for(let n in t){let a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{let t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(l,a.props);return a.type!==r.Fragment&&(d.ref=t?(0,n.composeRefs)(t,i):i),r.cloneElement(a,d)}return r.Children.count(a)>1?r.Children.only(null):null})).displayName=`${d}.SlotClone`,u=c,(p=r.forwardRef((e,n)=>{let{children:a,...l}=e;i(a)&&"function"==typeof s&&(a=s(a._payload));let d=r.Children.toArray(a),c=d.find(o);if(c){let e=c.props.children,a=d.map(t=>t!==c?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(u,{...l,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return(0,t.jsx)(u,{...l,ref:n,children:a})})).displayName=`${l}.Slot`,p),f=r.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?m:a,{...s,ref:r})});return f.displayName=`Primitive.${a}`,{...e,[a]:f}},{}),c=r.forwardRef((e,r)=>(0,t.jsx)(d.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));c.displayName="Label";var u=e.i(225913);e.i(986823);var p=e.i(113827);let m=(0,u.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),f=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(c,{ref:n,className:(0,p.cn)(m(),e),...r}));f.displayName=c.displayName,e.s(["Label",0,f],418883)},749505,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(522016),a=e.i(24071),s=e.i(867927),i=e.i(648119);e.i(986823);var l=e.i(113827),o=e.i(499971);let d=({className:e,...r})=>(0,t.jsx)("nav",{role:"navigation","aria-label":"pagination",className:(0,l.cn)("mx-auto flex w-full justify-center",e),...r});d.displayName="Pagination";let c=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)("ul",{ref:n,className:(0,l.cn)("flex flex-row items-center gap-1",e),...r}));c.displayName="PaginationContent";let u=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)("li",{ref:n,className:(0,l.cn)("",e),...r}));u.displayName="PaginationItem";let p=({className:e,isActive:r,size:a="icon",...s})=>(0,t.jsx)(n.default,{"aria-current":r?"page":void 0,className:(0,l.cn)((0,o.buttonVariants)({variant:r?"outline":"ghost",size:a}),e),...s});p.displayName="PaginationLink";let m=({className:e,...r})=>(0,t.jsxs)(p,{"aria-label":"Go to previous page",size:"default",className:(0,l.cn)("gap-1 pl-2.5",e),...r,children:[(0,t.jsx)(a.ChevronLeft,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Previous"})]});m.displayName="PaginationPrevious";let f=({className:e,...r})=>(0,t.jsxs)(p,{"aria-label":"Go to next page",size:"default",className:(0,l.cn)("gap-1 pr-2.5",e),...r,children:[(0,t.jsx)("span",{children:"Next"}),(0,t.jsx)(s.ChevronRight,{className:"h-4 w-4"})]});f.displayName="PaginationNext";let h=({className:e,...r})=>(0,t.jsxs)("span",{"aria-hidden":!0,className:(0,l.cn)("relative flex h-9 w-9 items-center justify-center",e),...r,children:[(0,t.jsx)(i.MoreHorizontal,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"More pages"})]});h.displayName="PaginationEllipsis",e.s(["Pagination",0,d,"PaginationContent",0,c,"PaginationEllipsis",0,h,"PaginationItem",0,u,"PaginationLink",0,p,"PaginationNext",0,f,"PaginationPrevious",0,m])},594249,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(981140),a=e.i(820783),s=e.i(30030),i=e.i(248425),l=e.i(842727),o=e.i(369340),d=e.i(586318),c=e.i(635804),u=e.i(999682),p=e.i(296626),m="Radio",[f,h]=(0,s.createContextScope)(m),[x,g]=f(m),y=r.forwardRef((e,s)=>{let{__scopeRadio:l,name:o,checked:d=!1,required:c,disabled:u,value:p="on",onCheck:m,form:f,...h}=e,[g,y]=r.useState(null),b=(0,a.useComposedRefs)(s,e=>y(e)),v=r.useRef(!1),N=!g||f||!!g.closest("form");return(0,t.jsxs)(x,{scope:l,checked:d,disabled:u,children:[(0,t.jsx)(i.Primitive.button,{type:"button",role:"radio","aria-checked":d,"data-state":w(d),"data-disabled":u?"":void 0,disabled:u,value:p,...h,ref:b,onClick:(0,n.composeEventHandlers)(e.onClick,e=>{d||m?.(),N&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),N&&(0,t.jsx)(j,{control:g,bubbles:!v.current,name:o,value:p,checked:d,required:c,disabled:u,form:f,style:{transform:"translateX(-100%)"}})]})});y.displayName=m;var b="RadioIndicator",v=r.forwardRef((e,r)=>{let{__scopeRadio:n,forceMount:a,...s}=e,l=g(b,n);return(0,t.jsx)(p.Presence,{present:a||l.checked,children:(0,t.jsx)(i.Primitive.span,{"data-state":w(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:r})})});v.displayName=b;var j=r.forwardRef(({__scopeRadio:e,control:n,checked:s,bubbles:l=!0,...o},d)=>{let p=r.useRef(null),m=(0,a.useComposedRefs)(p,d),f=(0,u.usePrevious)(s),h=(0,c.useSize)(n);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==s&&t){let r=new Event("click",{bubbles:l});t.call(e,s),e.dispatchEvent(r)}},[f,s,l]),(0,t.jsx)(i.Primitive.input,{type:"radio","aria-hidden":!0,defaultChecked:s,...o,tabIndex:-1,ref:m,style:{...o.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function w(e){return e?"checked":"unchecked"}j.displayName="RadioBubbleInput";var N=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],C="RadioGroup",[S,k]=(0,s.createContextScope)(C,[l.createRovingFocusGroupScope,h]),_=(0,l.createRovingFocusGroupScope)(),P=h(),[E,T]=S(C),M=r.forwardRef((e,r)=>{let{__scopeRadioGroup:n,name:a,defaultValue:s,value:c,required:u=!1,disabled:p=!1,orientation:m,dir:f,loop:h=!0,onValueChange:x,...g}=e,y=_(n),b=(0,d.useDirection)(f),[v,j]=(0,o.useControllableState)({prop:c,defaultProp:s??null,onChange:x,caller:C});return(0,t.jsx)(E,{scope:n,name:a,required:u,disabled:p,value:v,onValueChange:j,children:(0,t.jsx)(l.Root,{asChild:!0,...y,orientation:m,dir:b,loop:h,children:(0,t.jsx)(i.Primitive.div,{role:"radiogroup","aria-required":u,"aria-orientation":m,"data-disabled":p?"":void 0,dir:b,...g,ref:r})})})});M.displayName=C;var I="RadioGroupItem",D=r.forwardRef((e,s)=>{let{__scopeRadioGroup:i,disabled:o,...d}=e,c=T(I,i),u=c.disabled||o,p=_(i),m=P(i),f=r.useRef(null),h=(0,a.useComposedRefs)(s,f),x=c.value===d.value,g=r.useRef(!1);return r.useEffect(()=>{let e=e=>
2{N.includes(e.key)&&(g.current=!0)},t=()=>g.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,t.jsx)(l.Item,{asChild:!0,...p,focusable:!u,active:x,children:(0,t.jsx)(y,{disabled:u,required:c.required,checked:x,...m,...d,name:c.name,ref:h,onCheck:()=>c.onValueChange(d.value),onKeyDown:(0,n.composeEventHandlers)(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:(0,n.composeEventHandlers)(d.onFocus,()=>{g.current&&f.current?.click()})})})});D.displayName=I;var R=r.forwardRef((e,r)=>{let{__scopeRadioGroup:n,...a}=e,s=P(n);return(0,t.jsx)(v,{...s,...a,ref:r})});R.displayName="RadioGroupIndicator";var $=e.i(564346);e.i(986823);var A=e.i(113827);let L=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(M,{className:(0,A.cn)("grid gap-2",e),...r,ref:n}));L.displayName=M.displayName;let O=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(D,{ref:n,className:(0,A.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:(0,t.jsx)(R,{className:"flex items-center justify-center",children:(0,t.jsx)($.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));O.displayName=D.displayName,e.s(["RadioGroup",0,L,"RadioGroupItem",0,O],594249)},3321,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(986823);var n=e.i(113827);let a=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("textarea",{className:(0,n.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
2ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));a.displayName="Textarea",e.s(["Textarea",0,a])},952789,e=>{"use strict";e.s(["dsBackgroundColors",0,{listThemed:"hsl(var(--background))",primaryThemed:"hsl(var(--background))",buttonContrast:"hsl(var(--card))",helperFormBlack:"hsl(var(--foreground) / 0.4)",modalPopup:"hsl(var(--foreground) / 0.4)",helperFormWhite:"hsl(var(--foreground) / 0.4)",secondaryThemed:"hsl(var(--foreground) / 0.2)",tertiaryThemed:"hsl(var(--foreground) / 0.05)",success:"hsl(var(--success))",finalAction:"hsl(var(--primary))",primaryButton:"hsl(var(--primary))",secondaryButton:"hsl(var(--secondary))",primaryButton10:"hsl(var(--primary) / 0.1)",actionSecondary:"hsl(var(--primary) / 0.2)",actionTertiary:"hsl(var(--primary) / 0.1)",inProgress:"hsl(var(--secondary) / 0.1)",additionalInfo:"hsl(var(--secondary) / 0.1)",critical:"hsl(var(--destructive))",criticalMessage:"hsl(var(--destructive) / 0.1)",criticalSecondary:"hsl(var(--destructive) / 0.2)",scheduled:"hsl(var(--warning))",scheduledTransparent:"hsl(var(--warning) / 0.2)",buttonUncheck:"hsl(var(--card) / 0.2)",transparent:"transparent"},"dsChartCategoricalPalettes",0,{permissionAreas:["hsl(189 72% 45%)","hsl(222 78% 62%)","hsl(38 82% 52%)","hsl(12 78% 60%)","hsl(268 60% 64%)","hsl(152 56% 42%)","hsl(330 64% 62%)","hsl(205 42% 56%)"]},"dsStrokeColors",0,{focus:"hsl(var(--ring))",secondary:"hsl(var(--secondary))",neutral:"hsl(var(--border))",inputfieldThemed:"hsl(var(--input))",separatorThemed:"hsl(var(--border))",critical:"hsl(var(--destructive))",inProgress:"hsl(var(--secondary))",success:"hsl(var(--success))"},"dsTextColors",0,{accent:"hsl(var(--primary))",accentSecondary:"hsl(var(--secondary))",info:"hsl(var(--secondary))",additionalInfo:"hsl(var(--secondary) / 0.6)",contrast:"hsl(var(--primary-foreground))",contrastInactive:"hsl(var(--primary-foreground) / 0.6)",primaryThemed:"hsl(var(--foreground))",secondaryThemed:"hsl(var(--foreground) / 0.6)",tertiaryThemed:"hsl(var(--foreground) / 0.4)",quaternaryThemed:"hsl(var(--foreground) / 0.2)",warning:"hsl(var(--warning))",danger:"hsl(var(--destructive))",success:"hsl(var(--success))"}])},820783,e=>{"use strict";var t=e.i(271645);function r(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return t=>{let n=!1,a=e.map(e=>{let a=r(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t<a.length;t++){let n=a[t];"function"==typeof n?n():r(e[t],null)}}}}e.s(["composeRefs",0,n,"useComposedRefs",0,function(...e){return t.useCallback(n(...e),e)}])},225913,e=>{"use strict";var t=e.i(207670);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>a=>{var s;if((null==t?void 0:t.variants)==null)return n(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:i,defaultVariants:l}=t,o=Object.keys(i).map(e=>{let t=null==a?void 0:a[e],n=null==l?void 0:l[e];if(null===t)return null;let s=r(t)||r(n);return i[e][s]}),d=a&&Object.entries(a).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,o,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...l,...d}[t]):({...l,...d})[t]===r})?[...e,r,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},726909,e=>{"use strict";let t=(0,e.i(456420).default)("arrow-left-right",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);e.s(["ArrowLeftRight",0,t],726909)},926805,e=>{"use strict";var t=e.i(460573);e.s(["CalendarIcon",()=>t.default])},716327,e=>{"use strict";let t=(0,e.i(456420).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],716327)},758379,e=>{"use strict";let t=(0,e.i(456420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t])},632781,e=>{"use strict";var t=e.i(758379);e.s(["Loader2",()=>t.default])},515281,e=>{"use strict";let t=(0,e.i(456420).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],515281)},575387,e=>{"use strict";let t=(0,e.i(456420).default)("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2
20 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);e.s(["Phone",0,t],575387)},77071,e=>{"use strict";let t=(0,e.i(456420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],77071)},328623,e=>{"use strict";let t=(0,e.i(456420).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],328623)},786563,e=>{"use strict";let t=(0,e.i(456420).default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",0,t],786563)},203358,e=>{"use strict";let t=(0,e.i(456420).default)("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);e.s(["ThumbsUp",0,t],203358)},263676,e=>{"use strict";let t=(0,e.i(456420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],263676)},522016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return b}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=e.r(190809),i=e.r(843476),l=s._(e.r(271645)),o=e.r(195057),d=e.r(8372),c=e.r(818581),u=e.r(718967),p=e.r(405550),m=e.r(388540),f=e.r(91949),h=e.r(573668),x=e.r(509396);function g(t){var r;let n,a,s,[g,b]=(0,l.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:j,as:w,children:N,prefetch:C=null,passHref:S,replace:k,shallow:_,scroll:P,onClick:E,onMouseEnter:T,onTouchStart:M,legacyBehavior:I=!1,onNavigate:D,transitionTypes:R,ref:$,unstable_dynamicOnHover:A,...L}=t;n=N,I&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let O=l.default.useContext(d.AppRouterContext),B=!1!==C,z=!1===C?"none":!0===C?"full":"auto",U="none"!==z?"auto"===z?x.FetchStrategy.PPR:x.FetchStrategy.Full:x.FetchStrategy.PPR,F="string"==typeof(r=w||j)?r:(0,o.formatUrl)(r);if(I){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(n)}let W=I?a&&"object"==typeof a&&a.ref:$,H,V=l.default.useCallback(e=>(null!==O&&(v.current=(0,f.mountLinkInstance)(e,F,O,U,B,b,H)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[B,F,O,U,b,H]),q={ref:(0,c.useMergedRef)(V,W),onClick(t){I||"function"!=typeof E||E(t),I&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!O||t.defaultPrevented||function(t,r,n,a,s,i,o,d="none"){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:p}=e.r(699781);l.default.startTransition(()=>{p(r,a?"replace":"push",!1===s?m.ScrollBehavior.NoScroll:m.ScrollBehavior.Default,n.current,o,d)})}}(t,F,v,k,P,D,R,z)},onMouseEnter(e){I||"function"!=typeof T||T(e),I&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),O&&B&&(0,f.onNavigationIntent)(e.currentTarget,!0===A)},onTouchStart:function(e){I||"function"!=typeof M||M(e),I&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),O&&B&&(0,f.onNavigationIntent)(e.currentTarget,!0===A)}};return(0,u.isAbsoluteUrl)(F)?q.href=F:I&&!S&&("a"!==a.type||"href"in a.props)||(q.href=(0,p.addBasePath)(F)),s=I?l.default.cloneElement(a,q):(0,i.jsx)("a",{...L,...q,children:n}),(0,i.jsx)(y.Provider,{value:g,children:s})}let y=(0,l.createContext)(f.IDLE_LINK_STATUS),b=()=>(0,l.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
2dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},818581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(271645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=s(e,n)),t&&(a.current=s(t,n))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},232189,(e,t,r)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},865156,(e,t,r)=>{"use strict";var n=e.r(232189);function a(){}function s(){}s.resetWarningCache=a,t.exports=function(){function e(e,t,r,a,s,i){if(i!==n){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:a};return r.PropTypes=r,r}},745009,(e,t,r)=>{t.exports=e.r(865156)()},667668,e=>{"use strict";var t=e.i(271645),r=e.i(745009);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=e&&("u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=a){var s=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(r=a.next()).done)&&(s.push(r.value),!t||s.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var d=function(e,r,n){var a=!!n,s=t.default.useRef(n);t.default.useEffect(function(){s.current=n},[n]),t.default.useEffect(function(){if(!a||!e)return function(){};var t=function(){s.current&&s.current.apply(s,arguments)};return e.on(r,t),function(){e.off(r,t)}},[a,r,e,s])},c=function(e){var r=t.default.useRef(e);return t.default.useEffect(function(){r.current=e},[e]),r.current},u=function(e){return null!==e&&"object"===s(e)},p="[object Object]",m=function e(t,r){if(!u(t)||!u(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var a=Object.prototype.toString.call(t)===p;if(a!==(Object.prototype.toString.call(r)===p))return!1;if(!a&&!n)return t===r;var s=Object.keys(t),i=Object.keys(r);if(s.length!==i.length)return!1;for(var l={},o=0;o<s.length;o+=1)l[s[o]]=!0;for(var d=0;d<i.length;d+=1)l[i[d]]=!0;var c=Object.keys(l);return c.length===s.length&&c.every(function(n){return e(t[n],r[n])})},f=function(e,t,r){return u(e)?Object.keys(e).reduce(function(n,s){var l=!u(t)||!m(e[s],t[s]);return r.includes(s)?(l&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),n):l?a(a({},n||{}),{},i({},s,e[s])):n},null):null},h="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;if(null===e||u(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;if(u(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return x(e,t)})};var r=x(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},y=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.3.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.3.0",url:"https://stripe.com/docs/stripe-js/react"}))},b=t.default.createContext(null);b.displayName="ElementsContext";var v=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},j=function(e){var r=e.stripe,n=e.options,a=e.children,s=t.default.useMemo(function(){return g(r)},[r]),i=l(t.default.useState(function(){return{stripe:"sync"===s.tag?s.stripe:null,elements:"sync"===s.tag?s.stripe.elements(n):null}}),2),o=i[0],d=i[1];t.default.useEffect(function(){var e=!0,t=function(e){d(function(t){return t.stripe?t:{stripe:e,elements:e.elements(n)}})};return"async"!==s.tag||o.stripe?"sync"!==s.tag||o.stripe||t(s.stripe):s.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[s,o,n]);var u=c(r);t.default.useEffect(function(){null!==u&&u!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[u,r]);var p=c(n);return t.default.useEffect(function(){if(o.elements){var e=f(n,p,["clientSecret","fonts"]);e&&o.elements.update(e)}},[n,p,o.elements]),t.default.useEffect(function(){y(o.stripe)},[o.stripe]),t.default.createElement(b.Provider,{value:o},a)};j.propTypes={stripe:r.default.any,options:r.default.object};r.default.func.isRequired;var w=t.default.createContext(null);w.displayName="CheckoutContext";var N=function(e){var r=t.default.useContext(w),n=t.default.useContext(b);if(!r)return v(n,e);if(!n)return r;throw Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."))},C=["mode"],S=function(e,n,a){var s="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),i=n?function(e){N("mounts <".concat(s,">"));var r=e.id,n=e.className;return t.default.createElement("div",{id:r,className:n})}:function(r){var n,a=r.id,i=r.className,o=r.options,u=void 0===o?{}:o,p=r.onBlur,m=r.onFocus,h=r.onReady,x=r.onChange,g=r.onEscape,y=r.onClick,b=r.onLoadError,v=r.onLoaderStart,j=r.onNetworksChange,w=r.onConfirm,S=r.onCancel,k=r.onShippingAddressChange,_=r.onShippingRateChange,P=r.onSavedPaymentMethodRemove,E=r.onSavedPaymentMethodUpdate,T=N("mounts <".concat(s,">")),M="elements"in T?T.elements:null,I="checkoutState"in T?T.checkoutState:null,D=(null==I?void 0:I.type)==="success"||(null==I?void 0:I.type)==="loading"?I.sdk:null,R=l(t.default.useState(null),2),$=R[0],A=R[1],L=t.default.useRef(null),O=t.default.useRef(null);d($,"blur",p),d($,"focus",m),d($,"escape",g),d($,"click",y),d($,"loaderror",b),d($,"loaderstart",v),d($,"networksch
2ange",j),d($,"confirm",w),d($,"cancel",S),d($,"shippingaddresschange",k),d($,"shippingratechange",_),d($,"savedpaymentmethodremove",P),d($,"savedpaymentmethodupdate",E),d($,"change",x),h&&(n="expressCheckout"===e?h:function(){h($)}),d($,"ready",n),t.default.useLayoutEffect(function(){if(null===L.current&&null!==O.current&&(M||D)){var t=null;if(D)switch(e){case"paymentForm":t=D.createForm(u);break;case"payment":t=D.createPaymentElement(u);break;case"address":if("mode"in u){var r=u.mode,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(u,C);if("shipping"===r)t=D.createShippingAddressElement(n);else if("billing"===r)t=D.createBillingAddressElement(n);else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":t=D.createExpressCheckoutElement(u);break;case"currencySelector":t=D.createCurrencySelectorElement();break;case"taxId":t=D.createTaxIdElement(u);break;case"contactDetails":t=D.createContactDetailsElement();break;default:throw Error("<".concat(s,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}else M&&(t=M.create(e,u));L.current=t,A(t),t&&t.mount(O.current)}},[M,D,u]);var B=c(u);return t.default.useEffect(function(){if(L.current){var e=f(u,B,["paymentRequest"]);e&&"update"in L.current&&L.current.update(e)}},[u,B]),t.default.useLayoutEffect(function(){return function(){if(L.current&&"function"==typeof L.current.destroy)try{L.current.destroy(),L.current=null}catch(e){}}},[]),t.default.createElement("div",{id:a,className:i,ref:O})};return i.propTypes={id:r.default.string,className:r.default.string,onChange:r.default.func,onBlur:r.default.func,onFocus:r.default.func,onReady:r.default.func,onEscape:r.default.func,onClick:r.default.func,onLoadError:r.default.func,onLoaderStart:r.default.func,onNetworksChange:r.default.func,onConfirm:r.default.func,onCancel:r.default.func,onShippingAddressChange:r.default.func,onShippingRateChange:r.default.func,onSavedPaymentMethodRemove:r.default.func,onSavedPaymentMethodUpdate:r.default.func,options:r.default.object},i.displayName=s,i.__elementType=e,i},k="u"<typeof window;t.default.createContext(null).displayName="EmbeddedCheckoutProviderContext",S("auBankAccount",k);var _=S("card",k);S("cardNumber",k),S("cardExpiry",k),S("cardCvc",k),S("iban",k);var P=S("payment",k);S("expressCheckout",k),S("paymentRequestButton",k),S("linkAuthentication",k),S("contactDetails",k),S("address",k),S("shippingAddress",k),S("paymentMethodMessaging",k),S("taxId",k),S("issuingCardNumberDisplay",k),S("issuingCardCvcDisplay",k),S("issuingCardExpiryDisplay",k),S("issuingCardPinDisplay",k),S("issuingCardCopyButton",k),e.s(["CardElement",0,_,"Elements",0,j,"PaymentElement",0,P,"useElements",0,function(){var e;return(e="calls useElements()",v(t.default.useContext(b),e)).elements},"useStripe",0,function(){return N("calls useStripe()").stripe}])},670190,e=>{"use strict";function t(e,{allowInactive:r=!1}={}){let n=e.verification_status?.trim().toLowerCase()||null;return(!n||"verified"===n)&&(!0===e.is_usable||!1!==e.is_usable||r&&!1===e.active&&null===n)}let r=e=>("string"==typeof e?e.trim():"")||null;function n(e,n){let a=r(n);if(a&&e.some(e=>e.id===a&&t(e)))return a;let s=e.find(e=>!!e.active&&t(e)&&!!e.id);return r(s?.id)??r(e.find(e=>t(e)&&e.id)?.id)}e.s(["getRemovalActionDisabledReason",0,function({hasRemovalDate:e,paymentChoicesLoading:t,paymentChoiceUnavailable:r,paymentMethodsFailed:n}){return e?t?"Payment methods are still loading.":r?n?"Payment methods could not be loaded. Please try again.":"Select a payment method to continue.":null:"Select a removal date to continue."},"isPaymentMethodReauthorizationRequired",0,function(e){return"us_bank_account"===e.type&&!1===e.active&&!1===e.is_usable}
2,"isPaymentMethodSelectable",0,t,"resolveCheckoutPaymentToggle",0,function(e,t,r,n){return e??"paylater"},"resolveDefaultPaymentMethodId",0,n,"resolveOrderActionDefaultPaymentMethodId",0,function(e,t,r,a){return r?a:n(e,t)}])}]); 3 4//# debugId=4e3173e6-d976-bade-a337-9e3d72cd89e9 5//# chunkId=4e3173e6-d976-bade-a337-9e3d72cd89e9
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.