1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9e782cb0-e3cb-57f4-a07e-5117cbab51f0")}catch(e){}}(); 3import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{t}from"./link-DQ79ieAZ.js";import{Ca as n,Q as r,Tn as i,Xi as a,_n as o,at as s,bn as c,it as l,mn as u,qi as d,ui as f,wa as p,zt as m}from"./frosted-ui-C-IlupeO.js";import{t as h}from"./useRouter-CXQWTBlB.js";import{n as g}from"./useNavigate-DVZZsxfA.js";import{t as _}from"./useRouterState-AA3TEgu0.js";import{m as v}from"./useQuery-BjchxOEi.js";import{t as y}from"./ArrowRight16-BgF2Bf8U.js";import{t as b}from"./ArrowUpRightFromBracket12-DWA7lGN5.js";import{a as x,i as S,o as ee,r as te,t as ne}from"./routes-T4M6BWKB.js";import{t as C}from"./Message16-BYHHzQHi.js";import{t as w}from"./Trash16-BM9lFpi4.js";import{t as T}from"./ThreeDotsVertical16-CU_Qwjam.js";import{t as E}from"./XMarkSmall16-C7HIuF5N.js";import{n as D}from"./react-client-b8-F7YdI.js";import{t as O}from"./cn-CIC46yv0.js";import{Ho as re,Lt as k,Xa as A,yl as j}from"./hooks-BvQLve-N.js";import{n as M}from"./use-viewer-B6fhZ4h2.js";import{o as N}from"./toast-BSw6zLhC.js";import{n as P,t as ie}from"./use-support-chat-badge-count-query-BQM6a79M.js";import{C as F,Ht as ae}from"./types-D8zNp4wx.js";import{t as I}from"./not-empty-pWtdodt7.js";import{o as L}from"./v1-DWF2raMT.js";import{s as oe}from"./src-DsN78mkc.js";import{Al as R,Cl as se,gl as ce,kl as z}from"./index-BK_sTHql.js";import{t as B}from"./use-community-nav-DW6wjwex.js";import{t as V}from"./stop-propagation-CqJ3kEzj.js";import{t as H}from"./avatar-gSJxpYHk.js";import{r as le}from"./sidebar-nav-item-DWpxARP_.js";import{r as U,t as W}from"./use-resource-permissions-D78M7FCf.js";import{t as ue}from"./use-websites-tab-visited-CwQaix_f.js";var G=e(p()),K=({color:e=`currentColor`,...t})=>G.createElement(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"data-fui-icon":`PlusCircle20`,...t},G.createElement(`path`,{d:`M10 .5c5.247 0 9.5 4.253 9.5 9.5s-4.253 9.5-9.5 9.5S.5 15.247.5 10 4.753.5 10 .5zM10 2c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zm-.041 4c.414 0 .75.336.75.75v2.459h2.541c.414 0 .75.336.75.75s-.336.75-.75.75h-2.541v2.541c0 .414-.336.75-.75.75s-.75-.336-.75-.75v-2.541H6.75c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h2.459V6.75c0-.414.336-.75.75-.75z`,fill:e}));K.category=`Interface General`;var q=n(),J=10;function Y({children:e,...t}){return(0,q.jsxs)(z.Root,{children:[(0,q.jsx)(z.Trigger,{children:e}),(0,q.jsx)(z.Content,{className:`max-w-[480px] p-4`,children:(0,q.jsx)(de,{...t})})]})}function de({bizId:e,appId:n,appName:r,source:i,onSuccess:o}){let s=D(),c=v(),l=R(),{data:u,isLoading:p}=A({companyId:e,appId:n,first:J}),{mutateAsync:h,isPending:g}=j(),_=(0,G.useCallback)(async()=>{try{await h({input:{appId:n,resourceId:e,resourceType:F.Company}}),N.success(s(`/irtas`)),l(),await c.invalidateQueries({queryKey:[`fetchCompanyAppAuthorizations`]}),await c.invalidateQueries({queryKey:[`fetchCompanyAppReauthorizationCount`,{companyId:e}]}),await c.invalidateQueries({queryKey:[`fetchIsCompanyAppRequestingReauthorization`,{companyId:e,appId:n}]}),await c.invalidateQueries({queryKey:[`coreFetchCompanyExperienceList`,{companyId:e}]}),await c.invalidateQueries({queryKey:[`coreFetchAdminSidebarData`,{id:e}]}),ce(P({app_id:n,bot_id:e,source:i})),o?.()}catch(e){N.error(s(`oDC9aF`),{description:se(e)})}},[n,e,l,o,c,h,i,s]),y=(0,G.useCallback)(()=>void _(),[_]),x=u?.company?.experiencesV2.totalCount??0,S=(0,G.useMemo)(()=>u?.company?.experiencesV2.nodes?.filter(I),[u?.company?.experiencesV2.nodes]);return(0,q.jsxs)(`div`,{className:`relative`,children:[(0,q.jsx)(z.Close,{children:(0,q.jsx)(f,{type:`button`,tabIndex:-1,variant:`soft`,color:`gray`,className:`absolute right-0 rounded-full max-sm:hidden`,size:`1`,children:(0,q.jsx)(E,{})})}),(0,q.jsx)(z.Title,{size:`4`,weight:`semi-bold`,className:`mb-5 text-center`,trim:`normal`,children:s(`LSBjCD`)}),(0,q.jsx)(z.Description,{className:`mb-6 min-w-0 px-4 text-center text-pretty`,color:`gray`,size:`2`,
3weight:`regular`,children:s.rich(`jdd275`,{appName:r,strong:e=>(0,q.jsx)(d,{className:`text-gray-12`,children:e})})}),p?(0,q.jsx)(fe,{className:`mb-6`}):null,!!S?.length&&(0,q.jsxs)(`div`,{className:`mb-6 flex flex-col gap-1`,children:[(0,q.jsx)(X,{children:S.map((e,n)=>(0,q.jsxs)(G.Fragment,{children:[(0,q.jsx)(t,{to:`/experiences/${e.id}`,children:(0,q.jsxs)(`div`,{className:`hover:bg-gray-a3 group flex items-center gap-2 p-2`,children:[(0,q.jsx)(H,{src:e.image??e.app.icon?.source.url,fallback:e.name??``,shape:`square`,size:`1`}),(0,q.jsx)(a,{className:`flex-1 truncate`,children:e.name}),(0,q.jsxs)(`div`,{className:`text-gray-a8 hidden items-center gap-1 group-hover:flex`,children:[(0,q.jsx)(b,{}),(0,q.jsx)(a,{size:`1`,weight:`medium`,children:s(`FgydNe`)})]})]})}),n!==S.length-1&&(0,q.jsx)(Q,{})]},e.id))}),x>J&&(0,q.jsx)(a,{size:`2`,className:`text-gray-a10 pl-1`,children:s(`LKu7SO`,{count:x-J})})]}),(0,q.jsx)(m,{type:`button`,color:`danger`,size:`3`,className:`w-full`,variant:`solid`,onClick:y,disabled:g,loading:g,children:s(`a8npXI`)})]})}function X({children:e,className:t}){return(0,q.jsx)(`div`,{className:O(`border-stroke flex flex-col overflow-hidden rounded-lg border`,t),children:e})}function Z(){return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[(0,q.jsx)(l,{className:`size-6 rounded-md`}),(0,q.jsx)(s,{className:`w-28`})]})}function Q(){return(0,q.jsx)(r,{className:`bg-stroke w-full`})}function fe({className:e}){return(0,q.jsxs)(X,{className:e,children:[(0,q.jsx)(Z,{}),(0,q.jsx)(Q,{}),(0,q.jsx)(Z,{}),(0,q.jsx)(Q,{}),(0,q.jsx)(Z,{})]})}function pe({bizId:e,app:t}){let n=D(),r=M(),a=h(),s=g(),l=_({select:e=>e.location.pathname}),d=(0,G.useCallback)(()=>{s({to:`/messages`,search:{to_user_id:t.creatorId}})},[t.creatorId,s]),p=(0,G.useCallback)(()=>{a.preloadRoute({to:`/messages`,search:{to_user_id:t.creatorId}})},[t.creatorId,a]),m=(0,G.useCallback)(()=>{let n=`/dashboard/${e}/apps/${t.id}`;l!==n&&!l.startsWith(`${n}/`)||s({to:`/dashboard/${e}/`,replace:!0})},[t.id,e,s,l]);return(0,q.jsxs)(c,{children:[(0,q.jsx)(i,{children:(0,q.jsx)(f,{"aria-label":n(`I5NMJ8`),color:`gray`,size:`1`,type:`button`,variant:`ghost`,onClick:V,children:(0,q.jsx)(T,{})})}),(0,q.jsxs)(u,{align:`end`,finalFocus:!1,size:`2`,children:[r&&r!==t.creatorId?(0,q.jsxs)(o,{className:`flex items-center justify-start gap-3 font-medium`,onClick:d,onMouseEnter:p,children:[(0,q.jsx)(C,{className:`text-gray-a11`}),n(`ezgUoL`)]}):null,(0,q.jsx)(Y,{bizId:e,appId:t.id,appName:t.name,onSuccess:m,source:`dashboard_sidebar`,children:(0,q.jsxs)(o,{closeOnClick:!1,color:`danger`,className:`flex items-center justify-start gap-3 font-medium`,onClick:V,children:[(0,q.jsx)(w,{className:`text-danger-a11`}),n(`LSBjCD`)]})})]})]})}function $(){return(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-gray-a10 flex shrink-0 items-center justify-center [&_svg]:size-4`,children:(0,q.jsx)(y,{})})}function me({routes:e,showNewTagFor:t,nested:n=!1,counts:r,pendingActionRoutes:i,companyId:a,companyRoute:o}){let[s]=ue();return(0,q.jsx)(q.Fragment,{children:e.map(e=>(0,q.jsx)(le,{to:e.path,title:e.label,icon:n?void 0:ve(e),count:r?.get(e.name),pendingDot:i?.has(e.name),trailingAdornment:e.name===`community`?(0,q.jsx)($,{}):void 0,trailingAction:he(e)&&a?(0,q.jsx)(pe,{bizId:a,app:e.app}):void 0,exact:e.name===`home`,extraActivePrefix:e.name===`affiliates`&&o?`/${o}/affiliates`:void 0,showNewTag:e.new&&!(e.name===`websites`&&s)||e.name===t,showBetaTag:e.beta,nested:n,onClick:e.name===`community`&&a?()=>B(`/dashboard/${a}/`):void 0},e.name))})}function he(e){return`app`in e&&e.app!=null}function ge(e,t){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(t??e,{className:`hidden size-5 [[aria-expanded=true]_&]:inline-block`}),(0,q.jsx)(e,{className:`inline-block size-5 [[aria-expanded=true]_&]:hidden`})]})}function _e(e){let t=e.icon?.source.url;return({className:n})=>(0,q.jsx)(H,{className:O(`size-5`,n),shape:`square`,size:`1`,src:t,fallback:e.name})}function ve(e){let t=e.icon;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(e.filledIcon??e.icon,{className:`hidden size-5 [a[data-active='true']_&]:inline-block`}),(0,q.jsx)(t,{className:`inline-block size-5 [a[data-active='true']_&]:hidden`})]})}var ye=new Set([`cards`,`ads`,`bounties`]),be={statuses:[`pending`]};function xe(e){let{data:t,isLoading:n}=k({id:e},{staleTime:5*6e4});return{dashboardFeatures:t?.company?.dashboardFeatures,isLoading:n}}function Se({companyId:e,companyRoute:t}){let n=D(),r=x(`/dashboard/${e}`,t),i=ee(),{data:a}=k({id:e},{staleTime:5*6e4}),{resourcePermissions:o,hasLoaded:s}=U(e),c=a?.company?.dashboardFeatures??null,{data:l=0}=ie({companyId:e,enabled:W(o,L.SupportChatRead)}),{data:u}=re({id:e,filters:be},{enabled:S(`waitlists`,c)&&W(o,L.PlanWaitlistRead)}),{data:d}=oe(t=>t.disputes.summary({account_id:e,groups:[`status`]}),{enabled:S(`disputes`,c)&&W(o,L.PaymentDisputeRead)}),f=`/dashboard/${e}`,p=a?.viewer.user.id===a?.company?.companyOwner.id,m=a?.company?.paymentsApprovalStatus===ae.Rejected,h=a?.company?.currentSales??0,g=a?.company?.adsAdvancedWaitlistStatus,_=(0,G.useMemo)(()=>a?.company?.installedApps.nodes??[],[a?.company?.installedApps.nodes]),v=e=>(!e.ownerOnly||p)&&S(e.name,c)&&(!m||!ye.has(e.name))&&(!s||W(o,e.permission)),y=g!=null&&g!==`has_access`&&h>0,b=c?.connectedAccounts??null,C=a?.company?.publicExperiences,w=C?.totalCount===1?C.nodes?.[0]:null,T=(C?.totalCount??0)>0&&!(w?.isPublic===!0&&w.app.internalIdentifier===`forums`),E=[...ne,...T?[`community`]:[]].filter(e=>e!==`connected_accounts`||b===!0).map(e=>r[e]).filter(e=>!!e&&v(e)),O=i.map(e=>({...e,routes:(e.key===`other`&&b===!1?[...e.routeNames,`connected_accounts`]:e.routeNames).filter(e=>e!==`community`||!T).map(e=>r[e]).filter(e=>!!e&&v(e))})).filter(e=>e.routes.length>0),A=!s||o.get(L.CompanyBasicRead)===!0,j=!s||o.get(L.AppAuthorizationCreate)===!0,M=(0,G.useMemo)(()=>{let e=A?_.map(e=>({name:e.id,label:e.name,path:`${f}/apps/${e.id}/`,icon:_e(e),permission:L.CompanyBasicRead,app:{id:e.id,name:e.name,creatorId:e.creator.id}})):[];return j&&e.push({name:`add`,label:n(`2/2yg+`),path:`${f}/app-store/`,icon:K,permission:L.AppAuthorizationCreate}),e},[j,A,f,_,n]),N=te.map(e=>r[e]).filter(e=>!!e&&v(e)),P=(0,G.useMemo)(()=>new Map(l>0?[[`support_chats`,l]]:[]),[l]),F=(u?.company?.creatorDashboardTable.entries.totalCount??0)>0,I=d?.groups.status,R=(I?.needs_response??0)+(I?.warning_needs_response??0)>0;return{appRoutes:M,coreRoutes:E,pendingActionRoutes:(0,G.useMemo)(()=>{let e=new Set;return F&&e.add(`waitlists`),R&&e.add(`disputes`),e}
3,[R,F]),routeCounts:P,settingsRoutes:N,shouldFeatureAdsAtTop:y,toolGroups:O}}export{$ as a,ge as i,xe as n,Y as o,me as r,Se as t}; 4//# debugId=9e782cb0-e3cb-57f4-a07e-5117cbab51f0
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.