1;!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]="ebbb2837-68d3-3c8f-0fbf-09b99c4de542")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,253204,189299,e=>{"use strict";var t=e.i(650782),r=e.i(876868);e.i(839921);var i=e.i(55448),n=e.i(54010),s=e.i(843476),a=e.i(271645);let u=(0,a.createContext)(null);function o(){return(0,a.useContext)(u)}e.s(["EffectiveUserGroupOverrideProvider",0,function({userGroupId:e,children:t}){let r=(0,a.useMemo)(()=>("string"==typeof e?e.trim():"")||null,[e]);return(0,s.jsx)(u.Provider,{value:r,children:t})},"useEffectiveUserGroupOverride",0,o],189299);let l=e=>("string"==typeof e?e.trim():"")||null,c=(e,t)=>l(e)??l(t)??null;e.s(["applyEffectiveUserGroupScope",0,(e,t)=>Object.prototype.hasOwnProperty.call(e,"user_group")||!t?e:{...e,user_group:t},"hasExplicitUserGroupScope",0,e=>Object.prototype.hasOwnProperty.call(e,"user_group"),"resolveEffectiveUserGroupId",0,c,"useEffectiveUserGroupId",0,function(e){let s=o(),a=(0,r.useSessionValue)(()=>n.sessionStore.getSelectedUserGroupId()),u=(0,t.useMe)({allowImpersonation:!0,enabled:e?.enabled}),d=u.data?(0,i.toUserEntity)(u.data):null,p=d?.userGroupId??null;return{effectiveUserGroupId:l(s)??c(a,p),selectedUserGroupId:l(s??a),meUserGroupId:l(p),isLoading:u.isLoading}}],253204)},641881,e=>{"use strict";e.i(540259);var t=e.i(911860),r=e.i(197589),i=e.i(230689),n=e.i(162441);async function s({userGroupId:e,billingName:i,billingEmail:n}){let a=await (0,r.apiV1BankAccountSetupsCreate)({user_group:e??null});if(!a.client_secret||!a.publishable_key)throw Error("Unable to start bank account setup");let u=await (0,t.loadStripe)(a.publishable_key);if(!u)throw Error("Stripe failed to load");let o=await u.collectBankAccountForSetup({clientSecret:a.client_secret,params:{payment_method_type:"us_bank_account",payment_method_data:{billing_details:{name:i,email:n}}}});if(o.error)throw await (0,r.apiV1BankAccountSetupsRetrieve)(a.id).catch(()=>void 0),Error(o.error.message||"Unable to collect bank account");if(o.setupIntent?.status==="requires_payment_method"&&!o.setupIntent.payment_method)return await (0,r.apiV1BankAccountSetupsRetrieve)(a.id),null;let l=await u.confirmUsBankAccountSetup(a.client_secret);if(l.error)throw await (0,r.apiV1BankAccountSetupsRetrieve)(a.id).catch(()=>void 0),Error(l.error.message||"Unable to confirm bank account");return(0,r.apiV1BankAccountSetupsRetrieve)(a.id)}e.s(["connectBankAccount",0,s,"useBankAccountSetups",0,function(e,t){let{isAuthenticated:s}=(0,i.useAuthCompat)(),a=(0,n.useImpersonation)();return(0,r.useApiV1BankAccountSetupsList)(e,{query:{...t,queryKey:[...(0,r.getApiV1BankAccountSetupsListQueryKey)(e),a?.impersonatedUserId??""],enabled:s&&(t?.enabled??!0),placeholderData:e=>e}})}])},259650,534686,e=>{"use strict";var t=e.i(621482),r=e.i(197589);e.i(197792);let i=["orders.main_product","orders.order_group.seller_product_seller_location.seller_location","orders.price","user_address"];function n(e){var t;let r="string"==typeof(t=e.user_address)?t||void 0:Array.isArray(t)&&t.filter(Boolean).join(",")||void 0;if(!r){let{user_address:t,...r}=e;return r}return{...e,user_address:r}}function s(e){return n({limit:25,empty:!1,...e,"expand[]":[...i]})}e.s(["getCartIdLookupParams",0,function(e){return n({limit:1,user_address:[e],fields:"id,user_address"})},"getCartSheetCartsListParams",0,s,"normalizeCartListCsvParams",0,n],534686);var a=e.i(230689),u=e.i(162441),o=e.i(253204);e.s(["useCartCount",0,function(e={},t){let{isAuthenticated:i}=(0,a.useAuthCompat)(),n=(0,u.useImpersonation)(),{effectiveUserGroupId:s}=(0,o.useEffectiveUserGroupId)({enabled:i}),l=(0,o.applyEffectiveUserGroupScope)(e,s);return(0,r.useCheckoutV1CartCountList)(l,{query:{queryKey:[...(0,r.getCheckoutV1CartCountListQueryKey)(l),n?.impersonatedUserId??""],enabled:i,placeholderData:e=>e,...t}})},"useCartList",0,function(e,i){return function(e,i){let{isAuthenticated:s}=(0,a.useAuthCompat)(),l=(0,u.useImpersonation)(),{effectiveUserGroupId:c}=(0,o.useEffectiveUserGroupId)({enabled:s}),d=n((0,o.applyEffectiveUserGroupScope)(e,c));return(0,t.useInfiniteQuery)({queryKey:["infinite-carts-list",...(0,r.getCheckoutV1CartsListQueryKey)(d),l?.impersonatedUserId??""],enabled:s&&(i?.enabled??!0),initialPageParam:void 0,queryFn:({pageParam:e,signal:t})=>(0,r.checkoutV1CartsList)({...d,starting_after:e},void 0,t),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0}})}(s(e),i)},"useCartsList",0,function(e,t){let{isAuthenticated:i}=(0,a.useAuthCompat)(),s=(0,u.useImpersonation)(),{effectiveUserGroupId:l}=(0,o.useEffectiveUserGroupId)({enabled:i}),c=n((0,o.applyEffectiveUserGroupScope)(e,l));return(0,r.useCheckoutV1CartsList)(c,{query:{queryKey:[...(0,r.getCheckoutV1CartsListQueryKey)(c),s?.impersonatedUserId??""],enabled:i,placeholderData:e=>e,...t}})}],259650)},481063,268098,411902,62405,741542,893019,695380,429634,662945,e=>{"use strict";var t=e.i(197589),r=e.i(230689),i=e.i(162441),n=e.i(253204);let s=(e,t)=>(0,n.applyEffectiveUserGroupScope)(e,t);e.s(["getScopedFinancialConnectionAccountListParams",0,s,"useFinancialConnectionAccounts",0,function(e){var a;let u,{isAuthenticated:o}=(0,r.useAuthCompat)(),l=(0,i.useImpersonation)(),{effectiveUserGroupId:c}=(0,n.useEffectiveUserGroupId)({enabled:o}),d=s(e,c);return(0,t.useFinancialAccountsV1FinancialConnectionAccountList)(d,{query:{queryKey:(a=l?.impersonatedUserId??null,u=s(e,c),[...(0,t.getFinancialAccountsV1FinancialConnectionAccountListQueryKey)(u),a??""]),enabled:o}})}
2],481063),e.s(["useFinancialStatements",0,function(e){let r=(0,i.useImpersonation)();return(0,t.useFinancialAccountsV1FinancialStatementList)(e,{query:{queryKey:[...(0,t.getFinancialAccountsV1FinancialStatementListQueryKey)(e),r?.impersonatedUserId??""]}})}],268098),e.s(["useInvoiceMetrics",0,function(){let e=(0,i.useImpersonation)(),{effectiveUserGroupId:r}=(0,n.useEffectiveUserGroupId)(),s={user_group:r??void 0};return(0,t.useApiV1InvoicesMetricsList)(s,{query:{queryKey:[...(0,t.getApiV1InvoicesMetricsListQueryKey)(s),e?.impersonatedUserId??""]}})}],411902);var a=e.i(621482);e.s(["useInfiniteOrderGroups",0,function(e,s){let{isAuthenticated:u}=(0,r.useAuthCompat)(),o=(0,i.useImpersonation)(),{effectiveUserGroupId:l}=(0,n.useEffectiveUserGroupId)({enabled:u}),c=(0,n.applyEffectiveUserGroupScope)(e,l);return(0,a.useInfiniteQuery)({queryKey:["infinite-order-groups",...(0,t.getApiV1OrderGroupsListQueryKey)(c),o?.impersonatedUserId??""],enabled:u&&(s?.enabled??!0),initialPageParam:void 0,queryFn:({pageParam:e,signal:r})=>(0,t.apiV1OrderGroupsList)({...c,starting_after:e},void 0,r),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0}})},"useOrderGroups",0,function(e,s){let{isAuthenticated:a}=(0,r.useAuthCompat)(),u=(0,i.useImpersonation)(),{effectiveUserGroupId:o}=(0,n.useEffectiveUserGroupId)({enabled:a}),l=(0,n.applyEffectiveUserGroupScope)(e,o);return(0,t.useApiV1OrderGroupsList)(l,{query:{queryKey:[...(0,t.getApiV1OrderGroupsListQueryKey)(l),u?.impersonatedUserId??""],enabled:a,placeholderData:e=>e,...s}})}],62405),e.s(["useOrders",0,function(e,s){let{isAuthenticated:a}=(0,r.useAuthCompat)(),u=(0,i.useImpersonation)(),{effectiveUserGroupId:o}=(0,n.useEffectiveUserGroupId)({enabled:a}),l=(0,n.applyEffectiveUserGroupScope)(e,o);return(0,t.useApiV1OrdersList)(l,{query:{queryKey:[...(0,t.getApiV1OrdersListQueryKey)(l),u?.impersonatedUserId??""],enabled:a,placeholderData:e=>e,...s}})}],741542),e.s(["usePaymentMethods",0,function(e,s){let{isAuthenticated:a}=(0,r.useAuthCompat)(),u=(0,i.useImpersonation)(),o=a&&!(0,n.hasExplicitUserGroupScope)(e),{effectiveUserGroupId:l,isLoading:c}=(0,n.useEffectiveUserGroupId)({enabled:o}),d=(0,n.applyEffectiveUserGroupScope)(e,l),p=!o||!!l||!c;return(0,t.useApiV1PaymentMethodsList)(d,{query:{...s,queryKey:[...(0,t.getApiV1PaymentMethodsListQueryKey)(d),u?.impersonatedUserId??""],enabled:a&&p&&(s?.enabled??!0),placeholderData:e=>e}})}],893019);let u=t.apiV1SellerLocationsList,o=t.getApiV1SellerLocationsListQueryKey;e.s(["apiV1CustomerSellerLocationsList",0,u,"getCustomerSellerLocationsListQueryKey",0,o,"useCustomerSellerLocation",0,function(e,n,s){let{isAuthenticated:a}=(0,r.useAuthCompat)(),u=(0,i.useImpersonation)(),o=s?.query?.enabled;return(0,t.useApiV1SellerLocationsRetrieve)(e,n,{query:{queryKey:[...(0,t.getApiV1SellerLocationsRetrieveQueryKey)(e,n),u?.impersonatedUserId??""],enabled:"function"==typeof o?o:(o??!0)&&a,placeholderData:e=>e,...s?.query},request:s?.request})},"useCustomerSellerLocations",0,function(e,n){let{isAuthenticated:s}=(0,r.useAuthCompat)(),a=(0,i.useImpersonation)(),u=n?.query?.enabled;return(0,t.useApiV1SellerLocationsList)(e,{query:{queryKey:[...(0,t.getApiV1SellerLocationsListQueryKey)(e),a?.impersonatedUserId??""],enabled:"function"==typeof u?u:(u??!0)&&s,placeholderData:e=>e,...n?.query},request:n?.request})},"useInfiniteCustomerSellerLocations",0,function(e,n=!0){let{isAuthenticated:s}=(0,r.useAuthCompat)(),u=(0,i.useImpersonation)(),o=["infinite-customer-seller-locations",...(0,t.getApiV1SellerLocationsListQueryKey)(e),u?.impersonatedUserId??""];return(0,a.useInfiniteQuery)({queryKey:o,enabled:n&&s,placeholderData:e=>e,initialPageParam:void 0,queryFn:({pageParam:r,signal:i})=>(0,t.apiV1SellerLocationsList)({...e,starting_after:r},void 0,i),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0}})}],695380),e.s(["clearSetupIntentQueries",0,e=>{e.removeQueries({queryKey:(0,t.getApiV1SetupIntentsListQueryKey)()})},"useSetupIntent",0,function(e,s){let{isAuthenticated:a}=(0,r.useAuthCompat)(),u=(0,i.useImpersonation)(),o=a&&!(0,n.hasExplicitUserGroupScope)(e),{effectiveUserGroupId:l}=(0,n.useEffectiveUserGroupId)({enabled:o}),c=(0,n.applyEffectiveUserGroupScope)(e,l);return(0,t.useApiV1SetupIntentsList)({...c},{query:{...s,queryKey:[...(0,t.getApiV1SetupIntentsListQueryKey)(c),u?.
2impersonatedUserId??""],enabled:a&&(s?.enabled??!0)}})}],429634);var l=e.i(271645);e.s(["useInfiniteUserAddresses",0,function(e,s){let u,{isAuthenticated:o}=(0,r.useAuthCompat)(),l=(0,i.useImpersonation)(),{effectiveUserGroupId:c}=(0,n.useEffectiveUserGroupId)({enabled:o}),d=(0,n.applyEffectiveUserGroupScope)(e,c),p=["infinite-user-addresses",...(0,t.getApiV1UserAddressesListQueryKey)(d),l?.impersonatedUserId??""];return(0,a.useInfiniteQuery)({queryKey:p,enabled:(u=s?.enabled,(u??!0)&&o),placeholderData:e=>e,initialPageParam:void 0,queryFn:({pageParam:e,signal:r})=>(0,t.apiV1UserAddressesList)({...d,starting_after:e},void 0,r),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0}})},"useListAllMatchingUserAddressSeeds",0,function(e,i){let s,{isAuthenticated:a}=(0,r.useAuthCompat)(),{effectiveUserGroupId:u}=(0,n.useEffectiveUserGroupId)({enabled:a}),o=(0,n.applyEffectiveUserGroupScope)(e,u),c=(s=i?.enabled,(s??!0)&&a);return(0,l.useCallback)(async()=>{let e;if(!c)return[];let r=Math.min(100,Math.max(1,i?.limit??100)),n=[];for(;;){let s=await (0,t.apiV1UserAddressesList)({...o,fields:i?.fields??"id",limit:r,starting_after:e}),a=s.data??[];for(let e of a)e.id&&n.push({id:e.id,name:e.name?.trim()||"Project",latitude:e.latitude??null,longitude:e.longitude??null,estimatedStartDate:e.estimated_start_date??null,estimatedEndDate:e.estimated_end_date??null,isArchived:e.is_archived??!1});if(!s.has_more||0===a.length||!(e=a[a.length-1]?.id??void 0))break}return n},[c,i?.fields,i?.limit,o])},"useUserAddresses",0,function(e,s){let a,{isAuthenticated:u}=(0,r.useAuthCompat)(),o=(0,i.useImpersonation)(),{effectiveUserGroupId:l}=(0,n.useEffectiveUserGroupId)({enabled:u}),c=(0,n.applyEffectiveUserGroupScope)(e,l);return(0,t.useApiV1UserAddressesList)(c,{query:{queryKey:[...(0,t.getApiV1UserAddressesListQueryKey)(c),o?.impersonatedUserId??""],enabled:(a=s?.enabled,(a??!0)&&u),placeholderData:e=>e}})}],662945)},292502,e=>{"use strict";e.i(641881),e.i(259650),e.i(481063),e.i(268098),e.i(411902),e.i(62405),e.i(741542),e.i(893019),e.i(695380),e.i(429634),e.i(662945),e.i(655023),e.i(878632),e.s([])},655023,e=>{"use strict";var t=e.i(197589),r=e.i(162441);e.s(["useUserGroups",0,function(e,i=!0){let n=(0,r.useImpersonation)();return(0,t.useApiV1UserGroupsList)(e,{query:{queryKey:[...(0,t.getApiV1UserGroupsListQueryKey)(e),n?.impersonatedUserId??""],enabled:i}})}])},878632,e=>{"use strict";var t=e.i(621482),r=e.i(197589),i=e.i(230689),n=e.i(162441),s=e.i(884653),a=e.i(253204);e.s(["useInfiniteUsers",0,function(e,u){let o,{isAuthenticated:l}=(0,i.useAuthCompat)(),c=(0,n.useImpersonation)(),{selectedUserGroupId:d}=(0,a.useEffectiveUserGroupId)({enabled:l}),p=(0,a.applyEffectiveUserGroupScope)(e??{},d),f=["infinite-users",...(0,r.getApiV1UsersListQueryKey)(p),u?.bypassImpersonation?"":c?.impersonatedUserId??""];return(0,t.useInfiniteQuery)({queryKey:f,enabled:(o=u?.enabled,(o??!0)&&l),initialPageParam:void 0,queryFn:({pageParam:e,signal:t})=>(0,r.apiV1UsersList)({...p,starting_after:e},{headers:u?.bypassImpersonation?s.BypassImpersonationHeader:void 0},t),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0}})},"useUsers",0,function(e,t){let u,{isAuthenticated:o}=(0,i.useAuthCompat)(),l=(0,n.useImpersonation)(),{selectedUserGroupId:c}=(0,a.useEffectiveUserGroupId)({enabled:o}),d=(0,a.applyEffectiveUserGroupScope)(e??{},c),p=(0,r.getApiV1UsersListQueryKey)(d);return(0,r.useApiV1UsersList)(d,{query:{queryKey:[...p,t?.bypassImpersonation?"":l?.impersonatedUserId??""],enabled:(u=t?.enabled,(u??!0)&&o),placeholderData:e=>e},request:{headers:t?.bypassImpersonation?s.BypassImpersonationHeader:void 0}})}])},398106,206269,636074,281472,365414,644161,e=>{"use strict";e.i(135163);var t=e.i(271645),r=e.i(197589);e.i(839921);var i=e.i(890871);e.s(["useUserGroupBrandingQuery",0,function(e,n){let s=(0,r.useApiV1UserGroupsRetrieve)(e,{},{query:{enabled:n?.enabled}}),a=(0,t.useMemo)(()=>s.data?(0,i.toUserGroupEntity)(s.data).branding:null,[s.data]);return{...s,data:a}}],206269);var n=e.i(253204);e.s([],636074),e.i(292502),e.i(852603),e.i(556651),e.i(165267);var s=e.i(230689),a=e.i(162441);let u=e=>("string"==typeof e?e.trim():"")||void 0,o=(e={},t)=>{let i=u(e.account_type),n=u(e.account);return{...e,account_type:i,account:n??(i===r.InsurancePolicyAccountType.user_group?t??void 0:e.account)}};e.s(["useInsurancePolicies",0,function(e={},t){let{isAuthenticated:i}=(0,s.useAuthCompat)(),u=(0,a.useImpersonation)(),{effectiveUserGroupId:l}=(0,n.useEffectiveUserGroupId)({enabled:i}),c=o(e,l);return(0,r.useApiV1InsurancePoliciesList)(c,{query:{...t?.query,queryKey:((e={},t,i)=>{let n=o(e,t);return[...(0,r.getApiV1InsurancePoliciesListQueryKey)(n),i??""]})(e,l,u?.impersonatedUserId),enabled:i&&(t?.query?.enabled??!0),placeholderData:e=>e},request:t?.request})}],281472);let l={limit:100};function c(e){let t=e.trim();return!(t.length<4||/\s/.test(t))&&/\.[a-z]{2,}$/i.test(t.replace(/\/+$/,""))}e.s(["useIndustriesQuery",0,function(e){return(0,r.useApiV1IndustriesList)(l,{...e,query:{staleTime:1/0,gcTime:1/0,...e?.query}})}],365414),e.i(298820);var d=e.i(130691),p=e.i(11936);
2let f={state:"idle",normalizedDomain:null,company:null,detail:"",willEnrich:!1};e.s(["useCompanyWebsitePreview",0,function(e,{enabled:t=!0}={}){let i=e.trim(),n=(0,p.useDebouncedValue)(i,250),s=function(e,{enabled:t=!0}={}){let i=e.trim();return(0,r.useApiEnrichmentCompanyPreviewList)({website:i},{query:{enabled:t&&c(i),retry:!1,staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1}})}(n,{enabled:t});if(!t||!c(i))return f;if(n!==i||s.isPending||s.isFetching)return{...f,state:"checking"};if(s.isError){let e=(0,d.isApiRequestError)(s.error)?s.error.status:null;return{...f,state:400===e?"invalid":"unavailable"}}let a=s.data;return a?{state:a.status,normalizedDomain:a.normalized_domain||null,company:a.company??null,detail:a.detail??"",willEnrich:"matched"===a.status}:{...f,state:"checking"}}],644161),e.s([],398106)},852603,773885,936707,e=>{"use strict";var t=e.i(197589);e.s(["useTimeSlots",0,function(e){return(0,t.useApiV1TimeSlotsList)({limit:50},{query:{enabled:e?.enabled??!0,staleTime:1/0,refetchOnReconnect:!1,refetchOnWindowFocus:!1}})}],773885),e.i(11936);var r=e.i(271645);e.s(["useInfiniteScroll",0,function(e){let{enabled:t=!0,hasNextPage:i=!1,isFetchingNextPage:n=!1,onLoadMore:s,root:a=null,rootMargin:u="240px 0px",threshold:o=0}=e,[l,c]=(0,r.useState)(null),d=(0,r.useCallback)(e=>{c(e)},[]),p=(0,r.useRef)(!1),f=(0,r.useEffectEvent)(()=>{t&&i&&!n&&!p.current&&(p.current=!0,s())});return(0,r.useEffect)(()=>{if(!t||!l||!i||n){p.current=!1;return}if("u"<typeof IntersectionObserver)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&f()},{root:a,rootMargin:u,threshold:o});return e.observe(l),()=>e.disconnect()},[t,i,n,a,u,l,o]),d}],936707),e.i(906049),e.i(876868),e.i(756202),e.s([],852603)},11936,e=>{"use strict";var t=e.i(271645);e.s(["useDebouncedValue",0,function(e,r=350){let[i,n]=(0,t.useState)(e);return(0,t.useEffect)(()=>{let t=window.setTimeout(()=>{n(e)},r);return()=>window.clearTimeout(t)},[r,e]),i}])},906049,e=>{"use strict";var t=e.i(271645);let r=e=>"matchMedia"in window&&"function"==typeof window.matchMedia?window.matchMedia(e):null;e.s(["MOBILE_MEDIA_QUERY",0,"(max-width: 767px)","useMediaQuery",0,function(e,i={}){let{defaultValue:n=!1}=i;return(0,t.useSyncExternalStore)(t=>{let i=r(e);return i?(i.addEventListener("change",t),()=>i.removeEventListener("change",t)):()=>void 0},()=>{let t=r(e);return t?t.matches:n},()=>n)}])},876868,e=>{"use strict";var t=e.i(271645);e.s(["useSessionValue",0,e=>(0,t.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("session-store-update",t),()=>window.removeEventListener("session-store-update",t)},e,e)])},556651,960554,881965,856128,559243,649392,637282,e=>{"use strict";var t=e.i(954616),r=e.i(266027),i=e.i(912598),n=e.i(197589);e.i(787129);var s=e.i(108526),a=e.i(162441);let u="supplier-availability-blocks";e.s(["useCreateSupplierAvailabilityBlock",0,function(e){let r=(0,i.useQueryClient)();return(0,t.useMutation)({mutationFn:t=>(0,n.apiV1SellerLocationsForSellerAvailabilityBlocksCreate)(e,t),onSuccess:()=>{r.invalidateQueries({queryKey:[u,e]})}})},"useDeleteSupplierAvailabilityBlock",0,function(e){let r=(0,i.useQueryClient)();return(0,t.useMutation)({mutationFn:t=>(0,n.apiV1SellerLocationsForSellerAvailabilityBlocksDestroy)(e,t),onSuccess:()=>{r.invalidateQueries({queryKey:[u,e]})}})},"useLocationAvailabilityBlocks",0,function(e,t,i){return(0,r.useQuery)({queryKey:["location-availability-blocks",e??""],enabled:!!e&&(i?.enabled??!0),queryFn:()=>(0,s.fetchLocationAvailabilityBlocks)(e)})},"useSupplierAvailabilityBlocks",0,function(e,t,i){let s=(0,a.useImpersonation)();return(0,r.useQuery)({queryKey:[u,e??"",t??{},s?.impersonatedUserId??""],enabled:!!e&&(i?.enabled??!0),queryFn:async()=>{let r=await (0,n.apiV1SellerLocationsForSellerAvailabilityBlocksList)(e,{from:t?.from,to:t?.to,limit:100});return Array.isArray(r)?r:r?.data??[]}})}],960554);var o=e.i(876868);let l=e=>("string"==typeof e?e.trim():"")||void 0;var c=e.i(54010),d=e.i(621482);e.s(["useInfiniteOrdersForSeller",0,function(e,t){let r=(0,a.useImpersonation)(),i=l((0,o.useSessionValue)(()=>
2c.sessionStore.getSelectedSellerId())),s={...e,seller:i};return(0,d.useInfiniteQuery)({queryKey:["infinite-orders-for-seller",...(0,n.getApiV1OrdersForSellerListQueryKey)(s),r?.impersonatedUserId??""],initialPageParam:void 0,queryFn:({pageParam:e,signal:t})=>(0,n.apiV1OrdersForSellerList)({...s,starting_after:e},void 0,t),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0},...t})},"useOrdersForSeller",0,function(e,t){let r=(0,a.useImpersonation)(),i=l((0,o.useSessionValue)(()=>c.sessionStore.getSelectedSellerId())),s={...e,seller:i};return(0,n.useApiV1OrdersForSellerList)(s,{query:{queryKey:[...(0,n.getApiV1OrdersForSellerListQueryKey)(s),r?.impersonatedUserId??""],placeholderData:e=>e,...t}})}],881965);var p=e.i(271645),f=e.i(253204),m=e.i(650782);e.i(839921);var y=e.i(55448);let h="customer.locations.all",g="customer.users.manage",S={canReadLocations:!0,canManageLocations:!0,canReadListings:!0,canManageListings:!0,canReadUsers:!0,canManageUsers:!0,locationScope:"all"},v={canReadLocations:!1,canManageLocations:!1,canReadListings:!1,canManageListings:!1,canReadUsers:!1,canManageUsers:!1,locationScope:"none"};function I(e){let t=new Set(e),r=t.has("customer.locations.all"),i=t.has("customer.locations.assigned"),n=t.has("customer.locations.all"),s=t.has("customer.locations.assigned")||t.has(h),a=t.has(h);return{canReadLocations:r||i||n,canManageLocations:n,canReadListings:s,canManageListings:a,canReadUsers:t.has("customer.users.read")||t.has(g),canManageUsers:t.has(g),locationScope:r?"all":i?"assigned":"none"}}let L=e=>new Set((e?.scope_options??[]).filter(e=>e.granted).map(e=>e.key));e.s(["getSellerLocationLinkPermissionPayload",0,function(e){let t=I(e);return{can_manage_listings:t.canManageListings,can_manage_location_details:t.canManageLocations}},"useSupplierPermissions",0,function(){let e=(0,f.useEffectiveUserGroupId)(),t=(0,m.useMe)({allowImpersonation:!0,userGroupId:e.effectiveUserGroupId}),r=(0,n.useApiV1RbacRolesList)(e.effectiveUserGroupId?{user_group:e.effectiveUserGroupId}:void 0,{query:{enabled:!!(t.data&&e.effectiveUserGroupId),retry:!1}}),i=(0,p.useMemo)(()=>{let e=t.data;if(!e)return v;if(e.is_staff||e.is_superuser)return S;let i=r.data??[],n=(0,y.toUserEntity)(e).roleId;if(!n)return v;let s=i.find(e=>e.id===n);return s?I(L(s)):v},[t.data,r.data]),s=(0,p.useMemo)(()=>{let e=new Map;return(r.data??[]).forEach(t=>{e.set(t.id,L(t))}),e},[r.data]);return{permissions:i,getRoleScopeKeys:e=>e?s.get(e)??new Set:new Set,isLoading:e.isLoading||t.isLoading||r.isLoading,isError:!!(t.isError||r.isError)}}],856128);let b=n.apiV1SellerLocationsForSellerList,A=n.getApiV1SellerLocationsForSellerListQueryKey,_=n.useApiV1SellerLocationsForSellerCreate,P=n.useApiV1SellerLocationsForSellerUpdate,w=n.useApiV1SellerLocationsAttachUpdate,U=n.useApiV1SellerLocationsDetachUpdate;e.s(["apiV1SupplierSellerLocationsList",0,b,"getSupplierSellerLocationsListQueryKey",0,A,"useAttachSupplierSellerLocationUser",0,w,"useCreateSupplierSellerLocation",0,_,"useDetachSupplierSellerLocationUser",0,U,"useSupplierSellerLocation",0,function(e,t,r){let i=(0,a.useImpersonation)();return(0,n.useApiV1SellerLocationsForSellerRetrieve)(e,t,{query:{queryKey:[...(0,n.getApiV1SellerLocationsForSellerRetrieveQueryKey)(e,t),i?.impersonatedUserId??""],placeholderData:e=>e,...r?.query},request:r?.request})},"useSupplierSellerLocations",0,function(e,t){let r=(0,a.useImpersonation)();return(0,n.useApiV1SellerLocationsForSellerList)(e,{query:{queryKey:[...(0,n.getApiV1SellerLocationsForSellerListQueryKey)(e),r?.impersonatedUserId??""],placeholderData:e=>e,...t?.query},request:t?.request})},"useUpdateSupplierSellerLocation",0,P],559243);let E=(e,t)=>({...e,seller:e.seller?.length?e.seller:t?[t]:void 0});e.s(["useInfiniteSellerProductSellerLocations",0,function(e,t=!0){let r=(0,a.useImpersonation)(),i=E(e,l((0,o.useSessionValue)(()=>c.sessionStore.getSelectedSellerId()))),s=[...(0,n.getApiV1SellerProductSellerLocationsListQueryKey)(i),r?.impersonatedUserId??""];return(0,d.useInfiniteQuery)({queryKey:s,enabled:t,placeholderData:e=>e,initialPageParam:void 0,queryFn:({pageParam:e,signal:t})=>(0,n.apiV1SellerProductSellerLocationsList)({...i,starting_after:e},void 0,t),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0}})},"useSellerProductSellerLocations",0,function(e,t){let r=(0,a.useImpersonation)(),i=E(e,l((0,o.useSessionValue)(()=>
2c.sessionStore.getSelectedSellerId())));return(0,n.useApiV1SellerProductSellerLocationsList)(i,{query:{queryKey:[...(0,n.getApiV1SellerProductSellerLocationsListQueryKey)(i),r?.impersonatedUserId??""],...t}})}],649392),e.s(["useInfiniteSellers",0,function(e,t=!0){let r=(0,a.useImpersonation)(),i=(0,d.useInfiniteQuery)({queryKey:[...(0,n.getApiV1SellersListQueryKey)(e),r?.impersonatedUserId??""],enabled:t,initialPageParam:void 0,queryFn:({pageParam:t,signal:r})=>(0,n.apiV1SellersList)({...e,starting_after:t},void 0,r),getNextPageParam:e=>{if(!e?.has_more)return;let t=e.data??[];return t[t.length-1]?.id??void 0}}),s=(0,p.useMemo)(()=>i.data?.pages.flatMap(e=>e.data??[])??[],[i.data?.pages]),u=i.data?.pages[0]?.count??0;return{...i,sellers:s,totalCount:u}},"useSellers",0,function(e,t=!0){let r=(0,a.useImpersonation)();return(0,n.useApiV1SellersList)(e,{query:{queryKey:[...(0,n.getApiV1SellersListQueryKey)(e),r?.impersonatedUserId??""],enabled:t}})}],637282),e.i(906765),e.s([],556651)},906765,668569,e=>{"use strict";var t=e.i(376572),r=e.i(162441),i=e.i(650782),n=e.i(876868);e.i(839921);var s=e.i(55448),a=e.i(54010),u=e.i(843476),o=e.i(271645);let l=(0,o.createContext)(null);function c(){return(0,o.useContext)(l)}e.s(["EffectiveSellerOverrideProvider",0,function({sellerId:e,children:t}){let r=(0,o.useMemo)(()=>("string"==typeof e?e.trim():"")||null,[e]);return(0,u.jsx)(l.Provider,{value:r,children:t})},"useEffectiveSellerOverride",0,c],668569);let d=e=>("string"==typeof e?e.trim():"")||null;e.s(["useEffectiveSellerId",0,function(e){let{isStaff:u}=(0,t.useCurrentUser)(),{impersonatedUserId:o}
2=(0,r.useImpersonation)(),l=c(),p=(0,n.useSessionValue)(()=>a.sessionStore.getSelectedSellerId()),f=(0,i.useMe)({allowImpersonation:!0,enabled:e?.enabled}),m=f.data?(0,s.toUserEntity)(f.data):null,y=m?.userGroupExpanded?.sellerId??null,h=u&&!o;return{effectiveSellerId:d(l)??(h?d(p)??d(y)??null:d(y)??null),selectedSellerId:d(l??p),meSellerId:d(y),canSelectSeller:h,isLoading:f.isLoading,isError:f.isError,refetchMe:()=>{f.refetch()}}}],906765)},540259,911860,e=>{"use strict";function t(e){return(t="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)}var r,i="dahlia",n="https://js.stripe.com",s="".concat(n,"/").concat(i,"/stripe.js"),a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,u=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,o=function(){for(var e=document.querySelectorAll('script[src^="'.concat(n,'"]')),t=0;t<e.length;t++){var r,i=e[t];if(r=i.src,a.test(r)||u.test(r))return i}return null},l=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(s).concat(t);var i=document.head||document.body;if(!i)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(r),r},c=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.5.0",startTime:t})},d=null,p=null,f=null,m=function(e,r,n){if(null===e)return null;var s,a=r[0];if("string"!=typeof a)throw Error("Expected publishable key to be of type string, got type ".concat(t(a)," instead."));var u=a.match(/^pk_test/),o=3===(s=e.version)?"v3":s;u&&o!==i&&console.warn("Stripe.js@".concat(o," was loaded on the page, but @stripe/stripe-js@").concat("9.5.0"," expected Stripe.js@").concat(i,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var l=e.apply(void 0,r);return c(l,n),l},y=!1,h=function(){return r||(r=(null!==d?d:(d=new Promise(function(e,t){if("u"<typeof window||"u"<typeof document)return void e(null);if(window.Stripe,window.Stripe)return void e(window.Stripe);try{var r,i=o();i?i&&null!==f&&null!==p&&(i.removeEventListener("load",f),i.removeEventListener("error",p),null==(r=i.parentNode)||r.removeChild(i),i=l(null)):i=l(null),f=function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))},p=function(e){t(Error("Failed to load Stripe.js",{cause:e}))},i.addEventListener("load",f),i.addEventListener("error",p)}catch(e){t(e);return}})).catch(function(e){return d=null,Promise.reject(e)})).catch(function(e){return r=null,Promise.reject(e)}))};Promise.resolve().then(function(){return h()}).catch(function(e){y||console.warn(e)}),e.s(["loadStripe",0,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];y=!0;var i=Date.now();return h().then(function(e){return m(e,t,i)})}],911860),e.s([],540259)},621482,e=>{"use strict";var t=e.i(469637),r=e.i(992571),i=e.i(869230),n=class extends i.QueryObserver{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:i}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:u,isRefetchError:o}=n,l=i.fetchMeta?.fetchMore?.direction,c=u&&"forward"===l,d=s&&"forward"===l,p=u&&"backward"===l,f=s&&"backward"===l;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,r.hasNextPage)(t,i.data),hasPreviousPage:(0,r.hasPreviousPage)(t,i.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:p,isFetchingPreviousPage:f,isRefetchError:o&&!c&&!p,isRefetching:a&&!d&&!f}}};e.s(["useInfiniteQuery",0,function(e,r){return(0,t.useBaseQuery)(e,n,r)}
2],621482)},787129,383498,538691,108526,860378,266620,66237,e=>{"use strict";e.i(839921);var t=e.i(197589),r=e.i(5740),i=e.i(884567);function n(e,t=new Date){let r=o(t),i=e.hasRemovalDate&&!e.hasRentalTwoStep?28:0;return{startDate:a(r),endDate:a(u(r,i))}}function s(e){return e?(0,i.parseDateOnlyToLocalDate)(e):null}function a(e){return(0,i.formatLocalDateToDateOnly)(e)}function u(e,t){let r=new Date(e);return r.setDate(r.getDate()+t),r}function o(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function l(e){let t=(0,r.toSellerProductSellerLocationEntity)(e.spsl).sellerLocationExpanded,i=t?.sellerExpanded;return i?.name??t?.name??""}e.s(["resolveSupplierPricingDates",0,n,"resolveSupplierSelectionDates",0,function(e){let t=s(e.startDate)??s(e.jobSite?.estimated_start_date??null),r=s(e.endDate)??s(e.jobSite?.estimated_end_date??null),i=t,n=r;if(!i&&!n){let e=new Date;i=e,n=u(e,28)}i&&!n&&(n=u(i,28)),!i&&n&&(i=u(n,-28)),i||(i=new Date),n||(n=u(i,28)),n<=i&&(n=u(i,1));let l=e.earliestStartDate??null;if(l&&o(i)<o(l)){var c,d;let e,t=(c=o(l),d=o(i),Math.round(((e=e=>Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))(c)-e(d))/864e5));i=o(l),n=u(n,t)}return{startDate:a(i),endDate:a(n)}}],383498);let c=async e=>{let r=new Map;if(0===e.length)return r;let i=await Promise.all(e.map(async e=>{try{return await (0,t.apiV1SellerProductSellerLocationsRetrieve)(e,{"expand[]":["product","seller_location.seller"]})}catch{return null}}));for(let t=0;t<e.length;t++){let n=i[t];n?.id&&r.set(e[t],n)}return r};async function d(e){let r={product:e.productId,latitude:e.latitude,longitude:e.longitude,waste_type:e.wasteTypeId??null,start_date:e.startDate,end_date:e.endDate,...null!=e.timesPerWeek?{times_per_week:e.timesPerWeek}:{}},i=await (0,t.matchingEngineV1SellerProductSellerLocationsByLatLongCreate)(r),n=Array.isArray(i)?i:i?.results??i?.data??[],s=e=>{let t=e.seller_product_seller_location_id??e.sellerProductSellerLocationId??e.id??null;return t?{spslId:t,distanceMiles:e.distance_miles??e.distanceMiles??null,ranking:e.ranking??null}:null},a=new Map;for(let e of n){let t=s(e);t&&(a.has(t.spslId)||a.set(t.spslId,t))}let u=Array.from(a.values()),o=await c(u.map(e=>e.spslId)),l=u.filter(t=>{let r=o.get(t.spslId);return!r||!1!==e.isDelivery||!!r.allows_pick_up}).map(e=>({id:e.spslId,spsl:o.get(e.spslId)??{id:e.spslId},pricing:null,insights:null,total:null,distanceMiles:e.distanceMiles,ranking:e.ranking??null})),d=(e,t)=>{let r=e.ranking?.score??-1;return(t.ranking?.score??-1)-r},p=l.filter(e=>e.ranking?.tier==="recommended").sort(d),f=l.filter(e=>e.ranking?.tier==="alternative").sort(d),m=l.filter(e=>e.ranking?.tier==="unavailable").sort(d);return{results:p.length>0?[...p,...f]:[...f],recommended:p.length>0?p:f,alternatives:p.length>0?f:[],unavailable:m,marketInsights:null}}async function p(e){if(e.endDate&&e.startDate>e.endDate)throw Error("Invalid date range: startDate must be <= endDate");let r={seller_product_seller_location:e.sellerProductSellerLocationId,waste_type:e.wasteTypeId??null,start_date:e.startDate,end_date:e.endDate,is_pickup:e.isPickup??!1,...null!=e.timesPerWeek?{times_per_week:e.timesPerWeek}:{},...null!=e.shiftCount?{shift_count:e.shiftCount}:{}};return e.userAddressId?(0,t.pricingEngineV1SellerProductSellerLocationPricingCreate)({...r,user_address:e.userAddressId}):null!=e.latitude&&null!=e.longitude?(0,t.pricingEngineV1SellerProductSellerLocationPricingByLatLongCreate)({...r,latitude:e.latitude,longitude:e.longitude}):null}async function f(e){if(!e.userAddressId||!e.productId)return null;let r=n({hasRemovalDate:!!e.hasRemovalDate,hasRentalTwoStep:!!e.hasRentalTwoStep});try{return await (0,t.pricingEngineV1SupplierInsightsCreate)({product:e.productId,user_address:e.userAddressId,waste_type:e.wasteTypeId??null,start_date:r.startDate,end_date:r.endDate,...null!=e.timesPerWeek?{times_per_week:e.timesPerWeek}:{},...null!=e.shiftCount?{shift_count:e.shiftCount}:{}})}catch{return null}}async function m(e){return(await (0,t.apiV1SellerLocationsRetrieve)(e,{"expand[]":["availability_blocks"]})).availability_blocks??[]}e.s(["fetchSpslsByIds",0,c,"fetchSupplierInsights",0,f,"fetchSupplierSelectionPricing",0,p,"fetchSupplierSelectionResults",0,d,"getSupplierSelectionQueryKey",0,e=>["supplier-selection",e.productId,e.userAddressId??"",e.latitude,e.longitude,e.startDate,e.endD
2ate,e.hasRemovalDate,e.hasRentalTwoStep,e.wasteTypeId??"",e.timesPerWeek??null,e.shiftCount??null,e.isDelivery??!0],"preserveSupplierSelectionPricing",0,function(e,t){if(!e)return t;let r=new Map(e.results.map(e=>[e.id,e])),i=e=>{let t=r.get(e.id);return null===e.pricing&&t?.pricing?{...e,pricing:t.pricing,total:t.total}:e};return{...t,results:t.results.map(i),recommended:t.recommended.map(i),alternatives:t.alternatives.map(i)}},"sortSupplierResults",0,function(e,t,r){let i=[...e].sort((e,r)=>(function(e,t,r){switch(r){case"distance":return(e.distanceMiles??1/0)-(t.distanceMiles??1/0);case"name":return l(e).localeCompare(l(t));case"recommended":return(t.ranking?.score??-1)-(e.ranking?.score??-1);default:return(e.total??1/0)-(t.total??1/0)}})(e,r,t));return"desc"===r&&i.reverse(),i}],538691),e.s(["expandBlockedDays",0,function(e,t){let r=new Set,i=new Map;if(!e?.length)return{days:r,reasonByDay:i};let n=e=>{let t=e.getFullYear(),r=`${e.getMonth()+1}`.padStart(2,"0"),i=`${e.getDate()}`.padStart(2,"0");return`${t}-${r}-${i}`},s=e=>{let[t,r,i]=e.split("-").map(Number);return new Date(t,(r??1)-1,i??1)};for(let a of e){let e=s(a.start_date),u=a.end_date?s(a.end_date):e;for(let s=new Date(e);s<=u;s.setDate(s.getDate()+1)){if(t?.from&&s<t.from||t?.to&&s>t.to)continue;let e=n(s);r.add(e),i.has(e)||i.set(e,a.reason??null)}}return{days:r,reasonByDay:i}},"fetchLocationAvailabilityBlocks",0,m],108526),e.i(884638);let y=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function h(e){if(null==e||""===e)return"--";let t="string"==typeof e?Number(e):e;return Number.isFinite(t)?y.format(t):String(e)}function g(e){if(!e)return null;let t=e.breakdown?.rental,r=e.rental,i=e.material,n=e.service,s=S(e.breakdown?.other)??(r?.included_days!=null&&null!=r.per_included_days&&i?.included_tons!=null&&null!=i.per_included_tons?r.included_days*r.per_included_days+i.included_tons*i.per_included_tons+(n?.total??0):null),a=v(n?.items),u=(t?.month?.base??0)+(a??0),o=!!r?.included_days,l=!!i?.included_tons,c=o&&l,d=!c&&!!(t?.day||t?.week);return c?{kind:"swap",perSwap:s}:d?{kind:"equipment",day:t?.day?.base??null,week:t?.week?.base??null,month:u||(t?.month?.base??null)}:{kind:"service",perUnitMonth:S(e.breakdown?.other)??v(r?.items)??a}}function S(e){return e?Object.entries(e).reduce((e,[t,r])=>"total"===t||"number"!=typeof r?e:e-r,e.total):null}function v(e){return e?.find(e=>e.description?.trim().toLowerCase()==="included"&&null!==e.unit_price)?.unit_price??e?.find(e=>null!==e.unit_price)?.unit_price??null}e.s(["formatCurrency",0,h,"formatDistance",0,function(e){return null!=e&&Number.isFinite(e)?`${e.toFixed(1)} mi`:""}],860378),e.s(["getSupplierPriceDisplay",0,g],266620);let I="__none__";async function L(e){let r=new Map,{relatedMainProductIds:i,sellerLocationId:n}=e;return n&&0!==i.length&&await Promise.all(i.map(async e=>{try{let i=await (0,t.apiV1SellerProductSellerLocationsList)({main_product:e,seller_location:[n],limit:1,"expand[]":["product","seller_location.seller"]}),s=(i?.data??[]).find(e=>e?.id);s?.id&&r.set(e,s)}catch{}})),r}async function b(e){let t=new Map,{resolvedOptions:r,startDate:i,endDate:n}=e;return 0!==r.length&&i&&n&&await Promise.all(r.map(async r=>{try{let s=await p({sellerProductSellerLocationId:r.spslId,userAddressId:e.userAddressId??null,latitude:e.latitude??null,longitude:e.longitude??null,startDate:i,endDate:n,isPickup:e.isPickup??!1});t.set(r.mainProductId,{estimatedTotal:s?.total??null,priceDisplay:g(s),pricingSnapshotToken:s?.pricing_snapshot_token??null})}catch{t.set(r.mainProductId,{estimatedTotal:null,priceDisplay:null,pricingSnapshotToken:null})}})),t}async function A(e){if(!e)return[];try{let r=await (0,t.apiV1MainProductsList)({parent_product:e,limit:100});return(r?.data??[]).filter(e=>!!e?.id&&e?.is_deleted!==!0).map(e=>e.id)}catch{return[]}}e.s(["ATTACHMENT_ANALYTICS_PROPS",0,{isAttachment:"is_attachment",parentProduct:"parent_product"},"NO_ATTACHMENT_ID",0,I,"buildResolvedAttachmentOptions",0,function(e,t){let r=[];for(let i of e){let e=t.get(i.mainProductId);e?.id&&r.push({...i,spsl:e,spslId:e.id})}return r},"buildSupplierAttachmentAvailabilityRequests",0,function(e,t){if(0===t.length)return[];let i=[],n=new Set;for(let t of e){let e=(0,r.toSellerProductSellerLocationEntity)(t.spsl).sellerLocationId;!e||n.has(t.id)||(n.add(t.id),i.push({resultId:t.id,sellerLocationId:e}))}return i},"fetchAttachmentPricing",0,b,"fetchAttachmentSupplierSpsls",0,L,"fetchProductAttachmentIds",0,A,"formatAttachmentCostLabel",0,function(e){let t=e.priceDisplay;
2if(t?.kind==="swap"&&null!==t.perSwap)return`${h(t.perSwap)} per swap`;if(t?.kind==="service"&&null!==t.perUnitMonth)return`${h(t.perUnitMonth)} per unit / month`;if(t?.kind==="equipment"){let e=[[t.day,"day"],[t.week,"week"],[t.month,"month"]].filter(e=>null!==e[0]).map(([e,t])=>`${h(e)}/${t}`);if(e.length>0)return e.join(" · ")}return"Priced at checkout"},"getAttachmentPricingQueryKey",0,e=>["attachment-pricing",e.userAddressId??"",e.latitude??null,e.longitude??null,e.startDate,e.endDate,e.isPickup??!1,e.resolvedOptions.map(e=>e.spslId).sort().join(",")],"getAttachmentSpslQueryKey",0,e=>["attachment-supplier-spsls",e.sellerLocationId,[...e.relatedMainProductIds].sort().join(",")],"getProductAttachmentIdsQueryKey",0,e=>["product-attachment-ids",e],"mergeAttachmentPricing",0,function(e,t){return 0===t.size?e:e.map(e=>t.has(e.mainProductId)?{...e,...t.get(e.mainProductId)}:e)},"resolveAttachmentOptions",0,function(e){return(e?.related_products??[]).filter(e=>!!e?.id&&e?.is_deleted!==!0).map(e=>({mainProductId:e.id,name:e.name?.trim()||"Attachment",imageUrl:e.images?.[0]??void 0}))},"resolveEffectiveAttachmentId",0,function(e,t){return null!=t&&t!==I&&e.some(e=>e.mainProductId===t)?t:I}],66237),e.s([],787129)}]); 3 4//# debugId=ebbb2837-68d3-3c8f-0fbf-09b99c4de542
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.