PageSourceSearch

https://cloudmysite.ai/assets/PublishDialog-BFD8pRoX.js

js cloudmysite.ai collected 2026-10-05 15:12:44 UTC 16,261 bytes, 1 lines download raw bytes

1import{r as o,j as e}from"./jsx-runtime-C2UBfbyc.js";import{R as Ce,P as Re,O as Ee,C as $e,T as Te,D as Le}from"./index-CAsT1rfk.js";import{B as m}from"./react-toastify.esm-DcR-pTER.js";import{i as Ue,A as le,g as Me,r as Ie}from"./sessionErrors-COH7wBoA.js";import{i as Oe}from"./Chat.client-D3wYdePh.js";import{a as H}from"./auth-BYwTrny6.js";import{g as $}from"./workbench-DVZ8UPcc.js";import"./index-DTbehiYO.js";import"./index-SgDwteQq.js";import"./amplify_outputs-ByhBuvRU.js";import"./clsx-B-dksMZM.js";import"./resume-DQ2pc8eQ.js";import"./index-Ctn5E0jf.js";import"./contract-C8_2XbhZ.js";import"./logger-AqfA_hXV.js";import"./chat-YAQO4n_L.js";import"./index-CHoi3jgE.js";import"./index-DgoachrA.js";import"./artifactTitle-DNRdmHz0.js";import"./authenticated-chat-Yvg3yA_B.js";import"./aiWorkspace-DNQ8NOJn.js";import"./sync-DtNvzS6k.js";import"./HostedSignInButtons-BY3xXxUD.js";import"./API-DAFHaofH.js";import"./index-qtUc8lsi.js";import"./usePromptEnhancer-5VnOEynm.js";import"./pendingDashboardPromptAttachments-BmaqZ4u2.js";import"./Dropdown-Dgl1XgmV.js";import"./index-D2RkbEbt.js";import"./index-CdmNQeNf.js";import"./classNames-D4DIdros.js";import"./supportLinks-D1aYQK4l.js";import"./proxy-gn4uqtVm.js";import"./BillingExperience-D-K1LAVQ.js";import"./service-D1r3_DgS.js";import"./createLucideIcon-C_AYRPVT.js";import"./video-CFxngqn5.js";import"./mic-vocal-20U2l1KN.js";import"./pricingData-DrQtaPwh.js";import"./platformPricing-tZHuNO2h.js";import"./useBillingSummary-BO9ufWot.js";import"./index-D-j07sr6.js";import"./router-CdSor0Tc.js";import"./index-DG0jpFbZ.js";import"./refresh-cw-BgmVbcS1.js";import"./gauge-DejO41ze.js";import"./credit-card-C6H2etZq.js";import"./file-text-Bq8boU8U.js";import"./circle-alert-BPTJID5T.js";import"./components-DKMMHsO5.js";import"./single-fetch-Bfr4o6AV.js";import"./shield-check-BYYH1pJ6.js";import"./search-ZlL_h0-r.js";import"./download-BNQ6jJBj.js";import"./preload-helper-CLcXU_4U.js";import"./Button-B5kdVOtM.js";import"./Dialog-DaMOFeJE.js";import"./check-6fU0F-bx.js";import"./ImageStudio-Bk7F7h1y.js";import"./clientImageAssets-BwBgCWfG.js";import"./chatMedia-Bm3yTEDP.js";import"./imageStudio-BZ6yVwsW.js";import"./Input-DTMX85Mn.js";import"./Tabs-DNJS30xw.js";import"./imagePricing-Y4dpxEcZ.js";import"./useImagePricingPlan-Ddd2NPJk.js";import"./stripIndent-OpH14_i6.js";import"./workspaceHistorySource-CW8zU1pv.js";import"./index-Bj4CZp8v.js";import"./workspacePromptLaunch-Cfzl8mao.js";import"./networkQuality-MoaFJ23-.js";import"./chatMode-nkbEUJmy.js";import"./googleDrive-2-J1c5so.js";import"./runtimeUsage-CUnLOScq.js";import"./homePromptDraft-Br7wJnvm.js";import"./mutations-Dba0hfjS.js";import"./d1RuntimeProduct-DuY39u3D.js";import"./genieWebsiteRazorpay--S7PVtZf.js";import"./homeReset-ClYxhsPV.js";import"./index-CDg6de0u.js";import"./routing-5g8LK-Iv.js";import"./ReportIssueLink-2gue2bLN.js";import"./ChatClientFallback-DRLUUO3H.js";import"./AuthWrapper-BR8lelxY.js";const w=40,De="cloudmysite-ai-app-runtime-worker",q=["Preparing your deployment package...","Uploading assets to our global regions...","Connecting the live domain route...","Running final edge checks..."];function ur({isOpen:j,onClose:de,domainSuffix:l="cloudmysite.app",zoneName:ce,onPublish:me,initialRepoName:N,initialSubdomain:K,projectId:be,primaryPublishedUrl:f,domainWorkerService:pe=De,lockDomain:y=!1,securityWarnings:S=[],securityAuditSummary:T=null,isSecurityAuditRunning:V=!1,allowPublishWithWarnings:J=!1,onReviewSecurity:X}){const[L,v]=o.useState(!1),[ue,Z]=o.useState(""),[b,Q]=o.useState(""),[h,d]=o.useState("idle"),[he,c]=o.useState(""),[a,U]=o.useState("form"),[p,M]=o.useState(""),[P,I]=o.useState(w),[xe,O]=o.useState(0),[D,W]=o.useState(!1),[ee,_]=o.useState(!1),[te,x]=o.useState(""),re=o.useRef(!1),z=o.useRef(!1),B=o.useRef(!1),se=o.useRef(0),k=S.length>0,oe=S.some(Oe),ge=((ce||l||"cloudmysite.app").replace(/^\./,"")||"cloudmysite.app").trim().toLowerCase(),C=s=>s.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,63),ae=s=>/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(s),Y=()=>{U("form"),M(""),I(w),O(0),W(!1),_(!1),z.current=!1},fe=()=>{window.setTimeout(()=>{Ie()},1200)},ye=s=>
1{try{const r=new URL(s);return r.hostname.endsWith(".cloudmysite.app")||r.hostname.endsWith(".cloudmysite.net")}catch{return!1}},ne=s=>{const r=Math.floor(s/60),t=s%60;return`${r}:${String(t).padStart(2,"0")}`},ie=()=>{if(!p.startsWith("http"))return;window.open(p,"_blank","noopener,noreferrer")||(navigator.clipboard.writeText(p).catch(()=>{}),m.info(`Published URL copied: ${p}`))},A=async s=>{const r=C(s);if(!r||!ae(r)){const t="Enter a valid subdomain using letters, numbers, and hyphens.";return d("invalid"),c(t),{available:!1,message:t}}d("checking"),c("Checking availability...");try{const t=await fetch("/api/cloudflare-subdomain",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"check",subdomain:r,workerService:pe,zoneName:ge,projectId:be})}),n=await t.json();if(!t.ok){const u=n.error||n.message||"Unable to check domain availability right now.";return d("error"),c(u),{available:!1,message:u}}if(n.available){const u=n.message||`${r}.${l} is available.`;return d("available"),c(u),{available:!0,message:u}}const E=n.message||"That domain is already taken. Please choose another one.";return d("taken"),c(E),{available:!1,message:E}}catch{const t="Unable to check domain availability right now.";return d("error"),c(t),{available:!1,message:t}}};o.useEffect(()=>{if(j&&!re.current){const s=H.get(),r=C(K?.trim()||N?.trim()||""),t=y?N?.trim()||$(r,s?.email):$(r||N?.trim(),s?.email),n=f?`Using your primary domain: ${f.replace(/^https?:\/\//i,"")}`:r?y?`Using your saved domain: ${r}.${l}`:`Using ${r}.${l}`:"";Y(),Z(t),Q(r),d("idle"),c(n)}re.current=j},[j,N,K,y,l,f]),o.useEffect(()=>{if(a!=="deploying")return;const s=window.setInterval(()=>{I(t=>t<=1?(window.clearInterval(s),_(!0),0):t-1)},1e3),r=window.setInterval(()=>{O(t=>(t+1)%q.length)},5e3);return()=>{window.clearInterval(s),window.clearInterval(r)}},[a]),o.useEffect(()=>{a==="deploying"&&(!ee||!D||U("ready"))},[a,ee,D]),o.useEffect(()=>{a!=="ready"||z.current||p.startsWith("http")&&(z.current=!0,ie())},[a,p]);async function ve(s){s.preventDefault();const r=Date.now();if(!(B.current||r-se.current<1e3)){B.current=!0,se.current=r,v(!0),x("");try{const t=C(b);if(!t||!ae(t)){d("invalid"),c("Enter a valid subdomain using letters, numbers, and hyphens."),v(!1);return}if(oe||k&&!J){v(!1),X?.(),m.warn(oe?"Blocking security issues must be fixed before publishing.":"Security advisories were detected. Review them before publishing or continue with advisory warnings.");return}const n=await A(t);if(!n.available){x(n.message),v(!1);return}const E=ue||$(t,H.get()?.email);M(f||`https://${t}.${l}`),I(w),O(0),_(!1),W(!1),U("deploying");const u=await me(E,void 0,!0,t),i=u.url;if(W(!0),u.noChanges){m.info("Site already published. No changes to publish."),i.startsWith("http")&&(window.open(i,"_blank","noopener,noreferrer")||(navigator.clipboard.writeText(i).catch(()=>{}),m.info(`Published URL copied: ${i}`))),g();return}if(m.success("Website published and verified."),i.startsWith("http")&&ye(i)){M(i);return}i.startsWith("http")&&(window.open(i,"_blank","noopener,noreferrer")||(navigator.clipboard.writeText(i).catch(()=>{}),m.info(`Published URL copied: ${i}`))),g()}catch(t){if(console.error("Error inside handleSubmit:",t),Y(),Ue(t)){x(le),m.error(le,{autoClose:!1}),fe();return}const n=Me(t,"Failed to publish website. Please try again.");x(n),m.error(n)}finally{B.current=!1,v(!1)}}}const g=()=>{Y(),x(""),de()},ke=Math.max(0,Math.min(100,(w-P)/w*100)),we=q[xe]||q[0],R=a==="deploying"&&P===0&&!D,je=k?"border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-700/60 dark:bg-amber-950/35 dark:text-amber-200":"border-emerald-300 bg-emerald-50 text-emerald-900 dark:border-emerald-700/60 dark:bg-emerald-950/35 dark:text-emerald-200",Ne=k?"border border-amber-300 bg-white text-amber-800 hover:bg-amber-100 dark:border-amber-700/70 dark:bg-amber-950/50 dark:text-amber-200 dark:hover:bg-amber-900/55":"border border-emerald-300 bg-white text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700/70 dark:bg-emerald-950/50 dark:text-emerald-200 dark:hover:bg-emerald-900/55",F=b?`https://${b}.${l}`:"",G=(f||"").trim(),Se=!!G&&G!==F;return e.jsx(Ce,{open:j,onOpenChange:s=>!s&&g(),children:e.jsxs(Re,{children:[e.jsx(Ee,{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[9999]"}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[9999]",children:e.jsxs($e,{className:"bg-white dark:bg-bolt-elements-background-depth-1 rounded-lg p-6 border border-bolt-elements-borderColor shadow-xl max-w-md w-full mx-4",children:[e.jsx(Te,{className:"sr-only",children:a==="form"?"Publish Website":"Launching Your Site"}),e.jsx(Le,{className:"sr-only",children:"Configure publish settings and launch your website."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-medium text-bolt-elements-textPrimary",children:a==="form"?"Publish Website":"Launching Your Site"}),e.jsx("button",{onClick:g,className:"p-2 rounded-lg text-bolt-elements-textTertiary hover:text-bolt-elements-textPrimary hover:bg-bolt-elements-background-depth-2",children:e.jsx("div",{className:"i-ph:x w-5 h-5"})})]}),a==="form"?e.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[e.jsx("div",{className:"text-sm text-bolt-elements-textSecondary",children:"Publish your website to make it accessible online. Your site will be automatically deployed and hosted."}),te?e.jsx("div",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm font-medium text-red-700 dark:border-red-800/70 dark:bg-red-950/30 dark:text-red-200",children:te}):null,e.jsxs("div",{className:`rounded-lg border px-3 py-2 text-sm ${je}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"font-medium",children:V?"Running security audit...":k?`${S.length} security issue${S.length===1?"":"s"} detected`:"No security issues detected"}),e.jsx("button",{type:"button",onClick:()=>X?.(),className:`rounded-md px-2 py-1 text-xs font-semibold transition-colors ${Ne}`,children:"Review Security"})]}),T?e.jsxs("div",{className:"mt-1 text-xs opacity-80",children:["Scanned ",T.scannedFileCount," files in"," ",Math.max(0,Math.round(T.durationMs)),"ms"]}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium text-bolt-elements-textPrimary",children:"Website URL:"}),e.jsxs("div",{className:"p-3 bg-bolt-elements-background-depth-2 rounded-lg border border-bolt-elements-borderColor",children:[Se?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-emerald-500/30 bg-emerald-500/10 px-2 py-1",children:[e.jsx("span",{className:"text-sm font-mono text-bolt-elements-textPrimary break-all",children:G}),e.jsx("span",{className:"ml-auto text-[11px] text-emerald-600",children:"Primary"})]}),F?e.jsxs("div",{className:"text-xs text-bolt-elements-textTertiary",children:["Fallback / preview: ",F.replace(/^https?:\/\//i,"")]}):null]}):y?e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-bolt-elements-borderColor bg-bolt-elements-background-depth-1 px-2 py-1",children:[e.jsxs("span",{className:"text-sm font-mono text-bolt-elements-textPrimary",children:[b,".",l]}),e.jsx("span",{className:"ml-auto text-[11px] text-bolt-elements-textTertiary",children:"Locked"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{value:b,onChange:s=>{const r=C(s.target.value);Q(r),Z($(r,H.get()?.email)),d("idle"),c(""),x("")},onBlur:()=>{b&&A(b)},className:"flex-1 rounded-md border border-bolt-elements-borderColor bg-bolt-elements-background-depth-1 px-2 py-1 text-sm font-mono text-bolt-elements-textPrimary focus:outline-none focus:ring-1 focus:ring-accent-500",placeholder:"your-domain",maxLength:63}),e.jsxs("span",{className:"text-sm font-mono text-bolt-elements-textPrimary",children:[".",l]})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("div",{className:"text-xs",style:{color:h==="available"?"#16a34a":h==="taken"||h==="invalid"||h==="error"?"#dc2626":"inherit"},children:he||"Pick your public subdomain."}),!y&&e.jsx("button",{type:"button",onClick:()=>void A(b),className:"rounded-md border border-bolt-elements-borderColor bg-bolt-elements-background-depth-1 px-2 py-1 text-xs text-bolt-elements-textPrimary hover:bg-bolt-elements-background-depth-3 disabled:text-bolt-elements-textTertiary",disabled:L||h==="checking",children:h==="checking"?"Checking...":"Check"})]})]})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:g,className:"flex-1 px-4 py-2 rounded-lg border border-bolt-elements-borderColor text-bolt-elements-textPrimary bg-bolt-elements-background-depth-1 hover:bg-bolt-elements-background-depth-2",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:L||V,className:"flex-1 px-4 py-2 rounded-lg bg-accent-500 text-white hover:bg-accent-600 disabled:opacity-50 disabled:cursor-not-allowed",children:L?"Publishing...":k&&!J?"Review Security":"Publish"})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-xl border border-bolt-elements-borderColor bg-bolt-elements-background-depth-2 p-4",children:e.jsxs("div",{className:"flex flex-col items-center text-center gap-3",children:[e.jsxs("div",{className:"relative h-14 w-14",children:[e.jsx("div",{className:"absolute inset-0 rounded-full bg-accent-500/20 animate-ping"}),e.jsx("div",{className:"absolute inset-0 rounded-full border border-accent-500/50 flex items-center justify-center bg-bolt-elements-background-depth-1",children:e.jsx("div",{className:a==="ready"?"i-ph:check-circle-fill text-2xl text-emerald-500":"i-ph:rocket-launch-duotone text-2xl text-accent-500 animate-bounce"})})]}),e.jsx("div",{className:"text-sm font-medium text-bolt-elements-textPrimary",children:a==="ready"?"Site published and verified. Click below to open your live site.":R?"Publishing is still in progress...":"Deploying your site globally"}),e.jsx("div",{className:"text-xs text-bolt-elements-textSecondary",children:a==="ready"?"Your site was opened in a new tab. If it did not open, use the button below.":R?"On a slow connection, building and uploading can take several minutes. Keep this dialog open.":we}),a!=="ready"?e.jsx("div",{className:"text-[11px] text-bolt-elements-textTertiary",children:R?"Still working—no action is needed.":"Deployment is usually ready in 30-40 seconds."}):null,e.jsx("div",{className:"w-full h-2 rounded-full bg-bolt-elements-background-depth-3 overflow-hidden",children:e.jsx("div",{className:"h-full bg-accent-500 transition-all duration-500",style:{width:`${ke}%`}})}),e.jsx("div",{className:"text-xs text-bolt-elements-textSecondary",children:a==="ready"?"0:00 remaining":R?"Publishing in progress":`Estimated time remaining: ${ne(P)}`})]})}),e.jsxs("div",{className:"rounded-md border border-bolt-elements-borderColor bg-bolt-elements-background-depth-2 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] text-bolt-elements-textTertiary uppercase tracking-wide mb-1",children:"Live URL"}),e.jsx("div",{className:"text-sm font-mono text-bolt-elements-textPrimary break-all",children:p})]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(p).catch(()=>{}),m.info("Published URL copied")},className:"flex-1 px-4 py-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-background-depth-1 text-bolt-elements-textPrimary hover:bg-bolt-elements-background-depth-2",children:"Copy URL"}),e.jsx("button",{type:"button",onClick:()=>{ie(),g()},disabled:a!=="ready",className:"flex-1 px-4 py-2 rounded-lg bg-accent-500 text-white hover:bg-accent-600 disabled:opacity-50 disabled:cursor-not-allowed",children:a==="ready"?"Site Published - Click Here To Open":`Open in ${ne(P)}`})]})]})]})]})})]})})}export{ur as PublishDialog};

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.