PageSourceSearch

https://app-theflowops.web.app/assets/auto-setup-DwnpVaTQ.js

js app-theflowops.web.app collected 2026-10-03 12:17:08 UTC 2,081 bytes, 1 lines download raw bytes

1import{j as e}from"./chunk-maps-BwFKK2ai.js";import{r as i}from"./chunk-state-Be9ntrKz.js";import{i as j,_ as D,j as O,aO as h,al as l,ak as v,q as I,A as o}from"./hooks-CPHcGIez.js";import{m as P,r as k,c as E}from"./pendingAutocreate-C0yzDdSi.js";import"./chunk-dnd-C-C9ODMl.js";import"./index-CVxwXLTi.js";const H=()=>{const r=j(),s=D(),[m]=O(),d=i.useRef(!1),[A,p]=i.useState(!1),c=i.useCallback(async()=>{var y;p(!1);let n;try{n=await s.fetchQuery({queryKey:["settings"],queryFn:h.get})}catch{}if(!(n!=null&&n.domain))try{const{domain:t}=await h.autoGenerateDomain();s.setQueryData(["settings"],u=>u?{...u,domain:t}:{domain:t})}catch{p(!0);return}const f=m.get("autocreate"),T=f?P(f):null,g=k(),a=T??g;if(a){g&&E();try{const t=await l.getAll(),R=((y=t==null?void 0:t.items)==null?void 0:y.some(S=>S.type==="HOMEPAGE"))??!1?"RETREAT":"HOMEPAGE",b=await l.getDefaultData(a),N=v.transform(b,a),x=await l.create({...N,type:R});await s.refetchQueries({queryKey:["userRetreat",x.retreatUrl]}),r(I(o.SITE_EDITOR,{url:x.retreatUrl}),{replace:!0});return}catch{}}const w=a?`${o.MY_SITE_TEMPLATE}?autocreate=${encodeURIComponent(a)}`:o.ONBOARDING_START;r(w,{replace:!0})},[r,s,m]);return i.useEffect(()=>{d.current||(d.current=!0,c())},[c]),A?e.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center bg-white gap-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Something went wrong setting up your workspace."}),e.jsx("button",{className:"px-4 py-2 text-sm bg-gray-900 text-white rounded-md hover:bg-gray-700",onClick:()=>void c(),children:"Try again"}),e.jsx("button",{className:"px-4 py-2 text-sm text-gray-500 underline",onClick:()=>{E(),r(o.ONBOARDING_DOMAIN_SETUP,{replace:!0})},children:"Set up manually"})]}):e.jsxs("div",{className:"fixed inset-0 flex flex-col items-center justify-center bg-white gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full border-4 border-gray-200 border-t-gray-800 animate-spin"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Setting up your workspace…"})]})};export{H as default};

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.