@jhits/plugin-website 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/131._entry.js +2 -0
- package/dist/131._entry.js.LICENSE.txt +6 -0
- package/dist/303._entry.js +1 -0
- package/dist/_entry.js +2 -0
- package/dist/_entry.js.LICENSE.txt +6 -0
- package/dist/api/handler.d.ts.map +1 -1
- package/dist/api/handler.js +15 -4
- package/dist/remoteEntry.js +1 -0
- package/dist/server.js +232 -0
- package/dist/types/settings.d.ts +18 -11
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/views/Settings/components/ContactInfoSection.d.ts +12 -0
- package/dist/views/Settings/components/ContactInfoSection.d.ts.map +1 -0
- package/dist/views/Settings/components/ContactInfoSection.js +14 -0
- package/dist/views/Settings/components/DomainLanguagesCard.d.ts +8 -0
- package/dist/views/Settings/components/DomainLanguagesCard.d.ts.map +1 -0
- package/dist/views/Settings/components/DomainLanguagesCard.js +12 -0
- package/dist/views/Settings/components/DomainLanguagesModal.d.ts +12 -0
- package/dist/views/Settings/components/DomainLanguagesModal.d.ts.map +1 -0
- package/dist/views/Settings/components/DomainLanguagesModal.js +38 -0
- package/dist/views/Settings/components/FlagIcon.d.ts +6 -0
- package/dist/views/Settings/components/FlagIcon.d.ts.map +1 -0
- package/dist/views/Settings/components/FlagIcon.js +11 -0
- package/dist/views/Settings/components/LaunchDateSection.d.ts +8 -0
- package/dist/views/Settings/components/LaunchDateSection.d.ts.map +1 -0
- package/dist/views/Settings/components/LaunchDateSection.js +22 -0
- package/dist/views/Settings/components/LocalesManagementCard.d.ts +8 -0
- package/dist/views/Settings/components/LocalesManagementCard.d.ts.map +1 -0
- package/dist/views/Settings/components/LocalesManagementCard.js +66 -0
- package/dist/views/Settings/components/LocalizedContentSection.d.ts +12 -0
- package/dist/views/Settings/components/LocalizedContentSection.d.ts.map +1 -0
- package/dist/views/Settings/components/LocalizedContentSection.js +17 -0
- package/dist/views/Settings/components/SeoIdentitySection.d.ts +9 -0
- package/dist/views/Settings/components/SeoIdentitySection.d.ts.map +1 -0
- package/dist/views/Settings/components/SeoIdentitySection.js +12 -0
- package/dist/views/Settings/components/SocialLinksSection.d.ts +13 -0
- package/dist/views/Settings/components/SocialLinksSection.d.ts.map +1 -0
- package/dist/views/Settings/components/SocialLinksSection.js +13 -0
- package/dist/views/Settings/components/StatusSection.d.ts +8 -0
- package/dist/views/Settings/components/StatusSection.d.ts.map +1 -0
- package/dist/views/Settings/components/StatusSection.js +27 -0
- package/dist/views/Settings/constants.d.ts +12 -0
- package/dist/views/Settings/constants.d.ts.map +1 -0
- package/dist/views/Settings/constants.js +23 -0
- package/dist/views/Settings/hooks/useWebsiteSettings.d.ts +24 -0
- package/dist/views/Settings/hooks/useWebsiteSettings.d.ts.map +1 -0
- package/dist/views/Settings/hooks/useWebsiteSettings.js +217 -0
- package/dist/views/Settings/types.d.ts +5 -0
- package/dist/views/Settings/types.d.ts.map +1 -0
- package/dist/views/Settings/types.js +1 -0
- package/dist/views/SettingsView.d.ts +3 -6
- package/dist/views/SettingsView.d.ts.map +1 -1
- package/dist/views/SettingsView.js +59 -262
- package/package.json +14 -10
- package/src/api/handler.ts +41 -4
- package/src/types/settings.ts +28 -12
- package/src/views/Settings/components/ContactInfoSection.tsx +109 -0
- package/src/views/Settings/components/DomainLanguagesCard.tsx +91 -0
- package/src/views/Settings/components/DomainLanguagesModal.tsx +216 -0
- package/src/views/Settings/components/FlagIcon.tsx +20 -0
- package/src/views/Settings/components/LaunchDateSection.tsx +111 -0
- package/src/views/Settings/components/LocalesManagementCard.tsx +198 -0
- package/src/views/Settings/components/LocalizedContentSection.tsx +155 -0
- package/src/views/Settings/components/SeoIdentitySection.tsx +98 -0
- package/src/views/Settings/components/SocialLinksSection.tsx +98 -0
- package/src/views/Settings/components/StatusSection.tsx +181 -0
- package/src/views/Settings/constants.ts +26 -0
- package/src/views/Settings/hooks/useWebsiteSettings.ts +240 -0
- package/src/views/Settings/types.ts +4 -0
- package/src/views/SettingsView.tsx +226 -674
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpluginWebsite=self.webpackChunkpluginWebsite||[]).push([[303],{303(e,a,t){t.r(a),t.d(a,{Index:()=>B,default:()=>B});var r=t(713),s=t(594),o=t.n(s),d=t(555),i=t(145),n=t(846),l=t(571),c=t(68),x=t(172),m=t(855),p=t(398),h=t(587),b=t(301);const u=[{code:"en",name:"English",countryCode:"gb"},{code:"sv",name:"Swedish",countryCode:"se"},{code:"nl",name:"Dutch",countryCode:"nl"},{code:"de",name:"German",countryCode:"de"},{code:"fr",name:"French",countryCode:"fr"},{code:"es",name:"Spanish",countryCode:"es"}],g=[{name:"Instagram",icon:o().createElement(h.ao$,{size:18})},{name:"Facebook",icon:o().createElement(h.iYk,{size:18})},{name:"Twitter",icon:o().createElement(b.TCj,{size:18})},{name:"Pinterest",icon:o().createElement(h.oCJ,{size:18})},{name:"LinkedIn",icon:o().createElement(h.QEs,{size:18})},{name:"TikTok",icon:o().createElement(h.kkU,{size:18})}];function y({code:e,countryCode:a,className:t="w-4 h-3"}){let s=a;return!s&&e&&(s=u.find(a=>a.code===e)?.countryCode||e),s?(0,r.jsx)("img",{src:`https://flagcdn.com/w20/${s.toLowerCase()}.png`,alt:e||s,className:`${t} object-contain rounded-xs shadow-xs`}):null}var f=t(818),j=t(360),v=t(696);function N({settings:e,activeTab:a,onUpdateLocalized:t}){const s=e.localizedIdentity?.[a]||{};return(0,r.jsxs)("section",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"size-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)(j.A,{size:20})}),(0,r.jsxs)("h3",{className:"text-2xl lg:text-3xl font-bold text-dashboard-text leading-none tracking-tight",children:["Identity ",(0,r.jsx)("span",{className:"text-primary",children:"& SEO"})]})]}),(0,r.jsxs)(f.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-dashboard-card/50 border border-dashboard-border/40 p-8 rounded-[2rem] space-y-6 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 right-0 w-64 h-64 blur-3xl opacity-5 bg-primary pointer-events-none"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between ml-2",children:[(0,r.jsxs)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] opacity-60",children:["System Name (",a,")"]}),(0,r.jsx)(v.A,{size:10,className:"text-primary animate-pulse"})]}),(0,r.jsx)("input",{type:"text",value:s.siteName||"",onChange:e=>t("siteName",e.target.value),placeholder:"INITIALIZE_NAME",className:"w-full px-6 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60",children:["Strategic Tagline (",a,")"]}),(0,r.jsx)("input",{type:"text",value:s.siteTagline||"",onChange:e=>t("siteTagline",e.target.value),placeholder:"DEFINE_TAGLINE",className:"w-full px-6 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30"})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60",children:["Global Description Protocol (",a,")"]}),(0,r.jsx)("textarea",{value:s.siteDescription||"",onChange:e=>t("siteDescription",e.target.value),placeholder:"A comprehensive architectural description for search engine crawlers...",rows:3,className:"w-full px-6 py-4 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-medium leading-relaxed outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30 resize-none"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60",children:["Indexing Keywords (",a,")"]}),(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)(l.A,{className:"absolute left-5 top-1/2 -translate-y-1/2 size-4 text-dashboard-text-secondary/40 group-focus-within:text-primary transition-colors"}),(0,r.jsx)("input",{type:"text",value:s.keywords||"",onChange:e=>t("keywords",e.target.value),placeholder:"comma, separated, identifiers",className:"w-full pl-12 pr-6 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30"})]}),(0,r.jsx)("p",{className:"text-[10px] text-dashboard-text-secondary/60 ml-4 font-medium opacity-60",children:"Separated by commas. These tokens facilitate high-signal discovery during search engine scanning."})]})]})]})}var w=t(109),z=t(191),k=t(168),S=t(775),C=t(215),A=t(246);function L({settings:e,activeTab:a,onUpdateContact:t,onAddSocial:s,onUpdateSocial:o,onRemoveSocial:d}){const i=e.localizedContactInfo?.[a]||{},l=e.localizedSocials?.[a]||[];return(0,r.jsxs)("section",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"size-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)(z.A,{size:20})}),(0,r.jsxs)("h3",{className:"text-2xl lg:text-3xl font-bold text-dashboard-text leading-none tracking-tight",children:["Localized ",(0,r.jsx)("span",{className:"text-primary",children:"Content"})]})]}),(0,r.jsxs)(f.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-dashboard-card/50 border border-dashboard-border/40 p-8 rounded-[2rem] space-y-8 relative overflow-hidden",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60",children:["Communication Vector (",a,")"]}),(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)(k.A,{className:"absolute left-5 top-1/2 -translate-y-1/2 size-4 text-dashboard-text-secondary/40 group-focus-within:text-primary transition-colors"}),(0,r.jsx)("input",{type:"tel",value:i.phoneNumber||"",onChange:e=>t("phoneNumber",e.target.value),placeholder:"INITIALIZE_PHONE",className:"w-full pl-12 pr-6 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30"})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60",children:["Geospatial Coordinates (",a,")"]}),(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)(S.A,{className:"absolute left-5 top-1/2 -translate-y-1/2 size-4 text-dashboard-text-secondary/40 group-focus-within:text-primary transition-colors"}),(0,r.jsx)("input",{type:"text",value:i.physicalAddress||"",onChange:e=>t("physicalAddress",e.target.value),placeholder:"STREET_ADDRESS_PROTOCOL",className:"w-full pl-12 pr-6 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30"})]})]})]}),(0,r.jsxs)("div",{className:"pt-8 border-t border-dashboard-border/40",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 ml-2",children:[(0,r.jsxs)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] opacity-60",children:["Social Ecosystem Nodes (",a,")"]}),(0,r.jsxs)("button",{onClick:s,className:"flex items-center gap-2 px-4 py-2 bg-primary text-white rounded-xl text-[10px] font-bold uppercase tracking-[0.15em] hover:bg-primary/90 transition-all shadow-lg shadow-primary/10 active:scale-95 group/btn overflow-hidden relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-linear-to-br from-white/20 to-transparent opacity-0 group-hover/btn:opacity-100 transition-opacity"}),(0,r.jsx)(C.A,{size:12,strokeWidth:3})," ",(0,r.jsx)("span",{children:"Link Node"})]})]}),(0,r.jsx)("div",{className:"space-y-3",children:(0,r.jsx)(w.N,{mode:"popLayout",children:l.length>0?l.map((e,a)=>{const t=g.find(a=>a.name===e.platform);return(0,r.jsxs)(f.P.div,{layout:!0,initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{delay:.05*a},className:"flex items-center gap-4 p-3 bg-dashboard-bg/30 border border-dashboard-border/40 rounded-xl group hover:border-primary/30 transition-all duration-500",children:[(0,r.jsx)("div",{className:"shrink-0 size-10 rounded-lg bg-dashboard-card/50 flex items-center justify-center border border-dashboard-border/40 text-dashboard-text-secondary/40 group-hover:text-primary group-hover:bg-primary/10 group-hover:border-primary/20 transition-all duration-500 shadow-inner",children:t?.icon||(0,r.jsx)(n.A,{size:18})}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col md:flex-row items-center gap-4",children:[(0,r.jsx)("div",{className:"w-full md:w-32 relative",children:(0,r.jsxs)("select",{value:e.platform,onChange:a=>o(e.id,"platform",a.target.value),className:"w-full bg-transparent border-none outline-none text-[10px] font-bold uppercase tracking-wider text-dashboard-text/90 cursor-pointer focus:text-primary transition-colors appearance-none",children:[(0,r.jsx)("option",{value:"",className:"bg-neutral-900",children:"PLATFORM"}),g.map(e=>(0,r.jsx)("option",{value:e.name,className:"bg-neutral-900",children:e.name},e.name))]})}),(0,r.jsx)("div",{className:"hidden md:block h-5 w-px bg-dashboard-border/40"}),(0,r.jsx)("input",{type:"url",value:e.url,onChange:a=>o(e.id,"url",a.target.value),placeholder:"URL_ENDPOINT",className:"flex-1 bg-transparent border-none outline-none text-xs font-bold text-dashboard-text/90 placeholder:text-dashboard-text-secondary/30 w-full"})]}),(0,r.jsx)("button",{onClick:()=>d(e.id),className:"p-2 text-dashboard-text-secondary/40 hover:text-red-500 hover:bg-red-500/10 rounded-lg opacity-0 group-hover:opacity-100 transition-all active:scale-90",children:(0,r.jsx)(A.A,{size:16})})]},e.id)}):(0,r.jsx)("div",{className:"text-center py-12 bg-dashboard-card/20 border border-dashed border-dashboard-border/40 rounded-2xl",children:(0,r.jsx)("p",{className:"text-[10px] text-dashboard-text-secondary/40 font-bold uppercase tracking-[0.2em]",children:"No social platforms initialized"})})})})]})]})]})}var T=t(572),D=t(781),I=t(323);function U({supportedLocales:e,onUpdate:a}){const[t,o]=(0,s.useState)(""),[d,i]=(0,s.useState)(!1),[l,c]=(0,s.useState)(""),x=t=>{if(e.some(e=>e.code===t.code)){if(e.length<=1)return void alert("You must have at least one language enabled.");a(e.filter(e=>e.code!==t.code))}else a([...e,t])},m=async()=>{const r=t.trim().toLowerCase();if(r)if(e.some(e=>e.code===r||e.countryCode===r))c("Language already added");else{i(!0),c("");try{const t=await fetch(`https://restcountries.com/v3.1/alpha/${r}`);if(!t.ok)throw new Error("Country not found");const s=(await t.json())[0];if(s){const t={code:r,name:s.name.common,countryCode:s.cca2.toLowerCase()};a([...e,t]),o("")}}catch(e){c("Could not find country code")}finally{i(!1)}}};return(0,r.jsxs)("section",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"size-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)(n.A,{size:20})}),(0,r.jsxs)("h3",{className:"text-2xl lg:text-3xl font-bold text-dashboard-text leading-none tracking-tight",children:["Localization ",(0,r.jsx)("span",{className:"text-primary",children:"Matrix"})]})]}),(0,r.jsxs)(f.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-dashboard-card/50 border border-dashboard-border/40 p-8 rounded-[2rem] space-y-8 relative overflow-hidden",children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 ml-2",children:[(0,r.jsx)(v.A,{size:12,className:"text-primary animate-pulse"}),(0,r.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-primary/60",children:"Active Translation Nodes"})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(0,r.jsx)(w.N,{mode:"popLayout",children:e.length>0?e.map(e=>(0,r.jsxs)(f.P.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"flex items-center justify-between p-4 bg-dashboard-bg/30 border border-dashboard-border/40 rounded-xl group hover:border-primary/30 transition-all duration-500 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"size-10 rounded-lg bg-dashboard-card/50 flex items-center justify-center border border-dashboard-border/40 group-hover:bg-primary/10 group-hover:border-primary/20 transition-all duration-500 shadow-inner",children:(0,r.jsx)(y,{countryCode:e.countryCode})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-sm font-bold text-dashboard-text/90 group-hover:text-primary transition-colors",children:e.name}),(0,r.jsx)("span",{className:"text-[10px] text-dashboard-text-secondary/70 font-bold tracking-widest uppercase mt-0.5",children:e.code})]})]}),(0,r.jsx)("button",{onClick:()=>x(e),className:"p-2 text-dashboard-text-secondary/40 hover:text-red-500 hover:bg-red-500/10 rounded-lg opacity-0 group-hover:opacity-100 transition-all active:scale-90",children:(0,r.jsx)(T.A,{size:16})})]},e.code)):(0,r.jsx)("div",{className:"col-span-2 py-12 text-center bg-dashboard-card/30 border-dashed border border-dashboard-border/40 rounded-2xl",children:(0,r.jsx)("p",{className:"text-xs text-dashboard-text-secondary/60 font-medium",children:"No active localization nodes detected."})})})})]}),(0,r.jsxs)("div",{className:"space-y-4 pt-8 border-t border-dashboard-border/40",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,r.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-primary/60",children:"Initialize New Region"}),l&&(0,r.jsx)("p",{className:"text-[10px] font-bold text-red-500 animate-pulse",children:l})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",value:t,onChange:e=>o(e.target.value.toUpperCase()),onKeyDown:e=>"Enter"===e.key&&m(),placeholder:"COUNTRY CODE (e.g. BE, JP, FR)",className:"w-full pl-6 pr-12 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-xs font-bold uppercase tracking-wider outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/40",maxLength:3}),d&&(0,r.jsx)(D.A,{className:"absolute right-4 top-1/2 -translate-y-1/2 size-4 animate-spin text-primary"})]}),(0,r.jsx)("button",{onClick:m,disabled:d||!t,className:"px-6 bg-primary text-white rounded-xl hover:bg-primary/90 transition-all shadow-lg shadow-primary/10 disabled:opacity-50 active:scale-95 flex items-center justify-center shrink-0",children:(0,r.jsx)(C.A,{size:20,strokeWidth:2.5})})]})]}),(0,r.jsxs)("div",{className:"space-y-4 pt-8 border-t border-dashboard-border/40",children:[(0,r.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-primary/60 ml-2",children:"Recommended Protocols"}),(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-3",children:u.filter(a=>!e.some(e=>e.code===a.code)).slice(0,6).map(e=>(0,r.jsxs)("button",{onClick:()=>x(e),className:"flex flex-col items-center gap-2 p-3 bg-dashboard-bg/30 border border-dashboard-border/40 hover:border-primary/40 hover:bg-primary/5 group transition-all duration-500 rounded-xl",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg bg-dashboard-card/50 flex items-center justify-center border border-dashboard-border/40 group-hover:border-primary/20 transition-all shadow-inner",children:(0,r.jsx)(y,{countryCode:e.countryCode})}),(0,r.jsx)("span",{className:"text-[10px] font-bold text-dashboard-text-secondary/60 group-hover:text-primary transition-colors truncate w-full text-center",children:e.name})]},e.code))})]}),(0,r.jsxs)("div",{className:"bg-primary/5 border border-primary/10 p-6 rounded-2xl flex items-start gap-4 group",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center text-primary shrink-0 border border-primary/20",children:(0,r.jsx)(I.A,{size:16})}),(0,r.jsx)("p",{className:"text-xs text-dashboard-text-secondary/70 font-medium leading-relaxed",children:"JHITS operates on a modular localization engine. Provisioning a region here will automatically synchronize translation schemas and localized data structures across the entire infrastructure."})]})]})]})}var _=t(487),E=t(189),O=(t(885),t(851)),P=t(840);function R(...e){return(0,P.QP)((0,O.$)(e))}function M({settings:e,onUpdate:a}){const t=e.launch_date&&new Date(e.launch_date).getTime()<=Date.now(),s=e.launched||t,d=!t&&e.maintenanceMode;return o().useEffect(()=>{if(!e.launch_date||t)return;if(new Date(e.launch_date).getTime()<=Date.now())return;const a=setInterval(()=>{new Date(e.launch_date).getTime()<=Date.now()&&(window.location.reload(),clearInterval(a))},1e3);return()=>clearInterval(a)},[e.launch_date]),(0,r.jsxs)("section",{className:"space-y-12",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)("div",{className:"size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)(i.A,{size:28})}),(0,r.jsxs)("h3",{className:"text-4xl lg:text-5xl font-bold text-dashboard-text leading-none",children:["Site ",(0,r.jsx)("span",{className:"text-primary",children:"Status"})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[(0,r.jsxs)(f.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-dashboard-card/50 border border-dashboard-border/50 p-10 rounded-[3rem] group relative overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 right-0 w-32 h-32 blur-3xl opacity-0 group-hover:opacity-10 transition-opacity bg-primary pointer-events-none"}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-10",children:[(0,r.jsx)("div",{className:R("size-16 rounded-2xl flex items-center justify-center transition-all duration-500 border relative overflow-hidden shadow-inner",s?"bg-emerald-500/10 border-emerald-500/20 text-emerald-500":"bg-neutral-500/5 border-neutral-500/10 text-neutral-400"),children:(0,r.jsx)(_.A,{size:28,className:R("relative z-10 transition-transform duration-500 group-hover:scale-110",s&&"animate-pulse")})}),(0,r.jsx)("button",{onClick:()=>{const t=!e.launched;a({launched:t,maintenanceMode:!t&&e.maintenanceMode})},className:R("relative w-16 h-8 rounded-full transition-all duration-500 p-1 shadow-inner",s?"bg-emerald-500":"bg-neutral-200 dark:bg-neutral-800"),children:(0,r.jsx)("div",{className:R("w-6 h-6 bg-white rounded-full transition-transform duration-500 shadow-lg",s?"translate-x-8":"translate-x-0")})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-[10px] font-bold text-primary uppercase tracking-[0.3em] mb-3 block opacity-60",children:"Deployment Vector"}),(0,r.jsx)("h4",{className:"text-2xl font-bold text-dashboard-text mb-3",children:s?"System Published":"Private Mode"}),(0,r.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 font-medium leading-relaxed",children:s?"Your website is live and visible to all users across the world.":"The website is currently restricted to internal use and development."})]})]}),(0,r.jsxs)(f.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:R("bg-dashboard-card/50 border border-dashboard-border/50 p-10 rounded-[3rem] group relative overflow-hidden transition-all duration-500",d&&"border-orange-500/30 bg-orange-500/10"),children:[(0,r.jsx)("div",{className:"absolute top-0 right-0 w-32 h-32 blur-3xl opacity-0 group-hover:opacity-10 transition-opacity bg-orange-500 pointer-events-none"}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-10",children:[(0,r.jsx)("div",{className:R("size-16 rounded-2xl flex items-center justify-center transition-all duration-500 border relative overflow-hidden shadow-inner",d?"bg-orange-500/10 border-orange-500/20 text-orange-500":"bg-neutral-500/5 border-neutral-500/10 text-neutral-400"),children:(0,r.jsx)(E.A,{size:28,className:"relative z-10 transition-transform duration-500 group-hover:scale-110"})}),(0,r.jsx)("button",{onClick:()=>a({maintenanceMode:!e.maintenanceMode}),className:R("relative w-16 h-8 rounded-full transition-all duration-500 p-1 shadow-inner",d?"bg-orange-500":"bg-neutral-200 dark:bg-neutral-800"),children:(0,r.jsx)("div",{className:R("w-6 h-6 bg-white rounded-full transition-transform duration-500 shadow-lg",d?"translate-x-8":"translate-x-0")})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-[10px] font-bold text-orange-500 uppercase tracking-[0.3em] mb-3 block opacity-60",children:"Operational Mode"}),(0,r.jsx)("h4",{className:"text-2xl font-bold text-dashboard-text mb-3",children:"Maintenance"}),(0,r.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 font-medium leading-relaxed",children:d?"Visitors see a maintenance screen. You can still access the dashboard.":"System is running normally. All features are available to public users."})]})]})]}),!1]})}var $=t(841),F=t(218);function J({settings:e,onUpdate:a}){return e.launched?(0,r.jsxs)("section",{className:"space-y-12",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)("div",{className:"size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)($.A,{size:28})}),(0,r.jsxs)("h3",{className:"text-4xl lg:text-5xl font-bold text-dashboard-text leading-none",children:["Launch ",(0,r.jsx)("span",{className:"text-primary",children:"History"})]})]}),(0,r.jsxs)(f.P.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},className:"bg-dashboard-card/50 border border-dashboard-border/50 p-10 rounded-[3rem] flex items-center gap-8 relative overflow-hidden group",children:[(0,r.jsx)("div",{className:"absolute top-0 right-0 w-48 h-48 blur-3xl opacity-5 bg-emerald-500 pointer-events-none"}),(0,r.jsx)("div",{className:"size-20 rounded-2xl bg-emerald-500/10 flex items-center justify-center border border-emerald-500/20 shadow-inner shrink-0",children:(0,r.jsx)("div",{className:"size-5 rounded-full bg-emerald-500 animate-pulse shadow-[0_0_20px_rgba(16,185,129,0.4)]"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-[10px] font-bold text-emerald-500 uppercase tracking-[0.3em] mb-2 block opacity-60",children:"System Temporal Status"}),(0,r.jsx)("h4",{className:"text-2xl font-bold text-dashboard-text",children:"System Fully Operational"}),e.launch_date&&(0,r.jsxs)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400 font-medium mt-2",children:["Initial Deployment Sequence: ",new Date(e.launch_date).toLocaleDateString(void 0,{dateStyle:"long"})]})]})]})]}):(0,r.jsxs)("section",{className:"space-y-12",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)("div",{className:"size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)(F.A,{size:28})}),(0,r.jsxs)("h3",{className:"text-4xl lg:text-5xl font-bold text-dashboard-text leading-none",children:["Launch ",(0,r.jsx)("span",{className:"text-primary",children:"Sequence"})]})]}),(0,r.jsxs)(f.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-dashboard-card/50 border border-dashboard-border/50 p-10 rounded-[3rem] space-y-10 relative overflow-hidden",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10",children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("label",{className:"text-[10px] font-bold text-primary uppercase tracking-[0.3em] ml-2 opacity-60",children:"Deployment Date"}),(0,r.jsx)("input",{type:"date",value:e.launch_date?e.launch_date.split("T")[0]:"",onChange:t=>{const r=t.target.value,s=e.launch_date?.includes("T")?e.launch_date.split("T")[1]:"00:00";a({launch_date:r?`${r}T${s}`:""})},className:"w-full px-8 py-5 bg-dashboard-card/50 border border-dashboard-border/50 rounded-[2rem] text-sm font-bold outline-none focus:ring-4 focus:ring-primary/10 transition-all text-dashboard-text placeholder:text-neutral-500"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("label",{className:"text-[10px] font-bold text-primary uppercase tracking-[0.3em] ml-2 opacity-60",children:"Synchronization Time (24h)"}),(0,r.jsx)("input",{type:"time",step:"60",value:e.launch_date?.includes("T")?e.launch_date.split("T")[1]:"00:00",onChange:t=>{const r=t.target.value,s=e.launch_date?.includes("T")?e.launch_date.split("T")[0]:(new Date).toISOString().split("T")[0];a({launch_date:r?`${s}T${r}`:""})},className:"w-full px-8 py-5 bg-dashboard-card/50 border border-dashboard-border/50 rounded-[2rem] text-sm font-bold outline-none focus:ring-4 focus:ring-primary/10 transition-all text-dashboard-text placeholder:text-neutral-500"})]})]}),(0,r.jsxs)("div",{className:"bg-dashboard-card/50 border border-dashboard-border/50 p-8 rounded-[2rem] bg-primary/5 flex items-start gap-5 group",children:[(0,r.jsx)("div",{className:"size-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary shrink-0 border border-primary/20",children:(0,r.jsx)(I.A,{size:18})}),(0,r.jsx)("p",{className:"text-xs text-neutral-500 dark:text-neutral-400 font-medium leading-relaxed",children:"The temporal countdown will be active on the system frontend. Upon reaching the zero-point, the architecture will automatically transition to an active production state."})]})]})]})}var G=t(883),H=t(265),Y=t(387),W=t(599);function q({config:e,onEdit:a}){return(0,r.jsxs)("section",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"size-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)(G.A,{size:20})}),(0,r.jsxs)("h3",{className:"text-2xl lg:text-3xl font-bold text-dashboard-text leading-none tracking-tight",children:["Domain ",(0,r.jsx)("span",{className:"text-primary",children:"Strategy"})]})]}),(0,r.jsxs)(f.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-dashboard-card/50 border border-dashboard-border/40 p-8 rounded-[2rem] relative overflow-hidden",children:[(0,r.jsx)("div",{className:"space-y-6",children:e&&e.length>0?(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:e.map((e,a)=>(0,r.jsxs)(f.P.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:.1*a},className:"flex items-center justify-between p-4 bg-dashboard-bg/30 border border-dashboard-border/40 rounded-xl group hover:border-primary/30 transition-all duration-500 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"size-10 rounded-lg bg-dashboard-card/50 flex items-center justify-center border border-dashboard-border/40 group-hover:bg-primary/10 group-hover:border-primary/20 transition-all duration-500 shadow-inner",children:(0,r.jsx)(y,{code:e.locale})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-sm font-bold text-dashboard-text/90 group-hover:text-primary transition-colors",children:e.domain}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,r.jsx)(H.A,{size:10,className:"text-primary opacity-40"}),(0,r.jsx)("p",{className:"text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-widest",children:"Primary Region"})]})]})]}),!e.allowUserOverride&&(0,r.jsx)("div",{className:"size-8 bg-dashboard-card/50 flex items-center justify-center text-dashboard-text-secondary/50 rounded-lg border border-dashboard-border/40",title:"Locked to this language",children:(0,r.jsx)(Y.A,{size:14})})]},a))}):(0,r.jsx)("div",{className:"py-12 text-center bg-dashboard-card/30 border-dashed border border-dashboard-border/40 rounded-2xl",children:(0,r.jsx)("p",{className:"text-[10px] text-dashboard-text-secondary/40 font-bold uppercase tracking-[0.2em]",children:"No domain-specific routing configured"})})}),(0,r.jsxs)("div",{className:"mt-8 pt-8 border-t border-dashboard-border/40 flex flex-col items-center",children:[(0,r.jsxs)("button",{onClick:a,className:"w-full max-w-sm relative group/btn flex items-center justify-center gap-4 px-8 py-3 bg-primary text-white rounded-xl text-[10px] font-bold uppercase tracking-[0.2em] transition-all shadow-xl shadow-primary/10 hover:shadow-primary/20 active:scale-[0.98] overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-linear-to-br from-white/20 to-transparent opacity-0 group-hover/btn:opacity-100 transition-opacity"}),(0,r.jsx)(W.A,{size:16}),(0,r.jsx)("span",{children:e?.length?"Update Configurations":"Configure Domain Routing"})]}),(0,r.jsx)("p",{className:"text-[10px] text-dashboard-text-secondary/60 text-center mt-6 font-medium max-w-md",children:"Domain-based routing allows you to orchestrate specific regional delivery protocols based on the incoming hostname."})]})]})]})}var Q=t(82);function V(...e){return(0,P.QP)((0,O.$)(e))}function K({isOpen:e,config:a,supportedLocales:t,onClose:o,onSaveAndClose:d,isSaving:i=!1}){const[n,l]=(0,s.useState)(a),[c,x]=(0,s.useState)(null);if((0,s.useEffect)(()=>{l(a),x(null)},[a,e]),!e)return null;const m=(e,a,t)=>{const r=[...n];r[e]={...r[e],[a]:t},l(r)};return(0,r.jsx)("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:(0,r.jsxs)(f.P.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},className:"bg-dashboard-card/50 w-full max-w-xl rounded-[2rem] border border-dashboard-border/40 shadow-2xl flex flex-col max-h-[90vh] overflow-hidden relative",children:[(0,r.jsx)("div",{className:"absolute top-0 right-0 w-64 h-64 blur-3xl opacity-5 bg-primary pointer-events-none"}),(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-dashboard-border/40 relative z-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner",children:(0,r.jsx)(G.A,{size:16})}),(0,r.jsxs)("h2",{className:"text-xl font-bold text-dashboard-text/90",children:["Domain ",(0,r.jsx)("span",{className:"text-primary",children:"Routing"})]})]}),(0,r.jsx)("button",{onClick:o,className:"p-2 text-dashboard-text-secondary/50 hover:text-dashboard-text transition-all hover:bg-white/5 rounded-lg",children:(0,r.jsx)(T.A,{size:18})})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-6 space-y-4 relative z-10 custom-scrollbar",children:[(0,r.jsx)(w.N,{mode:"popLayout",children:n.length>0?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("span",{className:"text-[10px] font-bold text-primary/60 uppercase tracking-[0.2em] ml-2",children:"Active Configurations"}),n.map((e,a)=>(0,r.jsxs)(f.P.div,{layout:!0,initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"bg-dashboard-bg/30 rounded-xl border border-dashboard-border/40 overflow-hidden transition-all duration-300 hover:border-primary/20",children:[(0,r.jsxs)("div",{onClick:()=>(e=>{x(c===e?null:e)})(a),className:"w-full flex items-center justify-between p-3.5 text-left hover:bg-primary/5 transition-all cursor-pointer",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"text-sm font-bold text-dashboard-text/90",children:e.domain||"UNCONFIGURED_HOST"}),(0,r.jsx)(H.A,{size:12,className:"text-primary opacity-40"}),(0,r.jsxs)("div",{className:"px-2 py-0.5 bg-dashboard-card/50 border border-dashboard-border/40 rounded-full flex items-center gap-2 bg-primary/5",children:[(0,r.jsx)(y,{code:e.locale}),(0,r.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-wider text-primary",children:e.locale})]}),!1===e.allowUserOverride&&(0,r.jsx)(Q.A,{size:10,className:"text-dashboard-text-secondary/50"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),(e=>{l(n.filter((a,t)=>t!==e)),c===e&&x(null)})(a)},className:"p-1.5 text-dashboard-text-secondary/40 hover:text-red-500 hover:bg-red-500/10 rounded-lg transition-all",children:(0,r.jsx)(A.A,{size:14})}),(0,r.jsx)("div",{className:V("transition-transform duration-300",c===a&&"rotate-180"),children:(0,r.jsx)(T.A,{size:12,className:"text-dashboard-text-secondary/40 rotate-45"})})]})]}),(0,r.jsx)(w.N,{children:c===a&&(0,r.jsx)(f.P.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:(0,r.jsxs)("div",{className:"p-4 pt-0 space-y-4 border-t border-dashboard-border/40 bg-dashboard-card/20",children:[(0,r.jsxs)("div",{className:"space-y-1.5 mt-4",children:[(0,r.jsx)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/60 uppercase tracking-[0.15em] ml-1",children:"Hostname Protocol"}),(0,r.jsx)("input",{type:"text",value:e.domain,onChange:e=>m(a,"domain",e.target.value),placeholder:"e.g. jhits.tech",className:"w-full px-4 py-2 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-lg text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,r.jsx)("label",{className:"text-[10px] font-bold text-dashboard-text-secondary/60 uppercase tracking-[0.15em] ml-1",children:"Regional Node"}),(0,r.jsx)("select",{value:e.locale,onChange:e=>m(a,"locale",e.target.value),className:"w-full px-4 py-2 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-lg text-sm font-bold uppercase tracking-wider outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text cursor-pointer appearance-none",children:t.map(e=>(0,r.jsx)("option",{value:e.code,className:"bg-neutral-900",children:e.name},e.code))})]}),(0,r.jsxs)("div",{className:"shrink-0 flex flex-col items-center gap-1.5 pt-4",children:[(0,r.jsx)("label",{className:"text-[9px] font-bold text-dashboard-text-secondary/50 uppercase tracking-widest",children:"User Override"}),(0,r.jsx)("button",{onClick:()=>m(a,"allowUserOverride",!e.allowUserOverride),className:V("relative w-10 h-5 rounded-full transition-all duration-300 p-0.5",e.allowUserOverride?"bg-primary":"bg-neutral-700"),children:(0,r.jsx)("div",{className:V("w-4 h-4 bg-white rounded-full transition-transform duration-300 shadow-sm",e.allowUserOverride?"translate-x-5":"translate-x-0")})})]})]})]})})})]},a))]}):(0,r.jsx)("div",{className:"py-12 text-center bg-dashboard-card/20 border-dashed border border-dashboard-border/40 rounded-2xl",children:(0,r.jsx)("p",{className:"text-[10px] text-dashboard-text-secondary/40 font-bold uppercase tracking-[0.2em]",children:"No domain-specific routing configured"})})}),(0,r.jsx)("div",{className:"pt-2",children:(0,r.jsxs)("button",{onClick:()=>{l([...n,{domain:"",locale:t[0]?.code||"en",allowUserOverride:!0}]),x(n.length)},className:"w-full flex items-center justify-center gap-2 px-4 py-3 border border-dashed border-dashboard-border/40 text-dashboard-text-secondary/50 hover:border-primary/40 hover:text-primary rounded-xl transition-all duration-500 font-bold uppercase text-[10px] tracking-[0.2em]",children:[(0,r.jsx)(C.A,{size:16}),"Add System Domain"]})})]}),(0,r.jsxs)("div",{className:"flex gap-3 p-6 border-t border-dashboard-border/40 relative z-10",children:[(0,r.jsx)("button",{onClick:o,className:"flex-1 px-4 py-2.5 bg-dashboard-card/30 hover:bg-white/5 text-dashboard-text/80 rounded-xl text-[10px] font-bold uppercase tracking-wider transition-all border border-dashboard-border/40",children:"Cancel"}),(0,r.jsxs)("button",{onClick:()=>d(n),disabled:i,className:"flex-1 px-4 py-2.5 bg-primary text-white rounded-xl text-[10px] font-bold uppercase tracking-[0.15em] transition-all shadow-xl shadow-primary/10 hover:shadow-primary/20 disabled:opacity-50 flex items-center justify-center gap-2",children:[i?(0,r.jsx)("div",{className:"size-3.5 border-2 border-white/20 border-t-white rounded-full animate-spin"}):(0,r.jsx)(p.A,{size:14}),(0,r.jsx)("span",{children:i?"Syncing...":"Deploy Config"})]})]})]})})}function Z({siteId:e}){const[a,t]=(0,s.useState)("general"),{settings:o,isLoading:h,isSaving:b,isDirty:u,showSuccess:g,activeTab:f,setActiveTab:j,activeLocales:v,showDomainModal:w,setShowDomainModal:z,handleUpdateSettings:k,handleUpdateLocalizedIdentity:S,handleUpdateLocalizedContact:C,handleAddLocalizedSocial:A,handleUpdateLocalizedSocial:T,handleRemoveLocalizedSocial:D,handleUpdateLocales:I,handleSave:_,handleReset:E,saveDomainConfigAndClose:O}=function(e){const[a,t]=(0,s.useState)(!0),[r,o]=(0,s.useState)(!1),[d,i]=(0,s.useState)(!1),[n,l]=(0,s.useState)(""),[c,x]=(0,s.useState)(!1),[m,p]=(0,s.useState)(""),[h,b]=(0,s.useState)({identifier:"site_config",contactEmail:"",smtpUser:"",maintenanceMode:!1,launched:!1,launch_date:"",supportedLocales:[],localizedIdentity:{},localizedContactInfo:{},localizedSocials:{},domainLocaleConfig:[]}),u=m!==JSON.stringify(h),g=h.supportedLocales;return(0,s.useEffect)(()=>{g.length>0&&(n&&g.some(e=>e.code===n)||l(g[0].code))},[g,n]),(0,s.useEffect)(()=>{(async()=>{try{t(!0);const e=await fetch("/api/plugin-website/settings",{credentials:"include",cache:"no-store"});if(!e.ok)throw new Error("Failed to fetch settings");const a=await e.json();if(a&&a.identifier){let e="";if(a.launch_date){const t=new Date(a.launch_date);if(!isNaN(t.getTime())){const a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0");e=`${a}-${r}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}}const t={...a,launch_date:e,supportedLocales:a.supportedLocales||[],localizedIdentity:a.localizedIdentity||{},localizedContactInfo:a.localizedContactInfo||{},localizedSocials:a.localizedSocials||{},domainLocaleConfig:a.domainLocaleConfig||[]};b(t),p(JSON.stringify(t)),t.supportedLocales.length>0&&l(t.supportedLocales[0].code)}}catch(e){console.error("Failed to load settings:",e)}finally{t(!1)}})()},[e]),{settings:h,isLoading:a,isSaving:r,isDirty:u,showSuccess:d,activeTab:n,setActiveTab:l,activeLocales:g,showDomainModal:c,setShowDomainModal:x,handleUpdateSettings:e=>{b(a=>({...a,...e}))},handleUpdateLocalizedIdentity:(e,a)=>{n&&b(t=>({...t,localizedIdentity:{...t.localizedIdentity,[n]:{...t.localizedIdentity?.[n]||{},[e]:a}}}))},handleUpdateLocalizedContact:(e,a)=>{n&&b(t=>({...t,localizedContactInfo:{...t.localizedContactInfo,[n]:{...t.localizedContactInfo?.[n]||{},[e]:a}}}))},handleAddLocalizedSocial:()=>{if(!n)return;const e=h.localizedSocials?.[n]||[],a=Date.now();b(t=>({...t,localizedSocials:{...t.localizedSocials,[n]:[...e,{id:a,platform:"",url:""}]}}))},handleUpdateLocalizedSocial:(e,a,t)=>{if(!n)return;const r=h.localizedSocials?.[n]||[];b(s=>({...s,localizedSocials:{...s.localizedSocials,[n]:r.map(r=>r.id===e?{...r,[a]:t}:r)}}))},handleRemoveLocalizedSocial:e=>{if(!n)return;const a=h.localizedSocials?.[n]||[];b(t=>({...t,localizedSocials:{...t.localizedSocials,[n]:a.filter(a=>a.id!==e)}}))},handleUpdateLocales:e=>{b(a=>({...a,supportedLocales:e}))},handleSave:async()=>{if(0!==h.supportedLocales.length)try{if(o(!0),!(await fetch("/api/plugin-website/settings",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(h)})).ok)throw new Error("Failed to save settings");p(JSON.stringify(h)),i(!0),setTimeout(()=>i(!1),3e3)}catch(e){console.error("Failed to save settings:",e)}finally{o(!1)}else alert("At least one language must be enabled.")},handleReset:()=>{m&&b(JSON.parse(m))},saveDomainConfigAndClose:async e=>{const a={...h,domainLocaleConfig:e};b(a),x(!1);try{await fetch("/api/plugin-website/settings",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(a)}),p(JSON.stringify(a)),i(!0),setTimeout(()=>i(!1),3e3)}catch(e){console.error("Auto-save failed")}}}}(e);if(h)return(0,r.jsx)("div",{className:"h-full w-full bg-dashboard-card text-dashboard-text flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)(d.A,{className:"w-8 h-8 animate-spin text-primary mx-auto mb-4"}),(0,r.jsx)("p",{className:"text-sm text-dashboard-text-secondary",children:"Loading settings..."})]})});const P=o.supportedLocales&&o.supportedLocales.length>0,R=[{id:"general",label:"General",icon:i.A,description:"Status & Launch Date",localized:!1},{id:"localization",label:"Localization",icon:n.A,description:"Languages & Domains",localized:!1},{id:"seo",label:"Identity & SEO",icon:l.A,description:"Site Name & Meta",localized:!0},{id:"contact",label:"Contact & Social",icon:c.A,description:"Address & Links",localized:!0}];return(0,r.jsxs)("div",{className:"absolute inset-0 w-full flex overflow-hidden bg-dashboard-bg/50",children:[(0,r.jsxs)("aside",{className:"w-80 bg-dashboard-card/40 backdrop-blur-2xl border-r border-dashboard-border/60 flex flex-col p-6 flex-shrink-0 h-full",children:[(0,r.jsxs)("div",{className:"mb-12 px-2 shrink-0 pt-8",children:[(0,r.jsxs)("h1",{className:"text-3xl font-bold text-dashboard-text tracking-tight flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 bg-primary rounded-lg flex items-center justify-center shadow-lg shadow-primary/20",children:(0,r.jsx)(i.A,{size:18,className:"text-white"})}),"Settings"]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-3 ml-11",children:[(0,r.jsx)("p",{className:"text-[10px] font-bold text-primary/80 uppercase tracking-widest",children:"Website Engine"}),u&&(0,r.jsx)("span",{className:"flex size-2 rounded-full bg-amber-500 animate-pulse shadow-[0_0_8px_rgba(245,158,11,0.5)]",title:"Unsaved changes"})]})]}),(0,r.jsx)("nav",{className:"space-y-2 flex-1 overflow-y-auto custom-scrollbar pr-2",children:R.map(e=>{const s=e.icon,o=a===e.id,d=e.localized&&!P;return(0,r.jsxs)("button",{onClick:()=>!d&&t(e.id),className:`w-full flex items-center gap-4 p-4 rounded-2xl transition-all text-left group relative ${o?"bg-primary text-white shadow-xl shadow-primary/25 border border-primary/20":"hover:bg-primary/8 text-dashboard-text-secondary hover:text-primary border border-transparent"} ${d?"opacity-40 cursor-not-allowed":"cursor-pointer"}`,children:[(0,r.jsx)("div",{className:"flex items-center justify-center shrink-0 transition-transform duration-300 "+(o?"scale-110":"group-hover:scale-110"),children:(0,r.jsx)(s,{size:20,className:o?"text-white":"text-primary/60 group-hover:text-primary"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"block text-sm font-semibold tracking-tight truncate "+(o?"text-white":"text-dashboard-text"),children:e.label}),d&&(0,r.jsx)(x.A,{size:12,className:"text-dashboard-text-secondary opacity-50"})]}),(0,r.jsx)("span",{className:"text-[10px] font-medium opacity-70 truncate block mt-0.5 "+(o?"text-white/80":"text-dashboard-text-secondary"),children:e.description})]})]},e.id)})}),(0,r.jsxs)("div",{className:"mt-auto space-y-4 pt-8 border-t border-dashboard-border/40",children:[u&&(0,r.jsx)("button",{onClick:E,className:"w-full py-3 rounded-xl text-xs font-bold text-dashboard-text-secondary hover:text-dashboard-text hover:bg-dashboard-card/60 transition-all active:scale-[0.98]",children:"Discard Changes"}),(0,r.jsxs)("button",{onClick:_,disabled:b,className:"w-full flex items-center justify-center gap-3 py-4 rounded-2xl text-sm font-bold transition-all active:scale-[0.98] "+(b?"bg-neutral-200 dark:bg-neutral-800 text-neutral-400 cursor-not-allowed":g?"bg-emerald-500 text-white shadow-lg shadow-emerald-500/20":u?"bg-primary text-white hover:bg-primary/90 shadow-xl shadow-primary/30":"bg-neutral-100 dark:bg-neutral-800/40 text-dashboard-text-secondary opacity-40 cursor-not-allowed"),children:[b?(0,r.jsx)(d.A,{className:"w-4 h-4 animate-spin"}):g?(0,r.jsx)(m.A,{className:"w-4 h-4"}):(0,r.jsx)(p.A,{className:"w-4 h-4"}),b?"Saving...":g?"Saved!":"Save Changes"]})]})]}),(0,r.jsxs)("main",{className:"flex-1 flex flex-col min-w-0 bg-transparent",children:[(0,r.jsxs)("div",{className:"h-24 px-12 flex items-center justify-between shrink-0 z-10 bg-dashboard-bg/20 backdrop-blur-sm border-b border-dashboard-border/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)("div",{className:"h-10 w-1.5 bg-primary rounded-full shadow-[0_0_10px_rgba(var(--color-primary),0.3)]"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-dashboard-text tracking-tight leading-none mb-1.5",children:R.find(e=>e.id===a)?.label}),(0,r.jsx)("p",{className:"text-xs font-medium text-dashboard-text-secondary opacity-80",children:R.find(e=>e.id===a)?.description})]})]}),("seo"===a||"contact"===a)&&(0,r.jsx)("div",{className:"flex gap-1.5 p-1.5 bg-dashboard-card/50 backdrop-blur-md rounded-2xl border border-dashboard-border/40 shadow-sm",children:v.map(e=>(0,r.jsxs)("button",{onClick:()=>j(e.code),className:"px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-2.5 "+(f===e.code?"bg-primary text-white shadow-md":"text-dashboard-text-secondary hover:text-dashboard-text hover:bg-dashboard-card/80"),children:[(0,r.jsx)(y,{code:e.code,countryCode:e.countryCode}),e.code.toUpperCase()]},e.code))})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-12 pb-12 pt-6 custom-scrollbar",children:(0,r.jsx)("div",{className:"max-w-4xl",children:(()=>{const e=R.find(e=>e.id===a);if(e?.localized&&!P)return(0,r.jsx)("div",{className:"h-full flex items-center justify-center p-12",children:(0,r.jsxs)("div",{className:"max-w-md w-full text-center space-y-8",children:[(0,r.jsx)("div",{className:"size-24 bg-primary/15 rounded-[2rem] flex items-center justify-center mx-auto shadow-2xl shadow-primary/10 border border-primary/30",children:(0,r.jsx)(n.A,{size:48,className:"text-primary animate-pulse"})}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"text-3xl font-bold text-dashboard-text tracking-tight",children:"Configuration Required"}),(0,r.jsx)("p",{className:"text-sm text-dashboard-text-secondary font-medium leading-relaxed opacity-80",children:"To manage localized content like site names and contact info, you first need to define which languages your website supports."})]}),(0,r.jsx)("button",{onClick:()=>t("localization"),className:"inline-flex items-center gap-3 px-8 py-4 bg-primary text-white rounded-2xl text-xs font-bold uppercase tracking-wider hover:bg-primary/90 transition-all shadow-lg shadow-primary/25 active:scale-95",children:"Setup Languages Now"})]})});switch(a){case"general":return(0,r.jsxs)("div",{className:"space-y-10 max-w-3xl",children:[(0,r.jsx)(M,{settings:o,onUpdate:k}),(0,r.jsx)(J,{settings:o,onUpdate:k})]});case"localization":return(0,r.jsxs)("div",{className:"space-y-10 max-w-3xl",children:[(0,r.jsx)(U,{supportedLocales:o.supportedLocales,onUpdate:I}),(0,r.jsx)(q,{config:o.domainLocaleConfig||[],onEdit:()=>z(!0)})]});case"seo":return(0,r.jsx)("div",{className:"max-w-3xl",children:(0,r.jsx)(N,{settings:o,activeTab:f,onUpdateLocalized:S})});case"contact":return(0,r.jsx)("div",{className:"max-w-3xl",children:(0,r.jsx)(L,{settings:o,activeTab:f,onUpdateContact:C,onAddSocial:A,onUpdateSocial:T,onRemoveSocial:D})});default:return null}})()})})]}),(0,r.jsx)(K,{isOpen:w,config:o.domainLocaleConfig||[],supportedLocales:v,onClose:()=>z(!1),onSaveAndClose:O,isSaving:b})]})}function B({subPath:e,siteId:a,locale:t}){return e[0],(0,r.jsx)(Z,{siteId:a,locale:t})}}}]);
|