1import{d as I,L as Y,k as l,l as P,w as j,e as Z,a2 as z,c as d,a as t,v as y,E as _,n as w,B as A,f as x,t as D,x as s,N as K,y as c,z as v,a4 as L,D as $,G as Q,o as p,K as J,R as b}from"./FbEdaL-q.js";import{_ as X}from"./C85FlCDX.js";import{u as ee}from"./C3bIjaF4.js";const te={class:"bg-canvas text-foreground flex min-h-screen w-full flex-col items-center py-12"},oe={class:"mt-0 flex w-full max-w-7xl flex-col gap-10 px-4 pb-12 md:flex-row"},le={class:"flex w-full flex-col gap-6 md:w-1/3"},se={class:"bg-surface rounded-2xl p-6 shadow-lg"},re={class:"space-y-3 text-base"},ae={class:"w-full md:w-2/3"},ne={class:"bg-surface rounded-2xl p-8 shadow-2xl"},ue={key:0,class:"space-y-6 animate-pulse"},ie={key:0,class:"text-muted text-center text-sm"},de={class:"relative"},ce={class:"text-muted-2 pointer-events-none absolute right-2.5 bottom-2 text-xs"},pe={key:0},me={key:1,class:"rounded-lg border border-red-300 bg-red-50 px-4 py-3 text-sm text-red-700"},fe={class:"ml-1 inline-flex items-center gap-1"},ve={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-4 w-4","aria-hidden":"true"},be={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-4 w-4 text-green-700","aria-hidden":"true"},ge=["disabled"],xe={key:2,class:"py-8 text-center"},F="alttextstudio:contact_to_bug_report:v1",Se=I({name:"BugReportPage",__name:"index",setup(ye){ee({title:"Bug Report"});const f=z(),V=Y(),n=l(""),u=l(""),h=l(""),m=l(""),C=l(""),B=l(""),k=l(""),R=l(""),U=l(""),S=l(!1),g=l(!1),E=l(!1),N=l(!1),H=J(),T=l(!1),O=l(!1);P(()=>{if(!!!localStorage.getItem("auth_token")||V.lastFetchedAt!==null){T.value=!0;return}const e=setTimeout(()=>{O.value=!0},8e3),r=j(()=>V.lastFetchedAt,i=>{i!==null&&(T.value=!0,O.value=!1,clearTimeout(e),r())})});const M=l(null),q=Z(()=>n.value.trim().length>0&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u.value.trim())&&h.value.length>0&&m.value.trim().length>0);async function W(){if(!q.value||g.value)return;g.value=!0,E.value=!1;const a=await M.value?.execute()||"";try{await $fetch(`${H.public.apiBaseUrl}/bug-report`,{method:"POST",body:{name:n.value.trim(),email:u.value.trim(),subject:h.value,bug_description:m.value.trim(),browser_and_version:C.value.trim()||void 0,operating_system:B.value.trim()||void 0,device_type:k.value||void 0,device_type_other:R.value.trim()||void 0,screen_resolution:U.value.trim()||void 0,"cf-turnstile-response":a||void 0}}),S.value=!0}catch{E.value=!0}finally{g.value=!1}}async function G(){try{await navigator.clipboard.writeText("[email protected]"),N.value=!0,setTimeout(()=>{N.value=!1},2e3)}catch{}}return P(()=>{{const i=sessionStorage.getItem(F);if(i)try{const o=JSON.parse(i);typeof o.name=="string"&&o.name.trim()&&(n.value=o.name),typeof o.email=="string"&&o.email.trim()&&(u.value=o.email),typeof o.message=="string"&&o.message.trim()&&(m.value=o.message)}catch{}finally{sessionStorage.removeItem(F)}}const a=f.query.name,e=f.query.email,r=f.query.description;typeof a=="string"&&a.trim()&&!n.value&&(n.value=a),typeof e=="string"&&e.trim()&&!u.value&&(u.value=e),typeof r=="string"&&r.trim()&&!m.value&&(m.value=r)}),j(()=>V.user,a=>{const e=b.trim(String(b.get(a,"first_name","")||"")),r=b.trim(String(b.get(a,"last_name","")||"")),i=b.trim(`${e} ${r}`),o=b.trim(String(b.get(a,"email","")||""));i&&!n.value&&(n.value=i),o&&!u.value&&(u.value=o)},{immediate:!0}),(a,e)=>{const r=Q,i=X;return p(),d("div",te,[e[32]||(e[32]=t("section",{class:"mb-12 w-full px-4 pt-24 pb-8 text-center"},[t("div",{class:"mx-auto max-w-7xl"},[t("h1",{class:"text-foreground mb-4 text-4xl font-bold sm:text-5xl"}," Report a Bug "),t("p",{class:"text-muted mx-auto max-w-2xl text-lg"}," Help us improve by reporting issues you encounter ")])],-1)),t("div",oe,[t("aside",le,[t("div",se,[e[13]||(e[13]=t("h2",{class:"text-foreground mb-4 text-lg font-semibold"}," Quick Links ",-1)),t("ul",re,[t("li",null,[y(r,{to:"/support",class:w(A(f).path==="/support"?"text-brand-purple font-semibold":"text-foreground hover:text-brand-purple transition-colors")},{default:_(()=>e[9]||(e[9]=[s(" FAQ ",-1)])),_:1,__:[9]},8,["class"])]),t("li",null,[y(r,{to:"/support/contact",class:w(A(f).path==="/support/contact"?"text-brand-purple font-semibold":"text-foreground hover:text-brand-purple transition-colors")},{default:_(()=>e[10]||(e[10]=[s(" Contact Us ",-1)])),_:1,__:[10]},8,["class"])]),t("li",null,[y(r,{to:"/support/bug-report",class:w(A(f).path==="/support/bug-report"?"text-brand-purple font-semibold":"text-foreground hover:text-brand-purple transition-colors")},{default:_(()=>e[11]||(e[11]=[s(" Report a Bug ",-1)])),_:1,__:[11]},8,["class"])]),t("li",null,[y(r,{to:"/support/docs",class:w(A(f).path.startsWith("/support/docs")?"text-brand-purple font-semibold":"text-foreground hover:text-brand-purple transition-colors")},{default:_(()=>e[12]||(e[12]=[s(" Documentation ",-1)])),_:1,__:[12]},8,["class"])])])])]),t("main",ae,[t("div",ne,[!T.value&&!S.value?(p(),d("div",ue,[e[15]||(e[15]=D('<div><div class="bg-surface-2 mb-2 h-4 w-12 rounded"></div><div class="bg-surface-2 h-10 w-full rounded-lg"></div></div><div><div class="bg-surface-2 mb-2 h-4 w-12 rounded"></div><div class="bg-surface-2 h-10 w-full rounded-lg"></div></div><div><div class="bg-surface-2 mb-2 h-4 w-12 rounded"></div><div class="bg-surface-2 h-10 w-full rounded-lg"></div></div><div><div class="bg-surface-2 mb-2 h-4 w-28 rounded"></div><div class="bg-surface-2 h-36 w-full rounded-lg"></div></div><div><div class="bg-surface-2 mb-2 h-4 w-32 rounded"></div><div class="bg-surface-2 h-10 w-full rounded-lg"></div></div><div><div class="bg-surface-2 mb-2 h-4 w-32 rounded"></div><div class="bg-surface-2 h-10 w-full rounded-lg"></div></div><div><div class="bg-surface-2 mb-2 h-4 w-24 rounded"></div><div class="bg-surface-2 h-10 w-full rounded-lg"></div></div><div><div class="bg-surface-2 mb-2 h-4 w-32 rounded"></div><div class="bg-surface-2 h-10 w-full rounded-lg"></div></div><div class="bg-surface-2 h-14 w-full rounded-xl"></div>',9)),O.value?(p(),d("p",ie,e[14]||(e[14]=[s(" This is taking longer than usual. You can also reach us directly at ",-1),t("a",{href:"mailto:[email protected]",class:"text-accent font-medium hover:underline"},"[email protected]",-1),s(". ",-1)]))):x("",!0)])):x("",!0),T.value&&!S.value?(p(),d("form",{key:1,class:"space-y-6",onSubmit:K(W,["prevent"])},[t("div",null,[e[16]||(e[16]=t("label",{for:"name",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Name "),t("span",{class:"text-red-500"},"*")],-1)),c(t("input",{id:"name",type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>n.value=o),required:"",maxlength:"256",class:"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent block w-full rounded-lg border p-2.5 text-sm",placeholder:"Your name"},null,512),[[v,n.value]])]),t("div",null,[e[17]||(e[17]=t("label",{for:"email",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Email "),t("span",{class:"text-red-500"},"*")],-1)),c(t("input",{id:"email",type:"email","onUpdate:modelValue":e[1]||(e[1]=o=>u.value=o),required:"",maxlength:"254",class:"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent block w-full rounded-lg border p-2.5 text-sm",placeholder:"[email protected]"},null,512),[[v,u.value]])]),t("div",null,[e[19]||(e[19]=t("label",{for:"subject",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Subject "),t("span",{class:"text-red-500"},"*")],-1)),c(t("select",{id:"subject","onUpdate:modelValue":e[2]||(e[2]=o=>h.value=o),required:"",class:"border-border bg-surface-2 text-foreground focus:border-accent focus:ring-brand-blue/30 block w-full cursor-pointer rounded-lg border p-2.5 text-sm transition-all duration-200 focus:ring-2 focus:outline-none"},e[18]||(e[18]=[D('<option value="">Select a subject...</option><option value="alt-text-generator">Alt Text Generator (Web App)</option><option value="chrome-extension">Chrome Extension</option><option value="wordpress-plugin">WordPress Plugin</option><option value="shopify-app">Shopify App</option><option value="accessibility-audit">Accessibility Audit</option><option value="my-account">My Account</option><option value="billing">Billing & Credits</option><option value="website">alttextstudio.com (General)</option><option value="other">Other</option>',10)]),512),[[L,h.value]])]),t("div",null,[e[20]||(e[20]=t("label",{for:"bug-description",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Bug Description "),t("span",{class:"text-red-500"},"*")],-1)),t("div",de,[c(t("textarea",{id:"bug-description","onUpdate:modelValue":e[3]||(e[3]=o=>m.value=o),rows:"6",required:"",maxlength:"2500",class:"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent block w-full rounded-lg border p-2.5 pb-6 text-sm",placeholder:"Please describe the bug in detail. Include steps to reproduce, expected behavior, and actual behavior..."},null,512),[[v,m.value]]),t("div",ce,$(m.value.length)+"/2500 ",1)])]),t("div",null,[e[21]||(e[21]=t("label",{for:"browser",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Browser & Version "),t("span",{class:"text-muted-2"},"(optional)")],-1)),c(t("input",{id:"browser",type:"text","onUpdate:modelValue":e[4]||(e[4]=o=>C.value=o),maxlength:"256",class:"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent block w-full rounded-lg border p-2.5 text-sm",placeholder:"e.g., Chrome 120, Firefox 121"},null,512),[[v,C.value]])]),t("div",null,[e[22]||(e[22]=t("label",{for:"operating-system",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Operating System "),t("span",{class:"text-muted-2"},"(optional)")],-1)),c(t("input",{id:"operating-system",type:"text","onUpdate:modelValue":e[5]||(e[5]=o=>B.value=o),maxlength:"256",class:"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent block w-full rounded-lg border p-2.5 text-sm",placeholder:"e.g., Windows 11, macOS 15, iOS 18, Android 15"},null,512),[[v,B.value]])]),t("div",null,[e[24]||(e[24]=t("label",{for:"device-type",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Device Type "),t("span",{class:"text-muted-2"},"(optional)")],-1)),c(t("select",{id:"device-type","onUpdate:modelValue":e[6]||(e[6]=o=>k.value=o),class:"border-border bg-surface-2 text-foreground focus:border-accent focus:ring-brand-blue/30 block w-full cursor-pointer rounded-lg border p-2.5 text-sm transition-all duration-200 focus:ring-2 focus:outline-none"},e[23]||(e[23]=[D('<option value="">Select a device type...</option><option value="desktop">Desktop</option><option value="tablet">Tablet</option><option value="mobile">Mobile Device</option><option value="other">Other (Please Specify)</option>',5)]),512),[[L,k.value]])]),k.value==="other"?(p(),d("div",pe,[e[25]||(e[25]=t("label",{for:"device-type-other",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Please specify "),t("span",{class:"text-muted-2"},"(optional)")],-1)),c(t("input",{id:"device-type-other",type:"text","onUpdate:modelValue":e[7]||
1(e[7]=o=>R.value=o),maxlength:"256",class:"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent block w-full rounded-lg border p-2.5 text-sm",placeholder:"e.g., Smart TV, e-ink reader"},null,512),[[v,R.value]])])):x("",!0),t("div",null,[e[26]||(e[26]=t("label",{for:"screen-resolution",class:"text-foreground mb-2 block text-sm font-medium"},[s(" Screen Resolution "),t("span",{class:"text-muted-2"},"(optional)")],-1)),c(t("input",{id:"screen-resolution",type:"text","onUpdate:modelValue":e[8]||(e[8]=o=>U.value=o),maxlength:"64",class:"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent block w-full rounded-lg border p-2.5 text-sm",placeholder:"e.g., 1920Ã1080, 2560Ã1440"},null,512),[[v,U.value]])]),E.value?(p(),d("div",me,[e[30]||(e[30]=s(" Something went wrong. Please try again or email us directly: ",-1)),t("span",fe,[e[29]||(e[29]=t("a",{href:"mailto:[email protected]",class:"font-medium underline hover:text-red-900"},"[email protected]",-1)),t("button",{type:"button",class:"inline-flex items-center rounded p-0.5 hover:bg-red-200 focus:ring-2 focus:ring-red-400 focus:outline-none",title:"Copy email address","aria-label":"Copy email address",onClick:G},[N.value?(p(),d("svg",be,e[28]||(e[28]=[t("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z","clip-rule":"evenodd"},null,-1)]))):(p(),d("svg",ve,e[27]||(e[27]=[t("path",{d:"M7 3.5A1.5 1.5 0 0 1 8.5 2h3.879a1.5 1.5 0 0 1 1.06.44l3.122 3.12A1.5 1.5 0 0 1 17 6.622V12.5a1.5 1.5 0 0 1-1.5 1.5h-1v-3.379a3 3 0 0 0-.879-2.121L10.5 5.379A3 3 0 0 0 8.379 4.5H7v-1Z"},null,-1),t("path",{d:"M4.5 6A1.5 1.5 0 0 0 3 7.5v9A1.5 1.5 0 0 0 4.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L9.44 6.439A1.5 1.5 0 0 0 8.378 6H4.5Z"},null,-1)])))])])])):x("",!0),y(i,{ref_key:"turnstile",ref:M,action:"bug-report",class:"mb-4"},null,512),t("button",{type:"submit",disabled:!q.value||g.value,class:w([q.value&&!g.value?"bg-accent text-on-accent cursor-pointer hover:opacity-95":"bg-accent text-on-accent opacity-50 cursor-not-allowed","focus:ring-brand-blue/30 w-full rounded-xl px-8 py-4 font-bold shadow transition focus:ring-4 focus:outline-none"])},$(g.value?"Submitting...":"Submit Bug Report"),11,ge)],32)):x("",!0),S.value?(p(),d("div",xe,e[31]||(e[31]=[t("p",{class:"text-foreground mb-2 text-lg font-semibold"},"Thank you for helping us improve Alt Text Studio!",-1)]))):x("",!0)])])])])}}});export{Se 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.