1import{j as e,aF as U,cG as q,ci as B,aC as D,bs as M,r as x,K as f,bh as R,g6 as h}from"./index-jq8FrjtN.js";import{u as A}from"./useMutation-C8N43L_T.js";import{u as O,A as H}from"./AdminLayout-DTSWzk2Z.js";import{u as K}from"./UndoRedoButtons-BgiKaqr4.js";import{A as G}from"./AdminSaveHeader-DFj19MZy.js";import{A as Q}from"./AdminPreview-CThDGSaq.js";import{I as b}from"./input-9tT-03lN.js";import{L as j}from"./label-BCR_Lfre.js";import{S as V}from"./switch-DGWJxDy_.js";import{S as $,a as W,b as z,c as J,d as v}from"./select-D5vCCUf6.js";import{M as X}from"./MediaUploader-BEAWbB_R.js";import{I as Y}from"./ImagePositioner-DWe3g-sa.js";import{T as Z}from"./TextOverlayEditor-D1hBN0uH.js";import{P as ee}from"./panels-top-left-DPUFq6PQ.js";import{L as te,a as ae,m as oe}from"./LoginPageDesign-6ZGEBIu3.js";import"./storefront-q8YTqr7-.js";import"./BrandTemplateRouter-BAsIbGo6.js";import"./vtt-D3T_a5Nc.js";import"./captionsGrouping-BJhtOOH8.js";import"./captions-off-B-ugdnox.js";import"./maximize-2-at_rn65s.js";import"./shuffle-6NrHSaT1.js";import"./skip-forward-Cr95WXmZ.js";import"./audio-lines-CM6LwaxD.js";import"./mail-DvUOQ9jY.js";import"./trending-up-Cig2abHR.js";import"./chart-column-CcOKuiI0.js";import"./map-pin-CvKOf7wj.js";import"./message-square-DCD2gqzY.js";import"./gift-DKbGTBr8.js";import"./shopping-bag-BlEsNLRw.js";import"./languages-DRlUDL8e.js";import"./circle-help-BJ3VXYct.js";import"./useTimelineAxis-C6dYDx9o.js";import"./useTimelineWheel-jHdHCTBH.js";import"./refresh-cw-aUirpaqP.js";import"./undo-2-Db7ErcoE.js";import"./redo-2-B5ScCW3J.js";import"./saveMedia-5NqxfNxb.js";import"./zoom-out-rucrkJ6y.js";import"./zoom-in-CUvVg2u5.js";import"./save-B-8QjTHJ.js";import"./index-e2v1yxou.js";import"./VideoThumbnail-DwbqZdiC.js";import"./clipPoster-fLcoV5gS.js";import"./index-Dzd64Wun.js";import"./webpPreference-Aiiopq0j.js";import"./WebPToggle-D2Fnj0qH.js";import"./grid-3x3-dHotflmO.js";import"./move-CrQGxpL2.js";import"./lock-8NtAFjRX.js";import"./LinkPicker-ZShtJNqs.js";import"./UrlInput-C_KTyzDD.js";import"./link-BS5thsKK.js";import"./timer-CKQN_s2D.js";function d({title:t,icon:o,active:i,onClick:s,children:r}){return e.jsxs("div",{onClick:s,className:`rounded-lg border p-4 transition-all cursor-pointer ${i?"border-neutral-800 bg-white shadow-sm":"border-neutral-200 bg-neutral-50 hover:border-neutral-300"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o&&e.jsx("span",{className:"text-neutral-500",children:o}),e.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-neutral-600",children:t})]}),e.jsx("div",{onClick:l=>l.stopPropagation(),children:r})]})}function u({label:t,value:o,onChange:i}){return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{className:"text-[10px] text-neutral-400",children:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"color",value:o,onChange:s=>i(s.target.value),className:"w-8 h-8 rounded border border-neutral-200 cursor-pointer p-0"}),e.jsx(b,{value:o,onChange:s=>i(s.target.value),className:"flex-1 text-[11px] font-mono h-8"})]})]})}function se({form:t,set:o,setMulti:i,activeSection:s,setActiveSection:r}){const l=t.layout==="split"||t.layout==="split_right"||t.layout==="fullscreen";return e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{title:"Layout",icon:e.jsx(ee,{className:"w-4 h-4"}),active:s==="layout",onClick:()=>r("layout"),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs($,{value:t.layout,onValueChange:a=>o("layout",a),children:[e.jsx(W,{children:e.jsx(z,{})}),e.jsxs(J,{children:[e.jsx(v,{value:"split",children:"Split, Image left, form right"}),e.jsx(v,{value:"split_right",children:"Split, Form left, image right"}),e.jsx(v,{value:"centered",children:"Centered, Form card over background"}),e.jsx(v,{value:"fullscreen",children:"Fullscreen, Form over full background"})]})]}),e.jsxs("p",{className:"text-[10px] text-neutral-400",children:[t.layout==="split"&&"Shows a large background image on the left half and the login form on the right.",t.layout==="split_right"&&"Shows the login form on the left and a large background image on the right.",t.layout==="centered"&&"Displays a floating form card centered over the background.",t.layout==="fullscreen"&&"Login form overlays the full-screen background image."]})]})}
1),e.jsx(d,{title:"Background",icon:e.jsx(U,{className:"w-4 h-4"}),active:s==="background",onClick:()=>r("background"),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(X,{value:t.background_url||"",onChange:(a,m)=>{const y=m||(/\.(mp4|webm|mov|ogg)$/i.test(a||"")?"video":"image");i({background_url:a,background_type:a?y:"image"})},label:"Background image or video",accept:"image/*,video/*"}),t.background_url&&t.background_type!=="video"&&e.jsx(Y,{imageUrl:t.background_url,context:"hero_banner",initialPosition:t.background_position||"center center",onChange:a=>o("background_position",a),bannerLayout:t.layout==="split"?"two_column":"full_width",bannerHeight:"viewport",compact:!0}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{label:"Fallback Color",value:t.background_color||"#F5F5F5",onChange:a=>o("background_color",a)}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs(j,{className:"text-[10px] text-neutral-400",children:["Overlay Darkness (",t.background_overlay_opacity,"%)"]}),e.jsx("input",{type:"range",min:0,max:80,value:t.background_overlay_opacity||0,onChange:a=>o("background_overlay_opacity",Number(a.target.value)),className:"w-full mt-2"})]})]})]})}),l&&e.jsx(d,{title:"Background Text Overlays",icon:e.jsx(q,{className:"w-4 h-4"}),active:s==="overlays",onClick:()=>r("overlays"),children:e.jsx(Z,{overlays:t.text_overlays||[],onChange:a=>o("text_overlays",a),label:"Text on background"})}),e.jsx(d,{title:"Logo",active:s==="logo",onClick:()=>r("logo"),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-neutral-600",children:"Show logo on login page"}),e.jsx("p",{className:"text-[10px] text-neutral-400",children:"Uses your site logo from Site Settings"})]}),e.jsx(V,{checked:t.logo_visible,onCheckedChange:a=>o("logo_visible",a)})]}),t.logo_visible&&e.jsx(u,{label:"Logo Color",value:t.logo_color||"#2E2E2E",onChange:a=>o("logo_color",a)})]})}),e.jsx(d,{title:"Heading",icon:e.jsx(B,{className:"w-4 h-4"}),active:s==="heading",onClick:()=>r("heading"),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-xs mb-1 block",children:"Heading"}),e.jsx(b,{value:t.heading,onChange:a=>o("heading",a.target.value),placeholder:"Welcome back"})]}),e.jsxs("div",{children:[e.jsx(j,{className:"text-xs mb-1 block",children:"Subheading"}),e.jsx(b,{value:t.subheading,onChange:a=>o("subheading",a.target.value),placeholder:"Sign in to your account"})]})]})}),e.jsx(d,{title:"Form Styling",icon:e.jsx(D,{className:"w-4 h-4"}),active:s==="form",onClick:()=>r("form"),children:e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(u,{label:"Background",value:t.form_bg_color||"#FFFFFF",onChange:a=>o("form_bg_color",a)}),e.jsx(u,{label:"Text Color",value:t.form_text_color||"#2E2E2E",onChange:a=>o("form_text_color",a)}),e.jsx(u,{label:"Button Color",value:t.form_accent_color||"#1C1B17",onChange:a=>o("form_accent_color",a)})]})})})]})}function re({form:t,ss:o,isMobile:i,activeSection:s,onSectionClick:r}){return e.jsx(te,{settings:t,ss:o,isMobile:i,activeSection:s,onSectionClick:r})}function ct(){const t=M(),[o,i]=x.useState(ae),[s,r]=x.useState(!1),[l,a]=x.useState(null),{snapshot:m,undo:y,redo:C,canUndo:N,canRedo:S}=K();O(s);const{data:w=[]}=f({queryKey:["loginPageSettings"],queryFn:()=>h.entities.LoginPageSettings.list()}),{data:F=[]}=f({queryKey:["siteSettings"],queryFn:()=>h.entities.SiteSettings.list()}),g=w[0],L=F[0]||{};x.useEffect(()=>{g&&i(oe(g))},[g]);const P=(n,c)=>{m(o),i(p=>({...p,[n]:c})),r(!0)},E=n=>{m(o),i(c=>({...c,...n})),r(!0)},T=()=>{const n=y(o);n&&(i(n),r(!0))},I=()=>{const n=C(o);n&&(i(n),r(!0))},_=A({mutationFn:async n=>{const{id:c,created_date:p,updated_date:ie,created_by:ne,...k}=n;return g?h.entities.LoginPageSettings.update(g.id,k):h.entities.LoginPageSettings.create(k)},onSuccess:()=>{t.invalidateQueries({queryKey:["loginPageSettings"]}),r(!1),R.success("Saved")}});return e.jsx(H,{title:"Login Page",headerRight:e.jsx(G,{onSave:()=>_.mutate(o),saving:_.isPending,canUndo:N,canRedo:S,onUndo:T,onRedo:I}),children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-6",children:e.jsx(Q,{defaultVisible:!0,children:({isMobile:n,width:c,height:p})=>e.jsx(re,{form:o,ss:L,isMobile:n,width:c,height:p,activeSection:l,onSectionClick:a})})}
1),e.jsx(se,{form:o,set:P,setMulti:E,activeSection:l,setActiveSection:a})]})})}export{ct 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.