PageSourceSearch

https://app.flag50.com/_nuxt/BXlwsvL7.js

js flag50.com collected 2026-10-02 00:20:17 UTC 17,323 bytes, 1 lines download raw bytes

1import{_ as G}from"./DJdcNliN.js";import{a1 as X,by as Y,O as l,Y as c,K as e,bp as t,aM as C,R as K,N as p,X as m,bj as i,f as $,bP as R,bN as f,bG as _,M as x,bF as W,b7 as q,aA as J,b4 as g,aV as r,bc as Q,b2 as Z,H as ee}from"./DrVz_YTD.js";import{u as te}from"./hQWwy0gU.js";import{r as se}from"./C9BKGzBn.js";import{r as oe}from"./JKMWt79L.js";import{r as N}from"./CrPKnVgl.js";import{r as re}from"./yN-2_sS2.js";import{r as z}from"./BRxM1zIE.js";import{r as A}from"./CMYSMvYZ.js";import{r as ae}from"./C_ZyFZ_2.js";import{r as le}from"./CLU1kkAj.js";import{r as ie}from"./NDMYt-jT.js";import{r as I}from"./Dl5le0Rt.js";import"./BJZuE3_e.js";import"./Bfdwg2Ke.js";import"./V8PFFq63.js";import"./xcO_hOeK.js";import"./D9OshlXo.js";import"./DjwEBPp_.js";import"./BPTos7Sd.js";import"./BjVu0Sr8.js";import"./DCtVN20a.js";import"./BiaFfQVq.js";import"./Ck0JZadk.js";import"./b15ce8ka.js";import"./CP8LiM7B.js";import"./DpXT79uQ.js";import"./pg8HFmhE.js";import"./Dsg9Vr2f.js";import"./__8N_tLb.js";import"./2eekbN_6.js";import"./X9SsrHUP.js";import"./CMMJSp-V.js";import"./JGq_j5wB.js";const ne={class:"relative min-h-screen text-slate-100",style:{"background-color":"#030712"}},de={class:"relative min-h-screen px-5 py-8 pb-20 sm:px-10 lg:px-16"},ue={class:"mx-auto max-w-2xl space-y-6"},me={class:"rounded-2xl border border-white/10 bg-white/5 p-5"},ce={class:"flex items-center gap-2"},pe={key:0,class:"mt-4 space-y-4 text-sm text-slate-400"},ge={class:"rounded-3xl border border-app-border bg-app-card p-6 shadow-app-card backdrop-blur-app"},be={class:"mb-6 flex items-center justify-between"},fe={class:"flex items-center gap-3"},xe={class:"flex h-10 w-10 items-center justify-center rounded-xl bg-indigo-600"},he={key:0,class:"mb-6 rounded-2xl border border-emerald-500/30 bg-emerald-500/10 p-5"},ve={class:"mb-3 flex items-center gap-2"},ye={class:"mb-4 text-sm text-slate-300"},we={class:"flex flex-wrap gap-3"},_e=["href"],ke=["href"],Se=["href"],Te={key:1,class:"mb-6 rounded-2xl border border-red-500/30 bg-red-500/10 p-4"},Ce={class:"text-sm text-red-300"},$e={class:"relative"},Ne={class:"pointer-events-none absolute inset-y-0 right-3 flex items-center"},Oe={key:0,class:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-slate-400 border-t-transparent"},Fe={key:0,class:"mt-1.5 text-xs text-amber-400"},Ve={key:1,class:"mt-1.5 text-xs text-indigo-400"},je={key:2,class:"mt-1.5 text-xs text-red-400"},ze={key:3,class:"mt-1.5 text-xs text-slate-500"},Ae={class:"grid grid-cols-3 gap-3"},Re=["onClick"],qe={class:"text-sm font-medium"},Ie={class:"mt-0.5 text-xs opacity-70"},Le={key:0},Me={class:"grid grid-cols-3 gap-3"},Ue=["onClick"],Be={class:"text-sm font-semibold capitalize"},Ee={class:"text-xs opacity-70"},Pe=["disabled"],De={key:0,class:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"},He={key:0,class:"rounded-3xl border border-app-border bg-app-card p-6 shadow-app-card backdrop-blur-app"},Ge={class:"mb-5 flex items-center gap-3"},Xe={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-violet-600"},Ye={key:0,class:"mb-4 rounded-xl border border-emerald-500/30 bg-emerald-500/10 p-4"},Ke={class:"flex items-center gap-2"},We={class:"text-sm font-medium text-emerald-300"},Je={class:"mt-2 text-xs text-slate-400"},Qe={key:1,class:"mb-4 rounded-xl border border-red-500/30 bg-red-500/10 p-3"},Ze={class:"text-sm text-red-300"},et=["disabled"],tt={key:0,class:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"},It=X({__name:"demo",setup(st){const L=Y(),{getAuthHeaders:O}=te(),a=Z({org_name:"",org_code:"",sport:"footballflag",team_style:"pro",size:"medium",season_name:"Summer 2026",league_context:""}),F=g(!1),n=g(null),k=g("");let V=null;const M=ee(()=>n.value==="available"?"border-emerald-500/50 focus:border-emerald-500 focus:ring-emerald-500/30":n.value==="demo"?"border-indigo-500/50 focus:border-indigo-500 focus:ring-indigo-500/30":n.value==="taken"?"border-red-500/50 focus:border-red-500 focus:ring-red-500/30":"border-app-border focus:border-indigo-500 focus:ring-indigo-500");function U(u){const s=u.target.value;n.value=null,k.value="",V&&clearTimeout(V),!(!s.trim()||s.length<2)&&(V=setTimeout(async()=>{F.value=!0;try{const j=await O(),o=await $fetch(`/api/superadmin/check-org-code?code=${encodeURIComponent(s.trim())}`,{headers:j});n.value=o.status,k.value=o.name||""}catch{n.value=null}finally{F.value=!1}},400))}const h=g(!1),d=g(null),S=g(null),T=g(!1),v=g(""),y=g(!1),b=g(null),w=g(null),B=[{value:"pro",label:"Pro (NFL)",icon:le,description:"Real NFL teams with official colors"},{value:"college",label:"College (NCAA)",icon:ie,description:"Real college teams with official colors"},{value:"ai",label:"AI Generated",icon:N,description:"Claude generates unique fictional teams"}],E=[{value:"small",description:"2 divisions · ~18 games"},{value:"medium",description:"3 divisions · ~60 games"},{value:"large",description:"5 divisions · 100 games"}];async function P(){if(a.org_code.trim()&&!(n.value==="taken"||n.value==="available")){h.value=!0,d.value=null,S.value=null,b.value=null,w.value=null;try{const u=await O(),s=await $fetch("/api/superadmin/seed-demo",{method:"POST",headers:u,body:{org_code:a.org_code.trim(),org_name:a.org_name.trim()||void 0,sport:a.sport,team_style:a.team_style,size:a.size,season_name:a.season_name||"Summer 2026",league_context:a.league_context||void 0}});d.value=s}catch(u){S.value=u?.data?.statusMessage||u?.message||"Failed to seed org. Check the org code and try again."}finally{h.value=!1}}}async function D(){if(!(!v.value.trim()||!d.value?.org_code)){y.value=!0,w.value=null;try{const u=await O(),s=await $fetch("/api/superadmin/transfer-demo-org",{method:"POST",headers:u,body:{org_code:d.value.org_code,email:v.value.trim()}});b.value=s}catch(u){w.value=u?.data?.statusMessage||u?.message||"Transfer failed. Try again."}finally{y.value=!1}}}return(u,s)=>{const j=G;return r(),l($,null,[c(j,{back:!1,share:!1,logo:"/flag50_logo.svg"}
1),e("div",ne,[e("main",de,[e("div",ue,[e("div",me,[e("button",{type:"button",onClick:s[0]||(s[0]=o=>T.value=!t(T)),class:"flex w-full items-center justify-between text-left"},[e("div",ce,[c(t(se),{class:"h-4 w-4 text-slate-400"}),s[8]||(s[8]=e("span",{class:"text-sm font-medium text-slate-300"},"How to use this tool",-1))]),c(t(oe),{class:C(["h-4 w-4 text-slate-500 transition-transform",t(T)?"rotate-180":""])},null,8,["class"])]),t(T)?(r(),l("div",pe,[...s[9]||(s[9]=[K('<div class="flex gap-3"><div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-indigo-600/30 text-xs font-bold text-indigo-300">1</div><div><p class="font-medium text-slate-200">Enter a league name &amp; org code</p><p class="mt-0.5">Type a league name and a unique org code. The code check will confirm it&#39;s available — if it is, the org will be created automatically.</p></div></div><div class="flex gap-3"><div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-indigo-600/30 text-xs font-bold text-indigo-300">2</div><div><p class="font-medium text-slate-200">Seed it with teams &amp; games</p><p class="mt-0.5">Pick a team style and league size, then click <strong>Seed Org</strong>. This creates the org (or wipes an existing demo), generates teams, and builds a full season (~20s).</p></div></div><div class="flex gap-3"><div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-indigo-600/30 text-xs font-bold text-indigo-300">3</div><div><p class="font-medium text-slate-200">Run the demo</p><p class="mt-0.5">Share the scores link with the prospect or walk them through it live. The org is fully functional — scoring, standings, brackets, and admin all work.</p></div></div><div class="flex gap-3"><div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-indigo-600/30 text-xs font-bold text-indigo-300">4</div><div><p class="font-medium text-slate-200">They buy — transfer ownership</p><p class="mt-0.5">Enter their email in the <strong>Transfer Ownership</strong> section that appears after seeding. This creates their account (if new), writes them as org owner, clears the demo flag, and sends them a &quot;Set your password&quot; email via the Firebase auth flow.</p></div></div><div class="rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 text-amber-300/80"><strong class="text-amber-300">Note:</strong> If the prospect already has a Flag50 account, transferring ownership skips account creation and adds the org to their existing account immediately. </div>',5)])])):p("",!0)]),e("div",ge,[e("div",be,[e("div",fe,[e("div",xe,[c(t(N),{class:"h-6 w-6 text-white"})]),s[10]||(s[10]=e("div",null,[e("h2",{class:"text-2xl font-semibold text-white"},"Demo Org Seeder"),e("p",{class:"mt-0.5 text-sm text-slate-400"},"Seed any org with teams and games for demos")],-1))]),e("button",{onClick:s[1]||(s[1]=o=>t(L).push("/superadmin")),class:"flex items-center gap-2 rounded-xl border border-white/10 bg-app-button-secondary px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-app-button-secondary-hover"},[c(t(re),{class:"h-4 w-4"}),s[11]||(s[11]=m(" Back ",-1))])]),t(d)?(r(),l("div",he,[e("div",ve,[c(t(z),{class:"h-6 w-6 text-emerald-400"}),s[12]||(s[12]=e("span",{class:"font-semibold text-emerald-300"},"Org seeded successfully",-1))]),e("p",ye,[m(i(t(d).teams_created)+" teams • "+i(t(d).games_created)+" games",1),t(d).standings_created?(r(),l($,{key:0},[m(" • "+i(t(d).standings_created)+" division standings",1)],64)):p("",!0),m(" • Season: "+i(t(d).season_name),1)]),e("div",we,[t(d).landing_url?(r(),l("a",{key:0,href:t(d).landing_url,target:"_blank",class:"flex items-center gap-2 rounded-lg border border-emerald-400/30 bg-emerald-500/15 px-4 py-2 text-sm text-emerald-200 transition hover:bg-emerald-500/25"},[c(t(A),{class:"h-4 w-4"}),s[13]||(s[13]=m(" View landing page ",-1))],8,_e)):p("",!0),e("a",{href:t(d).scores_url,target:"_blank",class:"flex items-center gap-2 rounded-lg border border-white/10 bg-app-button-secondary px-4 py-2 text-sm text-white transition hover:bg-app-button-secondary-hover"},[c(t(A),{class:"h-4 w-4"}),s[14]||(s[14]=m(" scores.flag50.com ",-1))],8,ke),e("a",{href:t(d).app_url,target:"_blank",class:"flex items-center gap-2 rounded-lg border border-white/10 bg-app-button-secondary px-4 py-2 text-sm text-white transition hover:bg-app-button-secondary-hover"},[c(t(A),{class:"h-4 w-4"}),s[15]||(s[15]=m(" app.flag50.com ",-1))],8,Se)])])):p("",!0),t(S)?(r(),l("div",Te,[e("p",Ce,i(t(S)),1)])):p("",!0),e("form",{onSubmit:R(P,["prevent"]),class:"space-y-6"},[e("div",null,[s[16]||(s[16]=e("label",{class:"mb-2 block text-sm font-medium text-white"},[m(" League Name "),e("span",{class:"text-red-400"},"*")],-1)),f(e("input",{"onUpdate:modelValue":s[2]||(s[2]=o=>t(a).org_name=o),type:"text",placeholder:"Austin Flag Football",required:"",class:"w-full rounded-lg border border-app-border bg-app-bg px-4 py-3 text-sm text-white placeholder:text-slate-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"},null,512),[[_,t(a).org_name]])]),e("div",null,[s[17]||(s[17]=e("label",{class:"mb-2 block text-sm font-medium text-white"},[m(" Org Code "),e("span",{class:"text-red-400"},"*")],-1)),e("div",$e,[f(e("input",{"onUpdate:modelValue":s[3]||(s[3]=o=>t(a).org_code=o),type:"text",placeholder:"austin-flag",required:"",autocomplete:"off",class:C(["w-full rounded-lg border bg-app-bg px-4 py-3 pr-10 text-sm text-white placeholder:text-slate-500 focus:outline-none focus:ring-1",t(M)]),onInput:U},null,34),[[_,t(a).org_code]]),e("div",Ne,[t(F)?(r(),l("div",Oe)):t(n)==="available"?(r(),x(t(z),{key:1,class:"h-4 w-4 text-emerald-400"})):t(n)==="demo"?(r(),x(t(N),{key:2,class:"h-4 w-4 text-indigo-400"})):t(n)==="taken"?(r(),x(t(ae),{key:3,class:"h-4 w-4 text-red-400"})):p("",!0)])]),t(n)==="available"?(r(),l("p",Fe,"No org with this code — create it through onboarding first, then seed it here")):t(n)==="demo"?(r(),l("p",Ve,"Demo org exists — will re-seed ("+i(t(k))+")",1)):t(n)==="taken"?(r(),l("p",je,"Already a real org ("+i(t(k))+") — can't seed",1)):(r(),l("p",ze,"Lowercase letters, numbers, hyphens only"))]),e("div",null,[s[19]||(s[19]=e("label",{class:"mb-2 block text-sm font-medium text-white"},"Sport",-1)),f(e("select",{"onUpdate:modelValue":s[4]||(s[4]=o=>t(a).sport=o),class:"w-full rounded-lg border border-app-border bg-app-bg px-4 py-3 text-sm text-white focus:border-indigo-500 focus:outline-none"},[...s[18]||(s[18]=[e("option",{value:"footballflag"},"Flag Football",-1),e("option",{value:"basketball"},"Basketball",-1),e("option",{value:"soccer"},"Soccer",-1)])],512),[[W,t(a).sport]])]),e("div",null,[s[20]||(s[20]=e("label",{class:"mb-2 block text-sm font-medium text-white"},"Team Style",-1)),e("div",Ae,[(r(),l($,null,q(B,o=>e("button",{key:o.value,type:"button",onClick:H=>t(a).team_style=o.value,class:C(["flex flex-col items-center gap-2 rounded-xl border p-4 text-center transition",t(a).team_style===o.value?"border-indigo-500 bg-indigo-500/20 text-white":"border-app-border bg-app-bg text-slate-400 hover:border-white/20 hover:text-white"])},[(r(),x(Q(o.icon),{class:"h-6 w-6"})),e("div",null,[e("div",qe,i(o.label),1),e("div",Ie,i(o.description),1)])],10,Re)),64))])]),t(a).team_style==="ai"?(r(),l("div",Le,[s[21]||(s[21]=e("label",{class:"mb-2 block text-sm font-medium text-white"},"League Context",-1)),f(e("input",{"onUpdate:modelValue":s[5]||(s[5]=o=>t(a).league_context=o),type:"text",placeholder:"Youth flag football league in Austin TX",class:"w-full rounded-lg border border-app-border bg-app-bg px-4 py-3 text-sm text-white placeholder:text-slate-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"},null,512),[[_,t(a).league_context]]),s[22]||(s[22]=e("p",{class:"mt-1.5 text-xs text-slate-500"},"Claude uses this to generate appropriate team names",-1))])):p("",!0),e("div",null,[s[23]||(s[23]=e("label",{class:"mb-2 block text-sm font-medium text-white"},"League Size",-1)),e("div",Me,[(r(),l($,null,q(E,o=>e("button",{key:o.value,type:"button",onClick:H=>t(a).size=o.value,class:C(["flex flex-col items-center gap-1 rounded-xl border p-4 text-center transition",t(a).size===o.value?"border-indigo-500 bg-indigo-500/20 text-white":"border-app-border bg-app-bg text-slate-400 hover:border-white/20 hover:text-white"])},[e("div",Be,i(o.value),1),e("div",Ee,i(o.description),1)],10,Ue)),64))])]),e("div",null,[s[24]||(s[24]=e("label",{class:"mb-2 block text-sm font-medium text-white"},"Season Name",-1)),f(e("input",{"onUpdate:modelValue":s[6]||(s[6]=o=>t(a).season_name=o),type:"text",placeholder:"Summer 2026",class:"w-full rounded-lg border border-app-border bg-app-bg px-4 py-3 text-sm text-white placeholder:text-slate-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"},null,512),[[_,t(a).season_name]])]),e("button",{type:"submit",disabled:t(h)||t(n)==="taken"||t(n)==="available",class:"flex w-full items-center justify-center gap-2 rounded-xl bg-indigo-600 px-6 py-3 text-sm font-semibold text-white transition hover:bg-indigo-700 disabled:cursor-not-allowed disabled:opacity-50"},[t(h)?(r(),l("div",De)):(r(),x(t(N),{key:1,class:"h-4 w-4"})),m(" "+i(t(h)?"Seeding... (20–40s)":"Seed Org"),1)],8,Pe)],32)]),t(d)?(r(),l("div",He,[e("div",Ge,[e("div",Xe,[c(t(I),{class:"h-5 w-5 text-white"}
1)]),s[25]||(s[25]=e("div",null,[e("h3",{class:"text-lg font-semibold text-white"},"Transfer Ownership"),e("p",{class:"mt-0.5 text-sm text-slate-400"},"When they buy — send them their login")],-1))]),t(b)?(r(),l("div",Ye,[e("div",Ke,[c(t(z),{class:"h-5 w-5 text-emerald-400"}),e("span",We,i(t(b).is_new_user?"Account created and":"Ownership transferred and")+" email sent to "+i(t(b).email),1)]),e("p",Je," The org is no longer flagged as a demo. "+i(t(b).is_new_user?`They'll get a "Set your password" email to activate their account.`:"They can sign in immediately."),1)])):p("",!0),t(w)?(r(),l("div",Qe,[e("p",Ze,i(t(w)),1)])):p("",!0),t(b)?p("",!0):(r(),l("form",{key:2,onSubmit:R(D,["prevent"]),class:"space-y-4"},[e("div",null,[s[26]||(s[26]=e("label",{class:"mb-2 block text-sm font-medium text-white"},[m(" Prospect's email "),e("span",{class:"text-red-400"},"*")],-1)),f(e("input",{"onUpdate:modelValue":s[7]||(s[7]=o=>J(v)?v.value=o:null),type:"email",placeholder:"[email protected]",required:"",class:"w-full rounded-lg border border-app-border bg-app-bg px-4 py-3 text-sm text-white placeholder:text-slate-500 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"},null,512),[[_,t(v)]]),s[27]||(s[27]=e("p",{class:"mt-1.5 text-xs text-slate-500"},` If they don't have an account yet, one will be created and they'll receive a "Set your password" email. If they already have a Flag50 account, this org is added immediately. `,-1))]),e("button",{type:"submit",disabled:t(y),class:"flex w-full items-center justify-center gap-2 rounded-xl bg-violet-600 px-6 py-3 text-sm font-semibold text-white transition hover:bg-violet-700 disabled:cursor-not-allowed disabled:opacity-50"},[t(y)?(r(),l("div",tt)):(r(),x(t(I),{key:1,class:"h-4 w-4"})),m(" "+i(t(y)?"Transferring...":"Transfer Ownership & Send Email"),1)],8,et)],32))])):p("",!0)])])])],64)}}});export{It 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.