UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

2 lines • 88.5 kB
import{c as ee,j as t,m as ut,b as ye,e3 as ht,gK as Es,av as os,aL as rs,aM as cs,aN as ms,aO as ds,bc as fs,aP as us,aQ as hs,aR as gs,gZ as Rs,t as ce,q as jt,r as te,e as rt,B as Ue,i as Ze,K as Oe,ak as Tt,a9 as yt,I as ot,w as Nt,x as Ct,y as wt,v as Dt,D as $t,ai as es,a6 as xs,bx as bs,hx as Ft,n as ts}from"./index-ztdGKvBm.js";import{ChatLayout as zs}from"./index-Co7YBLf6.js";import{B as Ce}from"./badge-DcUertOZ.js";import{E as Xe}from"./empty-state-DM4xv3sa.js";import{b as qt}from"./repository-binding-D_Xc1yRH.js";import{b as As}from"./use-blocks-v8-project-BPvEDyS9.js";import{i as Fs}from"./AlertCircle-BlMH0XE7.js";import{s as Hs}from"./UserCheck01-k-4bTA2h.js";import{e as Vs,bi as ct,bj as ps,Y as Bs,bk as Os,b as Ht,a7 as ss,a6 as Ms,bl as qs,P as ns,bg as Is}from"./agent-icon-BYWtutu9.js";import{h as Qs}from"./UserSquare-CafFh5_d.js";import{i as Us}from"./Zap-CBJ7My90.js";import{I as nt}from"./icon-button-BH8Qviy5.js";import{S as Ks,c as Ws,a as Gs,b as Ys}from"./sheet-C-umRrOH.js";import{T as Js,b as at,c as Fe,e as Vt,a as Bt,d as Ot}from"./table-C3AdbrSy.js";import{a as It,b as Qt,C as Zs}from"./collapsible-CadTVXY4.js";import{s as Lt}from"./Plus-DWySsEmB.js";import{s as _t}from"./Trash01-BxBhF2b8.js";import{L as st}from"./label-8UxgpYiA.js";import{T as Ts,a as js,c as Ps}from"./tooltip-Bm0P1gm_.js";import{i as Xs}from"./Tool01-BCJ5kyrz.js";import{s as en}from"./Eye-kjjhS0vP.js";import{a as Ut,b as Kt,c as xt,d as Wt,S as Gt}from"./select-CxXZwsSr.js";import{a as zt,T as tn}from"./toggle-group-yQeAFu4u.js";import{i as sn}from"./ArrowRight-mzMrxxYI.js";import{S as nn}from"./settings-tab-DiVoBlPy.js";import{e as ln}from"./use-organization-settings-C2vcrj4S.js";import{c as an}from"./thread-route-CfpvvkkL.js";import"./use-mobile-C_hdQY5I.js";import"./MessageCircle01-BG1RhOiZ.js";import"./XClose-CmTuu4UN.js";import"./thread-button-CP83i3PG.js";import"./use-sidebar-collapsed-Cy-mIzeN.js";import"./use-chat-layout-state-Im_c7sw4.js";import"./use-panel-navigate-0z93k6Ut.js";import"./use-project-scope-BwqdbGG4.js";import"./toolbar-icon-button-Cz-oOJ1w.js";import"./use-in-settings-CFQ9B3W2.js";import"./resizable-DNBx7bMi.js";import"./route-page-header-CApA0aIo.js";import"./LayoutLeft-DDtN-od-.js";import"./use-current-view-DBmQQ8uy.js";import"./index-CDQbtG2e.js";import"./use-mcp-client-2MG3LveS.js";import"./auth-C82OPjUx.js";import"./ArrowUp-D5DDc3Cp.js";import"./ArrowLeft-B0PZnf1E.js";import"./BookOpen01-DU-B3R7s.js";import"./Globe04-CeAQ1YNm.js";import"./CheckCircle-DZ8MNpCP.js";import"./ChevronDown-XsLJSrfl.js";import"./ChevronSelectorVertical-CB0fn1Nq.js";import"./ChevronUp-BQktpZWC.js";import"./LinkBroken01-DfUhihLM.js";import"./CreditCard01-MY4ouqtl.js";import"./File02-DaYek2y9.js";import"./SwitchHorizontal01-CMdpIiQk.js";import"./Fingerprint04-B2fDIuT8.js";import"./Image01-BcIZ5mtf.js";import"./Key01-CaJGjh13.js";import"./Minus-hZzPDO0w.js";import"./Monitor01-DMFbvudn.js";import"./Sun-O9TdKcV_.js";import"./Play-BCFOaioW.js";import"./SearchMd-BD2qldmS.js";import"./ShoppingBag01-BbjW7cod.js";import"./Upload01-q-rKSvZf.js";import"./Users01-DM58_gUL.js";import"./index-BdQq_4o_.js";import"./active-indicator-CCMhAsc_.js";import"./index-DDkGmjwq.js";import"./extract-connection-data-DjYTV7t7.js";import"./metadata-D72DunRR.js";import"./connection-C8I8wKeO.js";import"./url-slug-CII_0B7H.js";import"./chat-context-DFEln8mI.js";import"./use-view-draft-kind-BopwZu5H.js";import"./use-blog-view-DMfZjkz0.js";import"./thread-intent-DyZ5A9F9.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DdfLfQcH.js";import"./task-board-i6qU2BVR.js";import"./schema-Bb-DbvPZ.js";import"./session-runtime-DBl1Hlcw.js";import"./use-entitlements-Gn1rhCN5.js";import"./use-ai-providers-Ct2xvYDX.js";import"./use-decopilot-events-43RPCkUH.js";import"./use-org-fs-D9dHgOYs.js";import"./useInfiniteQuery-Ypmdjx1e.js";import"./infiniteQueryObserver-C3KEOANj.js";import"./build-improve-prompt-doc-BBeWkVDi.js";import"./empty-state-I_cTbW85.js";import"./shell-layout-UF80oiAz.js";import"./use-deployment-admin-Cr4LWHG9.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-Bg0zOPPj.js";import"./command-C3tlrKUq.js";import"./index-DMpANy5-.js";import"./integration-icon-Bo-3z9o3.js";import"./project-icon-fQqckccl.js";import"./use-navigate-to-agent-Cw8_3uU5.js";import"./use-debounced-value-DO5dvp6c.js";import"./new-project-dialog-BW6Lh52P.js";import"./repository-picker-CSaozawA.js";import"./github-icon-Bq9Ot22_.js";import"./collection-search-DkVgkcUC.js";import"./new-project-store-DID5OVrt.js";import"./legacy-admin-welcome-dialog-plmLACwz.js";import"./drawer-CROtV2u4.js";import"./required-auth-layout-Cwtu4iIe.js";import"./use-org-sso-_fzcS8V-.js";import"./use-date-fns-locale-CloMwBOl.js";import"./mcp-oauth-BBSVAQ62.js";import"./mcp-oauth-Alln4VX8.js";import"./textarea-viSdm6BE.js";import"./use-connection-CcG4QE1K.js";import"./use-debounced-autosave-CCeLz8XW.js";import"./add-connection-dialog-CS6ZsWUV.js";import"./connection-card-CTJwLo8p.js";import"./connection-slug-BNBBglpK.js";import"./form-DlZ0KMAb.js";import"./schema-D_OZwHJO.js";import"./connection-form-helpers-BjSA2uCL.js";import"./authenticate-and-persist-oauth-87e1Ix6y.js";import"./collection-tabs-Cju2BOrS.js";import"./use-infinite-scroll-DdrDrAAo.js";import"./useSuspenseInfiniteQuery-Pk4rU2Ft.js";import"./file-type-icon-CdjLDWdN.js";import"./use-mcp-auth-status-6sC2vB74.js";import"./types-5-cDe_8u.js";import"./checkbox-QUuOza1H.js";import"./use-mcp-tools-DOqvKogJ.js";import"./use-mcp-prompts-qJSiAdA5.js";import"./utils-CVEq3hMx.js";import"./switch-B81oLbqr.js";import"./popover-C4oz5B-L.js";import"./scroll-area-Dm3EbBj1.js";import"./agent-capabilities-CyWfHGWp.js";import"./use-project-native-view-presence-C7OB-luC.js";import"./match-site-slug-config-B47_xZCi.js";import"./use-file-configs-3gwPBXwK.js";import"./optimistic-project-sidebar-views-aXJkp7Aa.js";import"./sections-BA7rlacS.js";import"./use-copy-DT4_uVrH.js";import"./roles-DW32thi2.js";import"./virtual-mcp-CAb2l-zV.js";import"./sandbox-url-D3mC8qhT.js";import"./secret-picker-Bjl5COEs.js";import"./use-secrets-BUuPyfGX.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./app-preview-url-9Od4s8Sz.js";import"./serial-task-queue-CGOeQgpr.js";function At(r,e){return r.name===e.name&&(r.scope??"runtime")===e.scope}function et(r,e){if(Array.isArray(r))return r;if(r&&typeof r=="object"){const i=r[e];if(Array.isArray(i))return i}return[]}function vt(r){return r==="deco-deno"?"Deco Deno":r==="deco-tanstack"?"Deco TanStack":r??null}function on(r){const e=(r??"").toLowerCase();return e.includes("ready")||e.includes("success")||e.includes("active")?"success":e.includes("fail")||e.includes("error")?"destructive":e.includes("build")||e.includes("pend")||e.includes("progress")?"warning":"secondary"}function St(r){if(!r)return"—";const e=new Date(r).getTime();if(Number.isNaN(e))return"—";const i=Math.round((Date.now()-e)/1e3),l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"}),o=[["year",31536e3],["month",2592e3],["day",86400],["hour",3600],["minute",60]];for(const[a,c]of o)if(Math.abs(i)>=c)return l.format(-Math.round(i/c),a);return l.format(-i,"second")}function ys(r){if(r==null||!Number.isFinite(r))return"—";if(r<1e3)return`${Math.round(r)}ms`;const e=r/1e3;if(e<60)return`${e.toFixed(e>=10?0:1)}s`;const i=Math.round(e);return`${Math.floor(i/60)}m ${i%60}s`}class Yt extends Error{constructor(e,i){super(e),this.status=i}status}function gt(r){return r instanceof Yt&&r.status===401}function ft(r){return r instanceof Error?r.message:String(r)}function rn(r){const e=r.trim();if(!e)return null;const l=(e.endsWith(".")?e.slice(0,-1):e).split(".");if(l.length<2)return"Domain must include a TLD (e.g., example.com)";if(e.length>253)return"Domain name is too long (max 253 characters)";for(const a of l){if(a.length>63)return`Label "${a}" is too long (max 63 characters)`;if(!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/i.test(a))return`Label "${a}" has invalid characters or format`}const o=l[l.length-1]??"";return/^[0-9]+$/.test(o)?"Domain must include a valid TLD, not a number":null}function vs(r,e){return r&&typeof r=="object"&&"error"in r?String(r.error):`request failed (${e})`}async function kt(r){const e=await fetch(r),i=await e.json().catch(()=>({}));if(!e.ok)throw new Yt(vs(i,e.status),e.status);return i}async function mt(r,e,i){const l=await fetch(r,{method:e,headers:i!==void 0?{"Content-Type":"application/json"}:{},body:i!==void 0?JSON.stringify(i):void 0}),o=await l.json().catch(()=>({}));if(!l.ok)throw new Yt(vs(o,l.status),l.status);return o}function bt(r){const e=ee.c(4),{title:i,actions:l,children:o}=r;let a;return e[0]!==l||e[1]!==o||e[2]!==i?(a=t.jsx(Rs,{title:i,actions:l,children:o}),e[0]=l,e[1]=o,e[2]=i,e[3]=a):a=e[3],a}function Ne(r){const e=ee.c(5),{className:i,children:l}=r;let o;e[0]!==i?(o=ut("gap-0 overflow-hidden p-0 divide-y divide-border",i),e[0]=i,e[1]=o):o=e[1];let a;return e[2]!==l||e[3]!==o?(a=t.jsx(Es,{className:o,children:l}),e[2]=l,e[3]=o,e[4]=a):a=e[4],a}function pt(r){const e=ee.c(5),{className:i,children:l}=r;let o;e[0]!==i?(o=ut("flex min-h-12 items-center gap-3 px-4 py-2",i),e[0]=i,e[1]=o):o=e[1];let a;return e[2]!==l||e[3]!==o?(a=t.jsx("div",{className:o,children:l}),e[2]=l,e[3]=o,e[4]=a):a=e[4],a}function tt(r){const e=ee.c(2),{children:i}=r;let l;return e[0]!==i?(l=t.jsx("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:i}),e[0]=i,e[1]=l):l=e[1],l}function dt(r){const e=ee.c(2),{rows:i}=r,l=i===void 0?3:i;let o;return e[0]!==l?(o=t.jsx(Ne,{children:Array.from({length:l},cn)}),e[0]=l,e[1]=o):o=e[1],o}function cn(r,e){return t.jsxs(pt,{children:[t.jsx(ht,{className:"h-4 w-40"}),t.jsx(ht,{className:"h-4 flex-1"}),t.jsx(ht,{className:"size-7 rounded-lg"})]},e)}function Qe(r){const e=ee.c(5),{className:i,children:l}=r;let o;e[0]!==i?(o=ut("text-xs font-medium text-muted-foreground",i),e[0]=i,e[1]=o):o=e[1];let a;return e[2]!==l||e[3]!==o?(a=t.jsx(Js,{className:o,children:l}),e[2]=l,e[3]=o,e[4]=a):a=e[4],a}function Jt(r){const e=ee.c(12),{open:i,onClick:l}=r,o=ye();let a;e[0]!==i||e[1]!==o?(a=o(i?"mainPanelTabs.hostingTab.hideDetails":"mainPanelTabs.hostingTab.showDetails"),e[0]=i,e[1]=o,e[2]=a):a=e[2];const c=i&&"rotate-90";let m;e[3]!==c?(m=ut("transition-transform duration-200 motion-reduce:transition-none",c),e[3]=c,e[4]=m):m=e[4];let s;e[5]!==m?(s=t.jsx(os,{className:m}),e[5]=m,e[6]=s):s=e[6];let n;return e[7]!==l||e[8]!==i||e[9]!==a||e[10]!==s?(n=t.jsx(nt,{label:a,size:"icon-sm",className:"-ml-1.5 text-muted-foreground","aria-expanded":i,onClick:l,children:s}),e[7]=l,e[8]=i,e[9]=a,e[10]=s,e[11]=n):n=e[11],n}function mn(r){const e=ee.c(8),{open:i,colSpan:l,children:o}=r;let a;e[0]!==o?(a=t.jsx(It,{children:t.jsx("div",{className:"border-b border-border bg-muted/30 px-4 py-3",children:o})}),e[0]=o,e[1]=a):a=e[1];let c;e[2]!==i||e[3]!==a?(c=t.jsx(Qt,{open:i,children:a}),e[2]=i,e[3]=a,e[4]=c):c=e[4];let m;return e[5]!==l||e[6]!==c?(m=t.jsx(at,{className:"border-0 hover:bg-transparent",children:t.jsx(Fe,{colSpan:l,className:"p-0 whitespace-normal",children:c})}),e[5]=l,e[6]=c,e[7]=m):m=e[7],m}function Ss(r){const e=ee.c(5),{open:i,children:l}=r;let o;e[0]!==l?(o=t.jsx(It,{children:t.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:l})}),e[0]=l,e[1]=o):o=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(Qt,{open:i,children:o}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}function Ns(r){const e=ee.c(6),{scope:i}=r,l=ye(),o=i==="build"?"outline":"secondary";let a;e[0]!==i||e[1]!==l?(a=l(i==="build"?"mainPanelTabs.hostingTab.secretScopeBuild":"mainPanelTabs.hostingTab.secretScopeRuntime"),e[0]=i,e[1]=l,e[2]=a):a=e[2];let c;return e[3]!==o||e[4]!==a?(c=t.jsx(Ce,{variant:o,children:a}),e[3]=o,e[4]=a,e[5]=c):c=e[5],c}function dn(r){const e=ee.c(9),{value:i}=r,l=ye();let o;e[0]!==l?(o=l("mainPanelTabs.hostingTab.dnsCopy"),e[0]=l,e[1]=o):o=e[1];let a;e[2]!==l||e[3]!==i?(a=()=>{if(!navigator.clipboard){ce.error(l("mainPanelTabs.hostingTab.dnsCopyError"));return}navigator.clipboard.writeText(i).then(()=>ce.success(l("mainPanelTabs.hostingTab.dnsCopied")),()=>ce.error(l("mainPanelTabs.hostingTab.dnsCopyError")))},e[2]=l,e[3]=i,e[4]=a):a=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Vs,{className:"size-3.5"}),e[5]=c):c=e[5];let m;return e[6]!==o||e[7]!==a?(m=t.jsx(nt,{label:o,onClick:a,children:c}),e[6]=o,e[7]=a,e[8]=m):m=e[8],m}function Et(r){const e=ee.c(28),{open:i,onOpenChange:l,title:o,description:a,confirmLabel:c,pending:m,onConfirm:s}=r,n=ye();let b;e[0]!==o?(b=t.jsx(rs,{children:o}),e[0]=o,e[1]=b):b=e[1];let x;e[2]!==a?(x=t.jsx(cs,{children:a}),e[2]=a,e[3]=x):x=e[3];let d;e[4]!==b||e[5]!==x?(d=t.jsxs(ms,{children:[b,x]}),e[4]=b,e[5]=x,e[6]=d):d=e[6];let u;e[7]!==n?(u=n("mainPanelTabs.hostingTab.cancel"),e[7]=n,e[8]=u):u=e[8];let f;e[9]!==m||e[10]!==u?(f=t.jsx(ds,{disabled:m,children:u}),e[9]=m,e[10]=u,e[11]=f):f=e[11];let h;e[12]!==s?(h=T=>{T.preventDefault(),s()},e[12]=s,e[13]=h):h=e[13];let g;e[14]!==c||e[15]!==m||e[16]!==h?(g=t.jsx(fs,{variant:"destructive",onClick:h,disabled:m,children:c}),e[14]=c,e[15]=m,e[16]=h,e[17]=g):g=e[17];let S;e[18]!==f||e[19]!==g?(S=t.jsxs(us,{children:[f,g]}),e[18]=f,e[19]=g,e[20]=S):S=e[20];let P;e[21]!==d||e[22]!==S?(P=t.jsxs(hs,{children:[d,S]}),e[21]=d,e[22]=S,e[23]=P):P=e[23];let p;return e[24]!==l||e[25]!==i||e[26]!==P?(p=t.jsx(gs,{open:i,onOpenChange:l,children:P}),e[24]=l,e[25]=i,e[26]=P,e[27]=p):p=e[27],p}const fn=8;function Zt(r){const e=ee.c(56),{base:i,orgSlug:l,site:o,label:a,variant:c}=r,m=c===void 0?"default":c,s=ye(),n=jt(),[b,x]=te.useState(!1);let d;e[0]!==i?(d=()=>mt(`${i}/deploy`,"POST",{mode:"current"}),e[0]=i,e[1]=d):d=e[1];let u;e[2]!==l||e[3]!==n||e[4]!==o||e[5]!==s?(u=()=>{n.invalidateQueries({queryKey:Oe.hostingDeployments(l,o)}),n.invalidateQueries({queryKey:Oe.hostingDeploymentHistory(l,o)}),ce.success(s("mainPanelTabs.hostingTab.toastDeployQueued")),x(!1)},e[2]=l,e[3]=n,e[4]=o,e[5]=s,e[6]=u):u=e[6];let f;e[7]!==d||e[8]!==u?(f={mutationFn:d,onSuccess:u,onError:un},e[7]=d,e[8]=u,e[9]=f):f=e[9];const h=rt(f);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=()=>x(!0),e[10]=g):g=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ct,{}),e[11]=S):S=e[11];let P;e[12]!==h.isPending||e[13]!==a||e[14]!==s?(P=h.isPending?s("mainPanelTabs.hostingTab.deploying"):a??s("mainPanelTabs.hostingTab.deploy"),e[12]=h.isPending,e[13]=a,e[14]=s,e[15]=P):P=e[15];let p;e[16]!==h.isPending||e[17]!==P||e[18]!==m?(p=t.jsxs(Ue,{size:"sm",variant:m,onClick:g,disabled:h.isPending,children:[S,P]}),e[16]=h.isPending,e[17]=P,e[18]=m,e[19]=p):p=e[19];let T;e[20]!==s?(T=s("mainPanelTabs.hostingTab.deployConfirmTitle"),e[20]=s,e[21]=T):T=e[21];let y;e[22]!==T?(y=t.jsx(rs,{children:T}),e[22]=T,e[23]=y):y=e[23];let w;e[24]!==s?(w=s("mainPanelTabs.hostingTab.deployConfirmDescription"),e[24]=s,e[25]=w):w=e[25];let v;e[26]!==w?(v=t.jsx(cs,{children:w}),e[26]=w,e[27]=v):v=e[27];let j;e[28]!==y||e[29]!==v?(j=t.jsxs(ms,{children:[y,v]}),e[28]=y,e[29]=v,e[30]=j):j=e[30];const N=h.isPending;let _;e[31]!==s?(_=s("mainPanelTabs.hostingTab.cancel"),e[31]=s,e[32]=_):_=e[32];let k;e[33]!==h.isPending||e[34]!==_?(k=t.jsx(ds,{disabled:N,children:_}),e[33]=h.isPending,e[34]=_,e[35]=k):k=e[35];let R;e[36]!==h?(R=M=>{M.preventDefault(),h.mutate()},e[36]=h,e[37]=R):R=e[37];const $=h.isPending;let H;e[38]!==s?(H=s("mainPanelTabs.hostingTab.deploy"),e[38]=s,e[39]=H):H=e[39];let A;e[40]!==h.isPending||e[41]!==R||e[42]!==H?(A=t.jsx(fs,{onClick:R,disabled:$,children:H}),e[40]=h.isPending,e[41]=R,e[42]=H,e[43]=A):A=e[43];let I;e[44]!==k||e[45]!==A?(I=t.jsxs(us,{children:[k,A]}),e[44]=k,e[45]=A,e[46]=I):I=e[46];let L;e[47]!==j||e[48]!==I?(L=t.jsxs(hs,{children:[j,I]}),e[47]=j,e[48]=I,e[49]=L):L=e[49];let O;e[50]!==b||e[51]!==L?(O=t.jsx(gs,{open:b,onOpenChange:x,children:L}),e[50]=b,e[51]=L,e[52]=O):O=e[52];let B;return e[53]!==O||e[54]!==p?(B=t.jsxs(t.Fragment,{children:[p,O]}),e[53]=O,e[54]=p,e[55]=B):B=e[55],B}function un(r){return ce.error(ft(r))}function hn(r,e){const i=(r??"").toLowerCase();return i.includes("rollback")?t.jsxs(Ce,{variant:"warning",children:[t.jsx(Bs,{}),e("mainPanelTabs.hostingTab.actionRollback")]}):i.includes("redeploy")?t.jsxs(Ce,{variant:"secondary",children:[t.jsx(Os,{}),e("mainPanelTabs.hostingTab.actionRedeploy")]}):t.jsxs(Ce,{variant:"secondary",children:[t.jsx(ct,{}),e("mainPanelTabs.hostingTab.actionDeploy")]})}function gn(r,e,i){const l=(r??"").toLowerCase();return l==="build"?t.jsxs(Ce,{variant:"secondary",children:[t.jsx(ps,{}),i("mainPanelTabs.hostingTab.typeBuild")]}):l==="fast-deploy"?t.jsxs(Ce,{variant:"secondary",children:[t.jsx(Us,{}),i("mainPanelTabs.hostingTab.typeFastDeploy")]}):l==="deploy"?t.jsxs(Ce,{variant:"secondary",children:[t.jsx(ct,{}),i("mainPanelTabs.hostingTab.typeDeploy")]}):hn(e,i)}function xn(r,e){const i=(r??"").toLowerCase();return i==="success"?t.jsx(Ce,{variant:"success",children:e("mainPanelTabs.hostingTab.outcomeSuccess")}):i==="failure"?t.jsx(Ce,{variant:"destructive",children:e("mainPanelTabs.hostingTab.outcomeFailure")}):i==="pending"?t.jsxs(Ce,{variant:"secondary",children:[t.jsx(Hs,{}),e("mainPanelTabs.hostingTab.outcomePending")]}):null}function Mt(r){const e=ee.c(7),{commit:i,onClick:l}=r,o=ye();let a;e[0]!==o?(a=o("mainPanelTabs.hostingTab.buildLogs"),e[0]=o,e[1]=a):a=e[1];const c=!i;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ps,{}),e[2]=m):m=e[2];let s;return e[3]!==l||e[4]!==a||e[5]!==c?(s=t.jsx(nt,{label:a,onClick:l,disabled:c,children:m}),e[3]=l,e[4]=a,e[5]=c,e[6]=s):s=e[6],s}function Cs(r){const e=ee.c(37),{base:i,orgSlug:l,site:o,target:a,onOpenChange:c}=r,m=ye(),s=a!=null,n=a?.commit??"",b=a?.env??"";let x;e[0]!==n||e[1]!==b||e[2]!==l||e[3]!==o?(x=Oe.hostingBuildLogs(l,o,n,b),e[0]=n,e[1]=b,e[2]=l,e[3]=o,e[4]=x):x=e[4];let d;e[5]!==i||e[6]!==n||e[7]!==b?(d=()=>kt(`${i}/deployments/logs?commit=${encodeURIComponent(n)}&env=${encodeURIComponent(b)}`),e[5]=i,e[6]=n,e[7]=b,e[8]=d):d=e[8];const u=s&&!!n;let f;e[9]!==x||e[10]!==d||e[11]!==u?(f={queryKey:x,queryFn:d,enabled:u,retry:!1,staleTime:0,gcTime:0,refetchOnMount:"always"},e[9]=x,e[10]=d,e[11]=u,e[12]=f):f=e[12];const h=Ze(f),g=h.data;let S;e[13]!==m?(S=m("mainPanelTabs.hostingTab.buildLogsTitle"),e[13]=m,e[14]=S):S=e[14];let P;e[15]!==S?(P=t.jsx(Ks,{children:S}),e[15]=S,e[16]=P):P=e[16];let p;e[17]!==n||e[18]!==m?(p=m("mainPanelTabs.hostingTab.buildLogsCommit",{commit:n.slice(0,7)}),e[17]=n,e[18]=m,e[19]=p):p=e[19];let T;e[20]!==p?(T=t.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:p}),e[20]=p,e[21]=T):T=e[21];let y;e[22]!==P||e[23]!==T?(y=t.jsxs(Ws,{className:"shrink-0 border-b border-border px-5 py-5 md:px-6",children:[P,T]}),e[22]=P,e[23]=T,e[24]=y):y=e[24];let w;e[25]!==g||e[26]!==h.error||e[27]!==h.isLoading||e[28]!==m?(w=t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-5 md:px-6",children:gt(h.error)?t.jsx(Xe,{icon:t.jsx(Tt,{className:"size-5"}),title:m("mainPanelTabs.hostingTab.notConnectedTitle"),description:m("mainPanelTabs.hostingTab.notConnectedDescription")}):h.isLoading?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ht,{className:"h-4 w-full"}),t.jsx(ht,{className:"h-4 w-full"}),t.jsx(ht,{className:"h-4 w-2/3"})]}):h.error?t.jsx(tt,{children:m("mainPanelTabs.hostingTab.buildLogsError")}):g&&g.configured===!1?t.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-lg border border-border bg-muted/30 px-4 py-8 text-center",children:[t.jsx(Fs,{className:"size-5 text-muted-foreground"}),t.jsx("p",{className:"text-sm font-medium text-foreground",children:m("mainPanelTabs.hostingTab.buildLogsNotWiredTitle")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:g.reason??m("mainPanelTabs.hostingTab.buildLogsNotWiredDescription")})]}):g?.text?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("pre",{className:"overflow-auto font-mono text-2xs leading-relaxed text-foreground/80 whitespace-pre-wrap break-words",children:g.text}),g.truncated&&t.jsx("p",{className:"text-xs text-warning",children:m("mainPanelTabs.hostingTab.buildLogsTruncated")}),g.url&&t.jsxs("a",{href:g.url,target:"_blank",rel:"noreferrer",className:"inline-flex w-fit items-center gap-1.5 text-xs text-primary hover:underline",children:[t.jsx(yt,{className:"size-3.5"}),m("mainPanelTabs.hostingTab.buildLogsOpenFull")]})]}):g?.url?t.jsxs("a",{href:g.url,target:"_blank",rel:"noreferrer",className:"inline-flex w-fit items-center gap-1.5 text-sm text-primary hover:underline",children:[t.jsx(yt,{className:"size-4"}),m("mainPanelTabs.hostingTab.buildLogsOpenFull")]}):t.jsx(tt,{children:m("mainPanelTabs.hostingTab.buildLogsEmpty")})}),e[25]=g,e[26]=h.error,e[27]=h.isLoading,e[28]=m,e[29]=w):w=e[29];let v;e[30]!==w||e[31]!==y?(v=t.jsxs(Gs,{className:"flex flex-col gap-0 p-0 sm:max-w-2xl",children:[y,w]}),e[30]=w,e[31]=y,e[32]=v):v=e[32];let j;return e[33]!==c||e[34]!==s||e[35]!==v?(j=t.jsx(Ys,{open:s,onOpenChange:c,children:v}),e[33]=c,e[34]=s,e[35]=v,e[36]=j):j=e[36],j}function bn(r){const e=ee.c(52),{base:i,orgSlug:l,site:o,enabled:a,deployments:c,isLoading:m,error:s}=r,n=ye(),[b,x]=te.useState(null),[d,u]=te.useState(fn),[f,h]=te.useState(null);let g;e[0]!==l||e[1]!==o?(g=Oe.hostingDeploymentHistory(l,o),e[0]=l,e[1]=o,e[2]=g):g=e[2];let S;e[3]!==i?(S=()=>kt(`${i}/deployments/history?limit=50`),e[3]=i,e[4]=S):S=e[4];let P;e[5]!==a||e[6]!==g||e[7]!==S?(P={queryKey:g,queryFn:S,enabled:a,retry:!1,staleTime:3e4},e[5]=a,e[6]=g,e[7]=S,e[8]=P):P=e[8];const p=Ze(P);let T,y,w,v;if(e[9]!==c||e[10]!==s||e[11]!==b||e[12]!==d||e[13]!==p.data||e[14]!==p.error||e[15]!==p.isLoading||e[16]!==m||e[17]!==n){const R=et(p.data,"items"),$=R.slice(0,d),H=R.length-$.length;let A;e[22]!==c?(A=c.find(jn)?.commitSha??c.find(Tn)?.commitSha??null,e[22]=c,e[23]=A):A=e[23];const I=A;let L;e[24]===Symbol.for("react.memo_cache_sentinel")?(L=(C,Q)=>{C&&h({commit:C,env:Q??"production"})},e[24]=L):L=e[24];const O=L;let B;e[25]!==n?(B=n("mainPanelTabs.hostingTab.deployments"),e[25]=n,e[26]=B):B=e[26];let M;e[27]!==c||e[28]!==s||e[29]!==b||e[30]!==m||e[31]!==n?(M=m?t.jsx(dt,{}):s?t.jsx(Ne,{children:t.jsx(tt,{children:n("mainPanelTabs.hostingTab.deploymentsError")})}):c.length===0?t.jsx(Ne,{children:t.jsx(Xe,{icon:t.jsx(ct,{className:"size-5"}),title:n("mainPanelTabs.hostingTab.noDeployments"),className:"py-10"})}):t.jsxs(Vt,{children:[t.jsx(Bt,{children:t.jsxs(at,{children:[t.jsx(Qe,{className:"pl-4",children:n("mainPanelTabs.hostingTab.colCommit")}),t.jsx(Qe,{children:n("mainPanelTabs.hostingTab.colStatus")}),t.jsx(Qe,{children:n("mainPanelTabs.hostingTab.colFramework")}),t.jsx(Qe,{className:"text-right",children:n("mainPanelTabs.hostingTab.colDuration")}),t.jsx(Qe,{className:"text-right",children:n("mainPanelTabs.hostingTab.colUpdated")}),t.jsx(Qe,{className:"w-[1%]"})]})}),t.jsx(Ot,{children:c.map(C=>{const Q=!!C.buildMessage,J=b===C.id;return t.jsxs(te.Fragment,{children:[t.jsxs(at,{className:ut(Q&&"cursor-pointer hover:bg-accent"),onClick:Q?()=>x(J?null:C.id):void 0,children:[t.jsx(Fe,{className:"px-4",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Q?t.jsx(Jt,{open:J,onClick:()=>x(J?null:C.id)}):t.jsx(Qs,{className:"size-4 text-muted-foreground/60"}),t.jsx("span",{className:"font-mono text-xs",children:C.shortCommit??C.commitSha?.slice(0,7)??"—"}),C.production===!0&&t.jsx(Ce,{variant:"outline",children:n("mainPanelTabs.hostingTab.production")})]})}),t.jsx(Fe,{children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Ce,{variant:on(C.phase),children:C.phase??"—"}),C.up===!0&&t.jsx(Ce,{variant:"success",children:n("mainPanelTabs.hostingTab.live")})]})}),t.jsx(Fe,{className:"text-xs text-muted-foreground",children:vt(C.framework)??"—"}),t.jsx(Fe,{className:"text-right font-mono text-xs text-muted-foreground tabular-nums",children:ys(C.durationMs)}),t.jsx(Fe,{className:"text-right text-xs text-muted-foreground",children:St(C.finishedAt??C.startedAt??C.createdAt)}),t.jsx(Fe,{className:"pr-3 text-right",onClick:pn,children:t.jsx(Mt,{commit:C.commitSha,onClick:()=>O(C.commitSha,C.env)})})]}),Q&&t.jsx(mn,{open:J,colSpan:6,children:t.jsx("p",{className:"whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:C.buildMessage})})]},C.id)})})]}),e[27]=c,e[28]=s,e[29]=b,e[30]=m,e[31]=n,e[32]=M):M=e[32],e[33]!==M||e[34]!==B?(v=t.jsx(bt,{title:B,children:M}),e[33]=M,e[34]=B,e[35]=v):v=e[35],T=bt,e[36]!==n?(y=n("mainPanelTabs.hostingTab.deployHistory"),e[36]=n,e[37]=y):y=e[37],w=p.isLoading?t.jsx(dt,{}):p.error?t.jsx(Ne,{children:t.jsx(tt,{children:n("mainPanelTabs.hostingTab.deployHistoryError")})}):R.length===0?t.jsx(Ne,{children:t.jsx(Xe,{icon:t.jsx(ct,{className:"size-5"}),title:n("mainPanelTabs.hostingTab.noDeployHistory"),className:"py-10"})}):t.jsxs(Vt,{children:[t.jsx(Bt,{children:t.jsxs(at,{children:[t.jsx(Qe,{className:"pl-4",children:n("mainPanelTabs.hostingTab.colAction")}),t.jsx(Qe,{children:n("mainPanelTabs.hostingTab.colStatus")}),t.jsx(Qe,{children:n("mainPanelTabs.hostingTab.colCommit")}),t.jsx(Qe,{children:n("mainPanelTabs.hostingTab.colFramework")}),t.jsx(Qe,{children:n("mainPanelTabs.hostingTab.colActor")}),t.jsx(Qe,{className:"text-right",children:n("mainPanelTabs.hostingTab.colDate")}),t.jsx(Qe,{className:"w-[1%]"})]})}),t.jsxs(Ot,{children:[$.map(C=>{const Q=!!I&&C.commitSha===I;return t.jsxs(at,{children:[t.jsx(Fe,{className:"pl-4",children:gn(C.type,C.action,n)}),t.jsx(Fe,{children:xn(C.outcome,n)}),t.jsx(Fe,{children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"font-mono text-xs",children:C.commitSha?.slice(0,7)??"—"}),Q&&t.jsx(Ce,{variant:"success",children:n("mainPanelTabs.hostingTab.live")})]})}),t.jsx(Fe,{className:"text-xs text-muted-foreground",children:vt(C.framework)??"—"}),t.jsx(Fe,{className:"text-xs text-muted-foreground",children:C.actor??"—"}),t.jsx(Fe,{className:"text-right text-xs text-muted-foreground",children:St(C.createdAt)}),t.jsx(Fe,{className:"pr-3 text-right",children:t.jsx(Mt,{commit:C.commitSha,onClick:()=>O(C.commitSha,C.env)})})]},C.id)}),H>0&&t.jsx(at,{className:"hover:bg-transparent",children:t.jsx(Fe,{colSpan:7,className:"p-2 text-center",children:t.jsx(Ue,{variant:"ghost",size:"sm",onClick:()=>u(R.length),children:n("mainPanelTabs.hostingTab.showMoreHistory",{count:String(H)})})})})]})]}),e[9]=c,e[10]=s,e[11]=b,e[12]=d,e[13]=p.data,e[14]=p.error,e[15]=p.isLoading,e[16]=m,e[17]=n,e[18]=T,e[19]=y,e[20]=w,e[21]=v}else T=e[18],y=e[19],w=e[20],v=e[21];let j;e[38]!==T||e[39]!==y||e[40]!==w?(j=t.jsx(T,{title:y,children:w}),e[38]=T,e[39]=y,e[40]=w,e[41]=j):j=e[41];let N;e[42]===Symbol.for("react.memo_cache_sentinel")?(N=R=>{R||h(null)},e[42]=N):N=e[42];let _;e[43]!==i||e[44]!==f||e[45]!==l||e[46]!==o?(_=t.jsx(Cs,{base:i,orgSlug:l,site:o,target:f,onOpenChange:N}),e[43]=i,e[44]=f,e[45]=l,e[46]=o,e[47]=_):_=e[47];let k;return e[48]!==v||e[49]!==j||e[50]!==_?(k=t.jsxs(t.Fragment,{children:[v,j,_]}),e[48]=v,e[49]=j,e[50]=_,e[51]=k):k=e[51],k}function pn(r){return r.stopPropagation()}function Tn(r){return r.production===!0&&r.up}function jn(r){return r.up===!0}const Pn=["16.148.147.194","52.32.122.94","52.35.156.199"];function yn(r){return r.replace(/\.$/,"").split(".").filter(Boolean).length===2}function is(r){const e=r.trim();return e.length>0&&!e.startsWith("/")&&e.includes(".")}function ws(r){const e=ee.c(24),{records:i}=r,l=ye();let o;e[0]!==l?(o=l("mainPanelTabs.hostingTab.dnsColType"),e[0]=l,e[1]=o):o=e[1];let a;e[2]!==o?(a=t.jsx(Qe,{className:"w-16",children:o}),e[2]=o,e[3]=a):a=e[3];let c;e[4]!==l?(c=l("mainPanelTabs.hostingTab.dnsColName"),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==c?(m=t.jsx(Qe,{children:c}),e[6]=c,e[7]=m):m=e[7];let s;e[8]!==l?(s=l("mainPanelTabs.hostingTab.dnsColValue"),e[8]=l,e[9]=s):s=e[9];let n;e[10]!==s?(n=t.jsx(Qe,{children:s}),e[10]=s,e[11]=n):n=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Qe,{className:"w-10"}),e[12]=b):b=e[12];let x;e[13]!==a||e[14]!==m||e[15]!==n?(x=t.jsx(Bt,{children:t.jsxs(at,{children:[a,m,n,b]})}),e[13]=a,e[14]=m,e[15]=n,e[16]=x):x=e[16];let d;e[17]!==i?(d=i.map(vn),e[17]=i,e[18]=d):d=e[18];let u;e[19]!==d?(u=t.jsx(Ot,{children:d}),e[19]=d,e[20]=u):u=e[20];let f;return e[21]!==u||e[22]!==x?(f=t.jsxs(Vt,{className:"table-fixed",children:[x,u]}),e[21]=u,e[22]=x,e[23]=f):f=e[23],f}function vn(r){return t.jsxs(at,{children:[t.jsx(Fe,{className:"font-mono text-xs",children:r.type}),t.jsx(Fe,{className:"break-all whitespace-normal font-mono text-xs",children:r.name}),t.jsx(Fe,{className:"break-all whitespace-normal font-mono text-xs text-muted-foreground",children:r.value}),t.jsx(Fe,{className:"text-right",children:t.jsx(dn,{value:r.value})})]},`${r.type}-${r.name}-${r.value}`)}function Ds(r){const e=ee.c(14),{status:i,children:l}=r,o=ye();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ht,{className:"size-4 text-muted-foreground"}),e[0]=a):a=e[0];let c;e[1]!==o?(c=o("mainPanelTabs.hostingTab.dnsSetupTitle"),e[1]=o,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsx("span",{className:"text-sm font-medium",children:c}),e[3]=c,e[4]=m):m=e[4];let s;e[5]!==i||e[6]!==o?(s=i&&t.jsx(Ce,{variant:i.active?"success":"outline",className:"ml-auto",children:i.active?o("mainPanelTabs.hostingTab.dnsActive"):o("mainPanelTabs.hostingTab.dnsAwaiting")}),e[5]=i,e[6]=o,e[7]=s):s=e[7];let n;e[8]!==m||e[9]!==s?(n=t.jsxs("div",{className:"flex items-center gap-2",children:[a,m,s]}),e[8]=m,e[9]=s,e[10]=n):n=e[10];let b;return e[11]!==l||e[12]!==n?(b=t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[n,l]}),e[11]=l,e[12]=n,e[13]=b):b=e[13],b}function ls(r){const e=ee.c(21),{from:i,source:l}=r,o=ye();let a,c,m,s,n;if(e[0]!==i||e[1]!==l||e[2]!==o){const d=i.trim().replace(/\.$/,""),u=d?yn(d)?"@":d:"@",f=l==="both";c=Ds,e[8]!==f?(s={active:f},e[8]=f,e[9]=s):s=e[9];let h;e[10]!==f||e[11]!==o?(h=o(f?"mainPanelTabs.hostingTab.dnsActiveHint":"mainPanelTabs.hostingTab.dnsAwaitingHint"),e[10]=f,e[11]=o,e[12]=h):h=e[12],n=t.jsxs("p",{className:"text-xs text-muted-foreground",children:[o("mainPanelTabs.hostingTab.dnsRedirectIntent",{from:d||"—"})," ",h]}),a=ws,m=Pn.map(g=>({type:"A",name:u,value:g})),e[0]=i,e[1]=l,e[2]=o,e[3]=a,e[4]=c,e[5]=m,e[6]=s,e[7]=n}else a=e[3],c=e[4],m=e[5],s=e[6],n=e[7];let b;e[13]!==a||e[14]!==m?(b=t.jsx(a,{records:m}),e[13]=a,e[14]=m,e[15]=b):b=e[15];let x;return e[16]!==c||e[17]!==s||e[18]!==n||e[19]!==b?(x=t.jsxs(c,{status:s,children:[n,b]}),e[16]=c,e[17]=s,e[18]=n,e[19]=b,e[20]=x):x=e[20],x}function as(r){const e=ee.c(2),{records:i}=r;if(i.length===0)return null;let l;return e[0]!==i?(l=t.jsx(Ds,{children:t.jsx(ws,{records:i})}),e[0]=i,e[1]=l):l=e[1],l}function Sn(r){const e=ee.c(16),{domain:i}=r,l=ye(),o=i.status??"pending";let a;e[0]!==o||e[1]!==l?(a=l(o==="active"?"mainPanelTabs.hostingTab.statusActive":o==="action-required"?"mainPanelTabs.hostingTab.statusActionRequired":"mainPanelTabs.hostingTab.statusPending"),e[0]=o,e[1]=l,e[2]=a):a=e[2];const c=a;let m;e[3]!==i.detail||e[4]!==l?(m=i.detail==="zone-not-onboarded"?l("mainPanelTabs.hostingTab.detailZoneNotOnboarded"):void 0,e[3]=i.detail,e[4]=l,e[5]=m):m=e[5];const s=m,n=o==="active"?"success":o==="action-required"?"warning":"outline";let b;e[6]!==c||e[7]!==n?(b=t.jsx(Ce,{variant:n,children:c}),e[6]=c,e[7]=n,e[8]=b):b=e[8];const x=b;if(!s)return x;let d;e[9]!==x?(d=t.jsx(Ts,{asChild:!0,children:x}),e[9]=x,e[10]=d):d=e[10];let u;e[11]!==s?(u=t.jsx(js,{className:"max-w-xs",children:s}),e[11]=s,e[12]=u):u=e[12];let f;return e[13]!==d||e[14]!==u?(f=t.jsxs(Ps,{children:[d,u]}),e[13]=d,e[14]=u,e[15]=f):f=e[15],f}function $s(r){const e=ee.c(121),{base:i,orgSlug:l,site:o,domains:a,dnsTemplate:c,isLoading:m,error:s}=r,n=ye(),b=jt(),[x,d]=te.useState(!1),[u,f]=te.useState(""),[h,g]=te.useState(null),[S,P]=te.useState(null);let p;e[0]!==l||e[1]!==b||e[2]!==o?(p=()=>b.invalidateQueries({queryKey:Oe.hostingDomains(l,o)}),e[0]=l,e[1]=b,e[2]=o,e[3]=p):p=e[3];const T=p;let y;e[4]!==i?(y=V=>mt(`${i}/domains`,"PUT",V),e[4]=i,e[5]=y):y=e[5];let w;e[6]!==T||e[7]!==n?(w=()=>{T(),ce.success(n("mainPanelTabs.hostingTab.toastDomainSaved")),d(!1)},e[6]=T,e[7]=n,e[8]=w):w=e[8];let v;e[9]!==y||e[10]!==w?(v={mutationFn:y,onSuccess:w,onError:Cn},e[9]=y,e[10]=w,e[11]=v):v=e[11];const j=rt(v);let N;e[12]!==i?(N=V=>mt(`${i}/domains/${encodeURIComponent(V)}`,"DELETE"),e[12]=i,e[13]=N):N=e[13];let _;e[14]!==T||e[15]!==n?(_=()=>{T(),ce.success(n("mainPanelTabs.hostingTab.toastDomainDeleted")),g(null)},e[14]=T,e[15]=n,e[16]=_):_=e[16];let k;e[17]!==N||e[18]!==_?(k={mutationFn:N,onSuccess:_,onError:Nn},e[17]=N,e[18]=_,e[19]=k):k=e[19];const R=rt(k);let $;e[20]!==u||e[21]!==j||e[22]!==n?($=()=>{const V=u.trim().toLowerCase();if(!V){ce.error(n("mainPanelTabs.hostingTab.errorDomainHostRequired"));return}const se=rn(V);if(se){ce.error(se);return}j.mutate({host:V})},e[20]=u,e[21]=j,e[22]=n,e[23]=$):$=e[23];const H=$;let A;if(e[24]!==c||e[25]!==u){let V;e[27]!==u?(V=se=>({...se,name:u.trim().toLowerCase()||se.name}),e[27]=u,e[28]=V):V=e[28],A=c.map(V),e[24]=c,e[25]=u,e[26]=A}else A=e[26];const I=A;let L,O;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{f(""),d(!0)},O=t.jsx(Lt,{}),e[29]=L,e[30]=O):(L=e[29],O=e[30]);let B;e[31]!==n?(B=n("mainPanelTabs.hostingTab.addDomain"),e[31]=n,e[32]=B):B=e[32];let M;e[33]!==B?(M=t.jsxs(Ue,{size:"sm",variant:"outline",onClick:L,children:[O,B]}),e[33]=B,e[34]=M):M=e[34];const C=M;let Q;e[35]!==n?(Q=n("mainPanelTabs.hostingTab.domains"),e[35]=n,e[36]=Q):Q=e[36];const J=a.length>0?C:void 0;let D;e[37]!==C||e[38]!==R.isPending||e[39]!==S||e[40]!==a||e[41]!==s||e[42]!==m||e[43]!==n?(D=m?t.jsx(dt,{}):s?t.jsx(Ne,{children:t.jsx(tt,{children:n("mainPanelTabs.hostingTab.domainsError")})}):a.length===0?t.jsx(Ne,{children:t.jsx(Xe,{icon:t.jsx(Ht,{className:"size-5"}),title:n("mainPanelTabs.hostingTab.noDomains"),description:n("mainPanelTabs.hostingTab.noDomainsDescription"),size:"inline",buttonComponent:C})}):t.jsx(Ne,{children:a.map((V,se)=>{const we=!V.canonical&&(V.dns?.length??0)>0,je=S===V.host;return t.jsxs("div",{children:[t.jsxs(pt,{children:[we?t.jsx(Jt,{open:je,onClick:()=>P(je?null:V.host)}):t.jsx(Ht,{className:"size-4 shrink-0 text-muted-foreground/60"}),t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t.jsx("span",{className:"truncate font-mono text-xs",children:V.host}),V.canonical&&t.jsx(Ce,{variant:"outline",children:n("mainPanelTabs.hostingTab.canonical")})]}),t.jsx(Sn,{domain:V}),!V.canonical&&t.jsx(nt,{label:n("mainPanelTabs.hostingTab.deleteDomain"),onClick:()=>g(V.host),disabled:R.isPending,className:"text-muted-foreground",children:t.jsx(_t,{})})]}),we&&t.jsx(Ss,{open:je,children:t.jsx(as,{records:V.dns??[]})})]},`${V.host}-${se}`)})}),e[37]=C,e[38]=R.isPending,e[39]=S,e[40]=a,e[41]=s,e[42]=m,e[43]=n,e[44]=D):D=e[44];let W;e[45]!==n?(W=n("mainPanelTabs.hostingTab.addDomainTitle"),e[45]=n,e[46]=W):W=e[46];let F;e[47]!==W?(F=t.jsx(Nt,{children:t.jsx(Ct,{children:W})}),e[47]=W,e[48]=F):F=e[48];let E;e[49]!==H?(E=V=>{V.preventDefault(),H()},e[49]=H,e[50]=E):E=e[50];let q;e[51]!==n?(q=n("mainPanelTabs.hostingTab.colHost"),e[51]=n,e[52]=q):q=e[52];let z;e[53]!==q?(z=t.jsx(st,{htmlFor:"domain-host",children:q}),e[53]=q,e[54]=z):z=e[54];let U;e[55]!==n?(U=n("mainPanelTabs.hostingTab.domainHostPlaceholder"),e[55]=n,e[56]=U):U=e[56];let G;e[57]===Symbol.for("react.memo_cache_sentinel")?(G=V=>f(V.target.value),e[57]=G):G=e[57];let Y;e[58]!==u||e[59]!==j.isPending||e[60]!==U?(Y=t.jsx(ot,{id:"domain-host",placeholder:U,value:u,onChange:G,className:"font-mono text-xs",autoComplete:"off",disabled:j.isPending}),e[58]=u,e[59]=j.isPending,e[60]=U,e[61]=Y):Y=e[61];let ne;e[62]!==z||e[63]!==Y?(ne=t.jsxs("div",{className:"flex flex-col gap-2",children:[z,Y]}),e[62]=z,e[63]=Y,e[64]=ne):ne=e[64];let ie;e[65]!==u||e[66]!==I?(ie=u.trim()&&t.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3",children:t.jsx(as,{records:I})}),e[65]=u,e[66]=I,e[67]=ie):ie=e[67];let Pe;e[68]===Symbol.for("react.memo_cache_sentinel")?(Pe=()=>d(!1),e[68]=Pe):Pe=e[68];const $e=j.isPending;let me;e[69]!==n?(me=n("mainPanelTabs.hostingTab.cancel"),e[69]=n,e[70]=me):me=e[70];let pe;e[71]!==j.isPending||e[72]!==me?(pe=t.jsx(Ue,{variant:"outline",type:"button",onClick:Pe,disabled:$e,children:me}),e[71]=j.isPending,e[72]=me,e[73]=pe):pe=e[73];let le;e[74]!==u||e[75]!==j.isPending?(le=j.isPending||!u.trim(),e[74]=u,e[75]=j.isPending,e[76]=le):le=e[76];let ae;e[77]!==j.isPending||e[78]!==n?(ae=j.isPending?n("mainPanelTabs.hostingTab.saving"):n("mainPanelTabs.hostingTab.save"),e[77]=j.isPending,e[78]=n,e[79]=ae):ae=e[79];let de;e[80]!==le||e[81]!==ae?(de=t.jsx(Ue,{type:"submit",disabled:le,children:ae}),e[80]=le,e[81]=ae,e[82]=de):de=e[82];let Le;e[83]!==pe||e[84]!==de?(Le=t.jsxs(wt,{children:[pe,de]}),e[83]=pe,e[84]=de,e[85]=Le):Le=e[85];let fe;e[86]!==E||e[87]!==ne||e[88]!==ie||e[89]!==Le?(fe=t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:E,children:[ne,ie,Le]}),e[86]=E,e[87]=ne,e[88]=ie,e[89]=Le,e[90]=fe):fe=e[90];let ue;e[91]!==F||e[92]!==fe?(ue=t.jsxs(Dt,{className:"sm:max-w-md",children:[F,fe]}),e[91]=F,e[92]=fe,e[93]=ue):ue=e[93];let oe;e[94]!==x||e[95]!==ue?(oe=t.jsx($t,{open:x,onOpenChange:d,children:ue}),e[94]=x,e[95]=ue,e[96]=oe):oe=e[96];const Te=h!=null;let he;e[97]===Symbol.for("react.memo_cache_sentinel")?(he=V=>{V||g(null)},e[97]=he):he=e[97];let ge;e[98]!==n?(ge=n("mainPanelTabs.hostingTab.confirmDeleteDomainTitle"),e[98]=n,e[99]=ge):ge=e[99];const ve=h??"";let Se;e[100]!==n||e[101]!==ve?(Se=n("mainPanelTabs.hostingTab.confirmDeleteDomainDescription",{host:ve}),e[100]=n,e[101]=ve,e[102]=Se):Se=e[102];let xe;e[103]!==n?(xe=n("mainPanelTabs.hostingTab.deleteDomain"),e[103]=n,e[104]=xe):xe=e[104];let re;e[105]!==R||e[106]!==h?(re=()=>{h&&R.mutate(h)},e[105]=R,e[106]=h,e[107]=re):re=e[107];let be;e[108]!==R.isPending||e[109]!==Te||e[110]!==ge||e[111]!==Se||e[112]!==xe||e[113]!==re?(be=t.jsx(Et,{open:Te,onOpenChange:he,title:ge,description:Se,confirmLabel:xe,pending:R.isPending,onConfirm:re}),e[108]=R.isPending,e[109]=Te,e[110]=ge,e[111]=Se,e[112]=xe,e[113]=re,e[114]=be):be=e[114];let _e;return e[115]!==Q||e[116]!==J||e[117]!==D||e[118]!==oe||e[119]!==be?(_e=t.jsxs(bt,{title:Q,actions:J,children:[D,oe,be]}),e[115]=Q,e[116]=J,e[117]=D,e[118]=oe,e[119]=be,e[120]=_e):_e=e[120],_e}function Nn(r){return ce.error(ft(r))}function Cn(r){return ce.error(ft(r))}function wn(r){const e=ee.c(22),{value:i,onChange:l,disabled:o,className:a}=r,c=ye();let m;e[0]!==l?(m=g=>l(g==="build"?"build":"runtime"),e[0]=l,e[1]=m):m=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Ut,{}),e[2]=s):s=e[2];let n;e[3]!==a?(n=t.jsx(Kt,{size:"sm",className:a,children:s}),e[3]=a,e[4]=n):n=e[4];let b;e[5]!==c?(b=c("mainPanelTabs.hostingTab.secretScopeRuntime"),e[5]=c,e[6]=b):b=e[6];let x;e[7]!==b?(x=t.jsx(xt,{value:"runtime",children:b}),e[7]=b,e[8]=x):x=e[8];let d;e[9]!==c?(d=c("mainPanelTabs.hostingTab.secretScopeBuild"),e[9]=c,e[10]=d):d=e[10];let u;e[11]!==d?(u=t.jsx(xt,{value:"build",children:d}),e[11]=d,e[12]=u):u=e[12];let f;e[13]!==x||e[14]!==u?(f=t.jsxs(Wt,{children:[x,u]}),e[13]=x,e[14]=u,e[15]=f):f=e[15];let h;return e[16]!==o||e[17]!==m||e[18]!==n||e[19]!==f||e[20]!==i?(h=t.jsxs(Gt,{value:i,onValueChange:m,disabled:o,children:[n,f]}),e[16]=o,e[17]=m,e[18]=n,e[19]=f,e[20]=i,e[21]=h):h=e[21],h}function Ls(r){const e=ee.c(151),{base:i,orgSlug:l,site:o,envVars:a,codeVars:c,isLoading:m,error:s}=r,n=ye(),b=jt(),[x,d]=te.useState(!1),[u,f]=te.useState(""),[h,g]=te.useState(""),[S,P]=te.useState("runtime"),[p,T]=te.useState(null),[y,w]=te.useState(""),[v,j]=te.useState(null);let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[0]=N):N=e[0];const[_,k]=te.useState(N);let R;e[1]===Symbol.for("react.memo_cache_sentinel")?(R=K=>{k(De=>{const Ge=new Set(De);return Ge.has(K)?Ge.delete(K):Ge.add(K),Ge})},e[1]=R):R=e[1];const $=R;let H;e[2]!==i?(H=K=>mt(`${i}/env`,"PUT",{vars:K}),e[2]=i,e[3]=H):H=e[3];let A;e[4]!==l||e[5]!==b||e[6]!==o||e[7]!==n?(A=()=>{b.invalidateQueries({queryKey:Oe.hostingEnv(l,o)}),ce.success(n("mainPanelTabs.hostingTab.toastEnvSaved"))},e[4]=l,e[5]=b,e[6]=o,e[7]=n,e[8]=A):A=e[8];let I;e[9]!==H||e[10]!==A?(I={mutationFn:H,onSuccess:A,onError:$n},e[9]=H,e[10]=A,e[11]=I):I=e[11];const L=rt(I);let O;e[12]!==u||e[13]!==S||e[14]!==h||e[15]!==L||e[16]!==a||e[17]!==n?(O=()=>{const K=u.trim();if(!K){ce.error(n("mainPanelTabs.hostingTab.errorEnvNameRequired"));return}if(a.some(De=>At(De,{name:K,scope:S}))){ce.error(n("mainPanelTabs.hostingTab.errorEnvNameDuplicate"));return}L.mutate([...a,{name:K,value:h,scope:S}],{onSuccess:()=>{d(!1),f(""),g(""),P("runtime")}})},e[12]=u,e[13]=S,e[14]=h,e[15]=L,e[16]=a,e[17]=n,e[18]=O):O=e[18];const B=O;let M;e[19]!==y||e[20]!==L||e[21]!==a?(M=K=>{L.mutate(a.map(De=>At(De,K)?{name:K.name,value:y,scope:K.scope}:De),{onSuccess:()=>T(null)})},e[19]=y,e[20]=L,e[21]=a,e[22]=M):M=e[22];const C=M;let Q;e[23]!==v||e[24]!==L||e[25]!==a?(Q=()=>{v&&L.mutate(a.filter(K=>!At(K,v)),{onSuccess:()=>j(null)})},e[23]=v,e[24]=L,e[25]=a,e[26]=Q):Q=e[26];const J=Q,D=L.isPending;let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{f(""),g(""),P("runtime")},e[27]=W):W=e[27];const F=W;let E,q;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=()=>d(!0),q=t.jsx(Lt,{}),e[28]=E,e[29]=q):(E=e[28],q=e[29]);let z;e[30]!==n?(z=n("mainPanelTabs.hostingTab.addVariable"),e[30]=n,e[31]=z):z=e[31];let U;e[32]!==z?(U=t.jsxs(Ue,{size:"sm",variant:"outline",onClick:E,children:[q,z]}),e[32]=z,e[33]=U):U=e[33];const G=U;let Y;e[34]!==n?(Y=n("mainPanelTabs.hostingTab.env"),e[34]=n,e[35]=Y):Y=e[35];const ne=a.length>0||c.length>0?G:void 0;let ie;e[36]!==G||e[37]!==c||e[38]!==y||e[39]!==p?.name||e[40]!==p?.scope||e[41]!==a||e[42]!==s||e[43]!==C||e[44]!==m||e[45]!==D||e[46]!==_||e[47]!==n?(ie=m?t.jsx(dt,{}):s?t.jsx(Ne,{children:t.jsx(tt,{children:n("mainPanelTabs.hostingTab.envError")})}):a.length===0&&c.length===0?t.jsx(Ne,{children:t.jsx(Xe,{icon:t.jsx(ss,{className:"size-5"}),title:n("mainPanelTabs.hostingTab.noEnv"),description:n("mainPanelTabs.hostingTab.noEnvDescription"),size:"inline",buttonComponent:G})}):t.jsxs(Ne,{children:[a.map(K=>{const De=K.scope==="build"?"build":"runtime",Ge=`${K.name}:${De}`,it=p?.name===K.name&&p?.scope===De,lt=_.has(Ge);return t.jsxs(pt,{children:[t.jsxs("div",{className:"flex min-w-0 flex-1 basis-0 items-center gap-2",children:[t.jsx("div",{className:"w-20 shrink-0",children:t.jsx(Ns,{scope:De})}),t.jsx("span",{className:"truncate font-mono text-xs",children:K.name})]}),t.jsx("div",{className:"flex min-w-0 flex-1 basis-0 items-center justify-end gap-2",children:it?t.jsxs(t.Fragment,{children:[t.jsx(ot,{value:y,onChange:Z=>w(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&C({name:K.name,scope:De}),Z.key==="Escape"&&T(null)},autoFocus:!0,size:"sm",className:"font-mono text-xs"}),t.jsx(Ue,{size:"sm",onClick:()=>C({name:K.name,scope:De}),disabled:D,children:n("mainPanelTabs.hostingTab.save")}),t.jsx(Ue,{size:"sm",variant:"ghost",onClick:()=>T(null),disabled:D,children:n("mainPanelTabs.hostingTab.cancel")})]}):t.jsxs(t.Fragment,{children:[t.jsx(nt,{label:n(lt?"mainPanelTabs.hostingTab.hideValue":"mainPanelTabs.hostingTab.showValue"),onClick:()=>$(Ge),className:"text-muted-foreground",children:lt?t.jsx(Xs,{}):t.jsx(en,{})}),lt?t.jsx("button",{type:"button",onClick:()=>{T({name:K.name,scope:De}),w(K.value)},title:n("mainPanelTabs.hostingTab.editValue"),className:"min-w-0 truncate px-1.5 py-0.5 text-right font-mono text-xs text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:K.value||"—"}):t.jsx("span",{className:"min-w-0 truncate px-1.5 py-0.5 text-right font-mono text-xs text-muted-foreground/60",children:K.value?"••••••••••":"—"})]})}),t.jsx(nt,{label:n("mainPanelTabs.hostingTab.deleteVariable"),onClick:()=>j({name:K.name,scope:De}),disabled:D,className:"text-muted-foreground",children:t.jsx(_t,{})})]},Ge)}),c.length>0&&t.jsxs(Qt,{children:[t.jsx(Zs,{asChild:!0,children:t.jsxs("button",{type:"button",className:"group flex w-full items-center gap-2 px-4 py-2.5 text-left text-xs text-muted-foreground hover:bg-accent",children:[t.jsx(os,{className:"size-4 transition-transform duration-200 group-data-[state=open]:rotate-90 motion-reduce:transition-none"}),t.jsx(ss,{className:"size-4"}),n("mainPanelTabs.hostingTab.codeVarsToggle",{count:String(c.length)})]})}),t.jsx(It,{children:t.jsx("div",{className:"divide-y divide-border/60 border-t border-border bg-muted/30",children:c.map(Dn)})})]})]}),e[36]=G,e[37]=c,e[38]=y,e[39]=p?.name,e[40]=p?.scope,e[41]=a,e[42]=s,e[43]=C,e[44]=m,e[45]=D,e[46]=_,e[47]=n,e[48]=ie):ie=e[48];let Pe;e[49]===Symbol.for("react.memo_cache_sentinel")?(Pe=K=>{d(K),K||F()},e[49]=Pe):Pe=e[49];let $e;e[50]!==n?($e=n("mainPanelTabs.hostingTab.addVariable"),e[50]=n,e[51]=$e):$e=e[51];let me;e[52]!==$e?(me=t.jsx(Nt,{children:t.jsx(Ct,{children:$e})}),e[52]=$e,e[53]=me):me=e[53];let pe;e[54]!==B?(pe=K=>{K.preventDefault(),B()},e[54]=B,e[55]=pe):pe=e[55];let le;e[56]!==n?(le=n("mainPanelTabs.hostingTab.colName"),e[56]=n,e[57]=le):le=e[57];let ae;e[58]!==le?(ae=t.jsx(st,{htmlFor:"env-name",children:le}),e[58]=le,e[59]=ae):ae=e[59];let de;e[60]!==n?(de=n("mainPanelTabs.hostingTab.envNamePlaceholder"),e[60]=n,e[61]=de):de=e[61];let Le;e[62]===Symbol.for("react.memo_cache_sentinel")?(Le=K=>f(K.target.value),e[62]=Le):Le=e[62];let fe;e[63]!==u||e[64]!==D||e[65]!==de?(fe=t.jsx(ot,{id:"env-name",placeholder:de,value:u,onChange:Le,className:"font-mono text-xs",autoComplete:"off",disabled:D}),e[63]=u,e[64]=D,e[65]=de,e[66]=fe):fe=e[66];let ue;e[67]!==ae||e[68]!==fe?(ue=t.jsxs("div",{className:"flex flex-col gap-2",children:[ae,fe]}),e[67]=ae,e[68]=fe,e[69]=ue):ue=e[69];let oe;e[70]!==n?(oe=n("mainPanelTabs.hostingTab.colValue"),e[70]=n,e[71]=oe):oe=e[71];let Te;e[72]!==oe?(Te=t.jsx(st,{htmlFor:"env-value",children:oe}),e[72]=oe,e[73]=Te):Te=e[73];let he;e[74]!==n?(he=n("mainPanelTabs.hostingTab.envValuePlaceholder"),e[74]=n,e[75]=he):he=e[75];let ge;e[76]===Symbol.for("react.memo_cache_sentinel")?(ge=K=>g(K.target.value),e[76]=ge):ge=e[76];let ve;e[77]!==h||e[78]!==D||e[79]!==he?(ve=t.jsx(ot,{id:"env-value",placeholder:he,value:h,onChange:ge,className:"font-mono text-xs",autoComplete:"off",disabled:D}),e[77]=h,e[78]=D,e[79]=he,e[80]=ve):ve=e[80];let Se;e[81]!==Te||e[82]!==ve?(Se=t.jsxs("div",{className:"flex flex-col gap-2",children:[Te,ve]}),e[81]=Te,e[82]=ve,e[83]=Se):Se=e[83];let xe;e[84]!==n?(xe=n("mainPanelTabs.hostingTab.secretScope"),e[84]=n,e[85]=xe):xe=e[85];let re;e[86]!==xe?(re=t.jsx(st,{children:xe}),e[86]=xe,e[87]=re):re=e[87];let be;e[88]!==S||e[89]!==D?(be=t.jsx(wn,{value:S,onChange:P,disabled:D,className:"w-full"}),e[88]=S,e[89]=D,e[90]=be):be=e[90];let _e;e[91]!==S||e[92]!==n?(_e=n(S==="build"?"mainPanelTabs.hostingTab.secretScopeBuildHint":"mainPanelTabs.hostingTab.secretScopeRuntimeHint"),e[91]=S,e[92]=n,e[93]=_e):_e=e[93];let V;e[94]!==_e?(V=t.jsx("p",{className:"text-xs text-muted-foreground",children:_e}),e[94]=_e,e[95]=V):V=e[95];let se;e[96]!==re||e[97]!==be||e[98]!==V?(se=t.jsxs("div",{className:"flex flex-col gap-2",children:[re,be,V]}),e[96]=re,e[97]=be,e[98]=V,e[99]=se):se=e[99];let we;e[100]===Symbol.for("react.memo_cache_sentinel")?(we=()=>{d(!1),F()},e[100]=we):we=e[100];let je;e[101]!==n?(je=n("mainPanelTabs.hostingTab.cancel"),e[101]=n,e[102]=je):je=e[102];let ke;e[103]!==D||e[104]!==je?(ke=t.jsx(Ue,{variant:"outline",type:"button",onClick:we,disabled:D,children:je}),e[103]=D,e[104]=je,e[105]=ke):ke=e[105];let He;e[106]!==u||e[107]!==D?(He=D||!u.trim(),e[106]=u,e[107]=D,e[108]=He):He=e[108];let We;e[109]!==D||e[110]!==n?(We=n(D?"mainPanelTabs.hostingTab.saving":"mainPanelTabs.hostingTab.add"),e[109]=D,e[110]=n,e[111]=We):We=e[111];let Ee;e[112]!==He||e[113]!==We?(Ee=t.jsx(Ue,{type:"submit",disabled:He,children:We}),e[112]=He,e[113]=We,e[114]=Ee):Ee=e[114];let Re;e[115]!==ke||e[116]!==Ee?(Re=t.jsxs(wt,{children:[ke,Ee]}),e[115]=ke,e[116]=Ee,e[117]=Re):Re=e[117];let Me;e[118]!==pe||e[119]!==ue||e[120]!==Se||e[121]!==se||e[122]!==Re?(Me=t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:pe,children:[ue,Se,se,Re]}),e[118]=pe,e[119]=ue,e[120]=Se,e[121]=se,e[122]=Re,e[123]=Me):Me=e[123];let Ve;e[124]!==me||e[125]!==Me?(Ve=t.jsxs(Dt,{className:"sm:max-w-md",children:[me,Me]}),e[124]=me,e[125]=Me,e[126]=Ve):Ve=e[126];let ze;e[127]!==x||e[128]!==Ve?(ze=t.jsx($t,{open:x,onOpenChange:Pe,children:Ve}),e[127]=x,e[128]=Ve,e[129]=ze):ze=e[129];const Ye=v!=null;let Be;e[130]===Symbol.for("react.memo_cache_sentinel")?(Be=K=>{K||j(null)},e[130]=Be):Be=e[130];let Ae;e[131]!==n?(Ae=n("mainPanelTabs.hostingTab.confirmDeleteVariableTitle"),e[131]=n,e[132]=Ae):Ae=e[132];const qe=v?.name??"";let Ie;e[133]!==n||e[134]!==qe?(Ie=n("mainPanelTabs.hostingTab.confirmDeleteVariableDescription",{name:qe}),e[133]=n,e[134]=qe,e[135]=Ie):Ie=e[135];let Ke;e[136]!==n?(Ke=n("mainPanelTabs.hostingTab.deleteVariable"),e[136]=n,e[137]=Ke):Ke=e[137];let X;e[138]!==J||e[139]!==D||e[140]!==Ye||e[141]!==Ae||e[142]!==Ie||e[143]!==Ke?(X=t.jsx(Et,{open:Ye,onOpenChange:Be,title:Ae,description:Ie,confirmLabel:Ke,pending:D,onConfirm:J}),e[138]=J,e[139]=D,e[140]=Ye,e[141]=Ae,e[142]=Ie,e[143]=Ke,e[144]=X):X=e[144];let Je;return e[145]!==Y||e[146]!==ne||e[147]!==ie||e[148]!==ze||e[149]!==X?(Je=t.jsxs(bt,{title:Y,actions:ne,children:[ie,ze,X]}),e[145]=Y,e[146]=ne,e[147]=ie,e[148]=ze,e[149]=X,e[150]=Je):Je=e[150],Je}function Dn(r){return t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 font-mono text-xs",children:[t.jsx("span",{className:"flex-1 basis-0 truncate",children:r.name}),t.jsx("span",{className:"flex-1 basis-0 truncate text-right text-muted-foreground",children:r.value})]},r.name)}function $n(r){return ce.error(ft(r))}function _s(r){const e=ee.c(160),{base:i,orgSlug:l,site:o,secrets:a,isLoading:c,error:m}=r,s=ye(),n=jt(),[b,x]=te.useState(!1),[d,u]=te.useState(""),[f,h]=te.useState(""),[g,S]=te.useState("runtime"),[P,p]=te.useState(null);let T;e[0]!==l||e[1]!==n||e[2]!==o?(T=()=>n.invalidateQueries({queryKey:Oe.hostingSecrets(l,o)}),e[0]=l,e[1]=n,e[2]=o,e[3]=T):T=e[3];const y=T;let w;e[4]!==i?(w=X=>mt(`${i}/secrets`,"PUT",X),e[4]=i,e[5]=w):w=e[5];let v;e[6]!==y||e[7]!==s?(v=X=>{y(),X?.workerSync?.status==="failed"?ce.warning(s("mainPanelTabs.hostingTab.toastSecretNotOnWorker")):ce.success(s("mainPanelTabs.hostingTab.toastSecretSaved")),x(!1),u(""),h(""),S("runtime")},e[6]=y,e[7]=s,e[8]=v):v=e[8];let j;e[9]!==w||e[10]!==v?(j={mutationFn:w,onSuccess:v,onError:_n},e[9]=w,e[10]=v,e[11]=j):j=e[11];const N=rt(j);let _;e[12]!==i?(_=X=>mt(`${i}/secrets/${encodeURIComponent(X.name)}?scope=${X.scope}`,"DELETE"),e[12]=i,e[13]=_):_=e[13];let k;e[14]!==y||e[15]!==s?(k=()=>{y(),ce.success(s("mainPanelTabs.hostingTab.toastSecretDeleted")),p(null)},e[14]=y,e[15]=s,e[16]=k):k=e[16];let R;e[17]!==_||e[18]!==k?(R={mutationFn:_,onSuccess:k,onError:Ln},e[17]=_,e[18]=k,e[19]=R):R=e[19];const $=rt(R);let H;e[20]!==d||e[21]!==g||e[22]!==f||e[23]!==N||e[24]!==s?(H=()=>{const X=d.trim();if(!X){ce.error(s("mainPanelTabs.hostingTab.errorSecretNameRequired"));return}if(!f){ce.error(s("mainPanelTabs.hostingTab.errorSecretValueRequired"));return}N.mutate({name:X,value:f,scope:g})},e[20]=d,e[21]=g,e[22]=f,e[23]=N,e[24]=s,e[25]=H):H=e[25];const A=H;let I,L;e[26]===Symbol.for("react.memo_cache_sentinel")?(L=()=>x(!0),I=t.jsx(Lt,{}),e[26]=I,e[27]=L):(I=e[26],L=e[27]);let O;e[28]!==s?(O=s("mainPanelTabs.hostingTab.addSecret"),e[28]=s,e[29]=O):O=e[29];let B;e[30]!==O?(B=t.jsxs(Ue,{size:"sm",variant:"outline",onClick:L,children:[I,O]}),e[30]=O,e[31]=B):B=e[31];const M=B;let C;e[32]!==s?(C=s("mainPanelTabs.hostingTab.secrets"),e[32]=s,e[33]=C):C=e[33];const Q=a.length>0?M:void 0;let J;e[34]!==M||e[35]!==$.isPending||e[36]!==m||e[37]!==c||e[38]!==a||e[39]!==s?(J=c?t.jsx(dt,{}):m?t.jsx(Ne,{children:t.jsx(tt,{children:s("mainPanelTabs.hostingTab.secretsError")})}):a.length===0?t.jsx(Ne,{children:t.jsx(Xe,{icon:t.jsx(es,{className:"size-5"}),title:s("mainPanelTabs.hostingTab.noSecrets"),description:s("mainPanelTabs.hostingTab.noSecretsDescription"),size:"inline",buttonComponent:M})}):t.jsx(Ne,{children:a.map(X=>{const Je=X.scope==="build"?"build":"runtime";return t.jsxs(pt,{children:[t.jsx(es,{className:"size-4 shrink-0 text-muted-foreground/60"}),t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t.jsx("div",{className:"w-20 shrink-0",children:t.jsx(Ns,{scope:Je})}),t.jsx("span",{className:"truncate font-mono text-xs",children:X.name}),X.origin==="worker"&&t.jsx(Ce,{variant:"secondary",children:s("mainPanelTabs.hostingTab.secretOnWorker")}),X.workerSync==="missing"&&t.jsxs(Ps,{children:[t.jsx(Ts,{asChild:!0,children:t.jsx(Ce,{variant:"warning",children:s("mainPanelTabs.hostingTab.secretNotOnWorker")})}),t.jsx(js,{className:"max-w-xs",children:s("mainPanelTabs.hostingTab.secretNotOnWorkerHint")})]})]}),t.jsx("span",{className:"font-mono text-xs text-muted-foreground/60",children:s("mainPanelTabs.hostingTab.secretValueHidden")}),t.jsx(nt,{label:s("mainPanelTabs.hostingTab.deleteSecret"),onClick:()=>p({name:X.name,scope:Je}),disabled:$.isPending,className:"text-muted-foreground",children:t.jsx(_t,{})})]},`${X.name}:${Je}`)})}),e[34]=M,e[35]=$.isPending,e[36]=m,e[37]=c,e[38]=a,e[39]=s,e[40]=J):J=e[40];let D;e[41]!==s?(D=s("mainPanelTabs.hostingTab.addSecretTitle"),e[41]=s,e[42]=D):D=e[42];let W;e[43]!==D?(W=t.jsx(Nt,{children:t.jsx(Ct,{children:D})}),e[43]=D,e[44]=W):W=e[44];let F;e[45]!==A?(F=X=>{X.preventDefault(),A()},e[45]=A,e[46]=F):F=e[46];let E;e[47]!==s?(E=s("mainPanelTabs.hostingTab.colName"),e[47]=s,e[48]=E):E=e[48];let q;e[49]!==E?(q=t.jsx(st,{htmlFor:"secret-name",children:E}),e[49]=E,e[50]=q):q=e[50];let z;e[51]!==s?(z=s("mainPanelTabs.hostingTab.secretNamePlaceholder"),e[51]=s,e[52]=z):z=e[52];let U;e[53]===Symbol.for("react.memo_cache_sentinel")?(U=X=>u(X.target.value),e[53]=U):U=e[53];let G;e[54]!==d||e[55]!==N.isPending||e[56]!==z?(G=t.jsx(ot,{id:"secret-name",placeholder:z,value:d,onChange:U,className:"font-mono text-xs",autoComplete:"off",disabled:N.isPending}),e[54]=d,e[55]=N.isPending,e[56]=z,e[57]=G):G=e[57];let Y;e[58]!==q||e[59]!==G?(Y=t.jsxs("div",{className:"flex flex-col gap-2",children:[q,G]}),e[58]=q,e[59]=G,e[60]=Y):Y=e[60];let ne;e[61]!==s?(ne=s("mainPanelTabs.hostingTab.colValue"),e[61]=s,e[62]=ne):ne=e[62];let ie;e[63]!==ne?(ie=t.jsx(st,{htmlFor:"secret-value",children:ne}),e[63]=ne,e[64]=ie):ie=e[64];let Pe;e[65]!==s?(Pe=s("mainPanelTabs.hostingTab.secretValuePlaceholder"),e[65]=s,e[66]=Pe):Pe=e[66];let $e;e[67]===Symbol.for("react.memo_cache_sentinel")?($e=X=>h(X.target.value),e[67]=$e):$e=e[67];let me;e[68]!==f||e[69]!==N.isPending||e[70]!==Pe?(me=t.jsx(ot,{id:"secret-value",type:"password",placeholder:Pe,value:f,onChange:$e,className:"font-mono text-xs",autoComplete:"new-password",disabled:N.isPending}),e[68]=f,e[69]=N.isPending,e[70]=Pe,e[71]=me):me=e[71];let pe;e[72]!==ie||e[73]!==me?(pe=t.jsxs("div",{className:"flex flex-col gap-2",children:[ie,me]}),e[72]=ie,e[73]=me,e[74]=pe):pe=e[74];let le;e[75]!==s?(le=s("mainPanelTabs.hostingTab.secretScope"),e[75]=s,e[76]=le):le=e[76];let ae;e[77]!==le?(ae=t.jsx(st,{children:le}),e[77]=le,e[78]=ae):ae=e[78];let de;e[79]===Symbol.for("react.memo_cache_sentinel")?(de=X=>S(X==="build"?"build":"runtime"),e[79]=de):de=e[79];const Le=N.isPending;let fe;e[80]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx(Kt,{className:"w-full",children:t.jsx(Ut,{})}),e[80]=fe):fe=e[80];let ue;e[81]!==s?(ue=s("mainPanelTabs.hostingTab.secretScopeRuntime"),e[81]=s,e[82]=ue):ue=e[82];let oe;e[83]!==ue?(oe=t.jsx(xt,{value:"runtime",children:ue}),e[83]=ue,e[84]=oe):oe=e[84];let Te;e[85]!==s?(Te=s("mainPanelTabs.hostingTab.secretScopeBuild"),e[85]=s,e[86]=Te):Te=e[86];let he;e[87]!==Te?(he=t.jsx(xt,{value:"build",children:Te}),e[87]=Te,e[88]=he):he=e[88];let ge;e[89]!==oe||e[90]!==he?(ge=t.jsxs(Wt,{children:[oe,he]}),e[89]=oe,e[90]=he,e[91]=ge):ge=e[91];let ve;e[92]!==g||e[93]!==N.isPending||e[94]!==ge?(ve=t.jsxs(Gt,{value:g,onValueChange:de,disabled:Le,children:[fe,ge]}),e[92]=g,e[93]=N.isPending,e[94]=ge,e[95]=ve):ve=e[95];let Se;e[96]!==g||e[97]!==s?(Se=s(g==="build"?"mainPanelTabs.hostingTab.secretScopeBuildHint":"mainPanelTabs.hostingTab.secretScopeRuntimeHint"),e[96]=g,e[97]=s,e[98]=Se):Se=e[98];let xe;e[99]!==Se?(xe=t.jsx("p",{className:"text-xs text-muted-foreground",children:Se}),e[99]=Se,e[100]=xe):xe=e[100];let re;e[101]!==ae||e[102]!==ve||e[103]!==xe?(re=t.jsxs("div",{className:"flex flex-col gap-2",children:[ae,ve,xe]}),e[101]=ae,e[102]=ve,e[103]=xe,e[104]=re):re=e[104];let be;e[105]===Symbol.for("react.memo_cache_sentinel")?(be=()=>x(!1),e[105]=be):be=e[105];const _e=N.isPending;let V;e[106]!==s?(V=s("mainPanelTabs.hostingTab.cancel"),e[106]=s,e[107]=V):V=e[107];let se;e[108]!==N.isPending||e[109]!==V?(se=t.jsx(Ue,{variant:"outline",type:"button",onClick:be,disabled:_e,children:V}),e[108]=N.isPending,e[109]=V,e[110]=se):se=e[110];let we;e[111]!==d||e[112]!==f||e[113]!==N.isPending?(we=N.isPending||!d.trim()||!f,e[111]=d,e[112]=f,e[113]=N.isPending,e[114]=we):we=e[114];let je;e[115]!==N.isPending||e[116]!==s?(je=N.isPending?s("mainPanelTabs.hostingTab.saving"):s("mainPanelTabs.hostingTab.add"),e[115]=N.isPending,e[116]=s,e[117]=je):je=e[117];let ke;e[118]!==we||e[119]!==je?(ke=t.jsx(Ue,{type:"submit",disabled:we,children:je}),e[118]=we,e[119]=je,e[120]=ke):ke=e[120];let He;e[121]!==se||e[122]!==ke?(He=t.jsxs(wt,{children:[se,ke]}),e[121]=se,e[122]=ke,e[123]=He):He=e[123];let We;e[124]!==F||e[125]!==Y||e[126]!==pe||e[127]!==re||e[128]!==He?(We=t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:F,children:[Y,pe,re,He]}),e[124]=F,e[125]=Y,e[126]=pe,e[127]=re,e[128]=He,e[129]=We):We=e[129];let Ee;e[130]!==W||e[131]!==We?(Ee=t.jsxs(Dt,{className:"sm:max-w-md",children:[W,We]}),e[130]=W,e[131]=We,e[132]=Ee):Ee=e[132];let Re;e[133]!==b||e[134]!==Ee?(Re=t.jsx($t,{open:b,onOpenChange:x,children:Ee}),e[133]=b,e[134]=Ee,e[135]=Re):Re=e[135];const Me=P!=null;let Ve;e[136]===Symbol.for("react.memo_cache_sentinel")?(Ve=X=>{X||p(null)},e[136]=Ve):Ve=e[136];let ze;e[137]!==s?(ze=s("mainPanelTabs.hostingTab.confirmDeleteSecretTitle"),e[137]=s,e[138]=ze):ze=e[138];const Ye=P?.name??"";let Be;e[139]!==s||e[140]!==Ye?(Be=s("mainPanelTabs.hostingTab.confirmDeleteSecretDescription",{name:Ye}),e[139]=s,e[140]=Ye,e[141]=Be):Be=e[141];let Ae;e[142]!==s?(Ae=s("mainPanelTabs.hostingTab.deleteSecret"),e[142]=s,e[143]=Ae):Ae=e[143];let qe;e[144]!==$||e[145]!==P?(qe=()=>{P&&$.mutate(P)},e[144]=$,e[145]=P,e[146]=qe):qe=e[146];let Ie;e[147]!==$.isPending||e[148]!==Me||e[149]!==ze||e[150]!==Be||e[151]!==Ae||e[152]!==qe?(Ie=t.jsx(Et,{open:Me,onOpenChange:Ve,title:ze,description:Be,confirmLabel:Ae,pending:$.isPending,onConfirm:qe}),e[147]=$.isPending,e[148]=Me,e[149]=ze,e[150]=Be,e[151]=Ae,e[152]=qe,e[153]=Ie):Ie=e[153];let Ke;return e[154]!==C||e[155]!==Q||e[156]!==J||e[157]!==Re||e[158]!==Ie?(Ke=t.jsxs(bt,{title:C,actions:Q,children:[J,Re,Ie]}),e[154]=C,e[155]=Q,e[156]=J,e[157]=Re,e[158]=Ie,e[159]=Ke):Ke=e[159],Ke}function Ln(r){return ce.error(ft(r))}function _n(r){return ce.error(ft(r))}const kn=3e4,En=8;function Rn(r){return r==="deploys"||r==="domains"||r==="variables"}function zn(r){const e=ee.c(95),{virtualMcpId:i}=r,l=ye(),{org:o}=xs(),a=qt(i),c=bs(a),m=!!c,s=c??"",n=c?`/api/${o.slug}/hosting/${encodeURIComponent(c)}`:"";let b;e[0]!==n||e[1]!==m?(b=(z,U)=>({queryKey:z,queryFn:()=>kt(`${n}${U}`),enabled:m,retry:!1,staleTime:kn}),e[0]=n,e[1]=m,e[2]=b):b=e[2];const x=b,[d,u]=te.useState("deploys"),f=Ze(x(Oe.hostingDeployments(o.slug,s),"/deployments")),h=Ze(x(Oe.hostingDeploymentHistory(o.slug,s),"/deployments/history?limit=50")),g=Ze(x(Oe.hostingEnv(o.slug,s),"/env")),S=Ze(x(Oe.hostingSecrets(o.slug,s),"/secrets")),P=Ze(x(Oe.hostingDomains(o.slug,s),"/domains"));if(!c){let z;e[3]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Tt,{className:"size-5"}),e[3]=z):z=e[3];let U;e[4]!==l?(U=l("mainPanelTabs.hostingTab.noSiteTitle"),e[4]=l,e[5]=U):U=e[5];let G;e[6]!==l?(G=l("mainPanelTabs.hostingTab.noSiteDescription"),e[6]=l,e[7]=G):G=e[7];let Y;return e[8]!==U||e[9]!==G?(Y=t.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:t.jsx(Xe,{icon:z,title:U,description:G})}),e[8]=U,e[9]=G,e[10]=Y):Y=e[10],Y}if(gt(f.error)&&gt(g.error)){let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Tt,{className:"size-5"}),e[11]=z):z=e[11];let U;e[12]!==l?(U=l("mainPanelTabs.hostingTab.notConnectedTitle"),e[12]=l,e[13]=U):U=e[13];let G;e[14]!==l?(G=l("mainPanelTabs.hostingTab.notConnectedDescription"),e[14]=l,e[15]=G):G=e[15];let Y;return e[16]!==U||e[17]!==G?(Y=t.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:t.jsx(Xe,{icon:z,title:U,description:G})}),e[16]=U,e[17]=G,e[18]=Y):Y=e[18],Y}let p,T,y;e[19]!==f.data?(p=et(f.data,"items").find(An),T=p?.servingUrl??null,y=T?T.replace(/^https?:\/\//,"").replace(/\/$/,""):null,e[19]=f.data,e[20]=p,e[21]=T,e[22]=y):(p=e[20],T=e[21],y=e[22]);const w=y,v=P.data;let j;e[23]!==l?(j=l("mainPanelTabs.hostingTab.viewsLabel"),e[23]=l,e[24]=j):j=e[24];let N;e[25]!==u?(N=z=>{Rn(z)&&u(z)},e[25]=u,e[26]=N):N=e[26];let _;e[27]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ct,{}),e[27]=_):_=e[27];let k;e[28]!==l?(k=l("mainPanelTabs.hostingTab.tabDeploys"),e[28]=l,e[29]=k):k=e[29];let R;e[30]!==k?(R=t.jsxs(zt,{value:"deploys",children:[_,k]}),e[30]=k,e[31]=R):R=e[31];let $;e[32]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ms,{}),e[32]=$):$=e[32];let H;e[33]!==l?(H=l("mainPanelTabs.hostingTab.domains"),e[33]=l,e[34]=H):H=e[34];let A;e[35]!==H?(A=t.jsxs(zt,{value:"domains",children:[$,H]}),e[35]=H,e[36]=A):A=e[36];let I;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(qs,{}),e[37]=I):I=e[37];let L;e[38]!==l?(L=l("mainPanelTabs.hostingTab.tabVariables"),e[38]=l,e[39]=L):L=e[39];let O;e[40]!==L?(O=t.jsxs(zt,{value:"variables",children:[I,L]}),e[40]=L,e[41]=O):O=e[41];let B;e[42]!==A||e[43]!==O||e[44]!==j||e[45]!==N||e[46]!==R||e[47]!==d?(B=t.jsxs(tn,{type:"single",variant:"segmented",size:"sm",value:d,"aria-label":j,onValueChange:N,children:[R,A,O]}),e[42]=A,e[43]=O,e[44]=j,e[45]=N,e[46]=R,e[47]=d,e[48]=B):B=e[48];let M;e[49]!==w||e[50]!==T?(M=T&&w&&t.jsxs("a",{href:T,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground hover:underline",children:[w,t.jsx(yt,{className:"size-3"})]}),e[49]=w,e[50]=T,e[51]=M):M=e[51];let C;e[52]!==n||e[53]!==p||e[54]!==o.slug||e[55]!==c?(C=!p&&t.jsx(Zt,{base:n,orgSlug:o.slug,site:c}),e[52]=n,e[53]=p,e[54]=o.slug,e[55]=c,e[56]=C):C=e[56];let Q;e[57]!==M||e[58]!==C?(Q=t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[M,C]}),e[57]=M,e[58]=C,e[59]=Q):Q=e[59];let J;e[60]!==B||e[61]!==Q?(J=t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-3 px-4 pb-2 pt-4",children:[B,Q]}),e[60]=B,e[61]=Q,e[62]=J):J=e[62];let D;e[63]!==n||e[64]!==f.error||e[65]!==f.isLoading||e[66]!==h||e[67]!==p||e[68]!==o.slug||e[69]!==c||e[70]!==d?(D=d==="deploys"&&t.jsx(Fn,{base:n,orgSlug:o.slug,site:c,live:p,deploymentsLoading:f.isLoading,deploymentsError:f.error,history:et(h.data,"items"),historyLoading:h.isLoading,historyError:h.error}),e[63]=n,e[64]=f.error,e[65]=f.isLoading,e[66]=h,e[67]=p,e[68]=o.slug,e[69]=c,e[70]=d,e[71]=D):D=e[71];let W;e[72]!==n||e[73]!==v?.dnsTemplate||e[74]!==v?.items||e[75]!==P.error||e[76]!==P.isLoading||e[77]!==o.slug||e[78]!==c||e[79]!==d?(W=d==="domains"&&t.jsx(Ft,{children:t.jsx($s,{base:n,orgSlug:o.slug,site:c,domains:v?.items??[],dnsTemplate:v?.dnsTemplate??[],isLoading:P.isLoading,error:P.error})}),e[72]=n,e[73]=v?.dnsTemplate,e[74]=v?.items,e[75]=P.error,e[76]=P.isLoading,e[77]=o.slug,e[78]=c,e[79]=d,e[80]=W):W=e[80];let F;e[81]!==n||e[82]!==g||e[83]!==o.slug||e[84]!==S||e[85]!==c||e[86]!==d?(F=d==="variables"&&t.jsxs(Ft,{children:[t.jsx(Ls,{base:n,orgSlug:o.slug,site:c,envVars:et(g.data,"vars"),codeVars:et(g.data,"codeVars"),isLoading:g.isLoading,error:g.error}),t.jsx(_s,{base:n,orgSlug:o.slug,site:c,secrets:et(S.data,"secrets"),isLoading:S.isLoading,error:S.error})]}),e[81]=n,e[82]=g,e[83]=o.slug,e[84]=S,e[85]=c,e[86]=d,e[87]=F):F=e[87];let E;e[88]!==D||e[89]!==W||e[90]!==F?(E=t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-1 pb-8",children:t.jsxs("div",{className:"w-full",children:[D,W,F]})}),e[88]=D,e[89]=W,e[90]=F,e[91]=E):E=e[91];let q;return e[92]!==J||e[93]!==E?(q=t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[J,E]}),e[92]=J,e[93]=E,e[94]=q):q=e[94],q}function An(r){return r.up===!0}function Fn(r){const e=ee.c(34),{base:i,orgSlug:l,site:o,live:a,deploymentsLoading:c,deploymentsError:m,history:s,historyLoading:n,historyError:b}=r,x=ye(),[d,u]=te.useState(En),[f,h]=te.useState(null);let g,S,P;if(e[0]!==i||e[1]!==m||e[2]!==c||e[3]!==s||e[4]!==b||e[5]!==d||e[6]!==n||e[7]!==a||e[8]!==l||e[9]!==o||e[10]!==x){const w=s.slice(0,d),v=s.length-w.length,j=a?.commitSha??null;let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=function(R,$){R&&h({commit:R,env:$??"production"})},e[14]=N):N=e[14];const _=N;g="flex flex-col gap-4",e[15]!==i||e[16]!==m||e[17]!==c||e[18]!==a||e[19]!==l||e[20]!==o||e[21]!==x?(S=c?t.jsx(dt,{rows:1}):m?t.jsx(Ne,{children:t.jsx(tt,{children:x("mainPanelTabs.hostingTab.deploymentsError")})}):a?t.jsx(Hn,{base:i,orgSlug:l,site:o,live:a}):t.jsx(Ne,{children:t.jsx(Xe,{icon:t.jsx(ct,{className:"size-5"}),title:x("mainPanelTabs.hostingTab.noLiveDeploy"),description:x("mainPanelTabs.hostingTab.noLiveDeployDescription"),size:"inline"})}),e[15]=i,e[16]=m,e[17]=c,e[18]=a,e[19]=l,e[20]=o,e[21]=x,e[22]=S):S=e[22],P=n?t.jsx(dt,{}):b?t.jsx(Ne,{children:t.jsx(tt,{children:x("mainPanelTabs.hostingTab.deployHistoryError")})}):s.length===0?a?t.jsx(Ne,{children:t.jsx(tt,{children:x("mainPanelTabs.hostingTab.noDeployHistory")})}):null:t.jsxs(Ne,{children:[w.map(k=>t.jsx(On,{event:k,isLive:!!j&&k.commitSha===j,onLogs:()=>_(k.commitSha,k.env)},k.id)),v>0&&t.jsx("div",{className:"flex justify-center p-2",children:t.jsx(Ue,{variant:"ghost",size:"sm",onClick:()=>u(s.length),children:x("mainPanelTabs.hostingTab.showMoreHistory",{count:String(v)})})})]}),e[0]=i,e[1]=m,e[2]=c,e[3]=s,e[4]=b,e[5]=d,e[6]=n,e[7]=a,e[8]=l,e[9]=o,e[10]=x,e[11]=g,e[12]=S,e[13]=P}else g=e[11],S=e[12],P=e[13];let p;e[23]===Symbol.for("react.memo_cache_sentinel")?(p=w=>{w||h(null)},e[23]=p):p=e[23];let T;e[24]!==i||e[25]!==f||e[26]!==l||e[27]!==o?(T=t.jsx(Cs,{base:i,orgSlug:l,site:o,target:f,onOpenChange:p}),e[24]=i,e[25]=f,e[26]=l,e[27]=o,e[28]=T):T=e[28];let y;return e[29]!==g||e[30]!==S||e[31]!==P||e[32]!==T?(y=t.jsxs("div",{className:g,children:[S,P,T]}),e[29]=g,e[30]=S,e[31]=P,e[32]=T,e[33]=y):y=e[33],y}function ks(r){return r?r.slice(0,7):"—"}function Hn(r){const e=ee.c(39),{base:i,orgSlug:l,site:o,live:a}=r,c=ye();let m;e[0]!==a.framework?(m=vt(a.framework),e[0]=a.framework,e[1]=m):m=e[1];const s=a.finishedAt??a.startedAt??a.createdAt;let n;e[2]!==s?(n=St(s),e[2]=s,e[3]=n):n=e[3];let b;e[4]!==a.durationMs||e[5]!==c?(b=a.durationMs!=null?c("mainPanelTabs.hostingTab.buildTook",{duration:ys(a.durationMs)}):null,e[4]=a.durationMs,e[5]=c,e[6]=b):b=e[6];let x;e[7]!==m||e[8]!==n||e[9]!==b?(x=[m,n,b].filter(Boolean),e[7]=m,e[8]=n,e[9]=b,e[10]=x):x=e[10];const d=x;let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-success/10 text-success",children:t.jsx(ct,{className:"size-5"})}),e[11]=u):u=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[12]=f):f=e[12];let h;e[13]!==c?(h=c("mainPanelTabs.hostingTab.liveInProduction"),e[13]=c,e[14]=h):h=e[14];let g;e[15]!==h?(g=t.jsxs("p",{className:"flex items-center gap-1.5 text-xs font-medium text-success",children:[f,h]}),e[15]=h,e[16]=g):g=e[16];let S;e[17]!==a.commitSha||e[18]!==a.shortCommit||e[19]!==c?(S=c("mainPanelTabs.hostingTab.commitTitle",{sha:a.shortCommit??ks(a.commitSha)}),e[17]=a.commitSha,e[18]=a.shortCommit,e[19]=c,e[20]=S):S=e[20];let P;e[21]!==S?(P=t.jsx("p",{className:"truncate text-sm font-semibold",children:S}),e[21]=S,e[22]=P):P=e[22];const p=d.join(" · ");let T;e[23]!==p?(T=t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:p}),e[23]=p,e[24]=T):T=e[24];let y;e[25]!==P||e[26]!==T||e[27]!==g?(y=t.jsxs("div",{className:"min-w-0 flex-1",children:[g,P,T]}),e[25]=P,e[26]=T,e[27]=g,e[28]=y):y=e[28];let w;e[29]!==c?(w=c("mainPanelTabs.hostingTab.actionRedeploy"),e[29]=c,e[30]=w):w=e[30];let v;e[31]!==i||e[32]!==l||e[33]!==o||e[34]!==w?(v=t.jsx(Zt,{base:i,orgSlug:l,site:o,variant:"outline",label:w}),e[31]=i,e[32]=l,e[33]=o,e[34]=w,e[35]=v):v=e[35];let j;return e[36]!==y||e[37]!==v?(j=t.jsxs("div",{className:"flex items-center gap-4 rounded-xl border border-border bg-card p-4 shadow-edge",children:[u,y,v]}),e[36]=y,e[37]=v,e[38]=j):j=e[38],j}function Vn(r,e){const i=(r.type??"").toLowerCase();if(i==="build")return e("mainPanelTabs.hostingTab.typeBuild");if(i==="fast-deploy")return e("mainPanelTabs.hostingTab.typeFastDeploy");if(i==="deploy")return e("mainPanelTabs.hostingTab.typeDeploy");const l=(r.action??"").toLowerCase();return l.includes("rollback")?e("mainPanelTabs.hostingTab.actionRollback"):l.includes("redeploy")?e("mainPanelTabs.hostingTab.actionRedeploy"):e("mainPanelTabs.hostingTab.actionDeploy")}function Bn(r,e){const i=(r.outcome??"").toLowerCase();return i==="failure"?"failed":i==="pending"?"pending":e?"live":i==="success"?"ready":"unknown"}function On(r){const e=ee.c(69),{event:i,isLive:l,onLogs:o}=r,a=ye();let c;e[0]!==i||e[1]!==l?(c=Bn(i,l),e[0]=i,e[1]=l,e[2]=c):c=e[2];const m=c,s=i.env??"production";let n;e[3]!==s?(n=s.toLowerCase(),e[3]=s,e[4]=n):n=e[4];const b=n;let x;e[5]!==a?(x=a("mainPanelTabs.hostingTab.live"),e[5]=a,e[6]=x):x=e[6];let d;e[7]!==a?(d=a("mainPanelTabs.hostingTab.statusReady"),e[7]=a,e[8]=d):d=e[8];let u;e[9]!==a?(u=a("mainPanelTabs.hostingTab.statusFailed"),e[9]=a,e[10]=u):u=e[10];let f;e[11]!==a?(f=a("mainPanelTabs.hostingTab.statusInProgress"),e[11]=a,e[12]=f):f=e[12];let h;e[13]!==x||e[14]!==d||e[15]!==u||e[16]!==f?(h={live:x,ready:d,failed:u,pending:f,unknown:"—"},e[13]=x,e[14]=d,e[15]=u,e[16]=f,e[17]=h):h=e[17];const g=h[m],S=m==="live"&&"bg-success",P=m==="ready"&&"bg-muted-foreground/40",p=m==="failed"&&"bg-destructive",T=m==="pending"&&"animate-pulse bg-warning",y=m==="unknown"&&"bg-muted-foreground/20";let w;e[18]!==P||e[19]!==p||e[20]!==T||e[21]!==y||e[22]!==S?(w=ut("size-2 shrink-0 rounded-full",S,P,p,T,y),e[18]=P,e[19]=p,e[20]=T,e[21]=y,e[22]=S,e[23]=w):w=e[23];let v;e[24]!==w?(v=t.jsx("span",{"aria-hidden":!0,className:w}),e[24]=w,e[25]=v):v=e[25];let j;e[26]!==i||e[27]!==a?(j=Vn(i,a),e[26]=i,e[27]=a,e[28]=j):j=e[28];let N;e[29]!==i.commitSha?(N=ks(i.commitSha),e[29]=i.commitSha,e[30]=N):N=e[30];let _;e[31]!==N?(_=t.jsx("span",{className:"font-mono text-xs font-normal text-muted-foreground",children:N}),e[31]=N,e[32]=_):_=e[32];let k;e[33]!==j||e[34]!==_?(k=t.jsxs("p",{className:"truncate text-sm font-medium",children:[j," ",_]}),e[33]=j,e[34]=_,e[35]=k):k=e[35];const R=i.actor;let $;e[36]!==i.createdAt?($=St(i.createdAt),e[36]=i.createdAt,e[37]=$):$=e[37];let H;e[38]!==i.actor||e[39]!==$?(H=[R,$].filter(Boolean),e[38]=i.actor,e[39]=$,e[40]=H):H=e[40];const A=H.join(" · ");let I;e[41]!==A?(I=t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:A}),e[41]=A,e[42]=I):I=e[42];let L;e[43]!==k||e[44]!==I?(L=t.jsxs("div",{className:"min-w-0 flex-1",children:[k,I]}),e[43]=k,e[44]=I,e[45]=L):L=e[45];const O=b==="production"?"secondary":"outline";let B;e[46]!==b||e[47]!==i.env||e[48]!==a?(B=b==="production"?a("mainPanelTabs.hostingTab.production"):b==="preview"?a("mainPanelTabs.hostingTab.preview"):i.env,e[46]=b,e[47]=i.env,e[48]=a,e[49]=B):B=e[49];let M;e[50]!==O||e[51]!==B?(M=t.jsx(Ce,{variant:O,children:B}),e[50]=O,e[51]=B,e[52]=M):M=e[52];const C=m==="live"&&"font-medium text-success",Q=m==="failed"&&"font-medium text-destructive",J=(m==="ready"||m==="pending"||m==="unknown")&&"text-muted-foreground";let D;e[53]!==C||e[54]!==Q||e[55]!==J?(D=ut("w-24 shrink-0 text-xs",C,Q,J),e[53]=C,e[54]=Q,e[55]=J,e[56]=D):D=e[56];let W;e[57]!==g||e[58]!==D?(W=t.jsx("span",{className:D,children:g}),e[57]=g,e[58]=D,e[59]=W):W=e[59];let F;e[60]!==i.commitSha||e[61]!==o?(F=t.jsx(Mt,{commit:i.commitSha,onClick:o}),e[60]=i.commitSha,e[61]=o,e[62]=F):F=e[62];let E;return e[63]!==v||e[64]!==L||e[65]!==M||e[66]!==W||e[67]!==F?(E=t.jsxs(pt,{className:"py-3",children:[v,L,M,W,F]}),e[63]=v,e[64]=L,e[65]=M,e[66]=W,e[67]=F,e[68]=E):E=e[68],E}function Mn(r){const e=ee.c(6),{type:i}=r,l=ye(),o=i==="permanent"?"secondary":"outline";let a;e[0]!==l||e[1]!==i?(a=l(i==="permanent"?"mainPanelTabs.hostingTab.permanent":"mainPanelTabs.hostingTab.temporary"),e[0]=l,e[1]=i,e[2]=a):a=e[2];let c;return e[3]!==o||e[4]!==a?(c=t.jsx(Ce,{variant:o,children:a}),e[3]=o,e[4]=a,e[5]=c):c=e[5],c}function qn(r){const e=ee.c(163),{base:i,orgSlug:l,site:o,redirects:a,isLoading:c,error:m}=r,s=ye(),n=jt(),[b,x]=te.useState(!1),[d,u]=te.useState(null),[f,h]=te.useState(""),[g,S]=te.useState(""),[P,p]=te.useState("permanent"),[T,y]=te.useState(null),[w,v]=te.useState(null);let j;e[0]!==l||e[1]!==n||e[2]!==o?(j=()=>n.invalidateQueries({queryKey:Oe.hostingRedirects(l,o)}),e[0]=l,e[1]=n,e[2]=o,e[3]=j):j=e[3];const N=j;let _;e[4]!==i?(_=Z=>mt(`${i}/redirects`,"PUT",Z),e[4]=i,e[5]=_):_=e[5];let k;e[6]!==N||e[7]!==s?(k=()=>{N(),ce.success(s("mainPanelTabs.hostingTab.toastRedirectSaved")),x(!1)},e[6]=N,e[7]=s,e[8]=k):k=e[8];let R;e[9]!==_||e[10]!==k?(R={mutationFn:_,onSuccess:k,onError:Qn},e[9]=_,e[10]=k,e[11]=R):R=e[11];const $=rt(R);let H;e[12]!==i?(H=Z=>mt(`${i}/redirects/${encodeURIComponent(Z)}`,"DELETE"),e[12]=i,e[13]=H):H=e[13];let A;e[14]!==N||e[15]!==s?(A=()=>{N(),ce.success(s("mainPanelTabs.hostingTab.toastRedirectDeleted")),y(null)},e[14]=N,e[15]=s,e[16]=A):A=e[16];let I;e[17]!==H||e[18]!==A?(I={mutationFn:H,onSuccess:A,onError:In},e[17]=H,e[18]=A,e[19]=I):I=e[19];const L=rt(I);let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{u(null),h(""),S(""),p("permanent"),x(!0)},e[20]=O):O=e[20];const B=O;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=Z=>{u(Z.from),h(Z.from),S(Z.to),p(Z.type==="temporary"?"temporary":"permanent"),x(!0)},e[21]=M):M=e[21];const C=M;let Q;e[22]!==f||e[23]!==g||e[24]!==P||e[25]!==$||e[26]!==s?(Q=()=>{const Z=f.trim(),Pt=g.trim();if(!Z||!Pt){ce.error(s("mainPanelTabs.hostingTab.errorRedirectFieldsRequired"));return}$.mutate({from:Z,to:Pt,type:P})},e[22]=f,e[23]=g,e[24]=P,e[25]=$,e[26]=s,e[27]=Q):Q=e[27];const J=Q;let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Lt,{}),e[28]=D):D=e[28];let W;e[29]!==s?(W=s("mainPanelTabs.hostingTab.addRedirect"),e[29]=s,e[30]=W):W=e[30];let F;e[31]!==W?(F=t.jsxs(Ue,{size:"sm",variant:"outline",onClick:B,children:[D,W]}),e[31]=W,e[32]=F):F=e[32];const E=F;let q;e[33]!==s?(q=s("mainPanelTabs.hostingTab.redirects"),e[33]=s,e[34]=q):q=e[34];const z=a.length>0?E:void 0;let U;e[35]!==E||e[36]!==L.isPending||e[37]!==w||e[38]!==m||e[39]!==c||e[40]!==$.isPending||e[41]!==a||e[42]!==s?(U=c?t.jsx(dt,{}):m?t.jsx(Ne,{children:t.jsx(tt,{children:s("mainPanelTabs.hostingTab.redirectsError")})}):a.length===0?t.jsx(Ne,{children:t.jsx(Xe,{icon:t.jsx(ns,{className:"size-5"}),title:s("mainPanelTabs.hostingTab.noRedirects"),className:"py-10",buttonComponent:E})}):t.jsx(Ne,{children:a.map((Z,Pt)=>{const Xt=is(Z.from),Rt=w===Z.from;return t.jsxs("div",{children:[t.jsxs(pt,{children:[Xt?t.jsx(Jt,{open:Rt,onClick:()=>v(Rt?null:Z.from)}):t.jsx(ns,{className:"size-4 shrink-0 text-muted-foreground/60"}),t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 font-mono text-xs",children:[t.jsx("span",{className:"truncate",children:Z.from}),t.jsx(sn,{className:"size-3.5 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"truncate text-muted-foreground",children:Z.to})]}),t.jsx(Mn,{type:Z.type}),t.jsx(nt,{label:s("mainPanelTabs.hostingTab.editRedirect"),onClick:()=>C(Z),disabled:$.isPending,className:"text-muted-foreground",children:t.jsx(Is,{})}),t.jsx(nt,{label:s("mainPanelTabs.hostingTab.deleteRedirect"),onClick:()=>y(Z.from),disabled:L.isPending,className:"-ml-1 text-muted-foreground",children:t.jsx(_t,{})})]}),Xt&&t.jsx(Ss,{open:Rt,children:t.jsx(ls,{from:Z.from,source:Z.source})})]},Z.id??`${Z.from}-${Pt}`)})}),e[35]=E,e[36]=L.isPending,e[37]=w,e[38]=m,e[39]=c,e[40]=$.isPending,e[41]=a,e[42]=s,e[43]=U):U=e[43];let G;e[44]!==d||e[45]!==s?(G=d!=null?s("mainPanelTabs.hostingTab.editRedirectTitle"):s("mainPanelTabs.hostingTab.addRedirectTitle"),e[44]=d,e[45]=s,e[46]=G):G=e[46];let Y;e[47]!==G?(Y=t.jsx(Nt,{children:t.jsx(Ct,{children:G})}),e[47]=G,e[48]=Y):Y=e[48];let ne;e[49]!==J?(ne=Z=>{Z.preventDefault(),J()},e[49]=J,e[50]=ne):ne=e[50];let ie;e[51]!==s?(ie=s("mainPanelTabs.hostingTab.colFrom"),e[51]=s,e[52]=ie):ie=e[52];let Pe;e[53]!==ie?(Pe=t.jsx(st,{htmlFor:"redirect-from",children:ie}),e[53]=ie,e[54]=Pe):Pe=e[54];let $e;e[55]!==s?($e=s("mainPanelTabs.hostingTab.redirectFromPlaceholder"),e[55]=s,e[56]=$e):$e=e[56];let me;e[57]===Symbol.for("react.memo_cache_sentinel")?(me=Z=>h(Z.target.value),e[57]=me):me=e[57];const pe=d!=null||$.isPending;let le;e[58]!==f||e[59]!==$e||e[60]!==pe?(le=t.jsx(ot,{id:"redirect-from",placeholder:$e,value:f,onChange:me,className:"font-mono text-xs",disabled:pe}),e[58]=f,e[59]=$e,e[60]=pe,e[61]=le):le=e[61];let ae;e[62]!==Pe||e[63]!==le?(ae=t.jsxs("div",{className:"flex flex-col gap-2",children:[Pe,le]}),e[62]=Pe,e[63]=le,e[64]=ae):ae=e[64];let de;e[65]!==s?(de=s("mainPanelTabs.hostingTab.colTo"),e[65]=s,e[66]=de):de=e[66];let Le;e[67]!==de?(Le=t.jsx(st,{htmlFor:"redirect-to",children:de}),e[67]=de,e[68]=Le):Le=e[68];let fe;e[69]!==s?(fe=s("mainPanelTabs.hostingTab.redirectToPlaceholder"),e[69]=s,e[70]=fe):fe=e[70];let ue;e[71]===Symbol.for("react.memo_cache_sentinel")?(ue=Z=>S(Z.target.value),e[71]=ue):ue=e[71];let oe;e[72]!==g||e[73]!==$.isPending||e[74]!==fe?(oe=t.jsx(ot,{id:"redirect-to",placeholder:fe,value:g,onChange:ue,className:"font-mono text-xs",disabled:$.isPending}),e[72]=g,e[73]=$.isPending,e[74]=fe,e[75]=oe):oe=e[75];let Te;e[76]!==Le||e[77]!==oe?(Te=t.jsxs("div",{className:"flex flex-col gap-2",children:[Le,oe]}),e[76]=Le,e[77]=oe,e[78]=Te):Te=e[78];let he;e[79]!==s?(he=s("mainPanelTabs.hostingTab.colType"),e[79]=s,e[80]=he):he=e[80];let ge;e[81]!==he?(ge=t.jsx(st,{children:he}),e[81]=he,e[82]=ge):ge=e[82];let ve;e[83]===Symbol.for("react.memo_cache_sentinel")?(ve=Z=>p(Z==="temporary"?"temporary":"permanent"),e[83]=ve):ve=e[83];const Se=$.isPending;let xe;e[84]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(Kt,{className:"w-full",children:t.jsx(Ut,{})}),e[84]=xe):xe=e[84];let re;e[85]!==s?(re=s("mainPanelTabs.hostingTab.permanent"),e[85]=s,e[86]=re):re=e[86];let be;e[87]!==re?(be=t.jsx(xt,{value:"permanent",children:re}),e[87]=re,e[88]=be):be=e[88];let _e;e[89]!==s?(_e=s("mainPanelTabs.hostingTab.temporary"),e[89]=s,e[90]=_e):_e=e[90];let V;e[91]!==_e?(V=t.jsx(xt,{value:"temporary",children:_e}),e[91]=_e,e[92]=V):V=e[92];let se;e[93]!==be||e[94]!==V?(se=t.jsxs(Wt,{children:[be,V]}),e[93]=be,e[94]=V,e[95]=se):se=e[95];let we;e[96]!==P||e[97]!==$.isPending||e[98]!==se?(we=t.jsxs(Gt,{value:P,onValueChange:ve,disabled:Se,children:[xe,se]}),e[96]=P,e[97]=$.isPending,e[98]=se,e[99]=we):we=e[99];let je;e[100]!==ge||e[101]!==we?(je=t.jsxs("div",{className:"flex flex-col gap-2",children:[ge,we]}),e[100]=ge,e[101]=we,e[102]=je):je=e[102];let ke;e[103]!==d||e[104]!==f||e[105]!==a?(ke=is(f)&&t.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3",children:t.jsx(ls,{from:f,source:a.find(Z=>Z.from===d)?.source})}),e[103]=d,e[104]=f,e[105]=a,e[106]=ke):ke=e[106];let He;e[107]===Symbol.for("react.memo_cache_sentinel")?(He=()=>x(!1),e[107]=He):He=e[107];const We=$.isPending;let Ee;e[108]!==s?(Ee=s("mainPanelTabs.hostingTab.cancel"),e[108]=s,e[109]=Ee):Ee=e[109];let Re;e[110]!==$.isPending||e[111]!==Ee?(Re=t.jsx(Ue,{variant:"outline",type:"button",onClick:He,disabled:We,children:Ee}),e[110]=$.isPending,e[111]=Ee,e[112]=Re):Re=e[112];let Me;e[113]!==f||e[114]!==g||e[115]!==$.isPending?(Me=$.isPending||!f.trim()||!g.trim(),e[113]=f,e[114]=g,e[115]=$.isPending,e[116]=Me):Me=e[116];let Ve;e[117]!==$.isPending||e[118]!==s?(Ve=$.isPending?s("mainPanelTabs.hostingTab.saving"):s("mainPanelTabs.hostingTab.save"),e[117]=$.isPending,e[118]=s,e[119]=Ve):Ve=e[119];let ze;e[120]!==Me||e[121]!==Ve?(ze=t.jsx(Ue,{type:"submit",disabled:Me,children:Ve}),e[120]=Me,e[121]=Ve,e[122]=ze):ze=e[122];let Ye;e[123]!==Re||e[124]!==ze?(Ye=t.jsxs(wt,{children:[Re,ze]}),e[123]=Re,e[124]=ze,e[125]=Ye):Ye=e[125];let Be;e[126]!==ne||e[127]!==ae||e[128]!==Te||e[129]!==je||e[130]!==ke||e[131]!==Ye?(Be=t.jsxs("form",{className:"flex flex-col gap-4",onSubmit:ne,children:[ae,Te,je,ke,Ye]}),e[126]=ne,e[127]=ae,e[128]=Te,e[129]=je,e[130]=ke,e[131]=Ye,e[132]=Be):Be=e[132];let Ae;e[133]!==Y||e[134]!==Be?(Ae=t.jsxs(Dt,{className:"sm:max-w-md",children:[Y,Be]}),e[133]=Y,e[134]=Be,e[135]=Ae):Ae=e[135];let qe;e[136]!==b||e[137]!==Ae?(qe=t.jsx($t,{open:b,onOpenChange:x,children:Ae}),e[136]=b,e[137]=Ae,e[138]=qe):qe=e[138];const Ie=T!=null;let Ke;e[139]===Symbol.for("react.memo_cache_sentinel")?(Ke=Z=>{Z||y(null)},e[139]=Ke):Ke=e[139];let X;e[140]!==s?(X=s("mainPanelTabs.hostingTab.confirmDeleteRedirectTitle"),e[140]=s,e[141]=X):X=e[141];const Je=T??"";let K;e[142]!==s||e[143]!==Je?(K=s("mainPanelTabs.hostingTab.confirmDeleteRedirectDescription",{from:Je}),e[142]=s,e[143]=Je,e[144]=K):K=e[144];let De;e[145]!==s?(De=s("mainPanelTabs.hostingTab.deleteRedirect"),e[145]=s,e[146]=De):De=e[146];let Ge;e[147]!==L||e[148]!==T?(Ge=()=>{T&&L.mutate(T)},e[147]=L,e[148]=T,e[149]=Ge):Ge=e[149];let it;e[150]!==L.isPending||e[151]!==Ie||e[152]!==X||e[153]!==K||e[154]!==De||e[155]!==Ge?(it=t.jsx(Et,{open:Ie,onOpenChange:Ke,title:X,description:K,confirmLabel:De,pending:L.isPending,onConfirm:Ge}),e[150]=L.isPending,e[151]=Ie,e[152]=X,e[153]=K,e[154]=De,e[155]=Ge,e[156]=it):it=e[156];let lt;return e[157]!==q||e[158]!==z||e[159]!==U||e[160]!==qe||e[161]!==it?(lt=t.jsxs(bt,{title:q,actions:z,children:[U,qe,it]}),e[157]=q,e[158]=z,e[159]=U,e[160]=qe,e[161]=it,e[162]=lt):lt=e[162],lt}function In(r){return ce.error(ft(r))}function Qn(r){return ce.error(ft(r))}const Un=3e4;function Kn(r){const e=ee.c(4),{virtualMcpId:i}=r,l=qt(i);if(As(l)){let a;return e[0]!==i?(a=t.jsx(zn,{virtualMcpId:i}),e[0]=i,e[1]=a):a=e[1],a}let o;return e[2]!==i?(o=t.jsx(Wn,{virtualMcpId:i}),e[2]=i,e[3]=o):o=e[3],o}function Wn(r){const e=ee.c(111),{virtualMcpId:i}=r,l=ye(),{org:o}=xs(),a=qt(i),c=bs(a),m=!!c,s=c?`/api/${o.slug}/hosting/${encodeURIComponent(c)}`:"";let n;e[0]!==s||e[1]!==m?(n=(F,E)=>({queryKey:F,queryFn:()=>kt(`${s}${E}`),enabled:m,retry:!1,staleTime:Un}),e[0]=s,e[1]=m,e[2]=n):n=e[2];const b=n,x=c??"",d=Ze(b(Oe.hostingDeployments(o.slug,x),"/deployments")),u=Ze(b(Oe.hostingEnv(o.slug,x),"/env")),f=Ze(b(Oe.hostingSecrets(o.slug,x),"/secrets")),h=Ze(b(Oe.hostingRedirects(o.slug,x),"/redirects")),g=Ze(b(Oe.hostingDomains(o.slug,x),"/domains"));if(!c){let F;e[3]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(Tt,{className:"size-5"}),e[3]=F):F=e[3];let E;e[4]!==l?(E=l("mainPanelTabs.hostingTab.noSiteTitle"),e[4]=l,e[5]=E):E=e[5];let q;e[6]!==l?(q=l("mainPanelTabs.hostingTab.noSiteDescription"),e[6]=l,e[7]=q):q=e[7];let z;return e[8]!==E||e[9]!==q?(z=t.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:t.jsx(Xe,{icon:F,title:E,description:q})}),e[8]=E,e[9]=q,e[10]=z):z=e[10],z}if(gt(d.error)&&gt(u.error)&&gt(h.error)){let F;e[11]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(Tt,{className:"size-5"}),e[11]=F):F=e[11];let E;e[12]!==l?(E=l("mainPanelTabs.hostingTab.notConnectedTitle"),e[12]=l,e[13]=E):E=e[13];let q;e[14]!==l?(q=l("mainPanelTabs.hostingTab.notConnectedDescription"),e[14]=l,e[15]=q):q=e[15];let z;return e[16]!==E||e[17]!==q?(z=t.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:t.jsx(Xe,{icon:F,title:E,description:q})}),e[16]=E,e[17]=q,e[18]=z):z=e[18],z}let P,p,T,y,w,v,j,N,_,k;if(e[19]!==d.data||e[20]!==g.data||e[21]!==u.data||e[22]!==h.data||e[23]!==f.data){p=et(d.data,"items");let F;e[34]!==u.data?(F=et(u.data,"vars"),e[34]=u.data,e[35]=F):F=e[35],w=F;let E;e[36]!==u.data?(E=et(u.data,"codeVars"),e[36]=u.data,e[37]=E):E=e[37],P=E;let q;e[38]!==f.data?(q=et(f.data,"secrets"),e[38]=f.data,e[39]=q):q=e[39],_=q;let z;e[40]!==h.data?(z=et(h.data,"items"),e[40]=h.data,e[41]=z):z=e[41],N=z;const U=g.data;let G;e[42]!==U?.items?(G=U?.items??[],e[42]=U?.items,e[43]=G):G=e[43],y=G;let Y;e[44]!==U?.dnsTemplate?(Y=U?.dnsTemplate??[],e[44]=U?.dnsTemplate,e[45]=Y):Y=e[45],T=Y;const ne=p.find(Yn);v=vt((ne??p.find(Gn))?.framework),j=ne?.servingUrl??null,k=j?j.replace(/^https?:\/\//,"").replace(/\/$/,""):null,e[19]=d.data,e[20]=g.data,e[21]=u.data,e[22]=h.data,e[23]=f.data,e[24]=P,e[25]=p,e[26]=T,e[27]=y,e[28]=w,e[29]=v,e[30]=j,e[31]=N,e[32]=_,e[33]=k}else P=e[24],p=e[25],T=e[26],y=e[27],w=e[28],v=e[29],j=e[30],N=e[31],_=e[32],k=e[33];const R=k;let $;e[46]!==s||e[47]!==o.slug||e[48]!==c?($=t.jsx(Zt,{base:s,orgSlug:o.slug,site:c}),e[46]=s,e[47]=o.slug,e[48]=c,e[49]=$):$=e[49];let H;e[50]!==l?(H=l("mainPanelTabs.hostingTab.title"),e[50]=l,e[51]=H):H=e[51];let A;e[52]!==v?(A=v&&t.jsx(Ce,{variant:"secondary",children:v}),e[52]=v,e[53]=A):A=e[53];let I;e[54]!==H||e[55]!==A?(I=t.jsxs("span",{className:"inline-flex items-center gap-2.5",children:[H,A]}),e[54]=H,e[55]=A,e[56]=I):I=e[56];let L;e[57]!==$||e[58]!==I?(L=t.jsx(ts.Title,{actions:$,children:I}),e[57]=$,e[58]=I,e[59]=L):L=e[59];let O;e[60]!==R||e[61]!==j?(O=j&&R&&t.jsx("p",{className:"flex flex-wrap items-center gap-x-1.5 text-sm text-muted-foreground",children:t.jsxs("a",{href:j,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-mono text-xs text-foreground hover:underline",children:[R,t.jsx(yt,{className:"size-3"})]})}),e[60]=R,e[61]=j,e[62]=O):O=e[62];let B;e[63]!==L||e[64]!==O?(B=t.jsxs("div",{className:"flex flex-col gap-2",children:[L,O]}),e[63]=L,e[64]=O,e[65]=B):B=e[65];let M;e[66]!==s||e[67]!==p||e[68]!==d.error||e[69]!==d.isLoading||e[70]!==m||e[71]!==o.slug||e[72]!==c?(M=t.jsx(bn,{base:s,orgSlug:o.slug,site:c,enabled:m,deployments:p,isLoading:d.isLoading,error:d.error}),e[66]=s,e[67]=p,e[68]=d.error,e[69]=d.isLoading,e[70]=m,e[71]=o.slug,e[72]=c,e[73]=M):M=e[73];let C;e[74]!==s||e[75]!==P||e[76]!==u.error||e[77]!==u.isLoading||e[78]!==w||e[79]!==o.slug||e[80]!==c?(C=t.jsx(Ls,{base:s,orgSlug:o.slug,site:c,envVars:w,codeVars:P,isLoading:u.isLoading,error:u.error}),e[74]=s,e[75]=P,e[76]=u.error,e[77]=u.isLoading,e[78]=w,e[79]=o.slug,e[80]=c,e[81]=C):C=e[81];let Q;e[82]!==s||e[83]!==o.slug||e[84]!==_||e[85]!==f.error||e[86]!==f.isLoading||e[87]!==c?(Q=t.jsx(_s,{base:s,orgSlug:o.slug,site:c,secrets:_,isLoading:f.isLoading,error:f.error}),e[82]=s,e[83]=o.slug,e[84]=_,e[85]=f.error,e[86]=f.isLoading,e[87]=c,e[88]=Q):Q=e[88];let J;e[89]!==s||e[90]!==T||e[91]!==y||e[92]!==g.error||e[93]!==g.isLoading||e[94]!==o.slug||e[95]!==c?(J=t.jsx($s,{base:s,orgSlug:o.slug,site:c,domains:y,dnsTemplate:T,isLoading:g.isLoading,error:g.error}),e[89]=s,e[90]=T,e[91]=y,e[92]=g.error,e[93]=g.isLoading,e[94]=o.slug,e[95]=c,e[96]=J):J=e[96];let D;e[97]!==s||e[98]!==o.slug||e[99]!==N||e[100]!==h.error||e[101]!==h.isLoading||e[102]!==c?(D=t.jsx(qn,{base:s,orgSlug:o.slug,site:c,redirects:N,isLoading:h.isLoading,error:h.error}),e[97]=s,e[98]=o.slug,e[99]=N,e[100]=h.error,e[101]=h.isLoading,e[102]=c,e[103]=D):D=e[103];let W;return e[104]!==M||e[105]!==C||e[106]!==Q||e[107]!==J||e[108]!==D||e[109]!==B?(W=t.jsx("div",{className:"h-full min-h-0 overflow-y-auto",children:t.jsx(ts.Container,{width:"standard",children:t.jsxs(Ft,{children:[B,M,C,Q,J,D]})})}),e[104]=M,e[105]=C,e[106]=Q,e[107]=J,e[108]=D,e[109]=B,e[110]=W):W=e[110],W}function Gn(r){return r.framework}function Yn(r){return r.up===!0}function Jn(){const r=ee.c(3),e=an(),i=ln();let l;return r[0]!==i.hosting||r[1]!==e?(l=i.hosting?t.jsx(Kn,{virtualMcpId:e}):t.jsx(nn,{virtualMcpId:e}),r[0]=i.hosting,r[1]=e,r[2]=l):l=r[2],l}function Ma(){const r=ee.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(zs.Content,{children:t.jsx(Jn,{})}),r[0]=e):e=r[0],e}export{Ma as default};