"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[731],{45875:(e,t,r)=>{r.d(t,{L:()=>E});var n=r(42294),s=r(10562),o=r(4795),l=r(46212),i=r(36245),a=r(89103),c=r(31206),d=r(87661),u=r(69199),x=r(13326),h=r(87603),m=r(8219),f=r(78355),p=r(24164),g=r(66807);function j(e){let{setScreen:t}=e,[r,s]=(0,l.useState)({message:"",attachmentIds:[]}),[j,k]=(0,l.useState)([]),v=async e=>{k(t=>[...t,{file:e,uploading:!0}]);let{attachment:{id:t},uploadFormUrl:r,uploadFormData:n}=await fetch("/api/support/upload?name=".concat(e.name,"&size=").concat(e.size),{method:"GET"}).then(e=>e.json()),o=new FormData;n.forEach(e=>{let{key:t,value:r}=e;o.append(t,r)}),o.append("file",e),fetch(r,{method:"POST",body:o}).then(e=>{e.ok||g.A.error(e.statusText)}).catch(e=>{console.error("Error uploading file:",e.message?e.message:e)}),k(r=>r.map(r=>r.file===e?{...r,uploading:!1,attachmentId:t}:r)),s(e=>({...e,attachmentIds:[...e.attachmentIds,t]}))},y=(0,l.useRef)(null),[b,w]=(0,l.useState)("idle"),{handleKeyDown:N}=(0,a.useEnterSubmit)(y);return(0,n.jsxs)("div",{className:"relative w-full px-3 pb-16 pt-5 sm:px-6",children:[(0,n.jsxs)("button",{type:"button",className:"-ml-2 flex items-center space-x-1 px-2 py-1",onClick:()=>t("main"),children:[(0,n.jsx)(h.Z,{className:"h-5 w-5"}),(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-700",children:"Contact support"})]}),(0,n.jsx)(x.M,{children:"success"===b?(0,n.jsxs)(o.E.div,{className:"flex h-[280px] flex-col items-center justify-center space-y-3 text-center",initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:[(0,n.jsx)(i.Rf,{className:"h-8 w-8 text-green-500"}),(0,n.jsxs)("p",{className:"text-gray-500",children:["Thanks for reaching out! ",(0,n.jsx)("br",{})," We'll get back to you as soon as possible."]})]}):(0,n.jsxs)(o.E.form,{ref:y,className:"mt-5 grid gap-2",onSubmit:async e=>{e.preventDefault(),w("loading");let t=await fetch("/api/support",{method:"POST",body:JSON.stringify(r)}).then(e=>e.json());t.error?(g.A.error(t.error),w("idle")):(s({message:"",attachmentIds:[]}),w("success"))},initial:{opacity:1,y:0},exit:{opacity:0,y:-10},children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Describe the issue"}),(0,n.jsx)(p.Z,{name:"message",required:!0,placeholder:"E.g. My custom domain is not working.",minRows:8,autoFocus:!0,autoComplete:"off",value:r.message,onChange:e=>s(t=>({...t,message:e.target.value})),onKeyDown:N,className:"".concat("border-gray-300 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:ring-gray-500"," mt-1 block w-full resize-none rounded-md focus:outline-none sm:text-sm")})]}),(0,n.jsx)("div",{className:"grid w-full gap-2",children:j.map(e=>(0,n.jsxs)("div",{className:"flex w-full items-center justify-between rounded-md border border-gray-200",children:[(0,n.jsxs)("div",{className:"flex flex-1 items-center space-x-2 p-2",children:[e.uploading?(0,n.jsx)(c.a,{className:"h-4 w-4"}):(0,n.jsx)(m.Z,{className:"h-4 w-4 text-gray-500"}),(0,n.jsx)("p",{className:"text-center text-sm text-gray-500",children:e.file.name})]}),(0,n.jsx)("button",{className:"h-full rounded-r-md border-l border-gray-200 p-2",onClick:()=>{k(t=>t.filter(t=>t.file.name!==e.file.name)),s(t=>({...t,attachmentIds:t.attachmentIds.filter(t=>t!==e.attachmentId)}))},children:(0,n.jsx)(f.Z,{className:"h-4 w-4 text-gray-500"})})]},e.attachmentId))}),(0,n.jsx)(d.a,{accept:"any",className:"aspect-[5/1] w-full rounded-md border border-dashed border-gray-300",iconClassName:"w-5 h-5",variant:"plain",onChange:async e=>{let{file:t}=e;return await v(t)},content:"Drag and drop or click to upload."}),(0,n.jsx)("div",{className:"fixed bottom-0 left-0 z-10 flex h-16 w-full items-center justify-center rounded-b-lg bg-white px-3 sm:px-6",children:(0,n.jsx)(u.k,{className:"h-9",disabled:!r.message,loading:"loading"===b,text:"Send message"})})]})})]})}var k=r(60464),v=r(27338),y=r(66135),b=r(34938),w=r(76358),N=r(68717),L=r(33469),C=r(89533),W=r.n(C),S=r(77748),P=r(96462);function Z(e){let{setScreen:t}=e,{data:r}=(0,N.useSession)(),s=(0,l.useRef)(null),o=(0,S.y1)(e=>{L.ZP.capture("help_articles_searched",{query:e})},1e3);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"p-2 sm:p-4",children:[(0,n.jsx)("div",{className:"p-2",children:(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-700",children:"\uD83D\uDC4B How can we help?"})}),(0,n.jsxs)(v.mY,{label:"help-portal",loop:!0,shouldFilter:!1,children:[(0,n.jsx)(v.mY.Input,{autoFocus:!0,onInput:e=>{setTimeout(()=>{var e;null===(e=s.current)||void 0===e||e.scrollTo(0,0)},0),o(e.currentTarget.value)},placeholder:"Search articles, guides, and more...",className:"w-full border-none p-2 text-sm placeholder-gray-400 focus:outline-none focus:ring-0"}),(0,n.jsxs)(v.mY.List,{ref:s,className:"scrollbar-hide h-[22rem] overflow-scroll border-t border-gray-200 py-2 transition-all",children:[(0,n.jsxs)(v.mY.Empty,{onClick:()=>t("contact"),className:"flex cursor-pointer items-center space-x-2 rounded-md bg-gray-100 px-4 py-2 text-sm text-gray-600",children:[(0,n.jsx)(b.Z,{className:"h-4 w-4 text-gray-400"}),(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-blue-600",children:"Can't find what you're looking for?"}),(0,n.jsx)("p",{className:"text-xs text-gray-400",children:"Send us a message and we'll get back to you as soon as possible."})]})]}),(0,n.jsx)(M,{})]})]})]}),(0,n.jsxs)("div",{className:"flex justify-between border-t border-gray-200 px-3 py-4 sm:px-6",children:[r?(0,n.jsxs)("button",{onClick:()=>t("contact"),className:"flex items-center space-x-2 hover:underline",children:[(0,n.jsx)(b.Z,{className:"h-4 w-4"}),(0,n.jsx)("p",{className:"text-sm",children:"Contact us"})]}):(0,n.jsx)("div",{}),(0,n.jsxs)("a",{href:"https://dub.co/help",target:"_blank",className:"flex items-center space-x-2 hover:underline",children:[(0,n.jsx)("p",{className:"text-sm",children:"Help center"}),(0,n.jsx)(w.Z,{className:"h-4 w-4"})]})]})]})}let M=()=>{let{popularHelpArticles:e,allHelpArticles:t}=(0,l.useContext)(P.X),r=(0,l.useMemo)(()=>new y.Z(t,{keys:["title","searchableSummary"]}),[t]),s=(0,v.U8)(e=>e.search);return(0,l.useMemo)(()=>0===s.length?e:r.search(s).map(e=>e.item),[s,e]).map(e=>{let{slug:t,title:r,summary:o}=e;return(0,n.jsxs)(v.mY.Item,{value:r,onSelect:()=>{L.ZP.capture("help_article_selected",{query:s,slug:t}),window.open("https://dub.co/help/article/".concat(t))},className:"group flex cursor-pointer items-center justify-between space-x-2 rounded-md px-4 py-2 hover:bg-gray-100 active:bg-gray-200 aria-selected:bg-gray-100",children:[(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsx)(W(),{highlightClassName:"underline bg-transparent text-blue-600",searchWords:s.split(" "),autoEscape:!0,textToHighlight:r,className:"text-sm font-medium text-gray-600 group-aria-selected:text-blue-600 sm:group-hover:text-blue-600"}),(0,n.jsx)(W(),{highlightClassName:"underline bg-transparent text-blue-600",searchWords:s.split(" "),autoEscape:!0,textToHighlight:o,className:"line-clamp-1 text-xs text-gray-400"})]}),(0,n.jsx)(k.a,{className:"invisible -ml-4 h-4 w-4 text-blue-600 group-aria-selected:visible sm:group-hover:visible"})]},t)})};function E(){var e;let[t,r]=(0,l.useState)("main"),i=(0,l.useRef)(null),a=(0,s.a)(i);return(0,n.jsx)(o.E.div,{className:"w-full overflow-y-scroll sm:w-[32rem]",animate:{height:null!==(e=null==a?void 0:a.borderBoxSize[0].blockSize)&&void 0!==e?e:"auto",maxHeight:"calc(100vh - 10rem)"},transition:{type:"spring",duration:.3},children:(0,n.jsxs)("div",{ref:i,children:["main"===t&&(0,n.jsx)(Z,{setScreen:r}),"contact"===t&&(0,n.jsx)(j,{setScreen:r})]})})}},96462:(e,t,r)=>{r.d(t,{X:()=>n});let n=(0,r(46212).createContext)({popularHelpArticles:[],allHelpArticles:[]})},38349:(e,t,r)=>{r.d(t,{MainNav:()=>ez,h:()=>eE});var n=r(42294),s=r(92226),o=r(66877),l=r(52867),i=r(46212),a=r(7067),c=r(92759),d=r(13728),u=r(87603),x=r(94014),h=r(36245),m=r(85949),f=r(86461),p=r(13326),g=r(4795),j=r(79315),k=r(55474),v=r(68717),y=r(66807),b=r(42890),w=r(36798),N=r(13891),L=r(10235),C=r(60386),W=r(24147),S=r(80708),P=r(74526),Z=r(69199),M=r(63252),E=r(41507);let z=[{value:"twitter",label:"Twitter/X",icon:b.a},{value:"linkedin",label:"LinkedIn",icon:w.a},{value:"product-hunt",label:"Product Hunt",icon:N.a},{value:"google",label:"Google",icon:L.a},{value:"github",label:"GitHub",icon:C.a},{value:"other",label:"Other",icon:M.T}];function _(e){let{onSubmit:t}=e,{isMobile:r}=(0,s.a)(),[l,a]=(0,i.useState)(void 0),[c,d]=(0,i.useState)(void 0),{status:u}=(0,i.useContext)(T);return(0,n.jsxs)("div",{className:"grid gap-4",children:[(0,n.jsx)(W.a,{className:"h-8"}),(0,n.jsx)("p",{className:"text-sm font-medium text-gray-800",children:"Where did you hear about Dub?"}),(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),l&&t("other"===l&&null!=c?c:l)},children:[(0,n.jsx)(S.a,{name:"source",required:!0,value:l,onValueChange:e=>{a(e)},className:"grid grid-cols-2 gap-3",children:z.map(e=>(0,n.jsxs)("div",{className:(0,o.a)("group flex flex-col rounded-md border border-gray-200 bg-white transition-all active:scale-[0.98]",l===e.value?"border-white ring-2 ring-gray-600":"hover:border-gray-500 hover:ring hover:ring-gray-200 active:ring-2"),children:[(0,n.jsx)(S.b,{value:e.value,id:e.value,className:"hidden"}),(0,n.jsxs)(P.a,{htmlFor:e.value,className:"flex h-full cursor-pointer select-none items-center gap-2 px-4 py-2 text-gray-600",children:[(0,n.jsx)(e.icon,{className:(0,o.a)("h-5 w-5 transition-all group-hover:grayscale-0",{grayscale:l!==e.value,"h-4 w-4":"twitter"===e.value,"text-gray-600":"other"===e.value})}),(0,n.jsx)("p",{children:e.label}),"other"===e.value&&(0,n.jsx)("div",{className:"flex grow justify-end",children:(0,n.jsx)(E.Z,{className:(0,o.a)("h-4 w-4 transition-transform",l===e.value&&"rotate-90")})})]})]},e.value))}),"other"===l&&(0,n.jsx)("div",{className:"mt-3",children:(0,n.jsx)("label",{children:(0,n.jsx)("div",{className:"mt-2 flex rounded-md shadow-sm",children:(0,n.jsx)("input",{type:"text",required:!0,maxLength:32,autoFocus:!r,autoComplete:"off",className:"block w-full rounded-md border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",placeholder:"Reddit, Indie Hackers, etc.",value:c,onChange:e=>d(e.target.value)})})})}),void 0!==l&&(0,n.jsx)(Z.k,{className:"mt-4 h-9",variant:"primary",type:"submit",text:"Submit",loading:"loading"===u,disabled:"success"===u||!l.length||"other"===l&&!c})]})]})}let T=(0,i.createContext)({status:"idle"}),B="hideUserSurveyPopup";function A(){let{data:e}=(0,v.useSession)(),[t,r]=(0,i.useState)("1"===j.Z.get(B)),[s,l]=(0,i.useState)(!1),a=(0,i.useCallback)(()=>{l(!1),setTimeout(()=>{r(!0),j.Z.set(B,"1")},500)},[]);return(null==e?void 0:e.user)&&!e.user.source&&(0,n.jsx)(c.a,{children:(0,n.jsx)(p.M,{initial:!1,children:!t&&(0,n.jsx)(g.E.div,{exit:{opacity:0},className:"p-2",children:(0,n.jsx)(m.a,{content:(0,n.jsx)(D,{hide:a}),popoverContentClassName:"mx-2",openPopover:!t&&s,setOpenPopover:l,children:(0,n.jsx)("button",{className:(0,o.a)("rounded-md p-1 text-left text-xs text-neutral-500 transition-colors duration-75","hover:text-neutral-600 data-[state=open]:text-neutral-600","outline-none focus-visible:ring-2 focus-visible:ring-black/50"),children:"Where did you hear about Dub?"})})})})})}function D(e){let{hide:t}=e,{update:r}=(0,v.useSession)(),[s,o]=(0,i.useState)("idle");return(0,n.jsx)(f.a,{height:!0,children:(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsx)("button",{className:"absolute right-2.5 top-2.5 rounded-full p-1 transition-colors hover:bg-gray-100 active:scale-90",onClick:t,children:(0,n.jsx)(k.Z,{className:"h-4 w-4 text-gray-500"})}),(0,n.jsxs)(T.Provider,{value:{status:s},children:[(0,n.jsx)(_,{onSubmit:async e=>{o("loading");try{await fetch("/api/user",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:e})}),o("success"),setTimeout(()=>{r(),t()},3e3)}catch(e){y.A.error("Error saving response. Please try again."),o("idle")}}}),(0,n.jsx)(p.M,{children:"success"===s&&(0,n.jsxs)(g.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"absolute inset-0 flex flex-col items-center justify-center space-y-3 rounded-lg bg-white text-sm",children:[(0,n.jsx)(h.Rf,{className:"h-8 w-8 text-green-500"}),(0,n.jsx)("p",{className:"text-gray-500",children:"Thank you for your response!"})]})})]})]})})}var H=r(10910),I=r(78749),R=r(94010),O=r(5704),F=r(37147),Y=r(71039),G=r(90927),U=r(51449),q=r(67704),V=r(56597),X=r(60594);function K(e){let{"data-hovered":t,className:r,...s}=e,l=(0,i.useRef)(null),a=(0,i.useRef)(null);return(0,i.useEffect)(()=>{a.current&&l.current&&t&&(a.current.animate([{transform:"scale(1)",opacity:1},{transform:"scale(1.15)",opacity:1},{transform:"scale(1.3)",opacity:0},{transform:"scale(1)",opacity:0},{transform:"scale(1)",opacity:1}],{duration:300}),l.current.animate([{transform:"translate(0, 0)"},{transform:"translate(1px, 1px)"},{transform:"translate(0, 0)"}],{duration:300}))},[t]),(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",className:(0,o.a)("overflow-visible",r),...s,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsxs)("g",{ref:l,children:[(0,n.jsx)("path",{d:"M8.095,7.778l7.314,2.51c.222,.076,.226,.388,.007,.47l-3.279,1.233c-.067,.025-.121,.079-.146,.146l-1.233,3.279c-.083,.219-.394,.215-.47-.007l-2.51-7.314c-.068-.197,.121-.385,.318-.318Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"12.031",x2:"16.243",y1:"12.031",y2:"16.243"})]}),(0,n.jsxs)("g",{ref:a,className:"[transform-box:fill-box] [transform-origin:center] [&_*]:[vector-effect:non-scaling-stroke]",children:[(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"7.75",x2:"7.75",y1:"1.75",y2:"3.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"11.993",x2:"10.578",y1:"3.507",y2:"4.922"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"3.507",x2:"4.922",y1:"11.993",y2:"10.578"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"1.75",x2:"3.75",y1:"7.75",y2:"7.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"3.507",x2:"4.922",y1:"3.507",y2:"4.922"})]})]})})}function J(e){let{"data-hovered":t,...r}=e,s=(0,i.useRef)(null);return(0,i.useEffect)(()=>{s.current&&t&&s.current.animate([{transform:"rotate(0)"},{transform:"rotate(180deg)"}],{duration:300})},[t]),(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",ref:s,...r,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("circle",{cx:"9",cy:"9",fill:"none",r:"2.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M16.25,9.355v-.71c0-.51-.383-.938-.89-.994l-1.094-.122-.503-1.214,.688-.859c.318-.398,.287-.971-.074-1.332l-.502-.502c-.36-.36-.934-.392-1.332-.074l-.859,.688-1.214-.503-.122-1.094c-.056-.506-.484-.89-.994-.89h-.71c-.51,0-.938,.383-.994,.89l-.122,1.094-1.214,.503-.859-.687c-.398-.318-.971-.287-1.332,.074l-.502,.502c-.36,.36-.392,.934-.074,1.332l.688,.859-.503,1.214-1.094,.122c-.506,.056-.89,.484-.89,.994v.71c0,.51,.383,.938,.89,.994l1.094,.122,.503,1.214-.687,.859c-.318,.398-.287,.972,.074,1.332l.502,.502c.36,.36,.934,.392,1.332,.074l.859-.688,1.214,.503,.122,1.094c.056,.506,.484,.89,.994,.89h.71c.51,0,.938-.383,.994-.89l.122-1.094,1.214-.503,.859,.688c.398,.318,.971,.287,1.332-.074l.502-.502c.36-.36,.392-.934,.074-1.332l-.687-.859,.503-1.214,1.094-.122c.506-.056,.89-.484,.89-.994Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})}function Q(e){let{"data-hovered":t,...r}=e,s=(0,i.useRef)(null);return(0,i.useEffect)(()=>{s.current&&t&&s.current.animate([{transform:"rotate(0deg)"},{transform:"rotate(10deg)"},{transform:"rotate(-10deg)"},{transform:"rotate(0deg)"}],{duration:300})},[t]),(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",ref:s,...r,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("path",{d:"M12.188,16.484c-1.097,0-2.192-.417-3.026-1.252l-2.175-2.175c-1.671-1.671-1.671-4.39,0-6.061,.356-.356,.753-.637,1.19-.846,.371-.18,.82-.021,1,.354,.179,.374,.021,.821-.354,1-.283,.135-.541,.318-.766,.543-1.096,1.096-1.096,2.863-.01,3.95l2.175,2.175c1.086,1.085,2.853,1.086,3.939,0,1.096-1.096,1.096-2.863,.01-3.949l-.931-.931c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l.931,.931c1.671,1.671,1.671,4.389,0,6.06-.842,.842-1.944,1.262-3.044,1.262Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M9.501,11.923c-.28,0-.548-.157-.677-.427-.179-.374-.021-.821,.354-1,.283-.135,.541-.318,.766-.543,1.096-1.096,1.096-2.863,.01-3.95l-2.175-2.175c-1.085-1.085-2.853-1.086-3.939,0-1.096,1.096-1.096,2.863-.01,3.949l.931,.931c.293,.293,.293,.768,0,1.061s-.768,.293-1.061,0l-.931-.931c-1.671-1.671-1.671-4.389,0-6.06,1.682-1.681,4.4-1.682,6.07-.01l2.175,2.175c1.671,1.671,1.671,4.39,0,6.061-.356,.356-.753,.637-1.19,.846-.104,.05-.214,.073-.323,.073Z",fill:"currentColor"})]})})}let $=[.3,1.5,1.75,.75];function ee(e){let{"data-hovered":t,className:r,...s}=e,l=(0,i.useRef)(null),a=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(null);return(0,i.useEffect)(()=>{t&&[l,a,c,d].forEach((e,t)=>{e.current&&e.current.animate([{transform:"scaleY(1)"},{transform:"scaleY(".concat($[t],")")},{transform:"scaleY(1)"}],{delay:50*t,duration:400})})},[t]),(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",className:(0,o.a)("[&_line]:origin-bottom [&_line]:[transform-box:stroke-box]",r),...s,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"2.75",x2:"2.75",y1:"2.75",y2:"15.25",ref:l}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"7",x2:"7",y1:"7.75",y2:"15.25",ref:a}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"11",x2:"11",y1:"11.75",y2:"15.25",ref:c}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"15.25",x2:"15.25",y1:"4.75",y2:"15.25",ref:d})]})})}let et={default:[{items:e=>{let{slug:t}=e;return[{name:"Links",icon:Q,href:"/".concat(t),exact:!0},{name:"Analytics",icon:ee,href:"/".concat(t,"/analytics")},{name:"Events",icon:K,href:"/".concat(t,"/events")},{name:"Settings",icon:J,href:"/".concat(t,"/settings")}]}}],workspaceSettings:[{name:"Workspace",items:e=>{let{slug:t,flags:r}=e;return[{name:"General",icon:H.E,href:"/".concat(t,"/settings"),exact:!0},{name:"Domains",icon:M.T,href:"/".concat(t,"/settings/domains")},{name:"Library",icon:I._,href:"/".concat(t,"/settings/library")},{name:"Billing",icon:R.$,href:"/".concat(t,"/settings/billing")},{name:"People",icon:O.Q,href:"/".concat(t,"/settings/people")},{name:"Integrations",icon:F.a,href:"/".concat(t,"/settings/integrations")},{name:"Security",icon:Y.d,href:"/".concat(t,"/settings/security")},...(null==r?void 0:r.referrals)?[{name:"Referrals",icon:G.n,href:"/".concat(t,"/settings/referrals")}]:[]]}},{name:"Developer",items:e=>{let{slug:t,flags:r}=e;return[{name:"API Keys",icon:U.s,href:"/".concat(t,"/settings/tokens")},{name:"OAuth Apps",icon:q.O,href:"/".concat(t,"/settings/oauth-apps")},...(null==r?void 0:r.webhooks)?[{name:"Webhooks",icon:V.G,href:"/".concat(t,"/settings/webhooks")}]:[]]}},{name:"Account",items:e=>{let{slug:t}=e;return[{name:"Notifications",icon:X.Y,href:"/".concat(t,"/settings/notifications")}]}}],userSettings:[{name:"Account",items:()=>[{name:"General",icon:H.E,href:"/account/settings",exact:!0},{name:"Security",icon:Y.d,href:"/account/settings/security"},{name:"API Keys",icon:U.s,href:"/account/settings/tokens"}]}]};var er=r(73491),en=r(35470),es=r(304),eo=r(65791),el=r(73360),ei=r(76311);function ea(){let{slug:e}=(0,l.useParams)();return e?(0,n.jsx)(ec,{}):null}function ec(){let{usage:e,usageLimit:t,linksUsage:r,linksLimit:s,billingCycleStart:l,plan:c,slug:d,paymentFailedAt:u,loading:h}=(0,a.Z)(),[m]=(0,i.useMemo)(()=>{if(l){let{lastDay:e}=(0,el.f)(l);return[e.toLocaleDateString("en-us",{month:"short",day:"numeric",year:"numeric"})]}return[]},[l]),p=(0,i.useMemo)(()=>[[e,t],[r,s]].map(e=>{let[t,r]=e;return void 0!==t&&void 0!==r&&t/Math.max(0,t,r)>=.9}),[e,t,r,s]),g=p.some(e=>e);return h||void 0!==e?(0,n.jsx)(f.a,{height:!0,children:(0,n.jsxs)("div",{className:"border-t border-neutral-300/80 p-3",children:[(0,n.jsxs)(x.default,{className:"group flex items-center gap-0.5 text-sm font-normal text-neutral-500 transition-colors hover:text-neutral-700",href:"/".concat(d,"/settings/billing"),children:["Usage",(0,n.jsx)(E.Z,{className:"size-3 text-neutral-400 transition-[color,transform] group-hover:translate-x-0.5 group-hover:text-neutral-500"})]}),(0,n.jsxs)("div",{className:"mt-4 flex flex-col gap-4",children:[(0,n.jsx)(ed,{icon:es.x,label:"Events",usage:e,limit:t,warning:p[0]}),(0,n.jsx)(ed,{icon:eo.n,label:"Links",usage:r,limit:s,warning:p[1]})]}),(0,n.jsx)("div",{className:"mt-3",children:h?(0,n.jsx)("div",{className:"h-4 w-2/3 animate-pulse rounded-md bg-neutral-500/10"}):(0,n.jsx)("p",{className:(0,o.a)("text-xs text-neutral-900/40",u&&"text-red-600"),children:u?"Your last payment failed. Please update your payment method to continue using Dub.":"Usage will reset ".concat(m)})}),u?(0,n.jsx)(er.Z,{text:"Update Payment Method",variant:"primary",className:"mt-4 w-full"}):g||"free"===c?(0,n.jsx)(x.default,{href:"/".concat(d,"/upgrade"),className:(0,o.a)((0,en.d)(),"mt-4 flex h-9 items-center justify-center rounded-md border px-4 text-sm"),children:"free"===c?"Get Dub Pro":"Upgrade plan"}):null]})}):null}function ed(e){let{icon:t,label:r,usage:s,limit:l,warning:i}=e,a=void 0===s||void 0===l,c=void 0!==l&&l>=1e9;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(t,{className:"size-3.5 text-neutral-600"}),(0,n.jsx)("span",{className:"text-xs font-medium text-neutral-700",children:r})]}),a?(0,n.jsx)("div",{className:"h-4 w-16 animate-pulse rounded-md bg-neutral-500/10"}):(0,n.jsxs)("span",{className:"text-xs font-medium text-neutral-600",children:[eu(s)," of ",eu(l)]})]}),!c&&(0,n.jsx)("div",{className:"mt-1.5",children:(0,n.jsx)("div",{className:(0,o.a)("h-0.5 w-full overflow-hidden rounded-full bg-neutral-900/10 transition-colors",a&&"bg-neutral-900/5"),children:!a&&(0,n.jsx)("div",{className:"animate-slide-right-fade size-full",style:{"--offset":"-100%"},children:(0,n.jsx)("div",{className:(0,o.a)("size-full rounded-full bg-gradient-to-r from-transparent to-blue-600",i&&"to-rose-500"),style:{transform:"translateX(-".concat(100-Math.floor(s/Math.max(0,s,l)*100),"%)")}})})})})]})}let eu=e=>e>=1e9?"∞":(0,ei.a)(e,{full:void 0!==e&&e<9999,digits:1});var ex=r(64271),eh=r(88415),em=r(36385),ef=r(52164),ep=r(63001),eg=r(87735),ej=r(51204),ek=r(51147),ev=r(9016),ey=r(59904),eb=r(64364);function ew(){let{workspaces:e}=(0,eh.Z)(),{data:t,status:r}=(0,v.useSession)(),{slug:s,key:a}=(0,l.useParams)(),[c,d]=(0,i.useState)(s);(0,i.useEffect)(()=>{s&&d(s)},[s]);let u=(0,i.useMemo)(()=>{var r,n;let s=null==e?void 0:e.find(e=>e.slug===c);return c&&e&&s?{...s,image:s.logo||"".concat(ey.c).concat(s.name)}:{name:(null==t?void 0:null===(r=t.user)||void 0===r?void 0:r.name)||(null==t?void 0:null===(n=t.user)||void 0===n?void 0:n.email),slug:"/",image:(0,ef.a)(null==t?void 0:t.user),plan:"free"}},[c,e,t]),[x,h]=(0,i.useState)(!1);return e&&"loading"!==r?(0,n.jsx)("div",{children:(0,n.jsx)(m.a,{content:(0,n.jsx)(eC,{selected:u,workspaces:e,setOpenPopover:h}),align:"start",openPopover:x,setOpenPopover:h,children:(0,n.jsxs)("button",{onClick:()=>h(!x),className:(0,o.a)("flex w-full items-center justify-between rounded-lg p-1.5 text-left text-sm transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80 data-[state=open]:bg-neutral-200/80","outline-none focus-visible:ring-2 focus-visible:ring-black/50"),children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-x-2.5 pr-2",children:[(0,n.jsx)(ep.a,{src:u.image,referrerPolicy:"no-referrer",width:28,height:28,alt:u.id||u.name,className:"h-7 w-7 flex-none shrink-0 overflow-hidden rounded-full"}),(0,n.jsxs)("div",{className:(0,o.a)(a?"hidden":"block","min-w-0 sm:block"),children:[(0,n.jsx)("div",{className:"truncate text-sm font-medium leading-5 text-neutral-900",children:u.name}),"/"!==u.slug&&(0,n.jsx)("div",{className:(0,o.a)("truncate text-xs capitalize leading-tight",eW(u.plan)),children:u.plan})]})]}),(0,n.jsx)(eb.Z,{className:"size-4 shrink-0 text-gray-400","aria-hidden":"true"})]})})}):(0,n.jsx)(eN,{})}function eN(){return(0,n.jsxs)("div",{className:"flex w-full animate-pulse items-center gap-x-1.5 rounded-lg p-1.5",children:[(0,n.jsx)("div",{className:"size-7 animate-pulse rounded-full bg-gray-200"}),(0,n.jsx)("div",{className:"mb-px mt-0.5 h-8 w-28 grow animate-pulse rounded-md bg-gray-200"}),(0,n.jsx)(eb.Z,{className:"h-4 w-4 text-gray-400","aria-hidden":"true"})]})}let eL=[{name:"Help Center",icon:r(90022).Z,href:"https://dub.co/help",target:"_blank"},{name:"Documentation",icon:ej.T,href:"https://dub.co/docs",target:"_blank"}];function eC(e){let{selected:t,workspaces:r,setOpenPopover:s}=e,{setShowAddWorkspaceModal:a}=(0,i.useContext)(em.t),{domain:c,key:d}=(0,l.useParams)(),u=(0,l.usePathname)(),h=(0,i.useRef)(null),{scrollProgress:m,updateScrollProgress:f}=(0,eg.a)(h),p=(0,i.useCallback)(e=>c||d||"/"===t.slug?"/".concat(e):(null==u?void 0:u.replace(t.slug,e).split("?")[0])||"/",[c,d,u,t.slug]);return(0,n.jsxs)("div",{className:"relative w-full",children:[(0,n.jsxs)("div",{ref:h,onScroll:f,className:"relative max-h-80 w-full space-y-0.5 overflow-auto rounded-lg bg-white text-base sm:w-64 sm:text-sm",children:[(0,n.jsx)("div",{className:"flex flex-col gap-0.5 border-b border-neutral-200 p-2",children:eL.map(e=>{let{name:t,icon:r,href:l,target:i}=e;return(0,n.jsxs)(x.default,{href:l,target:i,className:(0,o.a)("flex items-center gap-x-4 rounded-md px-2.5 py-2 transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80","outline-none focus-visible:ring-2 focus-visible:ring-black/50"),onClick:()=>s(!1),children:[(0,n.jsx)(r,{className:"size-4 text-neutral-500"}),(0,n.jsx)("span",{className:"block truncate text-neutral-600",children:t})]},t)})}),(0,n.jsxs)("div",{className:"p-2",children:[(0,n.jsx)("div",{className:"flex items-center justify-between pb-1",children:(0,n.jsx)("p",{className:"px-1 text-xs font-medium text-neutral-500",children:"Workspaces"})}),(0,n.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r.map(e=>{let{id:r,name:l,slug:i,logo:a,plan:c}=e,d=t.slug===i;return(0,n.jsxs)(x.default,{className:(0,o.a)("relative flex w-full items-center gap-x-2 rounded-md px-2 py-1.5 transition-all duration-75","hover:bg-neutral-200/50 active:bg-neutral-200/80","outline-none focus-visible:ring-2 focus-visible:ring-black/50",d&&"bg-neutral-200/50"),href:p(i),shallow:!1,onClick:()=>s(!1),children:[(0,n.jsx)(ep.a,{src:a||"".concat(ey.c).concat(l),width:28,height:28,alt:r,className:"size-7 shrink-0 overflow-hidden rounded-full"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"block truncate text-sm leading-5 text-neutral-900 sm:max-w-[140px]",children:l}),"/"!==i&&(0,n.jsx)("div",{className:(0,o.a)("truncate text-xs capitalize leading-tight",eW(c)),children:c})]}),t.slug===i?(0,n.jsx)("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-black",children:(0,n.jsx)(ek.n,{className:"size-4","aria-hidden":"true"})}):null]},i)}),(0,n.jsxs)("button",{onClick:()=>{s(!1),a(!0)},className:"group flex w-full cursor-pointer items-center gap-x-2 rounded-md p-2 text-neutral-700 transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80",children:[(0,n.jsx)(ev.v,{className:"mx-1.5 size-4 text-neutral-500"}),(0,n.jsx)("span",{className:"block truncate",children:"Create new workspace"})]},"add")]})]})]}),(0,n.jsx)("div",{className:"pointer-events-none absolute -bottom-px left-0 h-16 w-full rounded-b-lg bg-gradient-to-t from-white sm:bottom-0",style:{opacity:1-Math.pow(m,2)}})]})}let eW=e=>"enterprise"===e?"text-purple-700":e.startsWith("business")?"text-blue-900":"pro"===e?"text-cyan-900":"text-neutral-500",eS=["userSettings","workspaceSettings","default"];function eP(e){let{toolContent:t,newsContent:r}=e,{slug:s}=(0,l.useParams)(),{flags:h}=(0,a.Z)(),m=(0,l.usePathname)(),f=(0,i.useMemo)(()=>m.startsWith("/account/settings")?"userSettings":m.startsWith("/".concat(s,"/settings"))?"workspaceSettings":"default",[s,m]);return(0,n.jsxs)(c.a,{className:"scrollbar-hide relative flex h-full w-full flex-col overflow-y-auto overflow-x-hidden",children:[(0,n.jsxs)("nav",{className:"relative flex grow flex-col p-3 text-gray-500",children:[(0,n.jsxs)("div",{className:"relative flex items-start justify-between gap-1 pb-3",children:[eS.map(e=>(0,n.jsx)(x.default,{href:s?"/".concat(s):"/",className:(0,o.a)("rounded-md px-1 outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-black/50",e===f?"relative opacity-100":"pointer-events-none absolute opacity-0","default"===e&&"mb-1"),"aria-hidden":e!==f||void 0,inert:e!==f?"":void 0,children:"default"===e?(0,n.jsx)(d.e,{className:"h-6",isInApp:!0}):(0,n.jsxs)("div",{className:"py group -my-1 -ml-1 flex items-center gap-2 py-2 pr-1 text-sm font-medium text-neutral-900",children:[(0,n.jsx)(u.Z,{className:"size-4 text-neutral-500 transition-transform duration-100 group-hover:-translate-x-0.5"}),"Settings"]})},e)),(0,n.jsxs)("div",{className:"hidden items-center gap-3 md:flex",children:[(0,n.jsx)(i.Suspense,{fallback:null,children:t}),(0,n.jsx)(ex.default,{})]})]}),(0,n.jsx)("div",{className:"relative w-full grow",children:eS.map(e=>(0,n.jsxs)(eM,{visible:e===f,direction:"default"===e?"left":"right",children:["default"===e&&(0,n.jsx)("div",{className:"pt-2",children:(0,n.jsx)(ew,{})}),(0,n.jsx)("div",{className:"flex flex-col gap-4 pt-4",children:et[e].map((e,t)=>{let{name:r,items:o}=e;return(0,n.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r&&(0,n.jsx)("div",{className:"mb-2 pl-1 text-sm text-neutral-500",children:r}),o({slug:s||"",flags:h}).map(e=>(0,n.jsx)(eZ,{item:e},e.name))]},t)})}),(0,n.jsx)("div",{className:"-mx-3 mt-6 flex grow flex-col justify-end",children:"default"===e&&r})]},e))})]}),(0,n.jsxs)("div",{className:"relative flex flex-col justify-end",children:[(0,n.jsx)(A,{}),(0,n.jsx)(ea,{})]})]})}function eZ(e){let{item:t}=e,{name:r,icon:s,href:a,exact:c}=t,[d,u]=(0,i.useState)(!1),h=(0,l.usePathname)(),m=(0,i.useMemo)(()=>c?h===a:h.startsWith(a),[h,a,c]);return(0,n.jsxs)(x.default,{href:a,"data-active":m,onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),className:(0,o.a)("group flex items-center gap-2.5 rounded-md p-2 text-sm leading-none text-neutral-600 transition-[background-color,color,font-weight] duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80","outline-none focus-visible:ring-2 focus-visible:ring-black/50",m&&"bg-blue-100/50 font-medium text-blue-600 hover:bg-blue-100/80 active:bg-blue-100"),children:[(0,n.jsx)(s,{className:"size-4 text-neutral-500 transition-colors duration-75 group-data-[active=true]:text-blue-600","data-hovered":d}),r]})}function eM(e){let{visible:t,direction:r,children:s}=e;return(0,n.jsx)("div",{className:(0,o.a)("left-0 top-0 flex size-full flex-col md:transition-[opacity,transform] md:duration-300",t?"opacity-1 relative":(0,o.a)("pointer-events-none absolute opacity-0","left"===r?"-translate-x-full":"translate-x-full")),"aria-hidden":t?void 0:"true",inert:t?void 0:"",children:s})}let eE=(0,i.createContext)({isOpen:!1,setIsOpen:()=>{}});function ez(e){let{children:t,toolContent:r,newsContent:a}=e,c=(0,l.usePathname)(),{isMobile:d}=(0,s.a)(),[u,x]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{document.body.style.overflow=u&&d?"hidden":"auto"},[u,d]),(0,i.useEffect)(()=>{x(!1)},[c]),(0,n.jsxs)("div",{className:"min-h-screen md:grid md:grid-cols-[240px_minmax(0,1fr)]",children:[(0,n.jsx)("div",{className:(0,o.a)("fixed left-0 top-0 z-50 h-dvh w-screen transition-[background-color,backdrop-filter] md:sticky md:z-auto md:w-full md:bg-transparent",u?"bg-black/20 backdrop-blur-sm":"bg-transparent max-md:pointer-events-none"),onClick:e=>{e.target===e.currentTarget&&(e.stopPropagation(),x(!1))},children:(0,n.jsxs)("div",{className:(0,o.a)("relative h-full w-[240px] max-w-full bg-neutral-100 transition-transform md:translate-x-0",!u&&"-translate-x-full"),children:[(0,n.jsx)("div",{className:"absolute inset-0 overflow-hidden",children:(0,n.jsx)("div",{className:(0,o.a)("pointer-events-none absolute -left-2/3 bottom-0 aspect-square w-[140%] translate-y-1/4 rounded-full opacity-15 blur-[75px]","bg-[conic-gradient(from_32deg_at_center,#855AFC_0deg,#3A8BFD_72deg,#00FFF9_144deg,#5CFF80_198deg,#EAB308_261deg,#f00_360deg)]")})}),(0,n.jsx)(eP,{toolContent:r,newsContent:a})]})}),(0,n.jsx)("div",{className:"bg-neutral-100 md:pt-1.5",children:(0,n.jsx)("div",{className:"relative min-h-full bg-neutral-100 pt-px md:rounded-tl-2xl md:border md:border-b-0 md:border-r-0 md:border-neutral-200/80 md:bg-white",children:(0,n.jsx)(eE.Provider,{value:{isOpen:u,setIsOpen:x},children:t})})})]})}},53905:(e,t,r)=>{r.d(t,{HelpButton:()=>m});var n=r(42294),s=r(85949),o=r(66877),l=r(13326),i=r(4795),a=r(55474),c=r(90022),d=r(33469),u=r(46212),x=r(96462),h=r(45875);function m(e){let{popularHelpArticles:t,allHelpArticles:r}=e,[m,f]=(0,u.useState)(!1);return(0,n.jsx)(x.X.Provider,{value:{popularHelpArticles:t,allHelpArticles:r},children:(0,n.jsx)(s.a,{content:(0,n.jsx)(h.L,{}),openPopover:m,setOpenPopover:f,align:"start",children:(0,n.jsx)("button",{type:"button",onClick:()=>{m||d.ZP.capture("help_portal_opened"),f(e=>!e)},className:(0,o.a)("font-lg relative size-4 shrink-0 overflow-hidden rounded-full active:bg-gray-50","outline-none ring-offset-2 ring-offset-neutral-100 focus-visible:ring-2 focus-visible:ring-black/50"),children:(0,n.jsx)(l.M,{children:(0,n.jsx)(i.E.div,{className:"absolute inset-0 flex items-center justify-center font-medium text-neutral-500 hover:text-neutral-700",initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:m?(0,n.jsx)(a.Z,{className:"size-4",strokeWidth:2}):(0,n.jsx)(c.Z,{className:"size-4"})},m?"open":"closed")})})})})}},64271:(e,t,r)=>{r.d(t,{default:()=>x});var n=r(42294),s=r(85949),o=r(3478),l=r(52164),i=r(66877),a=r(17438),c=r(68717),d=r(94014),u=r(46212);function x(){var e;let{data:t}=(0,c.useSession)(),[r,x]=(0,u.useState)(!1);return(0,n.jsx)(s.a,{content:(0,n.jsxs)("div",{className:"flex w-full flex-col space-y-px rounded-md bg-white p-2 sm:w-56",children:[(null==t?void 0:t.user)?(0,n.jsxs)("div",{className:"p-2",children:[(0,n.jsx)("p",{className:"truncate text-sm font-medium text-neutral-900",children:t.user.name||(null===(e=t.user.email)||void 0===e?void 0:e.split("@")[0])}),(0,n.jsx)("p",{className:"truncate text-sm text-neutral-500",children:t.user.email})]}):(0,n.jsxs)("div",{className:"grid gap-2 px-2 py-3",children:[(0,n.jsx)("div",{className:"h-3 w-12 animate-pulse rounded-full bg-neutral-200"}),(0,n.jsx)("div",{className:"h-3 w-20 animate-pulse rounded-full bg-neutral-200"})]}),(0,n.jsx)(h,{as:d.default,label:"Account",icon:o.a,href:"/account/settings",onClick:()=>x(!1)}),(0,n.jsx)(h,{as:"button",type:"button",label:"Logout",icon:a.Z,onClick:()=>(0,c.signOut)({callbackUrl:"/login"})})]}),align:"start",openPopover:r,setOpenPopover:x,children:(0,n.jsx)("button",{onClick:()=>x(!r),className:(0,i.a)("group relative rounded-full ring-offset-1 ring-offset-neutral-100 transition-all hover:ring-2 hover:ring-black/10 active:ring-black/15 data-[state='open']:ring-black/15","outline-none focus-visible:ring-2 focus-visible:ring-black/50"),children:(null==t?void 0:t.user)?(0,n.jsx)(l.b,{user:t.user,className:"size-6 border-none duration-75 sm:size-6"}):(0,n.jsx)("div",{className:"size-6 animate-pulse rounded-full bg-gray-100 sm:size-6"})})})}function h(e){let{as:t,label:r,icon:s,children:o,...l}=e;return(0,n.jsxs)(null!=t?t:"button",{className:"flex items-center gap-x-4 rounded-md px-2.5 py-2 text-sm transition-all duration-75 hover:bg-neutral-200/50 active:bg-neutral-200/80",...l,children:[(0,n.jsx)(s,{className:"size-4 text-neutral-500"}),(0,n.jsx)("span",{className:"block truncate text-neutral-600",children:r}),o]})}},73491:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(42294),s=r(7067),o=r(69199),l=r(66877),i=r(52867),a=r(46212),c=r(66807);function d(e){let{id:t}=(0,s.Z)(),[r,d]=(0,a.useState)(!1),u=(0,i.useRouter)();return(0,n.jsx)(o.k,{...e,text:e.text||"Manage Subscription",variant:e.variant||"secondary",className:(0,l.a)(e.className,"h-9"),onClick:()=>{d(!0),fetch("/api/workspaces/".concat(t,"/billing/manage"),{method:"POST"}).then(async e=>{if(e.ok){let t=await e.json();console.log({url:t}),u.push(t)}else{let{error:t}=await e.json();c.A.error(t.message),d(!1)}})},loading:r})}},51204:(e,t,r)=>{r.d(t,{T:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"5.75",x2:"5.75",y1:"1.75",y2:"12.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"8.75",x2:"12.25",y1:"5.25",y2:"5.25"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"8.75",x2:"12.25",y1:"8.25",y2:"8.25"}),(0,n.jsx)("path",{d:"M2.75,14.5V3.75c0-1.105,.895-2,2-2H15.25V12.75",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M5.25,16.25h-.75c-.966,0-1.75-.783-1.75-1.75s.784-1.75,1.75-1.75H15.25c-.641,.844-.734,2.547,0,3.5H5.25Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})}},78749:(e,t,r)=>{r.d(t,{_:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("rect",{height:"12.5",width:"4",fill:"none",rx:"1",ry:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x:"5.75",y:"2.75"}),(0,n.jsx)("rect",{height:"10.5",width:"3",fill:"none",rx:"1",ry:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x:"2.75",y:"4.75"}),(0,n.jsx)("rect",{height:"10.5",width:"3.5",fill:"none",rx:"1",ry:"1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",transform:"translate(-2.382 4.324) rotate(-17.344)",x:"11.235",y:"4.719"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"10.934",x2:"14.275",y1:"9.272",y2:"8.228"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"5.75",x2:"9.75",y1:"7.25",y2:"7.25"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"2.75",x2:"5.75",y1:"8.75",y2:"8.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"1",x2:"17",y1:"15.25",y2:"15.25"})]})})}},37147:(e,t,r)=>{r.d(t,{a:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"7.954",x2:"5.047",y1:"5.988",y2:"11.511"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"10.046",x2:"12.953",y1:"5.988",y2:"11.511"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"6.25",x2:"11.75",y1:"13.25",y2:"13.25"}),(0,n.jsx)("circle",{cx:"9",cy:"4",fill:"none",r:"2.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("circle",{cx:"14",cy:"13.5",fill:"none",r:"2.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("circle",{cx:"4",cy:"13.5",fill:"none",r:"2.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})}},67704:(e,t,r)=>{r.d(t,{O:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("polyline",{fill:"none",points:"13.983 5.53 8 9 2.017 5.53",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"8",x2:"8",y1:"15.938",y2:"9"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"13.75",x2:"13.75",y1:"10.5",y2:"11.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"16.048",x2:"15.164",y1:"11.452",y2:"12.336"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"17",x2:"15.75",y1:"13.75",y2:"13.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"16.048",x2:"15.164",y1:"16.048",y2:"15.164"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"13.75",x2:"13.75",y1:"17",y2:"15.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"11.452",x2:"12.336",y1:"16.048",y2:"15.164"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"10.5",x2:"11.75",y1:"13.75",y2:"13.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"11.452",x2:"12.336",y1:"11.452",y2:"12.336"}),(0,n.jsx)("circle",{cx:"13.75",cy:"13.75",fill:"none",r:"1.75",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M14.25,8.06v-1.533c0-.713-.38-1.372-.997-1.73l-4.25-2.465c-.621-.36-1.386-.36-2.007,0L2.747,4.797c-.617,.358-.997,1.017-.997,1.73v4.946c0,.713,.38,1.372,.997,1.73l4.25,2.465c.603,.35,1.341,.353,1.951,.023",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})}},10910:(e,t,r)=>{r.d(t,{E:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"6.25",x2:"9",y1:"4.237",y2:"9"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"6.25",x2:"9",y1:"13.764",y2:"9"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"14.5",x2:"9",y1:"9",y2:"9"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"9",x2:"9",y1:"1.75",y2:"3.5"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"2.721",x2:"4.237",y1:"5.375",y2:"6.25"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"1.75",x2:"3.5",y1:"9",y2:"9"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"16.25",x2:"14.5",y1:"9",y2:"9"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"2.721",x2:"4.237",y1:"12.625",y2:"11.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"9",x2:"9",y1:"16.25",y2:"14.5"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"12.625",x2:"11.75",y1:"15.279",y2:"13.763"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"5.375",x2:"6.25",y1:"15.279",y2:"13.763"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"15.279",x2:"13.763",y1:"12.625",y2:"11.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"15.279",x2:"13.763",y1:"5.375",y2:"6.25"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"12.625",x2:"11.75",y1:"2.721",y2:"4.237"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"5.375",x2:"6.25",y1:"2.721",y2:"4.237"}),(0,n.jsx)("circle",{cx:"9",cy:"9",fill:"none",r:"5.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})}},51449:(e,t,r)=>{r.d(t,{s:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("path",{d:"M15.747,2.076l-2.847,.177-5.891,5.891c-.324-.084-.658-.144-1.009-.144-2.209,0-4,1.791-4,4s1.791,4,4,4,4-1.791,4-4c0-.362-.064-.707-.154-1.041l1.904-1.959v-2.25h2.25l1.753-1.645-.006-3.029Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("circle",{cx:"5.5",cy:"12.5",fill:"currentColor",r:"1",stroke:"none"})]})})}},9016:(e,t,r)=>{r.d(t,{v:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"9",x2:"9",y1:"3.25",y2:"14.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"3.25",x2:"14.75",y1:"9",y2:"9"})]})})}},94010:(e,t,r)=>{r.d(t,{$:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"16.25",x2:"1.75",y1:"2.75",y2:"2.75"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"5.75",x2:"9.25",y1:"11.25",y2:"11.25"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"5.75",x2:"9.25",y1:"8.25",y2:"8.25"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"11.75",x2:"12.25",y1:"11.25",y2:"11.25"}),(0,n.jsx)("line",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",x1:"11.75",x2:"12.25",y1:"8.25",y2:"8.25"}),(0,n.jsx)("polyline",{fill:"none",points:"14.75 5.75 14.75 16.25 12 14.75 9 16.25 6 14.75 3.25 16.25 3.25 5.75",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})}},71039:(e,t,r)=>{r.d(t,{d:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsx)("g",{fill:"currentColor",children:e.invert?(0,n.jsx)("path",{d:"M14.783,2.813l-5.25-1.68c-.349-.112-.718-.111-1.066,0L3.216,2.813c-.728,.233-1.216,.903-1.216,1.667v6.52c0,3.508,4.946,5.379,6.46,5.869,.177,.057,.358,.086,.54,.086s.362-.028,.538-.085c1.516-.49,6.462-2.361,6.462-5.869V4.48c0-.764-.489-1.434-1.217-1.667Zm-2.681,4.389l-3.397,4.5c-.128,.169-.322,.276-.534,.295-.021,.002-.043,.003-.065,.003-.189,0-.372-.071-.511-.201l-1.609-1.5c-.303-.283-.32-.757-.038-1.06,.284-.303,.758-.319,1.06-.038l1.001,.933,2.896-3.836c.25-.33,.72-.396,1.051-.146,.331,.25,.396,.72,.146,1.051Z",fill:"currentColor"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("path",{d:"M9.305,1.848l5.25,1.68c.414,.133,.695,.518,.695,.952v6.52c0,3.03-4.684,4.748-5.942,5.155-.203,.066-.413,.066-.616,0-1.258-.407-5.942-2.125-5.942-5.155V4.48c0-.435,.281-.82,.695-.952l5.25-1.68c.198-.063,.411-.063,.61,0Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("polyline",{fill:"none",points:"6.497 9.75 8.106 11.25 11.503 6.75",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})})}},5704:(e,t,r)=>{r.d(t,{Q:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("circle",{cx:"9",cy:"7",fill:"none",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("circle",{cx:"13.75",cy:"3.25",fill:"none",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("circle",{cx:"4.25",cy:"3.25",fill:"none",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M5.801,15.776c-.489-.148-.818-.635-.709-1.135,.393-1.797,1.993-3.142,3.908-3.142s3.515,1.345,3.908,3.142c.109,.499-.219,.987-.709,1.135-.821,.248-1.911,.474-3.199,.474s-2.378-.225-3.199-.474Z",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M13.584,7.248c.055-.002,.11-.004,.166-.004,1.673,0,3.079,1.147,3.473,2.697,.13,.511-.211,1.02-.718,1.167-.643,.186-1.457,.352-2.403,.385",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M4.416,7.248c-.055-.002-.11-.004-.166-.004-1.673,0-3.079,1.147-3.473,2.697-.13,.511,.211,1.02,.718,1.167,.643,.186,1.457,.352,2.403,.385",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})})}},56597:(e,t,r)=>{r.d(t,{G:()=>s});var n=r(42294);function s(e){return(0,n.jsx)("svg",{height:"18",width:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("path",{d:"M3.804,13.278l3.721-6.444c-.91-.515-1.524-1.492-1.524-2.613,0-1.657,1.343-3,3-3s3,1.343,3,3c0,.08-.003,.159-.009,.237",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M14.246,13.25H6.805c.009,1.046-.53,2.065-1.5,2.626-1.435,.828-3.27,.337-4.098-1.098s-.337-3.27,1.098-4.098c.069-.04,.139-.077,.21-.11",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M9,4.222l3.72,6.444c.901-.531,2.054-.574,3.025-.014,1.435,.828,1.927,2.663,1.098,4.098s-2.663,1.927-4.098,1.098c-.069-.04-.136-.082-.2-.126",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,n.jsx)("circle",{cx:"3.804",cy:"13.278",fill:"currentColor",r:"1.25",stroke:"none"}),(0,n.jsx)("circle",{cx:"9",cy:"4.222",fill:"currentColor",r:"1.25",stroke:"none"}),(0,n.jsx)("circle",{cx:"14.248",cy:"13.252",fill:"currentColor",r:"1.25",stroke:"none"})]})})}}}]);