PageSourceSearch

https://nrewind.com/assets/admin.settings-CCDITMn4.js

js nrewind.com collected 2026-10-09 22:03:52 UTC 11,555 bytes, 1 lines download raw bytes

1import{d as F,aO as E,bY as q,x as z,s as A,r as v,bZ as I,y,j as e,bM as G,v as _,a3 as P,z as R}from"./index-CUEiybWm.js";import{u as B}from"./useMutation-DCM591yd.js";import{u as C}from"./useServerFn-Bz1gkIp4.js";import{R as L,u as U}from"./RichTextEditor-B9rUPQNC.js";import{I as l}from"./input-CzSHQhF2.js";import{L as S}from"./label-D3CdILlG.js";import{F as T,g as O,S as M}from"./social-icons-qaIVbV7p.js";import{S as H}from"./settings-BO31X_Ue.js";import{S as D}from"./save-hK9aakMP.js";import{I as k}from"./image-BwA41p_F.js";import{T as w}from"./trash-2-BJKZq0Pu.js";import{P as N}from"./plus-B61eSGM6.js";import{S as Q}from"./share-2-B1XxhfV7.js";import{U as K}from"./upload-IRBmqjrb.js";import"./quote-Ze1ag3K4.js";import"./minus-CI5pGEij.js";import"./link-CmZtzh4I.js";import"./utils-BQHNewu7.js";import"./index-BJghfOUg.js";import"./index-DsrUXylw.js";const Y=[["path",{d:"M4 11a9 9 0 0 1 9 9",key:"pv89mb"}],["path",{d:"M4 4a16 16 0 0 1 16 16",key:"k0647b"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],V=F("rss",Y),J={site:{favicon_url:""},header:{logo_url:"",logo_dark_url:""},footer:{logo_url:"",cta:{eyebrow:"Booking Q3 sprints",heading:"Have a vision? **Let's build it together.**",button_text:"Start a project",button_link:"/contact",email:"[email protected]"},marquee:["Design that compounds","Code that ships","Brands that resonate","Growth that lasts","Senior-only pods"],first_column:{rich_text:"A senior-only growth studio shipping brands, products and performance for ambitious teams worldwide.",subscription_eyebrow:"Get the newsletter",subscription_footnote:"One sharp email a month. Unsubscribe anytime."},contact:{address:"Kolkata · Bengaluru · Remote-first",phone:"+91 00 0000 0000",phone_href:"tel:+910000000000"},socials:[{label:"Instagram",href:"#",icon:"instagram"},{label:"LinkedIn",href:"#",icon:"linkedin"},{label:"Twitter",href:"#",icon:"twitter"},{label:"YouTube",href:"#",icon:"youtube"},{label:"GitHub",href:"#",icon:"github"}],copyright:"© {year} NRewind Technologies. All rights reserved."}},Z=E({queryKey:["global-settings"],queryFn:()=>q(),staleTime:6e4});function h({title:u,desc:a,icon:o,children:d}){return e.jsxs("section",{className:"rounded-2xl border border-black/5 bg-white p-5 md:p-6",children:[e.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-xl bg-gradient-to-br from-[#0462EC] to-[#04BEFA] text-white",children:e.jsx(o,{size:16})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold uppercase tracking-widest text-black/70",children:u}),a&&e.jsx("p",{className:"text-xs text-black/50",children:a})]})]}),e.jsx("div",{className:"space-y-4",children:d})]})}function c({label:u,children:a}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{className:"text-xs font-semibold text-black/70",children:u}),a]})}function j({label:u,value:a,folder:o,onChange:d}){const p=v.useRef(null),[m,r]=v.useState(!1),x=C(U),f=async b=>{r(!0);try{const n=new FormData;n.append("file",b),n.append("folder",o);const{url:t}=await x({data:n});d(t),y.success("Uploaded")}catch(n){y.error(n.message||"Upload failed")}finally{r(!1),p.current&&(p.current.value="")}};return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(S,{className:"text-xs font-semibold text-black/70",children:u}),e.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-black/10 bg-black/[0.02] p-3",children:[e.jsx("div",{className:"grid h-16 w-16 shrink-0 place-items-center overflow-hidden rounded-lg border border-black/10 bg-white",children:a?e.jsx("img",{src:a,alt:"",className:"h-full w-full object-contain"}):e.jsx(k,{size:18,className:"text-black/30"})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsx("div",{className:"truncate text-xs text-black/50",children:a||"No image uploaded"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>p.current?.click(),disabled:m,className:"inline-flex items-center gap-1.5 rounded-md bg-gradient-to-r from-[#0462EC] to-[#04BEFA] px-3 py-1.5 text-xs font-bold text-white shadow disabled:opacity-60",children:[m?e.jsx(R,{size:12,className:"animate-spin"}):e.jsx(K,{size:12}),m?"Uploading…":a?"Replace":"Upload"]}),a&&e.jsxs("button",{type:"button",onClick:()=>d(""),className:"inline-flex items-center gap-1.5 rounded-md border border-black/10 px-3 py-1.5 text-xs font-semibold text-black/60 hover:border-red-300 hover:text-red-600",children:[e.jsx(w,{size:12})," Remove"]})]})]}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:b=>{const n=b.target.files?.[0];n&&f(n)}})]})]})}function ge(){const u=z(),{data:a}=A(Z),[o,d]=v.useState(a??J);v.useEffect(()=>{a&&d(a)},[a]);const p=C(I),m=B({mutationFn:t=>p({data:t}),onSuccess:t=>{u.setQueryData(["global-settings"],t),y.success("Global settings saved")},onError:t=>y.error(t.message||"Failed to save")}),r=(t,i)=>d(s=>({...s,footer:{...s.footer,[t]:i}})),x=t=>r("cta",{...o.footer.cta,...t}),f=t=>r("first_column",{...o.footer.first_column,...t}),b=t=>r("contact",{...o.footer.contact,...t});return e.jsxs("form",{onSubmit:t=>{t.preventDefault(),m.mutate(o)},className:"space-y-6 pb-24",children:[e.jsxs("div",{className:"sticky top-[64px] z-10 -mx-4 -mt-4 mb-2 flex items-center justify-between border-b border-black/5 bg-white/85 px-4 py-3 backdrop-blur md:-mx-6 md:-mt-6 md:px-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-bold uppercase tracking-widest text-black/40",children:[e.jsx(H,{size:12})," Global settings"]}),e.jsx("div",{className:"-mt-0.5 text-lg font-extrabold leading-tight",children:"Site-wide header & footer"})]}),e.jsxs("button",{type:"submit",disabled:m.isPending,className:"inline-flex items-center gap-1.5 rounded-xl bg-gradient-to-r from-[#0462EC] to-[#04BEFA] px-4 py-2.5 text-sm font-bold text-white shadow-lg shadow-[#0462EC]/25 transition hover:shadow-xl disabled:opacity-60",children:[e.jsx(D,{size:14})," ",m.isPending?"Saving…":"Save changes"]})]}),e.jsx(h,{title:"Site identity",icon:k,desc:"Favicon shown in browser tabs and bookmarks across every page.",children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.jsx(j,{label:"Favicon (PNG / SVG / ICO, square, ≥64×64)",value:o.site?.favicon_url??"",folder:"favicons",onChange:t=>d({...o,site:{...o.site,favicon_url:t}})})})}),e.jsx(h,{title:"Logos",icon:k,desc:"Upload PNG/SVG/JPG (≤5 MB). Files are stored in the uploads bucket.",children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsx(j,{label:"Header logo (light)",value:o.header.logo_url,folder:"logos",onChange:t=>d({...o,header:{...o.header,logo_url:t}})}),e.jsx(j,{label:"Header logo (dark / sticky)",value:o.header.logo_dark_url,folder:"logos",onChange:t=>d({...o,header:{...o.header,logo_dark_url:t}})}),e.jsx(j,{label:"Footer logo",value:o.footer.logo_url,folder:"logos",onChange:t=>r("logo_url",t)})]})}),e.jsx(h,{title:"Footer CTA",icon:G,children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(c,{label:"Eyebrow",children:e.jsx(l,{value:o.footer.cta.eyebrow,onChange:t=>x({eyebrow:t.target.value})})}),e.jsx(c,{label:"Email",children:e.jsx(l,{value:o.footer.cta.email,onChange:t=>x({email:t.target.value})})}),e.jsx(c,{label:"Heading (wrap gradient part in **double asterisks**)",children:e.jsx(l,{value:o.footer.cta.heading,onChange:t=>x({heading:t.target.value}),placeholder:"Have a vision? **Let's build it together.**"})}),e.jsx(c,{label:"Button text",children:e.jsx(l,{value:o.footer.cta.button_text,onChange:t=>x({button_text:t.target.value})})}),e.jsx(c,{label:"Button link",children:e.jsx(l,{value:o.footer.cta.button_link,onChange:t=>x({button_link:t.target.value})})})]})}),e.jsx(h,{title:"Footer marquee",icon:V,desc:"Repeating tagline strip. One line per row.",children:e.jsxs("div",{className:"space-y-2",children:[o.footer.marquee.map((t,i)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{value:t,onChange:s=>{const g=[...o.footer.marquee];g[i]=s.target.value,r("marquee",g)}}),e.jsx("button",{type:"button",onClick:()=>r("marquee",o.footer.marquee.filter((s,g)=>g!==i)),className:"grid h-9 w-9 place-items-center rounded-md border border-black/10 text-black/60 hover:border-red-300 hover:text-red-600",children:e.jsx(w,{size:14})})]},i)),e.jsxs("button",{type:"button",onClick:()=>r("marquee",[...o.footer.marquee,""]),className:"inline-flex items-center gap-1.5 rounded-md border border-dashed border-black/15 px-3 py-2 text-xs font-semibold text-black/60 hover:border-[#0462EC]/40 hover:text-[#0462EC]",children:[e.jsx(N,{size:12})," Add line"]})]})}),e.jsxs(h,{title:"Footer first column",icon:_,children:[e.jsx(c,{label:"Description (rich text)",children:e.jsx(L,{value:o.footer.first_column.rich_text,onChange:t=>f({rich_text:t}),placeholder:"Short intro paragraph…"})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(c,{label:"Subscription eyebrow",children:e.jsx(l,{value:o.footer.first_column.subscription_eyebrow,onChange:t=>f({subscription_eyebrow:t.target.value})})}),e.jsx(c,{label:"Subscription footnote",children:e.jsx(l,{value:o.footer.first_column.subscription_footnote,onChange:t=>f({subscription_footnote:t.target.value})})})]})]}),e.jsx(h,{title:"Contact",icon:P,children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(c,{label:"Address",children:e.jsx(l,{value:o.footer.contact.address,onChange:t=>b({address:t.target.value})})}),e.jsx(c,{label:"Phone (display)",children:e.jsx(l,{value:o.footer.contact.phone,onChange:t=>b({phone:t.target.value})})}),e.jsx(c,{label:"Phone link (tel:…)",children:e.jsx(l,{value:o.footer.contact.phone_href,onCh
1ange:t=>b({phone_href:t.target.value})})})]})}),e.jsx(h,{title:"Social links",icon:Q,desc:"Pick a FontAwesome brand icon for each link.",children:e.jsxs("div",{className:"space-y-2",children:[o.footer.socials.map((t,i)=>e.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-[auto_1fr_1fr_1.5fr_auto]",children:[e.jsx("div",{className:"grid h-9 w-9 place-items-center rounded-md border border-black/10 bg-black/[0.03] text-black/70",children:e.jsx(T,{icon:O(t.icon),className:"h-4 w-4"})}),e.jsx(l,{placeholder:"Label",value:t.label,onChange:s=>n(i,{label:s.target.value})}),e.jsx("select",{value:t.icon,onChange:s=>n(i,{icon:s.target.value}),className:"h-9 rounded-md border border-black/10 bg-white px-2 text-sm",children:M.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(l,{placeholder:"https://…",value:t.href,onChange:s=>n(i,{href:s.target.value})}),e.jsx("button",{type:"button",onClick:()=>r("socials",o.footer.socials.filter((s,g)=>g!==i)),className:"grid h-9 w-9 place-items-center rounded-md border border-black/10 text-black/60 hover:border-red-300 hover:text-red-600",children:e.jsx(w,{size:14})})]},i)),e.jsxs("button",{type:"button",onClick:()=>r("socials",[...o.footer.socials,{label:"",href:"#",icon:"globe"}]),className:"inline-flex items-center gap-1.5 rounded-md border border-dashed border-black/15 px-3 py-2 text-xs font-semibold text-black/60 hover:border-[#0462EC]/40 hover:text-[#0462EC]",children:[e.jsx(N,{size:12})," Add social link"]})]})}),e.jsx(h,{title:"Copyright",icon:_,desc:"Use {year} for the current year.",children:e.jsx(c,{label:"Copyright text",children:e.jsx(l,{value:o.footer.copyright,onChange:t=>r("copyright",t.target.value)})})})]});function n(t,i){const s=[...o.footer.socials];s[t]={...s[t],...i},r("socials",s)}}export{ge 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.