1import{H as y,a7 as E,r as c,j as e,k2 as w,S as C,aw as k,ax as A,k3 as R}from"./index-Cz_StzOF.js";import{u as T}from"./useSuspenseQuery-C53WRaHC.js";import{A as I}from"./alert-error-mom43jPu.js";import{A as L}from"./alert-success-BU8wWMCH.js";import{B as N}from"./button-DLLlTj8W.js";import{C as S}from"./checkbox-ra-lQ7fi.js";import{I as b}from"./input-C6Gc-HOE.js";import{L as l}from"./label-DuQ5chKt.js";import{A as O}from"./admin-page-header-Bn0eJ8kD.js";import{I as p}from"./image-picker-field-BzXqxR9s.js";import{m as _}from"./menu-colors-D2UGGhwU.js";import"./index-C3pZZpmr.js";import"./index-BsvPs760.js";import"./check-CutoH9vg.js";import"./media-picker-modal-C0N5f1Ra.js";import"./media-upload-zone-l1-54QAX.js";import"./core.esm-W6trNZA_.js";import"./triangle-alert--wIR-P26.js";import"./plus-CT_jhNCj.js";import"./attachment.actions-CBiSkClN.js";const U="#F5A71C",H=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function m(o){return o===""||H.test(o)}function g({id:o,label:d,value:s,placeholder:r,resetLabel:h,onChange:n}){const u=m(s);return e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:o,children:d}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{"aria-label":`${d} picker`,className:"h-9 w-12 cursor-pointer rounded border p-0.5",id:o,onChange:i=>n(i.target.value.toUpperCase()),type:"color",value:u&&s?s:r}),e.jsx(b,{className:"w-32",onChange:i=>n(i.target.value.trim()),placeholder:r,value:s}),s!==""&&e.jsx(N,{onClick:()=>n(""),size:"sm",type:"button",variant:"ghost",children:h})]})]})}function M(){const{data:o}=T(y()),d=E(),[s,r]=c.useState(o),[h,n]=c.useState(null),[u,i]=c.useState(null),[f,v]=c.useState(!1),j=m(s.menuColor),x=_(j?s.menuColor:""),F=async()=>{if(!(j&&m(s.retroHeaderColor)&&m(s.retroMenuColor))){n("Colours must be hex values like #F5A71C (or left empty for the default).");return}v(!0),n(null),i(null);try{const t=await R({data:s});d.setQueryData(y().queryKey,t),r(t),i("Site settings saved. The public site picks them up within a few minutes (or on hard refresh).")}catch(t){n(t instanceof Error?t.message:"Failed to save site settings")}finally{v(!1)}};return e.jsxs("section",{className:"px-4 py-8",children:[e.jsx(O,{eyebrow:"Admin",title:"Site Settings"}),e.jsx(I,{error:h}),e.jsx(L,{message:u}),e.jsxs("div",{className:"max-w-xl space-y-8",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{label:"Club image (top left of the header)",onChange:t=>r(a=>({...a,clubImageUrl:t})),value:s.clubImageUrl}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Shown top-left on every public page. Leave empty to use the built-in Shrewsbury Town badge."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{label:"Campaign email banner",onChange:t=>r(a=>({...a,campaignBannerImageUrl:t})),value:s.campaignBannerImageUrl}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Shown across the top of every campaign email. Swap it for a seasonal image (a Christmas banner, say) and every campaign picks it up. Leave empty to use the Shrewsbury Town badge. An individual campaign can override this from the email builder."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{id:"menu-color",label:"Menu colour",onChange:t=>r(a=>({...a,menuColor:t})),placeholder:U,resetLabel:"Reset to brand amber",value:s.menuColor}),e.jsx("div",{className:"flex items-center gap-3 pt-1",children:[["Default",x.base],["Hover",x.hover],["Selected",x.selected]].map(([t,a])=>e.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground text-xs",children:[e.jsx("span",{className:"inline-block h-5 w-8 rounded border",style:{backgroundColor:a}}),t]},t))}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Colours the main menu buttons and dropdown menus. Hover and selected shades are derived automatically."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"site-font",children:"Site font"}),e.jsx("select",{className:"h-9 w-64 rounded-md border bg-background px-3 text-sm",id:"site-font",onChange:t=>r(a=>({...a,siteFont:t.target.value})),value:s.siteFont,children:w.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsx("p",{className:"rounded-md border bg-muted/30 px-3 py-2 text-lg",style:{fontFamily:C[s.siteFont]},children:"Shrewsbury Town Football Club â fixtures, news and tickets."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Applies to the public site only â the admin area keeps its own font."})]}),e.jsxs("div",{className:"space-y-4 rounded-xl border p-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold text-base",children:"Retro mode â 140th anniversary"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Shows a RETRO toggle top-right of the public site. When a visitor flips it, the header switches to the original badge and the retro colours below. Their choice is remembered on their device."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{checked:s.retroEnabled,id:"retro-enabled",onCheckedChange:t=>r(a=>({...a,retroEnabled:t===!0}))}),e.jsx(l,{className:"cursor-pointer",htmlFor:"retro-enabled",children:"Show the RETRO toggle on the public site"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{label:"Retro club image (original badge)",onChange:t=>r(a=>({...a,retroClubImageUrl:t})),value:s.retroClubImageUrl}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Replaces the club image while retro mode is on. Leave empty to keep the normal image."})]}),e.jsx(g,{id:"retro-header-color",label:"Retro header colour",onChange:t=>r(a=>({...a,retroHeaderColor:t})),placeholder:k,resetLabel:"Reset to deep navy",value:s.retroHeaderColor}),e.jsx(g,{id:"retro-menu-color",label:"Retro menu colour",onChange:t=>r(a=>({...a,retroMenuColor:t})),placeholder:A,resetLabel:"Reset to white",value:s.retroMenuColor}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"retro-site-font",children:"Retro site font"}
1),e.jsx("select",{className:"h-9 w-64 rounded-md border bg-background px-3 text-sm",id:"retro-site-font",onChange:t=>r(a=>({...a,retroSiteFont:t.target.value})),value:s.retroSiteFont,children:w.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsx("p",{className:"rounded-md border bg-muted/30 px-3 py-2 text-lg",style:{fontFamily:C[s.retroSiteFont]},children:"Shrewsbury Town Football Club â est. 1886."}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"The whole public site switches to this font while a visitor has retro mode on."})]})]}),e.jsxs("div",{className:"space-y-4 rounded-xl border p-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold text-base",children:"Streaming"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"When on, the public site shows the Watch entry points (header link, Match Centre button, homepage promo). The /watch pages stay reachable by direct link either way."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{checked:s.watchEnabled,id:"watch-enabled",onCheckedChange:t=>r(a=>({...a,watchEnabled:t===!0}))}),e.jsx(l,{className:"cursor-pointer",htmlFor:"watch-enabled",children:"Show streaming / Watch features"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"watch-audio-entry",children:"Live audio channel id"}),e.jsx(b,{id:"watch-audio-entry",onChange:t=>r(a=>({...a,watchAudioEntryId:t.target.value})),placeholder:"e.g. 0_1l69aa6f",value:s.watchAudioEntryId}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"StreamAMG entry id for match commentary. Leave blank to offer no audio at all."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"watch-video-entry",children:"Live video channel id"}),e.jsx(b,{id:"watch-video-entry",onChange:t=>r(a=>({...a,watchVideoEntryId:t.target.value})),placeholder:"e.g. 0_3gbpcuxv",value:s.watchVideoEntryId}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"StreamAMG entry id for the video stream. Leave blank to offer no video at all."})]})]}),e.jsx(N,{disabled:f,onClick:F,type:"button",children:f?"Savingâ¦":"Save settings"})]})]})}function oe(){return e.jsx(M,{})}export{oe as component};
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.