1var Cr=Object.defineProperty;var wr=(t,r,o)=>r in t?Cr(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o;var De=(t,r,o)=>wr(t,typeof r!="symbol"?r+"":r,o);import{r as a,f as B,j as e,b as i,u as xe,a as Sr,F as z,L as G,R as ne,y as vr,H as Ir,Z as _r}from"./constants-C8rvLH7q.js";import{F as ue}from"./FMThemeSection-Cpz2OSne.js";import{O as We,P as Ar}from"./events-ltDbVrs0.js";import{bk as Er,bl as V,bm as K,bz as Je,bA as Fr,bp as Pr,bq as Tr,br as kr,ct as Mr,cu as Nr,bu as Lr,bD as vt,bE as It,bF as _t,aZ as Or,H as D,E as g,af as Me,n as f,cv as Rr,cw as Dr,cx as Br,a1 as et,f as ee,cy as dt,e as tt,b9 as He,k as At,ag as rt,B as b,I as Ee,cz as Ur,ai as Fe,c4 as Zr,be as Et,$ as k,a0 as ot,v as Ne,cA as Wr,u as ce,cB as Hr,cC as Ft,bZ as Pt,c0 as Tt,c1 as kt,bY as Mt,c2 as Nt,bW as Lt,y as N,ae as qr,D as L,a5 as Le,aj as q,ak as Pe,C as nt,aR as zr,m as Vr,bX as jr,b_ as $r,b$ as Gr,cD as Kr,cE as Yr,cF as Qr,cG as Xr}from"./index-CHlGMo7V.js";import{o as pt}from"./MagnifyingGlass.es-CHWgKdF2.js";import{u as Ot}from"./useRequestCart-DbRzSBTl.js";import{l as Jr}from"./logger-Bhqlyh9V.js";import{F as eo}from"./tagManagerEvents-DnaytZ8K.js";import{S as to}from"./Filmsupply-BStqok4q.js";import{s as qe,f as ro}from"./utils-Cj06VYpg.js";import{b as Rt}from"./utils-D3gjncAQ.js";import{w as oo}from"./theme-Bkxm8nOX.js";import{u as Dt,a as no,r as ao,A as io,C as lo}from"./utils-ByohjgLt.js";import{u as so}from"./userAbilities-D2YBbUkJ.js";import{u as Bt}from"./useCurrentWorkspace-CSw4X_Ny.js";import{u as Ut}from"./useFeatureFlag-CPiGF0uB.js";import{f as Be,g as Ue,d as se,h as Ze,M as ze,a as Ve,b as je,c as $e}from"./menu-BOP1BuzU.js";import{a as co}from"./useWorkspaceOverview-DX6cKaVg.js";import{n as Zt}from"./ShoppingCartSimple.es-CxuF5Hhq.js";import{C as po,S as Ge,Z as Ke,N as uo}from"./NotificationModalContent-DNEh-PQK.js";import{D as Wt}from"./index-Dsfo69d_.js";import{D as Oe}from"./constants-BwRvMAMv.js";import{e as mo}from"./CaretRight.es-Bkgx0sxl.js";import{N as ho,u as Ye}from"./index-BLEG6TI_.js";import{b as Ce,C as re,u as Ht,e as go}from"./index.esm-D6bPm7cf.js";import{u as de}from"./useMutation-B0g3ZAxu.js";import{A as fo,a as bo}from"./AuthForm-Dw2_tCWG.js";import{b as me,c as T,f as yo}from"./index.esm-Cib_o6_p.js";import{o as we}from"./yup-DT_F9qTt.js";import{o as be,g as xo,c as Co,d as wo,e as So,i as vo,u as Io}from"./GoogleIdentityProvider-CWQEG0ft.js";import{a as _o,f as Ao}from"./errors-DJ1GzgIs.js";import{o as Eo}from"./PencilSimple.es-FCsBMuru.js";import{c as ut,d as Fo,I as Po,M as To,b as ko,E as Mo}from"./ErrorModal-BD-z5cc9.js";import{a as No,u as Lo}from"./useEditWorkspaceAvatar-4QmU3GJG.js";import{c as he}from"./utils-c2TaxgYo.js";import{i as Oo,b as Ro,a as Do}from"./useEditProfileAvatar--c8MgVAC.js";import{A as Bo}from"./AddressField-DUVkGjiu.js";import{I as Uo,n as Zo,u as Wo,c as Ho,N as qo}from"./utils-Cs5fvUEz.js";import{T as zo}from"./constants-BpslzTR9.js";import{e as mt}from"./CaretDown.es-D42zrN2G.js";import{a as Vo,b as jo,s as $o}from"./browserStorage-CZvh8smI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"[email protected]"};var r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="669e738c-cda5-4d55-84d0-d7d4912fb5f6",t._sentryDebugIdIdentifier="sentry-dbid-669e738c-cda5-4d55-84d0-d7d4912fb5f6")}catch{}})();const[qt,Y]=Er({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"}
1),zt=a.forwardRef((t,r)=>{const o=Y(),n=V(o.getAnchorProps(),t);return B.jsx(K.div,{...n,ref:r})});zt.displayName="PopoverAnchor";const Vt=a.forwardRef((t,r)=>{const o=Y(),n=V(o.getArrowProps(),t);return B.jsx(K.div,{...n,ref:r})});Vt.displayName="PopoverArrow";const jt=a.forwardRef((t,r)=>{const o=Y(),n=V(o.getArrowTipProps(),t);return B.jsx(K.div,{...n,ref:r})});jt.displayName="PopoverArrowTip";const $t=a.forwardRef((t,r)=>{const o=Y(),n=V(o.getCloseTriggerProps(),t);return B.jsx(K.button,{...n,ref:r})});$t.displayName="PopoverCloseTrigger";const Gt=a.forwardRef((t,r)=>{const o=Y(),n=Je(),l=V(o.getContentProps(),n.getPresenceProps(),t);return n.unmounted?null:B.jsx(K.div,{...l,ref:Fr(n.ref,r)})});Gt.displayName="PopoverContent";const Kt=a.forwardRef((t,r)=>{const o=Y(),n=V(o.getDescriptionProps(),t);return B.jsx(K.div,{...n,ref:r})});Kt.displayName="PopoverDescription";const Yt=a.forwardRef((t,r)=>{const o=Y(),n=V(o.getIndicatorProps(),t);return B.jsx(K.div,{...n,ref:r})});Yt.displayName="PopoverIndicator";const Qt=a.forwardRef((t,r)=>{const o=Y(),n=Je(),l=V(o.getPositionerProps(),t);return n.unmounted?null:B.jsx(K.div,{...l,ref:r})});Qt.displayName="PopoverPositioner";const Go=t=>{const r=a.useId(),{getRootNode:o}=Pr(),{dir:n}=Tr(),l={id:r,dir:n,getRootNode:o,...t},c=kr(Mr,l);return Nr(c,Lr)},Ko=t=>{const[r,{children:o,...n}]=vt(t),l=Go(n),c=It(V({present:l.open},r));return B.jsx(qt,{value:l,children:B.jsx(_t,{value:c,children:o})})},Yo=t=>{const[r,{value:o,children:n}]=vt(t),l=It(V({present:o.open},r));return B.jsx(qt,{value:o,children:B.jsx(_t,{value:l,children:n})})},Xt=a.forwardRef((t,r)=>{const o=Y(),n=V(o.getTitleProps(),t);return B.jsx(K.div,{...n,ref:r})});Xt.displayName="PopoverTitle";const Jt=a.forwardRef((t,r)=>{const o=Y(),n=Je(),l=V({...o.getTriggerProps(),"aria-controls":n.unmounted?void 0:o.getTriggerProps()["aria-controls"]},t);return B.jsx(K.button,{...l,ref:r})});Jt.displayName="PopoverTrigger";const{withRootProvider:er,withContext:H}=Or({key:"popover"});er(Yo);const Qo=er(Ko),Xo=H(Jt,"trigger",{forwardAsChild:!0}),Jo=H(Qt,"positioner",{forwardAsChild:!0}),en=H(Gt,"content",{forwardAsChild:!0}),tn=H(jt,"arrowTip",{forwardAsChild:!0});H(Vt,"arrow",{forwardAsChild:!0,defaultProps:{children:B.jsx(tn,{})}});H($t,"closeTrigger",{forwardAsChild:!0});H(Yt,"indicator",{forwardAsChild:!0});H(Xt,"title",{forwardAsChild:!0});H(Kt,"description",{forwardAsChild:!0});H("footer","footer");H("header","header");const rn=H("div","body");H(zt,void 0,{forwardAsChild:!0});const Te={LOCAL:"(800) 805-6802",HREF:"tel:+1-800-805-6802",WITH_COUNTRY_CODE:"+1 800-805-6802"},on={ADDRESS:"[email protected]",HREF:"mailto:[email protected]"},Ae=({href:t,children:r,onClick:o})=>e(D,{fontSize:10,fontWeight:600,letterSpacing:"0.18px",textTransform:"uppercase",color:"white",textDecoration:"none",transition:"color 0.6s ease",_groupHover:{color:"gray.400"},_hover:{"&&&":{color:"white"}},target:"_blank",href:t,onClick:o,children:r}),ht=()=>e(g,{_groupHover:{backgroundColor:"gray.400"},height:10,width:"0.5px",backgroundColor:"white",margin:"0 8px",transition:"background-color 0.6s ease"}),nn=()=>i(f,{position:"relative",zIndex:1e4,width:"100%",height:Me.BRANDS_NAV_BAR,justifyContent:{base:"center",lg:"space-between"},padding:{base:"0 24px"},backgroundColor:"gray.900",children:[i(f,{alignItems:"center",className:"group",children:[e(Ae,{href:Rr,onClick:()=>We("musicbed","header"),children:"Musicbed"}),e(ht,{}),e(Ae,{href:Dr,children:"Filmsupply"}),e(ht,{}),e(Ae,{href:Br,onClick:()=>We("stills","header"),children:"Stills"})]}),i(f,{alignItems:"center",className:"group",display:{base:"none",lg:"flex"},gap:"20px",children:[e(D,{fontSize:10,lineHeight:"12px",color:"white",textDecoration:"none",transition:"color 0.6s ease",_hover:{"&&&":{color:"white"}},_groupHover:{color:"gray.400"},fontWeight:600,href:"/contact",children:"Contact Us"}),e(Ae,{href:Te.HREF,children:Te.LOCAL})]})]}),an=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),a.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),ln=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.8
16,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z",opacity:"0.2"}),a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z"}))]]),sn=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z",opacity:"0.2"}),a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z"}))]]),tr=a.forwardRef((t,r)=>a.createElement(et,{ref:r,...t,weights:an}));
1tr.displayName="CheckCircleIcon";const cn=tr,rr=a.forwardRef((t,r)=>a.createElement(et,{ref:r,...t,weights:ln}));rr.displayName="MoonIcon";const dn=rr,or=a.forwardRef((t,r)=>a.createElement(et,{ref:r,...t,weights:sn}));or.displayName="SunIcon";const pn=or,un=()=>{const{user:t,setUserCache:r}=ee(),{pathname:o}=xe();return{setTheme:async(l,c=Rt)=>{if(["/clips","/account/licenses"].includes(o)){(await dt({theme:l})).success&&(oo(l),window.location.reload());return}t&&r({...t,theme:l}),c(),localStorage.setItem("theme",l),await dt({theme:l})}}},mn=()=>{const t=tt(),{user:r}=ee(),{setTheme:o}=un(),n=c=>{(r==null?void 0:r.theme)!==c&&o(c,()=>{t.setQueryData(At.getUser.queryKey,s=>({...s,theme:c}))})},l=(r==null?void 0:r.theme)==="dark";return i(f,{alignItems:"center",gap:"8px",padding:"8px",children:[e(He,{flex:1,height:"32px",width:"32px",padding:6,_dark:{color:"white",backgroundColor:"transparent",_hover:{background:"button.secondary.hover"}},_light:{color:"amber.500",backgroundColor:"amber.50"},onClick:()=>n("light"),children:e(pn,{weight:"fill"})}),e(He,{flex:1,height:"32px",width:"32px",padding:6,_light:{color:"icon.primary",background:"none",_hover:{background:"button.secondary.hover"}},_dark:{color:"blue.500",backgroundColor:"whiteAlpha.5"},onClick:()=>n("dark"),children:e(dn,{weight:l?"fill":"regular"})})]})},J=({children:t,to:r,dataTestId:o})=>e(se,{asChild:!0,value:r,children:e(D,{width:"full",textDecoration:"none",textStyle:"UI.14.reg",asChild:!0,title:"","data-testid":o,children:e(G,{to:r,children:t})})}),gt=()=>{const t=Sr(),r=xe(),{user:o}=ee(),{logout:n,masqueradeLogout:l}=Dt(),c=Ut("editfest"),{data:s}=so({enabled:!!o}),d=!!(s!=null&&s.can_access_admin),p=!!(s!=null&&s.can_access_payout_settings),h=!!(s!=null&&s.can_access_footage_manager),S=!!(s!=null&&s.can_view_workspace_settings),{data:u}=no(),{data:m,handleSetCurrentWorkspace:y}=Bt({onSuccess:()=>{ao({navigate:t,pathname:r.pathname})}}),_=()=>{n()},I=()=>{l(),n()},x=C=>{C!==(m==null?void 0:m.id)&&y(C)};return i(z,{children:[i(Be,{children:[e(Ue,{children:"Workspaces"}),u==null?void 0:u.map(C=>e(se,{value:C.owner_email,onClick:()=>x(C.id),children:i(f,{flexDirection:"row",alignItems:"center",children:[e(rt,{size:"md",name:C.name,src:qe(C.avatar_url)??void 0,selected:C.id===(m==null?void 0:m.id)},qe(C.avatar_url)),i(f,{flexDirection:"column",align:"start",gap:"0px",ml:"12px",children:[e(b,{textStyle:"paragraph.14.reg",children:C.name}),e(b,{textStyle:"paragraph.12.reg",color:"text.secondary",mt:"-2px",children:C.owner_email})]})]})},`${C.owner_email}-${C.id}`))]}),e(Ze,{}),i(Be,{children:[e(Ue,{children:"Workspace"}),e(J,{to:"/workspace/overview",dataTestId:"account-menu-overview",children:"Overview"}),S&&i(z,{children:[e(J,{to:"/workspace/billing",dataTestId:"account-menu-billing",children:"Billing"}),e(J,{to:"/workspace/orders",dataTestId:"account-menu-orders",children:"Orders"}),e(J,{to:"/workspace/preferred-rates",dataTestId:"account-menu-preferred-rates",children:"Preferred Rates"}),e(J,{to:"/workspace/team",dataTestId:"account-menu-team",children:"Team"})]}),c&&e(J,{to:"/workspace/editfest",children:"Editfest"})]}),e(Ze,{}),i(Be,{children:[e(Ue,{children:"Profile"}),e(J,{to:"/profile/settings",dataTestId:"account-menu-settings",children:"Settings"}),e(J,{to:"/profile/notifications",dataTestId:"account-menu-notifications",children:"Notifications"}),h?e(se,{asChild:!0,value:"artist-dashboard",children:e(D,{width:"full",textDecoration:"none",textStyle:"paragraph.14.reg",target:"_top",href:io,children:"Artist Dashboard"})}):null,p?e(se,{asChild:!0,value:"artist-payout",children:e(D,{width:"full",textDecoration:"none",textStyle:"paragraph.14.reg",target:"_top",href:lo,children:"Payouts"})}):null,d?e(se,{asChild:!0,value:"admin-portal",children:e(D,{width:"full",textDecoration:"none",textStyle:"paragraph.14.reg",target:"_blank",href:"https://admin.filmsupply.com",children:"Admin Portal"})}):null,e(J,{to:"/contact",children:"Contact us"}),e(se,{asChild:!0,value:"logout",children:o!=null&&o.masquerade?i(g,{role:"button",display:"inline-block",width:"full",textStyle:"paragraph.14.reg",justifyContent:"flex-start",cursor:"pointer",onClick:I,color:"purple",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:[e(Ee,{marginInline:0,marginRight:"4px",children:e(Ur,{})}),o.masquerade.client_username]}):e(g,{role:"button",width:"full",textStyle:"paragraph.14.reg",justifyContent:"flex-start",cursor:"pointer",onClick:_,"data-testid":"logout-button",children:"Logout"})})]}),e(Ze,{}),e(mn,{})]})}
1,ft=({size:t})=>{const{data:r}=Bt(),{data:o}=co({enabled:!!(r!=null&&r.id)}),n=[r==null?void 0:r.avatar_url,o==null?void 0:o.avatar_url].map(qe).find(Boolean),l=[r==null?void 0:r.name,o==null?void 0:o.name].map(s=>s==null?void 0:s.trim()).find(Boolean),c={size:t,...l?{name:l}:{},...n?{src:n}:{}};return Zr(rt,{...c,key:n,"data-testid":"user-avatar"})},hn=()=>i(g,{padding:"0 8px",position:"relative",children:[e(g,{display:{base:"none",md:"initial"},children:i(ze,{workspace:!0,children:[e(Ve,{asChild:!0,children:e(g,{"aria-label":"Open account menu",role:"button","data-testid":"account-menu-button",children:e(ft,{size:"md"})})}),e(Fe,{children:e(je,{children:e($e,{children:e(ue,{children:e(gt,{})})})})})]})}),e(g,{position:"relative",display:{base:"flex",md:"none"},children:i(ze,{workspace:!0,children:[e(Ve,{asChild:!0,children:e(g,{"aria-label":"Open account menu",role:"button","data-testid":"account-menu-button",children:e(ft,{size:"md"})})}),e(Fe,{children:e(je,{children:e($e,{position:"relative",left:-8,bg:"background",width:{base:"100vw",md:280},h:"100vh",m:0,p:0,children:e(ue,{children:e(f,{transform:{base:"translateY(12px)",md:"translateY(16px)"},padding:"12px 8px",h:"auto",flexDirection:"column",boxShadow:{base:"none",md:"2xl"},borderRadius:{base:0,md:2},background:"background","data-testid":"account-menu-dropdown",children:e(g,{children:e(gt,{})})})})})})})]})})]}),gn=({count:t,filled:r=!0})=>e(g,{width:24,height:24,mr:8,"data-testid":"cart-icon",children:i(g,{position:"relative",children:[e(Zt,{weight:r?"fill":"regular",width:"100%",height:"100%"}),t>0&&e(po,{position:"absolute",top:0,right:0,w:"12px",h:"12px",bg:"blue.500",color:"white",borderRadius:"full",fontSize:"8px",fontWeight:"bold",lineHeight:1,"data-testid":"cart-count-badge",children:t})]})}),fn=({cartCount:t,cartTotal:r,cartItems:o})=>i(f,{direction:"column",background:"background.primary",border:"none",w:360,children:[i(f,{direction:"row",justify:"space-between",align:"center",p:24,children:[i(f,{direction:"row",align:"center",maxHeight:24,gap:4,children:[e(cn,{}),i(b,{textStyle:"paragraph.16.reg",color:"text.primary",children:[t," clip",t>1&&"s"," added"]})]}),i(f,{direction:"row",justify:"flex-start",align:"center",maxHeight:24,gap:8,children:[e(b,{textStyle:"UI.12.semi",color:"text.primary",children:"Total:"}),e(b,{textStyle:"heading.18.semi",color:"text.primary",children:r})]})]}),e(Wt,{margin:"0 0 20px 0"}),o==null?void 0:o.map(n=>{var l,c;return i(f,{direction:"row",justify:"space-between",align:"center",gap:16,px:24,mb:20,children:[e(Et,{src:(c=(l=n==null?void 0:n.thumbnails)==null?void 0:l.paths)==null?void 0:c["480"],alt:"",w:64,h:40}),i(b,{flex:1,textStyle:"UI.14.semi",children:["#",n.clip_id]}),e(b,{textStyle:"UI.14.semi",children:n.price.formatted})]},n.clip_id)}),e(G,{to:"/cart",style:{textDecoration:"none",outline:"none"},children:e(f,{justify:"stretch",px:24,pb:24,children:i(k,{_hover:{backgroundColor:"gray.800"},_focus:{outline:"none"},variant:"filled",size:"lg",disabled:!o,w:"100%",children:[e(Zt,{weight:"fill"}),e(b,{children:"Checkout"})]})})})]}),bn=({open:t,popoverHandler:r})=>{const{data:o}=Ot({enabled:!0}),n=a.useMemo(()=>{var p;return((p=o==null?void 0:o.licenses)==null?void 0:p.reduce((h,S)=>{var u;return h+(((u=S.items)==null?void 0:u.length)||0)},0))??0},[o]),l=a.useMemo(()=>{var p;return((p=o==null?void 0:o.total)==null?void 0:p.formatted)??null},[o]),c=a.useMemo(()=>{var p;return((p=o==null?void 0:o.licenses)==null?void 0:p.map(h=>h.items).flat())??[]},[o]),s=p=>{r(p.open)},d=()=>r(!1);return n>0?i(Qo,{open:t,lazyMount:!0,unmountOnExit:!0,onOpenChange:s,children:[e(Xo,{asChild:!0,children:e(g,{children:e(gn,{count:n})})}),e(Fe,{children:e(Jo,{children:e(en,{p:0,onMouseLeave:d,children:e(rn,{children:e(fn,{cartCount:n,cartTotal:l,cartItems:c})})})})})]}):null},nr="/collections/curated/featured",ar="/collections/featured",yn=async()=>ot({path:nr,method:"get"}),xn=async()=>ot({path:ar,method:"get"}),ke={featuredCollection:{queryKey:[nr],queryFn:yn},featuredCollections:{queryKey:[ar],queryFn:xn}},Cn=()=>{const{data:t,isLoading:r,error:o}=Ne({queryKey:ke.featuredCollection.queryKey,queryFn:ke.featuredCollection.queryFn,staleTime:Oe,retry:!1});return{featuredCollection:t,isLoading:r,error:o}},wn=()=>{const{data:t,isLoading:r,error:o}=Ne({queryKey:ke.featuredCollections.queryKey,queryFn:ke.featuredCollections.queryFn,staleTime:Oe,retry:!1});return{collections:t,isLoading:r,error:o}},Sn=({name:t,slug:r,id:o})=>e(D,{asChild:!0,display:"block",marginLeft:-10,marginRight:10,width:"100%",padding:"5px 10px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textStyle:"UI.14.reg",color:"text.secondary",textDecoration:"none",_hover:{color:"text.primary",backgroundColor:"surface.hover"},children:e(G,{to:`/collections/${r}/${o}`,children:t})}),vn=({collectionData:t})=>i(f,{flexWrap:"wrap",flexDirection:"column",width:"100%",paddingLeft:70,children:[i(f,{justifyContent:"space-between",width:"100%",paddingBottom:17,children:[e(b,{textStyle:"UI.14.semi",color:"text.primary",children:"Collections"}),e(g,{asChild:!0,textDecoration:"none",children:e(G,{to:"/collections",children:i(f,{alignItems:"center",padding:"5px 10px",cursor:"pointer",color:"text.primary",_hover:{backgroundColor:"surface.hover","& .caret":{transform:"translate(-3px, 0px)",transition:"0.3s ease-in-out"}},children:[e(b,{textStyle:"UI.14.semi",color:"text.primary",children:"Explore All"}),e(Ee,{className:"caret",width:10,height:10,marginLeft:8,color:"text.primary",children:e(mo,{})})]})})})]}),i(f,{flexWrap:"wrap",justifyContent:"space-between",width:"100%",borderTop:"1px solid",borderColor:"border.default",paddingTop:22,children:[e(f,{justifyContent:"flex-start",alignItems:"flex-start",width:"100%",children:(t??[]).map((r,o)=>e(b,{textTransform:"uppercase",textStyle:"UI.12.semi",color:"text.primary",marginBottom:12,letterSpacing:"1px",width:"25%",children:r.name},o))}),e(f,{justifyContent:"flex-start",alignItems:"flex-start",width:"100%",children:(t??[]).map((r,o)=>e(f,{flexWrap:"wrap",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",width:"25%",maxHeight:120,children:e(g,{width:"100%",children:r.collections.data.map(n=>e(Sn,{name:n.name,slug:n.slug,id:n.id},n.id))})},o))})]})]}),In=()=>{const{featuredCollection:t}=Cn(),{collections:r}=wn();return i(f,{maxWidth:1e3,width:"100%",marginTop:40,height:250,children:[e(Wr,{collection:t==null?void 0:t.collection}),e(vn,{collectionData:r})]})},_n=({onClose:t})=>e(f,{"data-testid":"mega-nav",position:"absolute",top:"100%",left:0,width:"100%",zIndex:999,boxShadow:"0px 6px 20px rgba(0, 0, 0, 0.1)",clipPath:"inset(0px -20px -20px -20px)",backgroundColor:"background",alignItems:"flex-start",justifyContent:"center",onMouseLeave:t,children:e(In,{})}),ae=({id:t,onMouseEnter:r,onFocus:o,onClick:n,to:l,padding:c="0 12px",children:s,...d})=>e(D,{padding:c,asChild:!0,display:{base:"none",md:"flex"},fontWeight:600,textStyle:"UI.14.semi",textDecoration:"none",_focus:{boxShadow:"none",outline:"none"},_focusVisible:{boxShadow:"none",outline:"none"},_hover:{"&&&":{color:"text.primary"}},_active:{fontWeight:700},onClick:n,...d,children:e(G,{id:t,to:l,onMouseEnter:r,onFocus:o,children:s})}),An=({isVisible:t})=>t?e(Fe,{children:e(g,{"data-testid":"mega-nav-overlay",backgroundColor:"black",opacity:.7,zIndex:998,top:0,width:"full",height:"full",position:"fixed"})}):null,En=({isMobileMenuOpen:t,mobileMenuTriggerRef:r,onlyLogo:o})=>{const[n,l]=a.useState(!1),{data:c}=Ot({enabled:!0}),{user:s,authStatus:d}=ee(),p=ce({base:!1,md:!0}),h=ce({base:!1,lg:!0}),[S,u]=a.useState(!1),m=!!(h&&S),y=s==null?void 0:s.email,_=d==="pending",I=ne.useMemo(()=>{var A;return((A=c==null?void 0:c.licenses)==null?void 0:A.reduce((w,R)=>{var j;return w+(((j=R==null?void 0:R.items)==null?void 0:j.length)??0)},0))??0},[c]),x=ne.useRef(!0),C=xe(),P=A=>{l(A)},M=()=>{Jr({event:eo,actionType:window.location.href,category:"Product Login"})},O=()=>{h&&u(!0)},F=()=>{h&&u(!1)},W=()=>{p&&l(!0)},U=A=>{A.key==="Escape"&&u(!1)};return ne.useEffect(()=>{if(x.current&&I>0){x.current=!1;return}l(!0)},[I]),ne.useEffect(()=>{u(!1)},[C]),ne.useEffect(()=>{h||u(!1)}
1,[h]),ne.useEffect(()=>{p||l(!1)},[p]),ne.useEffect(()=>{if(m)return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[m]),i(z,{children:[e(An,{isVisible:m}),i(g,{position:"relative",children:[i(f,{as:"nav",width:"100%",height:Me.NAVBAR,zIndex:999,backgroundColor:s!=null&&s.masquerade?"violet.900":"background",border:"none",borderBottom:"1px solid",borderColor:"border.default",alignItems:"center",padding:{base:"0 20px",md:"0 24px"},children:[e(f,{width:"100%",height:40,alignItems:"center",position:"relative",zIndex:4,justifyContent:"space-between",children:i(f,{gap:"4px",alignItems:"center",children:[e(g,{display:{md:"none"},padding:"0 8px 0 0",children:e(Hr,{asChild:!0,children:e(Ft,{ref:r,isOpen:t,isVisible:!t})})}),e(g,{lineHeight:1,asChild:!0,padding:"0 24px 0 0",children:e(vr,{id:y?void 0:"headerFSLogo","aria-label":"home",to:"/",onFocus:F,children:e(g,{asChild:!0,width:{base:115,md:132},fill:"text.primary",children:e(to,{width:"100%",height:40})})})}),!o&&i(f,{gap:4,_hover:{"& a":{color:"gray.600"}},children:[e(ae,{id:y?void 0:"headerSearch",to:"/clips","data-testid":"header-search-link",onMouseEnter:F,onFocus:F,children:i(f,{gap:8,children:[e(g,{asChild:!0,width:24,height:24,children:e(pt,{})}),"Search"]})}),e(ae,{id:y?void 0:"headerCollections",to:"/collections",onMouseEnter:O,onFocus:O,children:"Collections"}),e(ae,{id:y?void 0:"headerPricing",to:"/pricing",onMouseEnter:F,onFocus:F,children:"Pricing"}),e(ae,{id:y?void 0:"headerServices",to:"/services",display:{base:"none",lg:"flex"},onMouseEnter:F,onFocus:F,children:"Services"})]})]})}),i(f,{gap:{base:0,md:"4px"},alignItems:"center",children:[(y||I===0)&&e(g,{display:{base:"flex",md:"none"},padding:"0 8px",asChild:!0,children:e(G,{to:"/clips","aria-label":"search",children:e(g,{asChild:!0,width:20,height:20,children:e(pt,{})})})}),!o&&i(z,{children:[y&&e(ae,{id:y?void 0:"headerMyProjects",to:"/projects","data-testid":"header-boards-link",onMouseEnter:F,onFocus:F,children:"Boards"}),I>0&&e(ae,{id:y?void 0:"cart-popover",to:"/cart",display:"flex",onMouseEnter:W,onFocus:F,padding:{base:"0 12px",md:"0px"},children:e(bn,{open:!!(p&&n),popoverHandler:P})}),y||_?null:i(z,{children:[e(ae,{id:y?void 0:"headerLogin",to:"/login",onClick:M,onMouseEnter:F,onFocus:F,display:{base:"none",sm:"flex"},"data-testid":"header-login-link",padding:{base:"0",sm:"0px 8px 0px 0px",md:"0 12px"},children:"Login"}),e(g,{paddingLeft:"8px",children:e(G,{to:"/register",children:i(k,{type:"button",variant:"filled",id:"headerCreateAccount","aria-label":"register",size:{base:"sm",sm:"lg"},height:40,"data-testid":"header-create-account-button",onMouseEnter:F,onFocus:F,children:[e(b,{as:"span",display:{base:"none",sm:"initial"},children:"Create Free Account"}),e(b,{as:"span",display:{sm:"none"},children:"Create Account"})]})})})]}),y?e(hn,{}):null]})]})]}),m&&e(_n,{onClose:F})]})]})},Fn=({text:t,action:r,color:o="text.primary"})=>e(g,{as:"button",cursor:"pointer",width:"100%",padding:"8px 0px",textAlign:"left",border:"none",backgroundColor:"background",textStyle:"UI.14.reg",color:o,onClick:r,children:t}),Pn=({onClose:t})=>{var p;const{user:r,authStatus:o}=ee(),{logout:n,masqueradeLogout:l}=Dt(),c=r==null?void 0:r.email,s=o==="pending",d=()=>{if(t(),r!=null&&r.masquerade){l();return}n()};return e(Nt,{position:"absolute",top:"100%",insetInlineStart:0,width:"100vw",height:`calc(100dvh - ${Me.NAVBAR}px)`,zIndex:2,children:i(Mt,{width:"100vw",maxWidth:"none",height:"full",maxHeight:"none",borderRadius:0,boxShadow:"none",backgroundColor:"background",padding:0,_open:{animationName:"none"},_closed:{animationName:"fade-out",animationDuration:"fastest"},children:[e(Pt,{asChild:!0,autoFocus:!0,top:"-44px",insetEnd:"auto",insetInlineStart:"20px",zIndex:1,children:e(Ft,{isOpen:!0})}),e(Tt,{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0,children:"Navigation menu"}),i(kt,{"data-testid":"mobile-menu-body",display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",marginTop:0,padding:20,paddingBottom:"calc(100vh - 100svh)",overflow:"auto",animationName:"slide-from-left-full, fade-in",animationDuration:"slowest",animationTimingFunction:"ease-in-smooth",children:[e(pe,{to:"/clips",onClick:t,children:"Search"}),e(pe,{to:"/collections",onClick:t,children:"Collections"}),e(pe,{to:"/pricing",onClick:t,children:"Pricing"}),e(pe,{to:"/services",onClick:t,children:"Services"}
1),(r==null?void 0:r.isAmbassador)&&e(D,{href:"https://app.impact.com/abe/FM/login.user",target:"_blank",rel:"noreferrer",onClick:t,width:"100%",padding:"8px 0",textDecoration:"none",textStyle:"UI.14.reg",color:"text.primary",children:"Affiliates"}),e(f,{alignSelf:"center",margin:8,width:"100%",backgroundColor:"border.default",height:"1px"}),!c&&!s&&e(pe,{to:"/register",onClick:t,children:"Create free account"}),c?e(Fn,{text:r!=null&&r.masquerade?`Log Out as User: ${(p=r.masquerade)==null?void 0:p.client_username}`:"Logout",color:r!=null&&r.masquerade?"":"text.primary",action:d}):s?null:e(pe,{to:"/login",onClick:t,children:"Login"})]})]})})},pe=({to:t,onClick:r,children:o})=>e(D,{asChild:!0,width:"100%",padding:"8px 0",textDecoration:"none",textStyle:"UI.14.reg",color:"text.primary",children:e(G,{to:t,onClick:r,children:o})}),Tn=({onlyLogo:t})=>{const[r,o]=a.useState(!1),n=a.useRef(null),l=ce({base:!0,md:!1}),c=xe(),s=r&&l!==!1,d=({open:S})=>{o(S)},p=()=>{o(!1)},h=a.useCallback(()=>n.current,[]);return a.useEffect(()=>{o(!1)},[c]),a.useEffect(()=>{l===!1&&o(!1)},[l]),i(Lt,{placement:"start",open:s,lazyMount:!0,unmountOnExit:!0,onOpenChange:d,finalFocusEl:h,children:[e(En,{isMobileMenuOpen:s,mobileMenuTriggerRef:n,onlyLogo:t}),e(Pn,{onClose:p})]})},kn=({onlyLogo:t})=>e(g,{position:"sticky",top:-24,zIndex:999,children:i(ue,{children:[e(nn,{}),e(Tn,{onlyLogo:t})]})}),Mn=({size:t=16,...r})=>i("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[i("g",{clipPath:"url(#instagram-icon-clip)",children:[e("path",{d:"M8 1.441C10.136 1.441 10.389 1.45 11.233 1.488C11.7402 1.49409 12.2425 1.58746 12.718 1.764C13.0658 1.89248 13.3802 2.09754 13.638 2.364C13.9045 2.62179 14.1095 2.93622 14.238 3.284C14.4145 3.75949 14.5079 4.26183 14.514 4.769C14.552 5.613 14.561 5.869 14.561 8.002C14.561 10.135 14.552 10.391 14.514 11.235C14.5079 11.7422 14.4145 12.2445 14.238 12.72C14.1052 13.0651 13.9015 13.3785 13.64 13.64C13.3785 13.9015 13.0651 14.1052 12.72 14.238C12.2445 14.4145 11.7422 14.5079 11.235 14.514C10.391 14.552 10.135 14.561 8.002 14.561C5.869 14.561 5.613 14.552 4.769 14.514C4.26183 14.5079 3.75949 14.4145 3.284 14.238C2.93622 14.1095 2.62179 13.9045 2.364 13.638C2.09754 13.3802 1.89248 13.0658 1.764 12.718C1.58746 12.2425 1.49409 11.7402 1.488 11.233C1.45 10.389 1.441 10.133 1.441 8C1.441 5.867 1.45 5.611 1.488 4.767C1.49409 4.25983 1.58746 3.75749 1.764 3.282C1.89248 2.93422 2.09754 2.61979 2.364 2.362C2.62179 2.09554 2.93622 1.89048 3.284 1.762C3.75949 1.58546 4.26183 1.49209 4.769 1.486C5.613 1.448 5.869 1.439 8.002 1.439M8 0C5.827 0 5.555 0.009 4.7 0.048C4.03696 0.0614835 3.381 0.187265 2.76 0.42C2.22596 0.620558 1.74231 0.9356 1.343 1.343C0.9356 1.74231 0.620558 2.22596 0.42 2.76C0.187265 3.381 0.0614835 4.03696 0.048 4.7C0.009 5.555 0 5.827 0 8C0 10.173 0.009 10.445 0.048 11.3C0.0614835 11.963 0.187265 12.619 0.42 13.24C0.620558 13.774 0.9356 14.2577 1.343 14.657C1.74231 15.0644 2.22596 15.3794 2.76 15.58C3.38163 15.813 4.03828 15.9387 4.702 15.952C5.555 15.991 5.827 16 8 16C10.173 16 10.445 15.991 11.3 15.952C11.9637 15.9387 12.6204 15.813 13.242 15.58C13.7734 15.3743 14.256 15.0599 14.659 14.657C15.0619 14.254 15.3763 13.7714 15.582 13.24C15.815 12.6184 15.9407 11.9617 15.954 11.298C15.993 10.445 16.002 10.173 16.002 7.998C16.002 5.823 15.993 5.553 15.954 4.698C15.9397 4.03552 15.8132 3.38025 15.58 2.76C15.3794 2.22596 15.0644 1.74231 14.657 1.343C14.2577 0.9356 13.774 0.620558 13.24 0.42C12.619 0.187265 11.963 0.0614835 11.3 0.048C10.445 0.009 10.173 0 8 0Z",fill:"currentColor"}),e("path",{d:"M8 3.89197C7.18751 3.89197 6.39327 4.1329 5.71772 4.58429C5.04216 5.03568 4.51563 5.67727 4.2047 6.4279C3.89378 7.17854 3.81243 8.00452 3.97093 8.8014C4.12944 9.59827 4.52069 10.3302 5.09521 10.9048C5.66972 11.4793 6.40169 11.8705 7.19857 12.029C7.99544 12.1875 8.82142 12.1062 9.57206 11.7953C10.3227 11.4843 10.9643 10.9578 11.4157 10.2823C11.8671 9.60669 12.108 8.81245 12.108 7.99997C12.108 7.4605 12.0017 6.92631 11.7953 6.4279C11.5889 5.9295 11.2863 5.47664 10.9048 5.09517C10.5233 4.71371 10.0705 4.41112 9.57206 4.20467C9.07366 3.99822 8.53947 3.89197 8 3.89197ZM8 10.667C7.47252 10.667 6.95688 10.5106 6.51829 10.2175C6.07971 9.92444 5.73787 9.50791 5.53601 9.02058C5.33415 8.53325 5.28134 7.99701 5.38425 7.47966C5.48715 6.96231 5.74116 6.4871 6.11415 6.11411C6.48713 5.74113 6.96235 5.48712 7.47969 5.38421C7.99704 5.28131 8.53329 5.33412 9.02062 5.53598C9.50795 5.73784 9.92448 6.07968
110.2175 6.51826C10.5106 6.95685 10.667 7.47248 10.667 7.99997C10.667 8.7073 10.386 9.38566 9.88585 9.88582C9.38569 10.386 8.70733 10.667 8 10.667Z",fill:"currentColor"}),e("path",{d:"M12.27 4.69002C12.8002 4.69002 13.23 4.26021 13.23 3.73002C13.23 3.19983 12.8002 2.77002 12.27 2.77002C11.7398 2.77002 11.31 3.19983 11.31 3.73002C11.31 4.26021 11.7398 4.69002 12.27 4.69002Z",fill:"currentColor"})]}),e("defs",{children:e("clipPath",{id:"instagram-icon-clip",children:e("rect",{width:"16",height:"16",fill:"white"})})})]}),Nn=({size:t=16,...r})=>i("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[e("g",{clipPath:"url(#linkedin-icon-clip)",children:e("path",{d:"M3.35782 2.08966C3.3576 2.53756 3.1805 2.96702 2.86548 3.28358C2.55047 3.60013 2.12334 3.77784 1.67807 3.77762C1.2328 3.77739 0.805847 3.59925 0.491147 3.28238C0.176448 2.96551 -0.000222427 2.53587 2.10167e-07 2.08798C0.000222847 1.64008 0.177321 1.21062 0.492335 0.894064C0.807349 0.577512 1.23447 0.399801 1.67975 0.400025C2.12502 0.400249 2.55197 0.578389 2.86667 0.895258C3.18137 1.21213 3.35804 1.64177 3.35782 2.08966ZM3.40819 5.02817H0.0503674V15.6H3.40819V5.02817ZM8.71354 5.02817H5.37251V15.6H8.67996V10.0523C8.67996 6.96184 12.6842 6.67474 12.6842 10.0523V15.6H16V8.90395C16 3.69402 10.0735 3.88823 8.67996 6.44676L8.71354 5.02817Z",fill:"currentColor"})}),e("defs",{children:e("clipPath",{id:"linkedin-icon-clip",children:e("rect",{width:"16",height:"16",fill:"white"})})})]}),Ln=({size:t=16,...r})=>e("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:e("path",{d:"M15.6653 5.21798C15.5749 4.88575 15.3967 4.58253 15.1484 4.33867C14.9001 4.09481 14.5905 3.91889 14.2507 3.8285C13.0033 3.5 8 3.5 8 3.5C8 3.5 2.99667 3.5 1.74867 3.8285C1.40894 3.91904 1.09953 4.09504 0.851385 4.33888C0.603241 4.58272 0.425061 4.88586 0.334667 5.21798C0 6.44352 0 9 0 9C0 9 0 11.5565 0.334667 12.782C0.425057 13.1143 0.603317 13.4175 0.851594 13.6613C1.09987 13.9052 1.40945 14.0811 1.74933 14.1715C2.99667 14.5 8 14.5 8 14.5C8 14.5 13.0033 14.5 14.2513 14.1715C14.5912 14.0812 14.9009 13.9053 15.1491 13.6614C15.3974 13.4175 15.5757 13.1143 15.666 12.782C16 11.5565 16 9 16 9C16 9 16 6.44352 15.6653 5.21798ZM6.36333 11.321V6.67901L10.5453 9L6.36333 11.321Z",fill:"currentColor"})}),fe="footer",te=`@container ${fe} (min-width: 744px)`,ir=`@container ${fe} (min-width: 980px)`,ge=`@container ${fe} (min-width: 1280px)`,Re=`@container ${fe} (min-width: 768px)`,lr=`@container ${fe} (min-width: 1024px)`,On="width 0.3s, margin-inline-start 0.3s",bt={main:{textStyle:"UI.14.reg",color:"text.secondary",_hover:{color:"text.primary"},textDecoration:"none",display:"block",mt:"12px"},subFooter:{textStyle:"UI.12.reg",color:"text.secondary",_hover:{color:"text.primary"},textDecoration:"none"},subFooterStatic:{textStyle:"UI.12.reg",color:"white",_hover:{opacity:.8},textDecoration:"none"}},yt={textDecoration:"none",display:"block",color:"text.primary",_hover:{color:"text.secondary"}},Rn=new Date().getFullYear(),$={FM:"https://fm.co",FM_CAREERS:"https://fm.co/careers",MUSICBED:"https://www.musicbed.com/",STILLS:"https://stills.com/",ARTICLES:"https://www.filmsupply.com/articles/",FILMS:"https://www.filmsupply.com/films/",CONTRIBUTOR_APPLY:"http://apply.filmsupply.com/",INSTAGRAM:"https://instagram.com/filmsupply",LINKEDIN:"https://www.linkedin.com/company/fm-co",YOUTUBE:"https://www.youtube.com/@filmsupply"},Dn=[{id:"FooterAboutUs",to:"/about",label:"Our Story"},{id:"FooterFilmmakers",to:"/filmmakers",label:"Our Filmmakers"},{id:"FooterBlog",href:$.ARTICLES,target:"_blank",label:"Articles"},{id:"FooterFilms",href:$.FILMS,target:"_blank",label:"Films"},{id:"footerPopularSearches",to:"/stock-footage",label:"Popular Searches"},{to:"/category",label:"All Categories"}],Bn=[{id:"FooterPricing",to:"/pricing",label:"Pricing"},{id:"FooterFAQ",to:"/faq",label:"FAQ"},{id:"FooterEmailUs",href:on.HREF,label:"Email Us"},{href:Te.HREF,to:"/contact",label:Te.LOCAL},{id:"footerContributorApply",href:$.CONTRIBUTOR_APPLY,target:"_blank",label:"Become a Contributor"}],Un={id:"FooterFM",href:$.FM,target:"_blank",brandName:"FM",description:"A family of brands dedicated to empowering the creative.",trackingName:"fm"},Zn=[{id:"FooterFilmsupply",to:"/",brandName:"FILMSUPPLY",description:"Footage licensing for productions"},{id:"FooterMusicbed",href:$.MUSICBED,target:"_blank",brandName:"MUSICBED",description:"Music licensing for filmmakers",trackingName:"musicbed"},{id:"FooterStills",href:$.STILLS,target:"_blank",brandName:"STILLS",description:"Image licensing for creatives",trackingName:"stills"}],Wn=[Un,...Zn],Hn=[{id:"FooterInstagram",label:"instagram",href:$.INSTAGRAM,Icon:Mn},{id:"FooterLinkedin",label:"linkedin",href:$.LINKEDIN,Icon:Nn},{id:"FooterYoutube",label:"youtube",href:$.YOUTUBE,Icon:Ln}],qn=[{id:"FooterPrivacyPolicy",to:"/privacy-policy",label:"Privacy Policy"},{id:"FooterLicenseTerms",to:"/license-terms",label:"License Terms"},{id:"FooterTermsAndConditions",to:"/terms-and-conditions",label:"Terms & Conditions"},{id:"FooterCareers",href:$.FM_CAREERS,target:"_blank",label:"Careers"}];function sr({id:t,to:r,href:o,target:n,variant:l="main",children:c}){return r?e(D,{asChild:!0,id:t,...bt[l],children:e(G,{to:r,children:c})}):e(D,{id:t,href:o,target:n,...bt[l],children:c})}function xt({label:t,links:r}){return i(g,{children:[e(b,{textStyle:"UI.14.semi",color:"text.primary",mb:"2px",children:t}),r.map(o=>e(sr,{id:o.id,to:o.to,href:o.href,target:o.target,children:o.label},o.label))]})}const cr=N("div",{base:{display:"flex",flexDirection:"column",width:"100%",gap:64,[te]:{flexDirection:"row",width:"auto",gap:100}}}),zn=N("footer",{base:{width:"100%",containerName:fe,containerType:"inline-size",transition:"none","main:has([data-browse-desktop-filters-animate]) + &":{transition:On}}}),Vn=N("div",{base:{display:"flex",flexDirection:"column",alignItems:"flex-start",margin:"0 auto",padding:"40px 20px 0",gap:64,[te]:{gap:80},[ir]:{paddingInline:24},[ge]:{flexDirection:"row",justifyContent:"space-between",gap:0}}}),jn=N("div",{base:{display:"flex",flexDirection:"column",alignItems:"flex-start",flexShrink:0,width:"100%",[ge]:{flexBasis:346,width:"auto"}}}),$n=cr,Gn=N("div",{base:{[te]:{width:190}}}),Kn=N("div",{variants:{onlySubFooter:{true:{padding:"0 20px",[Re]:{padding:"0 32px"}},false:{padding:"64px 20px 40px",[te]:{padding:"80px 20px 40px"},[ir]:{paddingInline:24},[ge]:{paddingTop:40}}}}}),Yn=N("div",{base:{display:"flex",flexDirection:"column",alignItems:"flex-start",margin:"0 auto",gap:24,[ge]:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:0}},variants:{onlySubFooter:{true:{paddingTop:14,paddingBottom:40,[lr]:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},[ge]:{height:60,paddingTop:0,gap:0}},false:{paddingTop:0,paddingBottom:0}}}}),Qn=N("div",{variants:{onlySubFooter:{true:{[lr]:{order:1}},false:{[ge]:{order:1}}}}}),Xn=cr,Jn=N("div",{base:{[te]:{width:125}}}),ea=N("div",{base:{[te]:{width:135}}}),ta=N("div",{base:{display:"flex",flexDirection:"column",alignItems:"flex-start"},variants:{onlySubFooter:{true:{gap:10,[Re]:{flexDirection:"row",alignItems:"center",gap:24}},false:{gap:12,[te]:{flexDirection:"row",alignItems:"center",gap:24}}}}}),ra=N("div",{base:{order:1},variants:{onlySubFooter:{true:{[Re]:{order:0}},false:{[te]:{order:0}}}}}),oa=N("div",{base:{display:"flex",flexDirection:"column",flexWrap:"wrap",justifyContent:"space-between",width:"100%"},variants:{onlySubFooter:{true:{gap:8,[Re]:{flexDirection:"row",justifyContent:"flex-start",width:"auto",gap:24}},false:{gap:12,[te]:{flexDirection:"row",justifyContent:"flex-start",width:"auto",gap:24}}}}});function na(){return i(Xn,{children:[e(Jn,{children:e(xt,{label:"This is Filmsupply",links:Dn})}),e(ea,{children:e(xt,{label:"Help & Support",links:Bn})})]})}const aa="footage_research",ia=t=>ot({path:aa,method:"post",body:t}),la=({onSuccess:t})=>{const{mutate:r,isPending:o}=de({mutationFn:ia,onSuccess:t});return{execute:r,isPending:o}},sa=me({description:T().trim().required("This field is required"),
1callback_number:T().trim().required("This field is required")}),ca=we(sa),da={description:"",callback_number:""},pa=({open:t,onClose:r,onSuccess:o})=>{var A,w;const{data:n}=ee(),l=xe(),[c,s]=a.useState("form"),d=!!(n!=null&&n.email),p=c==="form",h=c==="auth",{register:S,reset:u,trigger:m,getValues:y,handleSubmit:_,formState:{errors:I}}=Ce({resolver:ca,defaultValues:{...da,callback_number:(n==null?void 0:n.phone)??""},reValidateMode:"onChange"}),x=()=>{r(),u(),s("form")},C=({submittedUser:R,authMode:j}={})=>{const oe=y(),v=(R==null?void 0:R.id)??(n==null?void 0:n.id);if(v===void 0)return;const ve=Ir.getCookieData();M({description:oe.description,callback_number:oe.callback_number,pageName:l.pathname,pageUrl:`https://www.filmsupply.com${l.pathname}`,status:d?"logged_in":j==="login"?"login":"registration",user_id:v,...ve?{hutk:ve}:{}})},P=()=>{Ar(),o(),u(),s("form")},{execute:M,isPending:O}=la({onSuccess:P}),F=_(()=>{C()}),W=({mode:R,user:j})=>{C({submittedUser:j,authMode:R})},U=async()=>{await m()&&s("auth")};return i(Ge,{title:p?"Expert Footage Research":void 0,subtitle:p?i(z,{children:["Fill out the form below and we will",e("br",{}),"get back to you within 1 business day."]}):void 0,open:t,onClose:x,maxW:{base:"full",lg:418},contentOnly:h,children:[p&&i(N.form,{display:"flex",flexDirection:"column",gap:24,onSubmit:d?F:void 0,children:[e(qr,{required:!0,label:"What would you like to find?",placeholder:'i.e. "I am looking for aerial shots of New York City"',errorText:(A=I.description)==null?void 0:A.message,...S("description")}),e(L,{required:!0,size:"lg",label:"Mobile phone",placeholder:"Enter your mobile number",errorText:(w=I.callback_number)==null?void 0:w.message,...S("callback_number")}),i(Le,{gap:16,alignItems:"center",justifyContent:"flex-end",children:[e(k,{variant:"outline",size:"lg",onClick:x,flex:1,children:"Cancel"}),d?e(k,{type:"submit",variant:"filled",size:"lg",flex:1,disabled:O,children:"Submit"}):e(k,{variant:"filled",size:"lg",flex:1,onClick:U,children:"Next"})]})]}),h&&e(g,{w:"full",minW:"354px",maxW:"500px",mx:"auto",px:"24px",py:"40px",children:e(fo,{initialStep:bo.register,onComplete:W,showLogo:!0})})]})},ua=({open:t,onClose:r})=>{const[o,n]=a.useState(!1);return i(z,{children:[e(pa,{open:t,onClose:r,onSuccess:()=>{r(),n(!0)}}),e(ho,{type:"success",title:"You're all set!",message:"We'll have footage options delivered to your account shortly.",buttonTitle:"Got it!",open:o,onClose:()=>{n(!1)},closeOnInteractOutside:!0})]})};function ma(){const{open:t,onOpen:r,onClose:o}=Ye();return i(z,{children:[e(ua,{open:t,onClose:o}),i(b,{color:"text.primary",fontSize:{base:"24px",md:"36px"},fontStyle:"normal",fontWeight:"700",lineHeight:{base:"32px",md:"48px"},letterSpacing:{base:"-0.456px",md:"-0.792px"},children:["Need help finding the ",e("br",{})," right footage?"]}),e(b,{textStyle:"UI.14.reg",color:"text.primary",mt:"4px",mb:"12px",children:"Have it delivered to your account within 1 business day."}),e(k,{id:"FooterGetInTouch",onClick:r,variant:"filled",backgroundColor:{base:"black",_dark:"white"},color:{base:"white",_dark:"black"},fontWeight:"600",borderRadius:"2px",px:"10px",h:"40px",w:{base:"100%",sm:"112px"},_hover:{backgroundColor:{base:"black",_dark:"white"},opacity:.9},_active:{backgroundColor:{base:"black",_dark:"white"}},children:"Get in touch"})]})}function ha(t){if(t)return()=>We(t,"footer")}function ga({id:t,to:r,href:o,target:n,brandName:l,description:c,trackingName:s}){const d=i(z,{children:[e(b,{textStyle:"UI.14.semi",color:"inherit",mb:2,children:l}),e(b,{textStyle:"UI.12.reg",color:"text.secondary",children:c})]}),p=ha(s);return r?e(D,{asChild:!0,id:t,...yt,onClick:p,children:e(G,{to:r,children:d})}):e(D,{id:t,href:o,target:n,...yt,onClick:p,children:d})}function fa(){return e(f,{flexDir:"column",gap:"16px",children:Wn.map(t=>e(ga,{...t},t.id))})}function ba({isStatic:t=!1}){return i(b,{textStyle:"UI.12.semi",color:t?"white":"text.primary",whiteSpace:"nowrap",children:["© ",Rn," FM LLC."]})}function ya({isStatic:t=!1}){return e(oa,{onlySubFooter:t,children:qn.map(r=>e(sr,{id:r.id,to:r.to,href:r.href,target:r.target,variant:t?"subFooterStatic":"subFooter",children:r.label},r.id))})}function xa({isStatic:t=!1}){return i(ta,{onlySubFooter:t,children:[e(ra,{onlySubFooter:t,children:e(ba,{isStatic:t})}),e(ya,{isStatic:t})]})}function Ca({isStatic:t=!1}){return e(Le,{gap:t?"40px":"24px",mr:t?{xl:80}:void 0,children:Hn.map(({id:r,label:o,href:n,Icon:l})=>e(D,{id:r,"aria-label":o,href:n,target:"_blank",color:t?"white":"text.primary",_hover:{opacity:.8},children:e(l,{})},r))})}function dr({onlySubFooter:t=!1,desktopOffsetPx:r=0}
1){return e(zn,{width:{base:"100%",lg:`calc(100% - ${r}px)`},marginInlineStart:{base:0,lg:`${r}px`},children:i(ue,{children:[!t&&e(g,{backgroundColor:"background.surface",children:i(Vn,{children:[e(jn,{children:e(ma,{})}),i($n,{children:[e(na,{}),e(Gn,{children:e(fa,{})})]})]})}),e(g,{backgroundColor:t?"black":"background.staticBlack",children:e(Kn,{onlySubFooter:t,children:i(Yn,{onlySubFooter:t,children:[e(Qn,{onlySubFooter:t,children:e(Ca,{isStatic:t})}),e(xa,{isStatic:t})]})})})]})})}const at=({email:t="",enabled:r=!0}={})=>{const{data:o,isLoading:n,isFetched:l}=Ne({queryKey:be.getEnrichmentByEmail.queryKey(t),queryFn:()=>be.getEnrichmentByEmail.queryFn(t),enabled:r&&!!t,staleTime:Oe});return{data:o,isLoading:n,isFetched:l}},pr=({enabled:t=!0}={})=>{const{data:r,isLoading:o,isFetched:n,error:l,refetch:c}=Ne({queryKey:be.getOnboardingStatus.queryKey,queryFn:be.getOnboardingStatus.queryFn,staleTime:Oe,enabled:t});return{data:r,isLoading:o,isFetched:n,error:l,refetch:c}};function ur({title:t,firstName:r,lastName:o,existingAvatarUrl:n,onAvatarChange:l}){const c=a.useRef(null),[s,d]=a.useState(n||""),{openCropModal:p,openErrorModal:h}=Q(),S=ro({first_name:r||null,last_name:o||null}),u=_=>{if(!_)return;if(!(ut.includes(_.type)&&_.size<=Fo)){h(x=>{u(x)});return}p(_,x=>{const C=URL.createObjectURL(x);d(C),l(x)})},m=_=>{var x;const I=((x=_.target.files)==null?void 0:x[0])||null;u(I),c.current&&(c.current.value="")},y=()=>{c.current&&c.current.click()};return a.useEffect(()=>{n&&d(n)},[n]),a.useEffect(()=>()=>{URL.revokeObjectURL(s)},[s]),i(z,{children:[i(f,{alignItems:"flex-start",justifyContent:"center",flexDirection:"column",boxSize:64,children:[t&&e(b,{mb:8,textStyle:"UI.14.semi",children:t}),i(g,{position:"relative",display:"flex",onClick:y,children:[e(rt,{size:"xl",name:S,src:s}),e(He,{"aria-label":"Edit avatar",rounded:"full",variant:"outline",size:"sm",zIndex:"overlay",width:24,height:24,position:"absolute",bottom:0,right:0,bg:"icon.colored.blue",children:e(Eo,{size:15,color:"white"})})]})]}),e("input",{ref:c,type:"file",accept:ut.join(","),onChange:m,style:{display:"none"},"aria-hidden":"true"})]})}const wa=()=>{const{mutate:t,isPending:r}=de({mutationFn:o=>xo(o)});return{enrichByDomain:t,isPending:r}};class ye extends Error{constructor(o,n,l){super(n);De(this,"statusCode");De(this,"data");this.statusCode=o,this.data=l,this.name="ApiError",Object.setPrototypeOf(this,ye.prototype)}getErrorMessage(){return"Api request error: "+this.message}}const Sa=({onSuccess:t}={})=>{const{mutate:r,isPending:o,isError:n}=de({mutationFn:Co,onSuccess:()=>{t==null||t()},onError:d=>{d instanceof ye||he(new Error("An error occurred while attempting to update company profile during onboarding."),{extra:{error:d}})}}),{uploadImage:l,uploading:c}=No({enabled:!0});return{execute:a.useCallback(async(d,p)=>{try{const h=p?await l({imageFile:p}):null;r({name:d.name,avatar_public_id:h??null,company_type_id:d.company_type_id,company_url:d.company_url,company_name:d.company_name})}catch(h){if(h instanceof ye)return;he(new Error("An error occurred while creating a workspace during onboarding."),{extra:{error:h}})}},[l,r]),isLoading:c||o,isError:n}},Se=({title:t,description:r})=>{const{progressStepperInfo:o}=Q();return i(q,{gap:"24px",children:[e(f,{direction:"row",gap:"2px",width:"280px",mx:"auto",alignItems:"center",justifyContent:"center",children:o.steps.map((n,l)=>e(g,{flex:1,height:"2px",bg:l<=o.activeIndex?"blue.500":"gray.200"},n))}),i(q,{gap:"2px",alignItems:"center",children:[e(b,{textStyle:"heading.18.semi",textAlign:"center",children:t}),r&&e(b,{textAlign:"center",textStyle:"paragraph.14.reg",children:r})]})]})},va=me({companyWebsite:T().trim().required("Company website is required").test("is-valid-url-or-domain","Must be a valid URL or domain",Oo),companyName:T().required("Company name is required"),companyType:T().required("Company type is required"),workspaceName:T().required("Workspace name is required")}),Ia=we(va),_a={companyWebsite:"",companyName:"",companyType:"",workspaceName:""},mr={companyName:"company_name",workspaceName:"company_name"},Aa=Object.keys(mr),Ct=t=>{try{return new URL(t.startsWith("http")?t:`https://${t}`).hostname.replace(/^www\./,"")}catch{return null}};function Ea(t){return t?{formDefaults:{...t.company_name&&{companyName:t.company_name},...t.company_url&&{companyWebsite:t.company_url},...t.company_name&&{workspaceName:t.company_name}},logoUrl:t.company_logo_url??void 0}:{formDefaults:{}}}const Fa=()=>
1{const{goToNextStep:t,setDomainEnrichment:r}=Q(),{data:o}=ee(),{data:n,isFetched:l}=at({email:o==null?void 0:o.email}),{formDefaults:c,logoUrl:s}=Ea(n),[d,p]=a.useState(null),[h,S]=a.useState(s),u=a.useRef(c.companyWebsite?Ct(c.companyWebsite)??"":""),m=a.useRef(new Set),y=(E,Z)=>(...X)=>{m.current.add(E),Z(...X)},_=()=>Aa.every(E=>m.current.has(E))&&m.current.has("avatar"),I=E=>P&&!m.current.has(E),x=ce({base:!0,lg:!1}),{enrichByDomain:C,isPending:P}=wa(),{data:M,isLoading:O}=Lo(),{execute:F,isLoading:W,isError:U}=Sa({onSuccess:t}),{control:A,handleSubmit:w,watch:R,setValue:j,getValues:oe,trigger:v,formState:{errors:ve}}=Ce({resolver:Ia,defaultValues:{..._a,...c},reValidateMode:"onChange"}),lt=R("workspaceName"),fr=async()=>{const E=oe("companyWebsite");if(!await v("companyWebsite"))return;const X=Ct(E);!X||X===u.current||_()||C(X,{onSuccess:_e=>{u.current=X,r(_e);for(const[st,xr]of Object.entries(mr)){const ct=_e[xr];ct&&!m.current.has(st)&&j(st,ct)}_e.company_logo_url&&!m.current.has("avatar")&&S(_e.company_logo_url)}})},Ie=_o({rhfErrors:ve,apiErrors:[]}),br=w(E=>{F({name:E.workspaceName,company_type_id:Number(E.companyType),company_url:E.companyWebsite,company_name:E.companyName},d??h??null)}),yr=E=>{m.current.add("avatar"),p(E)};return l?i(q,{w:{base:"100%",lg:"460px"},px:{base:24,lg:32},pt:40,pb:32,maxW:"100%",gap:24,children:[e(Se,{title:"Tell us about your company",description:"We'll personalize the experience based on your needs"}),i(N.form,{onSubmit:br,children:[i(q,{gap:24,children:[e(re,{name:"companyWebsite",control:A,render:({field:E})=>{var Z;return i(Pe,{gap:4,alignItems:"flex-start",children:[e(L,{...E,onChange:E.onChange,onBlur:()=>{E.onBlur(),fr()},label:"Company website",placeholder:"https://www.example.com",errorText:(Z=Ie.companyWebsite)==null?void 0:Z.message,loading:P}),e(b,{textStyle:"UI.12.reg",color:"text.secondary",mt:4,m:0,textAlign:"left",w:"full",children:"Enter your url and we'll auto-fill your company details"})]})}}),e(re,{name:"companyName",control:A,render:({field:E})=>{var Z;return e(L,{...E,onChange:y("companyName",E.onChange),label:"Company name",placeholder:"Company name",errorText:(Z=Ie.companyName)==null?void 0:Z.message,loading:I("companyName"),disabled:I("companyName")})}}),e(re,{name:"companyType",control:A,render:({field:E})=>{var Z;return e(Pe,{gap:4,alignItems:"flex-start",children:e(nt,{isDrawer:x,size:"lg",label:"Company type",placeholder:"Select company type",name:E.name,value:E.value,onChange:E.onChange,ref:E.ref,errorText:(Z=Ie.companyType)==null?void 0:Z.message,disabled:O,loading:O,items:(M==null?void 0:M.map(X=>({label:X.name,value:X.id.toString()})))??[]})})}})]}),e(q,{mt:24,mb:12,w:"full",children:e(Wt,{})}),i(q,{gap:16,children:[i(g,{children:[e(b,{textStyle:"UI.14.semi",w:"full",textAlign:"left",children:"Setup your Filmsupply workspace"}),e(b,{textStyle:"UI.12.reg",color:"text.secondary",w:"full",textAlign:"left",children:"Your account comes with a free workspace where you can work alongside your teammates."})]}),i(Le,{gap:16,align:"center",children:[e(ur,{firstName:lt||"",lastName:lt||"",existingAvatarUrl:h,onAvatarChange:yr}),e(re,{name:"workspaceName",control:A,render:({field:E})=>{var Z;return e(g,{flex:1,children:e(L,{...E,onChange:y("workspaceName",E.onChange),placeholder:"Your workspace name",errorText:(Z=Ie.workspaceName)==null?void 0:Z.message,loading:I("workspaceName"),disabled:I("workspaceName")})})}})]}),e(b,{textStyle:"UI.12.reg",color:"text.secondary",w:"full",textAlign:"left",children:"Workspace avatar can be PNG or JPEG, max 25mb"})]}),U&&e(b,{textStyle:"UI.12.reg",color:"red.500",mt:8,children:"We couldn't save your company details. Please try again."}),e(k,{type:"submit",variant:"filled",size:"lg",width:"full",mt:24,loading:W,disabled:W,children:"Continue"})]})]}):null},Pa=({onSuccess:t}={})=>{const r=tt(),o=()=>{r.invalidateQueries({queryKey:At.getUser.queryKey}),r.invalidateQueries({queryKey:be.updateOnboardingProfile.queryKey})},n=()=>{t==null||t(),o()},l=u=>{Ao({error:u,onFail:()=>{he(new Error("An error occured while attempting to update a profile during onboarding."),{extra:{error:u}})}})},{mutate:c,isPending:s,error:d}=de({mutationFn:wo,onSuccess:n,onError:l}),{uploadImage:p,uploading:h}=Ro({enabled:!0});return{updateProfile:a.useCallback(async u=>{const m=u.avatar?await p({imageFile:u.avatar}):u.avatarPublicId,y=Number(u.occupationTypeId)||null,_={avatar_public_id:m,first_name:u.firstName,last_name:u.lastName,occupation_type_id:y};c(_)},[c,p]),isLoading:s||h,error:d}},Ta=me({firstName:T().required("First name is required"),lastName:T().required("Last name is required"),occupationTypeId:T().required("Role is required")}),ka=we(Ta),Ma={firstName:"",lastName:"",occupationTypeId:""};function Na(t,r,o){return{firstName:(t==null?void 0:t.first_name)||(o==null?void 0:o.user_first_name)||(r==null?void 0:r.user_first_name)||"",lastName:(t==null?void 0:t.last_name)||(o==null?void 0:o.user_last_name)||(r==null?void 0:r.user_last_name)||""}}const La=()=>{var U;const{goToNextStep:t,domainEnrichment:r}=Q(),{data:o}=ee(),{data:n,isFetched:l}
1=at({email:o==null?void 0:o.email}),c=Na(o,n,r),[s,d]=a.useState(null),p=ce({base:!0,lg:!1}),{data:h,isLoading:S}=Do(),{updateProfile:u,isLoading:m,error:y}=Pa({onSuccess:t}),{handleSubmit:_,control:I,formState:{errors:x},watch:C}=Ce({resolver:ka,defaultValues:{...Ma,...c},reValidateMode:"onChange"}),{field:P}=Ht({name:"occupationTypeId",control:I}),M=C("firstName"),O=C("lastName"),F=a.useMemo(()=>(h==null?void 0:h.map(A=>({label:A.name,value:A.id.toString()})))??[],[h]),W=A=>{u({firstName:A.firstName,lastName:A.lastName,occupationTypeId:Number(A.occupationTypeId),avatar:s,avatarPublicId:null})};return l?i(q,{w:{base:"100%",lg:"460px"},px:{base:24,lg:32},pt:40,pb:32,maxW:"100%",gap:24,children:[e(Se,{title:"Now, tell us about you",description:"Help your team recognize you in your workspace"}),e(N.form,{onSubmit:_(W),children:i(q,{gap:24,children:[i(f,{gap:16,alignItems:"center",children:[e(ur,{firstName:M,lastName:O,onAvatarChange:d}),i(f,{direction:"column",gap:0,children:[e(b,{textStyle:"UI.14.semi",textAlign:"left",color:"text.primary",children:"Profile avatar"}),e(b,{textStyle:"UI.12.reg",color:"text.secondary",children:"PNG or JPEG, max 25mb"})]})]}),i(f,{gap:16,direction:{base:"column",lg:"row"},children:[e(g,{flex:1,minW:0,children:e(re,{name:"firstName",control:I,render:({field:A})=>{var w;return e(L,{...A,size:"lg",label:"First name",placeholder:"First name",errorText:(w=x.firstName)==null?void 0:w.message})}})}),e(g,{flex:1,minW:0,children:e(re,{name:"lastName",control:I,render:({field:A})=>{var w;return e(L,{...A,size:"lg",label:"Last name",placeholder:"Last name",errorText:(w=x.lastName)==null?void 0:w.message})}})})]}),e(g,{w:"full",children:e(nt,{isDrawer:p,size:"lg",label:"What's your role?",placeholder:"Select",name:P.name,value:P.value,onBlur:P.onBlur,onChange:P.onChange,ref:P.ref,errorText:(U=x.occupationTypeId)==null?void 0:U.message,disabled:S,loading:S,items:F})}),y&&e(b,{textStyle:"UI.12.reg",color:"red.500",children:"We couldn't save your profile. Please try again."}),e(g,{pt:8,children:e(k,{width:"100%",type:"submit",size:"lg",variant:"filled",loading:m,disabled:m,children:"Continue"})})]})})]}):null},Oa=me({company:T().trim().notRequired(),firstName:T().trim().required("First name is required"),lastName:T().trim().required("Last name is required"),streetAddress:T().trim().required("Street address is required"),suiteApt:T().trim().notRequired(),city:T().trim().required("City is required"),state:T().trim().required("State is required"),zipCode:T().trim().required("Zip code is required"),tShirtSize:T().required("T-shirt size is required"),mobileNumber:T().trim().required("Mobile number is required")}),Ra=we(Oa),Da="https://media.filmsupply.net/Filmsupply-FM-Periodical-All-Size.webp",Ba="https://media.filmsupply.net/Filmsupply-FM-Periodical-Desktop.webp",Ua=[{label:"Small",value:"s"},{label:"Medium",value:"m"},{label:"Large",value:"l"},{label:"XL",value:"xl"}],Za={company:"",firstName:"",lastName:"",streetAddress:"",suiteApt:"",city:"",state:"",zipCode:"",tShirtSize:"",mobileNumber:""},Wa=({src:t})=>e(Et,{src:t,alt:"Filmsupply welcome gift merch",w:{base:"100%",lg:"368px"},h:{base:"270px",lg:"100%"},borderRadius:"12px",objectFit:"cover",display:"block"}),Ha=({src:t,backgroundPosition:r="center",backgroundSize:o="cover"})=>e(g,{w:"368px",h:"100%",borderRadius:"12px",backgroundImage:`url(${t})`,backgroundSize:o,backgroundPosition:r,backgroundRepeat:"no-repeat"}),qa=({onSuccess:t}={})=>{const{mutate:r,isPending:o,error:n}=de({mutationFn:So,onSuccess:t,onError:l=>{he(new Error("An error occurred while attempting to claim a gift during onboarding."),{extra:{error:l}})}});return{execute:r,isLoading:o,isError:!!n}},za=()=>{var x,C,P,M,O,F,W,U,A;const{goToNextStep:t}=Q(),r=a.useMemo(()=>["us"],[]),o=ce({base:!0,lg:!1}),{execute:n,isLoading:l,isError:c}=qa({onSuccess:t}),{handleSubmit:s,control:d,register:p,setValue:h,watch:S,formState:{errors:u}}=Ce({resolver:Ra,defaultValues:Za,reValidateMode:"onChange"}),{field:m}=Ht({name:"tShirtSize",control:d}),y=S("streetAddress"),_=async w=>{h("streetAddress",w.streetAddress,{shouldDirty:!0,shouldValidate:!0}),h("city",w.city,{shouldDirty:!0,shouldValidate:!0}),h("state",w.state,{shouldDirty:!0,shouldValidate:!0}),h("zipCode",w.zipCode,{shouldDirty:!0,shouldValidate:!0})},I=w=>{n({first_name:w.firstName,last_name:w.lastName,company_name:w.company||null,address:w.streetAddress,address2:w.suiteApt||null,city:w.city,region:w.state,postal_code:w.zipCode,t_shirt_size:w.tShirtSize,phone:w.mobileNumber})};return i(f,{children:[e(g,{display:{base:"none",lg:"block"},pt:40,pb:32,pl:32,children:e(Ha,{src:Ba})}),i(q,{w:{base:"100%",lg:"500px"},px:{base:24,lg:32},pt:40,pb:32,maxW:"100%",gap:24,children:[e(Se,{title:"Welcome to Filmsupply!",description:"Claim your complimentary Periodical below as a welcome to the community."}),e(g,{display:{base:"block",lg:"none"},children:e(Wa,{src:Da})}),e(N.form,{onSubmit:s(I),width:{base:"100%",lg:"500px"},maxW:"100%",flexShrink:0,children:i(q,{gap:24,children:[e(L,{...p("company"),size:"lg",label:"Company",placeholder:"Company",errorText:(x=u.company)==null?void 0:x.message}),i(f,{gap:"16px",direction:{base:"column",lg:"row"},children:[e(g,{flex:1,minW:0,children:e(L,{...p("firstName"),size:"lg",label:"First name",placeholder:"First name",errorText:(C=u.firstName)==null?void 0:C.message})}),e(g,{flex:1,minW:0,children:e(L,{...p("lastName"),size:"lg",label:"Last name",placeholder:"Last name",errorText:(P=u.lastName)==null?void 0:P.message})})]}),i(f,{gap:"16px",direction:{base:"column",lg:"row"},children:[e(g,{flex:1,minW:0,children:e(Bo,{value:y,errorText:(M=u.streetAddress)==null?void 0:M.message,includedReg
1ionCodes:r,onChange:w=>{h("streetAddress",w,{shouldDirty:!0,shouldValidate:!1})},onAddressSelect:_})}),e(g,{width:{base:"100%",lg:"148px"},minW:{base:0,lg:"148px"},children:e(L,{...p("suiteApt"),size:"lg",label:"Suite/Apt#",placeholder:"Suite/Apt#"})})]}),i(f,{gap:"16px",direction:{base:"column",lg:"row"},children:[e(g,{flex:1,minW:0,children:e(L,{...p("city"),size:"lg",label:"City",placeholder:"City",errorText:(O=u.city)==null?void 0:O.message})}),e(g,{flex:1,minW:0,children:e(L,{...p("state"),size:"lg",label:"State",placeholder:"State",errorText:(F=u.state)==null?void 0:F.message})}),e(g,{width:{base:"100%",lg:"148px"},minW:{base:0,lg:"148px"},children:e(L,{...p("zipCode"),size:"lg",label:"Zip/Postal Code",placeholder:"12345",errorText:(W=u.zipCode)==null?void 0:W.message})})]}),i(f,{gap:"16px",direction:{base:"column",lg:"row"},children:[e(g,{flex:1,minW:0,children:e(L,{size:"lg",label:"Country",value:"United States",disabled:!0,readOnly:!0})}),e(g,{flex:1,minW:0,children:e(nt,{isDrawer:o,size:"lg",label:"T-shirt size",placeholder:"Select",name:m.name,value:m.value,onBlur:m.onBlur,onChange:m.onChange,ref:m.ref,errorText:(U=u.tShirtSize)==null?void 0:U.message,items:Ua.map(w=>({label:w.label,value:w.value}))})}),e(g,{width:{base:"100%",lg:"148px"},minW:{base:0,lg:"148px"},children:e(L,{...p("mobileNumber"),size:"lg",label:"Mobile number",placeholder:"+1 (555) 000-0000",type:"tel",errorText:(A=u.mobileNumber)==null?void 0:A.message})})]}),c&&e(b,{textStyle:"UI.12.reg",color:"red.500",textAlign:"center",children:"We couldn't process your gift request. Please try again."}),i(f,{gap:"16px",direction:{base:"column",md:"row"},children:[e(k,{flex:1,size:"lg",variant:"outline",onClick:t,children:"No thanks!"}),e(k,{flex:1,type:"submit",size:"lg",variant:"filled",loading:l,children:"Claim My Periodical"})]}),i(b,{textAlign:"center",textStyle:"UI.12.reg",color:"text.secondary",pt:16,pb:8,children:["Shipping is currently limited to US residents.",e("br",{}),"This info will only be used to send this gift - not other marketing purposes."]})]})})]})]})},Va=({onSuccess:t}={})=>{const r=tt(),[o,n]=a.useState(Uo),{mutate:l,isPending:c,error:s}=de({mutationFn:h=>Wo({body:h}),onSuccess:()=>{r.invalidateQueries({queryKey:Zo.all.queryKey}),t==null||t()},onError:h=>{h instanceof ye||he(new Error("An error occurred while updating email preferences during onboarding."),{extra:{error:h}})}}),d=a.useCallback(h=>{n(S=>({...S,[h]:!S[h]}))},[]),p=a.useCallback(()=>{l(Ho(o))},[o,l]);return{preferences:o,handleToggle:d,savePreferences:p,isLoading:c,isError:!!s}};function ja(){const{goToNextStep:t}=Q(),{preferences:r,handleToggle:o,savePreferences:n,isLoading:l,isError:c}=Va({onSuccess:t});return i(q,{w:{base:"100%",lg:"460px"},px:{base:24,lg:32},pt:40,pb:32,maxW:"100%",gap:0,children:[e(g,{w:"100%",mb:12,children:e(Se,{title:"Set your email notification preferences"})}),qo.map(s=>e(a.Fragment,{children:i(f,{justifyContent:"space-between",alignItems:"flex-start",borderBottomWidth:1,borderColor:"border.default",py:12,_last:{borderBottomWidth:0,paddingBottom:0},children:[i(f,{direction:"column",alignItems:"flex-start",textAlign:"left",children:[e(b,{textStyle:"UI.14.reg",mb:2,color:"text.primary",children:s.title}),e(b,{textStyle:"paragraph.14.reg",color:"text.secondary",children:s.description})]}),i(f,{gap:12,children:[e(b,{textStyle:"UI.14.reg",children:r[s.key]?"On":"Off"}),e(zr,{checked:r[s.key],onChange:()=>o(s.key),size:"lg"})]})]})},s.key)),c&&e(b,{textStyle:"UI.12.reg",color:"red.500",textAlign:"center",mt:16,children:"We couldn't save your email preferences. Please try again."}),e(k,{type:"submit",variant:"filled",loading:l,disabled:l,width:"full",height:"52px",mt:24,onClick:n,children:"Continue"})]})}const $a=({onSuccess:t,onError:r}={})=>{const{mutate:o,isPending:n,isError:l}=de({mutationFn:vo,onSuccess:t,onError:s=>{if(s.status===Vr){r==null||r(s.errors);return}he(new Error("An error occurred while inviting team members during onboarding."),{extra:{error:s}})}});return{execute:a.useCallback(s=>{s.length>0&&o(s)},[o]),isLoading:n,isError:l}},Ga=({email:t,roleOptions:r,selectedRole:o,label:n="Email",placeholderEmail:l="Email",placeholderRole:c="Select role",isDisabled:s=!1,error:d,onEmailChange:p,onRoleChange:h,isOpen:S,onOpenChange:u})=>{var w,R,j,oe;const{open:m,onToggle:y,onClose:_}=Ye(),{open:I,onOpen:x,onClose:C}=Ye(),P=r.find(v=>v.value===o),M=S!==void 0?S:m,O=()=>{u?u(!M):y()},F=()=>{u?u(!1):_()},W=v=>{v||C()},U=v=>{h(v.value),F()},A=()=>{F()};return i(f,{gap:2,alignItems:"flex-start",direction:"column",flex:1,children:[e(b,{textStyle:"UI.14.semi",mb:2,children:n}),i(g,{width:"100%",children:[e(g,{hideFrom:"lg",w:"full",children:i(z,{children:[e(f,{width:"100%",children:e(L,{size:"lg",name:"email",type:"email",endElement:e(g,{mx:4,children:i(k,{gap:12,variant:"shaded",size:"md",disabled:s,onClick:x,children:[e(b,{textStyle:"UI.14.reg",children:(P==null?void 0:P.label)||c}),e(Ee,{as:mt,width:12,height:12,color:"icon.secondary"})]})}),value:t,placeholder:l,disabled:s,onChange:v=>p(v.target.value),errorText:((w=d==null?void 0:d.email)==null?void 0:w.message)||((R=d==null?void 0:d.role)==null?void 0:R.message),onPointerDownCapture:v=>v.stopPropagation(),onClick:v=>v.stopPropagation()})}),i(Lt,{placement:"bottom",open:I,onOpenChange:({open:v})=>W(v),children:[e(jr,{}),e(Nt,{children:i(Mt,{children:[e(Pt,{asChild:!0,position:"absolute",right:16,top:16,opacity:.5,children:e($r,{size:"sm",background:"transparent"})}),e(Gr,{pb:8,children:e(Tt,{textAlign:"center",children:"Select a role"})}),e(kt,{pt:0,children:e(f,{direction:"column",gap:0,children:r.map(v=>e(k,{variant:"textOnly",justifyContent:"flex-start",borderRadius:6,bg:v.value===o?"button.secondary.active":"transparent",_active:{bg:"button.secondary.active"},h:"auto",p:8,fontWeight:"normal",onClick:()=>{h(v.value),C()},children:i(f,{direction:"column",gap:"2px",alignItems:"flex-start",textWrap:"wrap",children:[e(b,{textStyle:"UI.16.reg",children:v.label}),e(b,{textStyle:"UI.14.reg",color:"text.secondary",textAlign:"left",children:v.description})]})},v.value))})})]})})]})]})}),e(g,{hideBelow:"lg",w:"full",children:i(ze,{open:M,positioning:{sameWidth:!0,placement:"bottom"},onInteractOutside:A,onSelect:U,children:[e(Ve,{asChild:!0,children:e(f,{width:"100%",children:e(L,{size:"lg",name:"email",type:"email",endElement:e(g,{mx:4,children:i(k,{gap:12,variant:"shaded",size:"md",disabled:s,onClick:O,children:[e(b,{textStyle:"UI.14.reg",children:(P==null?void 0:P.label)||c}),e(Ee,{as:mt,width:12,height:12,color:"icon.secondary"})]})}),value:t,placeholder:l,disabled:s,onChange:v=>p(v.target.value),errorText:((j=d==null?void 0:d.email)==null?void 0:j.message)||((oe=d==null?void 0:d.role)==null?void 0:oe.message),onPointerDownCapture:v=>v.stopPropagation(),onClick:v=>v.stopPropagation()})})}),e(je,{children:e($e,{maxH:265,style:{zIndex:Ke+2},children:e(f,{direction:"column",gap:0,children:r.map(v=>e(se,{value:v.value,children:i(f,{direction:"column",gap:0,children:[e(b,{textStyle:"UI.14.reg",children:v.label}),e(b,{textStyle:"UI.12.reg",color:"text.secondary",children:v.description})]})},v.value))})})})]})})]})]})},Ka=me().shape({invitees:yo().of(me().shape({email:T().trim().email("Please enter a valid email address").when("role",{is:t=>!!t,then:t=>t.required("Please enter a valid email address")}),role:T().when("email",{is:t=>!!(t!=null&&t.trim()),then:t=>t.required("Please select a role to invite this user")})},[["email","role"]]))}),Ya={invitees:[{email:"",role:void 0},{email:"",role:void 0},{email:"",role:void 0}]};function Qa(){const{goToNextStep:t}=Q(),{control:r,handleSubmit:o,setError:n,formState:{errors:l}}=Ce({resolver:we(Ka),defaultValues:Ya}),{execute:c,isLoading:s,isError:d}=$a({onSuccess:t,onError:m=>{if(m)for(const[y,_]of Object.entries(m))n(y,{message:_.join(", ")})}}),{fields:p}
1=go({control:r,name:"invitees"}),[h,S]=a.useState(null),u=m=>{var I;if(!((I=m.invitees)==null?void 0:I.some(x=>{var C;return!!((C=x==null?void 0:x.email)!=null&&C.trim())||!!(x!=null&&x.role)}))){n("invitees.0.email",{message:"Please enter a valid email address"});return}const _=(m.invitees??[]).filter(x=>!!(x!=null&&x.email&&x.role));c(_)};return i(q,{w:{base:"100%",lg:"460px"},px:{base:24,lg:32},pt:40,pb:32,maxW:"100%",gap:24,children:[e(Se,{title:"Invite your first 3 team members",description:"You can always add more later in Teams."}),e(N.form,{onSubmit:o(u),children:i(f,{direction:"column",width:"100%",gap:24,children:[p.map((m,y)=>e(g,{children:e(f,{direction:{base:"column",md:"row"},gap:2,children:e(re,{name:`invitees.${y}.email`,control:r,render:({field:_})=>e(re,{name:`invitees.${y}.role`,control:r,render:({field:I})=>{var x,C,P,M;return e(Ga,{isDisabled:s,email:_.value||"",roleOptions:zo,selectedRole:I.value||"",placeholderEmail:"Email",placeholderRole:"Select role",error:{email:(C=(x=l.invitees)==null?void 0:x[y])==null?void 0:C.email,role:(M=(P=l.invitees)==null?void 0:P[y])==null?void 0:M.role},onEmailChange:_.onChange,onRoleChange:I.onChange,isOpen:h===y,onOpenChange:O=>{S(O?y:null)}})}})})})},m.id)),d&&e(b,{textStyle:"UI.12.reg",color:"red.500",textAlign:"center",children:"We couldn't send your invitations. Please try again."}),i(f,{mt:6,direction:{base:"column",md:"row"},gap:16,width:"100%",children:[e(k,{flex:"1",size:"lg",variant:"outline",disabled:s,onClick:t,children:"Skip"}),e(k,{flex:"1",size:"lg",type:"submit",variant:"filled",disabled:s,loading:s,children:"Send invites"})]})]})})]})}function wt(){const{cropModalState:t,closeCropModal:r,proceedCropModal:o,setCroppedFile:n}=Q();return t.selectedImage?i(Pe,{w:{base:"100%",lg:"354px"},maxW:"100%",gap:24,pt:40,pb:32,children:[e(g,{textStyle:"heading.18.semi",textAlign:"center",mb:24,color:"text.primary",px:{base:24,lg:32},children:"Crop your image"}),e(Pe,{mb:24,w:{base:"full",md:"auto"},h:"auto",justifyContent:"end",children:e(Po,{sourceFile:t.selectedImage,setOutputFile:n,minImageWidth:ko,minImageHeight:To}
1)}),i(Le,{w:"100%",gap:16,px:{base:24,lg:32},children:[e(k,{variant:"outline",size:"lg",onClick:r,flex:1,children:"Back"}),e(k,{variant:"filled",size:"lg",onClick:o,flex:1,children:"Crop"})]})]}):null}function Xa(){const{closeModal:t}=Q();return e(g,{w:{base:"100%",lg:"460px"},px:{base:24,lg:32},pt:40,pb:32,maxW:"100%",gap:24,children:e(uo,{type:"success",title:"Welcome to Filmsupply",message:"Your profile and workspace are ready to go!",buttons:e(k,{size:"lg",w:"full",variant:"filled",type:"submit",mt:24,onClick:t,children:"Start browsing"})})})}function Ja(){const{activeStep:t,isActionSheetStep:r,closeModal:o,cropModalState:n,closeCropModal:l}=Q(),c=!!ce({base:!0,lg:!1}),s=t.step==="success",d=n.isOpen,p=d&&!c;return i(z,{children:[i(Ge,{open:!0,onClose:s?o:Rt,showCloseTrigger:s,placement:{base:r?"bottom":"top",lg:"center"},closeOnInteractOutside:s,preventBodyLock:!s,contentOnly:!0,maxW:"100%",w:{base:"100%",lg:"fit-content"},my:{base:0,lg:"auto"},h:{base:r?"auto":"100dvh",lg:"auto"},maxH:{base:"100dvh",lg:"unset"},borderRadius:{base:r?"2xl":0,lg:"6"},borderBottomRadius:{base:0,lg:"6"},children:[p&&e(wt,{}),e(g,{display:p?"none":void 0,children:{company:e(Fa,{}),profile:e(La,{}),gift:e(za,{}),gdpr:e(ja,{}),invite:e(Qa,{}),success:e(Xa,{})}[t.step]})]}),d&&c&&e(Ge,{open:!0,onClose:l,closeOnInteractOutside:!1,showCloseTrigger:!1,placement:{base:"bottom"},backdropProps:{zIndex:Ke+2},positionerProps:{zIndex:Ke+3},maxW:"full",borderRadius:"2xl",borderBottomRadius:0,contentOnly:!0,children:e(wt,{})})]})}const le={company:{step:"company",title:"Tell us about your company",includeInProgress:!0,usesActionSheetLayout:!1,refetchStatusOnComplete:!0},profile:{step:"profile",title:"Now, tell us about you",includeInProgress:!0,usesActionSheetLayout:!1,refetchStatusOnComplete:!0},gdpr:{step:"gdpr",title:"Set your email notification preferences",includeInProgress:!0,usesActionSheetLayout:!1,refetchStatusOnComplete:!1},invite:{step:"invite",title:"Invite your first 3 team members",includeInProgress:!0,usesActionSheetLayout:!1,refetchStatusOnComplete:!1},gift:{step:"gift",title:"Claim your welcome gift",includeInProgress:!0,usesActionSheetLayout:!1,refetchStatusOnComplete:!1},success:{step:"success",title:"Welcome to Filmsupply",includeInProgress:!1,usesActionSheetLayout:!0,refetchStatusOnComplete:!1}},ei={company:"has_completed_workspace_step",profile:"has_completed_user_step",gdpr:"has_completed_email_preference_step"};function ti(t,r,o){for(let n=0;n<t.length;n++){if(!o(t[n].step))continue;const l=ei[t[n].step];if(!l||!r[l])return n}return 0}function St(t,r,o){switch(t){case"company":return!(r!=null&&r.has_completed_workspace_step);case"profile":return!(r!=null&&r.has_completed_user_step);case"gdpr":return!(r!=null&&r.has_completed_email_preference_step);case"invite":return!!(r!=null&&r.can_invite_team);case"gift":return o&&!!(r!=null&&r.is_eligible_for_gift);default:return!0}}const ie=[le.company,le.profile,le.gdpr,le.invite,le.gift,le.success];function ri({enabled:t=!0}){const{data:r,refetch:o}=pr({enabled:t}),n=Ut("new-onboarding-gifts"),l=a.useRef(!1),c=a.useCallback(u=>St(u,r,n),[r,n]),[s,d]=a.useState(0);a.useEffect(()=>{r&&!l.current&&(l.current=!0,d(ti(ie,r,c)))},[r,c]);const p=a.useMemo(()=>({...ie[s],index:s}),[s]),h=a.useMemo(()=>{const u=ie.filter(({step:m})=>le[m].includeInProgress&&c(m));return{steps:u.map(({step:m})=>m),activeIndex:u.findIndex(({step:m})=>m===p.step)}},[p.step,c]),S=a.useCallback(async()=>{ie[s].refetchStatusOnComplete&&o();let m=s+1;for(;m<ie.length&&!St(ie[m].step,r,n);)m++;m<ie.length&&d(m)},[s,o,r,n]);return{activeStep:p,progressStepperInfo:h,goToNextStep:S,isActionSheetStep:p.usesActionSheetLayout}}function oi(){const[t,r]=a.useState({isOpen:!1,selectedImage:null,croppedFile:null,onCropComplete:null}),o=(u,m)=>{r({isOpen:!0,selectedImage:u,croppedFile:null,onCropComplete:m})},n=()=>{r({isOpen:!1,selectedImage:null,croppedFile:null,onCropComplete:null})},l=u=>{r(m=>({...m,croppedFile:u}))},c=()=>{r(u=>(u.croppedFile&&u.onCropComplete&&u.onCropComplete(u.croppedFile),{isOpen:!1,selectedImage:null,croppedFile:null,onCropComplete:null}))}
1,[s,d]=a.useState({isOpen:!1,onImageSelect:null}),p=u=>{d({isOpen:!0,onImageSelect:u})},h=a.useCallback(()=>{d({isOpen:!1,onImageSelect:null})},[]),S=a.useCallback(u=>{const{onImageSelect:m}=s;h(),m==null||m(u)},[s,h]);return{cropModalState:t,openCropModal:o,closeCropModal:n,setCroppedFile:l,proceedCropModal:c,errorModalState:s,openErrorModal:p,closeErrorModal:h,handleErrorModalGoToCrop:S}}const hr=a.createContext(void 0),Q=()=>{const t=a.useContext(hr);if(!t)throw new Error("useOnboarding must be used within an OnboardingProvider");return t},ni=({children:t})=>{const{data:r}=ee({enabled:!0}),{isAcceptInvitePending:o}=Io(),n=!!r&&(r==null?void 0:r.has_completed_onboarding)===!1&&!o,{isFetched:l}=at({email:r==null?void 0:r.email,enabled:n}),{isFetched:c}=pr({enabled:n}),s=ri({enabled:n}),d=oi(),[p,h]=a.useState(!1),S=a.useCallback(()=>h(!1),[]),[u,m]=a.useState(null);a.useEffect(()=>{(r==null?void 0:r.has_completed_onboarding)===!1&&!o&&l&&c&&h(!0)},[r==null?void 0:r.has_completed_onboarding,o,l,c]);const y=a.useMemo(()=>({...s,...d,closeModal:S,domainEnrichment:u,setDomainEnrichment:m}),[s,d,S,u]);return i(hr.Provider,{value:y,children:[t,p&&e(ue,{children:e(Ja,{})}),d.errorModalState.isOpen&&e(ue,{children:e(Mo,{open:d.errorModalState.isOpen,handleGoToChoose:d.closeErrorModal,handleGoToCrop:d.handleErrorModalGoToCrop,handleClose:d.closeErrorModal})})]})},ai=({children:t})=>e(ni,{children:t}),it=300,ol=24,ii=80,nl=64,al=20,il=1024,ll="width 0.3s, min-width 0.3s, padding 0.3s, border-right-width 0.3s",sl={borderWidth:0,borderRightWidth:"1px",borderRightColor:"gray.200",borderColor:"background.subtle.gray",borderStyle:"solid"},li=()=>Me.NAVBAR+ii,cl=()=>`calc(100vh - ${li()}px)`,dl=t=>t?it+1:0,pl=t=>t?it:108,Qe="hideBrowseFilters",Xe="browse-desktop-filters-change";let gr=!0;const si=()=>!0,ci=()=>Vo(Qe)==null?gr:!1,di=t=>(window.addEventListener(Xe,t),()=>{window.removeEventListener(Xe,t)}),pi=t=>{gr=t,t?jo(Qe):$o(Qe,"true"),window.dispatchEvent(new Event(Xe))},ui=()=>{const t=a.useSyncExternalStore(di,ci,si),r=a.useCallback(()=>pi(!t),[t]);return{isDesktopFiltersOpen:t,handleToggleDesktopFilters:r}},mi=t=>typeof t=="object"&&t!==null,hi=({onlySubFooter:t})=>{const{isDesktopFiltersOpen:r}=ui();return e(dr,{onlySubFooter:t,desktopOffsetPx:r?it:0})},ul=({children:t})=>{var p;const r=_r(),o=(p=r[r.length-1])==null?void 0:p.handle,n=mi(o)?o:{},l=n.hasHeader??!0,c=n.hasFooter??!0,s=n.onlySubFooter??!1,d=n.shouldFooterFollowBrowseFilters??!1;return e(ai,{children:i(Xr,{children:[l&&e(kn,{}),e(Qr,{children:t}),c&&(d?e(hi,{onlySubFooter:s}):e(dr,{onlySubFooter:s}))]})})},ml=({children:t,...r})=>e(Kr,{...r,children:t}),hl=({children:t})=>e(Yr,{children:t});export{hl as B,ul as L,ml as P,on as S,Te as a,ll as b,sl as c,ol as d,cl as e,li as f,dl as g,nl as h,al as i,ii as j,it as k,pl as l,il as m,ui as u};
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.