"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1561],{7:(e,r,t)=>{t.d(r,{y:()=>a});var s=t(4208);function a({title:e,description:r}){return(0,s.jsxs)("header",{className:"mb-6",children:[(0,s.jsx)("h2",{className:"text-lg font-medium text-foreground",children:e}),r?(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:r}):null]})}},4023:(e,r,t)=>{t.d(r,{I:()=>d});var s=t(4208),a=t(91356),n=t(58113);function i({children:e}){return(0,s.jsx)("div",{className:"flex min-w-0 flex-1 flex-col gap-4 lg:gap-5",children:e})}function d({columns:e,children:r,className:t}){let l=a.Children.toArray(r).filter(Boolean);if(1===e)return(0,s.jsx)("div",{className:(0,n.cn)("flex w-full flex-col gap-4",t),children:r});let c=l.filter((e,r)=>r%2==0),o=l.filter((e,r)=>r%2==1);return(0,s.jsxs)("div",{className:(0,n.cn)("w-full",t),children:[(0,s.jsx)("div",{className:"flex flex-col gap-4 lg:hidden",children:l.map((e,r)=>(0,s.jsx)("div",{className:"min-w-0",children:e},r))}),(0,s.jsxs)("div",{className:"hidden items-start gap-5 lg:flex",children:[(0,s.jsx)(i,{children:c.map((e,r)=>(0,s.jsx)("div",{className:"min-w-0",children:e},r))}),(0,s.jsx)(i,{children:o.map((e,r)=>(0,s.jsx)("div",{className:"min-w-0",children:e},r))})]})]})}},6078:(e,r,t)=>{t.d(r,{v:()=>i});var s=t(4208),a=t(61554),n=t(18747);function i({isFetching:e,isError:r,onRetry:t}){let{ready:a,authenticated:l}=(0,n.v)();return!a||e?null:l?r?(0,s.jsx)(d,{onRetry:t}):null:(0,s.jsx)("p",{className:"mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900/40 dark:bg-amber-950/30 dark:text-amber-200",children:"Connectez-vous pour synchroniser avec le serveur. Les r\xe9glages locaux restent disponibles hors ligne."})}function d({onRetry:e}){return(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[(0,s.jsx)("span",{children:"\xc9chec de synchronisation avec le serveur."}),e?(0,s.jsx)(a.$,{type:"button",variant:"outline",size:"sm",className:"h-7",onClick:e,children:"R\xe9essayer"}):null]})}},12154:(e,r,t)=>{t.d(r,{d:()=>i});var s=t(4208);t(91356);var a=t(56235),n=t(58113);function i({className:e,...r}){return(0,s.jsx)(a.bL,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:(0,s.jsx)(a.zi,{"data-slot":"switch-thumb",className:"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"})})}},13746:(e,r,t)=>{t.d(r,{p:()=>i});var s=t(4208),a=t(91356),n=t(58113);let i=a.forwardRef(function({className:e,type:r,...t},a){return(0,s.jsx)("input",{ref:a,type:r,"data-slot":"input",className:(0,n.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})});i.displayName="Input"},19096:(e,r,t)=>{t.d(r,{J:()=>i});var s=t(4208);t(91356);var a=t(84068),n=t(58113);function i({className:e,...r}){return(0,s.jsx)(a.b,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}},25729:(e,r,t)=>{t.d(r,{KT:()=>c,Kk:()=>u,XE:()=>m,hY:()=>b,u8:()=>o,wB:()=>x});var s=t(4208),a=t(19096),n=t(12154),i=t(30925),d=t(58113);let l=(0,d.cn)("rounded-xl border border-mail-border bg-mail-surface shadow-sm","dark:bg-mail-surface-elevated dark:shadow-[0_1px_4px_rgba(0,0,0,0.35)]");function c({title:e,description:r,hint:t,action:a,badges:n,footer:i,children:o,className:u,bodyClassName:m,contentClassName:x,divider:b=!0}){let f=!!(e||r||a||n||t);return(0,s.jsx)("section",{className:(0,d.cn)(l,u),children:(0,s.jsxs)("div",{className:(0,d.cn)("p-5",m),children:[f?(0,s.jsxs)("div",{className:"flex items-start gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[e?(0,s.jsx)("p",{className:"text-sm font-semibold text-foreground",children:e}):null,r?(0,s.jsx)("p",{className:(0,d.cn)(e&&"mt-1","text-[13px] leading-relaxed text-muted-foreground"),children:r}):null,n?(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:n}):null,t?(0,s.jsx)("div",{className:"mt-2",children:t}):null]}),a?(0,s.jsx)("div",{className:"shrink-0",children:a}):null]}):null,o?(0,s.jsx)("div",{className:(0,d.cn)(f&&"mt-4 pt-4",f&&b&&"border-t border-mail-border","space-y-4",x),children:o}):null,i?(0,s.jsx)("div",{className:"mt-4",children:i}):null]})})}function o({label:e,htmlFor:r,hint:t,error:n,required:i,children:l,className:c,labelClassName:u,labelAction:m}){return(0,s.jsxs)("div",{className:(0,d.cn)("space-y-1.5",c),children:[e?(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)(a.J,{htmlFor:r,className:(0,d.cn)("text-xs font-medium text-muted-foreground",u),children:[e,i?(0,s.jsx)("span",{className:"ml-0.5 text-destructive",children:"*"}):null]}),m]}):null,l,t?(0,s.jsx)("div",{className:"text-xs leading-relaxed text-muted-foreground",children:t}):null,n?(0,s.jsx)("div",{className:"text-xs leading-relaxed text-destructive",children:n}):null]})}function u({title:e,description:r,checked:t,onCheckedChange:a,disabled:i,hint:l,variant:c="bordered",className:o}){let m=(0,s.jsxs)("label",{className:(0,d.cn)("flex items-center justify-between gap-4","bordered"===c&&"rounded-lg border border-mail-border bg-mail-surface-muted/40 px-3.5 py-3",i&&"opacity-70",o),children:[(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e}),r?(0,s.jsx)("span",{className:"mt-0.5 block text-xs leading-relaxed text-muted-foreground",children:r}):null]}),(0,s.jsx)(n.d,{checked:t,disabled:i,onCheckedChange:a})]});return l?(0,s.jsxs)("div",{className:"space-y-1.5",children:[m,l]}):m}function m({title:e,description:r,checked:t,onCheckedChange:a,disabled:n,variant:l="plain",className:c}){return(0,s.jsxs)("label",{className:(0,d.cn)("flex items-start gap-2.5","bordered"===l&&"rounded-lg border border-mail-border bg-mail-surface-muted/40 px-3.5 py-3",n&&"opacity-70",c),children:[(0,s.jsx)(i.S,{checked:t,disabled:n,onCheckedChange:e=>a(!0===e),className:"mt-0.5"}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block text-sm text-foreground",children:e}),r?(0,s.jsx)("span",{className:"mt-0.5 block text-xs leading-relaxed text-muted-foreground",children:r}):null]})]})}function x({columns:e=2,children:r,className:t}){return(0,s.jsx)("div",{className:(0,d.cn)("grid min-w-0 gap-4",2===e&&"sm:grid-cols-2",t),children:r})}function b({children:e,tone:r="muted",className:t}){return(0,s.jsx)("p",{className:(0,d.cn)("text-xs leading-relaxed","muted"===r&&"text-muted-foreground","warning"===r&&"text-amber-600 dark:text-amber-500","danger"===r&&"text-destructive",t),children:e})}},30925:(e,r,t)=>{t.d(r,{S:()=>l});var s=t(4208);t(91356);var a=t(28879),n=t(68183),i=t(35019),d=t(58113);function l({className:e,checked:r,...t}){return(0,s.jsx)(a.bL,{"data-slot":"checkbox",className:(0,d.cn)("peer border-[1.5px] border-mail-row-checkbox-border bg-background dark:bg-mail-surface-muted data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] shadow-xs transition-all outline-none hover:border-foreground/60 hover:shadow-sm focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,checked:r,children:(0,s.jsx)(a.C1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:"indeterminate"===r?(0,s.jsx)(n.A,{className:"size-3 stroke-[2.5] text-inherit"}):(0,s.jsx)(i.A,{className:"size-3.5 text-inherit stroke-[2.5]"})})})}},51355:(e,r,t)=>{t.d(r,{E:()=>l});var s=t(4208);t(91356);var a=t(49402),n=t(57542),i=t(58113);let d=(0,n.F)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function l({className:e,variant:r,asChild:t=!1,...n}){let c=t?a.DX:"span";return(0,s.jsx)(c,{"data-slot":"badge",className:(0,i.cn)(d({variant:r}),e),...n})}},54430:(e,r,t)=>{function s(e,r,t){let s=e?.[r];return!!s?.locked&&(!s.fields?.length||s.fields.includes(t))}function a(e,r){return s(e,"plugins",r)}t.d(r,{DD:()=>d,Li:()=>a,j_:()=>i,me:()=>s});let n={authentik:"Authentik / OIDC",nextcloud:"Nextcloud",onlyoffice:"OnlyOffice",ai_assistant:"UltiAI",search:"Recherche",immich:"Immich",jitsi:"Jitsi Meet",storage:"Stockage objet"};function i(e){return n[e]??e}function d(e){let r={};for(let t of e){let e=t.group||"other";r[e]=r[e]??[],r[e].push(t)}return r}},58564:(e,r,t)=>{t.d(r,{f:()=>x});var s=t(4208),a=t(91356),n=t(61554),i=t(7),d=t(6078);function l(){return(0,s.jsx)("p",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 px-3 py-2 text-xs text-blue-900 dark:border-blue-900/40 dark:bg-blue-950/30 dark:text-blue-200",children:"Chargement des r\xe9glages organisationnels depuis le serveur… Les modifications seront disponibles une fois la synchronisation termin\xe9e."})}var c=t(86272),o=t(29546),u=t(32826),m=t(37820);function x({title:e,description:r,children:t,policySection:b,showEffectiveBanner:f=!0,beforeSave:h}){let p,[g,v]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),{isFetching:y,isError:k,refetch:w,isFetched:C}=(0,o.Z3)(),z=(p=(0,o.Og)(),(0,a.useCallback)(async e=>{let r=m.U.getState(),t=e?.length?(0,u.wb)(r,e):(0,u.dt)(r);await p.mutateAsync({policy:t})},[p])),A=(0,m.U)(e=>e.apiSynced),_=!A&&!k&&(y||!C),E=!!b;async function S(){if(b){N(null);try{await h?.();let e=Array.isArray(b)?b:[b];await z(e),v(!0),setTimeout(()=>v(!1),2e3)}catch(e){N(e instanceof Error?e.message:"\xc9chec de l'enregistrement")}}}return(0,s.jsxs)("div",{className:"flex min-h-full flex-col",children:[(0,s.jsxs)("div",{className:"flex-1 space-y-6 pb-6",children:[(0,s.jsx)(i.y,{title:e,description:r}),(0,s.jsx)(d.v,{isFetching:y,isError:k,onRetry:()=>w()}),_?(0,s.jsx)(l,{}):null,f?(0,s.jsx)(c.K,{}):null,t]}),E?(0,s.jsx)("div",{className:"sticky bottom-0 z-10 -mx-4 shrink-0 border-t border-border bg-mail-surface/95 px-4 py-4 backdrop-blur supports-[backdrop-filter]:bg-mail-surface/80 sm:-mx-8 sm:px-8 dark:bg-mail-surface-elevated/95",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)(n.$,{type:"button",onClick:()=>void S(),disabled:!A||y,children:"Enregistrer"}),g?(0,s.jsx)("span",{className:"text-sm text-green-600 dark:text-green-500",children:"R\xe9glages enregistr\xe9s sur le serveur"}):null,j?(0,s.jsx)("span",{className:"text-sm text-destructive",children:j}):null]})}):null]})}},86272:(e,r,t)=>{t.d(r,{K:()=>x});var s=t(4208),a=t(91356),n=t(3964),i=t(77510),d=t(9519),l=t(26159),c=t(37820),o=t(54430),u=t(51355),m=t(58113);function x(){let e=(0,c.U)(e=>e.meta),r=(0,c.U)(e=>e.apiSynced),[t,x]=(0,a.useState)(!1);if(!r||!e)return null;let b=e.effective,f=(0,o.DD)(e.envVars??[]),h=(e.envVars??[]).filter(e=>e.set).length;return(0,s.jsxs)("div",{className:"mb-4 space-y-3 rounded-lg border border-border bg-muted/30 p-4 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(n.A,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"Configuration runtime (Docker Compose)"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:"Les services ci-dessous sont pilot\xe9s par les variables d'environnement du d\xe9ploiement. Les interrupteurs correspondants dans l'administration sont en lecture seule."}),(0,s.jsxs)("p",{className:"text-muted-foreground",children:["Recherche ",(0,s.jsx)("span",{className:"font-medium text-foreground",children:b.search.suite_engine})," \xb7 ","Nextcloud ",b.nextcloud.enabled?"actif":"inactif"," \xb7 ","OnlyOffice ",b.onlyoffice.enabled?"actif":"inactif",b.immich?(0,s.jsxs)(s.Fragment,{children:[" \xb7 ","Immich ",b.immich.enabled?"actif":"inactif"]}):null,b.jitsi?(0,s.jsxs)(s.Fragment,{children:[" \xb7 ","Jitsi ",b.jitsi.enabled?"actif":"inactif"]}):null]})]}),(0,s.jsxs)(u.E,{variant:"outline",className:"shrink-0 gap-1",children:[(0,s.jsx)(i.A,{className:"size-3","aria-hidden":!0}),"Compose"]})]}),(0,s.jsxs)("button",{type:"button",className:"flex w-full items-center gap-1.5 text-left font-medium text-foreground hover:underline",onClick:()=>x(e=>!e),children:[t?(0,s.jsx)(d.A,{className:"size-4","aria-hidden":!0}):(0,s.jsx)(l.A,{className:"size-4","aria-hidden":!0}),"Variables d'environnement (",h," d\xe9finies)"]}),t?(0,s.jsx)("div",{className:"space-y-4 border-t border-border/60 pt-3",children:Object.entries(f).map(([e,r])=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-2 font-medium text-foreground",children:(0,o.j_)(e)}),(0,s.jsx)("div",{className:"overflow-x-auto rounded-md border bg-background/80",children:(0,s.jsxs)("table",{className:"w-full text-left",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b text-muted-foreground",children:[(0,s.jsx)("th",{className:"px-2 py-1.5 font-medium",children:"Variable"}),(0,s.jsx)("th",{className:"px-2 py-1.5 font-medium",children:"D\xe9finie"}),(0,s.jsx)("th",{className:"px-2 py-1.5 font-medium",children:"Valeur"})]})}),(0,s.jsx)("tbody",{children:r.map(e=>(0,s.jsxs)("tr",{className:"border-b border-border/40 last:border-0",children:[(0,s.jsx)("td",{className:"px-2 py-1.5 font-mono text-[11px]",children:e.name}),(0,s.jsx)("td",{className:"px-2 py-1.5",children:(0,s.jsx)(u.E,{variant:e.set?"default":"secondary",className:(0,m.cn)("text-[10px]",!e.set&&"opacity-70"),children:e.set?"oui":"non"})}),(0,s.jsx)("td",{className:"max-w-[200px] truncate px-2 py-1.5 font-mono text-[11px] text-muted-foreground",children:e.secret?e.set?"••••••••":"—":e.value??"—"})]},e.name))})]})})]},e))}):null]})}}}]);