import{C as e,D as t,E as n,F as r,H as i,I as a,Q as o,S as s,T as c,U as l,Y as u,_ as d,a as f,b as p,g as m,i as h,l as g,n as _,p as v,y}from"./app-ixEr2bXY.js";import{t as b}from"./AdminLayout-DyrS-YzU.js";var x={key:0,class:`mb-5 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-300`},S={class:`grid gap-6 lg:grid-cols-2`},C={class:`rounded-2xl border border-line bg-surface p-6`},w={class:`flex items-center gap-3`},T=[`disabled`],E={class:`rounded-2xl border border-line bg-surface p-6`},D={class:`flex flex-wrap items-center gap-3`},O=[`src`],k={class:`mt-4`},A={key:0,class:`ml-2 text-sm text-ink-2`},j=t({__name:`Pwa`,props:{values:{},icons:{}},setup(t){let j=t,M=f(),N=y(()=>M.props.flash?.status),P=h({short_name:j.values.short_name,banner:j.values.banner});function F(){P.post(`/admin/pwa`,{preserveScroll:!0})}let I=h({icon:null});function L(e){let t=e.target.files?.[0]??null;I.icon=t,t&&I.post(`/admin/pwa/icon`,{preserveScroll:!0,forceFormData:!0})}return(f,h)=>(r(),e(d,null,[n(u(_),{title:`Admin · PWA`}),n(b,null,{title:i(()=>[...h[2]||=[c(`Progressive Web App`,-1)]]),subtitle:i(()=>[...h[3]||=[c(`Install experience, icons & push`,-1)]]),default:i(()=>[N.value?(r(),e(`div`,x,o(N.value),1)):s(``,!0),p(`div`,S,[p(`section`,C,[h[6]||=p(`h3`,{class:`mb-4 text-sm font-bold text-ink`},`Install settings`,-1),p(`form`,{class:`space-y-5`,onSubmit:m(F,[`prevent`])},[p(`div`,null,[h[4]||=p(`label`,{class:`block text-sm font-medium text-ink-2`},`App short name (home-screen label)`,-1),l(p(`input`,{"onUpdate:modelValue":h[0]||=e=>u(P).short_name=e,type:`text`,maxlength:`30`,class:`mt-1.5 w-full rounded-lg border-line bg-appbg text-ink focus:border-indigo-500 focus:ring-indigo-500`},null,512),[[v,u(P).short_name]])]),p(`label`,w,[l(p(`input`,{"onUpdate:modelValue":h[1]||=e=>u(P).banner=e,type:`checkbox`,class:`rounded border-line bg-appbg text-indigo-500 focus:ring-indigo-500`},null,512),[[g,u(P).banner]]),h[5]||=p(`span`,{class:`text-sm text-ink-2`},`Show the “install app” banner on supported devices`,-1)]),p(`button`,{type:`submit`,disabled:u(P).processing,class:`rounded-lg bg-indigo-500 px-4 py-2 text-sm font-semibold text-white hover:bg-indigo-600 disabled:opacity-60`},`Save`,8,T)],32),h[7]||=p(`p`,{class:`mt-4 text-xs text-ink-muted`},[c(`The theme color comes from the brand color in `),p(`strong`,null,`Theme`),c(`. Push notifications use VAPID (configured server-side).`)],-1)]),p(`section`,E,[h[8]||=p(`h3`,{class:`mb-1 text-sm font-bold text-ink`},`App icons`,-1),h[9]||=p(`p`,{class:`mb-4 text-xs text-ink-muted`},`Upload one square image — every PWA/favicon size is generated automatically (WebP/PNG).`,-1),p(`div`,D,[(r(!0),e(d,null,a(t.icons,t=>(r(),e(`img`,{key:t,src:t,class:`h-12 w-12 rounded-lg border border-line`,alt:``},null,8,O))),128))]),p(`div`,k,[p(`input`,{type:`file`,accept:`image/*`,class:`text-sm text-ink-2`,onChange:L},null,32),u(I).processing?(r(),e(`span`,A,`Generating…`)):s(``,!0)])])])]),_:1})],64))}});export{j as default};