1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CytRNqTg.js","./Bt0c346S.js","./DvgxvNL0.js","./entry.CS40kdde.css","./B3r-K2Yu.js","./CxT8oa0e.js","./BQdT0F5S.js","./0-j6vRIO.js","./D_gImRUP.js","./2LtEh3ef.js","./DUGeaezQ.js","./BFNn1VkQ.js","./BUnfBzxO.js","./54RfI63K.js","./BuIn91Xv.js","./CmyqCNQJ.js","./BnQ-3hEd.js","./adYS2KzZ.js","./BeDA2sgW.js","./NWbB3jZq.js","./w0kzRsi0.js","./D_WDSZCB.js","./BZoFZXE3.js","./avbM63L_.js","./ClLS-ExK.js","./Cc_Qow82.js","./B17cNeFb.js","./Dj0J5XCr.js","./CwESMuAN.js","./CkNx22Sy.js","./2LLEdQeX.js"])))=>i.map(i=>d[i]); 2import{ai as t,d as U,c as I,a_ as B,a as i,b as a,v as n,k as d,n as h,F as T,y as O,q as u,Q as _,o as s,S as F,aJ as A,cv as M,j as c,_ as y,p as q,cw as z,cx as H,C as J}from"./DvgxvNL0.js";import{N as K}from"./BuVIxg8d.js";import"./DQSAL0As.js";const Q={"auth-method-added":()=>t(()=>import("./CytRNqTg.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),"auth-method-removed":()=>t(()=>import("./CxT8oa0e.js"),__vite__mapDeps([5,1,2,3,4]),import.meta.url),"email-changed":()=>t(()=>import("./BQdT0F5S.js"),__vite__mapDeps([6,1,2,3,4]),import.meta.url),"password-changed":()=>t(()=>import("./0-j6vRIO.js"),__vite__mapDeps([7,1,2,3,4]),import.meta.url),"password-removed":()=>t(()=>import("./D_gImRUP.js"),__vite__mapDeps([8,1,2,3,4]),import.meta.url),"payment-failed":()=>t(()=>import("./2LtEh3ef.js"),__vite__mapDeps([9,1,2,3,4,10]),import.meta.url),"reset-password":()=>t(()=>import("./BFNn1VkQ.js"),__vite__mapDeps([11,1,2,3,4,10]),import.meta.url),"two-factor-added":()=>t(()=>import("./BUnfBzxO.js"),__vite__mapDeps([12,1,2,3,4]),import.meta.url),"two-factor-removed":()=>t(()=>import("./54RfI63K.js"),__vite__mapDeps([13,1,2,3,4]),import.meta.url),"verify-email":()=>t(()=>import("./BuIn91Xv.js"),__vite__mapDeps([14,1,2,3,4,10]),import.meta.url),"login-new-device":()=>t(()=>import("./CmyqCNQJ.js"),__vite__mapDeps([15,1,2,3,4]),import.meta.url),"payout-available":()=>t(()=>import("./BnQ-3hEd.js"),__vite__mapDeps([16,1,2,3,4,10]),import.meta.url),"personal-access-token-created":()=>t(()=>import("./adYS2KzZ.js"),__vite__mapDeps([17,1,2,3,4]),import.meta.url),"subscription-tax-change":()=>t(()=>import("./BeDA2sgW.js"),__vite__mapDeps([18,1,2,3,4]),import.meta.url),"subscription-credited":()=>t(()=>import("./NWbB3jZq.js"),__vite__mapDeps([19,1,2,3,4]),import.meta.url),"report-submitted":()=>t(()=>import("./w0kzRsi0.js"),__vite__mapDeps([20,1,2,3,4]),import.meta.url),"report-status-updated":()=>t(()=>import("./D_WDSZCB.js"),__vite__mapDeps([21,1,2,3,4]),import.meta.url),"moderation-thread-message-received":()=>t(()=>import("./BZoFZXE3.js"),__vite__mapDeps([22,1,2,3,4]),import.meta.url),"project-status-updated-neutral":()=>t(()=>import("./avbM63L_.js"),__vite__mapDeps([23,1,2,3,4,10]),import.meta.url),"project-status-approved":()=>t(()=>import("./ClLS-ExK.js"),__vite__mapDeps([24,1,2,3,4,10]),import.meta.url),"project-invited":()=>t(()=>import("./Cc_Qow82.js"),__vite__mapDeps([25,1,2,3,4,10]),import.meta.url),"project-transferred":()=>t(()=>import("./B17cNeFb.js"),__vite__mapDeps([26,1,2,3,4,10]),import.meta.url),"server-invited":()=>t(()=>import("./Dj0J5XCr.js"),__vite__mapDeps([27,1,2,3,4,10]),import.meta.url),"server-invited-no-account":()=>t(()=>import("./CwESMuAN.js"),__vite__mapDeps([28,1,2,3,4,10]),import.meta.url),"discord-role-creator-club":()=>t(()=>import("./CkNx22Sy.js"),__vite__mapDeps([29,1,2,3,4,10]),import.meta.url),"organization-invited":()=>t(()=>import("./2LLEdQeX.js"),__vite__mapDeps([30,1,2,3,4,10]),import.meta.url)},W={class:"mb-4 flex items-center justify-between gap-4"},X={class:"flex items-center gap-2"},Y={class:"flex flex-col gap-4"},Z={class:"label__title text-base"},G={key:0,class:"border-danger bg-danger/10 text-danger my-2 rounded border px-3 py-2 text-sm"},ee={key:1,class:"my-4 text-sm text-secondary"},te={key:2},oe={key:0,class:"mt-2 grid gap-3 md:grid-cols-2"},re=["for"],ae={class:"label__title"},le={key:1,class:"mt-2 text-xs text-secondary"},ie={class:"mt-4"},se=["srcdoc"],de={key:1,class:"rounded border border-divider bg-white px-4 py-3 text-sm text-secondary"},ne={class:"input-group mt-4"},_e={key:0,class:"border-0 border-b border-solid border-surface-4 pb-4"},ue={key:1,class:"m-0 mt-4 grid gap-3 p-0 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"},ce={class:"mb-3"},me={class:"font-mono text-sm font-semibold tracking-tight text-contrast"},pe={class:"mt-1 truncate text-xs text-secondary"},ve={class:"mt-auto flex gap-2"},be=U({__name:"emails",setup(he){const R=Object.keys(Q).sort(),b=_(""),m=I(()=>R.filter(o=>o.toLowerCase().includes(b.value.toLowerCase().trim())));function D(){let o=0;for(const r of m.value)L(r,o),o++}function k(o){navigator.clipboard?.writeText(`/_internal/templates/email/${o}`).catch(()=>{})}function V(o){return`/_internal/templates/email/${o}?preview=${Date.now()}`}const f=_(null),P=_(null),g=_(!1),p=_(null),w=_(""),E=_([]),v=_({});function $(o){const r=new Set,e=/\{([a-zA-Z0-9_.-]+)\}/g;let l=e.exec(o);for(;l!==null;)r.add(l[1]),l=e.exec(o);return[...r]}const C=I(()=>{let o=w.value;for(const[r,e]of Object.entries(v.value)){if(!e)continue;const l=new RegExp(`\\{${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\}`,"g");o=o.replace(l,e)}return o}
2);async function j(o,r){if(r?.shiftKey){L(o);return}P.value=o,g.value=!0,p.value=null,w.value="",E.value=[],v.value={};try{const e=await fetch(V(o),{cache:"no-store"});if(w.value=await e.text(),!e.ok)throw new Error(`Failed to load template ${o}`);const l=$(w.value);E.value=l,v.value=Object.fromEntries(l.map(x=>[x,""])),f.value?.show()}catch(e){p.value="Failed to load email preview.",console.error(e),f.value?.show()}finally{g.value=!1}}function N(){f.value?.hide()}function L(o,r=0){const x=window.screenX+(window.outerWidth-600)/2+r*28%320,S=window.screenY+(window.outerHeight-850)/2+r*28%320;window.open(V(o),`email-${o}`,`popup=yes,width=600,height=850,left=${x},top=${S},resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no,status=no`)}return B(()=>{document.getElementById("email-search")?.focus()}),(o,r)=>(s(),i("div",null,[a("div",W,[r[1]||(r[1]=a("h2",{class:"m-0 text-2xl font-semibold"},"Email templates",-1)),a("div",X,[n(d(A),{id:"email-search",modelValue:b.value,"onUpdate:modelValue":r[0]||(r[0]=e=>b.value=e),icon:d(F),type:"text",autocomplete:"off",placeholder:"Search templates...",clearable:""},null,8,["modelValue","icon"]),n(d(y),{type:"colored",color:"brand",disabled:m.value.length===0,onClick:D},{default:h(()=>[n(d(M),{class:"h-4 w-4","aria-hidden":"true"}),u(" Open all ("+c(m.value.length)+") ",1)]),_:1},8,["disabled"])])]),n(d(K),{ref_key:"previewModal",ref:f,header:"Preview email",width:"min(92vw, 1000px)","max-content-height":"88vh",scrollable:""},{default:h(()=>[a("div",Y,[a("p",Z,"Template: "+c(P.value),1),p.value?(s(),i("div",G,c(p.value),1)):q("",!0),g.value?(s(),i("div",ee,"Loa
2ding preview...")):(s(),i("div",te,[E.value.length?(s(),i("div",oe,[(s(!0),i(T,null,O(E.value,e=>(s(),i("label",{key:e,for:`preview-${e}`,class:"flex flex-col"},[a("span",ae,c(e),1),n(d(A),{id:`preview-${e}`,modelValue:v.value[e],"onUpdate:modelValue":l=>v.value[e]=l,type:"text",placeholder:`Enter ${e}`},null,8,["id","modelValue","onUpdate:modelValue","placeholder"])],8,re))),128))])):(s(),i("p",le," No template variables were detected; preview shown using default values. ")),a("div",ie,[r[2]||(r[2]=a("div",{class:"label__title mb-2"},"Rendered template",-1)),p.value?(s(),i("div",de," Could not render template preview. ")):(s(),i("iframe",{key:0,srcdoc:C.value,class:"h-[60vh] w-full rounded border border-divider bg-white",sandbox:"allow-same-origin"},null,8,se))]),a("div",ne,[n(d(y),{type:"quiet",onClick:N},{default:h(()=>[...r[3]||(r[3]=[u("Close",-1)])]),_:1})])]))])]),_:1},512),a("div",null,[m.value.length===0?(s(),i("div",_e," No templates match your search. ")):(s(),i("ul",ue,[(s(!0),i(T,null,O(m.value,e=>(s(),i("li",{key:e,class:"group flex flex-col justify-between rounded-2xl border border-solid border-surface-4 bg-surface-3 p-4 shadow-sm transition hover:shadow"},[a("div",ce,[a("div",me,c(e),1),a("div",pe," /_internal/templates/email/"+c(e),1)]),a("div",ve,[n(d(y),{type:"colored",color:"brand",onClick:l=>j(e,l)},{default:h(()=>[n(d(z),{"aria-hidden":"true"}),r[4]||(r[4]=u(" Preview ",-1))]),_:1},8,["onClick"]),n(d(J),{type:"outlined",label:"Copy",title:"Copy preview URL",onClick:l=>k(e)},{default:h(()=>[n(d(H),{"aria-hidden":"true"})]),_:1},8,["onClick"])])]))),128))])),r[5]||(r[5]=a("p",{class:"mt-4"},[u(" All templates come from "),a("code",{class:"rounded bg-code-bg px-1 py-0.5 text-sm text-code-text"}
2,"src/emails/index.ts"),u(". Popouts render via "),a("code",{class:"rounded bg-code-bg px-1 py-0.5 text-sm text-code-text"},"/_internal/templates/email/[template]"),u(". ")],-1))])]))}});export{be 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.