1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[681],{4923:(e,i,a)=>{a.d(i,{Q:()=>t,s:()=>n});let[n,t]=(0,a(6107).Wh)("Card")},14740:(e,i,a)=>{a.d(i,{E:()=>f});var n=a(37876),t=a(14232),r=a(26693),l=a(29185),s=a(75255),o=a(38993),d=a(16674),c=a(56044),h=a(89461),u=a(66394);let g=(0,c.B)("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),m=(0,r.Vg)("skeleton-start-color"),p=(0,r.Vg)("skeleton-end-color"),x=(0,o.i7)({from:{opacity:0},to:{opacity:1}}),y=(0,o.i7)({from:{borderColor:m.reference,background:m.reference},to:{borderColor:p.reference,background:p.reference}}),f=(0,h.R)((e,i)=>{let a={...e,fadeDuration:"number"==typeof e.fadeDuration?e.fadeDuration:.4,speed:"number"==typeof e.speed?e.speed:.8},r=(0,u.V)("Skeleton",a),o=function(){let e=(0,t.useRef)(!0);return(0,t.useEffect)(()=>{e.current=!1},[]),e.current}(),{startColor:h="",endColor:f="",isLoaded:b,fadeDuration:j,speed:k,className:v,fitContent:z,animation:S,...w}=(0,l.M)(a),[E,F]=(0,d.rd)("colors",[h,f]),A=function(e){let i=(0,t.useRef)(void 0);return(0,t.useEffect)(()=>{i.current=e},[e]),i.current}(b),C=(0,s.cx)("chakra-skeleton",v),R={...E&&{[m.variable]:E},...F&&{[p.variable]:F}};if(b){let e=o||A?"none":`${x} ${j}s`;return(0,n.jsx)(c.B.div,{ref:i,className:C,__css:{animation:e},...w})}return(0,n.jsx)(g,{ref:i,className:C,...w,__css:{width:z?"fit-content":void 0,...r,...R,_dark:{...r._dark,...R},animation:S||`${k}s linear infinite alternate ${y}`}})});f.displayName="Skeleton"},24887:(e,i,a)=>{a.d(i,{A:()=>n});let n=(0,a(17963).A)("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]])},25429:(e,i,a)=>{a.d(i,{Z:()=>c});var n=a(37876),t=a(29185),r=a(75255),l=a(4923),s=a(89461),o=a(66394),d=a(56044);let c=(0,s.R)(function(e,i){let{className:a,children:s,direction:c="column",justify:h,align:u,...g}=(0,t.M)(e),m=(0,o.o)("Card",e);return(0,n.jsx)(d.B.div,{ref:i,className:(0,r.cx)("chakra-card",a),__css:{display:"flex",flexDirection:c,justifyContent:h,alignItems:u,position:"relative",minWidth:0,wordWrap:"break-word",...m.container},...g,children:(0,n.jsx)(l.s,{value:m,children:s})})})},45412:(e,i,a)=>{a.d(i,{A:()=>n});let n=(0,a(17963).A)("Dna",[["path",{d:"m10 16 1.5 1.5",key:"11lckj"}],["path",{d:"m14 8-1.5-1.5",key:"1ohn8i"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m17 6-2.891-2.891",key:"xu6p2f"}],["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"m20 9 .891.891",key:"3xwk7g"}],["path",{d:"M3.109 14.109 4 15",key:"q76aoh"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m7 18 2.891 2.891",key:"1sisit"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}]])},46293:(e,i,a)=>{a.d(i,{A:()=>n});let n=(0,a(17963).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},62262:(e,i,a)=>{a.d(i,{A:()=>b});var n=a(37876),t=a(32985),r=a(97491),l=a(84940),s=a(79736),o=a(18387),d=a(91921),c=a(89099),h=a(80192),u=a(14136),g=a(46293),m=a(50665),p=a(3381),x=a(25527),y=a(45412),f=a(74049);function b(e){let{activeTab:i}=e,a=(0,c.useRouter)(),{membership:b}=(0,h.Z5)(),j=(null==b?void 0:b.role)==="org:admin",{billingStatus:k}=(0,f.H)(),v=[];v.push({key:"organization",label:"My Brands",icon:u.A,route:"/settings"}),v.push({key:"team",label:"Team",icon:g.A,route:"/settings/team"}),v.push({key:"social-accounts",label:"Connected Accounts",icon:m.A,route:"/settings/social-accounts"}),v.push({key:"dr-sosh",label:"Dr. Sosh",icon:p.A,route:"/settings/dr-sosh"}),j&&(null==k?void 0:k.isBillingOwner)&&v.push({key:"billing",label:"Billing",icon:x.A,route:"/settings/billing"}),j&&v.push({key:"brand-dna",label:"Brand DNA",icon:y.A,route:"/settings/brand-dna"});let z=v.findIndex(e=>e.key===i);return(0,n.jsx)(t.t,{variant:"line",mb:8,index:-1===z?0:z,children:(0,n.jsx)(r.w,{children:v.map(e=>(0,n.jsx)(l.o,{fontSize:"sm",onClick:()=>a.push(e.route),children:(0,n.jsxs)(s.z,{spacing:2,children:[(0,n.jsx)(o.I,{as:e.icon,boxSize:4}),(0,n.jsx)(d.E,{children:e.label})]})},e.key))})})}},88392:(e,i,a)=>{a.d(i,{b:()=>o});
1var n=a(37876),t=a(75255),r=a(4923),l=a(89461),s=a(56044);let o=(0,l.R)(function(e,i){let{className:a,...l}=e,o=(0,r.Q)();return(0,n.jsx)(s.B.div,{ref:i,className:(0,t.cx)("chakra-card__body",a),__css:o.body,...l})})},97873:(e,i,a)=>{a.d(i,{A:()=>B});var n=a(37876),t=a(14232),r=a(5377),l=a(24836),s=a(38061),o=a(51362),d=a(14740),c=a(59803),h=a(79736),u=a(93782),g=a(18387),m=a(91921),p=a(17523),x=a(38890),y=a(39955),f=a(42445),b=a(22426),j=a(17961),k=a(6078),v=a(84275),z=a(60851),S=a(14136);let w=(0,a(17963).A)("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);var E=a(24887),F=a(60383),A=a(67768),C=a(67914),R=a(80192),I=a(6433),O=a(74049),M=a(90068);function B(e){var i,a,B,T,$;let{onAddBrand:_,showMemberBrands:D}=e,L=(0,r.d)(),q=(0,A.jE)(),{setActive:P}=(0,R.ho)(),{organization:U}=(0,R.Z5)(),{billingStatus:W}=(0,O.H)(),{isOpen:H,onOpen:N,onClose:K}=(0,l.j)(),{isOpen:Q,onOpen:V,onClose:Z}=(0,l.j)(),X=(0,t.useRef)(null),Y=(0,t.useRef)(null),[G,J]=(0,t.useState)(null),[ee,ei]=(0,t.useState)(null),[ea,en]=(0,t.useState)(!1),[et,er]=(0,t.useState)(null),[el,es]=(0,t.useState)(null),eo=(0,s.dU)("slate.500","slate.400"),ed=(0,s.dU)("slate.400","slate.500"),ec=(0,s.dU)("slate.100","whiteAlpha.100"),eh=(0,s.dU)("brand.50","brand.900"),eu=null!=(B=null==W?void 0:W.currency)?B:"usd",eg=null!=(T=null==W?void 0:W.billingInterval)?T:"monthly",em=(0,C.I)({queryKey:["billing","brands"],queryFn:()=>I.c.getBrands(),staleTime:3e5}),ep=(0,C.I)({queryKey:["billing","brands","preview-charge"],queryFn:()=>I.c.previewBrandCharge(),enabled:Q,staleTime:3e4}),{userMemberships:ex}=(0,R.D_)({userMemberships:{pageSize:50}}),ey=null!=($=null==(i=em.data)?void 0:i.data)?$:[],ef=null==U?void 0:U.id,eb=(0,t.useMemo)(()=>{let e=new Map;if(ex.data)for(let i of ex.data)i.organization.imageUrl&&e.set(i.organization.id,i.organization.imageUrl);return e},[ex.data]),ej=new Set(ey.map(e=>e.clerkOrgId)),ek=D&&ex.data?ex.data.filter(e=>!ej.has(e.organization.id)).map(e=>({clerkOrgId:e.organization.id,name:e.organization.name,role:e.role.replace("org:",""),imageUrl:e.organization.imageUrl})):[],ev=async e=>{if(!e.isPrimary&&"FREE"===e.plan)return void L({title:"This brand space is deactivated",description:"Please reactivate it first.",status:"warning",duration:3e3});if(e.clerkOrgId!==ef){er(e.clerkOrgId);try{await P({organization:e.clerkOrgId}),L({title:"Switched to ".concat(e.name),status:"success",duration:2e3})}catch(e){L({title:"Failed to switch brand space",description:"Please try again.",status:"error",duration:3e3})}finally{er(null)}}},ez=async e=>{if(e.clerkOrgId!==ef){er(e.clerkOrgId);try{await P({organization:e.clerkOrgId}),L({title:"Switched to ".concat(e.name),status:"success",duration:2e3})}catch(e){L({title:"Failed to switch brand space",description:"Please try again.",status:"error",duration:3e3})}finally{er(null)}}},eS=async()=>{if(G){en(!0);try{await I.c.deactivateBrand(G.id),L({title:"Brand space deactivated",description:"".concat(G.name," has been deactivated."),status:"success",duration:4e3}),q.invalidateQueries({queryKey:["billing","brands"]}),q.invalidateQueries({queryKey:["billing"]}),K()}catch(e){L({title:"Failed to deactivate brand space",description:"Please try again or contact support.",status:"error",duration:4e3})}finally{en(!1)}}},ew=async()=>{if(ee){es(ee.id);try{await I.c.reactivateBrand(ee.id),L({title:"Brand space reactivated",description:"".concat(ee.name," is now active."),status:"success",duration:4e3}),q.invalidateQueries({queryKey:["billing","brands"]}),q.invalidateQueries({queryKey:["billing"]}),Z()}catch(e){L({title:"Failed to reactivate brand space",description:"Please try again or contact support.",status:"error",duration:4e3})}finally{es(null)}}};if(em.isLoading)return(0,n.jsx)(o.T,{spacing:3,align:"stretch",children:[1,2].map(e=>(0,n.jsx)(d.E,{h:"48px",borderRadius:"md"},e))});let eE="annual"===eg,eF=null==(a=ep.data)?void 0:a.data,eA=eE&&eF&&eF.recurringAmount>0&&eF.immediateCharge>eF.recurringAmount/12;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o.T,{spacing:0,align:"stretch",children:[ey.map((e,i)=>{let a=e.clerkOrgId===ef,t=!e.isPrimary&&"FREE"===e.plan;return(0,n.jsxs)(c.s,{py:3,px:3,align:"center",justify:"space-between",borderBottom:i<ey.length-1||ek.length>0?"1px solid":"none",borderColor:ec,bg:a&&!t?eh:"transparent",borderRadius:a&&!t?"lg":"none",children:[(0,n.jsxs)(h.z,{spacing:3,children:[(0,n.jsx)(u.e,{size:"xs",name:e.name,src:eb.get(e.clerkOrgId),icon:(0,n.jsx)(g.I,{as:S.A,boxSize:3}),opacity:t?.5:1}),(0,n.jsx)(m.E,{fontSize:"sm",fontWeight:"medium",fontFamily:"heading",color:t?ed:void 0,children:e.name}),e.isPrimary?(0,n.jsx)(p.E,{colorScheme:"brand",fontSize:"xs",px:2,py:.5,borderRadius:"md",children:(0,n.jsxs)(h.z,{spacing:1,children:[(0,n.jsx)(g.I,{as:w,boxSize:3}),(0,n.jsx)(m.E,{children:"Primary"})]})}):t?(0,n.jsx)(p.E,{colorScheme:"gray",fontSize:"xs",px:2,py:.5,borderRadius:"md",color:ed,children:"Deactivated"}):(0,n.jsxs)(p.E,{colorScheme:"gray",fontSize:"xs",px:2,py:.5,borderRadius:"md",children:[(0,M.$g)((0,M.XM)(eg,eu),eu),"/mo"]}),a&&!t&&(0,n.jsx)(p.E,{colorScheme:"green",fontSize:"xs",px:2,py:.5,borderRadius:"md",variant:"subtle",children:"Active"})]}),(0,n.jsx)(h.z,{spacing:2,children:t?(0,n.jsx)(x.$,{size:"xs",colorScheme:"brand",variant:"outline",onClick:()=>{ei(e),V()},isLoading:el===e.id,loadingText:"Reactivating...",fontFamily:"heading",children:"Reactivate"}):(0,n.jsxs)(n.Fragment,{children:[!a&&(0,n.jsx)(x.$,{size:"xs",variant:"ghost",leftIcon:(0,n.jsx)(g.I,{as:E.A,boxSize:3}),onClick:()=>ev(e),isLoading:et===e.clerkOrgId,loadingText:"Switching...",fontFamily:"heading",children:"Switch"}),!e.isPrimary&&(0,n.jsx)(x.$,{size:"xs",colorScheme:"red",variant:"ghost",onClick:()=>{J(e),N()},fontFamily:"heading",children:"Deactivate"})]})})]},e.id)}),ek.map((e,i)=>{let a=e.clerkOrgId===ef;return(0,n.jsxs)(c.s,{py:3,px:3,align:"center",justify:"space-between",borderBottom:i<ek.length-1?"1px solid":"none",borderColor:ec,bg:a?eh:"transparent",borderRadius:a?"lg":"none",children:[(0,n.jsxs)(h.z,{spacing:3,children:[(0,n.jsx)(u.e,{size:"xs",name:e.name,src:e.imageUrl,icon:(0,n.jsx)(g.I,{as:S.A,boxSize:3})}),(0,n.jsx)(m.E,{fontSize:"sm",fontWeight:"medium",fontFamily:"heading",children:e.name}),(0,n.jsx)(p.E,{colorScheme:"admin"===e.role?"brand":"gray",fontSize:"xs",px:2,py:.5,borderRadius:"md",textTransform:"capitalize",children:e.role}),a&&(0,n.jsx)(p.E,{colorScheme:"green",fontSize:"xs",px:2,py:.5,borderRadius:"md",variant:"subtle",children:"Active"})]}),(0,n.jsx)(h.z,{spacing:2,children:!a&&(0,n.jsx)(x.$,{size:"xs",variant:"ghost",leftIcon:(0,n.jsx)(g.I,{as:E.A,boxSize:3}),onClick:()=>ez(e),isLoading:et===e.clerkOrgId,loadingText:"Switching...",fontFamily:"heading",children:"Switch"})})]},e.clerkOrgId)}),D&&ex.isLoading&&(0,n.jsx)(d.E,{h:"48px",borderRadius:"md"})]}),(null==W?void 0:W.isBillingOwner)&&(0,n.jsx)(y.a,{mt:4,children:(0,n.jsx)(x.$,{size:"sm",variant:"outline",colorScheme:"brand",leftIcon:(0,n.jsx)(F.A,{size:14}),onClick:_,fontFamily:"heading",children:"Add a Brand Space"})}),(0,n.jsx)(f.Lt,{isOpen:H,leastDestructiveRef:X,onClose:K,isCentered:!0,children:(0,n.jsx)(b.m,{bg:"blackAlpha.600",backdropFilter:"blur(4px)",children:(0,n.jsxs)(f.EO,{borderRadius:"xl",mx:4,children:[(0,n.jsxs)(j.r,{fontFamily:"heading",fontSize:"lg",fontWeight:"bold",children:["Deactivate ",null==G?void 0:G.name,"?"]}),(0,n.jsx)(k.c,{children:(0,n.jsxs)(m.E,{fontFamily:"body",fontSize:"sm",lineHeight:"tall",children:["This brand space will lose access to all features and the ",(0,M.$g)((0,M.XM)(eg,eu),eu),"/mo charge will be removed from your subscription immediately."]})}),(0,n.jsxs)(v.j,{gap:3,children:[(0,n.jsx)(x.$,{ref:X,onClick:K,fontFamily:"heading",children:"Cancel"}),(0,n.jsx)(x.$,{colorScheme:"red",onClick:eS,isLoading:ea,loadingText:"Deactivating...",fontFamily:"heading",children:"Yes, Deactivate"})]})]})})}),(0,n.jsx)(f.Lt,{isOpen:Q,leastDestructiveRef:Y,onClose:Z,isCentered:!0,children:(0,n.jsx)(b.m,{bg:"blackAlpha.600",backdropFilter:"blur(4px)",children:(0,n.jsxs)(f.EO,{borderRadius:"xl",mx:4,children:[(0,n.jsxs)(j.r,{fontFamily:"heading",fontSize:"lg",fontWeight:"bold",children:["Reactivate ",null==ee?void 0:ee.name,"?"]}),(0,n.jsx)(k.c,{children:ep.isLoading?(0,n.jsxs)(h.z,{justify:"center",py:6,children:[(0,n.jsx)(z.y,{size:"md",color:"brand.500"}),(0,n.jsx)(m.E,{fontSize:"sm",color:eo,children:"Loading pricing details..."})]}):eF?(0,n.jsxs)(o.T,{spacing:3,align:"stretch",children:[(0,n.jsxs)(h.z,{justify:"space-between",children:[(0,n.jsx)(m.E,{fontSize:"sm",color:eo,fontFamily:"heading",children:"Immediate prorated charge"}),(0,n.jsx)(m.E,{fontSize:"sm",fontWeight:"bold",fontFamily:"heading",children:(0,M.$g)(eF.immediateCharge,eu)})]}),(0,n.jsxs)(h.z,{justify:"space-between",children:[(0,n.jsx)(m.E,{fontSize:"sm",color:eo,fontFamily:"heading",children:"Recurring"}),(0,n.jsxs)(m.E,{fontSize:"sm",fontWeight:"bold",fontFamily:"heading",children:[(0,M.$g)(eF.recurringAmount,eu),"/","annual"===eF.interval?"year":"month"]})]}),eA&&(0,n.jsx)(m.E,{fontSize:"xs",color:"amber.600",fontStyle:"italic",fontFamily:"body",children:"This is a prorated amount for the remainder of your current annual billing cycle."}),(0,n.jsx)(m.E,{fontFamily:"body",fontSize:"sm",lineHeight:"tall",pt:1,children:"This brand space will regain access to all features."})]}):(0,n.jsx)(m.E,{fontFamily:"body",fontSize:"sm",lineHeight:"tall",children:"This brand space will regain access to all features."})}),(0,n.jsxs)(v.j,{gap:3,children:[(0,n.jsx)(x.$,{ref:Y,onClick:Z,fontFamily:"heading",children:"Cancel"}),(0,n.jsxs)(x.$,{colorScheme:"brand",onClick:ew,isLoading:el===(null==ee?void 0:ee.id),loadingText:"Reactivating...",fontFamily:"heading",isDisabled:ep.isLoading,children:["Reactivate ",null==ee?void 0:ee.name]})]})]})})})]})}}}]);
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.