1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="84434b46-5d50-4897-9e67-acf605054291",e._sentryDebugIdIdentifier="sentry-dbid-84434b46-5d50-4897-9e67-acf605054291")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85413],{7823:(e,t,a)=>{"use strict";a.d(t,{O:()=>c,d:()=>d}),a(976413),a(718881);var r=a(917339),n=a(294799);let s=(0,r.F)("inline-flex items-center justify-center gap-[8px] rounded-md text-[14px] font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-[1px] focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-[16px]",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-[36px] min-w-[36px] px-[12px]",sm:"h-[32px] min-w-[32px] px-[6px]",lg:"h-[40px] min-w-[40px] px-[10px]"}},defaultVariants:{variant:"default",size:"default"}});var i=a(834023),l=a(829817);let o=(0,i.createContext)({size:"default",variant:"default"});function c({className:e,variant:t,size:a,children:s,...i}){return(0,n.jsx)(l.bL,{className:(0,r.cn)("flex items-center gap-[4px]",e),...i,children:(0,n.jsx)(o,{value:{variant:t,size:a},children:s})})}function d({className:e,children:t,variant:a,size:c,...u}){let p=(0,i.use)(o);return(0,n.jsx)(l.q7,{className:(0,r.cn)(s({variant:p.variant??a,size:p.size??c}),e),...u,children:t})}},18057:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var r=a(11241),n=a(834023);let s=e=>{let t,a,s,i,l=(0,r.c)(7),{defaultState:o,delay:c}=e,d=void 0===c?1e3:c,[u,p]=(0,n.useState)(o),m=(0,n.useRef)(void 0);l[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>()=>{void 0!==m.current&&clearTimeout(m.current)},a=[],l[0]=t,l[1]=a):(t=l[0],a=l[1]),(0,n.useEffect)(t,a),l[2]!==d?(s=()=>{p(!0),m.current=setTimeout(()=>{p(!1)},d)},l[2]=d,l[3]=s):s=l[3];let x=s;return l[4]!==x||l[5]!==u?(i={toggleValue:u,setToggleValue:p,toggle:x},l[4]=x,l[5]=u,l[6]=i):i=l[6],i}},36370:(e,t,a)=>{"use strict";a.r(t),a.d(t,{SubscriptionManagementBanner:()=>er,UsageDashboard:()=>en});var r=a(294799),n=a(11241),s=a(917339),i=a(439502),l=a(136638),o=a(534425),c=a(166457),d=a(926518),u=a(33031),p=a(99873),m=a(789545),x=a(103967),b=a(475814),g=a(1205),y=a(706023),f=a(904997),h=a(971677);function _({integration:e,subType:t,imageOverride:a}){return{name:e?(0,y.Rx)(e).name:(0,h.N)(t.replace("_"," ").toLowerCase()),thumbnail:a??(({type:e,subType:t})=>{switch(e){case u.CreditTransactionType.INTEGRATION_USAGE:case u.CreditTransactionType.GENERATION_USAGE:return`/images/integrations/${(0,f.k)(t)}.png`;default:return e}})({type:u.CreditTransactionType.INTEGRATION_USAGE,subType:t}),description:e?(0,y.Rx)(e).description:""}}let N={[u.CreditTransactionSubType.CHAT_GPT]:_({integration:y.n3.CHAT_GPT,subType:u.CreditTransactionSubType.CHAT_GPT,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI]:_({integration:y.n3.GOOGLE_GEMINI,subType:u.CreditTransactionSubType.GOOGLE_GEMINI,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_1_5]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_1_5,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_1_5_FLASH]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_1_5_FLASH,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_2_0_FLASH]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_2_0_FLASH,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_2_5_FLASH]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_2_5_FLASH,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_2_5_FLASH_LITE]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_2_5_FLASH_LITE,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_2_5_PRO]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_2_5_PRO,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_3_0_PRO]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_3_0_PRO,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_3_0_FLASH]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_3_0_FLASH,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_3_1_PRO]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_3_1_PRO,imageOverride:null}),[u.CreditTransactionSubType.GOOGLE_GEMINI_SNOWBALL]:_({integration:null,subType:u.CreditTransactionSubType.GOOGLE_GEMINI_SNOWBALL,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE]:_({integration:y.n3.ANTHROPIC_CLAUDE,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET]:_({integration:y.n3.ANTHROPIC_CLAUDE_SONNET,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_3_5]:_({integration:y.n3.ANTHROPIC_CLAUDE_SONNET_3_5,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_3_5,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_4]:_({integration:y.n3.ANTHROPIC_CLAUDE_SONNET_4,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_4,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_4_5]:_({integration:y.n3.ANTHROPIC_CLAUDE_SONNET_4_5,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_4_5,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_1]:_({integration:y.n3.ANTHROPIC_CLAUDE_OPUS_4_1,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_1,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_5]:_({integration:null,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_5,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_6]:_({integration:y.n3.ANTHROPIC_CLAUDE_OPUS_4_6,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_6,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_7]:_({integration:y.n3.ANTHROPIC_CLAUDE_OPUS_4_7,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_7,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_8]:_({integration:y.n3.ANTHROPIC_CLAUDE_OPUS_4_8,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_4_8,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_5]:_({integration:y.n3.ANTHROPIC_CLAUDE_OPUS_5,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_OPUS_5,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_FABLE_5]:_({integration:y.n3.ANTHROPIC_CLAUDE_FABLE_5,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_FABLE_5,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_4_6]:_({integration:null,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_SONNET_4_6,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_HAIKU_4_5]:_({integration:null,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_HAIKU_4_5,imageOverride:null}),[u.CreditTransactionSubType.ANTHROPIC_CLAUDE_HAIKU]:_({integration:y.n3.ANTHROPIC_CLAUDE_HAIKU,subType:u.CreditTransactionSubType.ANTHROPIC_CLAUDE_HAIKU,imageOverride:null}),[u.CreditTransactionSubType.GROQ]:_({integration:y.n3.GROQ,subType:u.CreditTransactionSubType.GROQ,imageOverride:null}),[u.CreditTransactionSubType.REKA]:_({integration:y.n3.REKA,subType:u.CreditTransactionSubType.REKA,imageOverride:null}),[u.CreditTransactionSubType.COHERE_COMMAND_R_PLUS]:_({integration:y.n3.COHERE_COMMAND_R_PLUS,subType:u.CreditTransactionSubType.COHERE_COMMAND_R_PLUS,imageOverride:null}),[u.CreditTransactionSubType.DEEPSEEK_V3]:_({integration:null,subType:u.CreditTransactionSubType.DEEPSEEK_V3,imageOverride:null}
1),[u.CreditTransactionSubType.DALL_E_3]:_({integration:null,subType:u.CreditTransactionSubType.DALL_E_3,imageOverride:null}),[u.CreditTransactionSubType.STABLE_DIFFUSION_V3_MEDIUM]:_({integration:null,subType:u.CreditTransactionSubType.STABLE_DIFFUSION_V3_MEDIUM,imageOverride:"/images/integrations/stable-diffusion-v-3.png"}),[u.CreditTransactionSubType.FAST_LIGHTNING_SDXL]:_({integration:null,subType:u.CreditTransactionSubType.FAST_LIGHTNING_SDXL,imageOverride:null}),[u.CreditTransactionSubType.RAPID_API]:_({integration:null,subType:u.CreditTransactionSubType.RAPID_API,imageOverride:null}),[u.CreditTransactionSubType.RELACE]:_({integration:null,subType:u.CreditTransactionSubType.RELACE,imageOverride:null}),[u.CreditTransactionSubType.MORPH]:_({integration:null,subType:u.CreditTransactionSubType.MORPH,imageOverride:null}),[u.CreditTransactionSubType.XAI_GROK_4]:_({integration:y.n3.GROK_4_0709,subType:u.CreditTransactionSubType.XAI_GROK_4,imageOverride:"/images/integrations/grok-4-0709.png"}),[u.CreditTransactionSubType.GROQ_KIMI_K2]:_({integration:null,subType:u.CreditTransactionSubType.GROQ_KIMI_K2,imageOverride:null}),[u.CreditTransactionSubType.SMS_VERIFY]:_({integration:y.n3.SMS_VERIFY,subType:u.CreditTransactionSubType.SMS_VERIFY,imageOverride:"/images/integrations/sapiom-verify.png"}),[u.CreditTransactionSubType.MOONSHOT_KIMI_K2_5]:_({integration:null,subType:u.CreditTransactionSubType.MOONSHOT_KIMI_K2_5,imageOverride:null}),[u.CreditTransactionSubType.MOONSHOT_KIMI_K2_6]:_({integration:null,subType:u.CreditTransactionSubType.MOONSHOT_KIMI_K2_6,imageOverride:null}),[u.CreditTransactionSubType.GALAPAGOS_ALPHA]:_({integration:null,subType:u.CreditTransactionSubType.GALAPAGOS_ALPHA,imageOverride:null}),[u.CreditTransactionSubType.ROCKHOPPER_ALPHA]:_({integration:null,subType:u.CreditTransactionSubType.ROCKHOPPER_ALPHA,imageOverride:null}),[u.CreditTransactionSubType.GALAPAGOS_MINI_ALPHA]:_({integration:null,subType:u.CreditTransactionSubType.GALAPAGOS_MINI_ALPHA,imageOverride:null}),[u.CreditTransactionSubType.FIREWORKS_DEEPSEEK]:_({integration:null,subType:u.CreditTransactionSubType.FIREWORKS_DEEPSEEK,imageOverride:null}),[u.CreditTransactionSubType.FIREWORKS_DESIGN]:_({integration:null,subType:u.CreditTransactionSubType.FIREWORKS_DESIGN,imageOverride:null}),[u.CreditTransactionSubType.FIREWORKS_GLM]:_({integration:null,subType:u.CreditTransactionSubType.FIREWORKS_GLM,imageOverride:null}),[u.CreditTransactionSubType.FIREWORKS_QWEN3]:_({integration:null,subType:u.CreditTransactionSubType.FIREWORKS_QWEN3,imageOverride:null})};function T(e){let t,a,i,l,o,c,d,u,p,m,y,f=(0,n.c)(23),{usages:h,loading:_}=e;if(f[0]!==_||f[1]!==h){p=Symbol.for("react.early_return_sentinel");e:{let e=Object.entries(h.reduce(j,{}));if(0===e.length&&!_){p=null;break e}t=g.BoneyardSkeleton,l="aggregate-usage-table",o=_,f[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,r.jsx)(C,{}),f[11]=c):c=f[11],d=null,u=null,a="flex flex-col gap-[12px] pb-[6px]",i=e.map(t=>{let[a,n]=t;return(0,r.jsxs)("div",{children:[e.length>1&&(0,r.jsx)(x.E,{type:"body-md",weight:"bold",children:a.split("_").map(b.Z).join(" ")}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:(0,s.cn)("flex flex-row gap-[8px] py-[14px]"),children:[(0,r.jsx)("div",{className:"col-span-3 flex basis-4/12 flex-col justify-center gap-[8px]",children:(0,r.jsx)(x.E,{type:"body-sm",className:"text-comeback-gray-500 uppercase",weight:"medium",children:"Integration"})}),(0,r.jsx)("div",{className:"flex basis-4/12 items-center justify-end",children:(0,r.jsx)(x.E,{type:"body-sm",className:"text-right text-comeback-gray-500 uppercase",weight:"medium",children:"Credits Used"})}),(0,r.jsx)("div",{className:"flex basis-4/12 items-center justify-end",children:(0,r.jsx)(x.E,{type:"body-sm",className:"text-right text-comeback-gray-500 uppercase",weight:"medium",children:"Average Credits per Run"})})]}),n.map(v)]})]},`${a}-index`)})}f[0]=_,f[1]=h,f[2]=t,f[3]=a,f[4]=i,f[5]=l,f[6]=o,f[7]=c,f[8]=d,f[9]=u,f[10]=p}else t=f[2],a=f[3],i=f[4],l=f[5],o=f[6],c=f[7],d=f[8],u=f[9],p=f[10];return p!==Symbol.for("react.early_return_sentinel")?p:(f[12]!==a||f[13]!==i?(m=(0,r.jsx)("div",{className:a,children:i}),f[12]=a,f[13]=i,f[14]=m):m=f[14],f[15]!==t||f[16]!==l||f[17]!==o||f[18]!==c||f[19]!==d||f[20]!==u||f[21]!==m?(y=(0,r.jsx)(t,{name:l,loading:o,fallback:c,className:d,fixture:u,children:m}),f[15]=t,f[16]=l,f[17]=o,f[18]=c,f[19]=d,f[20]=u,f[21]=m,f[22]=y):y=f[22],y)}function v(e){if(!e.subType||e.subType===u.CreditTransactionSubType.GPT_IMAGE_1||e.subType===u.CreditTransactionSubType.GPT_IMAGE_1_5||e.subType===u.CreditTransactionSubType.GOOGLE_GEMINI_2_5_FLASH_IMAGE||e.subType===u.CreditTransactionSubType.GOOGLE_GEMINI_3_1_FLASH_IMAGE||e.subType===u.CreditTransactionSubType.QUIVER_ARROW)return null;let{name:t,thumbnail:a}=N[e.subType];return(0,r.jsxs)("div",{className:(0,s.cn)("flex flex-row gap-[8px] border-comeback-gray-50 border-t py-[14px]"),children:[(0,r.jsx)("div",{className:"col-span-3 flex basis-4/12 flex-col justify-center gap-[8px]",children:(0,r.jsxs)("div",{className:"flex flex-row items-center gap-[4px]",children:[(0,r.jsx)("img",{src:a,width:20,height:20,alt:t}),(0,r.jsx)(x.E,{type:"body-md",className:"text-comeback-gray-900",children:t})]})}),(0,r.jsx)("div",{className:"flex basis-4/12 items-center justify-end",children:(0,r.jsx)(x.E,{type:"body-md",className:"text-comeback-gray-900",children:(0,d.EU)(e.amount)})}),(0,r.jsx)("div",{className:"flex basis-4/12 items-center justify-end",children:(0,r.jsxs)("div",{className:"flex flex-row desktop:items-center gap-[4px]",children:[(0,r.jsx)("div",{className:"desktop:mt-0 mt-[4px]",children:(0,r.jsx)(m.I,{size:"xs",content:p.tW,className:"text-comeback-gray-500"})}),(0,r.jsx)(x.E,{type:"body-md",className:"text-comeback-gray-500",children:(0,d.EU)(BigInt(e.average))})]})})]},N[e.subType].name)}function j(e,t){return void 0===e[t.type]&&(e[t.type]=[]),e[t.type]?.push(t),e}function C(){let e,t=(0,n.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("div",{className:"flex flex-col gap-[16px]",children:[0,1,2].map(S)}),t[0]=e):e=t[0],e}function S(e){return(0,r.jsx)("div",{className:"h-[12px] w-full rounded-[4px] bg-comeback-gray-50"},e)}var w=a(309894),E=a(508511);let O={[u.CreditTransactionType.GENERATION_USAGE]:"Generations",[u.CreditTransactionType.INTEGRATION_USAGE]:"Integrations",[u.CreditTransactionType.START_GENERATION]:"Generations"};function I(e){let t,a,i,l,o=(0,n.c)(11),{usages:c,loading:p,setOpenGenerationHistory:m}=e;if(o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)(A,{}),o[0]=t):t=o[0],o[1]!==m||o[2]!==c){let e;o[4]!==m?(e=e=>(0,r.jsxs)("div",{className:(0,s.cn)("flex grow flex-col gap-[8px] rounded-[8px] border-[1px] border-comeback-gray-75 px-[20px] py-[20px]"),children:[e.type===u.CreditTransactionType.GENERATION_USAGE?(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,r.jsx)(x.E,{weight:"medium",className:"text-comeback-gray-900",children:"Generations"}),(0,r.jsx)(w.Button,{color:"light",size:"sm",className:"border-none p-[4px]",onClick:()=>{m(!0)},iconRight:(0,r.jsx)(E.c,{size:12}),children:(0,r.jsx)(x.E,{type:"body-sm",className:"text-comeback-gray-500",children:"View History"})})]}):(0,r.jsx)(x.E,{weight:"medium",className:"text-comeback-gray-900",children:O[e.type]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(x.E,{weight:"medium",type:"display-lg",className:"text-comeback-gray-900",children:(0,d.EU)(e.amount)}),(0,r.jsx)(x.E,{type:"body-sm",className:"text-comeback-gray-500",children:"credits used this month"})]})]},e.type),o[4]=m,o[5]=e):e=o[5],a=c.filter(k).map(e),o[1]=m,o[2]=c,o[3]=a}else a=o[3];return o[6]!==a?(i=(0,r.jsx)("div",{className:"flex tablet:flex-row flex-col gap-[24px]",children:a}),o[6]=a,o[7]=i):i=o[7],o[8]!==p||o[9]!==i?(l=(0,r.jsx)(g.BoneyardSkeleton,{name:"usages-by-type-cards",loading:p,fallback:t,className:null,fixture:null,children:i}),o[8]=p,o[9]=i,o[10]=l):l=o[10],l}function k(e){return O[e.type]}function A(){let e,t=(0,n.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("div",{className:"flex flex-row gap-[24px]",children:[0,1].map(P)}),t[0]=e):e=t[0],e}function P(e){return(0,r.jsxs)("div",{className:"flex grow flex-col gap-[16px] rounded-[8px] border-[1px] border-comeback-gray-75 px-[20px] py-[20px]",children:[(0,r.jsx)("div",{className:"h-[12px] w-full rounded-[4px] bg-comeback-gray-50"}),(0,r.jsx)("div",{className:"h-[12px] w-full rounded-[4px] bg-comeback-gray-50"}),(0,r.jsx)("div",{className:"h-[12px] w-full rounded-[4px] bg-comeback-gray-50"})]},e)}var U=a(859144),L=a(482515),R=a(182720),D=a(421455),G=a(751355),M=a(238662),z=a(814121),H=a(728800),F=a(798812),B=a(985413),$=a(451286),K=a(550838),W=a(834023),V=a(7823);let Y=(0,G.U)(`
2 query GetOrganizationSettingsForAutoTopUp($id: ID!) { 3 organizationById(id: $id) { 4 id 5 plan 6 settings { 7 autoTopUpEnabled 8 autoTopUpThreshold 9 autoTopUpAmount 10 monthlySpendCap 11 } 12 } 13 } 14`),q=(0,G.U)(` 15 mutation UpdateAutoTopUpSettings($input: UpdateAutoTopUpSettingsInput!) { 16 updateAutoTopUpSettings(input: $input) { 17 success 18 clientSecret 19 } 20 } 21`);function X(e){let t,a,s,i,l,o=(0,n.c)(21),{dollars:c,onCommit:u,showCredits:p,useNewCreditBasis:m}=e,x=(0,d.Pn)(c),b=p?m?x:Math.round(x/1e3*10)/10:c;o[0]!==b||o[1]!==c||o[2]!==u||o[3]!==p||o[4]!==m?(t=e=>{let t=Number(e.target.value);if(Number.isNaN(t)||t<0){e.target.value=String(b);return}let a=p?Math.round((0,d.nc)(m?t:1e3*t)):Math.round(t);e.target.value=p?String(t):String(Math.round(t)),a!==c&&u(a)},o[0]=b,o[1]=c,o[2]=u,o[3]=p,o[4]=m,o[5]=t):t=o[5];let g=t;o[6]!==p?(a=p?null:(0,r.jsx)("span",{className:"text-[14px] text-comeback-gray-400",children:"$"}),o[6]=p,o[7]=a):a=o[7];let y=`${b}-${p}`,f=m||!p?"1":"0.1",h=`bg-transparent text-[14px] text-comeback-gray-900 outline-none ring-offset-background focus-visible:ring-[2px] focus-visible:ring-ring focus-visible:ring-offset-[2px] [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none ${p?"w-[64px] text-right":"w-[80px] text-left"}`;return o[8]!==b||o[9]!==g||o[10]!==y||o[11]!==f||o[12]!==h?(s=(0,r.jsx)("input",{"aria-label":"Auto top-up amount",name:"topup-amount",type:"number",step:f,defaultValue:b,onBlur:g,onKeyDown:J,className:h},y),o[8]=b,o[9]=g,o[10]=y,o[11]=f,o[12]=h,o[13]=s):s=o[13],o[14]!==p||o[15]!==m?(i=p?(0,r.jsx)("span",{className:"pl-[1px] text-[14px] text-comeback-gray-400",children:m?"credits":"K credits"}):null,o[14]=p,o[15]=m,o[16]=i):i=o[16],o[17]!==a||o[18]!==s||o[19]!==i?(l=(0,r.jsxs)("div",{className:"flex items-center gap-[2px] rounded-sm bg-comeback-gray-25 p-[2px]",children:[a,s,i]}),o[17]=a,o[18]=s,o[19]=i,o[20]=l):l=o[20],l}function J(e){"Enter"===e.key&&e.currentTarget.blur()}let Z=e=>{let t,a,s,l,o,c,p,m,b,g,y,f,h,_,N,T,v,j,C,S,E,O,I,k,A,P,U,L,G,J=(0,n.c)(76),{organizationId:Z}=e;J[0]!==Z?(t={variables:{id:Z}},J[0]=Z,J[1]=t):t=J[1];let{data:Q}=(0,M.U)(Y,t),[ee]=(0,z.n)(q),et=Q?.organizationById,ea=et?.plan,er=et?.settings,en=er?.autoTopUpEnabled===!0;J[2]!==er?(a=er?.autoTopUpAmount?(0,d.yt)(BigInt(er.autoTopUpAmount)):25,J[2]=er,J[3]=a):a=J[3];let es=a;J[4]!==er?(s=er?.monthlySpendCap?(0,d.yt)(BigInt(er.monthlySpendCap)):100,J[4]=er,J[5]=s):s=J[5];let ei=s,[el,eo]=(0,W.useState)(en),[ec,ed]=(0,W.useState)(es),[eu,ep]=(0,W.useState)(ei),{resetHumanCreditBasis:em}=(0,i.Wi)(),ex=void 0!==em&&em,[eb,eg]=(0,W.useState)(!1),[ey,ef]=(0,W.useState)(null),[eh,e_]=(0,W.useState)(!1),eN=(0,W.useRef)(void 0);J[6]===Symbol.for("react.memo_cache_sentinel")?(l=()=>()=>clearTimeout(eN.current),o=[],J[6]=l,J[7]=o):(l=J[6],o=J[7]),(0,W.useEffect)(l,o),J[8]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{clearTimeout(eN.current),e_(!0),eN.current=setTimeout(()=>e_(!1),2e3)},J[8]=c):c=J[8];let eT=c,{sendToast:ev}=(0,D.A)(),{open:ej}=(0,B.W)(),eC=(0,W.useRef)(!1);J[9]!==Z||J[10]!==ev||J[11]!==es||J[12]!==ei||J[13]!==en||J[14]!==ee?(p=(e,t)=>{ee({variables:{input:{organizationId:Z,enabled:e.enabled,topUpAmountDollars:e.topUpAmountDollars,thresholdDollars:10,monthlySpendCapDollars:e.monthlySpendCapDollars,defaultPaymentMethodId:t}}}).then(t=>{let a=t.data?.updateAutoTopUpSettings.clientSecret??null;if(!a)return void eT();eC.current=!1;let n=()=>{H.w.off("closeModal",n),eC.current||(eo(en),ed(es),ep(ei))};H.w.on("closeModal",n),H.w.emit("openModal",(0,r.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-[16px] p-[16px] tablet:h-[850px] tablet:w-[600px]",children:(0,r.jsx)(F.A,{clientSecret:a,onComplete:async t=>{eC.current=!0;let a="string"==typeof t.payment_method?t.payment_method:t.payment_method?.id??null;H.w.emit("closeModal",void 0),p(e,a)}})}))}).catch(e=>{$.Cp(e),ev("Failed to update settings. Try again.",{variant:"error"}),eo(en),ed(es),ep(ei)})},J[9]=Z,J[10]=ev,J[11]=es,J[12]=ei,J[13]=en,J[14]=ee,J[15]=p):p=J[15],J[16]!==el||J[17]!==eu||J[18]!==p||J[19]!==ec?(m=e=>{let t={enabled:el,topUpAmountDollars:ec,monthlySpendCapDollars:eu,...e};t.topUpAmountDollars<u.MIN_TOP_UP_DOLLARS||t.topUpAmountDollars>u.MAX_TOP_UP_DOLLARS?ef(`Top-up amount must be between $${u.MIN_TOP_UP_DOLLARS} and $${u.MAX_TOP_UP_DOLLARS}.`):t.monthlySpendCapDollars<t.topUpAmountDollars?ef("Monthly spending limit must be at least the top-up amount."):t.monthlySpendCapDollars>u.MAX_MONTHLY_CAP_DOLLARS?ef(`Monthly spending limit must be $${u.MAX_MONTHLY_CAP_DOLLARS.toLocaleStr
21ing()} or less.`):(ef(null),p(t,null))},J[16]=el,J[17]=eu,J[18]=p,J[19]=ec,J[20]=m):m=J[20];let eS=m;J[21]!==eb||J[22]!==ex?(b=eb?ex?`${(0,d.uK)(10)} credits`:`${Math.round((0,d.Pn)(10)/1e3*10)/10}K credits`:"$10",J[21]=eb,J[22]=ex,J[23]=b):b=J[23];let ew=b;if(!ea||!(0,u.isPaidPlan)(ea)){let e,t;return J[24]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[12px]",children:[(0,r.jsx)("div",{className:"flex h-[36px] w-[36px] shrink-0 items-center justify-center rounded-[8px] bg-comeback-gray-50",children:(0,r.jsx)(K.f,{className:"text-comeback-gray-900",size:18})}),(0,r.jsx)(x.E,{type:"body-md",weight:"medium",className:"text-comeback-gray-900",children:"Auto Top-Up"})]}),(0,r.jsx)(x.E,{type:"body-md",weight:"regular",className:"pl-[48px] text-comeback-gray-500",children:"Automatically purchase credits when your balance runs low"})]}),J[24]=e):e=J[24],J[25]!==ej||J[26]!==Z?(t=(0,r.jsx)("div",{className:"flex w-full flex-col rounded-[8px] border border-comeback-gray-75 p-[20px]",children:(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between gap-[8px]",children:[e,(0,r.jsx)(w.Button,{color:"dark",size:"sm",className:"w-fit",onPress:()=>{ej({title:"Join Pro",subTitle:"Upgrade to a paid plan to enable auto top-up and never run out of credits.",description:null,organizationId:Z,source:"auto_top_up"})},children:"Upgrade"})]})}),J[25]=ej,J[26]=Z,J[27]=t):t=J[27],t}J[28]===Symbol.for("react.memo_cache_sentinel")?(g=(0,r.jsxs)("div",{className:"flex items-center gap-[12px]",children:[(0,r.jsx)("div",{className:"flex h-[36px] w-[36px] shrink-0 items-center justify-center rounded-[8px] bg-comeback-gray-50",children:(0,r.jsx)(K.f,{className:"text-comeback-gray-900",size:18})}),(0,r.jsx)(x.E,{type:"body-md",weight:"medium",className:"text-comeback-gray-900",children:"Auto Top-Up"})]}),J[28]=g):g=J[28],J[29]===Symbol.for("react.memo_cache_sentinel")?(y=(0,r.jsx)(x.E,{type:"body-md",weight:"regular",className:"text-comeback-gray-500",children:"Automatically purchase credits when your balance runs low"}),J[29]=y):y=J[29],J[30]!==eS?(f=e=>{eo(e),eS({enabled:e})},J[30]=eS,J[31]=f):f=J[31],J[32]!==el||J[33]!==f?(h=(0,r.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[g,(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between gap-[8px] pl-[48px]",children:[y,(0,r.jsx)(R.l,{checked:el,onCheckedChange:f,color:"green"})]})]}),J[32]=el,J[33]=f,J[34]=h):h=J[34],J[35]===Symbol.for("react.memo_cache_sentinel")?(_=(0,r.jsx)(x.E,{type:"body-sm",weight:"regular",className:"text-comeback-gray-400",children:"Display"}),J[35]=_):_=J[35];let eE=eb?"credits":"usd";J[36]===Symbol.for("react.memo_cache_sentinel")?(N=e=>{e&&eg("credits"===e)},J[36]=N):N=J[36],J[37]===Symbol.for("react.memo_cache_sentinel")?(T=(0,r.jsx)(V.d,{value:"usd","aria-label":"USD ($)",className:"flex-1",children:"USD ($)"}),v=(0,r.jsx)(V.d,{value:"credits","aria-label":"Credits",className:"flex-1",children:"Credits"}),J[37]=T,J[38]=v):(T=J[37],v=J[38]),J[39]!==eE?(j=(0,r.jsxs)("div",{className:"flex w-full flex-col gap-1",children:[_,(0,r.jsxs)(V.O,{type:"single",variant:"outline",size:"sm",value:eE,onValueChange:N,className:"w-full rounded-[8px] bg-comeback-gray-50",children:[T,v]})]}),J[39]=eE,J[40]=j):j=J[40],J[41]===Symbol.for("react.memo_cache_sentinel")?(C=(0,r.jsx)(x.E,{type:"body-md",weight:"regular",className:"text-comeback-gray-500",children:"Monthly spending limit"}),J[41]=C):C=J[41],J[42]!==eS?(S=e=>{ep(e),eS({monthlySpendCapDollars:e})},J[42]=eS,J[43]=S):S=J[43],J[44]!==eu||J[45]!==eb||J[46]!==S||J[47]!==ex?(E=(0,r.jsxs)("div",{className:"flex items-center justify-between px-[16px] py-[12px]",children:[C,(0,r.jsx)(X,{dollars:eu,onCommit:S,showCredits:eb,useNewCreditBasis:ex})]}),J[44]=eu,J[45]=eb,J[46]=S,J[47]=ex,J[48]=E):E=J[48],J[49]!==el||J[50]!==eS||J[51]!==eb||J[52]!==ec||J[53]!==ex?(O=el?(0,r.jsxs)("div",{className:"flex items-center justify-between px-[16px] py-[12px]",children:[(0,r.jsx)(x.E,{type:"body-md",weight:"regular",className:"text-comeback-gray-500",children:"Amount of each top-up"}),(0,r.jsx)(X,{dollars:ec,onCommit:e=>{ed(e),eS({topUpAmountDollars:e})},showCredits:eb,useNewCreditBasis:ex})]}):null,J[49]=el,J[50]=eS,J[51]=eb,J[52]=ec,J[53]=ex,J[54]=O):O=J[54],J[55]!==E||J[56]!==O?(I=(0,r.jsxs)("div",{className:"flex flex-col divide-y divide-comeback-gray-75 rounded-[8px] border border-comeback-gray-75",children:[E,O]}),J[55]=E,J[56]=O,J[57]=I):I=J[57];let eO=el?`Auto top-up triggers when your balance falls below ${ew}. The monthly limit also applies to one-time credit purchases.`:"This monthly limit applies to one-time credit purchases. Raise it here if Buy credits is blocked.";J[58]!==eO?(k=(0,r.jsx)(x.E,{type:"body-sm",weight:"regular",className:"text-comeback-gray-400",children:eO}),J[58]=eO,J[59]=k):k=J[59];let eI=`text-comeback-red-500 ${ey?"visible":"invisible"}`,ek=ey??"\xa0";J[60]!==eI||J[61]!==ek?(A=(0,r.jsx)(x.E,{type:"body-sm",weight:"regular","aria-live":"polite",className:eI,children:ek}),J[60]=eI,J[61]=ek,J[62]=A):A=J[62];let eA=`text-comeback-gray-500 transition-opacity duration-300 ${eh?"opacity-100":"opacity-0"}`;return J[63]!==eA?(P=(0,r.jsx)(x.E,{type:"body-sm",weight:"regular",className:eA,children:"Saved"}),J[63]=eA,J[64]=P):P=J[64],J[65]!==A||J[66]!==P?(U=(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[A,P]}),J[65]=A,J[66]=P,J[67]=U):U=J[67],J[68]!==j||J[69]!==I||J[70]!==k||J[71]!==U?(L=(0,r.jsxs)("div",{className:"mt-[20px] flex flex-col gap-[12px] border-comeback-gray-75 border-t pt-[20px]",children:[j,I,k,U]}),J[68]=j,J[69]=I,J[70]=k,J[71]=U,J[72]=L):L=J[72],J[73]!==h||J[74]!==L?(G=(0,r.jsxs)("div",{className:"flex w-full flex-col rounded-[8px] border border-comeback-gray-75 p-[20px]",children:[h,L]}),J[73]=h,J[74]=L,J[75]=G):G=J[75],G};var Q=a(510822);let ee=(0,G.U)(` 22 query GetAggregatedUsageByOrganizationId( 23 $id: ID! 24 $startDate: DateTimeISO! 25 $endDate: DateTimeISO! 26 ) {
27 organizationById(id: $id) { 28 id 29 aggregatedIntegrationCreditUsageBySubType( 30 startDate: $startDate 31 endDate: $endDate 32 ) { 33 total 34 usages { 35 amount 36 average 37 type 38 subType 39 } 40 } 41 aggregatedCreditUsageByType(startDate: $startDate, endDate: $endDate) { 42 total 43 usages { 44 amount 45 average 46 type 47 subType 48 } 49 } 50 } 51 } 52`),et=(0,l.w)(new Date),ea=(0,o.p)(new Date),er=e=>{let t,a,i,l,o,c,d,u,p,m,b,g,y,f=(0,n.c)(29),{variant:h,className:_}=e,N=void 0===h?"dashboard":h;f[0]!==_?(t=(0,s.cn)("flex flex-col gap-[12px] rounded-[16px] border border-comeback-gray-50 bg-[#F6F6F6]",_),f[0]=_,f[1]=t):t=f[1];let T="pricing"===N&&"gap-[32px]";f[2]!==T?(a=(0,s.cn)("flex flex-col gap-[12px] px-[20px] py-[20px] tablet:pl-[20px]",T),f[2]=T,f[3]=a):a=f[3];let v="pricing"===N&&"desktop:text-display-sm text-display-xs";f[4]!==v?(i=(0,s.cn)(v),f[4]=v,f[5]=i):i=f[5],f[6]!==i?(l=(0,r.jsx)(x.E,{type:"display-md",weight:"semibold",className:i,children:"Manage your subscription in the iOS App"}),f[6]=i,f[7]=l):l=f[7];let j="pricing"===N&&"gap-[16px] tablet:gap-[4px]";f[8]!==j?(o=(0,s.cn)("flex w-fit flex-col",j),f[8]=j,f[9]=o):o=f[9],f[10]===Symbol.for("react.memo_cache_sentinel")?(c=(0,r.jsx)(x.E,{type:"body-md",weight:"regular",className:"text-comeback-gray-700",children:"You have subscribed through the iOS App."}),d=(0,r.jsx)(x.E,{type:"body-md",weight:"regular",className:"text-comeback-gray-700",children:"Apple requires subscription changes to be managed on iPhone."}),f[10]=c,f[11]=d):(c=f[10],d=f[11]),f[12]!==o?(u=(0,r.jsxs)("div",{className:o,children:[c,d]}),f[12]=o,f[13]=u):u=f[13],f[14]!==u||f[15]!==a||f[16]!==l?(p=(0,r.jsxs)("div",{className:a,children:[l,u]}),f[14]=u,f[15]=a,f[16]=l,f[17]=p):p=f[17];let C="pricing"===N?350:295,S="pricing"===N&&"w-[350px]";return f[18]!==S?(m=(0,s.cn)("ml-auto tablet:block hidden w-[295px] flex-shrink-0 rounded-tr-[16px]",S),f[18]=S,f[19]=m):m=f[19],f[20]!==C||f[21]!==m?(b=(0,r.jsx)(L.default,{src:"/images/manage-on-iphone.svg",alt:"Subscription Management Banner",width:C,height:146,className:m}),f[20]=C,f[21]=m,f[22]=b):b=f[22],f[23]!==p||f[24]!==b?(g=(0,r.jsxs)("div",{className:"flex flex-row gap-[12px]",children:[p,b]}),f[23]=p,f[24]=b,f[25]=g):g=f[25],f[26]!==g||f[27]!==t?(y=(0,r.jsx)("div",{className:t,children:g}),f[26]=g,f[27]=t,f[28]=y):y=f[28],y};function en(e){let t,a,l,o,d,u,p,m,x,b,g,y,f,h,_=(0,n.c)(36),{balance:N,organizationId:v,plan:j,planCredits:C,stripeProductId:S,revenueCatProductId:w,subscriptionStartDate:E,onUpdatePlan:O,setOpenGenerationHistory:k}=e,{autoTopUpEnabled:A}=(0,i.Wi)(),P=void 0!==A&&A;_[0]===Symbol.for("react.memo_cache_sentinel")?(t=et.toISOString(),a=ea.toISOString(),_[0]=t,_[1]=a):(t=_[0],a=_[1]),_[2]!==v?(l={variables:{id:v,startDate:t,endDate:a}},_[2]=v,_[3]=l):l=_[3];let{data:L,loading:R}=(0,Q.I)(ee,l);_[4]!==L?.organizationById?.aggregatedIntegrationCreditUsageBySubType.usages?(o=L?.organizationById?.aggregatedIntegrationCreditUsageBySubType.usages??[],_[4]=L?.organizationById?.aggregatedIntegrationCreditUsageBySubType.usages,_[5]=o):o=_[5];let D=o;_[6]!==L?.organizationById?.aggregatedCreditUsageByType.usages?(d=L?.organizationById?.aggregatedCreditUsageByType.usages??[],_[6]=L?.organizationById?.aggregatedCreditUsageByType.usages,_[7]=d):d=_[7];let G=d;return _[8]===Symbol.for("react.memo_cache_sentinel")?(u={opacity:0,scale:.95},p={opacity:1,scale:1},m={duration:.3,ease:"easeOut"},_[8]=u,_[9]=p,_[10]=m):(u=_[8],p=_[9],m=_[10]),_[11]===Symbol.for("react.memo_cache_sentinel")?(x=(0,s.cn)("flex flex-col gap-[34px] rounded-[8px] border-[1px] border-comeback-gray-75 px-[20px] py-[20px]"),_[11]=x):x=_[11],_[12]!==N||_[13]!==O||_[14]!==v||_[15]!==j||_[16]!==C||_[17]!==w||_[18]!==S||_[19]!==E?(b=(0,r.jsx)("div",{className:x,children:(0,r.jsx)(c.UsageProgressBar,{balance:N,organizationId:v,plan:j,planCredits:C,stripeProductId:S,revenueCatProductId:w,subscriptionStartDate:E,variant:"regular",onUpdatePlan:O})}),_[12]=N,_[13]=O,_[14]=v,_[15]=j,_[16]=C,_[17]=w,_[18]=S,_[19]=E,_[20]=b):b=_[20],_[21]!==P||_[22]!==v?(g=P&&(0,r.jsx)(W.Suspense,{fallback:null,children:(0,r.jsx)(Z,{organizationId:v})}),_[21]=P,_[22]=v,_[23]=g):g=_[23],_[24]!==R||_[25]!==k||_[26]!==G?(y=(G.length>0||R)&&(0,r.jsx)(I,{usages:G,loading:R,setOpenGenerationHistory:k}),_[24]=R,_[25]=k,_[26]=G,_[27]=y):y=_[27],_[28]!==D||_[29]!==R?(f=(D.length>0||R)&&(0,r.jsx)("div",{className:(0,s.cn)("flex flex-col gap-[34px] rounded-[8px] border-[1px] border-comeback-gray-75 px-[20px] py-[20px]"),children:(0,r.jsx)(T,{usages:D,loading:R})}),_[28]=D,_[29]=R,_[30]=f):f=_[30],_[31]!==b||_[32]!==g||_[33]!==y||_[34]!==f?(h=(0,r.jsxs)(U.P.div,{initial:u,animate:p,transition:m,className:"flex flex-col gap-[24px]",children:[b,g,y,f]}),_[31]=b,_[32]=g,_[33]=y,_[34]=f,_[35]=h):h=_[35],h}},143306:(e,t,a)=>{"use strict";a.d(t,{f:()=>_});var r=a(294799),n=a(11241),s=a(917339),i=a(387928),l=a(789545),o=a(890292),c=a(702459),d=a(103967),u=a(449259),p=a(834023),m=a(445870),x=a(989378),b=a(689836),g=a(555246),y=a(33031),f=a(309894);function h(e){let t,a,i,l,o=(0,n.c)(23),{stripeProductId:c,currentStripeProductId:d,loading:u,isLoggedIn:p,isActiveProduct:m,onPress:x,isRevenueCatProductId:b,isPopular:h}=e,_=(0,g.jt)(),N="usage_free"===c,T="enterprise-plan"===c,v=u||m||b;o[0]!==d||o[1]!==m||o[2]!==p||o[3]!==c?(t=function({isActiveProduct:e,isLoggedIn:t,stripeProductId:a,currentStripeProductId:r}){return"enterprise-plan"===a?"Contact Sales":t?e?"Current Plan":r?(0,y.isUsagePlanUpgrade)(a,r)?"Upgrade":"Downgrade":"Get Started":"Get Started"}({isLoggedIn:p,isActiveProduct:m,stripeProductId:c,currentStripeProductId:d}),o[0]=d,o[1]=m,o[2]=p,o[3]=c,o[4]=t):t=o[4];let j=t;if(T){let e,t;return o[5]!==c||o[6]!==_?(e=()=>{_("Usage Pricing Plan Clicked",{stripeProductId:c})},o[5]=c,o[6]=_,o[7]=e):e=o[7],o[8]!==e||o[9]!==j?(t=(0,r.jsx)(f.ButtonLink,{className:"w-full",color:"dark",size:"md",href:"https://anythingdotcom.typeform.com/to/KXvf3tZG",target:"_blank",onClick:e,children:j}),o[8]=e,o[9]=j,o[10]=t):t=o[10],t}o[11]!==h?(a=(0,s.cn)("w-full",{"bg-comeback-blue-600 text-comeback-gray-25":h}),o[11]=h,o[12]=a):a=o[12];let C=N?"light":"dark";
52return o[13]!==x||o[14]!==c||o[15]!==_?(i=()=>{_("Usage Pricing Plan Clicked",{stripeProductId:c}),x()},o[13]=x,o[14]=c,o[15]=_,o[16]=i):i=o[16],o[17]!==v||o[18]!==a||o[19]!==C||o[20]!==i||o[21]!==j?(l=(0,r.jsx)(f.Button,{className:a,color:C,size:"md",disabled:v,onClick:i,children:j}),o[17]=v,o[18]=a,o[19]=C,o[20]=i,o[21]=j,o[22]=l):l=o[22],l}function _(e){let t,a,g,y,f,_,v,j,C,S,w,E,O,I,k,A,P,U,L,R,D,G,M,z=(0,n.c)(74),{cardData:H,isYearly:F,currentStripeProductId:B,isLoggedIn:$,onSelectPrice:K,loading:W,variant:V,onChangeStripeProductId:Y,isRevenueCatProductId:q}=e,{plans:X,proposition:J,features:Z,isPopular:Q,showCreditsWithTooltip:ee}=H,[et,ea]=(0,p.useState)(X[0]?.stripeProductId??"");if(z[0]!==B||z[1]!==$||z[2]!==Q||z[3]!==F||z[4]!==K||z[5]!==X||z[6]!==et||z[7]!==V){w=Symbol.for("react.early_return_sentinel");e:{var er;let e;if(z[19]!==et?(e=e=>e.stripeProductId===et,z[19]=et,z[20]=e):e=z[20],!(y=X.find(e))){w=null;break e}let n=(0,b.G)({plan:y,isYearly:F});if(!n){w=null;break e}let{activePrice:i,amountText:l,savingsText:o}=n;t=l,f=o,g=()=>{K(i)},a=et===B||!B&&"usage_free"===et&&$,S="relative h-full w-full",z[21]!==Q||z[22]!==V?(C=(0,s.cn)("relative z-float flex h-full w-full flex-col text-left",{"gap-[16px]":"small"===V},{"gap-[32px] rounded-lg border border-comeback-gray-75 px-[16px] pt-[16px] pb-[48px]":"large"===V},{"rounded-t-none border-comeback-blue-100 border-t-0 bg-comeback-blue-25":Q}),z[21]=Q,z[22]=V,z[23]=C):C=z[23],j="relative z-float flex w-full flex-col gap-[16px]",_="flex gap-2",v="string"==typeof y.name?(0,r.jsx)(d.E,{className:"text-comeback-gray-900",weight:"medium",type:"body-lg",children:(er=y.name).charAt(0).toUpperCase()+er.slice(1).toLowerCase()}):y.name}z[0]=B,z[1]=$,z[2]=Q,z[3]=F,z[4]=K,z[5]=X,z[6]=et,z[7]=V,z[8]=t,z[9]=a,z[10]=g,z[11]=y,z[12]=f,z[13]=_,z[14]=v,z[15]=j,z[16]=C,z[17]=S,z[18]=w}else t=z[8],a=z[9],g=z[10],y=z[11],f=z[12],_=z[13],v=z[14],j=z[15],C=z[16],S=z[17],w=z[18];return w!==Symbol.for("react.early_return_sentinel")?w:(z[24]!==_||z[25]!==v?(E=(0,r.jsx)("div",{className:_,children:v}),z[24]=_,z[25]=v,z[26]=E):E=z[26],z[27]!==t?(O=(0,r.jsx)(d.E,{className:"text-comeback-gray-900",type:"display-md",weight:"semibold",children:t}),z[27]=t,z[28]=O):O=z[28],z[29]!==F||z[30]!==f?(I=F&&f&&(0,r.jsx)("span",{className:"relative top-[-3px]",children:(0,r.jsx)(c.E,{color:"blue",size:"small",children:f})}),z[29]=F,z[30]=f,z[31]=I):I=z[31],z[32]!==O||z[33]!==I?(k=(0,r.jsxs)("div",{className:"flex flex-wrap items-baseline gap-[8px]",children:[O,I]}),z[32]=O,z[33]=I,z[34]=k):k=z[34],z[35]!==Y||z[36]!==y.description||z[37]!==y.stripeProductId||z[38]!==X?(A=X.length>1?(0,r.jsx)("div",{className:"mb-[-8px]",children:(0,r.jsxs)(x.l6,{value:y.stripeProductId,onValueChange:e=>{ea(e),Y?.(e)},children:[(0,r.jsx)(x.bq,{size:"sm",children:(0,r.jsx)(x.yv,{children:y.description})}),(0,r.jsx)(x.gC,{children:X.map(T)})]})}):(0,r.jsx)("span",{className:"whitespace-nowrap",children:y.description}),z[35]=Y,z[36]=y.description,z[37]=y.stripeProductId,z[38]=X,z[39]=A):A=z[39],z[40]!==k||z[41]!==A||z[42]!==j||z[43]!==E?(P=(0,r.jsxs)("div",{className:j,children:[E,k,A]}),z[40]=k,z[41]=A,z[42]=j,z[43]=E,z[44]=P):P=z[44],z[45]!==g?(U=()=>g(),z[45]=g,z[46]=U):U=z[46],z[47]!==B||z[48]!==a||z[49]!==$||z[50]!==Q||z[51]!==q||z[52]!==W||z[53]!==et||z[54]!==U?(L=(0,r.jsx)("div",{className:"relative z-float",children:(0,r.jsx)(h,{stripeProductId:et,onPress:U,loading:W,isActiveProduct:a,currentStripeProductId:B,isLoggedIn:$,isRevenueCatProductId:q,isPopular:Q})}),z[47]=B,z[48]=a,z[49]=$,z[50]=Q,z[51]=q,z[52]=W,z[53]=et,z[54]=U,z[55]=L):L=z[55],z[56]!==Z||z[57]!==y.creditsPerMonth||z[58]!==J||z[59]!==ee||z[60]!==et||z[61]!==V?(R="large"===V&&(0,r.jsxs)("div",{className:"relative z-float flex flex-col gap-[12px]",children:[!!J&&(0,r.jsx)(d.E,{type:"body-md",className:"text-comeback-gray-700",children:J}),ee&&(0,r.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,r.jsx)(m.A,{content:o.bC,className:"h-5 w-5 text-comeback-gray-700"}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)(d.E,{className:"text-comeback-gray-700",type:"body-md",children:[y.creditsPerMonth," monthly credits"]}),(0,r.jsx)(u.m_,{content:`${y.creditsPerMonth} credits per month + ${"usage_free"===et?"1k":"3k"} daily credits that reset when out`,isInstant:!0,children:(0,r.jsx)("div",{children:(0,r.jsx)(l.I,{size:"xs",content:i.l,className:"text-comeback-gray-400"})})})]})]}),Z.map(N)]}),z[56]=Z,z[57]=y.creditsPerMonth,z[58]=J,z[59]=ee,z[60]=et,z[61]=V,z[62]=R):R=z[62],z[63]!==P||z[64]!==L||z[65]!==R||z[66]!==C?(D=(0,r.jsxs)("div",{className:C,children:[P,L,R]}),z[63]=P,z[64]=L,z[65]=R,z[66]=C,z[67]=D):D=z[67],z[68]!==Q?(G=Q&&(0,r.jsx)("div",{className:"absolute top-[-36px] left-0 z-float flex h-[36px] w-full items-center justify-center rounded-t-lg rounded-b-none border-x border-x-comeback-blue-100 border-t border-t-comeback-blue-100 bg-comeback-blue-600 text-comeback-gray-25",children:"Most popular"}),z[68]=Q,z[69]=G):G=z[69],z[70]!==D||z[71]!==G||z[72]!==S?(M=(0,r.jsxs)("div",{className:S,children:[D,G]}),z[70]=D,z[71]=G,z[72]=S,z[73]=M):M=z[73],M)}function N(e,t){return(0,r.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,r.jsx)(m.A,{content:o.bC,className:"h-5 w-5 text-comeback-gray-700"}),"string"==typeof e?(0,r.jsx)(d.E,{className:"text-comeback-gray-700",type:"body-md",children:e}):e]},t)}function T(e){return(0,r.jsx)(x.eb,{value:e.stripeProductId,children:e.description},e.stripeProductId)}},166457:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Loading:()=>f,UsageProgressBar:()=>_,getNextCreditRefillDate:()=>h});var r=a(294799),n=a(11241),s=a(760486),i=a(33031),l=a(106504),o=a(555246),c=a(917339),d=a(568611),u=a(926518),p=a(309894),m=a(99873),x=a(789545);function b({progress:e,color:t,isLoading:a}){return(0,r.jsxs)("div",{className:"relative overflow-hidden",children:[(0,r.jsx)("div",{className:"h-[8px] w-full overflow-hidden rounded-[40px] border-[1px] border-comeback-gray-100 bg-comeback-gray-75"}
52),(0,r.jsx)("div",{className:(0,c.cn)("absolute bottom-0 left-0 top-0 h-full rounded-[40px] border-[1px]",a?"animate-pulse border-comeback-gray-100 bg-comeback-gray-900":{"border-comeback-gray-600 bg-comeback-gray-900":"gray"===t,"border-comeback-red-600 bg-comeback-red-500":"red"===t,"border-comeback-yellow-700 bg-comeback-yellow-400":"yellow"===t}),style:{width:`${Math.min(Math.max(e,0),100)}%`}})]})}a(976413),a(718881),a(514886);var g=a(103967),y=a(449948);function f({variant:e,organizationId:t}){let a=i.OrganizationPlan.FREE_USAGE;return(0,r.jsx)(_,{balance:100n,organizationId:t,stripeProductId:null,revenueCatProductId:null,subscriptionStartDate:null,plan:a,planCredits:100n,variant:e,isLoading:!0,onUpdatePlan:null})}let h=e=>{let t=new Date(e),a=new Date;return new Date(a.getFullYear(),a.getMonth()+ +(a.getDate()>=t.getDate()),t.getDate())};function _(e){let t,a,f,_,N,T,v,j,C,S,w,E,O,I,k,A=(0,n.c)(51),{balance:P,organizationId:U,planCredits:L,stripeProductId:R,revenueCatProductId:D,subscriptionStartDate:G,plan:M,variant:z,isLoading:H,onUpdatePlan:F}=e,{open:B}=(0,s.q)(),$=G&&(0,i.isPaidPlan)(M)?h(G):null;A[0]!==F?(t=()=>{F?.()},A[0]=F,A[1]=t):t=A[1];let K=t;A[2]!==B||A[3]!==U?(a=()=>{B({organizationId:U,source:"usage_progress_bar"})},A[2]=B,A[3]=U,A[4]=a):a=A[4];let W=a,{progress:V,dangerZone:Y,isEmpty:q}=(({planCredits:e,balance:t})=>{let a=t>e?1:Number(100n*t/e)/100,r=(a>1?1:a)*100,n=r<100-u.ZM;return{progress:r,dangerZone:n,planCredits:e,isEmpty:t<=0n}})({planCredits:L,balance:P}),X=(0,o.jt)();A[5]!==M||A[6]!==D||A[7]!==R||A[8]!==z?(f="small"===z?"Credits":(0,i.getPlanDisplayName)({stripeProductId:R,revenueCatProductId:D,plan:M}),A[5]=M,A[6]=D,A[7]=R,A[8]=z,A[9]=f):f=A[9],A[10]!==f?(_=(0,r.jsx)(g.E,{weight:"medium",className:"text-comeback-gray-900",children:f}),A[10]=f,A[11]=_):_=A[11];let J=M===i.OrganizationPlan.BUSINESS;A[12]!==J?(N=(0,c.cn)("flex flex-row items-center gap-[16px]",{"flex-row-reverse":J}),A[12]=J,A[13]=N):N=A[13],A[14]!==U||A[15]!==M||A[16]!==z?(T="small"!==z&&(0,i.isPaidPlan)(M)&&(0,r.jsx)(y.UpsellCreditsModalButton,{color:M===i.OrganizationPlan.BUSINESS?"dark":"light",organizationId:U}),A[14]=U,A[15]=M,A[16]=z,A[17]=T):T=A[17],A[18]!==W||A[19]!==K||A[20]!==U||A[21]!==M||A[22]!==X||A[23]!==z?(v="small"===z?(0,r.jsx)(p.ButtonLink,{href:(0,l.J1)({organizationId:U}),target:"_blank",onPress:()=>{X("Upgrade From Usage Progress Banner Clicked")},color:M===i.OrganizationPlan.BUSINESS?"light":"dark",children:"View usage"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Button,{onPress:W,color:"light",iconLeft:(0,r.jsx)(x.I,{content:m.BL,size:"small"}),children:"Get free credits"}),(0,r.jsx)(p.Button,{onPress:K,color:M===i.OrganizationPlan.BUSINESS?"dark":"light",children:"Update plan"})]}),A[18]=W,A[19]=K,A[20]=U,A[21]=M,A[22]=X,A[23]=z,A[24]=v):v=A[24],A[25]!==N||A[26]!==T||A[27]!==v?(j=(0,r.jsxs)("div",{className:N,children:[T,v]}),A[25]=N,A[26]=T,A[27]=v,A[28]=j):j=A[28],A[29]!==j||A[30]!==_?(C=(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[_,j]}),A[29]=j,A[30]=_,A[31]=C):C=A[31];let Z=Math.max(H?0:V,1),Q=Y?q?"red":"yellow":"gray";A[32]!==H||A[33]!==Z||A[34]!==Q?(S=(0,r.jsx)(b,{progress:Z,color:Q,isLoading:H}),A[32]=H,A[33]=Z,A[34]=Q,A[35]=S):S=A[35];let ee=Y&&!H&&(0,r.jsx)(x.I,{size:"xs",content:m.ZQ,className:(0,c.cn)("text-comeback-gray-900",{"text-comeback-red-500":Y&&q,"text-comeback-yellow-800":Y&&!q})}),et=H?(0,r.jsx)("div",{className:"flex h-[20px] w-[120px] animate-pulse flex-row items-center rounded-[4px] bg-comeback-gray-50"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(g.E,{className:"whitespace-nowrap text-comeback-gray-500",children:[(0,r.jsx)("span",{className:(0,c.cn)("text-comeback-gray-900",{"text-comeback-red-500":Y&&q,"text-comeback-yellow-800":Y&&!q}),children:(0,u.EU)(P)})," ","/ ",(0,u.EU)(L)," credits left"]}),(0,r.jsx)("a",{target:"_blank",rel:"noreferrer",href:"/help/credits",className:"flex flex-row items-center gap-[4px] text-comeback-gray-500",children:(0,r.jsx)(x.I,{size:"xs",content:m.yF})})]});A[36]!==et?(w=(0,r.jsx)("div",{className:"flex flex-row items-center gap-[8px]",children:et}),A[36]=et,A[37]=w):w=A[37],A[38]!==ee||A[39]!==w?(E=(0,r.jsx)("div",{className:"flex flex-row items-center gap-[12px]",children:(0,r.jsxs)("div",{className:"flex flex-row items-center gap-[4px]",children:[ee,w]})}),A[38]=ee,A[39]=w,A[40]=E):E=A[40];let ea=g.E,er=(0,i.isPaidPlan)(M)&&$?` Your credits refill on ${(0,d.s_)($)}.`:void 0;return A[41]!==ea||A[42]!==er?(O=(0,r.jsxs)(ea,{type:"body-md",className:"text-comeback-gray-500",children:["Credits are used for AI generations.",er]}),A[41]=ea,A[42]=er,A[43]=O):O=A[43],A[44]!==S||A[45]!==E||A[46]!==O?(I=(0,r.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[S,E,O]}),A[44]=S,A[45]=E,A[46]=O,A[47]=I):I=A[47],A[48]!==C||A[49]!==I?(k=(0,r.jsxs)("div",{className:"flex flex-col gap-[24px]",children:[C,I]}),A[48]=C,A[49]=I,A[50]=k):k=A[50],k}_.Loading=f},182720:(e,t,a)=>{"use strict";a.d(t,{l:()=>i});var r=a(294799),n=a(917339),s=a(92563);let i=a(834023).forwardRef(({className:e,color:t="gray",...a},i)=>(0,r.jsx)(s.bL,{className:(0,n.cn)("inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none ring-offset-background focus-visible:ring-[2px] focus-visible:ring-ring focus-visible:ring-offset-[2px] disabled:cursor-not-allowed disabled:opacity-50",{"data-[state=checked]:bg-comeback-gray-500 data-[state=unchecked]:bg-comeback-gray-75":"gray"===t,"data-[state=checked]:bg-comeback-green-500 data-[state=unchecked]:bg-comeback-gray-75":"green"===t},e),...a,ref:i,children:(0,r.jsx)(s.zi,{className:(0,n.cn)("pointer-events-none block h-3 w-3 rounded-full bg-white ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}
52))},186472:(e,t,a)=>{"use strict";a.d(t,{W:()=>s,d:()=>i});var r=a(767838),n=a(232726);let s=(0,r.y)(()=>({referral:void 0})),i=e=>(0,n.P)(s,e)},211387:(e,t,a)=>{"use strict";async function r(e,t={}){let{url:a="about:blank",target:n="_blank"}=t,s=window.open(a,n);if(!s){let t=await e();t&&(window.location.href=t);return}try{let t=await e();if(!t)return void s.close();s.location.href=t}catch(e){try{s.close()}catch(e){}throw e}}a.d(t,{a:()=>r})},216473:(e,t,a)=>{"use strict";a.d(t,{N:()=>i});var r=a(294799),n=a(11241),s=a(486447);function i(e){let t,a=(0,n.c)(4),{id:i,name:l,size:o}=e;return a[0]!==i||a[1]!==l||a[2]!==o?(t=(0,r.jsx)(s.default,{userId:i,name:l,image:null,size:o}),a[0]=i,a[1]=l,a[2]=o,a[3]=t):t=a[3],t}},403174:(e,t,a)=>{"use strict";a.d(t,{_u:()=>u,m_:()=>d}),a(976413),a(718881);var r=a(917339),n=a(313822);a(103967);var s=a(294799),i=a(834023),l=a(97252);let o=(0,r.F)(["z-tooltip overflow-hidden","min-h-[20px] min-w-[40px] max-w-xs","origin-[var(--radix-tooltip-content-transform-origin)]","animate-in fade-in-0 zoom-in-95 duration-[140ms] ease-out-strong","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-[100ms]","data-[state=instant-open]:animate-none data-[state=instant-open]:duration-0","data-[side=bottom]:slide-in-from-top-[2px] data-[side=left]:slide-in-from-right-[2px] data-[side=right]:slide-in-from-left-[2px] data-[side=top]:slide-in-from-bottom-[2px]"],{variants:{variant:{default:"rounded-md bg-primary text-primary-foreground px-[10px] py-[6px] text-center",custom:""}},defaultVariants:{variant:"default"}}),c={side:"top",isInstant:!1,align:"center",variant:"default",asChild:!0,sideOffset:4,collisionPadding:4},d=e=>{let t={...c,...e},{open:a,defaultOpen:i,onOpenChange:d}=t;return(0,s.jsxs)(l.bL,{open:a,defaultOpen:i,onOpenChange:d,delayDuration:600*!t.isInstant,children:[(0,s.jsx)(l.l9,{asChild:t.asChild,children:t.children}),(0,s.jsx)(l.ZL,{children:(0,s.jsx)(l.UC,{side:t.side,align:t.align,sideOffset:t.sideOffset,collisionPadding:t.collisionPadding,className:(0,r.cn)(o({variant:t.variant}),t.className),children:"string"==typeof t.content?(0,s.jsx)(n.E,{type:"body-sm",children:t.content}):t.content})})]})};function u(e){return e.content?(0,s.jsx)(d,{...e}):(0,s.jsx)(s.Fragment,{children:e.children})}l.Kq,l.l9,(0,i.forwardRef)(({className:e,variant:t="default",sideOffset:a=4,...n},i)=>(0,s.jsx)(l.ZL,{children:(0,s.jsx)(l.UC,{ref:i,sideOffset:a,className:(0,r.cn)(o({variant:t}),e),...n})})).displayName=l.UC.displayName},421455:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var r=a(294799),n=a(11241),s=a(35279),i=a(103967),l=a(238309),o=a(834023),c=a(354127),d=a(917339),u=a(890292),p=a(445870),m=a(732950),x=a.n(m),b=a(71940),g=a(971288);let y={variant:"default",isDismissible:!1},f=u.A3,h=u.hm,_=e=>{let t,a,s,l,c=(0,n.c)(8),{label:u,onPress:p,...m}=e;c[0]!==p?(t={onPress:p},c[0]=p,c[1]=t):t=c[1];let{buttonProps:y}=(0,g.s)(t,(0,o.useRef)(null)),f=(0,b.v)({},y,m);return c[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,d.cn)(x().action,"outline-none"),c[2]=a):a=c[2],c[3]!==u?(s=(0,r.jsx)(i.E,{type:"body-sm",children:u}),c[3]=u,c[4]=s):s=c[4],c[5]!==f||c[6]!==s?(l=(0,r.jsx)("button",{type:"button",className:a,...f,children:s}),c[5]=f,c[6]=s,c[7]=l):l=c[7],l};function N(e){let{label:t,...a}=e;return(0,o.createElement)(_,{label:t,...a,key:t})}let T=(0,o.forwardRef)(function(e,t){let a,s=(0,n.c)(2),l={...y,...e},o=(0,c.A)(t),m="success"===l.variant||"error"===l.variant,b=l.actions?.length===1,g=!l.description&&!m&&!l.actions?.length&&"items-center";return s[0]!==g?(a=(0,d.cn)("tablet:w-max w-full min-w-[16rem] tablet:max-w-[20rem] rounded-md","mt-[40px] tablet:mt-0","flex bg-white",x().shadow,g),s[0]=g,s[1]=a):a=s[1],(0,r.jsx)("div",{ref:o,className:a,children:(0,r.jsxs)("div",{className:"mr-auto flex grow",children:[(0,r.jsxs)("div",{className:"flex grow flex-row gap-[9px] px-[1rem] py-[.5rem]",children:[m&&(0,r.jsx)(p.A,{content:(e=>{switch(e){case"success":return f;case"error":return h;default:throw Error("Unknown variant")}})(l.variant),className:(0,d.cn)({"text-success-500":"success"===l.variant,"text-comeback-red-400":"error"===l.variant})}),(0,r.jsxs)("div",{className:"flex flex-col items-center text-left",children:[(0,r.jsx)(i.E,{type:"body-md",weight:l.description?"medium":"regular",className:l.description?void 0:"flex h-full items-center",children:l.title}),l.description&&("string"==typeof l.description?(0,r.jsx)(i.E,{type:"body-sm",children:l.description}):l.description)]})]}),l.isOnlyActionDismiss&&(0,r.jsx)("button",{type:"button",className:"border-none bg-transparent pt-[3px] pr-[4px]",onClick:l.onDismiss,children:(0,r.jsx)(p.A,{className:"cursor-pointer text-comeback-gray-500",content:u.oG})}),l.actions&&!l.isOnlyActionDismiss&&(0,r.jsx)("div",{className:(0,d.cn)("flex flex-col gap-x-[1rem] whitespace-nowrap","border-comeback-gray-50 border-l border-solid","justify-center",b&&"mt-[.125rem] mr-[.5rem] ml-auto"),children:l.actions.map(N)})]})})});function v(e){let t,a,o,c=(0,n.c)(9);c[0]===Symbol.for("react.memo_cache_sentinel")?(t={defaultValue:!0},c[0]=t):t=c[0];let d=(0,s.OD)(t),{enqueueSnackbar:u,closeSnackbar:p}=(0,l.dh)();c[1]!==p||c[2]!==u||c[3]!==e||c[4]!==d?(a=function(t,a){let n=void 0===a?{}:a;return u((0,r.jsx)(i.E,{type:"body-sm",children:t}),{...d?{}:{anchorOrigin:{horizontal:"center",vertical:"top"}},...e,content:e=>(0,r.jsx)(T,{...{title:t,description:n.description,variant:n.variant,isOnlyActionDismiss:n.isOnlyActionDismiss,actions:n.actions?.map(j)},onDismiss:()=>{p(e)}})})},c[1]=p,c[2]=u,c[3]=e,c[4]=d,c[5]=a):a=c[5];let m=a;
52return c[6]!==p||c[7]!==m?(o={sendToast:m,dismissToast:p},c[6]=p,c[7]=m,c[8]=o):o=c[8],o}function j(e){return e}},449259:(e,t,a)=>{"use strict";a.d(t,{_u:()=>r._u,m_:()=>r.m_}),a(976413),a(718881);var r=a(403174)},449948:(e,t,a)=>{"use strict";a.r(t),a.d(t,{UpsellCreditsModal:()=>U,UpsellCreditsModalButton:()=>R});var r=a(294799),n=a(11241),s=a(216473),i=a(186472),l=a(819745),o=a(451286),c=a(128979),d=a.n(c),u=a(834023);class p{map;expiryTime;constructor(e){this.map=new Map,this.expiryTime=e}set(e,t){let a=this.map.get(e);void 0!==a&&clearTimeout(a.timeout);let r=setTimeout(()=>{this.map.delete(e)},this.expiryTime);this.map.set(e,{value:t,timeout:r})}get(e){let t=this.map.get(e);if(t)return t.value}delete(e){let t=this.map.get(e);return void 0!==t&&(clearTimeout(t.timeout),this.map.delete(e))}has(e){return this.map.has(e)}clear(){for(let[,{timeout:e}]of this.map)clearTimeout(e);this.map.clear()}size(){return this.map.size}}var m=a(751355),x=a(814121);let b=(0,m.U)(` 53 mutation CreateCheckoutSessionWithLookup( 54 $input: CreateCheckoutSessionWithPriceLookupInput! 55 ) { 56 createCheckoutSessionWithPriceLookup(input: $input) { 57 url 58 } 59 } 60`),g=new p(d()("20h"));function y(e){if(l.K.is(e)){let t=e.errors.find(e=>"string"==typeof e.message&&e.message.length>0)?.message;if(t)return t}return e instanceof Error&&e.message?e.message:"Failed to start checkout. Please try again."}function f(e){return e.referral}var h=a(985413),_=a(35279),N=a(555246),T=a(917339),v=a(926518),j=a(309894),C=a(99873),S=a(665237),w=a(713582),E=a(789545),O=a(655665),I=a(103967),k=a(510822);let A=(0,m.U)(` 61 query OrganizationsForSelector { 62 organizations { 63 edges { 64 node { 65 id 66 name 67 } 68 } 69 } 70 } 71`),P=[{lookup:"topoff_10",amount:10n*v.np,usd:"$12.00"},{lookup:"topoff_50",amount:50n*v.np,usd:"$60.00"},{lookup:"topoff_100",amount:100n*v.np,usd:"$120.00"},{lookup:"topoff_200",amount:200n*v.np,usd:"$240.00"}];function U(e){let t,a,l,c,d,p,m,_,S,O,U,R,D,G,M,z,H,F,B=(0,n.c)(43),{organizationId:$}=e,K=(0,N.jt)(),[W,V]=(0,u.useState)(!1),[Y,q]=(0,u.useState)(P[0]),{data:X}=(0,k.I)(A);if(B[0]!==X?.organizations.edges||B[1]!==$){let e,a=X?.organizations.edges.map(L)??[];B[3]!==$?(e=e=>e.id===$,B[3]=$,B[4]=e):e=B[4],t=a.find(e),B[0]=X?.organizations.edges,B[1]=$,B[2]=t}else t=B[2];let J=t;B[5]!==$||B[6]!==Y.lookup?(a={organizationId:$,lookup:Y.lookup,code:null,disabled:null,redirectURL:null},B[5]=$,B[6]=Y.lookup,B[7]=a):a=B[7];let{url:Z,error:Q}=(e=>{let t,a,r,s,l,c=(0,n.c)(19),{organizationId:d,lookup:p,code:m,disabled:h,redirectURL:_}=e;c[0]!==m||c[1]!==p||c[2]!==d||c[3]!==_?(t=function({organizationId:e,lookup:t,code:a,redirectURL:r}){return`${e}-${t}-${a}-${r}`}({organizationId:d,lookup:p,code:m,redirectURL:_}),a=g.get(t),c[0]=m,c[1]=p,c[2]=d,c[3]=_,c[4]=t,c[5]=a):(t=c[4],a=c[5]);let N=a,[T,v]=(0,u.useState)(N),[j,C]=(0,u.useState)(null),S=(0,i.d)(f),[w]=(0,x.n)(b);return c[6]!==m||c[7]!==w||c[8]!==h||c[9]!==t||c[10]!==p||c[11]!==d||c[12]!==_||c[13]!==S?(r=()=>{if(h||!d)return;let e=g.get(t);if(e){v(e),C(null);return}let a=!1;return v(void 0),C(null),w({variables:{input:{lookup:p,promotionCode:m,organizationId:d,referral:S,redirectURL:_??window.location.href}}}).then(e=>{if(a)return;if(e.error){o.Cp(Error("Failed to create Stripe checkout url",{cause:e.error})),v(void 0),C(y(e.error));return}let r=e.data?.createCheckoutSessionWithPriceLookup.url;if(r){g.set(t,r),v(r),C(null);return}v(void 0),C("Failed to start checkout. Please try again.")}).catch(e=>{a||(o.Cp(Error("Failed to create Stripe checkout url",{cause:e})),v(void 0),C(y(e)))}),()=>{a=!0}},s=[w,d,S,p,m,h,_,t],c[6]=m,c[7]=w,c[8]=h,c[9]=t,c[10]=p,c[11]=d,c[12]=_,c[13]=S,c[14]=r,c[15]=s):(r=c[14],s=c[15]),(0,u.useEffect)(r,s),c[16]!==j||c[17]!==T?(l={url:T,error:j},c[16]=j,c[17]=T,c[18]=l):l=c[18],l})(a),{open:ee}=(0,h.W)();return B[8]===Symbol.for("react.memo_cache_sentinel")?(l=(0,r.jsx)(I.E,{type:"display-xs",weight:"medium",className:"text-center text-comeback-gray-900",children:"Purchase credits"}),B[8]=l):l=B[8],B[9]===Symbol.for("react.memo_cache_sentinel")?(c=(0,r.jsx)("br",{}),d=(0,r.jsx)("br",{}),B[9]=c,B[10]=d):(c=B[9],d=B[10]),B[11]!==ee||B[12]!==$?(p=(0,r.jsxs)(I.E,{type:"body-md",className:"text-comeback-gray-900",children:["Buy extra credits that roll over month to month.",c,d,(0,r.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),ee({title:"Upgrade your plan",subTitle:"Get more credits per month with a larger plan",description:null,organizationId:$,source:"plan_upgrade"})},className:"text-comeback-blue-400",children:"Upgrading your plan"}
71)," ","is usually better value (10% bonus credits)."]}),B[11]=ee,B[12]=$,B[13]=p):p=B[13],B[14]===Symbol.for("react.memo_cache_sentinel")?(m=(0,r.jsx)(E.I,{size:"medium",content:C.tW,className:"text-comeback-gray-200"}),B[14]=m):m=B[14],B[15]!==Y.amount?(_=(0,v.EU)(Y.amount),B[15]=Y.amount,B[16]=_):_=B[16],B[17]!==_?(S=(0,r.jsxs)("div",{className:"flex flex-row items-center gap-[4px]",children:[m,(0,r.jsx)(I.E,{type:"body-md",className:"text-comeback-gray-900",children:_})]}),B[17]=_,B[18]=S):S=B[18],B[19]===Symbol.for("react.memo_cache_sentinel")?(O=(0,r.jsx)(E.I,{size:"xs",content:C.In,className:"text-comeback-gray-200"}),B[19]=O):O=B[19],B[20]!==S?(U=(0,r.jsx)(w.ty,{className:"outline-none",children:(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between rounded-[8px] border-[1px] border-comeback-gray-75 px-[12px] py-[6px]",children:[S,O]})}),B[20]=S,B[21]=U):U=B[21],B[22]===Symbol.for("react.memo_cache_sentinel")?(R=e=>{e.preventDefault(),V(!1)},B[22]=R):R=B[22],B[23]!==Y.lookup?(D=P.map(e=>{let t=e.lookup===Y?.lookup;return(0,r.jsxs)(w._2,{inset:null,className:(0,T.cn)("flex w-full flex-row items-center gap-[4px]",{"cursor-pointer":!t}),onClick:a=>{t?a.preventDefault():q(e)},children:[(0,r.jsx)(E.I,{size:"xs",content:C.bC,className:(0,T.cn)("invisible text-comeback-gray-200",{visible:t})}),(0,r.jsx)(E.I,{size:"xs",content:C.tW,className:"text-comeback-gray-200"}),(0,r.jsx)(I.E,{type:"body-md",className:"text-comeback-gray-900",children:(0,v.EU)(e.amount)})]},e.lookup)}),B[23]=Y.lookup,B[24]=D):D=B[24],B[25]!==D?(G=(0,r.jsx)(w.SQ,{disablePortal:!0,align:"start",side:"bottom",sideOffset:10,className:"flex min-w-[243px] flex-col gap-[8px] tablet:w-[443px]",onEscapeKeyDown:R,children:D}),B[25]=D,B[26]=G):G=B[26],B[27]!==W||B[28]!==U||B[29]!==G?(M=(0,r.jsxs)(w.rI,{open:W,onOpenChange:V,children:[U,G]}),B[27]=W,B[28]=U,B[29]=G,B[30]=M):M=B[30],B[31]!==M||B[32]!==p?(z=(0,r.jsxs)("div",{className:"flex flex-col gap-[20px] px-[32px]",children:[l,p,M]}),B[31]=M,B[32]=p,B[33]=z):z=B[33],B[34]!==Q||B[35]!==Z||B[36]!==Y.usd||B[37]!==J||B[38]!==K?(H=J&&(0,r.jsxs)("div",{className:"flex flex-col gap-[12px] border-t-[1px] border-t-comeback-gray-50 px-[32px] py-[20px]",children:[Q?(0,r.jsx)(I.E,{type:"body-sm",className:"text-comeback-red-500",children:Q}):null,(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"flex flex-row items-center gap-[4px] text-comeback-gray-500",children:[(0,r.jsx)(s.N,{size:"small",id:J.id,name:J.name}),(0,r.jsx)(I.E,{type:"body-md",className:"text-comeback-gray-900",children:J.name})]})}),(0,r.jsxs)("div",{className:"flex flex-row items-center gap-[16px]",children:[(0,r.jsx)(I.E,{type:"body-md",className:"text-comeback-gray-900",children:Y.usd}),(0,r.jsx)(j.ButtonLink,{color:"dark",href:Z,target:"_blank",disabled:!Z||!!Q,onClick:()=>{K("Upsell Credits clicked")},children:"Buy credits"})]})]})]}),B[34]=Q,B[35]=Z,B[36]=Y.usd,B[37]=J,B[38]=K,B[39]=H):H=B[39],B[40]!==z||B[41]!==H?(F=(0,r.jsxs)("div",{className:"flex tablet:max-w-[400px] flex-col gap-[20px] pt-[10px]",children:[z,H]}),B[40]=z,B[41]=H,B[42]=F):F=B[42],F}function L(e){let{node:t}=e;return t}function R(e){let t,a,s,i,l,o,c,d,p=(0,n.c)(24);p[0]!==e?({organizationId:t,...a}=e,p[0]=e,p[1]=t,p[2]=a):(t=p[1],a=p[2]);let m=(0,_.GM)(),[x,b]=(0,u.useState)(!1),[g,y]=(0,u.useState)(!1);if(!m){let e,n,s,i,l;return p[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(S.h,{className:"mb-[20px]"}),p[3]=e):e=p[3],p[4]!==t?(n=(0,r.jsxs)("div",{className:"flex h-[90dvh] flex-col overflow-y-auto bg-white",children:[e,(0,r.jsx)(U,{organizationId:t})]}),p[4]=t,p[5]=n):n=p[5],p[6]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{b(e)},p[6]=s):s=p[6],p[7]!==a?(i=(0,r.jsx)(j.Button,{...a,children:"Purchase credits"}),p[7]=a,p[8]=i):i=p[8],p[9]!==x||p[10]!==n||p[11]!==i?(l=(0,r.jsx)(S._,{content:n,nested:!0,open:x,modal:!0,dismissible:!0,disableAutoFocus:!0,onOpenChange:s,children:i}),p[9]=x,p[10]=n,p[11]=i,p[12]=l):l=p[12],l}return p[13]!==a?(s=(0,r.jsx)(O.aF.Trigger,{children:(0,r.jsx)(j.Button,{...a,children:"Purchase credits"})}),p[13]=a,p[14]=s):s=p[14],p[15]===Symbol.for("react.memo_cache_sentinel")?(i=(0,r.jsx)(O.aF.Overlay,{}),p[15]=i):i=p[15],p[16]===Symbol.for("react.memo_cache_sentinel")?(l=(0,r.jsx)(O.aF.Title,{hidden:!0,children:"Purchase Credits"}),o=(0,r.jsx)(O.aF.DismissButton,{}),p[16]=l,p[17]=o):(l=p[16],o=p[17]),p[18]!==t?(c=(0,r.jsxs)(O.aF.Content,{children:[l,o,(0,r.jsx)(U,{organizationId:t})]}),p[18]=t,p[19]=c):c=p[19],p[20]!==g||p[21]!==s||p[22]!==c?(d=(0,r.jsxs)(O.aF.Root,{open:g,onOpenChange:y,children:[s,i,c]}),p[20]=g,p[21]=s,p[22]=c,p[23]=d):d=p[23],d}},486447:(e,t,a)=>{"use strict";a.d(t,{H:()=>u,default:()=>p});var r=a(294799),n=a(11241),s=a(917339),i=a(302978),l=a(921513),o=a(482515),c=a(716710);let d=e=>{switch(e){case"small":return 20;case"medium":return 30;case"large":return 40;case"xl":return 48;case"2xl":return 64;case"3xl":return 84;case"4xl":return 100}};function u(e){let t,a,u,p,m,x,b=(0,n.c)(30),{image:g,userId:y,name:f,size:h,Image:_,className:N}=e,T=void 0===h?"medium":h;b[0]!==f?.[0]||b[1]!==y?(t=f?.[0]?.toUpperCase()==="+"?`+${y}`:f?.[0]?.toUpperCase(),b[0]=f?.[0],b[1]=y,b[2]=t):t=b[2];let v=t;b[3]!==g||b[4]!==y?(a=g||y&&(0,c.s)(y).url,b[3]=g,b[4]=y,b[5]=a):a=b[5];let j=a,C="small"===T,S="medium"===T,w="large"===T,E="xl"===T,O="2xl"===T,I="3xl"===T,k="4xl"===T;return b[6]!==N||b[7]!==k||b[8]!==C||b[9]!==S||b[10]!==w||b[11]!==E||b[12]!==O||b[13]!==I?(u=(0,s.cn)("inline-flex items-center justify-center","select-none","relative","rounded-full","flex-shrink-0",{"h-[20px] w-[20px]":C,"h-[30px] w-[30px]":S,"h-[40p
71x] w-[40px]":w,"h-[48px] w-[48px]":E,"h-[64px] w-[64px]":O,"h-[84px] w-[84px]":I,"h-[100px] w-[100px]":k},N),b[6]=N,b[7]=k,b[8]=C,b[9]=S,b[10]=w,b[11]=E,b[12]=O,b[13]=I,b[14]=u):u=b[14],b[15]!==_||b[16]!==g||b[17]!==j||b[18]!==v||b[19]!==T||b[20]!==y?(p=_?(0,r.jsx)(_,{image:j,className:"h-full w-full rounded-[inherit] object-cover"}):(0,r.jsx)(l.N,{children:j&&(0,r.jsx)(o.default,{className:(0,s.cn)("h-full w-full rounded-[inherit] object-cover"),style:{backgroundColor:g?"#ffffff":y?(0,c.s)(y).hex:void 0},src:j,alt:`${v}'s avatar`,width:d(T),height:d(T),unoptimized:!0})}),b[15]=_,b[16]=g,b[17]=j,b[18]=v,b[19]=T,b[20]=y,b[21]=p):p=b[21],b[22]!==g||b[23]!==v||b[24]!==T?(m=!g&&(0,r.jsx)("span",{className:(0,s.cn)("absolute font-medium text-body-md text-white",{"text-[1.5rem]":"2xl"===T,"text-[2rem]":"3xl"===T,"text-[0.5rem]":"small"===T}),children:v}),b[22]=g,b[23]=v,b[24]=T,b[25]=m):m=b[25],b[26]!==u||b[27]!==p||b[28]!==m?(x=(0,r.jsxs)(i.bL,{className:u,children:[p,m]}),b[26]=u,b[27]=p,b[28]=m,b[29]=x):x=b[29],x}let p=u},552417:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>y,i5:()=>g,xy:()=>x});var r=a(294799),n=a(11241),s=a(449259),i=a(103967),l=a(18057),o=a(917339),c=a(451286),d=a(517908),u=a(319839),p=a(834023);let m={label:"Copy",successMessage:"Copied!",variant:"inline"},x=e=>{let t={...m,...e},{toggleValue:a,toggle:r}=(0,l.A)({defaultState:!1}),n=async()=>{try{await navigator.clipboard.writeText(t.textToCopy??"")}catch(e){c.Cp(Error("Could not copy text",{cause:e}))}r()},s=e.disabled??a;return{isCopied:a,copy:n,disabled:s}};function b(e){return c.Cp(e)}function g({...e}){let t={...m,...e},{toggleValue:a,toggle:n}=(0,l.A)({defaultState:!1}),[o,d]=(0,p.useState)(!1),u=async()=>{try{await navigator.clipboard.writeText(t.textToCopy??"")}catch(e){c.Cp(Error("Could not copy text",{cause:e}))}n()};return(0,r.jsx)(s.m_,{...e.tooltipProps,open:o||a,onOpenChange:d,content:(0,r.jsx)(i.E,{type:"body-sm",children:a?t.successMessage:t.label}),children:(0,r.jsx)("button",{type:"button","aria-label":"Copy Button",className:t.className,onClick:async()=>{await u()},disabled:a,children:e.children})})}let y=function(e){let t,a,l,c,g,y=(0,n.c)(18),f={...m,...e},{isCopied:h,copy:_,disabled:N}=x({textToCopy:f.textToCopy}),[T,v]=(0,p.useState)(!1),j=(0,o.cn)("flex gap-[4px]",f.className);y[0]!==_||y[1]!==e?(t=t=>{e.onClick?.(t),_().catch(b)},y[0]=_,y[1]=e,y[2]=t):t=y[2],y[3]!==h?(a=h?(0,r.jsx)(d.J,{width:18,height:18}):(0,r.jsx)(u.U,{width:18,height:18}),y[3]=h,y[4]=a):a=y[4];let C="inline"===f.variant&&(0,r.jsx)("span",{className:"tablet:text-body-sm text-body-md",children:h?f.successMessage:f.label});y[5]!==N||y[6]!==j||y[7]!==t||y[8]!==a||y[9]!==C?(l=(0,r.jsxs)("button",{type:"button","aria-label":"Copy Button",className:j,onClick:t,disabled:N,children:[a,C]}),y[5]=N,y[6]=j,y[7]=t,y[8]=a,y[9]=C,y[10]=l):l=y[10];let S=l;if("inline"===f.variant)return S;let w=T||h,E=h?f.successMessage:f.label;return y[11]!==E?(c=(0,r.jsx)(i.E,{type:"body-sm",children:E}),y[11]=E,y[12]=c):c=y[12],y[13]!==S||y[14]!==v||y[15]!==w||y[16]!==c?(g=(0,r.jsx)(s.m_,{side:"bottom",open:w,onOpenChange:v,content:c,children:S}),y[13]=S,y[14]=v,y[15]=w,y[16]=c,y[17]=g):g=y[17],g}},568611:(e,t,a)=>{"use strict";a.d(t,{Yq:()=>s,fU:()=>i,j1:()=>l,s_:()=>o});var r=a(847923);let n=Intl.DateTimeFormat("en-US",{month:"short",day:"2-digit",hour:"numeric",minute:"2-digit",hour12:!0}),s=e=>n.format(new Date(e)),i=e=>(0,r.GP)(e,"p"),l=e=>(0,r.GP)(e,"MMM do"),o=e=>(0,r.GP)(e,"MMMM do")},592048:(e,t,a)=>{"use strict";a.d(t,{m:()=>i});var r=a(726482),n=a(451286);let s=a(912857).fc(r.l).catch(e=>(n.Cp(Error(`Invalid usage plan strategy: ${JSON.stringify(e.input)}`)),r.l.DEFAULT)),i=e=>s.parse(e)},655665:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>r.Cf,Dz:()=>r.Dz,L3:()=>r.L3,aF:()=>r.Ay,rr:()=>r.rr,zM:()=>r.zM}),a(976413),a(718881);var r=a(406706)},689836:(e,t,a)=>{"use strict";a.d(t,{G:()=>r});let r=({plan:e,isYearly:t})=>{let a=e.prices.find(e=>e.interval===(t?"year":"month")),r=e.prices.find(e=>"month"===e.interval),n=e.prices.find(e=>"year"===e.interval);if(!a||!r||!n)return null;let s="string"==typeof a.amount?a.amount:`$${Math.ceil(a.amount/100)}/mo`,i="number"==typeof r.amount&&"number"==typeof n.amount?(r.amount-n.amount)*12/100:null;return{amountText:s,activePrice:a,savingsText:i&&i>0?`Save $${Math.round(i)}`:null}}},713582:(e,t,a)=>{"use strict";a.d(t,{rI:()=>d,SQ:()=>p,_2:()=>m,ty:()=>u}),a(976413),a(718881);var r=a(917339),n=a(294799),s=a(834023),i=a(556566),l=a(153523),o=a(88221),c=a(115856);let d=c.bL,u=c.l9;c.YJ,c.ZL,c.Pb,c.z6,(0,s.forwardRef)(({className:e,inset:t,children:a,...s},l)=>(0,n.jsxs)(c.ZP,{ref:l,className:(0,r.cn)("flex cursor-default select-none items-center gap-[8px] rounded-sm px-[8px] py-[6px] text-[14px] outline-none","focus:bg-accent data-[state=open]:bg-accent","[&_svg]:pointer-events-none [&_svg]:size-[16px] [&_svg]:shrink-0",t&&"pl-[32px]",e),...s,children:[a,(0,n.jsx)(i.c,{className:"ml-auto"})]})).displayName=c.ZP.displayName,(0,s.forwardRef)(({className:e,...t},a)=>(0,n.jsx)(c.G5,{ref:a,className:(0,r.cn)("z-modal min-w-[128px] overflow-hidden rounded-md border bg-popover p-[4px] text-popover-foreground shadow-lg","origin-[var(--radix-dropdown-menu-content-transform-origin)]","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[state=open]:duration-[160ms] data-[state=open]:ease-out-strong","data-[state=closed]:duration-[120ms] data-[state=closed]:ease-in","data-[side=bottom]:slide-in-from-top-[2px] data-[side=left]:slide-in-from-right-[2px] data-[side=right]:sli
71de-in-from-left-[2px] data-[side=top]:slide-in-from-bottom-[2px]",e),...t})).displayName=c.G5.displayName;let p=(0,s.forwardRef)(({className:e,sideOffset:t=4,disablePortal:a,...s},i)=>{let l=(0,n.jsx)(c.UC,{ref:i,sideOffset:t,className:(0,r.cn)("z-modal min-w-[128px] overflow-hidden rounded-md border bg-popover p-[4px] text-popover-foreground shadow-md","origin-[var(--radix-dropdown-menu-content-transform-origin)]","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[state=open]:duration-[160ms] data-[state=open]:ease-out-strong","data-[state=closed]:duration-[120ms] data-[state=closed]:ease-in","data-[side=bottom]:slide-in-from-top-[2px] data-[side=left]:slide-in-from-right-[2px] data-[side=right]:slide-in-from-left-[2px] data-[side=top]:slide-in-from-bottom-[2px]",e),...s});return a?l:(0,n.jsx)(c.ZL,{children:l})});p.displayName=c.UC.displayName;let m=(0,s.forwardRef)(({className:e,inset:t,...a},s)=>(0,n.jsx)(c.q7,{ref:s,className:(0,r.cn)("relative flex cursor-default select-none items-center gap-[8px] rounded-sm px-[8px] py-[6px] text-[14px] outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-[16px] [&_svg]:shrink-0",t&&"pl-[32px]",e),...a}));m.displayName=c.q7.displayName,(0,s.forwardRef)(({className:e,children:t,checked:a,...s},i)=>(0,n.jsxs)(c.H_,{ref:i,className:(0,r.cn)("relative flex cursor-default select-none items-center rounded-sm py-[6px] pl-[32px] pr-[8px] text-[14px] outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...s,children:[(0,n.jsx)("span",{className:"absolute left-[8px] flex h-[14px] w-[14px] items-center justify-center",children:(0,n.jsx)(c.VF,{children:(0,n.jsx)(l.J,{className:"h-[16px] w-[16px]"})})}),t]})).displayName=c.H_.displayName,(0,s.forwardRef)(({className:e,children:t,...a},s)=>(0,n.jsxs)(c.hN,{ref:s,className:(0,r.cn)("relative flex cursor-default select-none items-center rounded-sm py-[6px] pl-[32px] pr-[8px] text-[14px] outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,n.jsx)("span",{className:"absolute left-[8px] flex h-[14px] w-[14px] items-center justify-center",children:(0,n.jsx)(c.VF,{children:(0,n.jsx)(o.j,{className:"h-[8px] w-[8px] fill-current"})})}),t]})).displayName=c.hN.displayName,(0,s.forwardRef)(({className:e,inset:t,...a},s)=>(0,n.jsx)(c.JU,{ref:s,className:(0,r.cn)("px-[8px] py-[6px] text-[14px] font-semibold",t&&"pl-[32px]",e),...a})).displayName=c.JU.displayName,(0,s.forwardRef)(({className:e,...t},a)=>(0,n.jsx)(c.wv,{ref:a,className:(0,r.cn)("-mx-[4px] my-[4px] h-[1px] bg-muted",e),...t})).displayName=c.wv.displayName},716710:(e,t,a)=>{"use strict";function r(e){let t=Number.parseInt(e.replace(/-/g,"").slice(-12),16)%20+1;return{url:`/images/default-avatars/${t}.png`,hex:({1:"#FE565A",2:"#FFAD54",3:"#9A68CF",4:"#FF6888",5:"#F96F57",6:"#5DC171",7:"#8393F6",8:"#F098F1",9:"#C33F62",10:"#FF9043",11:"#F681C0",12:"#3156B0",13:"#20A47C",14:"#8186F4",15:"#929FF4",16:"#FB5F6C",17:"#898EEB",18:"#F9795B",19:"#FFB146",20:"#E05B70"})[t]}}a.d(t,{s:()=>r})},728800:(e,t,a)=>{"use strict";a.d(t,{AppBuilderModal:()=>x,w:()=>m});var r=a(294799),n=a(11241),s=a(35279),i=a(665237),l=a(789545),o=a(890292),c=a(480309),d=a(777201),u=a(388001),p=a(834023);let m=(0,u.A)();function x(){let e,t,a,u,x,g,y,f,h=(0,n.c)(20),[_,N]=(0,p.useState)(null),[T,v]=(0,p.useState)(!1),[j,C]=(0,p.useState)(!1);h[0]===Symbol.for("react.memo_cache_sentinel")?(e=e=>{e||(N(null),C(!1),m.emit("closeModal",void 0)),v(e)},h[0]=e):e=h[0];let S=e;if(h[1]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{let e=e=>{null!==e&&"object"==typeof e&&"content"in e&&"hideCloseButton"in e?(N(e.content),C(e.hideCloseButton??!1)):(N(e),C(!1)),v(!0)},t=()=>{N(null),v(!1),C(!1)};return m.on("openModal",e),m.on("closeModal",t),()=>{m.off("openModal",e),m.off("closeModal",t)}},a=[],h[1]=t,h[2]=a):(t=h[1],a=h[2]),(0,p.useEffect)(t,a),!(0,s.GM)()){let e,t,a;h[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(i.h,{}),h[3]=e):e=h[3],h[4]!==_?(t=(0,r.jsxs)("div",{className:"flex h-[80dvh] flex-col overflow-auto bg-white",children:[e,_]}),h[4]=_,h[5]=t):t=h[5];let n=!j;return h[6]!==T||h[7]!==t||h[8]!==n?(a=(0,r.jsx)(i._,{content:t,nested:!0,open:T,modal:!0,dismissible:n,onOpenChange:S,children:null}),h[6]=T,h[7]=t,h[8]=n,h[9]=a):a=h[9],a}return h[10]===Symbol.for("react.memo_cache_sentinel")?(u=(0,r.jsx)(c.hJ,{className:"fade-in fixed inset-0 z-overlay animate-in tablet:bg-comeback-gray-900/80 duration-[220ms] ease-out-strong"}),h[10]=u):u=h[10],h[11]===Symbol.for("react.memo_cache_sentinel")?(x=(0,r.jsx)(d.s6,{children:(0,r.jsx)(c.hE,{children:"Modal"})}),h[11]=x):x=h[11],h[12]!==j?(g=!j&&(0,r.jsx)(c.HM,{className:"absolute tablet:top-[4px] top-[2px] right-[2px] tablet:right-[4px] w-fit roun
71ded p-[4px] text-comeback-gray-500 outline-none transition-colors hover:bg-comeback-gray-50",children:(0,r.jsx)(l.I,{size:"custom",className:"h-[20px] tablet:h-[12px] tablet:w-[12px] w-[20px]",content:o.tx})}),h[12]=j,h[13]=g):g=h[13],h[14]!==_||h[15]!==g?(y=(0,r.jsxs)(c.ZL,{children:[u,(0,r.jsxs)(c.UC,{onCloseAutoFocus:b,className:"fade-in slide-in-from-bottom-4 fixed inset-0 tablet:inset-[0.75rem] z-modal m-auto flex h-full tablet:h-fit tablet:max-h-[100dvh] tablet:w-fit animate-in flex-col overflow-auto tablet:rounded-xl bg-white text-comeback-gray-900 shadow-style-1 outline-none duration-[280ms] ease-out-strong",children:[x,g,_]})]}),h[14]=_,h[15]=g,h[16]=y):y=h[16],h[17]!==T||h[18]!==y?(f=(0,r.jsx)(c.bL,{open:T,onOpenChange:S,children:y}),h[17]=T,h[18]=y,h[19]=f):f=h[19],f}function b(){document.body.style.pointerEvents=""}},732950:e=>{e.exports={shadow:"styles_shadow__HRypT",action:"styles_action__zeki4"}},760486:(e,t,a)=>{"use strict";a.d(t,{q:()=>h});var r=a(294799),n=a(11241),s=a(555246),i=a(728800),l=a(125695),o=a(926518),c=a(789545),d=a(890292),u=a(103967),p=a(676044),m=a(552417),x=a(583735),b=a(858720),g=a(106504);function y(e){let t,a,s,i,y,h,_,N,T,v,j,C,S,w,E,O,I=(0,n.c)(18),{organizationId:k}=e,{referralLink:A}=(0,b.x)(k),P=A||`${l.Ay.NEXT_PUBLIC_PREFERRED_URL??l.Ay.NEXT_PUBLIC_URL}/dashboard/team/invite`;I[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(c.I,{content:d.jl,size:"large",className:"mx-auto text-comeback-gray-700"})}),I[0]=t):t=I[0],I[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,r.jsxs)(r.Fragment,{children:[t,(0,r.jsxs)(u.E,{type:"body-lg",weight:"medium",className:"mb-2 text-comeback-gray-900",children:["Get up to ",(0,o.uK)(5)," credits right now"]}),(0,r.jsx)(u.E,{type:"body-md",className:"mb-4 text-comeback-gray-600",children:"by sharing your story on X"})]}),I[1]=a):a=I[1];let U=a;return I[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,r.jsx)("button",{type:"button",onClick:f,"aria-label":"Close",className:"absolute top-4 right-4 rounded-full p-2 transition-colors hover:bg-gray-100",children:(0,r.jsx)(p.X,{className:"text-comeback-gray-700",width:18,height:18})}),I[2]=s):s=I[2],I[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,r.jsxs)("div",{className:"mb-6 flex flex-col items-start gap-[4px]",children:[(0,r.jsx)(u.E,{type:"display-lg",weight:"medium",children:"Share"}),(0,r.jsx)(u.E,{type:"body-lg",className:"text-comeback-gray-500",children:"and earn free credits"})]}),I[3]=i):i=I[3],I[4]===Symbol.for("react.memo_cache_sentinel")?(y=(0,r.jsx)(u.E,{type:"body-md",weight:"medium",className:"mb-4 text-comeback-gray-500",children:"How it works:"}),I[4]=y):y=I[4],I[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(c.I,{content:d.vp,size:"medium",className:"mt-0.5 text-comeback-gray-700"}),(0,r.jsx)(u.E,{type:"body-md",className:"text-comeback-gray-900",children:"Share your invite link"})]}),I[5]=h):h=I[5],I[6]===Symbol.for("react.memo_cache_sentinel")?(_=(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)(c.I,{content:d.Du,size:"medium",className:"mt-0.5 text-comeback-gray-700"}),(0,r.jsx)(u.E,{type:"body-md",className:"text-comeback-gray-900",children:"They sign up"})]}),I[6]=_):_=I[6],I[7]===Symbol.for("react.memo_cache_sentinel")?(N=(0,r.jsx)(c.I,{content:d.jl,size:"medium",className:"mt-0.5 text-comeback-gray-700"}),I[7]=N):N=I[7],I[8]===Symbol.for("react.memo_cache_sentinel")?(T=(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[N,(0,r.jsx)(u.E,{type:"body-md",className:"text-comeback-gray-900",children:(0,r.jsxs)("strong",{children:["Both of you get"," ",(0,o.uK)(x.T.SIGNUP_REFEREE_BONUS)," ","credits"]})})]}),I[8]=T):T=I[8],I[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,r.jsx)(c.I,{content:d.jl,size:"medium",className:"mt-0.5 text-comeback-gray-700"}),I[9]=v):v=I[9],I[10]===Symbol.for("react.memo_cache_sentinel")?(j=(0,r.jsxs)("div",{className:"mb-6",children:[y,(0,r.jsxs)("div",{className:"space-y-3",children:[h,_,T,(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[v,(0,r.jsxs)(u.E,{type:"body-md",className:"text-comeback-gray-900",children:["You get"," ",(0,r.jsxs)("strong",{children:[(0,o.uK)(x.T.CONVERSION_REFERRER_BONUS)," ","credits"]})," ","once they upgrade to Pro"]})]})]})]}),I[10]=j):j=I[10],I[11]===Symbol.for("react.memo_cache_sentinel")?(C=(0,r.jsx)(u.E,{type:"body-sm",className:"mb-2 text-comeback-gray-500",children:"Your inv
71ite link:"}),I[11]=C):C=I[11],I[12]!==P?(S=(0,r.jsxs)("div",{className:"mb-6",children:[C,(0,r.jsxs)("label",{className:"flex items-center rounded-[8px] border border-comeback-gray-75 bg-white",children:[(0,r.jsx)("input",{readOnly:!0,value:P,className:"w-full flex-1 truncate rounded-l-[8px] py-[10px] pl-[14px] tablet:text-sm text-comeback-gray-900 outline-none disabled:bg-white","aria-label":"Your referral link"}),(0,r.jsx)(m.Ay,{className:"mr-[14px] ml-[6px] text-comeback-gray-500",textToCopy:P,variant:"tooltip"})]})]}),I[12]=P,I[13]=S):S=I[13],I[14]===Symbol.for("react.memo_cache_sentinel")?(w=(0,r.jsxs)("div",{className:"mb-6 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"flex-1 border-comeback-gray-100 border-t"}),(0,r.jsx)(u.E,{type:"body-sm",className:"mx-4 text-comeback-gray-200",children:"OR"}),(0,r.jsx)("div",{className:"flex-1 border-comeback-gray-100 border-t"})]}),E=(0,r.jsx)("a",{href:g.T0,className:"inline-block w-full cursor-pointer rounded-lg border border-comeback-gray-50 bg-white p-6 text-center shadow-style-1 transition-[border-color,box-shadow,transform] duration-[180ms] ease-out-strong hover:border-comeback-gray-100 hover:shadow-lg active:scale-[0.98]",target:"_blank",rel:"noreferrer",children:U}),I[14]=w,I[15]=E):(w=I[14],E=I[15]),I[16]!==S?(O=(0,r.jsxs)("div",{className:"no-scrollbar relative mx-auto tablet:min-w-[500px] max-w-4xl rounded-lg bg-white p-8",children:[s,i,j,S,w,E]}),I[16]=S,I[17]=O):O=I[17],O}function f(){i.w.emit("closeModal")}let h=()=>{let e,t=(0,n.c)(2),a=(0,s.jt)();return t[0]!==a?(e={open:e=>{let{organizationId:t,source:n}=e;a("Referral Modal Shown",{source:void 0===n?"dashboard_menu":n}),i.w.emit("openModal",(0,r.jsx)(y,{organizationId:t}))}},t[0]=a,t[1]=e):e=t[1],e}},768775:(e,t,a)=>{"use strict";a.d(t,{z:()=>l});var r=a(294799),n=a(11241),s=a(103967),i=a(917339);function l(e){let t,a,l,o,c,d,u,p,m,x=(0,n.c)(20),{isYearly:b,onChange:g}=e,y=b?"text-comeback-gray-400":"text-white";x[0]!==y?(t=(0,i.cn)("z-float px-[12px] py-[4px] text-center text-[14px] transition-colors duration-150",y),x[0]=y,x[1]=t):t=x[1],x[2]!==t?(a=(0,r.jsx)("span",{className:t,children:"Monthly"}),x[2]=t,x[3]=a):a=x[3];let f=b?"text-white":"text-comeback-gray-400";x[4]!==f?(l=(0,i.cn)("z-float px-[12px] py-[4px] text-center text-[14px] transition-colors duration-150",f),x[4]=f,x[5]=l):l=x[5],x[6]!==l?(o=(0,r.jsx)("span",{className:l,children:"Yearly"}),x[6]=l,x[7]=o):o=x[7];let h=b?"translate-x-full":"translate-x-0";return x[8]!==h?(c=(0,i.cn)("absolute inset-y-0 block h-full w-[50%] rounded-[8px] border border-comeback-gray-900 bg-comeback-gray-800 transition-transform duration-150 ease-[
71cubic-bezier(0.23,1,0.32,1)]",h),x[8]=h,x[9]=c):c=x[9],x[10]!==c?(d=(0,r.jsx)("span",{className:c}),x[10]=c,x[11]=d):d=x[11],x[12]!==g||x[13]!==a||x[14]!==o||x[15]!==d?(u=(0,r.jsxs)("button",{type:"button",onClick:g,className:"relative grid grid-cols-2 rounded-[8px] bg-comeback-gray-50 outline-none transition-transform duration-[160ms] ease-[cubic-bezier(0.23,1,0.32,1)] focus-visible:ring-2 focus-visible:ring-comeback-gray-75 focus-visible:ring-offset-2 active:scale-[0.97]",children:[a,o,d]}),x[12]=g,x[13]=a,x[14]=o,x[15]=d,x[16]=u):u=x[16],x[17]===Symbol.for("react.memo_cache_sentinel")?(p=(0,r.jsxs)(s.E,{className:"text-comeback-gray-500",children:["Get ",(0,r.jsx)("strong",{children:"2 months free"})," with annual"]}),x[17]=p):p=x[17],x[18]!==u?(m=(0,r.jsxs)("div",{className:"flex flex-col items-center gap-[12px]",children:[u,p]}),x[18]=u,x[19]=m):m=x[19],m}},798812:(e,t,a)=>{"use strict";a.d(t,{A:()=>x});var r=a(294799),n=a(11241),s=a(125695),i=a(103967),l=a(917339),o=a(309894),c=a(288338),d=a(520942),u=a(834023);function p(e){let t,a,s,d,p,m,x,b=(0,n.c)(16),{onComplete:g}=e,y=(0,c.t2)(),f=(0,c.HH)(),[h,_]=(0,u.useState)(!1),[N,T]=(0,u.useState)(null);b[0]!==f||b[1]!==g||b[2]!==y?(t=async()=>{if(!y||!f)return;_(!0),T(null);let e=await y.confirmSetup({elements:f,redirect:"if_required"});if(e.error){T(e.error.message??"Unable to save payment method"),_(!1);return}_(!1),g?.(e.setupIntent)},b[0]=f,b[1]=g,b[2]=y,b[3]=t):t=b[3];let v=t;b[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.cn)("box-border w-full overflow-visible overflow-y-auto bg-white"),s=(0,r.jsx)(i.E,{type:"display-md",className:"mb-6",children:"Setup Payment Method"}),d=(0,r.jsx)(c.He,{}),b[4]=a,b[5]=s,b[6]=d):(a=b[4],s=b[5],d=b[6]),b[7]!==N?(p=N&&(0,r.jsx)("div",{className:"mt-4 text-comeback-red-600",children:N}),b[7]=N,b[8]=p):p=b[8];let j=!y||h,C=h?"Saving...":"Confirm payment method";return b[9]!==v||b[10]!==j||b[11]!==C?(m=(0,r.jsx)(o.Button,{color:"dark",onPress:v,disabled:j,className:"mt-4 w-full",children:C}),b[9]=v,b[10]=j,b[11]=C,b[12]=m):m=b[12],b[13]!==p||b[14]!==m?(x=(0,r.jsxs)("div",{className:a,children:[s,d,p,m]}),b[13]=p,b[14]=m,b[15]=x):x=b[15],x}let m=(0,d.c)(s.Ay.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY);function x(e){let t,a,s,i=(0,n.c)(7),{clientSecret:l,onComplete:o}=e;i[0]!==l?(t={clientSecret:l},i[0]=l,i[1]=t):t=i[1];let d=t;return i[2]!==o?(a=(0,r.jsx)(p,{onComplete:o}),i[2]=o,i[3]=a):a=i[3],i[4]!==d||i[5]!==a?(s=(0,r.jsx)(c.S8,{stripe:m,options:d,children:a}),i[4]=d,i[5]=a,i[6]=s):s=i[6],s}},858720:(e,t,a)=>{"use strict";a.d(t,{x:()=>o});var r=a(11241),n=a(106504),s=a(751355),i=a(510822);let l=(0,s.U)(` 72 query GetOrganizationReferralCode($organizationId: ID!) { 73 organizationById(id: $organizationId) { 74 id 75 referralCode 76 referralCount 77 } 78 } 79`);function o(e){let t,a,s,o,c,d=(0,r.c)(13),u=e||"";d[0]!==u?(t={organizationId:u},d[0]=u,d[1]=t):t=d[1];let p=!e;d[2]!==t||d[3]!==p?(a={variables:t,skip:p,fetchPolicy:"cache-first"},d[2]=t,d[3]=p,d[4]=a):a=d[4];let{data:m,loading:x,error:b}=(0,i.I)(l,a),g=m?.organizationById?.referralCode||null;d[5]!==g?(s=g?(0,n.CI)({referralCode:g,fullURL:!0}):null,d[5]=g,d[6]=s):s=d[6];let y=s;return d[7]!==b?(o=b?Error(b.message):null,d[7]=b,d[8]=o):o=d[8],d[9]!==x||d[10]!==y||d[11]!==o?(c={referralLink:y,loading:x,error:o},d[9]=x,d[10]=y,d[11]=o,d[12]=c):c=d[12],c}},869208:(e,t,a)=>{"use strict";a.d(t,{X:()=>L});var r=a(294799),n=a(451286),s=a(125695),i=a(728800),l=a(143306),o=a(74916),c=a(880387),d=a(11241),u=a(760486),p=a(648692),m=a(103967);let x=()=>{let e,t,a,n,s=(0,d.c)(7),{open:l}=(0,u.q)(),{state:o}=(0,p.A)(),{organizations:c}=o;s[0]!==l||s[1]!==c[0]?(e=()=>{let e=c[0];e&&(i.w.emit("closeModal"),setTimeout(()=>{l({organizationId:e.id,source:"upsell_modal"})},100))},s[0]=l,s[1]=c[0],s[2]=e):e=s[2];let x=e;return s[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)(m.E,{children:"Want free credits?"}),s[3]=t):t=s[3],s[4]===Symbol.for("react.memo_cache_sentinel")?(a=(0,r.jsx)(m.E,{className:"underline",children:"Share or post about Anything for more"}),s[4]=a):a=s[4],s[5]!==x?(n=(0,r.jsxs)("div",{className:"flex flex-row items-center gap-[4px]",children:[t,(0,r.jsx)("button",{onClick:x,children:a})]}),s[5]=x,s[6]=n):n=s[6],n};var b=a(35279),g=a(186472),y=a(106504),f=a(555246),h=a(211387),_=a(33031),N=a(834023),T=a(768775),v=a(917339),j=a(737356),C=a(36370),S=a(883690),w=a(439502),E=a(592048),O=a(751355),I=a(814121);let k=(0,O.U)(` 80 mutation CreateCheckoutSessionWithLookup( 81 $input: CreateCheckoutSessionWithPriceLookupInput! 82 ) { 83 createCheckoutSessionWithPriceLookup(input: $input) { 84 url 85 } 86 } 87`),A=(0,O.U)(` 88 mutation CreateBillingPortalURL($input: CreateBillingPortalURLInput!) { 89 createBillingPortalURL(input: $input) { 90 url 91 success 92 } 93 } 94`),P=(0,O.U)(` 95 mutation CreateEmbeddedCheckoutSession( 96 $input: CreateEmbeddedCheckoutSessionInput! 97 ) { 98 createEmbeddedCheckoutSession(input: $input) { 99 success 100 clientSecret 101 sessionId 102 } 103 } 104`);async function U({sessionId:e}){try{let t=await fetch(`/api/billing?session_id=${encodeURIComponent(e)}`,{redirect:"manual"});t.ok||"opaqueredirect"===t.type||n.wd(`Billing session handler returned ${t.status}`,"warning")}catch{}}function L({title:e,subTitle:t,description:a,code:d,organizationId:u,source:O,variant:R="default"}){let D=(0,f.jt)(),G=(0,g.d)(e=>e.referral),M=(0,b.al)(),z="dashboard"===R,[H,{loading:F}]=(0,I.n)(P),[B,{loading:$}]=(0,I.n)(k),[K]=(0,I.n)(A),W=F||$,V=`${s.Ay.NEXT_PUBLIC_DEMO_URL}?utm_medium=${M?"mobile":"web"}&utm_source=homepage&utm_content=pricing`,{state:{organizations:Y}}=(0,p.A)(),q=Y.find(e=>e.id===u),[X,J]=(0,N.useState)(!q||q.stripeSubscriptionInterval!==S.cbG.MONTHLY),Z=q?.plan||_.OrganizationPlan.FREE_USAGE,Q=q?.planId??null,ee=!!q?.revenueCatProductId&&null===q.stripeProductId,{usagePlansStrategy:et,embeddedCheckoutEnabled:ea=!1}=(0,w.Wi)(),er=async e=>{let t=Object.entries((0,o.e$)()).find(([t,a])=>a.prices.some(t=>t.stripePriceId===e.stripePriceId)),a=t?t[1].name:"Unknown Plan";if(t||n.wd(`Unknown plan for price ID: ${e.stripePriceId}`,"warning"),O&&D("Upsell Modal Checkout Clicked",{source:O,plan_selected:a}),e.stripePriceId.startsWith("team_"))return void window.open(V,"_blank");if((0,_.isPaidPlan)(Z))return void await (0,h.a)(async()=>{let{data:t,error:a}=await K({variables:{input:{organizationId:u,priceId:e.stripePriceId}}}),r=t?.createBillingPortalURL.url;return a||!r?(n.Cp(a??Error("Could not create billing URL")),null):r});if(ea){try{let{data:t,error:a}=await H({variables:{input:{lookup:e.stripePriceId,promotionCode:d??null,organizationId:u,referral:G??null}}}),n=t?.createEmbeddedCheckoutSession;if(a||!n?.clientSecret)throw a??Error("Could not create checkout session");let{clientSecret:s,sessionId:l}=n;
104i.w.emit("openModal",(0,r.jsx)(c.N,{clientSecret:s,onComplete:async()=>{await U({sessionId:l}),i.w.emit("closeModal",void 0),window.location.pathname.includes(y.rG)?window.location.href=(0,y.J1)({organizationId:u}):window.location.reload()}}))}catch(e){n.Cp(e),j.oR.error("Failed to start checkout. Please try again.")}return}await (0,h.a)(async()=>{let{data:t,error:a}=await B({variables:{input:{lookup:e.stripePriceId,promotionCode:d,organizationId:u,referral:G,redirectURL:window.location.href}}}),r=t?.createCheckoutSessionWithPriceLookup.url;return a||!r?(n.Cp(a??Error("Could not create checkout URL")),null):r})},en=(0,o.Zu)({planStrategy:(0,E.m)(et)}).filter(e=>"free-card"!==e.cardId);return(0,r.jsx)("div",{className:(0,v.cn)("flex w-full flex-col gap-[100px]",z?"":"my-[32px]"),children:(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-[24px]",children:[ee?(0,r.jsx)("div",{className:(0,v.cn)("w-full",z?"":"px-[72px]"),children:(0,r.jsx)(C.SubscriptionManagementBanner,{})}):(0,r.jsxs)("div",{className:"flex flex-col items-center gap-[16px]",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-[4px] px-[20px] tablet:px-0",children:[!z&&(0,r.jsx)(m.E,{type:"display-xs",weight:"medium",children:e}),!!t&&(0,r.jsx)(m.E,{type:"body-lg",className:"text-comeback-gray-500",children:t})]}),(0,r.jsx)(T.z,{isYearly:X,onChange:()=>J(e=>!e)})]}),(0,r.jsx)("div",{className:"flex w-full flex-col items-center justify-center gap-[30px]",children:(0,r.jsx)("div",{className:(0,v.cn)("grid w-full grid-cols-1 tablet:grid-cols-2 gap-[32px]",en.length%2==0?"desktop:grid-cols-2":"desktop:grid-cols-3",z?"":"px-[72px]",ee&&"opacity-50"),children:en.map(e=>(0,r.jsx)(l.f,{cardData:e,isYearly:X,onSelectPrice:er,loading:!!W,currentStripeProductId:Q,isRevenueCatProductId:ee,isLoggedIn:!0,variant:"large",onChangeStripeProductId:null},e.cardId))})}),!!a&&(0,r.jsx)(m.E,{type:"body-sm",children:a}),!z&&(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(x,{})})]})})}},880387:(e,t,a)=>{"use strict";a.d(t,{N:()=>d});var r=a(294799),n=a(11241),s=a(125695),i=a(917339),l=a(520942),o=a(288338);let c=(0,l.c)(s.Ay.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY);function d(e){let t,a,s,l,d,u=(0,n.c)(11),{className:p,clientSecret:m,onComplete:x}=e;return u[0]!==p?(t=(0,i.cn)("box-border max-h-[90dvh] min-h-[850px] w-full min-w-[90dvw] overflow-visible overflow-y-auto bg-comeback-blue-600 p-8",p),u[0]=p,u[1]=t):t=u[1],u[2]!==m||u[3]!==x?(a={clientSecret:m,onComplete:x},u[2]=m,u[3]=x,u[4]=a):a=u[4],u[5]===Symbol.for("react.memo_cache_sentinel")?(s=(0,r.jsx)(o.zm,{}),u[5]=s):s=u[5],u[6]!==a?(l=(0,r.jsx)("div",{className:"w-full bg-comeback-blue-600",children:(0,r.jsx)(o.OH,{stripe:c,options:a,children:s})}),u[6]=a,u[7]=l):l=u[7],u[8]!==t||u[9]!==l?(d=(0,r.jsx)("div",{className:t,children:l}),u[8]=t,u[9]=l,u[10]=d):d=u[10],d}},985413:(e,t,a)=>{"use strict";a.d(t,{W:()=>c});var r=a(294799),n=a(11241),s=a(555246),i=a(439502),l=a(728800),o=a(869208);let c=()=>{let e,t=(0,n.c)(3),a=(0,s.jt)(),c=(0,i.Wi)();return t[0]!==c||t[1]!==a?(e={open:e=>{let{title:t,subTitle:n,description:s,organizationId:i,source:d}=e;a("Upsell Modal Shown",{source:d,featureFlags:c}),l.w.emit("openModal",{content:(0,r.jsx)(o.X,{title:t,subTitle:n,description:s,organizationId:i,subscriptionStartDate:null,source:d}),hideCloseButton:null})}},t[0]=c,t[1]=a,t[2]=e):e=t[2],e}},989378:(e,t,a)=>{"use strict";a.d(t,{bq:()=>d,eb:()=>x,gC:()=>m,l6:()=>o,yv:()=>c});var r=a(294799),n=a(152155),s=a(498637),i=a(834023),l=a(917339);let o=s.bL;s.YJ;let c=s.WT,d=i.forwardRef(({className:e,children:t,...a},i)=>(0,r.jsxs)(s.l9,{ref:i,className:(0,l.cn)("flex w-full items-center justify-between whitespace-nowrap rounded-md border border-comeback-gray-75 bg-transparent px-3 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",{"h-8 py-2":"md"===a.size,"h-[28px] py-[2px]":"sm"===a.size},e),...a,children:[t,(0,r.jsx)(s.In,{asChild:!0,children:a.icon??(0,r.jsx)(n.D3D,{className:"h-4 w-4 opacity-50"})})]}));d.displayName=s.l9.displayName;let u=i.forwardRef(({className:e,...t},a)=>(0,r.jsx)(s.PP,{ref:a,className:(0,l.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,r.jsx)(n.Mtm,{})}));u.displayName=s.PP.displayName;let p=i.forwardRef(({className:e,...t},a)=>(0,r.jsx)(s.wn,{ref:a,className:(0,l.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,r.jsx)(n.D3D,{})}));p.displayName=s.wn.displayName;let m=i.forwardRef(({className:e,children:t,position:a="popper",...n},i)=>(0,r.jsx)(s.ZL,{children:(0,r.jsxs)(s.UC,{ref:i,className:(0,l.cn)("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
104de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-modal max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover bg-white text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in","popper"===a&&"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",e),position:a,...n,children:[(0,r.jsx)(u,{}),(0,r.jsx)(s.LM,{className:(0,l.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),(0,r.jsx)(p,{})]})}));m.displayName=s.UC.displayName,i.forwardRef(({className:e,...t},a)=>(0,r.jsx)(s.JU,{ref:a,className:(0,l.cn)("px-2 py-1.5 font-semibold text-sm",e),...t})).displayName=s.JU.displayName;let x=i.forwardRef(({className:e,children:t,...a},i)=>(0,r.jsxs)(s.q7,{ref:i,className:(0,l.cn)("hover:bg-comeback-gray-50","relative flex w-full cursor-pointer select-none items-center rounded-sm py-2 pr-2 pl-6 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,r.jsx)(s.p4,{children:t}),(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(n.Srz,{className:"h-4 w-4"})})})]}));x.displayName=s.q7.displayName,i.forwardRef(({className:e,...t},a)=>(0,r.jsx)(s.wv,{ref:a,className:(0,l.cn)("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=s.wv.displayName}}]);
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.