@tsiky/components-r19 6.1.0 → 6.1.1
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/index.cjs.js
CHANGED
|
@@ -8166,18 +8166,18 @@
|
|
|
8166
8166
|
${f}px !important;
|
|
8167
8167
|
top: ${p}px !important;
|
|
8168
8168
|
}
|
|
8169
|
-
`),()=>{M.contains(g)&&M.removeChild(g)}},[t]),o.jsx(x0e,{isPresent:t,childRef:r,sizeRef:s,children:J.cloneElement(e,{ref:h})})}const L0e=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:h})=>{const l=zt(I0e),u=k.useId();let p=!0,y=k.useMemo(()=>(p=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:m=>{l.set(m,!0);for(const f of l.values())if(!f)return;c&&c()},register:m=>(l.set(m,!1),()=>l.delete(m))}),[n,l,c]);return r&&p&&(y={...y}),k.useMemo(()=>{l.forEach((m,f)=>l.set(f,!1))},[n]),J.useEffect(()=>{!n&&!l.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(_0e,{isPresent:n,anchorX:d,root:h,children:e})),o.jsx(yL.Provider,{value:y,children:e})};function I0e(){return new Map}function N$(e=!0){const t=k.useContext(yL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const J1=e=>e.key||"";function wC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const b0e=({children:e,custom:t,initial:n=!0,onExitComplete:c,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:h})=>{const[l,u]=N$(s),p=k.useMemo(()=>wC(e),[e]),y=s&&!l?[]:p.map(J1),m=k.useRef(!0),f=k.useRef(p),g=zt(()=>new Map),[M,x]=k.useState(p),[v,L]=k.useState(p);pw(()=>{m.current=!1,f.current=p;for(let b=0;b<v.length;b++){const _=J1(v[b]);y.includes(_)?g.delete(_):g.get(_)!==!0&&g.set(_,!1)}},[v,y.length,y.join("-")]);const w=[];if(p!==M){let b=[...p];for(let _=0;_<v.length;_++){const I=v[_],j=J1(I);y.includes(j)||(b.splice(_,0,I),w.push(I))}return r==="wait"&&w.length&&(b=w),L(wC(b)),x(p),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=k.useContext(hw);return o.jsx(o.Fragment,{children:v.map(b=>{const _=J1(b),I=s&&!l?!1:p===v||y.includes(_),j=()=>{if(g.has(_))g.set(_,!0);else return;let N=!0;g.forEach(S=>{S||(N=!1)}),N&&(C?.(),L(f.current),s&&u?.(),c&&c())};return o.jsx(L0e,{isPresent:I,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:h,onExitComplete:I?void 0:j,anchorX:d,children:b},_)})})},S$=k.createContext({strict:!1}),CC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},a1={};for(const e in CC)a1[e]={isEnabled:t=>CC[e].some(n=>!!t[n])};function w0e(e){for(const t in e)a1[t]={...a1[t],...e[t]}}const C0e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||C0e.has(e)}let j$=e=>!sL(e);function N0e(e){typeof e=="function"&&(j$=t=>t.startsWith("on")?!sL(t):e(t))}try{N0e(require("@emotion/is-prop-valid").default)}catch{}function S0e(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(j$(i)||n===!0&&sL(i)||!t&&!sL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const mL=k.createContext({});function fL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function B1(e){return typeof e=="string"||Array.isArray(e)}const Vw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pw=["initial",...Vw];function gL(e){return fL(e.animate)||Pw.some(t=>B1(e[t]))}function $$(e){return!!(gL(e)||e.variants)}function j0e(e,t){if(gL(e)){const{initial:n,animate:c}=e;return{initial:n===!1||B1(n)?n:void 0,animate:B1(c)?c:void 0}}return e.inherit!==!1?t:{}}function $0e(e){const{initial:t,animate:n}=j0e(e,k.useContext(mL));return k.useMemo(()=>({initial:t,animate:n}),[NC(t),NC(n)])}function NC(e){return Array.isArray(e)?e.join(" "):e}const R1={};function q0e(e){for(const t in e)R1[t]=e[t],xw(t)&&(R1[t].isCSSVariable=!0)}function q$(e,{layout:t,layoutId:n}){return i1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!R1[e]||e==="opacity")}const A0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},z0e=c1.length;function V0e(e,t,n){let c="",i=!0;for(let r=0;r<z0e;r++){const s=c1[r],d=e[s];if(d===void 0)continue;let h=!0;if(typeof d=="number"?h=d===(s.startsWith("scale")?1:0):h=parseFloat(d)===0,!h||n){const l=_$(d,qw[s]);if(!h){i=!1;const u=A0e[s]||s;c+=`${u}(${l}) `}n&&(t[s]=l)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Tw(e,t,n){const{style:c,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const h in t){const l=t[h];if(i1.has(h)){s=!0;continue}else if(xw(h)){i[h]=l;continue}else{const u=_$(l,qw[h]);h.startsWith("origin")?(d=!0,r[h]=u):c[h]=u}}if(t.transform||(s||n?c.transform=V0e(t,e.transform,n):c.transform&&(c.transform="none")),d){const{originX:h="50%",originY:l="50%",originZ:u=0}=r;c.transformOrigin=`${h} ${l} ${u}`}}const Hw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function A$(e,t,n){for(const c in t)!je(t[c])&&!q$(c,n)&&(e[c]=t[c])}function P0e({transformTemplate:e},t){return k.useMemo(()=>{const n=Hw();return Tw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function T0e(e,t){const n=e.style||{},c={};return A$(c,n,e),Object.assign(c,P0e(e,t)),c}function H0e(e,t){const n={},c=T0e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=c,n}const D0e={offset:"stroke-dashoffset",array:"stroke-dasharray"},B0e={offset:"strokeDashoffset",array:"strokeDasharray"};function R0e(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?D0e:B0e;e[r.offset]=K.transform(-c);const s=K.transform(t),d=K.transform(n);e[r.array]=`${s} ${d}`}function z$(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},h,l,u){if(Tw(e,d,l),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),c!==void 0&&(p.scale=c),i!==void 0&&R0e(p,i,r,s,!1)}const V$=()=>({...Hw(),attrs:{}}),P$=e=>typeof e=="string"&&e.toLowerCase()==="svg";function F0e(e,t,n,c){const i=k.useMemo(()=>{const r=V$();return z$(r,t,P$(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};A$(r,e.style,e),i.style={...r,...i.style}}return i}const E0e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Dw(e){return typeof e!="string"||e.includes("-")?!1:!!(E0e.indexOf(e)>-1||/[A-Z]/u.test(e))}function O0e(e,t,n,{latestValues:c},i,r=!1){const d=(Dw(e)?F0e:H0e)(t,c,i,e),h=S0e(t,typeof e=="string",r),l=e!==k.Fragment?{...h,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>je(u)?u.get():u,[u]);return k.createElement(e,{...l,children:p})}function SC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Bw(e,t,n,c){if(typeof t=="function"){const[i,r]=SC(c);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=SC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function Q_(e){return je(e)?e.get():e}function U0e({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:W0e(n,c,i,e),renderState:t()}}function W0e(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=Q_(r[y]);let{initial:s,animate:d}=e;const h=gL(e),l=$$(e);t&&l&&!h&&e.inherit!==!1&&(s===void 0&&(s=t.initial),d===void 0&&(d=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const p=u?d:s;if(p&&typeof p!="boolean"&&!fL(p)){const y=Array.isArray(p)?p:[p];for(let m=0;m<y.length;m++){const f=Bw(e,y[m]);if(f){const{transitionEnd:g,transition:M,...x}=f;for(const v in x){let L=x[v];if(Array.isArray(L)){const w=u?L.length-1:0;L=L[w]}L!==null&&(i[v]=L)}for(const v in g)i[v]=g[v]}}}return i}const T$=e=>(t,n)=>{const c=k.useContext(mL),i=k.useContext(yL),r=()=>U0e(e,t,c,i);return n?r():zt(r)};function Rw(e,t,n){const{style:c}=e,i={};for(const r in c)(je(c[r])||t.style&&je(t.style[r])||q$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const G0e=T$({scrapeMotionValuesFromProps:Rw,createRenderState:Hw});function H$(e,t,n){const c=Rw(e,t,n);for(const i in e)if(je(e[i])||je(t[i])){const r=c1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const K0e=T$({scrapeMotionValuesFromProps:H$,createRenderState:V$}),Z0e=Symbol.for("motionComponentSymbol");function Uc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function X0e(e,t,n){return k.useCallback(c=>{c&&e.onMount&&e.onMount(c),t&&(c?t.mount(c):t.unmount()),n&&(typeof n=="function"?n(c):Uc(n)&&(n.current=c))},[t])}const Fw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Y0e="framerAppearId",D$="data-"+Fw(Y0e),B$=k.createContext({});function J0e(e,t,n,c,i){const{visualElement:r}=k.useContext(mL),s=k.useContext(S$),d=k.useContext(yL),h=k.useContext(kL).reducedMotion,l=k.useRef(null);c=c||s.renderer,!l.current&&c&&(l.current=c(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const u=l.current,p=k.useContext(B$);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Q0e(l.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const m=n[D$],f=k.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return pw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),f.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(!f.current&&u.animationState&&u.animationState.animateChanges(),f.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),f.current=!1),u.enteringChildren=void 0)}),u}function Q0e(e,t,n,c){const{layoutId:i,layout:r,drag:s,dragConstraints:d,layoutScroll:h,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:R$(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Uc(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:c,crossfade:u,layoutScroll:h,layoutRoot:l})}function R$(e){if(e)return e.options.allowProjection!==!1?e.projection:R$(e.parent)}function OL(e,{forwardMotionProps:t=!1}={},n,c){n&&w0e(n);const i=Dw(e)?K0e:G0e;function r(d,h){let l;const u={...k.useContext(kL),...d,layoutId:ele(d)},{isStatic:p}=u,y=$0e(d),m=i(d,p);if(!p&&uw){tle(u,n);const f=ale(u);l=f.MeasureLayout,y.visualElement=J0e(e,m,u,c,f.ProjectionNode)}return o.jsxs(mL.Provider,{value:y,children:[l&&y.visualElement?o.jsx(l,{visualElement:y.visualElement,...u}):null,O0e(e,d,X0e(m,y.visualElement,h),m,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=k.forwardRef(r);return s[Z0e]=e,s}function ele({layoutId:e}){const t=k.useContext(hw).id;return t&&e!==void 0?t+"-"+e:e}function tle(e,t){const n=k.useContext(S$).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const c="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?n1(!1,c,"lazy-strict-mode"):et(!1,c,"lazy-strict-mode")}}function ale(e){const{drag:t,layout:n}=a1;if(!t&&!n)return{};const c={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?c.MeasureLayout:void 0,ProjectionNode:c.ProjectionNode}}function nle(e,t){if(typeof Proxy>"u")return OL;const n=new Map,c=(r,s)=>OL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&gw(!1,"motion() is deprecated. Use motion.create() instead."),c(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?c:(n.has(s)||n.set(s,OL(s,void 0,e,t)),n.get(s))})}function F$({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function ole({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cle(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),c=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:c.y,right:c.x}}function UL(e){return e===void 0||e===1}function ew({scale:e,scaleX:t,scaleY:n}){return!UL(e)||!UL(t)||!UL(n)}function wc(e){return ew(e)||E$(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function E$(e){return jC(e.x)||jC(e.y)}function jC(e){return e&&e!=="0%"}function dL(e,t,n){const c=e-n,i=t*c;return n+i}function $C(e,t,n,c,i){return i!==void 0&&(e=dL(e,i,c)),dL(e,n,c)+t}function tw(e,t=0,n=1,c,i){e.min=$C(e.min,t,n,c,i),e.max=$C(e.max,t,n,c,i)}function O$(e,{x:t,y:n}){tw(e.x,t.translate,t.scale,t.originPoint),tw(e.y,n.translate,n.scale,n.originPoint)}const qC=.999999999999,AC=1.0000000000001;function ile(e,t,n,c=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,s;for(let d=0;d<i;d++){r=n[d],s=r.projectionDelta;const{visualElement:h}=r.options;h&&h.props.style&&h.props.style.display==="contents"||(c&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Gc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,O$(e,s)),c&&wc(r.latestValues)&&Gc(e,r.latestValues))}t.x<AC&&t.x>qC&&(t.x=1),t.y<AC&&t.y>qC&&(t.y=1)}function Wc(e,t){e.min=e.min+t,e.max=e.max+t}function zC(e,t,n,c,i=.5){const r=fe(e.min,e.max,i);tw(e,t,n,r,c)}function Gc(e,t){zC(e.x,t.x,t.scaleX,t.scale,t.originX),zC(e.y,t.y,t.scaleY,t.scale,t.originY)}function U$(e,t){return F$(cle(e.getBoundingClientRect(),t))}function rle(e,t,n){const c=U$(e,n),{scroll:i}=t;return i&&(Wc(c.x,i.offset.x),Wc(c.y,i.offset.y)),c}const VC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kc=()=>({x:VC(),y:VC()}),PC=()=>({min:0,max:0}),_e=()=>({x:PC(),y:PC()}),aw={current:null},W$={current:!1};function sle(){if(W$.current=!0,!!uw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>aw.current=e.matches;e.addEventListener("change",t),t()}else aw.current=!1}const dle=new WeakMap;function lle(e,t,n){for(const c in t){const i=t[c],r=n[c];if(je(i))e.addValue(c,i);else if(je(r))e.addValue(c,zc(i,{owner:e}));else if(r!==i)if(e.hasValue(c)){const s=e.getValue(c);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(c);e.addValue(c,zc(s!==void 0?s:i,{owner:e}))}}for(const c in n)t[c]===void 0&&e.removeValue(c);return t}const TC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hle{scrapeMotionValuesFromProps(t,n,c){return{}}constructor({parent:t,props:n,presenceContext:c,reducedMotionConfig:i,blockInitialAnimation:r,visualState:s},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=jw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=De.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,ke.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=s;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=c,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=gL(n),this.isVariantNode=$$(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in p){const m=p[y];h[y]!==void 0&&je(m)&&m.set(h[y])}}mount(t){this.current=t,dle.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,c)=>this.bindToMotionValue(c,n)),W$.current||sle(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:aw.current,process.env.NODE_ENV!=="production"&&gw(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),vt(this.notifyUpdate),vt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const c=i1.has(t);c&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&ke.preRender(this.notifyUpdate),c&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in a1){const n=a1[t];if(!n)continue;const{isEnabled:c,Feature:i}=n;if(!this.features[t]&&i&&c(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_e()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let c=0;c<TC.length;c++){const i=TC[c];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,s=t[r];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=lle(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const c=this.values.get(t);n!==c&&(c&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let c=this.values.get(t);return c===void 0&&n!==void 0&&(c=zc(n===null?void 0:n,{owner:this}),this.addValue(t,c)),c}readValue(t,n){let c=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return c!=null&&(typeof c=="string"&&(Tj(c)||Dj(c))?c=parseFloat(c):!g0e(c)&&At.test(n)&&(c=x$(t,n)),this.setBaseTarget(t,je(c)?c.get():c)),je(c)?c.get():c}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let c;if(typeof n=="string"||typeof n=="object"){const r=Bw(this.props,n,this.presenceContext?.custom);r&&(c=r[t])}if(n&&c!==void 0)return c;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!je(i)?i:this.initialValues[t]!==void 0&&c===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new fw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Aw.render(this.render)}}class G$ extends hle{constructor(){super(...arguments),this.KeyframeResolver=c0e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:c}){delete n[t],delete c[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;je(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function K$(e,{style:t,vars:n},c,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,c);for(s in n)r.setProperty(s,n[s])}function ule(e){return window.getComputedStyle(e)}class ple extends G${constructor(){super(...arguments),this.type="html",this.renderInstance=K$}readValueFromInstance(t,n){if(i1.has(n))return this.projection?.isProjecting?Gb(n):Lde(t,n);{const c=ule(t),i=(xw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return U$(t,n)}build(t,n,c){Tw(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Rw(t,n,c)}}const Z$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yle(e,t,n,c){K$(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(Z$.has(i)?i:Fw(i),t.attrs[i])}class kle extends G${constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_e}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(i1.has(n)){const c=M$(n);return c&&c.default||0}return n=Z$.has(n)?n:Fw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return H$(t,n,c)}build(t,n,c){z$(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){yle(t,n,c,i)}mount(t){this.isSVGTag=P$(t.tagName),super.mount(t)}}const mle=(e,t)=>Dw(e)?new kle(t):new ple(t,{allowProjection:e!==k.Fragment});function t1(e,t,n){const c=e.getProps();return Bw(c,t,n!==void 0?n:c.custom,e)}const nw=e=>Array.isArray(e);function fle(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zc(n))}function gle(e){return nw(e)?e[e.length-1]||0:e}function vle(e,t){const n=t1(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=gle(r[s]);fle(e,s,d)}}function Mle(e){return!!(je(e)&&e.add)}function ow(e,t){const n=e.getValue("willChange");if(Mle(n))return n.add(t);if(!n&>.WillChange){const c=new gt.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function X$(e){return e.props[D$]}const xle=e=>e!==null;function _le(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(xle),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const Lle={type:"spring",stiffness:500,damping:25,restSpeed:10},Ile=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ble={type:"keyframes",duration:.8},wle={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Cle=(e,{keyframes:t})=>t.length>2?ble:i1.has(e)?e.startsWith("scale")?Ile(t[1]):Lle:wle;function Nle({when:e,delay:t,delayChildren:n,staggerChildren:c,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:h,elapsed:l,...u}){return!!Object.keys(u).length}const Ew=(e,t,n,c={},i,r)=>s=>{const d=$w(c,e)||{},h=d.delay||c.delay||0;let{elapsed:l=0}=c;l=l-Qe(h);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-l,onUpdate:y=>{t.set(y),d.onUpdate&&d.onUpdate(y)},onComplete:()=>{s(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:r?void 0:i};Nle(d)||Object.assign(u,Cle(e,u)),u.duration&&(u.duration=Qe(u.duration)),u.repeatDelay&&(u.repeatDelay=Qe(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Jb(u),u.delay===0&&(p=!0)),(gt.instantAnimations||gt.skipAnimations)&&(p=!0,Jb(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=_le(u.keyframes,d);if(y!==void 0){ke.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Sw(u):new Wde(u)};function Sle({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function Y$(e,t,{delay:n=0,transitionOverride:c,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;c&&(r=c);const h=[],l=i&&e.animationState&&e.animationState.getState()[i];for(const u in d){const p=e.getValue(u,e.latestValues[u]??null),y=d[u];if(y===void 0||l&&Sle(l,u))continue;const m={delay:n,...$w(r||{},u)},f=p.get();if(f!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===f&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const x=X$(e);if(x){const v=window.MotionHandoffAnimation(x,u,ke);v!==null&&(m.startTime=v,g=!0)}}ow(e,u),p.start(Ew(u,p,y,e.shouldReduceMotion&&f$.has(u)?{type:!1}:m,e,g));const M=p.animation;M&&h.push(M)}return s&&Promise.all(h).then(()=>{ke.update(()=>{s&&vle(e,s)})}),h}function J$(e,t,n,c=0,i=1){const r=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*c;return typeof n=="function"?n(r,s):i===1?r*c:d-r*c}function cw(e,t,n={}){const c=t1(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=c||{};n.transitionOverride&&(i=n.transitionOverride);const r=c?()=>Promise.all(Y$(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:p}=i;return jle(e,t,h,l,u,p,n)}:()=>Promise.resolve(),{when:d}=i;if(d){const[h,l]=d==="beforeChildren"?[r,s]:[s,r];return h().then(()=>l())}else return Promise.all([r(),s(n.delay)])}function jle(e,t,n=0,c=0,i=0,r=1,s){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(cw(h,t,{...s,delay:n+(typeof c=="function"?0:c)+J$(e.variantChildren,h,c,i,r)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function $le(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>cw(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=cw(e,t,n);else{const i=typeof t=="function"?t1(e,t,n.custom):t;c=Promise.all(Y$(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function Q$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let c=0;c<n;c++)if(t[c]!==e[c])return!1;return!0}const qle=Pw.length;function eq(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?eq(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<qle;n++){const c=Pw[n],i=e.props[c];(B1(i)||i===!1)&&(t[c]=i)}return t}const Ale=[...Vw].reverse(),zle=Vw.length;function Vle(e){return t=>Promise.all(t.map(({animation:n,options:c})=>$le(e,n,c)))}function Ple(e){let t=Vle(e),n=HC(),c=!0;const i=h=>(l,u)=>{const p=t1(e,u,h==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:y,transitionEnd:m,...f}=p;l={...l,...f,...m}}return l};function r(h){t=h(e)}function s(h){const{props:l}=e,u=eq(e.parent)||{},p=[],y=new Set;let m={},f=1/0;for(let M=0;M<zle;M++){const x=Ale[M],v=n[x],L=l[x]!==void 0?l[x]:u[x],w=B1(L),C=x===h?v.isActive:null;C===!1&&(f=M);let b=L===u[x]&&L!==l[x]&&w;if(b&&c&&e.manuallyAnimateOnMount&&(b=!1),v.protectedKeys={...m},!v.isActive&&C===null||!L&&!v.prevProp||fL(L)||typeof L=="boolean")continue;const _=Tle(v.prevProp,L);let I=_||x===h&&v.isActive&&!b&&w||M>f&&w,j=!1;const N=Array.isArray(L)?L:[L];let S=N.reduce(i(x),{});C===!1&&(S={});const{prevResolvedValues:A={}}=v,B={...A,...S},T=q=>{I=!0,y.has(q)&&(j=!0,y.delete(q)),v.needsAnimating[q]=!0;const P=e.getValue(q);P&&(P.liveStyle=!1)};for(const q in B){const P=S[q],H=A[q];if(m.hasOwnProperty(q))continue;let D=!1;nw(P)&&nw(H)?D=!Q$(P,H):D=P!==H,D?P!=null?T(q):y.add(q):P!==void 0&&y.has(q)?T(q):v.protectedKeys[q]=!0}v.prevProp=L,v.prevResolvedValues=S,v.isActive&&(m={...m,...S}),c&&e.blockInitialAnimation&&(I=!1);const V=b&&_;I&&(!V||j)&&p.push(...N.map(q=>{const P={type:x};if(typeof q=="string"&&c&&!V&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,D=t1(H,q);if(H.enteringChildren&&D){const{delayChildren:F}=D.transition||{};P.delay=J$(H.enteringChildren,e,F)}}return{animation:q,options:P}}))}if(y.size){const M={};if(typeof l.initial!="boolean"){const x=t1(e,Array.isArray(l.initial)?l.initial[0]:l.initial);x&&x.transition&&(M.transition=x.transition)}y.forEach(x=>{const v=e.getBaseTarget(x),L=e.getValue(x);L&&(L.liveStyle=!0),M[x]=v??null}),p.push({animation:M})}let g=!!p.length;return c&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),c=!1,g?t(p):Promise.resolve()}function d(h,l){if(n[h].isActive===l)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(h,l)),n[h].isActive=l;const u=s(h);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:s,setActive:d,setAnimateFunction:r,getState:()=>n,reset:()=>{n=HC()}}}function Tle(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Q$(t,e):!1}function Rt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function HC(){return{animate:Rt(!0),whileInView:Rt(),whileHover:Rt(),whileTap:Rt(),whileDrag:Rt(),whileFocus:Rt(),exit:Rt()}}class Vt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Hle extends Vt{constructor(t){super(t),t.animationState||(t.animationState=Ple(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fL(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Dle=0;class Ble extends Vt{constructor(){super(...arguments),this.id=Dle++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===c)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Rle={animation:{Feature:Hle},exit:{Feature:Ble}};function F1(e,t,n,c={passive:!0}){return e.addEventListener(t,n,c),()=>e.removeEventListener(t,n)}function G1(e){return{point:{x:e.pageX,y:e.pageY}}}const Fle=e=>t=>zw(t)&&e(t,G1(t));function A1(e,t,n,c){return F1(e,t,Fle(n),c)}const tq=1e-4,Ele=1-tq,Ole=1+tq,aq=.01,Ule=0-aq,Wle=0+aq;function Ve(e){return e.max-e.min}function Gle(e,t,n){return Math.abs(e-t)<=n}function DC(e,t,n,c=.5){e.origin=c,e.originPoint=fe(t.min,t.max,e.origin),e.scale=Ve(n)/Ve(t),e.translate=fe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ele&&e.scale<=Ole||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ule&&e.translate<=Wle||isNaN(e.translate))&&(e.translate=0)}function z1(e,t,n,c){DC(e.x,t.x,n.x,c?c.originX:void 0),DC(e.y,t.y,n.y,c?c.originY:void 0)}function BC(e,t,n){e.min=n.min+t.min,e.max=e.min+Ve(t)}function Kle(e,t,n){BC(e.x,t.x,n.x),BC(e.y,t.y,n.y)}function RC(e,t,n){e.min=t.min-n.min,e.max=e.min+Ve(t)}function V1(e,t,n){RC(e.x,t.x,n.x),RC(e.y,t.y,n.y)}function We(e){return[e("x"),e("y")]}const nq=({current:e})=>e?e.ownerDocument.defaultView:null,FC=(e,t)=>Math.abs(e-t);function Zle(e,t){const n=FC(e.x,t.x),c=FC(e.y,t.y);return Math.sqrt(n**2+c**2)}class oq{constructor(t,n,{transformPagePoint:c,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=GL(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,f=Zle(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!f)return;const{point:g}=y,{timestamp:M}=Se;this.history.push({...g,timestamp:M});const{onStart:x,onMove:v}=this.handlers;m||(x&&x(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,y)},this.handlePointerMove=(y,m)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=WL(m,this.transformPagePoint),ke.update(this.updatePoint,!0)},this.handlePointerUp=(y,m)=>{this.end();const{onEnd:f,onSessionEnd:g,resumeAnimation:M}=this.handlers;if(this.dragSnapToOrigin&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=GL(y.type==="pointercancel"?this.lastMoveEventInfo:WL(m,this.transformPagePoint),this.history);this.startEvent&&f&&f(y,x),g&&g(y,x)},!zw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=G1(t),h=WL(d,this.transformPagePoint),{point:l}=h,{timestamp:u}=Se;this.history=[{...l,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,GL(h,this.history)),this.removeListeners=O1(A1(this.contextWindow,"pointermove",this.handlePointerMove),A1(this.contextWindow,"pointerup",this.handlePointerUp),A1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),vt(this.updatePoint)}}function WL(e,t){return t?{point:t(e.point)}:e}function EC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function GL({point:e},t){return{point:e,delta:EC(e,cq(t)),offset:EC(e,Xle(t)),velocity:Yle(t,.1)}}function Xle(e){return e[0]}function cq(e){return e[e.length-1]}function Yle(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=cq(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>Qe(t)));)n--;if(!c)return{x:0,y:0};const r=Ge(i.timestamp-c.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-c.x)/r,y:(i.y-c.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Jle(e,{min:t,max:n},c){return t!==void 0&&e<t?e=c?fe(t,e,c.min):Math.max(e,t):n!==void 0&&e>n&&(e=c?fe(n,e,c.max):Math.min(e,n)),e}function OC(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Qle(e,{top:t,left:n,bottom:c,right:i}){return{x:OC(e.x,n,i),y:OC(e.y,t,c)}}function UC(e,t){let n=t.min-e.min,c=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,c]=[c,n]),{min:n,max:c}}function ehe(e,t){return{x:UC(e.x,t.x),y:UC(e.y,t.y)}}function the(e,t){let n=.5;const c=Ve(e),i=Ve(t);return i>c?n=T1(t.min,t.max-c,e.min):c>i&&(n=T1(e.min,e.max-i,t.min)),ft(0,1,n)}function ahe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const iw=.35;function nhe(e=iw){return e===!1?e=0:e===!0&&(e=iw),{x:WC(e,"left","right"),y:WC(e,"top","bottom")}}function WC(e,t,n){return{min:GC(e,t),max:GC(e,n)}}function GC(e,t){return typeof e=="number"?e:e[t]||0}const ohe=new WeakMap;class che{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_e(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:c}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=p=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(G1(p).point)},s=(p,y)=>{const{drag:m,dragPropagation:f,onDragStart:g}=this.getProps();if(m&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=d0e(m),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),We(x=>{let v=this.getAxisMotionValue(x).get()||0;if(lt.test(v)){const{projection:L}=this.visualElement;if(L&&L.layout){const w=L.layout.layoutBox[x];w&&(v=Ve(w)*(parseFloat(v)/100))}}this.originPoint[x]=v}),g&&ke.postRender(()=>g(p,y)),ow(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:m,dragDirectionLock:f,onDirectionLock:g,onDrag:M}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=y;if(f&&this.currentDirection===null){this.currentDirection=ihe(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",y.point,x),this.updateAxis("y",y.point,x),this.visualElement.render(),M&&M(p,y)},h=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>We(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new oq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:h,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:nq(this.visualElement)})}stop(t,n){const c=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!c)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&ke.postRender(()=>d(c,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,c){const{drag:i}=this.getProps();if(!c||!Q1(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Jle(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Uc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&c?this.constraints=Qle(c.layoutBox,t):this.constraints=!1,this.elastic=nhe(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&We(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=ahe(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Uc(t))return!1;const c=t.current;et(c!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=rle(c,i.root,this.visualElement.getTransformPagePoint());let s=ehe(i.layout.layoutBox,r);if(n){const d=n(ole(s));this.hasMutatedConstraints=!!d,d&&(s=F$(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},l=We(u=>{if(!Q1(u,n,this.currentDirection))return;let p=h&&h[u]||{};s&&(p={min:0,max:0});const y=i?200:1e6,m=i?40:1e7,f={type:"inertia",velocity:c?t[u]:0,bounceStiffness:y,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(u,f)});return Promise.all(l).then(d)}startAxisValueAnimation(t,n){const c=this.getAxisMotionValue(t);return ow(this.visualElement,t),c.start(Ew(t,c,0,n,this.visualElement,!1))}stopAnimation(){We(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){We(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,c=this.visualElement.getProps(),i=c[n];return i||this.visualElement.getValue(t,(c.initial?c.initial[t]:void 0)||0)}snapToCursor(t){We(n=>{const{drag:c}=this.getProps();if(!Q1(n,c,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:d}=i.layout.layoutBox[n];r.set(t[n]-fe(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:c}=this.visualElement;if(!Uc(n)||!c||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};We(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const h=d.get();i[s]=the({min:h,max:h},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.resolveConstraints(),We(s=>{if(!Q1(s,t,null))return;const d=this.getAxisMotionValue(s),{min:h,max:l}=this.constraints[s];d.set(fe(h,l,i[s]))})}addListeners(){if(!this.visualElement.current)return;ohe.set(this.visualElement,this);const t=this.visualElement.current,n=A1(t,"pointerdown",h=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(h)}),c=()=>{const{dragConstraints:h}=this.getProps();Uc(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",c);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ke.read(c);const s=F1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:h,hasLayoutChanged:l})=>{this.isDragging&&l&&(We(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=h[u].translate,p.set(p.get()+h[u].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:c=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=iw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function Q1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ihe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class rhe extends Vt{constructor(t){super(t),this.removeGroupControls=Ze,this.removeListeners=Ze,this.controls=new che(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ze}unmount(){this.removeGroupControls(),this.removeListeners()}}const KC=e=>(t,n)=>{e&&ke.postRender(()=>e(t,n))};class she extends Vt{constructor(){super(...arguments),this.removePointerDownListener=Ze}onPointerDown(t){this.session=new oq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nq(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:KC(t),onStart:KC(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&ke.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=A1(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const eL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ZC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const l1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(K.test(e))e=parseFloat(e);else return e;const n=ZC(e,t.target.x),c=ZC(e,t.target.y);return`${n}% ${c}%`}},dhe={correct:(e,{treeScale:t,projectionDelta:n})=>{const c=e,i=At.parse(e);if(i.length>5)return c;const r=At.createTransformer(e),s=typeof i[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;i[0+s]/=d,i[1+s]/=h;const l=fe(d,h,.5);return typeof i[2+s]=="number"&&(i[2+s]/=l),typeof i[3+s]=="number"&&(i[3+s]/=l),r(i)}};let KL=!1;class lhe extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;q0e(hhe),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),KL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),eL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,KL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||ke.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Aw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;KL=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),c&&c.deregister&&c.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function iq(e){const[t,n]=N$(),c=k.useContext(hw);return o.jsx(lhe,{...e,layoutGroup:c,switchLayoutGroup:k.useContext(B$),isPresent:t,safeToRemove:n})}const hhe={borderRadius:{...l1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:l1,borderTopRightRadius:l1,borderBottomLeftRadius:l1,borderBottomRightRadius:l1,boxShadow:dhe};function uhe(e,t,n){const c=je(e)?e:zc(e);return c.start(Ew("",c,t,n)),c.animation}const phe=(e,t)=>e.depth-t.depth;class yhe{constructor(){this.children=[],this.isDirty=!1}add(t){yw(this.children,t),this.isDirty=!0}remove(t){kw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(phe),this.isDirty=!1,this.children.forEach(t)}}function khe(e,t){const n=De.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(vt(c),e(r-t))};return ke.setup(c,!0),()=>vt(c)}const rq=["TopLeft","TopRight","BottomLeft","BottomRight"],mhe=rq.length,XC=e=>typeof e=="string"?parseFloat(e):e,YC=e=>typeof e=="number"||K.test(e);function fhe(e,t,n,c,i,r){i?(e.opacity=fe(0,n.opacity??1,ghe(c)),e.opacityExit=fe(t.opacity??1,0,vhe(c))):r&&(e.opacity=fe(t.opacity??1,n.opacity??1,c));for(let s=0;s<mhe;s++){const d=`border${rq[s]}Radius`;let h=JC(t,d),l=JC(n,d);if(h===void 0&&l===void 0)continue;h||(h=0),l||(l=0),h===0||l===0||YC(h)===YC(l)?(e[d]=Math.max(fe(XC(h),XC(l),c),0),(lt.test(l)||lt.test(h))&&(e[d]+="%")):e[d]=l}(t.rotate||n.rotate)&&(e.rotate=fe(t.rotate||0,n.rotate||0,c))}function JC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ghe=sq(0,.5,Gj),vhe=sq(.5,.95,Ze);function sq(e,t,n){return c=>c<e?0:c>t?1:n(T1(e,t,c))}function QC(e,t){e.min=t.min,e.max=t.max}function Ee(e,t){QC(e.x,t.x),QC(e.y,t.y)}function eN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function tN(e,t,n,c,i){return e-=t,e=dL(e,1/n,c),i!==void 0&&(e=dL(e,1/i,c)),e}function Mhe(e,t=0,n=1,c=.5,i,r=e,s=e){if(lt.test(t)&&(t=parseFloat(t),t=fe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=fe(r.min,r.max,c);e===r&&(d-=t),e.min=tN(e.min,t,n,d,i),e.max=tN(e.max,t,n,d,i)}function aN(e,t,[n,c,i],r,s){Mhe(e,t[n],t[c],t[i],t.scale,r,s)}const xhe=["x","scaleX","originX"],_he=["y","scaleY","originY"];function nN(e,t,n,c){aN(e.x,t,xhe,n?n.x:void 0,c?c.x:void 0),aN(e.y,t,_he,n?n.y:void 0,c?c.y:void 0)}function oN(e){return e.translate===0&&e.scale===1}function dq(e){return oN(e.x)&&oN(e.y)}function cN(e,t){return e.min===t.min&&e.max===t.max}function Lhe(e,t){return cN(e.x,t.x)&&cN(e.y,t.y)}function iN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function lq(e,t){return iN(e.x,t.x)&&iN(e.y,t.y)}function rN(e){return Ve(e.x)/Ve(e.y)}function sN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ihe{constructor(){this.members=[]}add(t){yw(this.members,t),t.scheduleRender()}remove(t){if(kw(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let c;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){c=r;break}}return c?(this.promote(c),!0):!1}promote(t,n){const c=this.lead;if(t!==c&&(this.prevLead=c,this.lead=t,t.show(),c)){c.instance&&c.scheduleRender(),t.scheduleRender(),t.resumeFrom=c,n&&(t.resumeFrom.preserveOpacity=!0),c.snapshot&&(t.snapshot=c.snapshot,t.snapshot.latestValues=c.animationValues||c.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&c.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:c}=t;n.onExitComplete&&n.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function bhe(e,t,n){let c="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(c=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(c+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:p,rotateY:y,skewX:m,skewY:f}=n;l&&(c=`perspective(${l}px) ${c}`),u&&(c+=`rotate(${u}deg) `),p&&(c+=`rotateX(${p}deg) `),y&&(c+=`rotateY(${y}deg) `),m&&(c+=`skewX(${m}deg) `),f&&(c+=`skewY(${f}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(c+=`scale(${d}, ${h})`),c||"none"}const ZL=["","X","Y","Z"],whe=1e3;let Che=0;function XL(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function hq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=X$(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ke,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&hq(c)}function uq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=Che++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jhe),this.nodes.forEach(zhe),this.nodes.forEach(Vhe),this.nodes.forEach($he)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new yhe)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new fw),this.eventHandlers.get(s).add(d)}notifyListeners(s,...d){const h=this.eventHandlers.get(s);h&&h.notify(...d)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=C$(s)&&!k0e(s),this.instance=s;const{layoutId:d,layout:h,visualElement:l}=this.options;if(l&&!l.current&&l.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let u,p=0;const y=()=>this.root.updateBlockedByResize=!1;ke.read(()=>{p=window.innerWidth}),e(s,()=>{const m=window.innerWidth;m!==p&&(p=m,this.root.updateBlockedByResize=!0,u&&u(),u=khe(y,250),eL.hasAnimatedSinceResize&&(eL.hasAnimatedSinceResize=!1,this.nodes.forEach(hN)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&l&&(d||h)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const f=this.options.transition||l.getDefaultTransition()||Bhe,{onLayoutAnimationStart:g,onLayoutAnimationComplete:M}=l.getProps(),x=!this.targetLayout||!lq(this.targetLayout,m),v=!p&&y;if(this.options.layoutRoot||this.resumeFrom||v||p&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...$w(f,"layout"),onPlay:g,onComplete:M};(l.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(u,v)}else p||hN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Phe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hq(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(dN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(lN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ahe),this.nodes.forEach(Nhe),this.nodes.forEach(She)):this.nodes.forEach(lN),this.clearAllSnapshots();const d=De.now();Se.delta=ft(0,1e3/60,d-Se.timestamp),Se.timestamp=d,Se.isProcessing=!0,HL.update.process(Se),HL.preRender.process(Se),HL.render.process(Se),Se.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Aw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qhe),this.sharedNodes.forEach(The)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ke.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ke.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ve(this.snapshot.measuredBox.x)&&!Ve(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=_e(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(d=!1),d&&this.instance){const h=c(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!dq(this.projectionDelta),h=this.getTransformTemplate(),l=h?h(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;s&&this.instance&&(d||wc(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return s&&(h=this.removeTransform(h)),Rhe(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return _e();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Fhe))){const{scroll:l}=this.root;l&&(Wc(d.x,l.offset.x),Wc(d.y,l.offset.y))}return d}removeElementScroll(s){const d=_e();if(Ee(d,s),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const l=this.path[h],{scroll:u,options:p}=l;l!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Ee(d,s),Wc(d.x,u.offset.x),Wc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const h=_e();Ee(h,s);for(let l=0;l<this.path.length;l++){const u=this.path[l];!d&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Gc(h,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),wc(u.latestValues)&&Gc(h,u.latestValues)}return wc(this.latestValues)&&Gc(h,this.latestValues),h}removeTransform(s){const d=_e();Ee(d,s);for(let h=0;h<this.path.length;h++){const l=this.path[h];if(!l.instance||!wc(l.latestValues))continue;ew(l.latestValues)&&l.updateSnapshot();const u=_e(),p=l.measurePageBox();Ee(u,p),nN(d,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return wc(this.latestValues)&&nN(d,this.latestValues),d}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Se.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(s||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:p}=this.options;if(!(!this.layout||!(u||p))){if(this.resolvedRelativeTargetAt=Se.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),V1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_e(),this.targetWithTransforms=_e()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Kle(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ee(this.target,this.layout.layoutBox),O$(this.target,this.targetDelta)):Ee(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),V1(this.relativeTargetOrigin,this.target,y.target),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ew(this.parent.latestValues)||E$(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const s=this.getLead(),d=!!this.resumingFrom||this!==s;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Se.timestamp&&(h=!1),h)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Ee(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;ile(this.layoutCorrected,this.treeScale,this.path,d),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=_e());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(eN(this.prevProjectionDelta.x,this.projectionDelta.x),eN(this.prevProjectionDelta.y,this.projectionDelta.y)),z1(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!sN(this.projectionDelta.x,this.prevProjectionDelta.x)||!sN(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kc(),this.projectionDelta=Kc(),this.projectionDeltaWithTransform=Kc()}setAnimationOrigin(s,d=!1){const h=this.snapshot,l=h?h.latestValues:{},u={...this.latestValues},p=Kc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=_e(),m=h?h.source:void 0,f=this.layout?this.layout.source:void 0,g=m!==f,M=this.getStack(),x=!M||M.members.length<=1,v=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(Dhe));this.animationProgress=0;let L;this.mixTargetDelta=w=>{const C=w/1e3;uN(p.x,s.x,C),uN(p.y,s.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(V1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Hhe(this.relativeTarget,this.relativeTargetOrigin,y,C),L&&Lhe(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=_e()),Ee(L,this.relativeTarget)),g&&(this.animationValues=u,fhe(u,l,this.latestValues,C,v,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ke.update(()=>{eL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zc(0)),this.currentAnimation=uhe(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(whe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:d,target:h,layout:l,latestValues:u}=s;if(!(!d||!h||!l)){if(this!==s&&this.layout&&l&&pq(this.options.animationType,this.layout.layoutBox,l.layoutBox)){h=this.target||_e();const p=Ve(this.layout.layoutBox.x);h.x.min=s.target.x.min,h.x.max=h.x.min+p;const y=Ve(this.layout.layoutBox.y);h.y.min=s.target.y.min,h.y.max=h.y.min+y}Ee(d,h),Gc(d,u),z1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Ihe),this.sharedNodes.get(s).add(d);const l=d.options.initialPromotionConfig;d.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(d):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:d,preserveFollowOpacity:h}={}){const l=this.getStack();l&&l.promote(this,h),s&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let d=!1;const{latestValues:h}=s;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const l={};h.z&&XL("z",s,l,this.animationValues);for(let u=0;u<ZL.length;u++)XL(`rotate${ZL[u]}`,s,l,this.animationValues),XL(`skew${ZL[u]}`,s,l,this.animationValues);s.render();for(const u in l)s.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);s.scheduleRender()}applyProjectionStyles(s,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Q_(d?.pointerEvents)||"",s.transform=h?h(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Q_(d?.pointerEvents)||""),this.hasProjected&&!wc(this.latestValues)&&(s.transform=h?h({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let p=bhe(this.projectionDeltaWithTransform,this.treeScale,u);h&&(p=h(u,p)),s.transform=p;const{x:y,y:m}=this.projectionDelta;s.transformOrigin=`${y.origin*100}% ${m.origin*100}% 0`,l.animationValues?s.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const f in R1){if(u[f]===void 0)continue;const{correct:g,applyTo:M,isCSSVariable:x}=R1[f],v=p==="none"?u[f]:g(u[f],l);if(M){const L=M.length;for(let w=0;w<L;w++)s[M[w]]=v}else x?this.options.visualElement.renderState.vars[f]=v:s[f]=v}this.options.layoutId&&(s.pointerEvents=l===this?Q_(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(dN),this.root.sharedNodes.clear()}}}function Nhe(e){e.updateLayout()}function She(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:c}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?We(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Ve(p);p.min=n[u].min,p.max=p.min+y}):pq(i,t.layoutBox,n)&&We(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Ve(n[u]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+y)});const s=Kc();z1(s,n,t.layoutBox);const d=Kc();r?z1(d,e.applyTransform(c,!0),t.measuredBox):z1(d,n,t.layoutBox);const h=!dq(s);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:y}=u;if(p&&y){const m=_e();V1(m,t.layoutBox,p.layoutBox);const f=_e();V1(f,n,y.layoutBox),lq(m,f)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=f,e.relativeTargetOrigin=m,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:s,hasLayoutChanged:h,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function jhe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function $he(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qhe(e){e.clearSnapshot()}function dN(e){e.clearMeasurements()}function lN(e){e.isLayoutDirty=!1}function Ahe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function hN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zhe(e){e.resolveTargetDelta()}function Vhe(e){e.calcProjection()}function Phe(e){e.resetSkewAndRotation()}function The(e){e.removeLeadSnapshot()}function uN(e,t,n){e.translate=fe(t.translate,0,n),e.scale=fe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pN(e,t,n,c){e.min=fe(t.min,n.min,c),e.max=fe(t.max,n.max,c)}function Hhe(e,t,n,c){pN(e.x,t.x,n.x,c),pN(e.y,t.y,n.y,c)}function Dhe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Bhe={duration:.45,ease:[.4,0,.1,1]},yN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),kN=yN("applewebkit/")&&!yN("chrome/")?Math.round:Ze;function mN(e){e.min=kN(e.min),e.max=kN(e.max)}function Rhe(e){mN(e.x),mN(e.y)}function pq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Gle(rN(t),rN(n),.2)}function Fhe(e){return e!==e.root&&e.scroll?.wasRoot}const Ehe=uq({attachResizeListener:(e,t)=>F1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),YL={current:void 0},yq=uq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!YL.current){const e=new Ehe({});e.mount(window),e.setOptions({layoutScroll:!0}),YL.current=e}return YL.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ohe={pan:{Feature:she},drag:{Feature:rhe,ProjectionNode:yq,MeasureLayout:iq}};function fN(e,t,n){const{props:c}=e;e.animationState&&c.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=c[i];r&&ke.postRender(()=>r(t,G1(t)))}class Uhe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=l0e(t,(n,c)=>(fN(this.node,c,"Start"),i=>fN(this.node,i,"End"))))}unmount(){}}class Whe extends Vt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=O1(F1(this.node.current,"focus",()=>this.onFocus()),F1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function gN(e,t,n){const{props:c}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&c.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=c[i];r&&ke.postRender(()=>r(t,G1(t)))}class Ghe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=y0e(t,(n,c)=>(gN(this.node,c,"Start"),(i,{success:r})=>gN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const rw=new WeakMap,JL=new WeakMap,Khe=e=>{const t=rw.get(e.target);t&&t(e)},Zhe=e=>{e.forEach(Khe)};function Xhe({root:e,...t}){const n=e||document;JL.has(n)||JL.set(n,{});const c=JL.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Zhe,{root:e,...t})),c[i]}function Yhe(e,t,n){const c=Xhe(t);return rw.set(e,n),c.observe(e),()=>{rw.delete(e),c.unobserve(e)}}const Jhe={some:0,all:1};class Qhe extends Vt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:c,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:c,threshold:typeof i=="number"?i:Jhe[i]},d=h=>{const{isIntersecting:l}=h;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),y=l?u:p;y&&y(h)};return Yhe(this.node.current,s,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eue(t,n))&&this.startObserver()}unmount(){}}function eue({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tue={inView:{Feature:Qhe},tap:{Feature:Ghe},focus:{Feature:Whe},hover:{Feature:Uhe}},aue={layout:{ProjectionNode:yq,MeasureLayout:iq}},nue={...Rle,...tue,...Ohe,...aue},Ow=nle(nue,mle);function kq(e){const t=zt(()=>zc(e)),{isStatic:n}=k.useContext(kL);if(n){const[,c]=k.useState(e);k.useEffect(()=>t.on("change",c),[])}return t}function mq(e,t){const n=kq(t()),c=()=>n.set(t());return c(),pw(()=>{const i=()=>ke.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),vt(c)}}),n}function oue(e){q1.current=[],e();const t=mq(q1.current,e);return q1.current=void 0,t}function cue(e,t,n,c){if(typeof e=="function")return oue(e);const i=typeof t=="function"?t:m0e(t,n,c);return Array.isArray(e)?vN(e,i):vN([e],([r])=>i(r))}function vN(e,t){const n=zt(()=>[]);return mq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class iue{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(c=>{c.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const rue=()=>new iue;function sue(){return zt(rue)}const fq=k.createContext(null);function due(e,t,n,c){if(!c)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=c>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],h=s.layout,l=fe(h.min,h.max,.5);return r===1&&d.layout.max+n>l||r===-1&&d.layout.min+n<l?_2e(e,i,i+r):e}function lue({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=zt(()=>Ow[t]),h=[],l=k.useRef(!1);et(!!i,"Reorder.Group must be provided a values prop","reorder-values");const u={axis:n,registerItem:(p,y)=>{const m=h.findIndex(f=>p===f.value);m!==-1?h[m].layout=y[n]:h.push({value:p,layout:y[n]}),h.sort(pue)},updateOrder:(p,y,m)=>{if(l.current)return;const f=due(h,p,y,m);h!==f&&(l.current=!0,c(f.map(uue).filter(g=>i.indexOf(g)!==-1)))}};return k.useEffect(()=>{l.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(fq.Provider,{value:u,children:e})})}const hue=k.forwardRef(lue);function uue(e){return e.value}function pue(e,t){return e.layout.min-t.layout.min}function MN(e,t=0){return je(e)?e:kq(t)}function yue({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const h=zt(()=>Ow[c]),l=k.useContext(fq),u={x:MN(t.x),y:MN(t.y)},p=cue([u.x,u.y],([g,M])=>g||M?1:"unset");et(!!l,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:m,updateOrder:f}=l;return o.jsx(h,{drag:y,...s,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:p},layout:r,onDrag:(g,M)=>{const{velocity:x}=M;x[y]&&f(n,u[y].get(),x[y]),i&&i(g,M)},onLayoutMeasure:g=>m(n,g),ref:d,ignoreStrict:!0,children:e})}const kue=k.forwardRef(yue),lL=[o.jsx(j1,{size:18}),o.jsx(Ct,{size:18}),o.jsx(N1,{size:18}),o.jsx(Nt,{size:18}),o.jsx(v1,{size:18}),o.jsx(g1,{size:18})],mue=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,h]=k.useState(e??[]);return k.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((l,u)=>{if(l.icon==null&&(l.icon=lL[u%lL.length]),typeof l.text=="string"&&l.text.includes("/")){const p=String(l.text).split("/"),y=p[0].trim(),f=p.slice(1).join("/").trim().match(/^(\d+)(.*)$/);if(f){const g=f[1],M=f[2]??"",x=g.padStart(3,"0");l.text=`${y} / ${x}${M}`}}}),h(e)):h([])},[e]),o.jsxs("div",{className:`trend-list ${c??""}`,draggable:n,style:{position:"relative"},children:[o.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),o.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:o.jsx(hue,{axis:"y",values:d,onReorder:l=>{h(l),t?.(l)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((l,u)=>o.jsx(fue,{value:l,index:u,itemsDraggable:s},String(l.id)))})}),n&&o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:o.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function fue({value:e,index:t}){const n=sue(),c=lL[t%lL.length]??null;return o.jsx(kue,{value:e,dragListener:!1,dragControls:n,style:{listStyle:"none"},onDragStart:()=>{try{document.body.classList.add("is-dragging")}catch{}},onDragEnd:()=>{try{document.body.classList.remove("is-dragging")}catch{}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("div",{className:"reorder-handle","aria-hidden":!0,onPointerDown:i=>n.start(i),style:{width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",userSelect:"none"},children:o.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:o.jsxs("g",{fill:"currentColor",children:[o.jsx("circle",{cx:"8",cy:"6",r:"2"}),o.jsx("circle",{cx:"16",cy:"6",r:"2"}),o.jsx("circle",{cx:"8",cy:"12",r:"2"}),o.jsx("circle",{cx:"16",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),o.jsx("div",{style:{flex:1},children:o.jsx(Pj,{title:e.title,subtitle:e.subtitle,text:e.text,background:e.background,titleStyle:e.titleStyle,subtitleStyle:e.subtitleStyle,textStyle:e.textStyle,itemStyle:e.itemStyle,icon:e.icon??c})})]})})}function gue(e,t){return t.required?t.type==="checkbox"&&!e?{isValid:!1,error:`${t.label} est requis`}:!e||typeof e=="string"&&e.trim()===""?{isValid:!1,error:`${t.label} est requis`}:null:null}function vue(e){return!e||typeof e=="string"&&e.trim()===""}function Mue(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function xue(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function _ue(e,t){const n=Number(e);return isNaN(n)?{isValid:!1,error:"Doit être un nombre valide"}:t.validation?.min!==void 0&&n<Number(t.validation.min)?{isValid:!1,error:`Doit être ≥ ${t.validation.min}`}:t.validation?.max!==void 0&&n>Number(t.validation.max)?{isValid:!1,error:`Doit être ≤ ${t.validation.max}`}:null}function Lue(e,t){return t.validation?.minDate&&new Date(e)<new Date(t.validation.minDate)?{isValid:!1,error:`Doit être après ${t.validation.minDate}`}:t.validation?.maxDate&&new Date(e)>new Date(t.validation.maxDate)?{isValid:!1,error:`Doit être avant ${t.validation.maxDate}`}:null}function Iue(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),c=e.type;if(!n.some(i=>c.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${c}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function bue(e,t){return t.validation?t.validation.minLength&&e.length<t.validation.minLength?{isValid:!1,error:`Minimum ${t.validation.minLength} caractères`}:t.validation.maxLength&&e.length>t.validation.maxLength?{isValid:!1,error:`Maximum ${t.validation.maxLength} caractères`}:t.validation.pattern&&!new RegExp(t.validation.pattern).test(e)?{isValid:!1,error:"Format invalide"}:null:null}function hL(e,t){const n=gue(e,t);if(n)return n;if(vue(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=Mue(c);if(r)return r;break}case"url":{const r=xue(c);if(r)return r;break}case"number":{const r=_ue(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=Lue(e,t);if(r)return r;break}case"file":{const r=Iue(e,t);if(r)return r;break}}const i=bue(c,t);return i||{isValid:!0}}function gq(e,t){const n={};let c=!0;for(const i of t){const r=hL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const wue="_formContainer_14ads_1",Cue="_headerLine_14ads_17",Nue="_formTitle_14ads_25",Sue="_formDescription_14ads_30",jue="_sectionTitle_14ads_37",$ue="_sectionHelp_14ads_44",que="_fieldHelp_14ads_50",Aue="_gridContainer_14ads_58",zue="_fieldGridItem_14ads_70",Vue="_sectionFull_14ads_105",Pue="_formFooter_14ads_110",Tue="_footerLeft_14ads_118",Hue="_footerRight_14ads_119",Due="_cancelLink_14ads_125",Bue="_submitButton_14ads_136",Rue="_fieldLabel_14ads_148",Fue="_inputWrapper_14ads_163",Eue="_inputInner_14ads_187",Oue="_hasPrefix_14ads_196",Uue="_inputBase_14ads_196",Wue="_iconPrefix_14ads_292",Gue="_iconSuffix_14ads_293",Kue="_passwordToggle_14ads_319",Zue="_fieldError_14ads_365",Xue="_fieldInvalid_14ads_372",ye={formContainer:wue,headerLine:Cue,formTitle:Nue,formDescription:Sue,sectionTitle:jue,sectionHelp:$ue,fieldHelp:que,gridContainer:Aue,fieldGridItem:zue,sectionFull:Vue,formFooter:Pue,footerLeft:Tue,footerRight:Hue,cancelLink:Due,submitButton:Bue,fieldLabel:Rue,inputWrapper:Fue,inputInner:Eue,hasPrefix:Oue,inputBase:Uue,iconPrefix:Wue,iconSuffix:Gue,passwordToggle:Kue,fieldError:Zue,fieldInvalid:Xue},vq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=k.useState(!1),h=e.type==="password",l=e.attributes?.showPasswordToggle??!0,u=h?s?"text":"password":e.type,p=e.attributes?.iconComponent??(e.attributes?.icon?mt[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",m=f=>{n(f.target.value)};return o.jsxs("div",{className:ye.inputWrapper,children:[o.jsx("label",{className:`${ye.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${ye.inputInner} ${p&&y==="prefix"?ye.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:ye.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${ye.inputBase} ${i?ye.fieldInvalid:""}`,value:t??"",onChange:m,onBlur:c,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),h&&l&&o.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:ye.passwordToggle,onClick:()=>d(f=>!f),children:s?o.jsx(I1,{size:16}):o.jsx(b1,{size:16})}),p&&y==="suffix"&&!h&&o.jsx("span",{className:ye.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:ye.fieldError,children:i})]})},Yue="_fieldGroup_yb3zi_7",Jue="_fieldLabel_yb3zi_11",Que="_required_yb3zi_17",epe="_fieldInput_yb3zi_22",tpe="_fieldInvalid_yb3zi_40",ape="_fieldValid_yb3zi_44",npe="_fieldError_yb3zi_48",ope="_radioGroup_yb3zi_57",jt={fieldGroup:Yue,fieldLabel:Jue,required:Que,fieldInput:epe,fieldInvalid:tpe,fieldValid:ape,fieldError:npe,radioGroup:ope},vL=({field:e,children:t,error:n,touched:c})=>{const i=c&&n;return o.jsxs("div",{className:jt.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&o.jsx("label",{className:`${jt.fieldLabel} ${e.required?jt.required:""}`,children:e.label}),t,i&&o.jsx("span",{className:jt.fieldError,children:n})]})},Mq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,h=["form-control",jt.fieldInput,s?jt.fieldInvalid:"",d?jt.fieldValid:""].filter(Boolean).join(" ");return o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("textarea",{className:h,placeholder:e.placeholder,value:t||"",onChange:l=>n(l.target.value),onBlur:c,rows:4})})},cpe="_wrapper_117u4_1",ipe="_wrapperInvalid_117u4_15",rpe="_nativeSelect_117u4_19",spe="_display_117u4_30",dpe="_topLabel_117u4_37",lpe="_valueLine_117u4_45",hpe="_valuePlaceholder_117u4_53",upe="_valueActive_117u4_57",ppe="_caret_117u4_61",ype="_error_117u4_75",kpe="_optionStyle_117u4_89",Oe={wrapper:cpe,wrapperInvalid:ipe,nativeSelect:rpe,display:spe,topLabel:dpe,valueLine:lpe,valuePlaceholder:hpe,valueActive:upe,caret:ppe,error:ype,optionStyle:kpe},Uw=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=!!(r&&i),d=e.label||"",h=e.placeholder||"",l=e.options?.find(u=>String(u.value)===String(t))?.label??"";return o.jsxs("div",{className:`${Oe.wrapper} ${s?Oe.wrapperInvalid:""} ${t?Oe.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Oe.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:c,"aria-invalid":s,"aria-label":d,children:[o.jsx("option",{value:"",disabled:!0,hidden:!0,children:h||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>o.jsx("option",{value:u.value,className:Oe.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Oe.display,children:[d&&o.jsx("span",{className:Oe.topLabel,children:d}),o.jsx("span",{className:`${Oe.valueLine} ${t?Oe.valueActive:Oe.valuePlaceholder}`,children:t?l:h}),o.jsx("span",{className:Oe.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Oe.error,children:i})]})},xq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),_q=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("div",{className:jt.radioGroup,children:e.options?.map(s=>o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"radio",className:"form-check-input",id:`${e.name}-${s.value}`,name:e.name,value:s.value,checked:t===s.value,onChange:d=>n(d.target.value),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),mpe="_fileInputContainer_r2guc_3",fpe="_customFileInput_r2guc_8",gpe="_fileInputLabel_r2guc_12",vpe="_dragOver_r2guc_39",Mpe="_uploadIcon_r2guc_44",xpe="_uploadText_r2guc_50",_pe="_uploadHint_r2guc_56",Lpe="_fileList_r2guc_60",Ipe="_fileListTitle_r2guc_69",bpe="_fileItem_r2guc_80",wpe="_fileIcon_r2guc_96",Cpe="_fileName_r2guc_102",Npe="_fileSize_r2guc_108",Spe="_removeButton_r2guc_114",jpe="_errorText_r2guc_129",qe={fileInputContainer:mpe,customFileInput:fpe,fileInputLabel:gpe,dragOver:vpe,uploadIcon:Mpe,uploadText:xpe,uploadHint:_pe,fileList:Lpe,fileListTitle:Ipe,fileItem:bpe,fileIcon:wpe,fileName:Cpe,fileSize:Npe,removeButton:Spe,errorText:jpe},Lq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=k.useRef(null),[d,h]=k.useState(!1),l=M=>{n(M.target.files)},u=()=>{s.current&&s.current.click()},p=M=>{M.preventDefault(),h(!0)},y=()=>{h(!1)},m=M=>{M.preventDefault(),h(!1),M.dataTransfer.files&&M.dataTransfer.files.length>0&&n(M.dataTransfer.files)},f=M=>{if(!t)return;const x=Array.from(t);x.splice(M,1);const v=new DataTransfer;x.forEach(L=>v.items.add(L)),n(v.files)},g=M=>{if(M===0)return"0 Bytes";const x=1024,v=["Bytes","KB","MB","GB"],L=Math.floor(Math.log(M)/Math.log(x));return parseFloat((M/Math.pow(x,L)).toFixed(2))+" "+v[L]};return o.jsxs("div",{className:`${qe.fileInputContainer} ${r&&i?qe.hasError:""}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:l,onBlur:c,ref:s,className:qe.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${qe.fileInputLabel} ${d?qe.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:m,onClick:u,tabIndex:0,children:[o.jsx("div",{className:qe.uploadIcon,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),o.jsx("path",{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"})]})}),o.jsx("div",{className:qe.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:qe.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:qe.fileList,children:[o.jsx("div",{className:qe.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((M,x)=>o.jsxs("li",{className:qe.fileItem,children:[o.jsx("div",{className:qe.fileIcon,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:o.jsx("path",{d:"M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3z"})})}),o.jsx("div",{className:qe.fileName,children:M.name}),o.jsx("div",{className:qe.fileSize,children:g(M.size)}),o.jsx("button",{type:"button",className:qe.removeButton,onClick:v=>{v.stopPropagation(),f(x)},"aria-label":`Supprimer ${M.name}`,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"}),o.jsx("path",{fillRule:"evenodd",d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"})]})})]},x))})]}),r&&i&&o.jsx("div",{className:qe.errorText,children:i})]})},$pe="_container_ecah4_2",qpe="_label_ecah4_6",Ape="_requiredIndicator_ecah4_13",zpe="_input_ecah4_18",Vpe="_inputError_ecah4_49",Ppe="_errorMessage_ecah4_58",Rc={container:$pe,label:qpe,requiredIndicator:Ape,input:zpe,inputError:Vpe,errorMessage:Ppe},Iq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r,labelColor:s="black",backgroundColor:d="white"})=>{const h=e.type==="month"?"month":e.type==="week"?"week":e.type==="time"?"time":e.type==="datetime-local"?"datetime-local":"date";return o.jsxs("div",{className:Rc.container,children:[o.jsxs("label",{htmlFor:e.name,className:Rc.label,style:{color:s},children:[e.label,e.required&&o.jsx("span",{className:Rc.requiredIndicator,children:"*"})]}),o.jsx("input",{type:h,id:e.name,name:e.name,value:t||"",onChange:l=>n(l.target.value),onBlur:c,className:`${Rc.input} ${r&&i?Rc.inputError:""}`,style:{color:s,backgroundColor:d},min:e.validation?.min,max:e.validation?.max,step:e.type==="time"?e.attributes?.step:void 0,disabled:e.disabled}),r&&i&&o.jsx("div",{className:Rc.errorMessage,children:i})]})},Tpe="_rangeContainer_cyqk3_3",Hpe={rangeContainer:Tpe},bq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${Hpe.rangeContainer}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:c,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Dpe="_colorPickerContainer_1wxgj_2",Bpe="_colorInput_1wxgj_19",Rpe="_colorValue_1wxgj_39",QL={colorPickerContainer:Dpe,colorInput:Bpe,colorValue:Rpe},wq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:"mb-3",children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsxs("div",{className:QL.colorPickerContainer,children:[o.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:c,className:QL.colorInput}),o.jsx("span",{className:QL.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Cq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return o.jsx(Lq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(Iq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(bq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(wq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(Mq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(Uw,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(xq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(_q,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(vq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var eI,xN;function Fpe(){if(xN)return eI;xN=1;function e(){this.__data__=[],this.size=0}return eI=e,eI}var tI,_N;function Nq(){if(_N)return tI;_N=1;function e(t,n){return t===n||t!==t&&n!==n}return tI=e,tI}var aI,LN;function ML(){if(LN)return aI;LN=1;var e=Nq();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return aI=t,aI}var nI,IN;function Epe(){if(IN)return nI;IN=1;var e=ML(),t=Array.prototype,n=t.splice;function c(i){var r=this.__data__,s=e(r,i);if(s<0)return!1;var d=r.length-1;return s==d?r.pop():n.call(r,s,1),--this.size,!0}return nI=c,nI}var oI,bN;function Ope(){if(bN)return oI;bN=1;var e=ML();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return oI=t,oI}var cI,wN;function Upe(){if(wN)return cI;wN=1;var e=ML();function t(n){return e(this.__data__,n)>-1}return cI=t,cI}var iI,CN;function Wpe(){if(CN)return iI;CN=1;var e=ML();function t(n,c){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,c])):i[r][1]=c,this}return iI=t,iI}var rI,NN;function xL(){if(NN)return rI;NN=1;var e=Fpe(),t=Epe(),n=Ope(),c=Upe(),i=Wpe();function r(s){var d=-1,h=s==null?0:s.length;for(this.clear();++d<h;){var l=s[d];this.set(l[0],l[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,rI=r,rI}var sI,SN;function Gpe(){if(SN)return sI;SN=1;var e=xL();function t(){this.__data__=new e,this.size=0}return sI=t,sI}var dI,jN;function Kpe(){if(jN)return dI;jN=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return dI=e,dI}var lI,$N;function Zpe(){if($N)return lI;$N=1;function e(t){return this.__data__.get(t)}return lI=e,lI}var hI,qN;function Xpe(){if(qN)return hI;qN=1;function e(t){return this.__data__.has(t)}return hI=e,hI}var uI,AN;function Sq(){if(AN)return uI;AN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return uI=e,uI}var pI,zN;function Mt(){if(zN)return pI;zN=1;var e=Sq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return pI=n,pI}var yI,VN;function Ww(){if(VN)return yI;VN=1;var e=Mt(),t=e.Symbol;return yI=t,yI}var kI,PN;function Ype(){if(PN)return kI;PN=1;var e=Ww(),t=Object.prototype,n=t.hasOwnProperty,c=t.toString,i=e?e.toStringTag:void 0;function r(s){var d=n.call(s,i),h=s[i];try{s[i]=void 0;var l=!0}catch{}var u=c.call(s);return l&&(d?s[i]=h:delete s[i]),u}return kI=r,kI}var mI,TN;function Jpe(){if(TN)return mI;TN=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return mI=n,mI}var fI,HN;function _L(){if(HN)return fI;HN=1;var e=Ww(),t=Ype(),n=Jpe(),c="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:c:r&&r in Object(d)?t(d):n(d)}return fI=s,fI}var gI,DN;function jq(){if(DN)return gI;DN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return gI=e,gI}var vI,BN;function $q(){if(BN)return vI;BN=1;var e=_L(),t=jq(),n="[object AsyncFunction]",c="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var h=e(d);return h==c||h==i||h==n||h==r}return vI=s,vI}var MI,RN;function Qpe(){if(RN)return MI;RN=1;var e=Mt(),t=e["__core-js_shared__"];return MI=t,MI}var xI,FN;function eye(){if(FN)return xI;FN=1;var e=Qpe(),t=function(){var c=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}();function n(c){return!!t&&t in c}return xI=n,xI}var _I,EN;function qq(){if(EN)return _I;EN=1;var e=Function.prototype,t=e.toString;function n(c){if(c!=null){try{return t.call(c)}catch{}try{return c+""}catch{}}return""}return _I=n,_I}var LI,ON;function tye(){if(ON)return LI;ON=1;var e=$q(),t=eye(),n=jq(),c=qq(),i=/[\\^$.*+?()[\]{}|]/g,r=/^\[object .+?Constructor\]$/,s=Function.prototype,d=Object.prototype,h=s.toString,l=d.hasOwnProperty,u=RegExp("^"+h.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var m=e(y)?u:r;return m.test(c(y))}return LI=p,LI}var II,UN;function aye(){if(UN)return II;UN=1;function e(t,n){return t?.[n]}return II=e,II}var bI,WN;function r1(){if(WN)return bI;WN=1;var e=tye(),t=aye();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return bI=n,bI}var wI,GN;function Gw(){if(GN)return wI;GN=1;var e=r1(),t=Mt(),n=e(t,"Map");return wI=n,wI}var CI,KN;function LL(){if(KN)return CI;KN=1;var e=r1(),t=e(Object,"create");return CI=t,CI}var NI,ZN;function nye(){if(ZN)return NI;ZN=1;var e=LL();function t(){this.__data__=e?e(null):{},this.size=0}return NI=t,NI}var SI,XN;function oye(){if(XN)return SI;XN=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return SI=e,SI}var jI,YN;function cye(){if(YN)return jI;YN=1;var e=LL(),t="__lodash_hash_undefined__",n=Object.prototype,c=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return c.call(s,r)?s[r]:void 0}return jI=i,jI}var $I,JN;function iye(){if(JN)return $I;JN=1;var e=LL(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return $I=c,$I}var qI,QN;function rye(){if(QN)return qI;QN=1;var e=LL(),t="__lodash_hash_undefined__";function n(c,i){var r=this.__data__;return this.size+=this.has(c)?0:1,r[c]=e&&i===void 0?t:i,this}return qI=n,qI}var AI,eS;function sye(){if(eS)return AI;eS=1;var e=nye(),t=oye(),n=cye(),c=iye(),i=rye();function r(s){var d=-1,h=s==null?0:s.length;for(this.clear();++d<h;){var l=s[d];this.set(l[0],l[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,AI=r,AI}var zI,tS;function dye(){if(tS)return zI;tS=1;var e=sye(),t=xL(),n=Gw();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return zI=c,zI}var VI,aS;function lye(){if(aS)return VI;aS=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return VI=e,VI}var PI,nS;function IL(){if(nS)return PI;nS=1;var e=lye();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return PI=t,PI}var TI,oS;function hye(){if(oS)return TI;oS=1;var e=IL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return TI=t,TI}var HI,cS;function uye(){if(cS)return HI;cS=1;var e=IL();function t(n){return e(this,n).get(n)}return HI=t,HI}var DI,iS;function pye(){if(iS)return DI;iS=1;var e=IL();function t(n){return e(this,n).has(n)}return DI=t,DI}var BI,rS;function yye(){if(rS)return BI;rS=1;var e=IL();function t(n,c){var i=e(this,n),r=i.size;return i.set(n,c),this.size+=i.size==r?0:1,this}return BI=t,BI}var RI,sS;function Aq(){if(sS)return RI;sS=1;var e=dye(),t=hye(),n=uye(),c=pye(),i=yye();function r(s){var d=-1,h=s==null?0:s.length;for(this.clear();++d<h;){var l=s[d];this.set(l[0],l[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,RI=r,RI}var FI,dS;function kye(){if(dS)return FI;dS=1;var e=xL(),t=Gw(),n=Aq(),c=200;function i(r,s){var d=this.__data__;if(d instanceof e){var h=d.__data__;if(!t||h.length<c-1)return h.push([r,s]),this.size=++d.size,this;d=this.__data__=new n(h)}return d.set(r,s),this.size=d.size,this}return FI=i,FI}var EI,lS;function mye(){if(lS)return EI;lS=1;var e=xL(),t=Gpe(),n=Kpe(),c=Zpe(),i=Xpe(),r=kye();function s(d){var h=this.__data__=new e(d);this.size=h.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=c,s.prototype.has=i,s.prototype.set=r,EI=s,EI}var OI,hS;function fye(){if(hS)return OI;hS=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return OI=t,OI}var UI,uS;function gye(){if(uS)return UI;uS=1;function e(t){return this.__data__.has(t)}return UI=e,UI}var WI,pS;function vye(){if(pS)return WI;pS=1;var e=Aq(),t=fye(),n=gye();function c(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return c.prototype.add=c.prototype.push=t,c.prototype.has=n,WI=c,WI}var GI,yS;function Mye(){if(yS)return GI;yS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length;++c<i;)if(n(t[c],c,t))return!0;return!1}return GI=e,GI}var KI,kS;function xye(){if(kS)return KI;kS=1;function e(t,n){return t.has(n)}return KI=e,KI}var ZI,mS;function zq(){if(mS)return ZI;mS=1;var e=vye(),t=Mye(),n=xye(),c=1,i=2;function r(s,d,h,l,u,p){var y=h&c,m=s.length,f=d.length;if(m!=f&&!(y&&f>m))return!1;var g=p.get(s),M=p.get(d);if(g&&M)return g==d&&M==s;var x=-1,v=!0,L=h&i?new e:void 0;for(p.set(s,d),p.set(d,s);++x<m;){var w=s[x],C=d[x];if(l)var b=y?l(C,w,x,d,s,p):l(w,C,x,s,d,p);if(b!==void 0){if(b)continue;v=!1;break}if(L){if(!t(d,function(_,I){if(!n(L,I)&&(w===_||u(w,_,h,l,p)))return L.push(I)})){v=!1;break}}else if(!(w===C||u(w,C,h,l,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return ZI=r,ZI}var XI,fS;function _ye(){if(fS)return XI;fS=1;var e=Mt(),t=e.Uint8Array;return XI=t,XI}var YI,gS;function Lye(){if(gS)return YI;gS=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return YI=e,YI}var JI,vS;function Iye(){if(vS)return JI;vS=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return JI=e,JI}var QI,MS;function bye(){if(MS)return QI;MS=1;var e=Ww(),t=_ye(),n=Nq(),c=zq(),i=Lye(),r=Iye(),s=1,d=2,h="[object Boolean]",l="[object Date]",u="[object Error]",p="[object Map]",y="[object Number]",m="[object RegExp]",f="[object Set]",g="[object String]",M="[object Symbol]",x="[object ArrayBuffer]",v="[object DataView]",L=e?e.prototype:void 0,w=L?L.valueOf:void 0;function C(b,_,I,j,N,S,A){switch(I){case v:if(b.byteLength!=_.byteLength||b.byteOffset!=_.byteOffset)return!1;b=b.buffer,_=_.buffer;case x:return!(b.byteLength!=_.byteLength||!S(new t(b),new t(_)));case h:case l:case y:return n(+b,+_);case u:return b.name==_.name&&b.message==_.message;case m:case g:return b==_+"";case p:var B=i;case f:var T=j&s;if(B||(B=r),b.size!=_.size&&!T)return!1;var V=A.get(b);if(V)return V==_;j|=d,A.set(b,_);var $=c(B(b),B(_),j,N,S,A);return A.delete(b),$;case M:if(w)return w.call(b)==w.call(_)}return!1}return QI=C,QI}var eb,xS;function wye(){if(xS)return eb;xS=1;function e(t,n){for(var c=-1,i=n.length,r=t.length;++c<i;)t[r+c]=n[c];return t}return eb=e,eb}var tb,_S;function Kw(){if(_S)return tb;_S=1;var e=Array.isArray;return tb=e,tb}var ab,LS;function Cye(){if(LS)return ab;LS=1;var e=wye(),t=Kw();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return ab=n,ab}var nb,IS;function Nye(){if(IS)return nb;IS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length,r=0,s=[];++c<i;){var d=t[c];n(d,c,t)&&(s[r++]=d)}return s}return nb=e,nb}var ob,bS;function Sye(){if(bS)return ob;bS=1;function e(){return[]}return ob=e,ob}var cb,wS;function jye(){if(wS)return cb;wS=1;var e=Nye(),t=Sye(),n=Object.prototype,c=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return c.call(s,d)}))}:t;return cb=r,cb}var ib,CS;function $ye(){if(CS)return ib;CS=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return ib=e,ib}var rb,NS;function bL(){if(NS)return rb;NS=1;function e(t){return t!=null&&typeof t=="object"}return rb=e,rb}var sb,SS;function qye(){if(SS)return sb;SS=1;var e=_L(),t=bL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return sb=c,sb}var db,jS;function Aye(){if(jS)return db;jS=1;var e=qye(),t=bL(),n=Object.prototype,c=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&c.call(s,"callee")&&!i.call(s,"callee")};return db=r,db}var m1={exports:{}},lb,$S;function zye(){if($S)return lb;$S=1;function e(){return!1}return lb=e,lb}m1.exports;var qS;function Vq(){return qS||(qS=1,function(e,t){var n=Mt(),c=zye(),i=t&&!t.nodeType&&t,r=i&&!0&&e&&!e.nodeType&&e,s=r&&r.exports===i,d=s?n.Buffer:void 0,h=d?d.isBuffer:void 0,l=h||c;e.exports=l}(m1,m1.exports)),m1.exports}var hb,AS;function Vye(){if(AS)return hb;AS=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(c,i){var r=typeof c;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(c))&&c>-1&&c%1==0&&c<i}return hb=n,hb}var ub,zS;function Pq(){if(zS)return ub;zS=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return ub=t,ub}var pb,VS;function Pye(){if(VS)return pb;VS=1;var e=_L(),t=Pq(),n=bL(),c="[object Arguments]",i="[object Array]",r="[object Boolean]",s="[object Date]",d="[object Error]",h="[object Function]",l="[object Map]",u="[object Number]",p="[object Object]",y="[object RegExp]",m="[object Set]",f="[object String]",g="[object WeakMap]",M="[object ArrayBuffer]",x="[object DataView]",v="[object Float32Array]",L="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",I="[object Uint8ClampedArray]",j="[object Uint16Array]",N="[object Uint32Array]",S={};S[v]=S[L]=S[w]=S[C]=S[b]=S[_]=S[I]=S[j]=S[N]=!0,S[c]=S[i]=S[M]=S[r]=S[x]=S[s]=S[d]=S[h]=S[l]=S[u]=S[p]=S[y]=S[m]=S[f]=S[g]=!1;function A(B){return n(B)&&t(B.length)&&!!S[e(B)]}return pb=A,pb}var yb,PS;function Tye(){if(PS)return yb;PS=1;function e(t){return function(n){return t(n)}}return yb=e,yb}var f1={exports:{}};f1.exports;var TS;function Hye(){return TS||(TS=1,function(e,t){var n=Sq(),c=t&&!t.nodeType&&t,i=c&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===c,s=r&&n.process,d=function(){try{var h=i&&i.require&&i.require("util").types;return h||s&&s.binding&&s.binding("util")}catch{}}();e.exports=d}(f1,f1.exports)),f1.exports}var kb,HS;function Tq(){if(HS)return kb;HS=1;var e=Pye(),t=Tye(),n=Hye(),c=n&&n.isTypedArray,i=c?t(c):e;return kb=i,kb}var mb,DS;function Dye(){if(DS)return mb;DS=1;var e=$ye(),t=Aye(),n=Kw(),c=Vq(),i=Vye(),r=Tq(),s=Object.prototype,d=s.hasOwnProperty;function h(l,u){var p=n(l),y=!p&&t(l),m=!p&&!y&&c(l),f=!p&&!y&&!m&&r(l),g=p||y||m||f,M=g?e(l.length,String):[],x=M.length;for(var v in l)(u||d.call(l,v))&&!(g&&(v=="length"||m&&(v=="offset"||v=="parent")||f&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,x)))&&M.push(v);return M}return mb=h,mb}var fb,BS;function Bye(){if(BS)return fb;BS=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return fb=t,fb}var gb,RS;function Rye(){if(RS)return gb;RS=1;function e(t,n){return function(c){return t(n(c))}}return gb=e,gb}var vb,FS;function Fye(){if(FS)return vb;FS=1;var e=Rye(),t=e(Object.keys,Object);return vb=t,vb}var Mb,ES;function Eye(){if(ES)return Mb;ES=1;var e=Bye(),t=Fye(),n=Object.prototype,c=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))c.call(r,d)&&d!="constructor"&&s.push(d);return s}return Mb=i,Mb}var xb,OS;function Oye(){if(OS)return xb;OS=1;var e=$q(),t=Pq();function n(c){return c!=null&&t(c.length)&&!e(c)}return xb=n,xb}var _b,US;function Uye(){if(US)return _b;US=1;var e=Dye(),t=Eye(),n=Oye();function c(i){return n(i)?e(i):t(i)}return _b=c,_b}var Lb,WS;function Wye(){if(WS)return Lb;WS=1;var e=Cye(),t=jye(),n=Uye();function c(i){return e(i,n,t)}return Lb=c,Lb}var Ib,GS;function Gye(){if(GS)return Ib;GS=1;var e=Wye(),t=1,n=Object.prototype,c=n.hasOwnProperty;function i(r,s,d,h,l,u){var p=d&t,y=e(r),m=y.length,f=e(s),g=f.length;if(m!=g&&!p)return!1;for(var M=m;M--;){var x=y[M];if(!(p?x in s:c.call(s,x)))return!1}var v=u.get(r),L=u.get(s);if(v&&L)return v==s&&L==r;var w=!0;u.set(r,s),u.set(s,r);for(var C=p;++M<m;){x=y[M];var b=r[x],_=s[x];if(h)var I=p?h(_,b,x,s,r,u):h(b,_,x,r,s,u);if(!(I===void 0?b===_||l(b,_,d,h,u):I)){w=!1;break}C||(C=x=="constructor")}if(w&&!C){var j=r.constructor,N=s.constructor;j!=N&&"constructor"in r&&"constructor"in s&&!(typeof j=="function"&&j instanceof j&&typeof N=="function"&&N instanceof N)&&(w=!1)}return u.delete(r),u.delete(s),w}return Ib=i,Ib}var bb,KS;function Kye(){if(KS)return bb;KS=1;var e=r1(),t=Mt(),n=e(t,"DataView");return bb=n,bb}var wb,ZS;function Zye(){if(ZS)return wb;ZS=1;var e=r1(),t=Mt(),n=e(t,"Promise");return wb=n,wb}var Cb,XS;function Xye(){if(XS)return Cb;XS=1;var e=r1(),t=Mt(),n=e(t,"Set");return Cb=n,Cb}var Nb,YS;function Yye(){if(YS)return Nb;YS=1;var e=r1(),t=Mt(),n=e(t,"WeakMap");return Nb=n,Nb}var Sb,JS;function Jye(){if(JS)return Sb;JS=1;var e=Kye(),t=Gw(),n=Zye(),c=Xye(),i=Yye(),r=_L(),s=qq(),d="[object Map]",h="[object Object]",l="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",m=s(e),f=s(t),g=s(n),M=s(c),x=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=l||c&&v(new c)!=u||i&&v(new i)!=p)&&(v=function(L){var w=r(L),C=w==h?L.constructor:void 0,b=C?s(C):"";if(b)switch(b){case m:return y;case f:return d;case g:return l;case M:return u;case x:return p}return w}),Sb=v,Sb}var jb,QS;function Qye(){if(QS)return jb;QS=1;var e=mye(),t=zq(),n=bye(),c=Gye(),i=Jye(),r=Kw(),s=Vq(),d=Tq(),h=1,l="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,m=y.hasOwnProperty;function f(g,M,x,v,L,w){var C=r(g),b=r(M),_=C?u:i(g),I=b?u:i(M);_=_==l?p:_,I=I==l?p:I;var j=_==p,N=I==p,S=_==I;if(S&&s(g)){if(!s(M))return!1;C=!0,j=!1}if(S&&!j)return w||(w=new e),C||d(g)?t(g,M,x,v,L,w):n(g,M,_,x,v,L,w);if(!(x&h)){var A=j&&m.call(g,"__wrapped__"),B=N&&m.call(M,"__wrapped__");if(A||B){var T=A?g.value():g,V=B?M.value():M;return w||(w=new e),L(T,V,x,v,w)}}return S?(w||(w=new e),c(g,M,x,v,L,w)):!1}return jb=f,jb}var $b,ej;function e4e(){if(ej)return $b;ej=1;var e=Qye(),t=bL();function n(c,i,r,s,d){return c===i?!0:c==null||i==null||!t(c)&&!t(i)?c!==c&&i!==i:e(c,i,r,s,n,d)}return $b=n,$b}var qb,tj;function t4e(){if(tj)return qb;tj=1;var e=e4e();function t(n,c){return e(n,c)}return qb=t,qb}var a4e=t4e();const n4e=a.getDefaultExportFromCjs(a4e),o4e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:h})=>{const[l,u]=k.useState(t),[p,y]=k.useState({}),[m,f]=k.useState({}),[g,M]=k.useState(!1),x=k.useRef(t);k.useEffect(()=>{n4e(x.current,t)||(u(t),x.current=t)},[t]);const v=(I,j)=>{const N={...l,[I]:j};if(u(N),m[I]){const S=e.fields.find(A=>A.name===I);if(S){const A=hL(j,S);y(B=>({...B,[I]:A.isValid?"":A.error}))}}},L=I=>{if(!m[I]){f(N=>({...N,[I]:!0}));const j=e.fields.find(N=>N.name===I);if(j){const N=hL(l[I],j);y(S=>({...S,[I]:N.isValid?"":N.error}))}}},w=async I=>{I.preventDefault(),M(!0);const j=e.fields.reduce((S,A)=>(A.type!=="section"&&(S[A.name]=!0),S),{});f(j);const N=gq(l,e.fields.filter(S=>S.type!=="section"));if(y(N.errors),N.isValid)try{await n(l)}catch(S){console.error("Erreur lors de la soumission:",S),y(A=>({...A,__global:"Une erreur est survenue lors de la soumission"}))}M(!1)},C=h?mt[h]:null,b=i&&mt[i]||e.submitIcon&&mt[e.submitIcon]||null,_=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:ye.formContainer,children:[o.jsx("div",{className:ye.headerLine,children:o.jsx("h2",{className:ye.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:ye.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${ye.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:w,children:[o.jsx("div",{className:ye.gridContainer,style:{gridTemplateColumns:`repeat(${_}, minmax(0, 1fr))`},children:e.fields.map(I=>{if(I.type==="section")return o.jsxs("div",{className:ye.sectionFull,children:[o.jsx("h5",{className:ye.sectionTitle,children:I.label}),I.help&&o.jsx("p",{className:ye.sectionHelp,children:I.help})]},I.name);const N={gridColumn:`span ${Math.max(1,Math.min(_,I.gridCol??_))}`};return o.jsxs("div",{className:ye.fieldGridItem,style:N,children:[o.jsx(Cq,{field:I,value:l[I.name],onChange:S=>v(I.name,S),onBlur:()=>L(I.name),error:p[I.name],touched:m[I.name]}),I.help&&o.jsx("small",{className:ye.fieldHelp,children:I.help})]},I.name)})}),o.jsxs("div",{className:ye.formFooter,children:[o.jsx("div",{className:ye.footerLeft,children:s&&o.jsxs("button",{type:"button",className:ye.cancelLink,onClick:s,children:[C&&o.jsx(C,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:ye.footerRight,children:o.jsx(tL,{type:"submit",variant:"primary",size:"md",className:ye.submitButton,disabled:g,children:g?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[b&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(b,{size:16,className:"me-2"}),c||e.submitText||"Valider",b&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(b,{size:16,className:"ms-2"})]})})})]})]})]})};function c4e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const aj=new Map,i4e=({path:e,style:t,width:n=24,height:c=24,keepColors:i=!1,onClick:r})=>{const[s,d]=k.useState("");return k.useEffect(()=>{e&&(async()=>{try{let l=aj.get(e);l||(l=fetch(e).then(f=>{if(!f.ok)throw new Error(`Failed to load ${e}`);return f.text()}),aj.set(e,l));let u=await l;const p=t?.width||`${n}px`,y=t?.height||`${c}px`;i||(u=u.replace(/fill="[^"]*"/g,'fill="currentColor"'),u=u.replace(/fill='[^']*'/g,"fill='currentColor'"));const m=i?`width="${p}" height="${y}"`:`width="${p}" height="${y}" fill="currentColor"`;u=u.replace(/<svg/,`<svg ${m}`),d(u)}catch(l){console.error(`Failed to load icon: ${e}`,l)}})()},[e,t?.width,t?.height,n,c]),s?o.jsx("span",{onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t?.color||"inherit",...t},dangerouslySetInnerHTML:{__html:s}}):null},r4e="_container_1gljv_85",s4e="_tableWrapper_1gljv_111",d4e="_tableControls_1gljv_117",l4e="_controlsRight_1gljv_128",h4e="_limitedRows_1gljv_151",u4e="_table_1gljv_111",p4e="_headerCell_1gljv_206",y4e="_headerContent_1gljv_220",k4e="_headerWords_1gljv_229",m4e="_headerWord_1gljv_229",f4e="_cellContent_1gljv_276",g4e="_alignLeft_1gljv_286",v4e="_alignCenter_1gljv_290",M4e="_alignRight_1gljv_294",x4e="_tableCell_1gljv_298",_4e="_tableRow_1gljv_308",L4e="_emptyRow_1gljv_385",I4e="_toggleFiltersButton_1gljv_393",b4e="_toggleSortButton_1gljv_394",w4e="_buttonTextCompact_1gljv_415",C4e="_uppercaseSmall_1gljv_450",N4e="_filtersPanel_1gljv_463",S4e="_filtersPanelInline_1gljv_481",j4e="_filtersPanelHorizontal_1gljv_492",$4e="_filtersRow_1gljv_492",q4e="_filtersActionsHorizontal_1gljv_525",A4e="_filterItemInline_1gljv_542",z4e="_filterLabel_1gljv_571",V4e="_filterInput_1gljv_576",P4e="_filterSelect_1gljv_577",T4e="_operatorSelect_1gljv_578",H4e="_operatorInput_1gljv_579",D4e="_activeFilterTag_1gljv_597",B4e="_actionsGroup_1gljv_609",R4e="_applyButton_1gljv_615",F4e="_cancelButton_1gljv_625",E4e="_columnSorterContainer_1gljv_649",O4e="_sorterControls_1gljv_654",U4e="_sortDropdownWrapper_1gljv_659",W4e="_sortDropdown_1gljv_659",G4e="_sortDropdownHeader_1gljv_679",K4e="_closeButton_1gljv_688",Z4e="_sortDropdownContent_1gljv_703",X4e="_sortDropdownItem_1gljv_709",Y4e="_sortDirectionButtons_1gljv_734",J4e="_sortDirectionButton_1gljv_734",Q4e="_activeSort_1gljv_757",e5e="_sortActions_1gljv_764",t5e="_paginationButton_1gljv_842",a5e="_pageSizeSelect_1gljv_844",n5e="_topPagination_1gljv_853",o5e="_paginationContainer_1gljv_861",c5e="_leftGroup_1gljv_874",i5e="_pageSizeControls_1gljv_882",r5e="_paginationInfo_1gljv_908",s5e="_paginationControls_1gljv_916",d5e="_disabledButton_1gljv_947",l5e="_activeButton_1gljv_952",h5e="_navigationButton_1gljv_962",u5e="_operatorFilterContainer_1gljv_1010",p5e="_rangeSeparator_1gljv_1016",y5e="_activeFiltersSection_1gljv_1179",k5e="_activeFiltersRow_1gljv_1184",m5e="_activeFiltersList_1gljv_1192",f5e="_clearAllButton_1gljv_1200",g5e="_removeFilterButton_1gljv_1221",v5e="_sortIndicator_1gljv_1272",M5e="_active_1gljv_349",x5e="_clearSortButton_1gljv_1371",_5e="_loaderSpinner_1gljv_2743",L5e="_loaderSpinnerSmall_1gljv_2755",I5e="_paginationLoading_1gljv_2772",b5e="_loadingButton_1gljv_2780",w5e="_loadingIndicator_1gljv_2791",z={container:r4e,tableWrapper:s4e,tableControls:d4e,controlsRight:l4e,limitedRows:h4e,table:u4e,headerCell:p4e,headerContent:y4e,headerWords:k4e,headerWord:m4e,cellContent:f4e,alignLeft:g4e,alignCenter:v4e,alignRight:M4e,tableCell:x4e,tableRow:_4e,emptyRow:L4e,toggleFiltersButton:I4e,toggleSortButton:b4e,buttonTextCompact:w4e,uppercaseSmall:C4e,filtersPanel:N4e,filtersPanelInline:S4e,filtersPanelHorizontal:j4e,filtersRow:$4e,filtersActionsHorizontal:q4e,filterItemInline:A4e,filterLabel:z4e,filterInput:V4e,filterSelect:P4e,operatorSelect:T4e,operatorInput:H4e,activeFilterTag:D4e,actionsGroup:B4e,applyButton:R4e,cancelButton:F4e,columnSorterContainer:E4e,sorterControls:O4e,sortDropdownWrapper:U4e,sortDropdown:W4e,sortDropdownHeader:G4e,closeButton:K4e,sortDropdownContent:Z4e,sortDropdownItem:X4e,sortDirectionButtons:Y4e,sortDirectionButton:J4e,activeSort:Q4e,sortActions:e5e,paginationButton:t5e,pageSizeSelect:a5e,topPagination:n5e,paginationContainer:o5e,leftGroup:c5e,pageSizeControls:i5e,paginationInfo:r5e,paginationControls:s5e,disabledButton:d5e,activeButton:l5e,navigationButton:h5e,operatorFilterContainer:u5e,rangeSeparator:p5e,activeFiltersSection:y5e,activeFiltersRow:k5e,activeFiltersList:m5e,clearAllButton:f5e,removeFilterButton:g5e,sortIndicator:v5e,active:M5e,clearSortButton:x5e,loaderSpinner:_5e,loaderSpinnerSmall:L5e,paginationLoading:I5e,loadingButton:b5e,loadingIndicator:w5e},C5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:c,className:z.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),N5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:c,className:z.filterInput}),S5e=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState([]);k.useEffect(()=>{(async()=>{if(e.asyncOptions)try{const h=await e.asyncOptions();r(h??[])}catch(h){console.error("Erreur chargement options MultiSelect:",h),r([])}else r(e.options??[])})()},[e]);const s=d=>{const h=Array.from(d.target.selectedOptions,l=>l.value);n(h)};return o.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:c,className:z.filterMultiSelect,children:i.map((d,h)=>o.jsx("option",{value:String(d.value),children:d.label},h))})},nj=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState(t||""),s=d=>{const h=d.target.value===""?"":Number(d.target.value);r(h),n(h)};return o.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:z.filterInput})},j5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState([]),[s,d]=k.useState(!1);k.useEffect(()=>{(async()=>{if(e.asyncOptions){d(!0);try{const u=await e.asyncOptions();r(u)}catch(u){console.error("Error loading options:",u)}finally{d(!1)}}else r(e.options||[])})()},[e]);const h=l=>{const u=l.target.value;n(u)};return s?o.jsx("div",{children:"Chargement..."}):o.jsxs("select",{value:String(t||""),onChange:h,disabled:c,className:z.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(l=>o.jsx("option",{value:l.value,children:l.label},l.value))]})},$5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState("");k.useEffect(()=>{r(typeof t=="string"?t:String(t||""))},[t]);const s=d=>{const h=d.target.value;r(h),n(h)};return o.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:z.filterInput})},q5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState(t?.operator||""),[s,d]=k.useState(t?.value||"");k.useEffect(()=>{i&&s&&n({operator:i,value:s})},[i,s,n]);const h=u=>{r(u.target.value)},l=u=>{d(u.target.value)};return o.jsxs("div",{className:z.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:h,disabled:c,className:z.operatorSelect,children:[o.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>o.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),o.jsx("input",{type:"text",value:s,onChange:l,placeholder:"Valeur",disabled:c||!i,className:z.operatorInput})]})},A5e=({value:e,onChange:t,disabled:n})=>{const c=e||{},i=s=>{t({...c,start:s.target.value})},r=s=>{t({...c,end:s.target.value})};return o.jsxs("div",{className:z.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:z.filterInput}),o.jsx("span",{className:z.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:z.filterInput})]})},z5e=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx($5e,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(nj,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(nj,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(j5e,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(q5e,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(S5e,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(N5e,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx(A5e,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(C5e,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},Hq=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=k.useState([]),[d,h]=k.useState(()=>{const f={};return e.forEach(g=>{g.type==="daterange"?f[g.id]={start:"",end:""}:f[g.id]=g.defaultValue??""}),f});k.useEffect(()=>{if(!i)return;const f={...d??{}};e.forEach(g=>{g.id in f||(f[g.id]=g.type==="daterange"?{start:"",end:""}:g.defaultValue??"")}),(t||[]).forEach(g=>{!g||!g.id||(f[g.id]=g.value)}),h(f),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(f=>f.id))]);const l=i?t:r,u=k.useCallback((f,g)=>{h(M=>({...M,[f]:g}))},[]),p=k.useCallback(async()=>{const f=[],g={...d};for(const[M,x]of Object.entries(g)){const v=e.find(C=>C.id===M);if(!v)continue;let L=x;try{typeof x=="function"&&(L=await x(g)),typeof v.executeOnApply=="function"&&(L=await v.executeOnApply(L,g))}catch{continue}if(v.type==="daterange"){const C=L?.start??"",b=L?.end??"",_=typeof C=="string"?C.trim()==="":!C,I=typeof b=="string"?b.trim()==="":!b;if(_&&I)continue}L==null||typeof L=="string"&&L.trim()===""||Array.isArray(L)&&L.length===0||typeof L=="object"&&!Array.isArray(L)&&Object.keys(L).length===0||f.push({id:M,type:v.type,value:L,label:v.label})}return i?n?.(f):(s(f),c?.(f)),f},[d,e,i,n,c]),y=k.useCallback(f=>{h(g=>({...g,[f]:void 0})),u(f,void 0)},[u]),m=k.useCallback(()=>{const f={};e.forEach(g=>{g.type==="daterange"?f[g.id]={start:"",end:""}:f[g.id]=g.defaultValue??""}),h(f),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:l,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:m}},V5e=(e,t)=>{if(e==null)return!1;const n=t.value;if(n==null)return!1;switch(t.type){case"text":case"search":return String(e).toLowerCase().includes(String(n).toLowerCase());case"number":case"range":return Number(e)===Number(n);case"select":case"multiselect":return Array.isArray(n)?n.includes(e)||n.map(c=>String(c)).includes(String(e)):String(e)===String(n);case"boolean":return!!e==!!n;case"date":return new Date(e).getTime()===new Date(String(n)).getTime();case"daterange":try{if(!n||typeof n!="object")return!1;const c=n;if(!c.start||!c.end)return!1;const i=c.start,r=c.end;if(typeof i!="string"||typeof r!="string"||!i.trim()||!r.trim())return!1;const s=new Date(e).getTime(),d=new Date(i).getTime(),h=new Date(r).getTime();return isNaN(s)||isNaN(d)||isNaN(h)?!1:s>=d&&s<=h}catch(c){return console.error("Error processing daterange filter:",c),!1}case"operator":if(typeof n=="object"&&n!==null){const c=n;if(!("operator"in c)||!("value"in c))return!1;const{operator:i,value:r}=c,s=Number(e),d=Number(r);if(isNaN(s)||isNaN(d))return String(e).includes(String(r));switch(i){case"equals":return s===d;case"gt":return s>d;case"lt":return s<d;case"gte":return s>=d;case"lte":return s<=d;default:return String(e).includes(String(r))}}return!1;default:return String(e).toLowerCase().includes(String(n).toLowerCase())}};function Dq(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),h=(n||"").trim().toLowerCase(),l=k.useMemo(()=>{let g=e;return h&&(g=g.filter(M=>t.some(x=>{const v=M.data[x.id];return v==null?!1:String(v).toLowerCase().includes(h)}))),s.length>0&&(g=g.filter(M=>s.every(x=>{try{const v=M.data[x.id];return V5e(v,x)}catch(v){return console.error("Error applying filter:",v),!1}}))),g},[e,t,h,s]),u=k.useMemo(()=>{if(!c?.key)return l;const g=c.key;return[...l].sort((M,x)=>{const v=M.data[g],L=x.data[g];if(v==null)return 1;if(L==null)return-1;if(typeof v=="number"&&typeof L=="number")return c.direction==="desc"?L-v:v-L;if(v instanceof Date&&L instanceof Date){const C=v.getTime()-L.getTime();return c.direction==="desc"?-C:C}const w=String(v).localeCompare(String(L),void 0,{numeric:!0,sensitivity:"base"});return c.direction==="desc"?-w:w})},[l,c]),p=u,y=Math.ceil(u.length/d),m=0,f=Math.min(i*d,u.length);return{paginatedData:p,sortedData:u,filteredData:l,totalPages:y,startIndex:m,endIndex:f}}const Bq=({value:e})=>e,Rq=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),Fq=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),Eq=({value:e})=>{if(!e)return null;const t={success:"success-badge",warning:"warning-badge",error:"error-badge",info:"info-badge",default:"default-badge"},n=typeof e=="object"?e.type:"default",c=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},c)},Oq=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},Uq=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),Wq=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),Gq=({value:e})=>k.createElement("div",{className:"image-container"},k.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),sw={renderers:{text:Bq,email:Rq,link:Fq,badge:Eq,date:Oq,number:Uq,currency:Wq,image:Gq},icons:{sortAsc:k.createElement(jc,{className:"sort-icon active",size:14}),sortDesc:k.createElement(qt,{className:"sort-icon active",size:14}),sortDefault:k.createElement(Yc,{className:"sort-icon",size:14})}},P5e=(e,t)=>{sw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),sw.renderers[e]=t},T5e=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1,debounceTimeout:r=300,expanded:s,onToggle:d,panelPlacement:h="top",onPanelHeightChange:l,label:u="Advanced-Filters",applyLabel:p="Apply",cancelLabel:y="Cancel",clearLabel:m="Clear",applyDisabled:f=!1,loading:g=!1})=>{const[M,x]=k.useState(!1),v=typeof s=="boolean"?s:M,{appliedFilters:L,tempFilters:w,updateFilter:C,applyFilters:b,clearAllFilters:_}=Hq({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),I=k.useRef(null),j=k.useRef(null);k.useEffect(()=>{if(v&&I.current){const V=I.current.getBoundingClientRect().height;l?.(V)}else l?.(0)},[v,e,w,l]);const N=()=>{typeof s=="boolean"?d?.(!s):x(V=>{const $=!V;return d?.($),$})},S=()=>e.map(V=>{const $=w?.[V.id];return $==null||typeof $=="string"&&$.trim()===""?null:{id:V.id,label:V.label,value:$}}).filter(Boolean),A=async()=>{let V;try{V=await b()}catch{V=void 0}let $=[];V&&Array.isArray(V)&&V.length>0?$=V:L&&L.length>0?$=L:$=S(),n?.($),c?.($)},B=()=>{d?.(!1),typeof s!="boolean"&&x(!1)},T=()=>{_(),n?.([]),c?.([])};return k.useEffect(()=>{const V=q=>{v&&j.current&&(j.current.contains(q.target)||(d?.(!1),typeof s!="boolean"&&x(!1)))},$=q=>{q.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&x(!1))};return v&&(document.addEventListener("pointerdown",V),document.addEventListener("keydown",$)),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("keydown",$)}},[v,s,d]),o.jsxs("div",{className:z.advancedFiltersContainer,ref:j,children:[o.jsxs("button",{className:`${z.toggleFiltersButton} ${L.length>0?z.active:""} ${v?z.toggleFiltersButtonOpen:""} ${g?z.loadingButton:""}`,onClick:N,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:g,children:[g?o.jsx("span",{className:z.loaderSpinnerSmall}):o.jsx(wt,{size:14}),o.jsx("span",{className:z.buttonTextCompact,children:u}),L.length>0&&!g&&o.jsx("span",{className:z.filterCountBadge,"aria-hidden":!0,children:L.length}),g&&o.jsx("span",{className:z.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:I,className:`${z.filtersPanel} ${h==="top"?`${z.filtersPanelInline} ${z.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:z.filtersRow,children:e.map(V=>o.jsxs("div",{className:`${z.filterItem} ${z.filterItemInline}`,children:[o.jsxs("label",{className:z.filterLabel,children:[V.label,V.required&&o.jsx("span",{className:z.required,children:"*"})]}),o.jsx(z5e,{config:V,value:w[V.id],onChange:$=>C(V.id,$),disabled:V.disabled})]},V.id))}),o.jsxs("div",{className:z.filtersActionsHorizontal,children:[o.jsx("div",{className:z.activeFiltersSection,children:L.length>0&&o.jsxs("div",{className:z.activeFiltersRow,children:[o.jsx("span",{className:z.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:z.activeFiltersList,children:L.map(V=>o.jsxs("div",{className:z.activeFilterTag,children:[V.label??V.id,o.jsx("button",{className:z.removeFilterButton,onClick:()=>C(V.id,void 0),"aria-label":`Supprimer ${V.id}`,type:"button",children:"×"})]},V.id))}),o.jsxs("button",{className:z.clearAllButton,onClick:T,type:"button",children:[o.jsx(Ke,{size:12})," ",m]})]})}),o.jsxs("div",{className:z.actionsGroup,children:[o.jsx("button",{className:z.cancelButton,onClick:B,type:"button",disabled:g,children:y}),o.jsx("button",{className:`${z.applyButton} ${g?z.loadingButton:""}`,onClick:A,type:"button",disabled:f||g,"aria-disabled":f||g,children:g?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:z.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},oj=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},H5e=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=k.useState(!1),d=e.filter(f=>f.sortable),h=k.useRef(null),l=t?.key!==null&&t?.key!==void 0,u=(f,g)=>{n({key:f,direction:g}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(f=>!f),m=()=>{s(!1)};return k.useEffect(()=>{if(!r)return;const f=M=>{if(!h.current)return;const x=M.target;x&&!h.current.contains(x)&&s(!1)},g=M=>{M.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",f),document.addEventListener("keydown",g),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",g)}},[r]),k.useEffect(()=>{const f=document.querySelector("[data-table-wrapper]");if(!f)return;const g=f.style.overflow??"";return r?f.style.overflow="hidden":f.style.overflow=g,()=>{f.style.overflow=g}},[r]),o.jsx("div",{className:z.columnSorterContainer,ref:h,children:o.jsx("div",{className:z.sorterControls,children:d.length>0&&o.jsxs("div",{className:z.sortDropdownWrapper,ref:h,children:[o.jsxs("button",{className:`${z.toggleSortButton} ${r?z.toggleSortButtonOpen:""} ${l?z.active:""} ${i?z.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:z.loaderSpinnerSmall}):o.jsx(Yc,{size:14}),o.jsx("span",{className:`${z.buttonTextCompact} ${oj(c)?z.uppercaseSmall:""}`,children:c}),l&&!i&&o.jsx("div",{className:z.sortIndicator,children:t?.direction==="asc"?o.jsx(jc,{size:12}):o.jsx(qt,{size:12})})]}),r&&o.jsxs("div",{className:`${z.sortDropdown} ${z.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:z.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:z.closeButton,onClick:m,"aria-label":"Fermer",type:"button",children:o.jsx(Ke,{size:16})})]}),o.jsx("div",{className:z.sortDropdownContent,children:d.map(f=>{const g=String(f.label??f.id),M=oj(g);return o.jsxs("div",{className:z.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:x=>{x.key==="Enter"&&u(f.id,"asc")},children:[o.jsx("span",{className:`${z.columnSorterLabel} ${M?z.uppercaseSmall:""}`,title:g,"aria-label":g,children:g}),o.jsxs("div",{className:z.sortDirectionButtons,children:[o.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===f.id&&t?.direction==="asc"?z.activeSort:""}`,onClick:()=>u(f.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(jc,{size:12})}),o.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===f.id&&t?.direction==="desc"?z.activeSort:""}`,onClick:()=>u(f.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:o.jsx(qt,{size:12})})]})]},f.id)})}),l&&o.jsx("div",{className:z.sortActions,children:o.jsxs("button",{className:z.clearSortButton,onClick:p,type:"button",children:[o.jsx(bt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},D5e=({currentPage:e,totalPages:t,pageSize:n,totalItems:c,itemLabel:i="items",onPageChange:r,onPageSizeChange:s,loading:d=!1})=>{const h=Math.max(1,Math.floor(t)),l=Math.min(Math.max(1,Math.floor(e)),h),u=()=>{l>1&&r(l-1)},p=()=>{if(l<t){const g=l+1;r(g)}},y=c>0?(l-1)*n+1:0,m=c>0?Math.min(l*n,c):0,f=()=>{const g=[];let x=Math.max(1,l-Math.floor(2.5)),v=x+5-1;v>h&&(v=h,x=Math.max(1,v-5+1));for(let L=x;L<=v;L++)g.push(L);return g};return o.jsxs("div",{className:z.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:z.leftGroup,children:s&&o.jsx("div",{className:z.pageSizeControls,children:o.jsx("select",{value:n,onChange:g=>s(Number(g.target.value)),className:z.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(g=>o.jsx("option",{value:g,children:g},g))})})}),o.jsx("div",{className:z.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:z.paginationLoading,children:[o.jsx("span",{className:z.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${m} ${i}`}),o.jsxs("div",{className:z.paginationControls,children:[o.jsx("button",{onClick:u,disabled:l===1||d,className:`${z.paginationButton} ${z.navigationButton} ${l===1?z.disabledButton:""} ${d?z.loadingButton:""}`,"aria-label":"Page précédente",children:d&&l>1?o.jsx("span",{className:z.loaderSpinnerSmall}):"«"}),f().map(g=>o.jsx("button",{onClick:()=>r(g),disabled:d,"aria-current":l===g?"page":void 0,className:`${z.paginationButton} ${l===g?z.activeButton:""} ${d?z.loadingButton:""}`,children:d&&l===g?o.jsx("span",{className:z.loaderSpinnerSmall}):g},g)),o.jsx("button",{onClick:p,disabled:d||l>=h,className:`${z.paginationButton} ${z.navigationButton} ${d?z.loadingButton:""} ${l>=h?z.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:z.loaderSpinnerSmall}):"»"})]})]})},B5e=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const c=n.toLowerCase();return c.charAt(0).toUpperCase()+c.slice(1)},R5e=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},F5e=({columns:e})=>o.jsx("thead",{className:z.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?z.alignRight:t.align==="left"?z.alignLeft:z.alignCenter,i=t.preserveHeaderCase===!0,r=B5e(String(t.label??""),i),s=R5e(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${z.headerCell} ${c}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",title:t.a11yConfig?.mode==="guide"?t.a11yConfig.description:t.a11yConfig?.mode==="key"?t.a11yConfig.key:void 0,children:o.jsx("div",{className:z.headerContent,children:s?o.jsx("div",{className:z.headerWords,children:d.map((h,l)=>o.jsx("span",{className:z.headerWord,children:h},l))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),E5e=({value:e,row:t,column:n})=>{const c=n.align==="right"?z.alignRight:n.align==="left"?z.alignLeft:z.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${z.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:z.cellContent,children:i})})},O5e=({row:e,rowId:t,columns:n,onRowClick:c,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:h,...l}=s||{},u={backgroundColor:d,...l,"--row-accent":h??"transparent"};return o.jsx("tr",{className:`${z.tableRow} ${c?z.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(E5e,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},U5e=({data:e,columns:t,onRowClick:n,startIndex:c,searchTerm:i,getRowStyle:r})=>e.length===0?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,className:z.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(O5e,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),Kq=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:c,searchTerm:i="",className:r="",filterConfig:s=[],externalFilters:d=[],onFiltersChange:h,onApplyFilters:l,onSort:u,filtersControlled:p=!1,debounceTimeout:y=300,getRowStyle:m,background:f,onPageSizeChange:g,onPageChange:M,itemLabel:x="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:L,sortLabel:w="Sort",applyLabel:C="Apply",cancelLabel:b="Cancel",clearLabel:_="Clear",applyDisabled:I=!1,paginationLoading:j=!1,filtersLoading:N=!1,sortLoading:S=!1,totalCount:A=null})=>{const[B,T]=k.useState({key:null,direction:"asc"}),[V,$]=k.useState(n.currentPage??1),[q,P]=k.useState(n.pageSize??10),[H,D]=k.useState(!1),F=k.useRef(null),[G,oe]=k.useState([]),ae=p?d:G,Me=p?[]:G;k.useEffect(()=>{const de=n.currentPage??1,Tt=n.pageSize??10;de!==V&&$(de),Tt!==q&&P(Tt)},[n.currentPage,n.pageSize]);const{paginatedData:me,sortedData:Ce,totalPages:he,startIndex:Y}=Dq(t,e,i,B,V,q,Me),ee=Ce.length,ie=typeof A=="number"&&A>=0?A:ee;let ue=he;typeof A=="number"&&A>=0&&(ue=Math.max(1,Math.ceil(A/q)));const re=ee>10;k.useEffect(()=>{const de=Math.max(1,Math.floor(ue));V>de&&$(de),V<1&&$(1)},[ue]);const W=de=>{p||oe(de),h?.(de),$(1),M?.(1)},O=de=>{p||oe(de),l?.(de),$(1),M?.(1),F.current&&F.current.style.setProperty("--filters-panel-height","0px")},ne=de=>{M?.(de),$(de)},we=de=>{P(de),$(1),g?.(de),M?.(1)},Be=de=>{F.current&&F.current.style.setProperty("--filters-panel-height",`${Math.round(de)}px`)},ge=de=>{T(de),u?.(de)},$e=de=>{D(de),!de&&F.current&&F.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(ae?.length??0)>0&&D(!0)},[ae]),k.useEffect(()=>{s.length>0&&ae.length>0&&D(!0)},[s.length,ae.length]);const Pc=(ae?.length??0)>0&&L?L:v;return o.jsxs("div",{ref:F,className:`${z.container} ${r} ${H?z.filtersOpen:""}`,style:{background:f,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:z.tableControls,children:o.jsxs("div",{className:z.controlsRight,children:[o.jsx(H5e,{columns:e,onSort:ge,label:w,sortConfig:B,loading:S}),s.length>0&&o.jsx(T5e,{filters:s,externalFilters:ae,onFiltersChange:W,onApply:O,isControlled:p,debounceTimeout:y,expanded:H,onToggle:$e,panelPlacement:"top",onPanelHeightChange:Be,label:Pc,applyLabel:C,cancelLabel:b,clearLabel:_,applyDisabled:I,loading:N})]})}),o.jsx("div",{className:z.topPagination,children:o.jsx(D5e,{currentPage:V,totalPages:ue,pageSize:q,totalItems:ie,itemLabel:x,onPageChange:ne,onPageSizeChange:we,loading:j})}),o.jsx("div",{className:`${z.tableWrapper} ${re?z.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:z.table,children:[o.jsx(F5e,{columns:e}),o.jsx(U5e,{data:me,columns:e,onRowClick:c,startIndex:Y,getRowStyle:m,searchTerm:i})]})})]})};function W5e(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=k.useMemo(()=>{if(n===null||typeof n>"u")return null;const p=Number(n);if(!Number.isFinite(p)||p<=0)return 1;const y=Number(r);return!Number.isFinite(y)||y<=0?1:Math.max(1,Math.ceil(p/y))},[n,r]),h=s>1,l=d===null?!1:s<d,u=p=>{typeof p=="number"&&(p<1||p<s&&!h||p>s&&!l||c?.(p))};return o.jsx(Kq,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const G5e="_mpRoot_31595_1",K5e="_mpHeader_31595_22",Z5e="_mpTitle_31595_31",X5e="_mpList_31595_35",Y5e="_mpVertical_31595_41",J5e="_mpHorizontal_31595_46",Q5e="_mpItem_31595_55",eke="_mpClickable_31595_95",tke="_mpLeft_31595_117",ake="_mpIcon_31595_125",nke="_mpMeta_31595_140",oke="_mpLabel_31595_145",cke="_mpDate_31595_154",ike="_mpRight_31595_160",rke="_mpValue_31595_168",ske="_mpHint_31595_176",dke="_mpBadge_31595_180",lke="_mpBadgeTop_31595_199",hke="_mpBadgeSub_31595_206",uke="_mpBadgeSmall_31595_213",pke="_mpPill_31595_229",yke="_mpRounded_31595_232",kke="_mpCompact_31595_236",mke="_compactItemWrapper_31595_252",fke="_mpSummaryRoot_31595_265",gke="_mpSummaryInner_31595_269",vke="_mpSummaryFlex_31595_284",Mke="_mpSummaryCardWrapperHorizontal_31595_292",xke="_mpSummaryCardWrapper_31595_292",_ke="_mpSummaryCardHorizontal_31595_303",Lke="_mpSummaryCard_31595_292",Ike="_mpSummaryValue_31595_321",bke="_mpSummaryLabel_31595_327",wke="_mpSummaryBadge_31595_338",Cke="_mpSummaryBadgeSub_31595_357",Nke="_mpEmpty_31595_365",Ske="_mpSummaryVertical_31595_372",jke="_mpIconSquare_31595_380",Z={mpRoot:G5e,mpHeader:K5e,mpTitle:Z5e,mpList:X5e,mpVertical:Y5e,mpHorizontal:J5e,mpItem:Q5e,mpClickable:eke,mpLeft:tke,mpIcon:ake,mpMeta:nke,mpLabel:oke,mpDate:cke,mpRight:ike,mpValue:rke,mpHint:ske,mpBadge:dke,mpBadgeTop:lke,mpBadgeSub:hke,mpBadgeSmall:uke,mpPill:pke,mpRounded:yke,mpCompact:kke,compactItemWrapper:mke,mpSummaryRoot:fke,mpSummaryInner:gke,mpSummaryFlex:vke,mpSummaryCardWrapperHorizontal:Mke,mpSummaryCardWrapper:xke,mpSummaryCardHorizontal:_ke,mpSummaryCard:Lke,mpSummaryValue:Ike,mpSummaryLabel:bke,mpSummaryBadge:wke,mpSummaryBadgeSub:Cke,mpEmpty:Nke,mpSummaryVertical:Ske,mpIconSquare:jke},$t=(e,t=1)=>{if(!e||typeof e!="string")return`rgba(124, 58, 237, ${t})`;const n=e.trim();if(n.toLowerCase()==="transparent")return"rgba(0,0,0,0)";if(/^rgba?\(/i.test(n))return/^rgba\(/i.test(n)?n.replace(/rgba\(([^)]+),\s*([0-9.]+)\s*\)$/,(d,h)=>`rgba(${h.split(",").map(u=>u.trim()).slice(0,3).join(", ")}, ${t})`):n;let c=n.replace("#","").toLowerCase();if(c.length===3&&(c=c.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(c))return`rgba(124, 58, 237, ${t})`;const i=parseInt(c.slice(0,2),16),r=parseInt(c.slice(2,4),16),s=parseInt(c.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},$ke=({item:e,shape:t,onItemClick:n,color:c,renderItem:i})=>{const r=k.useCallback(()=>{n?.(e)},[n,e]),s=[Z.mpItem,t==="pill"?Z.mpPill:Z.mpRounded,n?Z.mpClickable:""].filter(Boolean).join(" ");if(i)return o.jsx("div",{className:s,role:n?"button":"group",tabIndex:n?0:-1,onClick:r,onKeyDown:y=>{n&&(y.key==="Enter"||y.key===" ")&&(n(e),y.preventDefault())},"aria-label":n?`Voir les détails de ${e.label}`:void 0,children:i(e)});const d=n?"button":"div",h=n?{onClick:r,className:s,type:"button","aria-label":`Voir les détails de ${e.label}`}:{className:s,role:"group"},l=e.iconComponent,u=e.iconSquareBg,p=e.iconColor;return o.jsxs(d,{...h,children:[o.jsxs("div",{className:Z.mpLeft,children:[l?o.jsx("div",{className:Z.mpIconSquare,style:{background:u??$t(p??c??"#7c3aed",1),border:`1px solid ${$t(p??c??"#7c3aed",.18)}`,color:p??"#ffffff"},children:k.createElement(l,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?o.jsx("div",{className:Z.mpIcon,children:e.icon}):null,o.jsxs("div",{className:Z.mpMeta,children:[o.jsx("div",{className:Z.mpLabel,children:e.label}),e.subLabel&&o.jsx("div",{className:Z.mpDate,children:e.subLabel}),e.date&&o.jsx("div",{className:Z.mpDate,children:e.date})]})]}),o.jsxs("div",{className:Z.mpRight,children:[o.jsx("div",{className:Z.mpValue,style:{color:e.valueColor??c??void 0},children:e.value}),e.badge?o.jsxs("div",{className:[Z.mpBadge,e.badge.small?Z.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??$t(e.badge.color||c||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":$t(e.badge.color||c||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[o.jsx("div",{className:Z.mpBadgeTop,children:e.badge.text}),e.badge.subText&&o.jsx("div",{className:Z.mpBadgeSub,children:e.badge.subText})]}):e.hint?o.jsx("div",{className:Z.mpHint,children:e.hint}):null]})]})},qke=k.memo($ke),cj=({title:e,right:t})=>!e&&!t?null:o.jsxs("div",{className:Z.mpHeader,children:[o.jsx("div",{className:Z.mpTitle,children:e}),o.jsx("div",{children:t})]}),ij=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Ake=({item:e})=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:14,borderRadius:12,minHeight:88,boxSizing:"border-box",background:e.bgColor??"transparent",border:`1px solid ${e.borderColor??"transparent"}`,boxShadow:"0 4px 10px rgba(15,23,42,0.03)"},children:[o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[o.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),o.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),o.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??ij("#7c3aed",.12),border:`1px solid ${ij(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?k.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),zke=({item:e,bg:t,onClick:n,width:c,height:i,extraStyle:r})=>o.jsxs("div",{className:Z.mpSummaryCard,style:{background:t,width:c??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[o.jsx("div",{className:Z.mpSummaryLabel,children:e.label}),o.jsx("div",{className:Z.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&o.jsxs("div",{className:Z.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:Z.mpSummaryBadgeSub,children:e.badge.subText})]})]}),rj=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},sj=e=>o.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[o.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?o.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[o.jsx("div",{style:{fontWeight:900,fontSize:"clamp(16px, 1.6vw, 20px)",color:e.valueColor,lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.value}),e.badge?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:rj("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:rj("#7c3aed",.12)}`,color:e.badge.textColor||"#0f172a",fontWeight:700,fontSize:"clamp(12px, 1.2vw, 14px)",width:"120px",height:"52px",textAlign:"center",boxSizing:"border-box",overflow:"hidden",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",lineHeight:1.2,flexShrink:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:800,lineHeight:1.2,letterSpacing:"0.02em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.text}),e.badge.subText?o.jsx("div",{style:{fontSize:13,marginTop:4,fontWeight:700,letterSpacing:"0.01em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.subText}):null]}):null]})]}),dj=(e,t)=>{try{if(typeof e=="function"){const n=e(t);if(n!==void 0)return n}}catch{}try{return k.createElement(e,{item:t})}catch(n){return console.warn("chooseDefaultRender: impossible de rendre CompactRenderer",n),null}},Vke=e=>{switch(e){case"image":return t=>k.createElement(Ake,{item:t});case"pertinence":return t=>k.createElement(zke,{item:t});case"alternateHorizontal":return t=>dj(sj,t);case"compact":return t=>dj(sj,t);case"summary":return;case"default":default:return}},Zq=({item:e,orientation:t,bg:n,border:c,valueColor:i,onClick:r,width:s,height:d,extraStyle:h})=>{const u=t==="horizontal"?Z.mpSummaryCardHorizontal:Z.mpSummaryCard;return o.jsxs("div",{className:u,style:{background:n,border:`1px solid ${c}`,width:s??void 0,height:d??void 0,...h??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&o.jsxs("div",{className:Z.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:Z.mpSummaryBadgeSub,children:e.badge.subText})]}),o.jsx("div",{className:Z.mpSummaryValue,style:{color:i},children:e.value}),o.jsx("div",{className:Z.mpSummaryLabel,children:e.label})]})},Pke=["transparent","transparent","transparent","transparent"],Tke=["transparent","transparent","transparent","transparent"],Hke=["#059669","#2563eb","#b45309","#7c3aed"],Dke=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Xq=e=>{const{items:t=[],layout:n="vertical",orientation:c="auto",shape:i="rounded",color:r="#7c3aed",compact:s=!1,title:d,onItemClick:h,className:l="",loading:u=!1,emptyMessage:p="Aucun élément",renderItem:y,summary:m=!1,summaryBgColors:f=Pke,summaryBorderColors:g=Tke,summaryValueColors:M=Hke,preset:x,background:v}=e,{itemsContainerStyle:L,itemsContainerClassName:w,summaryGridColumns:C,compactItemWidth:b,compactItemHeight:_,compactItemStyle:I,summaryCardWidth:j,summaryCardHeight:N,summaryCardStyle:S}=e,A=n==="vertical",B={"--mp-accent":r,"--mp-accent-soft":Dke(r,.08),"--mp-bg-primary":v},T=[Z.mpRoot,A?Z.mpVertical:Z.mpHorizontal,s?Z.mpCompact:"",m?Z.mpSummaryRoot:"",c!=="auto"?c==="vertical"?Z.mpOrientationVertical:Z.mpOrientationHorizontal:"",l].filter(Boolean).join(" "),V=k.useMemo(()=>y||(Vke(x)??void 0),[y,x]);if(m){const $=c==="horizontal"?Z.mpSummaryFlex:Z.mpSummaryVertical,P={...(C?{display:"grid",gridTemplateColumns:`repeat(${C}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...L??{}};return o.jsxs("div",{className:T,style:B,"aria-busy":u,children:[d&&o.jsx(cj,{title:d}),o.jsx("div",{className:Z.mpSummaryInner,children:o.jsx("div",{className:`${$} ${w??""}`,style:P,children:t.length===0?o.jsx("div",{className:Z.mpEmpty,children:p}):t.map((H,D)=>{const F=H.bgColor??f[D%f.length],G=H.borderColor??g[D%g.length],oe=H.valueColor??M[D%M.length];return V?o.jsx("div",{className:c==="horizontal"?Z.mpSummaryCardWrapperHorizontal:Z.mpSummaryCardWrapper,style:{width:j??void 0,height:N??void 0,...S??{}},children:V(H,D)},H.id):o.jsx(Zq,{item:H,orientation:c==="horizontal"?"horizontal":"vertical",bg:F,border:G,valueColor:oe,onClick:h,width:j??void 0,height:N??void 0,extraStyle:S},H.id)})})})]})}return o.jsxs("div",{className:T,style:B,"aria-busy":u,children:[d&&o.jsx(cj,{title:d}),o.jsx("div",{className:Z.mpList,style:L,children:u?o.jsx("div",{className:Z.mpEmpty,children:"Chargement…"}):t.length===0?o.jsx("div",{className:Z.mpEmpty,children:p}):t.map($=>{const q=s?{width:b??void 0,height:_??void 0,boxSizing:"border-box",...I??{}}:void 0;return o.jsx("div",{className:s?Z.compactItemWrapper:void 0,style:q,children:o.jsx(qke,{item:$,shape:i,onItemClick:h,color:r,renderItem:V?P=>V(P,t.indexOf(P)):void 0})},$.id)})})]})};k.memo(Xq);const Bke=({a11yConfig:e,width:t,height:n,colors:c={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:i={},placeholder:r="Loading Chart",style:s,className:d="",children:h,padding:l="1rem",variant:u="default",showBorder:p=!1,titleKey:y,leftTitleKey:m})=>{const f=t?typeof t=="number"?`${t}px`:t:void 0,g=n?typeof n=="number"?`${n}px`:n:void 0,M=r&&typeof r=="object"&&!k.isValidElement(r)&&("text"in r||"subtext"in r||"icon"in r||"background"in r||"iconSize"in r),x=M?r:void 0,v=x?.icon?mt[x.icon]:void 0,L=28,w=x?.iconSize??L,C=["chart-container",`variant-${u}`,p?"with-border":"",d].filter(Boolean).join(" "),b=c.contentBackground??void 0,_=typeof l=="number"?`${l}px`:l;return o.jsxs("div",{className:C,style:{width:f,height:g,color:c.text,background:c.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:_,...s},children:[o.jsxs("div",{className:"chart-header",children:[o.jsxs("div",{title:Q(e,m||y),className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.left,i.leftSubtitle&&o.jsx("div",{className:"chart-subtitle-left",children:i.leftSubtitle})]}),o.jsx("div",{className:"chart-title-right",children:i.right})]}),o.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:b},children:h||(M&&x?o.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[v&&o.jsx("div",{className:"placeholder-icon",style:{width:w,height:w},children:o.jsx(v,{color:x.iconColor??"currentColor",size:typeof w=="number"?w:parseInt(String(w),10)||L})}),x.text&&o.jsx("div",{className:"placeholder-text",children:x.text}),x.subtext&&o.jsx("div",{className:"placeholder-subtext",children:x.subtext})]}):o.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:r}))})]})},Zw=({id:e,size:t="100%",background:n,icon:c,text:i,subtext:r,onClose:s,onClick:d,style:h,className:l="",colorTextPrimary:u,colorTextSub:p,model:y,fontSize:m,fontWeight:f,a11yConfig:g,titleKey:M})=>{const x=c||y?.icon,v=typeof x=="string",L=v?mt[x]:null,w=v?null:x;return o.jsxs("div",{id:e,className:`alert ${l}`,style:{width:typeof t=="number"?`${t}px`:t,background:n||y?.background,pointerEvents:"auto",...h},role:"alert",onClick:d,title:Q(g,M),children:[L&&o.jsx(L,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),w!=null&&o.jsx("span",{className:"alert-icon",style:{display:"flex",alignItems:"center",color:u||y?.colorTextPrimary,flexShrink:0},children:w}),o.jsxs("div",{className:"alert-content",children:[o.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary,fontSize:m,fontWeight:f},children:i}),r&&o.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&o.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},Yq=k.createContext(null),Rke=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,Fke=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:c,containerStyle:i})=>{const[r,s]=k.useState([]),d=k.useRef(new Map),h=k.useRef(null),l=k.useRef(null),u=k.useRef(n);k.useEffect(()=>()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear()},[]);const p=(_,I)=>{const j=I===void 0||I===0?t:I;if(j===-1)return;const N=window.setTimeout(()=>{f(_)},j);d.current.set(_,N)},y=_=>{const I=d.current.get(_);I&&(window.clearTimeout(I),d.current.delete(_))},m=_=>{const I=Rke(),j={..._,id:I,createdAt:Date.now()};return s(N=>{const S=[j,...N],A=u.current;return typeof A=="number"&&A>=0&&S.length>A?(S.slice(A).forEach(T=>y(T.id)),S.slice(0,A)):S}),p(I,_.duration),I},f=_=>{y(_),s(I=>I.filter(j=>j.id!==_))},g=(_,I)=>{s(j=>j.map(N=>N.id===_?{...N,...I}:N))},M=()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear(),s([])},x=_=>{l.current=_},v=()=>r.slice(),L=k.useMemo(()=>({showAlert:m,dismissAlert:f,updateAlert:g,clearAlerts:M,setContainerRef:x,getAlertsSnapshot:v}),[r]),w=l.current,C=o.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:10001,padding:"8px 4px"},children:o.jsx(b0e,{mode:"popLayout",children:r.map(_=>o.jsx(Ow.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{type:"spring",damping:25,stiffness:300},style:{width:"100%",pointerEvents:"auto",boxShadow:"0 6px 20px rgba(0, 0, 0, 0.12)",borderRadius:"8px",marginBottom:"6px",backgroundColor:_.background||_.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:o.jsx(Zw,{id:_.id,text:_.text,subtext:_.subtext,icon:_.icon,background:"transparent",colorTextPrimary:_.colorTextPrimary,colorTextSub:_.colorTextSub,model:_.model,onClose:()=>f(_.id),size:"100%",style:{boxShadow:"none"}})},_.id))})}),b=o.jsx("div",{ref:_=>{l.current||(h.current=_)},className:c,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:C});return o.jsxs(Yq.Provider,{value:L,children:[w?lw.createPortal(C,w):b,e]})},Eke=()=>{const e=k.useContext(Yq);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},Oke={default:{background:"#f3f4f6",icon:"Info",colorTextPrimary:"#111827",colorTextSub:"#4b5563"},info:{background:"#dbeafe",icon:"Info",colorTextPrimary:"#1e40af",colorTextSub:"#3b82f6"},success:{background:"#dcfce7",icon:"CheckCircle2",colorTextPrimary:"#166534",colorTextSub:"#22c55e"},warning:{background:"#fef3c7",icon:"AlertTriangle",colorTextPrimary:"#92400e",colorTextSub:"#f59e0b"},error:{background:"#fee2e2",icon:"XCircle",colorTextPrimary:"#991b1b",colorTextSub:"#ef4444"}},Uke="_container_18zbo_1",Wke="_icon_18zbo_9",Gke="_selectWrapper_18zbo_23",Ab={container:Uke,icon:Wke,selectWrapper:Gke},Kke=({options:e,defaultValue:t,onChange:n,label:c})=>{const[i,r]=k.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return o.jsxs("div",{className:Ab.container,children:[o.jsxs("div",{className:Ab.icon,children:[o.jsx(x1,{size:18}),o.jsx("p",{children:c})]}),o.jsx("div",{className:Ab.selectWrapper,children:o.jsx(Uw,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},Zke=250,Xke=k.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:c,afterOpen:i,beforeClose:r,afterClose:s,style:d,className:h="",children:l,closeOnOverlayClick:u=!0,showCloseButton:p=!0},y)=>{const[m,f]=k.useState(!1),[g,M]=k.useState(!1),x=k.useRef(null),v=k.useRef(null),L=k.useRef(null),w=k.useRef(null);k.useEffect(()=>{const _=x.current;if(!_)return;const I=_.parentElement;return I?(window.getComputedStyle(I).position==="static"&&(I.setAttribute("data-scp-prev-position",I.style.position??""),I.style.position="relative",I.setAttribute("data-scp-position-changed","true")),()=>{if(I.getAttribute("data-scp-position-changed")==="true"){const N=I.getAttribute("data-scp-prev-position")??"";I.style.position=N,I.removeAttribute("data-scp-position-changed"),I.removeAttribute("data-scp-prev-position")}}):void 0},[]),k.useImperativeHandle(y,()=>({open:()=>{m||(c?.(),M(!1),f(!0))},close:()=>{m&&(r?.(),M(!1),f(!1))},toggle:()=>{m?(r?.(),M(!1),f(!1)):(c?.(),M(!1),f(!0))}}),[m,c,r]),k.useEffect(()=>{const _=v.current;w.current&&(window.clearTimeout(w.current),w.current=null);const I=j=>{if(j.target===_&&!(j.propertyName!=="transform"&&j.propertyName!=="opacity"))if(m){M(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}};return _&&(_.addEventListener("transitionend",I),w.current=window.setTimeout(()=>{if(m){M(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}},Zke+60)),m&&(L.current=document.activeElement),()=>{_&&_.removeEventListener("transitionend",I),w.current&&(window.clearTimeout(w.current),w.current=null)}},[m,i,s]),k.useEffect(()=>{const _=I=>{I.key==="Escape"&&m&&(r?.(),M(!1),f(!1))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[m,r]);const C=()=>{u&&(r?.(),M(!1),f(!1))},b=typeof n=="number"?`${n}px`:n;return o.jsxs("div",{ref:x,className:`scp-inline-root ${m?"open":""}`,"aria-hidden":!m,children:[o.jsx("div",{className:`scp-overlay ${m?"visible":""}`,onMouseDown:C,role:"presentation"}),o.jsxs("aside",{className:`scp-panel ${m?"in":"out"} ${g?"interactive":""} ${h}`,style:{width:b,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[o.jsxs("div",{className:"scp-header",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"scp-title",children:e}),t&&o.jsx("div",{className:"scp-subtitle",children:t})]}),p&&o.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),M(!1),f(!1)},children:o.jsx(Ke,{size:18})})]}),o.jsx("div",{className:"scp-body",children:l})]})]})});function Yke(e){const t=k.useRef("");k.useEffect(()=>{if(e){t.current=document.body.style.overflow,document.body.style.overflow="hidden";return}document.body.style.overflow=t.current||""},[e])}const Jke="_container_1pfsp_1",Qke="_title_1pfsp_8",lj={container:Jke,title:Qke},e3e=({title:e,fontSize:t,barColor:n,className:c="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return o.jsx("div",{className:`${lj.container} ${c}`,style:r,children:o.jsx("h2",{className:lj.title,children:e})})},t3e="_modalOverlay_1878x_1",a3e="_modalContainer_1878x_16",n3e="_modalTitle_1878x_29",o3e="_modalInput_1878x_38",c3e="_modalTextarea_1878x_39",i3e="_modalActions_1878x_70",r3e="_cancelBtn_1878x_77",s3e="_saveBtn_1878x_99",d3e="_inputError_1878x_141",l3e="_inlineAlert_1878x_146",Ye={modalOverlay:t3e,modalContainer:a3e,modalTitle:n3e,modalInput:o3e,modalTextarea:c3e,modalActions:i3e,cancelBtn:r3e,saveBtn:s3e,inputError:d3e,inlineAlert:l3e},Vc=({isOpen:e,onClose:t,onSave:n,title:c="Ajouter un élément",fields:i,initialValues:r={},errorMessage:s="",disableSave:d,onFieldChange:h,confirmText:l="Valider",cancelText:u="Annuler"})=>{const[p,y]=k.useState({}),m=k.useRef(null),[f,g]=k.useState(!1),[M,x]=k.useState(!1),v=k.useRef(null);if(k.useEffect(()=>{if(!e)return;const _={};for(const I of i)_[I.name]=Object.prototype.hasOwnProperty.call(r,I.name)?r[I.name]:"";return y(_),requestAnimationFrame(()=>{m.current?.focus();const I=m.current;if(I&&typeof I.selectionStart=="number"){const j=String(I.value??"").length;I.setSelectionRange(j,j)}}),()=>{v.current&&(window.clearTimeout(v.current),v.current=null)}},[e]),k.useEffect(()=>{s&&e?(x(!0),v.current&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{x(!1),v.current=null},3e3)):(x(!1),v.current&&(window.clearTimeout(v.current),v.current=null))},[s,e]),!e)return null;const L=(_,I)=>{y(j=>({...j,[_]:I})),h&&h(_,I)},w=async()=>{if(!Object.values(p).some(_=>_===""||_===void 0))try{g(!0);const _=await n(p);if(typeof _=="string"&&_==="duplicate-same"){g(!1);return}y({}),g(!1),t()}catch(_){console.error("AddItemModal onSave error:",_),g(!1),t()}},C=_=>{_.target===_.currentTarget&&t()},b=_=>_.stopPropagation();return o.jsx("div",{className:Ye.modalOverlay,onMouseDown:C,role:"dialog","aria-modal":"true",children:o.jsxs("div",{className:Ye.modalContainer,onMouseDown:b,onClick:b,children:[o.jsx("h2",{className:Ye.modalTitle,children:c}),i.map((_,I)=>{const j=p[_.name]??"",N=I===0&&!!s,S={name:_.name,placeholder:_.placeholder||_.label,value:String(j),onChange:A=>L(_.name,A.target.value),className:_.type==="textarea"?`${Ye.modalTextarea} ${N?Ye.inputError:""}`:`${Ye.modalInput} ${N?Ye.inputError:""}`,tabIndex:0,disabled:f};return I===0&&(S.ref=A=>{m.current=A}),o.jsxs("div",{style:{marginBottom:8},children:[_.type==="textarea"?o.jsx("textarea",{rows:_.rows||4,...S}):o.jsx("input",{type:_.type||"text",...S}),I===0&&M&&s&&o.jsx("div",{style:{marginTop:8},children:o.jsx(Zw,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>x(!1),className:Ye.inlineAlert})})]},_.name)}),o.jsxs("div",{className:Ye.modalActions,children:[o.jsx("button",{className:Ye.cancelBtn,onClick:t,type:"button",disabled:f,children:u}),o.jsx("button",{className:Ye.saveBtn,onClick:w,type:"button",disabled:f||!!d,children:f?"En cours...":l})]})]})})},h3e=({title:e,keyCount:t,onAddKey:n,a11yConfig:c})=>{const[i,r]=k.useState(!1),s=d=>{const h=d.key;n&&h&&n(h)};return o.jsxs("div",{className:"header-container",children:[o.jsxs("div",{className:"header-info",children:[o.jsx("h1",{title:Q(c,e),children:e}),o.jsxs("p",{children:[t," clés"]})]}),o.jsxs("button",{onClick:()=>r(!0),className:"add-key-button",children:[o.jsx($c,{className:"add-key-icon"}),"Clé"]}),o.jsx(Vc,{isOpen:i,title:"Ajouter une clé",onClose:()=>r(!1),onSave:s,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},u3e=({modules:e,onEdit:t,onDelete:n,onAddModule:c,onSelectModule:i,addModalFields:r,addModalTitle:s})=>{const[d,h]=k.useState(!1),[l,u]=k.useState(null),[p,y]=k.useState(null),[m,f]=k.useState(!1),g=()=>h(!0),M=()=>h(!1),x=_=>{if(c){const I=_.code?.trim()||_.id?.trim(),j=_.title?.trim(),N=I||j||String(Date.now()),S=j||I||`Module ${N}`;c({id:N,title:S,subtitle:"",translations:{}})}M()},v=(_,I)=>{_.stopPropagation(),u(I)},L=()=>u(null),w=_=>{if(!l){L();return}const I={...l,title:_.title||l.title,subtitle:""};t&&t(I),L()},C=(_,I)=>{_.stopPropagation(),n&&n(I)},b=_=>{y(_.id),i&&i(_)};return m?o.jsx("div",{className:"module-sidebar collapsed",children:o.jsx(Qc,{size:20,className:"menu-toggle",onClick:()=>f(!1)})}):o.jsxs("div",{className:"module-sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),o.jsxs("div",{className:"header-actions",children:[o.jsx(Jc,{size:18,className:"header-folder",onClick:g}),o.jsx(Qc,{size:18,className:"header-menu",onClick:()=>f(!0)})]})]}),o.jsx("hr",{className:"divider"}),o.jsx("div",{className:"module-list",children:e.map(_=>{const I=Object.keys(_.translations||{}).length,j=I>0||_.id===p;return o.jsxs("div",{className:`module-item ${_.id===p?"selected":""}`,onClick:()=>b(_),role:"button",tabIndex:0,onKeyDown:N=>{N.key==="Enter"&&b(_)},children:[o.jsxs("div",{className:"module-left",children:[o.jsx(w1,{size:16,className:"item-folder"}),o.jsxs("div",{className:"module-info",children:[o.jsxs("div",{className:"module-title",children:[_.title,j&&o.jsxs("span",{className:"count",children:[" ",I," "]})]}),_.subtitle?o.jsx("div",{className:"module-subtitle",children:_.subtitle}):null]})]}),o.jsxs("div",{className:"module-actions",children:[t&&o.jsx(e1,{onClick:N=>v(N,_),color:"#777",size:16}),n&&o.jsx(dt,{onClick:N=>C(N,_.id),color:"#777",size:16})]})]},_.id)})}),o.jsx(Vc,{isOpen:d,onClose:M,onSave:x,title:s||"Ajouter un module",fields:r&&r.length?r.map(_=>({name:_.name,label:_.label,type:_.type,placeholder:_.placeholder,rows:_.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),l&&o.jsx(Vc,{isOpen:!!l,onClose:L,onSave:w,title:"Éditer le module",initialValues:{title:l.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},Jq=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:c="left",iconColor:i="#9ca3af",a11yConfig:r,className:s})=>o.jsxs("div",{className:`search-container icon-${c}`,title:Q(r,e),children:[o.jsx("div",{className:"search-icon-wrapper",children:o.jsx(S1,{className:"search-icon",color:i})}),o.jsx("input",{type:"text",placeholder:e,value:t,onChange:d=>n?.(d.target.value),className:`search-input ${s}`})]}),p3e=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:c,onEditKey:i,onEditTranslation:r,onDeleteTranslation:s,onAddTranslation:d,draggable:h=!1,checkDuplicateLocal:l})=>{const[u,p]=k.useState(!1),[y,m]=k.useState(""),[f,g]=k.useState(null),[M,x]=k.useState(""),[v,L]=k.useState(""),[w,C]=k.useState(!1),[b,_]=k.useState(!1),[I,j]=k.useState(null),[N,S]=k.useState(!1),A=t.map(D=>D.language),B=n.filter(D=>!A.includes(D.code)),T=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),m(""),L(""),p(!1))},V=(D,F)=>{g(D),x(F)},$=D=>{r?.(e,D,M),g(null),x("")},q=()=>{g(null),x("")},P=async D=>{const F=D.name?.trim();if(F){if(j(null),S(!1),F===e||!i)return C(!1),"ok";try{const G=await i(e,F);if(typeof G=="string"&&G==="ok")C(!1),j(null);else{if(typeof G=="string"&&G==="duplicate-same")return j("Une clé existe déjà dans ce module."),S(!0),"duplicate-same";if(typeof G=="string"&&G==="duplicate-other")return C(!1),j(null),"duplicate-other";C(!1)}}catch(G){console.error("Erreur handleRenameSave:",G),j("Erreur lors du renommage.")}}},H=(D,F)=>{if(D!=="name")return;const G=F.trim();j(null),S(!1),G&&typeof l=="function"&&(l(G,e)?(j("Une clé existe déjà dans ce module."),S(!0)):(j(null),S(!1)))};return o.jsxs("div",{className:`translation-key ${b?"collapsed":"expanded"} ${h?"draggable":""}`,children:[o.jsxs("div",{className:"card-header",children:[o.jsxs("div",{className:"header-left",children:[o.jsx("button",{className:"collapse-button",onClick:()=>_(!b),title:b?"Déplier":"Replier",children:b?o.jsx(L1,{className:"collapse-icon"}):o.jsx(qt,{className:"collapse-icon"})}),o.jsx("h3",{className:"card-title",title:e,children:e})]}),o.jsxs("div",{className:"header-actions",children:[o.jsx("button",{className:"action-button",onClick:D=>{D.stopPropagation(),C(!0)},title:"Renommer la clé",children:o.jsx(yt,{className:"action-icon"})}),o.jsx("button",{onClick:D=>{D.stopPropagation(),c?.(e)},className:"action-button delete",title:"Supprimer la clé",children:o.jsx(dt,{className:"action-icon"})})]})]}),o.jsx("div",{className:`translations-container ${b?"":"expanded"}`,children:!h&&o.jsxs(o.Fragment,{children:[t.map(D=>o.jsxs("div",{className:"translation-row",children:[o.jsx("div",{className:"language-code",children:D.language}),o.jsx("div",{className:"translation-content",children:f===D.language?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"text",value:M,onChange:F=>x(F.target.value),className:"edit-input",autoFocus:!0,onKeyDown:F=>{F.key==="Enter"&&$(D.language),F.key==="Escape"&&q()}}),o.jsx("button",{onClick:()=>$(D.language),className:"save-button",disabled:!M.trim(),children:"Enregistrer"}),o.jsx("button",{onClick:q,className:"cancel-button",children:o.jsx(Ke,{className:"action-icon"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"translation-text",title:D.value,children:D.value}),o.jsx("button",{onClick:()=>V(D.language,D.value),className:"edit-button",title:"Éditer la traduction",children:o.jsx(yt,{className:"action-icon"})}),o.jsx("button",{onClick:()=>s?.(e,D.language),className:"delete-translation-button",title:"Supprimer la traduction",children:o.jsx(Ke,{className:"action-icon"})})]})})]},D.language)),u?o.jsxs("div",{className:"add-language-row",children:[o.jsx("div",{className:"language-code",children:"+"}),o.jsxs("div",{className:"add-language-content",children:[o.jsx("div",{className:"language-select-container",children:o.jsxs("select",{value:y,onChange:D=>m(D.target.value),className:"language-select",children:[o.jsx("option",{value:"",children:"Sélectionnez la langue"}),B.map(D=>o.jsxs("option",{value:D.code,children:[D.name," (",D.code,")"]},D.code))]})}),y&&o.jsx("input",{type:"text",value:v,onChange:D=>L(D.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:D=>{D.key==="Enter"&&T(),D.key==="Escape"&&(p(!1),m(""),L(""))}}),o.jsx("button",{onClick:T,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),o.jsx("button",{onClick:()=>{p(!1),m(""),L("")},className:"cancel-button",children:o.jsx(Ke,{className:"action-icon"})})]})]}):o.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:B.length===0,children:[o.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),h&&o.jsxs("div",{className:"drag-overlay",children:[o.jsx(a.Move,{size:24,strokeWidth:1.5}),o.jsx("span",{children:"Glisser pour réorganiser"})]}),o.jsx(Vc,{isOpen:w,onClose:()=>{C(!1),j(null),S(!1)},onSave:P,onFieldChange:H,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:I||"",disableSave:N})]})},y3e="_wrapper_1wvht_1",k3e="_leftGroup_1wvht_12",m3e="_filterButton_1wvht_21",f3e="_open_1wvht_42",g3e="_filterIcon_1wvht_42",v3e="_infoText_1wvht_58",M3e="_pickerContainer_1wvht_66",x3e="_srOnly_1wvht_79",_3e="_pickerLabel_1wvht_91",L3e="_datetime_1wvht_98",I3e="_rightGroup_1wvht_107",b3e="_searchInputWrap_1wvht_116",w3e="_searchInput_1wvht_116",C3e="_searchIcon_1wvht_152",Pe={wrapper:y3e,leftGroup:k3e,filterButton:m3e,open:f3e,filterIcon:g3e,infoText:v3e,pickerContainer:M3e,srOnly:x3e,pickerLabel:_3e,datetime:L3e,rightGroup:I3e,searchInputWrap:b3e,searchInput:w3e,searchIcon:C3e};function N3e({onDateChange:e,onSearch:t,initialDate:n}){const[c,i]=k.useState(!1),[r,s]=k.useState(n??""),d=k.useRef(null);k.useEffect(()=>{function p(y){const m=y.target;d.current&&m&&!d.current.contains(m)&&i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),k.useEffect(()=>{n&&s(n)},[n]);const h=()=>i(p=>!p),l=p=>{const y=p.target.value;s(y),e?.(y)},u=p=>{t?.(p.target.value)};return o.jsxs("div",{className:Pe.wrapper,ref:d,children:[o.jsxs("div",{className:Pe.leftGroup,children:[o.jsxs("button",{type:"button",className:`${Pe.filterButton} ${c?Pe.open:""}`,onClick:h,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[o.jsx("span",{children:"Entry time"}),o.jsx("svg",{className:Pe.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),o.jsx("div",{className:Pe.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),c&&o.jsxs("div",{className:Pe.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[o.jsx("label",{className:Pe.pickerLabel,htmlFor:"entry-datetime",children:o.jsx("span",{className:Pe.srOnly,children:"Choisir la date et l’heure"})}),o.jsx("input",{id:"entry-datetime",className:Pe.datetime,type:"datetime-local",value:r,onChange:l,"aria-label":"Date et heure d’entrée"})]})]}),o.jsx("div",{className:Pe.rightGroup,children:o.jsxs("div",{className:Pe.searchInputWrap,children:[o.jsx("input",{className:Pe.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),o.jsx("svg",{className:Pe.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z"})})]})})]})}const S3e=({className:e="",style:t={},title:n,titleClassName:c="",titleStyle:i,data:r,lineClasses:s={},renderCell:d,bg:h,titleBg:l,titleColor:u,itemBg:p,emptyContent:y,colGap:m="1rem"})=>{const f=Array.isArray(r)?r:[],g=f.length===0,M=f.every(w=>typeof w=="string"),x=f.some(w=>Array.isArray(w)),v=(w,C,b)=>d?d(w,C,b):o.jsx("span",{className:"slb-cell-text",children:w}),L=m?{"--col-gap":m}:void 0;return g?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:h??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{...i,background:l??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-empty",children:y??null})]}):M&&!x?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:h??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:l??void 0,color:u??void 0},children:n}),o.jsx("ul",{className:"slb-list",children:f.map((w,C)=>o.jsx("li",{className:`slb-item ${s[C]||""}`,style:{background:p??void 0},children:v(w,C,0)},C))})]}):o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:h??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:l??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-grid",style:L,children:f.map((w,C)=>{const b=s[C]||"";if(Array.isArray(w)){const[_,I]=w;return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(_,C,0)}),o.jsx("div",{className:"slb-grid-right",children:v(I,C,1)})]},C)}return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(w,C,0)}),o.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},C)})})]})},j3e=({className:e="",style:t={},title:n,titleColor:c,data:i=[],badgeColor:r="#0ea5e9",badgeColors:s={},badgePadding:d="8px 16px",badgeWidth:h,itemBg:l,lineClasses:u={},colGap:p="1rem"})=>{const y=i.some(f=>Array.isArray(f)),m=p?{"--col-gap":p}:void 0;return o.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&o.jsx("div",{className:"clb-title",style:c?{color:c}:void 0,children:n}),o.jsx("div",{className:"clb-grid",style:m,children:i.map((f,g)=>{const M=u[g]||"";if(Array.isArray(f)){const[x,v]=f,L=s[g]||r;return o.jsxs("div",{className:`clb-row ${M}`,style:{background:l??void 0},children:[o.jsx("div",{className:"clb-badge-col",children:o.jsx("div",{className:"counter-badge",style:{background:L,padding:d,width:h,minWidth:h},children:x})}),o.jsx("div",{className:"clb-text",children:v})]},g)}return y?o.jsxs("div",{className:`clb-row ${M}`,style:{background:l??void 0},children:[o.jsx("div",{className:"clb-badge-col clb-empty-badge"}),o.jsx("div",{className:"clb-text",children:f})]},g):o.jsx("div",{className:`clb-fullrow ${M}`,style:{background:l??void 0},children:o.jsx("span",{children:f})},g)})})]})},$3e=({className:e="",style:t={},title:n,items:c=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:h,colGap:l="1rem"})=>{const u=l?{"--col-gap":l}:void 0;return o.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&o.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),o.jsx("div",{className:"tlb-grid",style:u,children:c.map((p,y)=>{const m=d[y]||"";return o.jsxs("div",{className:`tlb-row ${m}`,style:{background:s??void 0},children:[o.jsx("div",{className:"tlb-label",children:p.label}),o.jsxs("div",{className:"tlb-value-group",children:[o.jsx("div",{className:"tlb-icon-col",children:h?h(p):p.icon??null}),o.jsxs("div",{className:"tlb-value-wrap",children:[o.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&o.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},q3e=({className:e="",style:t={},children:n,gap:c="1rem"})=>o.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":c},children:k.Children.map(n,i=>o.jsx("div",{className:"frc-item",children:i}))}),A3e=({className:e="",style:t={},children:n,gap:c="1rem",background:i="#D9EEF5"})=>o.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":c},children:k.Children.map(n,r=>o.jsx("div",{className:"lcc-cell",children:r}))}),z3e="_overlay_3x4or_2",V3e="_fadeIn_3x4or_1",P3e="_popup_3x4or_17",T3e="_slideUp_3x4or_1",H3e="_header_3x4or_28",D3e="_body_3x4or_40",B3e="_footer_3x4or_51",R3e="_cancelButton_3x4or_59",F3e="_confirmButton_3x4or_77",E3e="_warning_3x4or_97",O3e="_danger_3x4or_106",U3e="_info_3x4or_115",_t={overlay:z3e,fadeIn:V3e,popup:P3e,slideUp:T3e,header:H3e,body:D3e,footer:B3e,cancelButton:R3e,confirmButton:F3e,warning:E3e,danger:O3e,info:U3e},W3e=({isOpen:e,title:t,message:n,onConfirm:c,onCancel:i,confirmText:r="Confirmer",cancelText:s="Annuler",type:d="warning"})=>{if(!e)return null;const h=u=>{u.target===u.currentTarget&&i()},l=u=>{u.key==="Escape"&&i(),u.key==="Enter"&&u.ctrlKey&&c()};return o.jsx("div",{className:_t.overlay,onClick:h,onKeyDown:l,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:o.jsxs("div",{className:`${_t.popup} ${_t[d]}`,children:[o.jsx("div",{className:_t.header,children:o.jsx("h3",{id:"confirmation-title",children:t})}),o.jsx("div",{className:_t.body,children:o.jsx("p",{id:"confirmation-message",children:n})}),o.jsxs("div",{className:_t.footer,children:[o.jsx("button",{className:_t.cancelButton,onClick:i,type:"button",children:s}),o.jsx("button",{className:_t.confirmButton,onClick:c,type:"button",autoFocus:!0,children:r})]})]})})},G3e=()=>{const[e,t]=k.useState({isOpen:!1,title:"",message:"",onConfirm:null}),n=k.useCallback((r,s,d)=>{t({isOpen:!0,title:r,message:s,onConfirm:d})},[]),c=k.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=k.useCallback(()=>{e.onConfirm?.(),c()},[e.onConfirm,c]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:c,handleConfirm:i}},K3e="_container_1l44m_1",Z3e="_selectButton_1l44m_7",X3e="_disabled_1l44m_22",Y3e="_error_1l44m_39",J3e="_outline_1l44m_52",Q3e="_filled_1l44m_58",eme="_sm_1l44m_67",tme="_md_1l44m_73",ame="_lg_1l44m_79",nme="_buttonContent_1l44m_85",ome="_label_1l44m_93",cme="_placeholder_1l44m_103",ime="_iconsContainer_1l44m_108",rme="_loadingSpinner_1l44m_115",sme="_spin_1l44m_1",dme="_arrowIcon_1l44m_133",lme="_arrowIconOpen_1l44m_141",hme="_dropdown_1l44m_146",ume="_dropdownIn_1l44m_1",pme="_searchContainer_1l44m_171",yme="_searchInputWrapper_1l44m_177",kme="_searchIcon_1l44m_183",mme="_searchInput_1l44m_177",fme="_optionsList_1l44m_208",gme="_noResults_1l44m_231",vme="_option_1l44m_208",Mme="_optionHighlighted_1l44m_261",xme="_optionSelected_1l44m_266",_me="_optionDisabled_1l44m_277",Lme="_optionLabel_1l44m_283",Ime="_checkIcon_1l44m_291",bme="_widthFull_1l44m_299",wme="_width64_1l44m_302",Cme="_width80_1l44m_305",Nme="_width96_1l44m_308",se={container:K3e,selectButton:Z3e,disabled:X3e,error:Y3e,default:"_default_1l44m_48",outline:J3e,filled:Q3e,sm:eme,md:tme,lg:ame,buttonContent:nme,label:ome,placeholder:cme,iconsContainer:ime,loadingSpinner:rme,spin:sme,arrowIcon:dme,arrowIconOpen:lme,dropdown:hme,dropdownIn:ume,searchContainer:pme,searchInputWrapper:yme,searchIcon:kme,searchInput:mme,optionsList:fme,noResults:gme,option:vme,optionHighlighted:Mme,optionSelected:xme,optionDisabled:_me,optionLabel:Lme,checkIcon:Ime,widthFull:bme,width64:wme,width80:Cme,width96:Nme},Sme=({options:e,value:t,onChange:n,placeholder:c="Sélectionner une option...",disabled:i=!1,loading:r=!1,error:s=!1,className:d="",size:h="md",variant:l="default",width:u="w-full"})=>{const[p,y]=k.useState(!1),[m,f]=k.useState(""),[g,M]=k.useState(0),[x,v]=k.useState({top:0,left:0,width:0}),L=k.useRef(null),w=k.useRef(null),C=k.useRef(null),b=k.useMemo(()=>m?e.filter($=>$.label.toLowerCase().includes(m.toLowerCase())):e,[e,m]),_=e.find($=>$.value===t),I=k.useCallback(()=>{if(L.current){const $=L.current.getBoundingClientRect();v({top:$.top,left:$.left,width:$.width})}},[]);k.useEffect(()=>(p&&(I(),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I)),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}),[p,I]),k.useEffect(()=>{const $=q=>{L.current&&!L.current.contains(q.target)&&w.current&&!w.current.contains(q.target)&&(y(!1),f(""))};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]),k.useEffect(()=>{M(0)},[b]);const j=$=>{$.disabled||(n?.($.value,$),y(!1),f(""))},N=$=>{f($.target.value),p||y(!0)},S=$=>{if(!p){($.key==="ArrowDown"||$.key==="Enter")&&y(!0);return}switch($.key){case"ArrowDown":$.preventDefault(),M(q=>q<b.length-1?q+1:q);break;case"ArrowUp":$.preventDefault(),M(q=>q>0?q-1:q);break;case"Enter":$.preventDefault(),b[g]&&j(b[g]);break;case"Escape":y(!1),f("");break}},A=()=>[se.selectButton,se[h],se[l],i?se.disabled:"",s?se.error:"",d].filter(Boolean).join(" "),B=()=>{switch(u){case"w-64":return se.width64;case"w-80":return se.width80;case"w-96":return se.width96;default:return se.widthFull}},T=($,q)=>[se.option,q===g?se.optionHighlighted:"",$.value===t?se.optionSelected:"",$.disabled?se.optionDisabled:""].filter(Boolean).join(" "),V={position:"fixed",top:x.top+(L.current?.offsetHeight||0)+4,left:x.left,width:x.width,zIndex:9999};return o.jsxs("div",{className:`${se.container} ${B()}`,children:[o.jsx("button",{ref:L,className:A(),onClick:()=>!i&&y(!p),onKeyDown:S,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:o.jsxs("div",{className:se.buttonContent,children:[o.jsx("span",{className:`${se.label} ${_?"":se.placeholder}`,children:_?_.label:c}),o.jsxs("div",{className:se.iconsContainer,children:[r&&o.jsx("div",{className:se.loadingSpinner}),o.jsx("svg",{className:`${se.arrowIcon} ${p?se.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&lw.createPortal(o.jsxs("div",{className:`${se.dropdown} ${B()}`,style:V,ref:w,children:[o.jsx("div",{className:se.searchContainer,children:o.jsxs("div",{className:se.searchInputWrapper,children:[o.jsx("svg",{className:se.searchIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),o.jsx("input",{ref:C,type:"text",value:m,onChange:N,placeholder:"Rechercher...",className:se.searchInput,autoFocus:!0})]})}),o.jsx("div",{className:se.optionsList,children:b.length===0?o.jsx("div",{className:se.noResults,children:"Aucun résultat trouvé"}):o.jsx("ul",{role:"listbox",children:b.map(($,q)=>o.jsx("li",{className:T($,q),onClick:()=>j($),onMouseEnter:()=>M(q),role:"option","aria-selected":$.value===t,"aria-disabled":$.disabled,children:o.jsxs("div",{className:se.buttonContent,children:[o.jsx("span",{className:se.optionLabel,title:$.label,children:$.label}),$.value===t&&o.jsx("svg",{className:se.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]})},$.value))})})]}),document.body)]})},jme="_container_uq7pt_1",$me="_item_uq7pt_7",qme="_mainValue_uq7pt_13",Ame="_label_uq7pt_17",zme="_subValue_uq7pt_22",Vme="_subValueWrapper_uq7pt_27",Pme="_subSeparator_uq7pt_32",Ue={container:jme,item:$me,mainValue:qme,label:Ame,subValue:zme,subValueWrapper:Vme,subSeparator:Pme},Tme=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:c="28px",valueFontWeight:i=700,subFontSize:r="16px",subFontWeight:s=600,backgroundColor:d="#ffffff",labelColor:h="#6b7280",valueColor:l="#000000"})=>{const u=(p,y,m)=>{const[f,g]=p.split("/").map(M=>M.trim());return o.jsxs("span",{className:Ue.subValueWrapper,children:[o.jsx("span",{className:Ue.subLeft,style:{color:y},children:f}),o.jsx("span",{className:Ue.subSeparator,children:" / "}),o.jsx("span",{className:Ue.subRight,style:{color:m},children:g})]})};return o.jsxs("div",{className:Ue.container,style:{backgroundColor:d},children:[e&&o.jsxs("div",{className:Ue.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ue.mainValue,style:{fontSize:c,fontWeight:i,color:l},children:e}),o.jsx("div",{className:Ue.label,style:{color:h},children:"DMS"})]}),t.map((p,y)=>o.jsxs("div",{className:Ue.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ue.mainValue,style:{fontSize:c,fontWeight:i,color:l},children:p.value}),o.jsx("div",{className:Ue.label,style:{color:h},children:p.label}),o.jsx("div",{className:Ue.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},Hme="_encours_16ist_1",Dme="_header_16ist_19",Bme="_iconWrap_16ist_27",Rme="_title_16ist_36",Fme="_items_16ist_47",Eme="_spaceEvenly_16ist_56",Ome="_item_16ist_47",Ume="_valueContainer_16ist_86",Wme="_value_16ist_86",Gme="_label_16ist_108",ot={encours:Hme,header:Dme,iconWrap:Bme,title:Rme,items:Fme,spaceEvenly:Eme,item:Ome,valueContainer:Ume,value:Wme,label:Gme},Sc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function Kme(e,t){const n={},c={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=Sc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=Sc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(c.color=e.labelColor),e.labelFontSize!==void 0?c.fontSize=Sc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(c.fontSize=Sc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?c.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(c.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:c}}function Zme(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Xme(e){const{title:t,titleColor:n,titleFontSize:c,titleFontWeight:i,icon:r,iconSize:s=18,iconColor:d,defaultValueFontSize:h,defaultValueFontWeight:l,defaultLabelFontSize:u,defaultLabelFontWeight:p,data:y,style:m,bg:f="#ffffff",width:g,gap:M,className:x,ariaLabel:v}=e,L=r?mt[r]:void 0,w={background:f,width:Sc(g),...m},C={};n&&(C.color=n),c!==void 0&&(C.fontSize=Sc(c)),i!==void 0&&(C.fontWeight=i);const b={};return d&&(b.color=d),o.jsxs("section",{className:`${ot.encours} ${x??""}`,style:w,"aria-label":v??t,children:[o.jsxs("div",{className:ot.header,children:[o.jsx("div",{className:ot.iconWrap,"aria-hidden":!0,style:b,children:L?o.jsx(L,{size:typeof s=="number"?s:void 0}):o.jsx(Zme,{})}),o.jsx("div",{className:ot.title,style:C,children:t})]}),o.jsx("div",{className:`${ot.items} ${M===void 0?ot.spaceEvenly:""}`,role:"list",style:M!==void 0?{gap:`${M}px`}:{},children:y.map((_,I)=>{const{valueStyle:j,labelStyle:N}=Kme(_,{defaultValueFontSize:h,defaultValueFontWeight:l,defaultLabelFontSize:u,defaultLabelFontWeight:p});return o.jsx("div",{className:ot.item,role:"listitem",style:{..._.background?{background:_.background}:{},..._.width?{width:Sc(_.width)}:{}},children:o.jsxs("div",{className:ot.valueContainer,children:[o.jsx("div",{className:ot.value,style:j,children:_.value}),_.label&&o.jsx("div",{className:ot.label,style:N,children:_.label})]})},`${String(_.label??_.value)}-${I}`)})})]})}const Yme=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M480-360 280-559h400z"})),Jme=k.memo(Yme),Qme=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"m280-400 200-201 200 201z"})),e6e=k.memo(Qme),t6e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},J.createElement("path",{fill:"#0087BD",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm3.983-3.55q.1 0 .192-.033a.36.36 0 0 0 .158-.117l4.117-4.133q.15-.15.15-.35a.54.54 0 0 0-.15-.367.52.52 0 0 0-.358-.133.5.5 0 0 0-.359.15l-3.75 3.75L5.35 7.583a.48.48 0 0 0-.7 0q-.15.15-.15.367 0 .216.15.35l1.983 2a.48.48 0 0 0 .35.15"})),a6e=k.memo(t6e),n6e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},J.createElement("path",{fill:"#1E2122",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm0-1h10V3H3z"})),o6e=k.memo(n6e),c6e=({items:e,onSave:t,loading:n,disabled:c,saveLabel:i,savingLabel:r,buttonTitle:s,size:d=16,colors:h={bg:"#DADADA",activeBg:"var(--color-primary)",circle:"#FFFFFF",icon:"#1C1B1F",icon2:"#FFFFFF"},style:l,a11yConfig:u})=>{const[p,y]=k.useState(!1),[m,f]=k.useState(e),[g,M]=k.useState(!1);if(k.useEffect(()=>{M(!0)},[]),k.useEffect(()=>{f(e)},[e]),!g)return null;const x=(w,C)=>{C<4||f(b=>b.map(_=>_.component_key===w?{..._,visible:!_.visible}:_))},v=()=>{t(m),y(!1)},L=Q(u,s);return o.jsxs("div",{style:{position:"relative",display:"inline-block",...l},children:[o.jsxs("div",{onClick:()=>{c||y(!p)},style:{display:"flex",alignItems:"center",cursor:c?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:L,children:[o.jsx(Aj,{width:d,height:d,fill:h?.icon||"currentColor",style:{transition:"color 0.2s"}}),p?o.jsx(e6e,{width:d,height:d,fill:h?.icon||"currentColor"}):o.jsx(Jme,{width:d,height:d,fill:h?.icon||"currentColor"})]}),p&&o.jsxs("div",{style:{position:"absolute",top:"120%",right:0,minWidth:260,background:"#fff",borderRadius:"0.25rem",boxShadow:"0px 3px 7px 0px rgba(17, 20, 21, 0.05),0px 14px 14px 0px rgba(17, 20, 21, 0.04),0px 30px 18px 0px rgba(17, 20, 21, 0.03), 0px 54px 22px 0px rgba(17, 20, 21, 0.01),0px 85px 24px 0px rgba(17, 20, 21, 0)",zIndex:235465456,padding:"0 0 0.5rem 0"},children:[o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:m.map((w,C)=>o.jsxs(k.Fragment,{children:[o.jsxs("li",{onClick:()=>x(w.component_key,C),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:C<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:b=>{C>=4&&(b.currentTarget.style.background="#F9FAFB")},onMouseLeave:b=>{C>=4&&(b.currentTarget.style.background="transparent")},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:w.visible?o.jsx(a6e,{width:20,height:20,fill:h?.activeBg||"var(--color-primary, #008FBB)"}):o.jsx(o6e,{width:20,height:20,fill:"#D1D5DB"})}),o.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:w.label})]}),C===3&&o.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},w.component_key))}),o.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{type:"button",onClick:v,disabled:n,style:{padding:"6px 16px",borderRadius:4,border:"none",background:"var(--color-primary, #008FBB)",color:"#fff",fontSize:"14px",fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"opacity 0.2s",opacity:n?.7:1},children:n?r:i})})]})]})},i6e="_container_zhny9_1",r6e="_card_zhny9_15",s6e="_footer_zhny9_33",d6e="_noPaddingMobile_zhny9_51",ei={container:i6e,card:r6e,footer:s6e,noPaddingMobile:d6e},l6e="_board_95t8m_1",h6e="_clickable_95t8m_21",u6e="_sideBar_95t8m_26",p6e="_boardContent_95t8m_32",y6e="_orange_95t8m_40",k6e="_red_95t8m_44",m6e="_green_95t8m_48",f6e="_grey_95t8m_52",g6e="_lightGrey_95t8m_56",v6e="_big_95t8m_61",M6e="_medium_95t8m_66",x6e="_headerRow_95t8m_70",_6e="_iconWrapper_95t8m_75",L6e="_headerTitle_95t8m_80",I6e="_valueArea_95t8m_89",b6e="_titleWhite_95t8m_99",w6e="_titleBlack_95t8m_103",C6e="_valueWhite_95t8m_108",N6e="_valueBlack_95t8m_112",S6e="_valueBlue_95t8m_116",j6e="_bars_95t8m_121",$6e="_bar_95t8m_121",q6e="_barDark_95t8m_135",A6e="_barDim_95t8m_139",z6e="_predictionSection_95t8m_143",V6e="_predictionHeader_95t8m_155",P6e="_predictionBody_95t8m_162",T6e="_hasPrediction_95t8m_170",Ae={board:l6e,clickable:h6e,sideBar:u6e,boardContent:p6e,orange:y6e,red:k6e,green:m6e,grey:f6e,lightGrey:g6e,big:v6e,medium:M6e,headerRow:x6e,iconWrapper:_6e,headerTitle:L6e,valueArea:I6e,titleWhite:b6e,titleBlack:w6e,valueWhite:C6e,valueBlack:N6e,valueBlue:S6e,bars:j6e,bar:$6e,barDark:q6e,barDim:A6e,predictionSection:z6e,predictionHeader:V6e,predictionBody:P6e,hasPrediction:T6e},H6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Ae.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Ae.bar} ${r<c?"":e?Ae.barDark:Ae.barDim}`},r))})},St=({a11yConfig:e,iconName:t,label:n,value:c,backgroundColor:i="green",bars:r,lightBars:s=5,size:d="big",valueScale:h,width:l,height:u,className:p="",style:y,titleColor:m="white",valueColor:f="white",titleFontSize:g,titleFontWeight:M,valueFontSize:x,valueFontWeight:v,barColor:L,justifyContent:w="space-between",alignItems:C="flex-start",cardGap:b="",onClick:_,iconColor:I,titleKey:j,predictionValue:N,predictionLabel:S})=>{const A=r!=="none",B=r==="endingDark",{padding:T,...V}=y||{},$=l===void 0&&u===void 0&&i===void 0&&Object.keys(V).length===0?void 0:{...l!==void 0?{width:l}:{},...u!==void 0?{height:u}:{},...i!==void 0?{backgroundColor:i}:{},...V},q=`${Ae.board} ${Ae[d]} ${N!==void 0?Ae.hasPrediction:""} ${p}`;return o.jsxs("div",{className:q,onClick:_,style:h!==void 0?{...$,"--ds-value-scale":h}:$,children:[L&&o.jsx("div",{className:Ae.sideBar,style:{backgroundColor:L}}),o.jsxs("div",{className:Ae.boardContent,style:{padding:T,gap:b},children:[o.jsxs("div",{className:Ae.headerRow,style:{justifyContent:w,alignItems:C},children:[t&&o.jsx("div",{className:Ae.iconWrapper,style:{color:I},children:t}),o.jsx("div",{className:`${Ae.headerTitle} header-title-data-board`,children:o.jsx("span",{title:Q(e,j),"aria-label":e?.description,style:{color:m,...g?{fontSize:g}:{},...M?{fontWeight:M}:{}},children:n})}),A?o.jsx(H6e,{endingDark:B,lightCount:s}):null]}),o.jsx("div",{className:Ae.valueArea,style:{color:f,...x?{fontSize:x}:{},...v?{fontWeight:v}:{}},children:c})]}),N!==void 0&&o.jsxs("div",{className:Ae.predictionSection,children:[o.jsx("div",{className:Ae.predictionHeader,children:S??"PRED."}),o.jsx("div",{className:Ae.predictionBody,children:N})]})]})},D6e="_wrapper_1ydle_10",B6e="_hosp_1ydle_19",R6e="_headerRow_1ydle_54",F6e="_iconWrapper_1ydle_61",E6e="_headerTitle_1ydle_67",O6e="_hospValue_1ydle_76",U6e="_side_1ydle_88",W6e="_mini_1ydle_100",G6e="_miniLabel_1ydle_131",K6e="_miniValue_1ydle_140",Z6e="_miniBars_1ydle_150",X6e="_bars_1ydle_155",Y6e="_bar_1ydle_155",J6e="_barDark_1ydle_169",Q6e="_barDim_1ydle_173",ze={wrapper:D6e,hosp:B6e,headerRow:R6e,iconWrapper:F6e,headerTitle:E6e,hospValue:O6e,side:U6e,mini:W6e,miniLabel:G6e,miniValue:K6e,miniBars:Z6e,bars:X6e,bar:Y6e,barDark:J6e,barDim:Q6e},e8e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${ze.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${ze.bar} ${r<c?"":e?ze.barDark:ze.barDim}`},r))})},Qq=({left:e,right:t,className:n="",style:c,miniTilesCount:i=3})=>{const r=e.bars??"endingDark",s=r!=="none",d=r==="endingDark",h={...c,"--mini-tiles-count":i};return o.jsxs("div",{className:`${ze.wrapper} ${n} data-four-boards`,style:h,children:[o.jsxs("div",{className:`${ze.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},title:Q(e.a11yConfig,e.titleKey),children:[o.jsxs("div",{className:ze.headerRow,children:[o.jsxs("div",{className:`${ze.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&o.jsx("span",{style:{color:e.iconColor},children:e.iconName}),o.jsx("span",{className:ze.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},title:Q(e.a11yConfig,e.titleKey),children:e.label})]}),s?o.jsx(e8e,{endingDark:d,lightCount:e.lightBars??5}):null]}),o.jsx("div",{className:ze.hospValue,style:{color:e.valueColor||"white",...e.valueScale!==void 0?{"--ds-value-scale":e.valueScale}:{},...e.valueFontSize?{fontSize:e.valueFontSize}:{},...e.valueFontWeight?{fontWeight:e.valueFontWeight}:{}},children:e.value})]}),o.jsx("div",{className:ze.side,children:t.map((l,u)=>o.jsxs("div",{className:`${ze.mini} ${l.className||""} icon-wrapper-data-four-boards`,onClick:l.onClick,style:{...l.width?{width:l.width}:{},...l.height?{height:l.height}:{},...l.backgroundColor?{backgroundColor:l.backgroundColor}:{},...l.style||{}},title:Q(l.a11yConfig,l.titleKey),children:[o.jsxs("span",{className:ze.miniLabel,style:{color:l.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...l.titleFontSize?{fontSize:l.titleFontSize}:{},...l.titleFontWeight?{fontWeight:l.titleFontWeight}:{}},title:Q(l.a11yConfig,l.titleKey),children:[l.iconName&&o.jsx("span",{style:{color:l.iconColor},children:l.iconName}),l.label]}),o.jsx("span",{className:`${ze.miniValue} mini-value-data-four-boards`,style:{color:l.valueColor||"white",textAlign:"right",...l.valueScale!==void 0?{"--ds-value-scale":l.valueScale}:{},...l.valueFontSize?{fontSize:l.valueFontSize}:{},...l.valueFontWeight?{fontWeight:l.valueFontWeight}:{}},children:l.value}),o.jsx("div",{className:ze.miniBars})]},l.id??`${l.label}-${u}`))})]})},t8e=({items:e,footerLabel:t,width:n,height:c,size:i=320,style:r,className:s="",backgroundColor:d,titleFontSize:h,titleFontWeight:l,valueFontSize:u,valueFontWeight:p,noPaddingLeftRight:y=!1,onItemClick:m})=>{const f={width:n??i,height:c,backgroundColor:d??"var(--ds-navy)",...r},g=e[0],M=e[1],x=e.slice(2,5);return o.jsxs("div",{style:f,className:`${ei.container} ${y?ei.noPaddingMobile:""} ${s}`,children:[o.jsxs("div",{className:ei.card,children:[g?o.jsx(St,{a11yConfig:g.a11yConfig,label:g.label,value:g.value,backgroundColor:g.backgroundColor,bars:g.bars,lightBars:g.lightBars,size:g.size??"big",valueScale:g.valueScale,width:g.width,height:g.height,titleColor:"white",valueColor:"white",titleFontSize:g.titleFontSize??h,titleFontWeight:g.titleFontWeight??l,valueFontSize:g.valueFontSize??u,valueFontWeight:g.valueFontWeight??p,titleKey:g.titleKey,onClick:v=>m?.(0,v)}):null,M&&x.length>0?o.jsx(Qq,{left:{a11yConfig:M.a11yConfig,id:M.id,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,valueScale:M.valueScale,width:M.width,height:M.height,titleFontSize:M.titleFontSize??h,titleFontWeight:M.titleFontWeight??l,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,titleKey:M.titleKey,onClick:v=>m?.(1,v)},right:x.map((v,L)=>({a11yConfig:v.a11yConfig,id:v.id,label:v.label,value:v.value,backgroundColor:v.backgroundColor,bars:v.bars,lightBars:v.lightBars,valueScale:v.valueScale,width:v.width,height:v.height,titleFontSize:v.titleFontSize??h,titleFontWeight:v.titleFontWeight??l,valueFontSize:v.valueFontSize??u,valueFontWeight:v.valueFontWeight??p,titleKey:v.titleKey,onClick:w=>m?.(2+L,w)}))}):M&&x.length===0?o.jsx(St,{a11yConfig:M.a11yConfig,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,size:M.size??"big",valueScale:M.valueScale,width:M.width,height:M.height,titleColor:"white",valueColor:"white",titleFontSize:M.titleFontSize??h,titleFontWeight:M.titleFontWeight??l,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,onClick:v=>m?.(1,v)}):null]}),t&&o.jsx("div",{className:ei.footer,children:t})]})},a8e=({x:e,y:t,width:n,payload:c,fontSize:i,fontWeight:r,stroke:s})=>o.jsx("g",{transform:`translate(${e},${t})`,children:o.jsx("foreignObject",{x:-n,y:-35,width:n,height:70,style:{overflow:"visible"},children:o.jsx("div",{style:{fontSize:i,fontWeight:r,color:s,lineHeight:"1.2",display:"flex",justifyContent:"flex-end",textAlign:"right",alignItems:"center",height:"100%",width:"100%",paddingRight:"8px",boxSizing:"border-box"},children:o.jsx("span",{style:{overflowWrap:"break-word",whiteSpace:"normal",display:"block",maxWidth:"100%"},children:c.value})})})}),n8e=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:c=!0,backgroundColor:i="transparent",legendTextColor:r="var(--color-text)",barHeight:s=40,yAxisWidth:d=120,fontSize:h="12px",fontWeight:l="400",domain:u,xAxisLabel:p,margin:y={top:20,right:60,bottom:40,left:0},valueFormatter:m,tickFormatter:f,labelDataKey:g="percentage"})=>{const M=(y.top??20)+(y.bottom??40)+e.length*(s+20),x=Math.max(M,t),v=k.useMemo(()=>{if(!e||e.length===0)return d;const _=(parseFloat(h)||12)*.7,j=Math.max(...e.map(N=>(N.label||"").length))*_+16;return Math.min(Math.max(j,40),d)},[e,h,d]),L=b=>f?f(b):b?.toString()||"",w=b=>m&&g==="value"?m(b):b==null||b===""?"":g==="percentage"?`${b}%`:b.toString(),C=(b,_,I)=>{if(typeof b!="number")return b;const j=m?m(b):b.toString(),N=I?.payload?.percentage;return typeof N=="number"&&Number.isFinite(N)&&g==="percentage"?`${j} (${N.toFixed(1)}%)`:j};return o.jsx("div",{style:{backgroundColor:i,width:"100%"},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:x,children:o.jsxs(a.BarChart,{data:e,layout:"vertical",margin:y,children:[o.jsx(a.CartesianGrid,{opacity:.4,stroke:"#E5E7EB",vertical:!1,horizontal:!0}),o.jsx(a.XAxis,{type:"number",domain:u||[0,"auto"],axisLine:!1,tickLine:!1,fontSize:h,fontWeight:l,stroke:r,tickFormatter:L,label:p?{value:p,position:"insideBottom",offset:-10,style:{textAnchor:"middle",fill:r,fontSize:12,fontWeight:"500"}}:void 0}),o.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:v,interval:0,fontSize:h,fontWeight:l,tick:o.jsx(a8e,{fontSize:h,fontWeight:l,stroke:r})}),c&&o.jsx(a.Tooltip,{formatter:C,labelStyle:{color:"var(--color-text)"}}),o.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s,children:o.jsx(a.LabelList,{dataKey:g,position:"right",offset:10,formatter:w,fill:r,fontSize:h,fontWeight:l})})]})})})},o8e="_menu_10i6j_1",c8e="_menuRow_10i6j_18",i8e="_separator_10i6j_33",r8e="_rowLabel_10i6j_39",s8e="_rowLeadingIcon_10i6j_47",d8e="_rowIcon_10i6j_54",Fc={menu:o8e,menuRow:c8e,separator:i8e,rowLabel:r8e,rowLeadingIcon:s8e,rowIcon:d8e},l8e=k.forwardRef(function({isVisible:t,onClose:n,items:c,style:i,position:r,bg:s},d){const h=k.useRef(null),l=d||h;if(k.useEffect(()=>{if(!t)return;const y=m=>{l.current&&!l.current.contains(m.target)&&n?.()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[t,n]),!t)return null;const p={...{top:r?.top,left:r?.left,right:r?.right,bottom:r?.bottom},...s&&{backgroundColor:s},...i};return o.jsx("div",{ref:l,role:"menu",className:Fc.menu,style:p,children:c.map(y=>{if(y.type==="separator")return o.jsx("hr",{className:Fc.separator},y.id);const m=y,f=m.color?{color:m.color}:{},g=m.closeOnClick!==!1;return o.jsxs("button",{role:"menuitem",className:Fc.menuRow,style:f,onClick:()=>{m.onClick?.(),g&&n?.()},children:[o.jsxs("span",{className:Fc.rowLabel,children:[m.leadingIcon&&o.jsx("span",{className:Fc.rowLeadingIcon,children:m.leadingIcon}),o.jsx("span",{children:m.label})]}),m.icon&&o.jsx("span",{className:Fc.rowIcon,children:m.icon})]},m.id)})})}),eA=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:c,profileHref:i,profileLinkTarget:r="_self",backgroundColor:s="transparent",textColor:d="inherit",roleColor:h="#888",avatarSize:l="32px",padding:u="10px",gap:p="12px",emailFontSize:y="14px",emailFontWeight:m=600,roleFontSize:f="12px",roleFontWeight:g,avatarColor:M="#5b8fb9",backgroundColorAvatar:x="#f1f4f5",dropdownMenuItems:v,dropdownMenuStyle:L,dropdownMenuOffset:w,statusDotColor:C,a11yConfig:b,style:_,className:I=""})=>{const{user:j}=ht(),N=e||j,{currentTheme:S,switchTheme:A}=pL(),B=k.useRef(null),T=k.useRef(null),[V,$]=k.useState(!1),[q,P]=k.useState({}),H=k.useMemo(()=>{const Y=[],ee=({variant:ue})=>ue==="sun"?o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})}):o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(Y.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),Y.push({id:"sep-profile",type:"separator"}));const ie=S==="dark";return Y.push({id:"theme",type:"action",label:ie?"Mode clair":"Mode sombre",icon:o.jsx(ee,{variant:ie?"sun":"moon"}),onClick:()=>{A(ie?"light":"dark")}}),(t||c)&&(Y.push({id:"sep-theme",type:"separator"}),Y.push({id:"logout",type:"action",label:"Se déconnecter",danger:!0,onClick:()=>{if(t){if(typeof window>"u")return;n==="_blank"?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t);return}c?.()}})),Y},[S,t,n,c,i,r,A]),D=v??H,F=()=>{if(!B.current){$(Y=>!Y);return}if(!V){const Y=B.current.getBoundingClientRect(),ee=window.innerWidth,ie=window.innerHeight,ue=200,re=200,W=4,O=w?.x??0,ne=w?.y??0,Be=ee-Y.right>=ue+W;P(Be?{top:Y.bottom-re+ne,left:Y.right+W+O}:{bottom:ie-Y.top+ne,left:Y.left+O})}$(Y=>!Y)};if(k.useEffect(()=>{if(!V||!B.current)return;const Y=()=>{const ee=B.current.getBoundingClientRect(),ie=window.innerWidth,ue=window.innerHeight,re=200,W=200,O=4,ne=w?.x??0,we=w?.y??0,ge=ie-ee.right>=re+O;P(ge?{top:ee.bottom-W+we,left:ee.right+O+ne}:{bottom:ue-ee.top+we,left:ee.left+ne})};return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),()=>{window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y)}},[V,w]),k.useEffect(()=>{if(!V||!B.current||!T.current)return;const Y=()=>{const ie=B.current.getBoundingClientRect(),ue=T.current.getBoundingClientRect(),re=w?.x??0,W=w?.y??0;P(O=>O.left!==void 0&&O.top!==void 0&&O.left>=ie.right-1?{top:ie.bottom-ue.height+W,left:O.left+re}:O)},ee=requestAnimationFrame(()=>{setTimeout(Y,0)});return()=>cancelAnimationFrame(ee)},[V,w]),!N)return null;const G=N,oe=parseInt(l,10)||40,ae=`${oe*.375}px`,Me=`${oe*1.375}px`,me=`${oe*.2}px`,Ce=`${oe*.6}px`,he=()=>{const Y=parseInt(l,10)||40,ee=Math.max(8,Y*.34375),ie=Math.max(2,Y*.05);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[G.image?o.jsx("img",{src:G.image,alt:`${G.prenom} ${G.nom}`,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):o.jsxs("div",{style:{width:l,height:l,position:"relative",borderRadius:"50%",backgroundColor:x,overflow:"hidden",userSelect:"none"},children:[o.jsx("div",{style:{width:ae,height:ae,borderRadius:"50%",backgroundColor:M,position:"absolute",top:me,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),o.jsx("div",{style:{width:Me,height:Me,borderRadius:"50%",backgroundColor:M,position:"absolute",top:Ce,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),C&&o.jsx("div",{style:{position:"absolute",bottom:ie,right:ie,width:`${ee}px`,height:`${ee}px`,borderRadius:"50%",backgroundColor:C,border:"2px solid white",zIndex:10}})]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[o.jsx("span",{style:{fontWeight:m,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:G.email,children:G.email}),o.jsx("span",{style:{color:h,fontSize:f,fontWeight:g,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:G.role,children:G.role})]})]})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:B,className:`user-info ${I}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:u,backgroundColor:s,gap:p,color:d,width:"100%",boxSizing:"border-box",cursor:"pointer",userSelect:"none",..._},onClick:F,title:Q(b,G.role),role:"button",tabIndex:0,children:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:o.jsx(he,{})})}),o.jsx(l8e,{ref:T,isVisible:V,onClose:()=>$(!1),items:D,style:L,position:q})]})},h8e="_navItem_16uqf_1",u8e="_label_16uqf_14",p8e="_icon_16uqf_26",h1={navItem:h8e,label:u8e,icon:p8e},Xw=({label:e,labelKey:t,onClick:n,href:c,isActive:i,icon:r,style:s,className:d="",highlightColor:h="#00aec7",color:l="#333",activeColor:u="#00aec7",highlightBackgroundColor:p="rgba(0, 0, 0, 0.05)",fontSize:y="15px",fontWeight:m="500",sidebarCollapsed:f=!1,padding:g="10px 16px",borderWidth:M="4px",iconGap:x="12px",disabled:v=!1,disabledColor:L,a11yConfig:w})=>{const C=()=>{v||n?.()},b=o.jsxs(o.Fragment,{children:[r&&o.jsx("span",{className:h1.icon,style:{marginRight:f?0:x},children:r}),!f&&o.jsx("span",{className:h1.label,children:e})]}),_=()=>{if(!i)return"transparent";const j=N=>{const S=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(N);return S?{r:parseInt(S[1],16),g:parseInt(S[2],16),b:parseInt(S[3],16)}:null};if(h.startsWith("#")){const N=j(h);if(N)return`rgba(${N.r}, ${N.g}, ${N.b}, 0.08)`}else if(h.startsWith("rgb")){const N=h.match(/\d+/g);if(N&&N.length>=3)return`rgba(${N[0]}, ${N[1]}, ${N[2]}, 0.08)`}return p},I={onClick:C,className:`${h1.navItem} ${i?h1.active:""} ${d} ${v?h1.disabled:""}`,style:{padding:g,color:i?u:v?L||"#999":l,borderLeft:i?`${M} solid ${h}`:`${M} solid transparent`,backgroundColor:_(),fontSize:y,fontWeight:m,cursor:v?"not-allowed":"pointer",textDecoration:"none",...s},"aria-disabled":v};return c&&!n&&!v?o.jsx("a",{href:c,...I,title:Q(w,t),children:b}):o.jsx("div",{...I,role:n?"button":void 0,tabIndex:n&&!v?0:void 0,title:Q(w,t),children:b})},y8e="_navbar_agnn2_1",k8e="_topSection_agnn2_9",m8e="_sectionsContainer_agnn2_14",f8e="_sectionTitle_agnn2_20",g8e="_sectionItems_agnn2_25",v8e="_bottomSection_agnn2_30",M8e="_versionContainer_agnn2_49",ut={navbar:y8e,topSection:k8e,sectionsContainer:m8e,sectionTitle:f8e,sectionItems:g8e,bottomSection:v8e,versionContainer:M8e},x8e=({logoProps:e,logoSpacing:t,navItems:n,padding:c="24px 16px",sectionSpacing:i="32px",itemSpacing:r="4px",backgroundColor:s="#fff",highlightColor:d="#00aec7",highlightBackgroundColor:h="rgba(0, 0, 0, 0.05)",version:l,navSectionStyle:u,navLinkStyle:p,navItemPadding:y="10px 16px",navItemBorderWidth:m="4px",navItemIconGap:f="12px",navItemFontSize:g="15px",navItemFontWeight:M="500",navItemColor:x,sectionTitlePadding:v="16px",sectionTitleFontSize:L="11px",sectionTitleColor:w="#999",sectionTitleWeight:C="500",versionFontSize:b="12px",versionFontWeight:_="400",versionColor:I="#999",userInfoProps:j,style:N,className:S="",width:A="280px",showLogo:B=!0,versionA11yConfig:T,displayNone:V=!1})=>{const $=ht(),q=$.activeNav,P=$.setActiveNav,H=$.user,D=j.user||H;return o.jsxs("div",{className:`${ut.navbar} ${S}`,style:{width:A,backgroundColor:s,padding:c,display:V?"none":"flex",...N},children:[o.jsxs("div",{className:ut.topSection,style:{gap:t},children:[B&&o.jsx("div",{className:ut.logoContainer,children:o.jsx(uL,{...e})}),o.jsx("div",{className:ut.sectionsContainer,style:{gap:i},children:n.map((F,G)=>o.jsxs("div",{className:ut.section,children:[F.title&&o.jsx("div",{className:ut.sectionTitle,title:Q(F.a11yConfig,F.titleKey),style:{fontSize:L,color:w,padding:v,fontWeight:C,border:"4px solid transparent",...u},children:F.title}),o.jsx("div",{className:ut.sectionItems,style:{gap:r},children:F.items.map(oe=>o.jsx(Xw,{...oe,isActive:oe.isActive===null?oe.isActive:q===oe.id,onClick:()=>{oe.onClick&&oe.onClick(),oe.isActive==null&&P(oe.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:h,padding:y,borderWidth:m,iconGap:f,fontSize:g,fontWeight:M,color:x,style:p},oe.id))})]},G))})]}),o.jsxs("div",{className:ut.bottomSection,style:{gap:t},children:[o.jsx(eA,{...j,user:D}),l&&o.jsx("div",{className:ut.versionContainer,title:Q(T,l),style:{fontSize:b,fontWeight:_,color:I},children:l})]})]})},_8e="_container_4qege_1",L8e="_titleContainer_4qege_10",I8e="_title_4qege_10",b8e="_inlineToggleContainer_4qege_24",w8e="_rightContentContainer_4qege_30",u1={container:_8e,titleContainer:L8e,title:I8e,inlineToggleContainer:b8e,rightContentContainer:w8e},C8e=({className:e="",style:t,fontSize:n="20px",fontWeight:c="bold",color:i="#000",padding:r="0",margin:s,backgroundColor:d,width:h,height:l,border:u,borderRadius:p,navItems:y,formatTitle:m=M=>M,rightContent:f,inlineToggle:g})=>{const{activeNav:M}=ht(),x=y.find(L=>L.id===M),v=m(x?x.label:M);return v?o.jsxs("div",{className:`${u1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:h,height:l,border:u,borderRadius:p,...t},children:[o.jsxs("div",{className:u1.titleContainer,children:[o.jsx("div",{className:u1.title,style:{fontSize:n,fontWeight:c,color:i},children:v}),g&&o.jsx("div",{className:u1.inlineToggleContainer,children:g})]}),f&&o.jsx("div",{className:u1.rightContentContainer,children:f})]}):null},N8e="_navItem_1hg26_1",S8e="_navItemIcon_1hg26_21",j8e="_navItemLabel_1hg26_29",$8e="_navItemCount_1hg26_36",q8e="_navItemIndicator_1hg26_49",p1={navItem:N8e,navItemIcon:S8e,navItemLabel:j8e,navItemCount:$8e,navItemIndicator:q8e},tA=({a11yConfig:e,label:t,isActive:n,onClick:c,href:i,labelKey:r,icon:s,count:d,activeColor:h="#00aec7",inactiveColor:l="#666",activeBackgroundColor:u="transparent",countBackgroundColor:p,countColor:y="#fff",countBorderRadius:m="10px",countPadding:f="2px 6px",countFontSize:g="12px",countFontWeight:M="500",indicatorColor:x="#00aec7",indicatorHeight:v="3px",padding:L="8px 4px",fontSize:w="14px",fontWeight:C="500",gap:b="8px",style:_,className:I="",disabled:j=!1,onNavigate:N})=>{const S=()=>{j||(c?.(),i&&(N?N(i):window.location.href=i))};return o.jsxs("div",{className:`${p1.navItem} ${I}`,onClick:S,title:Q(e,r),style:{gap:b,padding:L,color:n?h:l,backgroundColor:n?u:"transparent",fontSize:w,fontWeight:C,..._},children:[s&&o.jsx("span",{className:p1.navItemIcon,children:s}),o.jsx("span",{className:p1.navItemLabel,children:t}),d!==void 0&&o.jsx("span",{className:p1.navItemCount,style:{backgroundColor:p,color:y,borderRadius:m,padding:f,fontSize:g,fontWeight:M},children:d}),n&&!j&&o.jsx("div",{className:p1.navItemIndicator,style:{height:v,backgroundColor:x}})]})},A8e="_container_13hsa_1",z8e="_groupHeader_13hsa_8",V8e="_groupHeaderLeft_13hsa_18",P8e="_groupIcon_13hsa_23",T8e="_dropdown_13hsa_29",H8e="_item_13hsa_42",D8e="_itemIcon_13hsa_65",B8e="_chevron_13hsa_72",R8e="_chevronOpen_13hsa_79",pt={container:A8e,groupHeader:z8e,groupHeaderLeft:V8e,groupIcon:P8e,dropdown:T8e,item:H8e,itemIcon:D8e,chevron:B8e,chevronOpen:R8e},F8e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M480-344 240-584l43-43 197 197 197-197 43 43z"})),P1=k.memo(F8e),aA=({groups:e,activeItemId:t,onItemClick:n,style:c,className:i,bgColor:r="transparent",color:s="var(--color-text)",headerBgColor:d="var(--color-indicator)",headerColor:h="var(--color-text)",headerBorderBottomColor:l="var(--color-border)",dropdownBgColor:u="var(--color-background)",itemBgColor:p="transparent",itemHoverBgColor:y="rgba(0,0,0,0.05)",itemColor:m="var(--color-text)",itemActiveColor:f="var(--color-primary)",itemActiveBorderColor:g="var(--color-primary)",itemDividerColor:M="var(--color-border)",iconColor:x="#555555",activeIconColor:v="var(--color-primary)",headerIconColor:L="var(--color-text)",chevronColor:w="var(--color-text)",iconSize:C=22,headerPadding:b="14px 20px",itemPadding:_="14px 20px",iconGap:I=14,borderRadius:j=0})=>{const[N,S]=k.useState(""),A=k.useRef(null);k.useEffect(()=>{const T=V=>{A.current&&!A.current.contains(V.target)&&S("")};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const B={backgroundColor:r,color:s,borderRadius:j,...c};return o.jsx("nav",{ref:A,className:[pt.container,i].filter(Boolean).join(" "),style:B,children:e.map(T=>{const V=N===T.id,$={backgroundColor:d,color:h,padding:b,borderBottom:`1px solid ${l}`,gap:I},q={backgroundColor:u};return o.jsxs("div",{children:[o.jsxs("div",{className:pt.groupHeader,style:$,onClick:()=>S(V?"":T.id),role:"button","aria-expanded":V,children:[o.jsxs("div",{className:pt.groupHeaderLeft,style:{gap:I},children:[T.icon&&o.jsx("span",{className:pt.groupIcon,style:{color:L,width:C,height:C},children:T.icon}),o.jsx("span",{children:T.label})]}),o.jsx("span",{className:[pt.chevron,V?pt.chevronOpen:""].join(" "),style:{color:w},children:o.jsx(P1,{width:18,height:18})})]}),V&&o.jsx("div",{className:pt.dropdown,style:q,children:T.items.map(P=>{const H=P.id===t,D={padding:_,gap:I,color:H?f:m,backgroundColor:p,"--item-border-width":H?"4px":"1px","--item-border-color":H?g:M};return o.jsxs("div",{className:pt.item,style:D,onClick:()=>{n?.(T.id,P.id),S("")},role:"menuitem",onMouseEnter:F=>{H||(F.currentTarget.style.backgroundColor=y)},children:[P.icon&&o.jsx("span",{className:pt.itemIcon,style:{color:H?v:x,width:C,height:C},children:P.icon}),o.jsx("span",{children:P.label})]},P.id)})})]},T.id)})})},E8e="_subheaderContent_1glo8_1",O8e="_navContainer_1glo8_11",U8e="_rightContent_1glo8_45",zb={subheaderContent:E8e,navContainer:O8e,rightContent:U8e},W8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:c,width:i,height:r="auto",border:s,borderBottom:d="none",itemGap:h="24px",actionsGap:l="16px",itemPadding:u="12px 0",itemFontSize:p="14px",itemFontWeight:y="500",activeItemColor:m="#00aec7",inactiveItemColor:f="#5c6975",indicatorHeight:g="3px",showDraggable:M=!1,showLegend:x=!1,showData:v=!1,className:L="",style:w,countBackgroundColor:C,countColor:b,countBorderRadius:_,countPadding:I,countFontSize:j,countFontWeight:N,navContainerClassName:S,navContainerStyle:A,rightContentClassName:B,rightContentStyle:T,rightActions:V,activeSwitcherColor:$,inactiveSwitcherColor:q,isMobile:P=!1,onNavigate:H})=>{const{activeSubNav:D,setActiveSubNav:F,navCounts:G,activeNav:oe}=ht();if(P){const ae=e.find(me=>me.id===D)||e[0],Me=[{id:"current-group",label:ae?.label||oe?.toUpperCase()||"MENU",icon:ae?.icon,items:e.map(me=>({id:me.id,label:me.label,icon:me.icon}))}];return o.jsx("div",{className:L,style:w,children:o.jsx(aA,{groups:Me,activeItemId:D,onItemClick:(me,Ce)=>{const he=e.find(Y=>Y.id===Ce);he&&(he.onClick&&he.onClick(),he.href&&(H?H(he.href):he.onNavigate?he.onNavigate(he.href):window.location.href=he.href),F(Ce))},headerBgColor:t})})}return o.jsxs("div",{className:`${zb.subheaderContent} ${L}`,style:{backgroundColor:t,padding:n,margin:c,width:i,height:r,border:s,borderBottom:d,...w},children:[o.jsx("div",{className:`${zb.navContainer} ${S||""}`,style:{gap:h,...A},children:e.map(ae=>{const Me=ae.count!==void 0?ae.count:G[ae.id],me=D===ae.id||ae.isActive;return o.jsx(tA,{...ae,onNavigate:H||ae.onNavigate,count:Me,isActive:me,onClick:()=>{ae.onClick&&ae.onClick(),F(ae.id)},activeColor:m,inactiveColor:f,countBackgroundColor:C,countColor:b,countBorderRadius:_,countPadding:I,countFontSize:j,countFontWeight:N,indicatorColor:m,indicatorHeight:g,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:ae.style},ae.id)})}),o.jsxs("div",{className:`${zb.rightContent} ${B||""}`,style:{gap:l,...T},children:[M&&o.jsx(aL,{size:20,colors:{bg:$,activeBg:q,icon:"#1C1B1F",icon2:"#FFFFFF"}}),x&&o.jsx(nL,{size:20,colors:{bg:$,activeBg:q,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&o.jsx(oL,{size:20,colors:{bg:$,activeBg:q,icon:"#1C1B1F",icon2:"#FFFFFF"}}),V]})]})},G8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:c="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:h=""})=>{const[l,u]=k.useState(!1),{currentTheme:p,switchTheme:y}=pL(),m=p!="dark",f=()=>{y(m?"dark":"light"),e?.()};return k.useEffect(()=>{u(!0)},[]),!l||!p?o.jsx(o.Fragment,{}):o.jsx("div",{className:`theme-switcher ${h}`,onClick:f,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i,padding:r,borderRadius:s,transition:"all 0.3s ease",...d},children:m?o.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},K8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[c,i]=k.useState({sortBy:e,sortOrder:t,filters:{}}),r=k.useCallback(s=>{let d="asc";c.sortBy===s&&(d=c.sortOrder==="asc"?"desc":"asc");const h={...c,sortBy:s,sortOrder:d};i(h),n(s,d)},[c,n]);return{tableState:c,handleSort:r}},Z8e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M440-800v487L216-537l-56 57 320 320 320-320-56-57-224 224v-487z"})),X8e=k.memo(Z8e),Y8e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487z"})),J8e=k.memo(Y8e),Q8e=({columns:e,sortBy:t,sortOrder:n,onSort:c,removeLabelSpan:i=!1})=>o.jsx("thead",{children:o.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,h=!!r.sortable;return o.jsx("th",{className:`${r.className||""}${h?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>h&&c(String(r.key)),title:Q(r.a11yConfig,r.titleKey),children:o.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:o.jsx("span",{children:r.label}),h&&o.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?o.jsx(J8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):o.jsx(X8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),efe=({data:e,columns:t,rowKey:n,onRowClick:c,isLoading:i,text:r,rowStyle:s,rowClassName:d,renderSeparator:h})=>!e.length&&!i?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:o.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):o.jsx("tbody",{children:e.map((l,u)=>{const p=l[n],y=typeof p=="string"||typeof p=="number"?p:u,m=h?h(l):null;return o.jsx("tr",{onClick:()=>c&&c(l),style:{cursor:c?"pointer":"default",...s?s(l):{}},className:d?d(l,u):"",children:m?o.jsx("td",{colSpan:t.length,children:m}):t.map((f,g)=>o.jsx("td",{style:{width:f.width,textAlign:f.align||"left"},className:f.className,children:f.render?f.render(l):l[f.key]},`${String(f.key)}-${g}`))},y)})}),tfe=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:c,hasMore:i,text:r,isLoading:s})=>{const{page:d,pageSize:h,total:l}=e,u=h===-1?l:h,p=Math.ceil(l/u)||1,y=Math.min(Math.max(1,d),p),m=l===0?0:(y-1)*u+1,f=Math.min(y*u,l),g=x=>{t({page:x})},M=k.useMemo(()=>{if(p<=6)return Array.from({length:p},(j,N)=>N+1);const L=Math.max(y-1,1),w=Math.min(y+1,p),C=L>2,b=w<p-2,_=1,I=p;if(!C&&b)return[...Array.from({length:5},(S,A)=>A+1),"...",p];if(C&&!b){const N=Array.from({length:5},(S,A)=>p-5+A+1);return[_,"...",...N]}if(C&&b){const j=Array.from({length:w-L+1},(N,S)=>L+S);return[_,"...",...j,"...",I]}return[]},[y,p]);return o.jsxs("div",{className:"table-pagination",children:[o.jsx("div",{className:"pagination-summary",children:l>0?o.jsx("span",{children:r?.itemsRange?r.itemsRange(m,f,l):o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:[m,"–",f]})," ","sur ",o.jsx("b",{children:l.toLocaleString()})," éléments"]})}):o.jsx("span",{children:r?.noResults||"0 résultats"})}),o.jsx("div",{className:"pagination-spacer"}),!c&&h!==-1&&p>1&&o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:()=>g(1),disabled:y===1,title:r?.first||"Premier",children:"<<"}),o.jsx("button",{className:"pagination-btn",onClick:()=>g(y-1),disabled:y===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((x,v)=>x==="..."?o.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},v):o.jsx("button",{className:`pagination-btn ${x===y?"active":""}`,onClick:()=>g(x),children:x},v)),o.jsx("button",{className:"pagination-btn",onClick:()=>g(y+1),disabled:y===p,title:r?.next||"Suivant",children:">"}),o.jsx("button",{className:"pagination-btn",onClick:()=>g(p),disabled:y===p,title:r?.last||"Dernier",children:">>"})]}),!c&&n&&i&&o.jsx("div",{className:"pagination-load-more",children:o.jsx("button",{className:"btn-load-more",onClick:n,disabled:s,style:{padding:"8px 16px",backgroundColor:"white",border:"1px solid #ddd",borderRadius:"6px",cursor:s?"wait":"pointer",color:"#555",fontWeight:600},children:s?r?.loading||"Chargement...":r?.loadMore||"Charger plus"})})]})},nA=({data:e,columns:t,isLoading:n,pagination:c,onPaginationChange:i,onSortChange:r,rowKey:s,loaderSize:d=40,stickyHeader:h=!0,height:l,minHeight:u="200px",text:p,onLoadMore:y,infiniteScroll:m,hasMore:f,tableState:g,className:M,style:x,rowStyle:v,onRowClick:L,rowClassName:w,titleKey:C,removeLabelSpan:b=!1,a11yConfig:_,renderSeparator:I})=>{const j=k.useMemo(()=>({...p}),[p]),N=k.useRef(null);k.useEffect(()=>{if(!m||!y||!f||n)return;const $=new IntersectionObserver(q=>{q[0].isIntersecting&&y()},{threshold:.1});return N.current&&$.observe(N.current),()=>$.disconnect()},[m,y,f,n]);const{tableState:S,handleSort:A}=K8e({initialSortBy:null,onSortChange:r}),B=(g?.sortBy!==void 0?g.sortBy:S.sortBy)??void 0,T=g?.sortOrder!==void 0?g.sortOrder:S.sortOrder,V=$=>{const q=B,P=T;let H="asc";q===$&&(H=P==="asc"?"desc":"asc"),g?.sortBy!==void 0?r($,H):A($)};return o.jsxs("div",{className:`table-container ${M||""}`,style:x,title:Q(_,C),children:[o.jsxs("div",{className:"table-frame",style:{height:l??void 0,minHeight:u??void 0},children:[n&&o.jsx("div",{className:"table-loader-overlay",children:o.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),o.jsxs("div",{className:`table-wrapper ${h?"sticky-header":""}`,children:[o.jsxs("table",{className:"data-table",children:[o.jsx(Q8e,{columns:t,sortBy:B,sortOrder:T,onSort:V,removeLabelSpan:b}),o.jsx(efe,{data:e,columns:t.map($=>({...$,render:$.render?q=>$.render(q,{}):void 0})),rowKey:s,onRowClick:L,isLoading:n,text:j,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:w,renderSeparator:I})]}),m&&o.jsx("div",{ref:N,style:{height:20,margin:10}})]})]}),o.jsx(tfe,{state:c,onPaginationChange:i,text:j,onLoadMore:y,infiniteScroll:m,hasMore:f,isLoading:n})]})},afe="_datePickerContainer_1941b_3",nfe="_label_1941b_16",ofe="_displayNode_1941b_23",cfe="_datePickerButton_1941b_30",ife="_datePickerButtonDisabled_1941b_50",rfe="_datePickerButtonOpen_1941b_59",sfe="_datePickerLabel_1941b_68",dfe="_placeholder_1941b_79",lfe="_chevron_1941b_83",hfe="_errorMessage_1941b_91",ufe="_dropdown_1941b_96",pfe="_calendarHeader_1941b_120",yfe="_navButton_1941b_129",kfe="_headerSelectors_1941b_148",mfe="_monthSelector_1941b_156",ffe="_yearSelector_1941b_157",gfe="_selectorButton_1941b_161",vfe="_selectorChevron_1941b_178",Mfe="_selectorChevronOpen_1941b_183",xfe="_monthDropdown_1941b_187",_fe="_yearDropdown_1941b_188",Lfe="_monthItem_1941b_208",Ife="_yearItem_1941b_209",bfe="_monthItemSelected_1941b_231",wfe="_yearItemSelected_1941b_232",Cfe="_weekdays_1941b_236",Nfe="_weekday_1941b_236",Sfe="_calendarGrid_1941b_252",jfe="_dateCell_1941b_260",$fe="_dateCellSelected_1941b_283",qfe="_dateCellOtherMonth_1941b_287",Afe="_dateCellOtherMonthSelected_1941b_291",zfe="_calendarFooter_1941b_295",Vfe="_cancelButton_1941b_303",Pfe="_applyButton_1941b_304",Tfe="_timePickerContainer_1941b_348",Hfe="_timeGroup_1941b_357",Dfe="_timeLabel_1941b_364",Bfe="_timeInputWrapper_1941b_370",Rfe="_timeInput_1941b_370",Ffe="_timeSeparator_1941b_398",U={datePickerContainer:afe,label:nfe,displayNode:ofe,datePickerButton:cfe,datePickerButtonDisabled:ife,datePickerButtonOpen:rfe,datePickerLabel:sfe,placeholder:dfe,chevron:lfe,errorMessage:hfe,dropdown:ufe,calendarHeader:pfe,navButton:yfe,headerSelectors:kfe,monthSelector:mfe,yearSelector:ffe,selectorButton:gfe,selectorChevron:vfe,selectorChevronOpen:Mfe,monthDropdown:xfe,yearDropdown:_fe,monthItem:Lfe,yearItem:Ife,monthItemSelected:bfe,yearItemSelected:wfe,weekdays:Cfe,weekday:Nfe,calendarGrid:Sfe,dateCell:jfe,dateCellSelected:$fe,dateCellOtherMonth:qfe,dateCellOtherMonthSelected:Afe,calendarFooter:zfe,cancelButton:Vfe,applyButton:Pfe,timePickerContainer:Tfe,timeGroup:Hfe,timeLabel:Dfe,timeInputWrapper:Bfe,timeInput:Rfe,timeSeparator:Ffe},hj=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],Efe=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],dw=({value:e,onChange:t,label:n,placeholder:c="Sélectionner une date...",className:i="",fullWidth:r=!0,disabled:s=!1,error:d,buttonHeight:h="2.75rem",buttonPadding:l="0.75rem 1rem 0.75rem 1rem",dropdownMaxHeight:u="auto",fontSize:p="0.875rem",iconSize:y="1.5rem",labelMarginBottom:m="0.5rem",errorMarginTop:f="0.25rem",dropdownMarginTop:g="0.25rem",itemPadding:M="0.5rem 0.75rem",fontWeight:x="400",buttonBgColor:v,buttonBorderColor:L,buttonTextColor:w,dropdownBgColor:C="#ffffff",itemHoverColor:b,selectedItemBgColor:_,iconColor:I,errorColor:j,labelColor:N,placeholderColor:S,borderRadius:A="var(--radius-content)",borderWidth:B="0.0625rem",boxShadow:T="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:V="0.2s",transitionTiming:$="ease",dateCellSize:q="2.5rem",headerTextColor:P="#6c757d",weekdayTextColor:H="#6c757d",currentMonthDateColor:D="#212529",otherMonthDateColor:F="#adb5bd",selectedDateBgColor:G="#00A6D9",selectedDateTextColor:oe="#ffffff",cancelButtonBgColor:ae="#e9ecef",cancelButtonTextColor:Me="#212529",applyButtonBgColor:me="#00A6D9",applyButtonTextColor:Ce="#ffffff",width:he,displayNode:Y=void 0,displayMode:ee="auto",displayNodeAriaLabel:ie,dropdownPosition:ue="bottom",dropdownAlignment:re="right",dropdownWidth:W,withBorder:O=!1,icon:ne,precision:we="day",hoursLabel:Be="Heures",minutesLabel:ge="Minutes",lowerLimit:$e=null,upperLimit:Pt=null,months:Pc,weekdays:de,cancelText:Tt="Annuler",applyText:wL="Appliquer",prevMonthAriaLabel:xe="Mois précédent",nextMonthAriaLabel:Ht="Mois suivant",calendarAriaLabel:rA="Sélecteur de date",openedAriaLabel:sA="Ouvrir le sélecteur de date",selectedDateAriaLabel:dA="Date sélectionnée: ",locale:Yw="fr-FR",rotateIcon:lA=!0})=>{const Dt=R=>{if(R instanceof Date)return isNaN(R.getTime())?null:R;if(typeof R=="string"&&R){const X=new Date(R);return isNaN(X.getTime())?null:X}return null},[tt,Bt]=k.useState(!1),[Tc,hA]=k.useState({top:0,left:0,width:0}),[le,s1]=k.useState(Dt(e)||new Date),[CL,NL]=k.useState(Dt(e)),[SL,jL]=k.useState(Dt(e)?.getHours()??0),[$L,qL]=k.useState(Dt(e)?.getMinutes()??0),[AL,Hc]=k.useState(!1),[zL,Dc]=k.useState(!1),VL=k.useRef(null),K1=k.useRef(null),PL=k.useRef(null),TL=k.useRef(null);k.useEffect(()=>{const R=Dt(e);NL(R),R&&(s1(R),jL(R.getHours()),qL(R.getMinutes()))},[e]);const Bc=k.useCallback(()=>{if(K1.current){const R=K1.current.getBoundingClientRect();hA({top:R.top,left:R.left,width:R.width})}},[]);k.useEffect(()=>(tt&&(Bc(),window.addEventListener("scroll",Bc,!0),window.addEventListener("resize",Bc)),()=>{window.removeEventListener("scroll",Bc,!0),window.removeEventListener("resize",Bc)}),[tt,Bc]),k.useEffect(()=>{const R=X=>{if(VL.current&&!VL.current.contains(X.target)){const Ie=document.getElementById("datepicker-dropdown");if(Ie&&Ie.contains(X.target))return;Bt(!1),Hc(!1),Dc(!1)}PL.current&&!PL.current.contains(X.target)&&Hc(!1),TL.current&&!TL.current.contains(X.target)&&Dc(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);const Jw=R=>new Date(R.getFullYear(),R.getMonth()+1,0).getDate(),uA=R=>{const X=new Date(R.getFullYear(),R.getMonth(),1).getDay();return X===0?6:X-1},pA=()=>{const R=[],X=uA(le),Ie=Jw(le),Z1=new Date(le.getFullYear(),le.getMonth()-1,1),xt=Jw(Z1);for(let Xe=X-1;Xe>=0;Xe--)R.push(new Date(le.getFullYear(),le.getMonth()-1,xt-Xe));for(let Xe=1;Xe<=Ie;Xe++)R.push(new Date(le.getFullYear(),le.getMonth(),Xe));const d1=42-R.length;for(let Xe=1;Xe<=d1;Xe++)R.push(new Date(le.getFullYear(),le.getMonth()+1,Xe));return R},yA=(R,X)=>!R||!X?!1:R.getDate()===X.getDate()&&R.getMonth()===X.getMonth()&&R.getFullYear()===X.getFullYear(),kA=R=>R.getMonth()===le.getMonth()&&R.getFullYear()===le.getFullYear(),mA=()=>{s1(new Date(le.getFullYear(),le.getMonth()-1,1))},fA=()=>{s1(new Date(le.getFullYear(),le.getMonth()+1,1))},gA=R=>{if(!s){const X=new Date(R);X.setHours(SL),X.setMinutes($L),NL(X)}},vA=()=>{if(!s){if(CL){const R=new Date(CL);R.setHours(SL),R.setMinutes($L),t(R)}else t(null);Bt(!1)}},MA=()=>{const R=Dt(e);NL(R),R&&(jL(R.getHours()),qL(R.getMinutes())),Bt(!1)},xA=R=>{s1(new Date(le.getFullYear(),R,1)),Hc(!1)},_A=R=>{s1(new Date(R,le.getMonth(),1)),Dc(!1)},LA=()=>{const R=le.getFullYear(),X=[];for(let Ie=R-10;Ie<=R+10;Ie++)X.push(Ie);return X},IA=R=>{if(!s)switch(R.key){case"Enter":case" ":R.preventDefault(),Bt(!tt);break;case"Escape":Bt(!1),Hc(!1),Dc(!1);break;case"Tab":tt&&(Bt(!1),Hc(!1),Dc(!1));break}},bA={width:he||(r?"100%":"auto"),fontSize:p,fontWeight:x},wA={height:h,padding:l,backgroundColor:v||"#ffffff",border:O?void 0:"none",borderColor:d?j||"#dc3545":L||"#dee2e6",color:w||"#212529",borderRadius:A,borderWidth:B,fontWeight:x,transition:`all ${V} ${$}`},CA={backgroundColor:C||"#ffffff",maxHeight:u,borderRadius:A,borderWidth:B,boxShadow:T,transition:`opacity ${V} ${$}, transform ${V} ${$}`,position:"fixed",top:ue==="bottom"?Tc.top+(K1.current?.offsetHeight||0)+parseFloat(g.replace("rem",""))*16:"auto",bottom:ue==="top"?window.innerHeight-Tc.top+parseFloat(g.replace("rem",""))*16:"auto",left:re==="left"?Tc.left:"auto",right:re==="right"?window.innerWidth-(Tc.left+Tc.width):"auto",width:W||(r?Tc.width:"auto"),zIndex:10001},Qw={width:y,height:y,color:I||"#6c757d","--icon-rotation":lA&&tt?"rotate(180deg)":"rotate(0deg)"},NA={color:N||"#212529",marginBottom:m,fontWeight:x},SA={color:S||"#6c757d"},jA={color:j||"#dc3545",marginTop:f},$A=pA(),at=Dt(e),eC=at?we==="minutes"?`${at.toLocaleDateString(Yw)} ${at.getHours().toString().padStart(2,"0")}:${at.getMinutes().toString().padStart(2,"0")}`:at.toLocaleDateString(Yw):"",qA=!!Y&&(ee==="icon"||ee==="auto"&&!at),AA=ie||(at?`${dA}${eC}`:sA);return o.jsxs("div",{className:`${U.datePickerContainer} ${i}`,ref:VL,style:bA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&o.jsx("label",{className:U.label,style:NA,children:n}),o.jsxs("button",{ref:K1,type:"button",onClick:()=>!s&&Bt(!tt),onKeyDown:IA,className:`
|
|
8169
|
+
`),()=>{M.contains(g)&&M.removeChild(g)}},[t]),o.jsx(x0e,{isPresent:t,childRef:r,sizeRef:s,children:J.cloneElement(e,{ref:h})})}const L0e=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:h})=>{const l=zt(I0e),u=k.useId();let p=!0,y=k.useMemo(()=>(p=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:m=>{l.set(m,!0);for(const f of l.values())if(!f)return;c&&c()},register:m=>(l.set(m,!1),()=>l.delete(m))}),[n,l,c]);return r&&p&&(y={...y}),k.useMemo(()=>{l.forEach((m,f)=>l.set(f,!1))},[n]),J.useEffect(()=>{!n&&!l.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(_0e,{isPresent:n,anchorX:d,root:h,children:e})),o.jsx(yL.Provider,{value:y,children:e})};function I0e(){return new Map}function N$(e=!0){const t=k.useContext(yL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const J1=e=>e.key||"";function wC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const b0e=({children:e,custom:t,initial:n=!0,onExitComplete:c,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:h})=>{const[l,u]=N$(s),p=k.useMemo(()=>wC(e),[e]),y=s&&!l?[]:p.map(J1),m=k.useRef(!0),f=k.useRef(p),g=zt(()=>new Map),[M,x]=k.useState(p),[v,L]=k.useState(p);pw(()=>{m.current=!1,f.current=p;for(let b=0;b<v.length;b++){const _=J1(v[b]);y.includes(_)?g.delete(_):g.get(_)!==!0&&g.set(_,!1)}},[v,y.length,y.join("-")]);const w=[];if(p!==M){let b=[...p];for(let _=0;_<v.length;_++){const I=v[_],j=J1(I);y.includes(j)||(b.splice(_,0,I),w.push(I))}return r==="wait"&&w.length&&(b=w),L(wC(b)),x(p),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=k.useContext(hw);return o.jsx(o.Fragment,{children:v.map(b=>{const _=J1(b),I=s&&!l?!1:p===v||y.includes(_),j=()=>{if(g.has(_))g.set(_,!0);else return;let N=!0;g.forEach(S=>{S||(N=!1)}),N&&(C?.(),L(f.current),s&&u?.(),c&&c())};return o.jsx(L0e,{isPresent:I,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:h,onExitComplete:I?void 0:j,anchorX:d,children:b},_)})})},S$=k.createContext({strict:!1}),CC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},a1={};for(const e in CC)a1[e]={isEnabled:t=>CC[e].some(n=>!!t[n])};function w0e(e){for(const t in e)a1[t]={...a1[t],...e[t]}}const C0e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||C0e.has(e)}let j$=e=>!sL(e);function N0e(e){typeof e=="function"&&(j$=t=>t.startsWith("on")?!sL(t):e(t))}try{N0e(require("@emotion/is-prop-valid").default)}catch{}function S0e(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(j$(i)||n===!0&&sL(i)||!t&&!sL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const mL=k.createContext({});function fL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function B1(e){return typeof e=="string"||Array.isArray(e)}const Vw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pw=["initial",...Vw];function gL(e){return fL(e.animate)||Pw.some(t=>B1(e[t]))}function $$(e){return!!(gL(e)||e.variants)}function j0e(e,t){if(gL(e)){const{initial:n,animate:c}=e;return{initial:n===!1||B1(n)?n:void 0,animate:B1(c)?c:void 0}}return e.inherit!==!1?t:{}}function $0e(e){const{initial:t,animate:n}=j0e(e,k.useContext(mL));return k.useMemo(()=>({initial:t,animate:n}),[NC(t),NC(n)])}function NC(e){return Array.isArray(e)?e.join(" "):e}const R1={};function q0e(e){for(const t in e)R1[t]=e[t],xw(t)&&(R1[t].isCSSVariable=!0)}function q$(e,{layout:t,layoutId:n}){return i1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!R1[e]||e==="opacity")}const A0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},z0e=c1.length;function V0e(e,t,n){let c="",i=!0;for(let r=0;r<z0e;r++){const s=c1[r],d=e[s];if(d===void 0)continue;let h=!0;if(typeof d=="number"?h=d===(s.startsWith("scale")?1:0):h=parseFloat(d)===0,!h||n){const l=_$(d,qw[s]);if(!h){i=!1;const u=A0e[s]||s;c+=`${u}(${l}) `}n&&(t[s]=l)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Tw(e,t,n){const{style:c,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const h in t){const l=t[h];if(i1.has(h)){s=!0;continue}else if(xw(h)){i[h]=l;continue}else{const u=_$(l,qw[h]);h.startsWith("origin")?(d=!0,r[h]=u):c[h]=u}}if(t.transform||(s||n?c.transform=V0e(t,e.transform,n):c.transform&&(c.transform="none")),d){const{originX:h="50%",originY:l="50%",originZ:u=0}=r;c.transformOrigin=`${h} ${l} ${u}`}}const Hw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function A$(e,t,n){for(const c in t)!je(t[c])&&!q$(c,n)&&(e[c]=t[c])}function P0e({transformTemplate:e},t){return k.useMemo(()=>{const n=Hw();return Tw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function T0e(e,t){const n=e.style||{},c={};return A$(c,n,e),Object.assign(c,P0e(e,t)),c}function H0e(e,t){const n={},c=T0e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=c,n}const D0e={offset:"stroke-dashoffset",array:"stroke-dasharray"},B0e={offset:"strokeDashoffset",array:"strokeDasharray"};function R0e(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?D0e:B0e;e[r.offset]=K.transform(-c);const s=K.transform(t),d=K.transform(n);e[r.array]=`${s} ${d}`}function z$(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},h,l,u){if(Tw(e,d,l),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),c!==void 0&&(p.scale=c),i!==void 0&&R0e(p,i,r,s,!1)}const V$=()=>({...Hw(),attrs:{}}),P$=e=>typeof e=="string"&&e.toLowerCase()==="svg";function F0e(e,t,n,c){const i=k.useMemo(()=>{const r=V$();return z$(r,t,P$(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};A$(r,e.style,e),i.style={...r,...i.style}}return i}const E0e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Dw(e){return typeof e!="string"||e.includes("-")?!1:!!(E0e.indexOf(e)>-1||/[A-Z]/u.test(e))}function O0e(e,t,n,{latestValues:c},i,r=!1){const d=(Dw(e)?F0e:H0e)(t,c,i,e),h=S0e(t,typeof e=="string",r),l=e!==k.Fragment?{...h,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>je(u)?u.get():u,[u]);return k.createElement(e,{...l,children:p})}function SC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Bw(e,t,n,c){if(typeof t=="function"){const[i,r]=SC(c);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=SC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function Q_(e){return je(e)?e.get():e}function U0e({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:W0e(n,c,i,e),renderState:t()}}function W0e(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=Q_(r[y]);let{initial:s,animate:d}=e;const h=gL(e),l=$$(e);t&&l&&!h&&e.inherit!==!1&&(s===void 0&&(s=t.initial),d===void 0&&(d=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const p=u?d:s;if(p&&typeof p!="boolean"&&!fL(p)){const y=Array.isArray(p)?p:[p];for(let m=0;m<y.length;m++){const f=Bw(e,y[m]);if(f){const{transitionEnd:g,transition:M,...x}=f;for(const v in x){let L=x[v];if(Array.isArray(L)){const w=u?L.length-1:0;L=L[w]}L!==null&&(i[v]=L)}for(const v in g)i[v]=g[v]}}}return i}const T$=e=>(t,n)=>{const c=k.useContext(mL),i=k.useContext(yL),r=()=>U0e(e,t,c,i);return n?r():zt(r)};function Rw(e,t,n){const{style:c}=e,i={};for(const r in c)(je(c[r])||t.style&&je(t.style[r])||q$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const G0e=T$({scrapeMotionValuesFromProps:Rw,createRenderState:Hw});function H$(e,t,n){const c=Rw(e,t,n);for(const i in e)if(je(e[i])||je(t[i])){const r=c1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const K0e=T$({scrapeMotionValuesFromProps:H$,createRenderState:V$}),Z0e=Symbol.for("motionComponentSymbol");function Uc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function X0e(e,t,n){return k.useCallback(c=>{c&&e.onMount&&e.onMount(c),t&&(c?t.mount(c):t.unmount()),n&&(typeof n=="function"?n(c):Uc(n)&&(n.current=c))},[t])}const Fw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Y0e="framerAppearId",D$="data-"+Fw(Y0e),B$=k.createContext({});function J0e(e,t,n,c,i){const{visualElement:r}=k.useContext(mL),s=k.useContext(S$),d=k.useContext(yL),h=k.useContext(kL).reducedMotion,l=k.useRef(null);c=c||s.renderer,!l.current&&c&&(l.current=c(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const u=l.current,p=k.useContext(B$);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Q0e(l.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const m=n[D$],f=k.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return pw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),f.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(!f.current&&u.animationState&&u.animationState.animateChanges(),f.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),f.current=!1),u.enteringChildren=void 0)}),u}function Q0e(e,t,n,c){const{layoutId:i,layout:r,drag:s,dragConstraints:d,layoutScroll:h,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:R$(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Uc(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:c,crossfade:u,layoutScroll:h,layoutRoot:l})}function R$(e){if(e)return e.options.allowProjection!==!1?e.projection:R$(e.parent)}function OL(e,{forwardMotionProps:t=!1}={},n,c){n&&w0e(n);const i=Dw(e)?K0e:G0e;function r(d,h){let l;const u={...k.useContext(kL),...d,layoutId:ele(d)},{isStatic:p}=u,y=$0e(d),m=i(d,p);if(!p&&uw){tle(u,n);const f=ale(u);l=f.MeasureLayout,y.visualElement=J0e(e,m,u,c,f.ProjectionNode)}return o.jsxs(mL.Provider,{value:y,children:[l&&y.visualElement?o.jsx(l,{visualElement:y.visualElement,...u}):null,O0e(e,d,X0e(m,y.visualElement,h),m,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=k.forwardRef(r);return s[Z0e]=e,s}function ele({layoutId:e}){const t=k.useContext(hw).id;return t&&e!==void 0?t+"-"+e:e}function tle(e,t){const n=k.useContext(S$).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const c="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?n1(!1,c,"lazy-strict-mode"):et(!1,c,"lazy-strict-mode")}}function ale(e){const{drag:t,layout:n}=a1;if(!t&&!n)return{};const c={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?c.MeasureLayout:void 0,ProjectionNode:c.ProjectionNode}}function nle(e,t){if(typeof Proxy>"u")return OL;const n=new Map,c=(r,s)=>OL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&gw(!1,"motion() is deprecated. Use motion.create() instead."),c(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?c:(n.has(s)||n.set(s,OL(s,void 0,e,t)),n.get(s))})}function F$({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function ole({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function cle(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),c=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:c.y,right:c.x}}function UL(e){return e===void 0||e===1}function ew({scale:e,scaleX:t,scaleY:n}){return!UL(e)||!UL(t)||!UL(n)}function wc(e){return ew(e)||E$(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function E$(e){return jC(e.x)||jC(e.y)}function jC(e){return e&&e!=="0%"}function dL(e,t,n){const c=e-n,i=t*c;return n+i}function $C(e,t,n,c,i){return i!==void 0&&(e=dL(e,i,c)),dL(e,n,c)+t}function tw(e,t=0,n=1,c,i){e.min=$C(e.min,t,n,c,i),e.max=$C(e.max,t,n,c,i)}function O$(e,{x:t,y:n}){tw(e.x,t.translate,t.scale,t.originPoint),tw(e.y,n.translate,n.scale,n.originPoint)}const qC=.999999999999,AC=1.0000000000001;function ile(e,t,n,c=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,s;for(let d=0;d<i;d++){r=n[d],s=r.projectionDelta;const{visualElement:h}=r.options;h&&h.props.style&&h.props.style.display==="contents"||(c&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Gc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,O$(e,s)),c&&wc(r.latestValues)&&Gc(e,r.latestValues))}t.x<AC&&t.x>qC&&(t.x=1),t.y<AC&&t.y>qC&&(t.y=1)}function Wc(e,t){e.min=e.min+t,e.max=e.max+t}function zC(e,t,n,c,i=.5){const r=fe(e.min,e.max,i);tw(e,t,n,r,c)}function Gc(e,t){zC(e.x,t.x,t.scaleX,t.scale,t.originX),zC(e.y,t.y,t.scaleY,t.scale,t.originY)}function U$(e,t){return F$(cle(e.getBoundingClientRect(),t))}function rle(e,t,n){const c=U$(e,n),{scroll:i}=t;return i&&(Wc(c.x,i.offset.x),Wc(c.y,i.offset.y)),c}const VC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kc=()=>({x:VC(),y:VC()}),PC=()=>({min:0,max:0}),_e=()=>({x:PC(),y:PC()}),aw={current:null},W$={current:!1};function sle(){if(W$.current=!0,!!uw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>aw.current=e.matches;e.addEventListener("change",t),t()}else aw.current=!1}const dle=new WeakMap;function lle(e,t,n){for(const c in t){const i=t[c],r=n[c];if(je(i))e.addValue(c,i);else if(je(r))e.addValue(c,zc(i,{owner:e}));else if(r!==i)if(e.hasValue(c)){const s=e.getValue(c);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(c);e.addValue(c,zc(s!==void 0?s:i,{owner:e}))}}for(const c in n)t[c]===void 0&&e.removeValue(c);return t}const TC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hle{scrapeMotionValuesFromProps(t,n,c){return{}}constructor({parent:t,props:n,presenceContext:c,reducedMotionConfig:i,blockInitialAnimation:r,visualState:s},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=jw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=De.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,ke.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=s;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=c,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=gL(n),this.isVariantNode=$$(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in p){const m=p[y];h[y]!==void 0&&je(m)&&m.set(h[y])}}mount(t){this.current=t,dle.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,c)=>this.bindToMotionValue(c,n)),W$.current||sle(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:aw.current,process.env.NODE_ENV!=="production"&&gw(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),vt(this.notifyUpdate),vt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const c=i1.has(t);c&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&ke.preRender(this.notifyUpdate),c&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in a1){const n=a1[t];if(!n)continue;const{isEnabled:c,Feature:i}=n;if(!this.features[t]&&i&&c(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_e()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let c=0;c<TC.length;c++){const i=TC[c];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,s=t[r];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=lle(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const c=this.values.get(t);n!==c&&(c&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let c=this.values.get(t);return c===void 0&&n!==void 0&&(c=zc(n===null?void 0:n,{owner:this}),this.addValue(t,c)),c}readValue(t,n){let c=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return c!=null&&(typeof c=="string"&&(Tj(c)||Dj(c))?c=parseFloat(c):!g0e(c)&&At.test(n)&&(c=x$(t,n)),this.setBaseTarget(t,je(c)?c.get():c)),je(c)?c.get():c}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let c;if(typeof n=="string"||typeof n=="object"){const r=Bw(this.props,n,this.presenceContext?.custom);r&&(c=r[t])}if(n&&c!==void 0)return c;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!je(i)?i:this.initialValues[t]!==void 0&&c===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new fw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Aw.render(this.render)}}class G$ extends hle{constructor(){super(...arguments),this.KeyframeResolver=c0e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:c}){delete n[t],delete c[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;je(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function K$(e,{style:t,vars:n},c,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,c);for(s in n)r.setProperty(s,n[s])}function ule(e){return window.getComputedStyle(e)}class ple extends G${constructor(){super(...arguments),this.type="html",this.renderInstance=K$}readValueFromInstance(t,n){if(i1.has(n))return this.projection?.isProjecting?Gb(n):Lde(t,n);{const c=ule(t),i=(xw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return U$(t,n)}build(t,n,c){Tw(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Rw(t,n,c)}}const Z$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yle(e,t,n,c){K$(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(Z$.has(i)?i:Fw(i),t.attrs[i])}class kle extends G${constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_e}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(i1.has(n)){const c=M$(n);return c&&c.default||0}return n=Z$.has(n)?n:Fw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return H$(t,n,c)}build(t,n,c){z$(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){yle(t,n,c,i)}mount(t){this.isSVGTag=P$(t.tagName),super.mount(t)}}const mle=(e,t)=>Dw(e)?new kle(t):new ple(t,{allowProjection:e!==k.Fragment});function t1(e,t,n){const c=e.getProps();return Bw(c,t,n!==void 0?n:c.custom,e)}const nw=e=>Array.isArray(e);function fle(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zc(n))}function gle(e){return nw(e)?e[e.length-1]||0:e}function vle(e,t){const n=t1(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=gle(r[s]);fle(e,s,d)}}function Mle(e){return!!(je(e)&&e.add)}function ow(e,t){const n=e.getValue("willChange");if(Mle(n))return n.add(t);if(!n&>.WillChange){const c=new gt.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function X$(e){return e.props[D$]}const xle=e=>e!==null;function _le(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(xle),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const Lle={type:"spring",stiffness:500,damping:25,restSpeed:10},Ile=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ble={type:"keyframes",duration:.8},wle={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Cle=(e,{keyframes:t})=>t.length>2?ble:i1.has(e)?e.startsWith("scale")?Ile(t[1]):Lle:wle;function Nle({when:e,delay:t,delayChildren:n,staggerChildren:c,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:h,elapsed:l,...u}){return!!Object.keys(u).length}const Ew=(e,t,n,c={},i,r)=>s=>{const d=$w(c,e)||{},h=d.delay||c.delay||0;let{elapsed:l=0}=c;l=l-Qe(h);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-l,onUpdate:y=>{t.set(y),d.onUpdate&&d.onUpdate(y)},onComplete:()=>{s(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:r?void 0:i};Nle(d)||Object.assign(u,Cle(e,u)),u.duration&&(u.duration=Qe(u.duration)),u.repeatDelay&&(u.repeatDelay=Qe(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Jb(u),u.delay===0&&(p=!0)),(gt.instantAnimations||gt.skipAnimations)&&(p=!0,Jb(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=_le(u.keyframes,d);if(y!==void 0){ke.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Sw(u):new Wde(u)};function Sle({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function Y$(e,t,{delay:n=0,transitionOverride:c,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;c&&(r=c);const h=[],l=i&&e.animationState&&e.animationState.getState()[i];for(const u in d){const p=e.getValue(u,e.latestValues[u]??null),y=d[u];if(y===void 0||l&&Sle(l,u))continue;const m={delay:n,...$w(r||{},u)},f=p.get();if(f!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===f&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const x=X$(e);if(x){const v=window.MotionHandoffAnimation(x,u,ke);v!==null&&(m.startTime=v,g=!0)}}ow(e,u),p.start(Ew(u,p,y,e.shouldReduceMotion&&f$.has(u)?{type:!1}:m,e,g));const M=p.animation;M&&h.push(M)}return s&&Promise.all(h).then(()=>{ke.update(()=>{s&&vle(e,s)})}),h}function J$(e,t,n,c=0,i=1){const r=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*c;return typeof n=="function"?n(r,s):i===1?r*c:d-r*c}function cw(e,t,n={}){const c=t1(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=c||{};n.transitionOverride&&(i=n.transitionOverride);const r=c?()=>Promise.all(Y$(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:p}=i;return jle(e,t,h,l,u,p,n)}:()=>Promise.resolve(),{when:d}=i;if(d){const[h,l]=d==="beforeChildren"?[r,s]:[s,r];return h().then(()=>l())}else return Promise.all([r(),s(n.delay)])}function jle(e,t,n=0,c=0,i=0,r=1,s){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(cw(h,t,{...s,delay:n+(typeof c=="function"?0:c)+J$(e.variantChildren,h,c,i,r)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function $le(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>cw(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=cw(e,t,n);else{const i=typeof t=="function"?t1(e,t,n.custom):t;c=Promise.all(Y$(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function Q$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let c=0;c<n;c++)if(t[c]!==e[c])return!1;return!0}const qle=Pw.length;function eq(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?eq(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<qle;n++){const c=Pw[n],i=e.props[c];(B1(i)||i===!1)&&(t[c]=i)}return t}const Ale=[...Vw].reverse(),zle=Vw.length;function Vle(e){return t=>Promise.all(t.map(({animation:n,options:c})=>$le(e,n,c)))}function Ple(e){let t=Vle(e),n=HC(),c=!0;const i=h=>(l,u)=>{const p=t1(e,u,h==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:y,transitionEnd:m,...f}=p;l={...l,...f,...m}}return l};function r(h){t=h(e)}function s(h){const{props:l}=e,u=eq(e.parent)||{},p=[],y=new Set;let m={},f=1/0;for(let M=0;M<zle;M++){const x=Ale[M],v=n[x],L=l[x]!==void 0?l[x]:u[x],w=B1(L),C=x===h?v.isActive:null;C===!1&&(f=M);let b=L===u[x]&&L!==l[x]&&w;if(b&&c&&e.manuallyAnimateOnMount&&(b=!1),v.protectedKeys={...m},!v.isActive&&C===null||!L&&!v.prevProp||fL(L)||typeof L=="boolean")continue;const _=Tle(v.prevProp,L);let I=_||x===h&&v.isActive&&!b&&w||M>f&&w,j=!1;const N=Array.isArray(L)?L:[L];let S=N.reduce(i(x),{});C===!1&&(S={});const{prevResolvedValues:A={}}=v,B={...A,...S},T=q=>{I=!0,y.has(q)&&(j=!0,y.delete(q)),v.needsAnimating[q]=!0;const P=e.getValue(q);P&&(P.liveStyle=!1)};for(const q in B){const P=S[q],H=A[q];if(m.hasOwnProperty(q))continue;let D=!1;nw(P)&&nw(H)?D=!Q$(P,H):D=P!==H,D?P!=null?T(q):y.add(q):P!==void 0&&y.has(q)?T(q):v.protectedKeys[q]=!0}v.prevProp=L,v.prevResolvedValues=S,v.isActive&&(m={...m,...S}),c&&e.blockInitialAnimation&&(I=!1);const V=b&&_;I&&(!V||j)&&p.push(...N.map(q=>{const P={type:x};if(typeof q=="string"&&c&&!V&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,D=t1(H,q);if(H.enteringChildren&&D){const{delayChildren:E}=D.transition||{};P.delay=J$(H.enteringChildren,e,E)}}return{animation:q,options:P}}))}if(y.size){const M={};if(typeof l.initial!="boolean"){const x=t1(e,Array.isArray(l.initial)?l.initial[0]:l.initial);x&&x.transition&&(M.transition=x.transition)}y.forEach(x=>{const v=e.getBaseTarget(x),L=e.getValue(x);L&&(L.liveStyle=!0),M[x]=v??null}),p.push({animation:M})}let g=!!p.length;return c&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(g=!1),c=!1,g?t(p):Promise.resolve()}function d(h,l){if(n[h].isActive===l)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(h,l)),n[h].isActive=l;const u=s(h);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:s,setActive:d,setAnimateFunction:r,getState:()=>n,reset:()=>{n=HC()}}}function Tle(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Q$(t,e):!1}function Rt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function HC(){return{animate:Rt(!0),whileInView:Rt(),whileHover:Rt(),whileTap:Rt(),whileDrag:Rt(),whileFocus:Rt(),exit:Rt()}}class Vt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Hle extends Vt{constructor(t){super(t),t.animationState||(t.animationState=Ple(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fL(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Dle=0;class Ble extends Vt{constructor(){super(...arguments),this.id=Dle++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===c)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Rle={animation:{Feature:Hle},exit:{Feature:Ble}};function F1(e,t,n,c={passive:!0}){return e.addEventListener(t,n,c),()=>e.removeEventListener(t,n)}function G1(e){return{point:{x:e.pageX,y:e.pageY}}}const Fle=e=>t=>zw(t)&&e(t,G1(t));function A1(e,t,n,c){return F1(e,t,Fle(n),c)}const tq=1e-4,Ele=1-tq,Ole=1+tq,aq=.01,Ule=0-aq,Wle=0+aq;function Ve(e){return e.max-e.min}function Gle(e,t,n){return Math.abs(e-t)<=n}function DC(e,t,n,c=.5){e.origin=c,e.originPoint=fe(t.min,t.max,e.origin),e.scale=Ve(n)/Ve(t),e.translate=fe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ele&&e.scale<=Ole||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ule&&e.translate<=Wle||isNaN(e.translate))&&(e.translate=0)}function z1(e,t,n,c){DC(e.x,t.x,n.x,c?c.originX:void 0),DC(e.y,t.y,n.y,c?c.originY:void 0)}function BC(e,t,n){e.min=n.min+t.min,e.max=e.min+Ve(t)}function Kle(e,t,n){BC(e.x,t.x,n.x),BC(e.y,t.y,n.y)}function RC(e,t,n){e.min=t.min-n.min,e.max=e.min+Ve(t)}function V1(e,t,n){RC(e.x,t.x,n.x),RC(e.y,t.y,n.y)}function We(e){return[e("x"),e("y")]}const nq=({current:e})=>e?e.ownerDocument.defaultView:null,FC=(e,t)=>Math.abs(e-t);function Zle(e,t){const n=FC(e.x,t.x),c=FC(e.y,t.y);return Math.sqrt(n**2+c**2)}class oq{constructor(t,n,{transformPagePoint:c,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=GL(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,f=Zle(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!f)return;const{point:g}=y,{timestamp:M}=Se;this.history.push({...g,timestamp:M});const{onStart:x,onMove:v}=this.handlers;m||(x&&x(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,y)},this.handlePointerMove=(y,m)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=WL(m,this.transformPagePoint),ke.update(this.updatePoint,!0)},this.handlePointerUp=(y,m)=>{this.end();const{onEnd:f,onSessionEnd:g,resumeAnimation:M}=this.handlers;if(this.dragSnapToOrigin&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=GL(y.type==="pointercancel"?this.lastMoveEventInfo:WL(m,this.transformPagePoint),this.history);this.startEvent&&f&&f(y,x),g&&g(y,x)},!zw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=G1(t),h=WL(d,this.transformPagePoint),{point:l}=h,{timestamp:u}=Se;this.history=[{...l,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,GL(h,this.history)),this.removeListeners=O1(A1(this.contextWindow,"pointermove",this.handlePointerMove),A1(this.contextWindow,"pointerup",this.handlePointerUp),A1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),vt(this.updatePoint)}}function WL(e,t){return t?{point:t(e.point)}:e}function EC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function GL({point:e},t){return{point:e,delta:EC(e,cq(t)),offset:EC(e,Xle(t)),velocity:Yle(t,.1)}}function Xle(e){return e[0]}function cq(e){return e[e.length-1]}function Yle(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=cq(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>Qe(t)));)n--;if(!c)return{x:0,y:0};const r=Ge(i.timestamp-c.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-c.x)/r,y:(i.y-c.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Jle(e,{min:t,max:n},c){return t!==void 0&&e<t?e=c?fe(t,e,c.min):Math.max(e,t):n!==void 0&&e>n&&(e=c?fe(n,e,c.max):Math.min(e,n)),e}function OC(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Qle(e,{top:t,left:n,bottom:c,right:i}){return{x:OC(e.x,n,i),y:OC(e.y,t,c)}}function UC(e,t){let n=t.min-e.min,c=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,c]=[c,n]),{min:n,max:c}}function ehe(e,t){return{x:UC(e.x,t.x),y:UC(e.y,t.y)}}function the(e,t){let n=.5;const c=Ve(e),i=Ve(t);return i>c?n=T1(t.min,t.max-c,e.min):c>i&&(n=T1(e.min,e.max-i,t.min)),ft(0,1,n)}function ahe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const iw=.35;function nhe(e=iw){return e===!1?e=0:e===!0&&(e=iw),{x:WC(e,"left","right"),y:WC(e,"top","bottom")}}function WC(e,t,n){return{min:GC(e,t),max:GC(e,n)}}function GC(e,t){return typeof e=="number"?e:e[t]||0}const ohe=new WeakMap;class che{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_e(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:c}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=p=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(G1(p).point)},s=(p,y)=>{const{drag:m,dragPropagation:f,onDragStart:g}=this.getProps();if(m&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=d0e(m),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),We(x=>{let v=this.getAxisMotionValue(x).get()||0;if(lt.test(v)){const{projection:L}=this.visualElement;if(L&&L.layout){const w=L.layout.layoutBox[x];w&&(v=Ve(w)*(parseFloat(v)/100))}}this.originPoint[x]=v}),g&&ke.postRender(()=>g(p,y)),ow(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:m,dragDirectionLock:f,onDirectionLock:g,onDrag:M}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=y;if(f&&this.currentDirection===null){this.currentDirection=ihe(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",y.point,x),this.updateAxis("y",y.point,x),this.visualElement.render(),M&&M(p,y)},h=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>We(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new oq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:h,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:nq(this.visualElement)})}stop(t,n){const c=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!c)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&ke.postRender(()=>d(c,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,c){const{drag:i}=this.getProps();if(!c||!Q1(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Jle(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Uc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&c?this.constraints=Qle(c.layoutBox,t):this.constraints=!1,this.elastic=nhe(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&We(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=ahe(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Uc(t))return!1;const c=t.current;et(c!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=rle(c,i.root,this.visualElement.getTransformPagePoint());let s=ehe(i.layout.layoutBox,r);if(n){const d=n(ole(s));this.hasMutatedConstraints=!!d,d&&(s=F$(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},l=We(u=>{if(!Q1(u,n,this.currentDirection))return;let p=h&&h[u]||{};s&&(p={min:0,max:0});const y=i?200:1e6,m=i?40:1e7,f={type:"inertia",velocity:c?t[u]:0,bounceStiffness:y,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(u,f)});return Promise.all(l).then(d)}startAxisValueAnimation(t,n){const c=this.getAxisMotionValue(t);return ow(this.visualElement,t),c.start(Ew(t,c,0,n,this.visualElement,!1))}stopAnimation(){We(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){We(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,c=this.visualElement.getProps(),i=c[n];return i||this.visualElement.getValue(t,(c.initial?c.initial[t]:void 0)||0)}snapToCursor(t){We(n=>{const{drag:c}=this.getProps();if(!Q1(n,c,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:d}=i.layout.layoutBox[n];r.set(t[n]-fe(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:c}=this.visualElement;if(!Uc(n)||!c||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};We(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const h=d.get();i[s]=the({min:h,max:h},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.resolveConstraints(),We(s=>{if(!Q1(s,t,null))return;const d=this.getAxisMotionValue(s),{min:h,max:l}=this.constraints[s];d.set(fe(h,l,i[s]))})}addListeners(){if(!this.visualElement.current)return;ohe.set(this.visualElement,this);const t=this.visualElement.current,n=A1(t,"pointerdown",h=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(h)}),c=()=>{const{dragConstraints:h}=this.getProps();Uc(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",c);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ke.read(c);const s=F1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:h,hasLayoutChanged:l})=>{this.isDragging&&l&&(We(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=h[u].translate,p.set(p.get()+h[u].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:c=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=iw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function Q1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ihe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class rhe extends Vt{constructor(t){super(t),this.removeGroupControls=Ze,this.removeListeners=Ze,this.controls=new che(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ze}unmount(){this.removeGroupControls(),this.removeListeners()}}const KC=e=>(t,n)=>{e&&ke.postRender(()=>e(t,n))};class she extends Vt{constructor(){super(...arguments),this.removePointerDownListener=Ze}onPointerDown(t){this.session=new oq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nq(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:KC(t),onStart:KC(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&ke.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=A1(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const eL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ZC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const l1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(K.test(e))e=parseFloat(e);else return e;const n=ZC(e,t.target.x),c=ZC(e,t.target.y);return`${n}% ${c}%`}},dhe={correct:(e,{treeScale:t,projectionDelta:n})=>{const c=e,i=At.parse(e);if(i.length>5)return c;const r=At.createTransformer(e),s=typeof i[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;i[0+s]/=d,i[1+s]/=h;const l=fe(d,h,.5);return typeof i[2+s]=="number"&&(i[2+s]/=l),typeof i[3+s]=="number"&&(i[3+s]/=l),r(i)}};let KL=!1;class lhe extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;q0e(hhe),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),KL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),eL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,KL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||ke.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Aw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;KL=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),c&&c.deregister&&c.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function iq(e){const[t,n]=N$(),c=k.useContext(hw);return o.jsx(lhe,{...e,layoutGroup:c,switchLayoutGroup:k.useContext(B$),isPresent:t,safeToRemove:n})}const hhe={borderRadius:{...l1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:l1,borderTopRightRadius:l1,borderBottomLeftRadius:l1,borderBottomRightRadius:l1,boxShadow:dhe};function uhe(e,t,n){const c=je(e)?e:zc(e);return c.start(Ew("",c,t,n)),c.animation}const phe=(e,t)=>e.depth-t.depth;class yhe{constructor(){this.children=[],this.isDirty=!1}add(t){yw(this.children,t),this.isDirty=!0}remove(t){kw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(phe),this.isDirty=!1,this.children.forEach(t)}}function khe(e,t){const n=De.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(vt(c),e(r-t))};return ke.setup(c,!0),()=>vt(c)}const rq=["TopLeft","TopRight","BottomLeft","BottomRight"],mhe=rq.length,XC=e=>typeof e=="string"?parseFloat(e):e,YC=e=>typeof e=="number"||K.test(e);function fhe(e,t,n,c,i,r){i?(e.opacity=fe(0,n.opacity??1,ghe(c)),e.opacityExit=fe(t.opacity??1,0,vhe(c))):r&&(e.opacity=fe(t.opacity??1,n.opacity??1,c));for(let s=0;s<mhe;s++){const d=`border${rq[s]}Radius`;let h=JC(t,d),l=JC(n,d);if(h===void 0&&l===void 0)continue;h||(h=0),l||(l=0),h===0||l===0||YC(h)===YC(l)?(e[d]=Math.max(fe(XC(h),XC(l),c),0),(lt.test(l)||lt.test(h))&&(e[d]+="%")):e[d]=l}(t.rotate||n.rotate)&&(e.rotate=fe(t.rotate||0,n.rotate||0,c))}function JC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const ghe=sq(0,.5,Gj),vhe=sq(.5,.95,Ze);function sq(e,t,n){return c=>c<e?0:c>t?1:n(T1(e,t,c))}function QC(e,t){e.min=t.min,e.max=t.max}function Ee(e,t){QC(e.x,t.x),QC(e.y,t.y)}function eN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function tN(e,t,n,c,i){return e-=t,e=dL(e,1/n,c),i!==void 0&&(e=dL(e,1/i,c)),e}function Mhe(e,t=0,n=1,c=.5,i,r=e,s=e){if(lt.test(t)&&(t=parseFloat(t),t=fe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=fe(r.min,r.max,c);e===r&&(d-=t),e.min=tN(e.min,t,n,d,i),e.max=tN(e.max,t,n,d,i)}function aN(e,t,[n,c,i],r,s){Mhe(e,t[n],t[c],t[i],t.scale,r,s)}const xhe=["x","scaleX","originX"],_he=["y","scaleY","originY"];function nN(e,t,n,c){aN(e.x,t,xhe,n?n.x:void 0,c?c.x:void 0),aN(e.y,t,_he,n?n.y:void 0,c?c.y:void 0)}function oN(e){return e.translate===0&&e.scale===1}function dq(e){return oN(e.x)&&oN(e.y)}function cN(e,t){return e.min===t.min&&e.max===t.max}function Lhe(e,t){return cN(e.x,t.x)&&cN(e.y,t.y)}function iN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function lq(e,t){return iN(e.x,t.x)&&iN(e.y,t.y)}function rN(e){return Ve(e.x)/Ve(e.y)}function sN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ihe{constructor(){this.members=[]}add(t){yw(this.members,t),t.scheduleRender()}remove(t){if(kw(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let c;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){c=r;break}}return c?(this.promote(c),!0):!1}promote(t,n){const c=this.lead;if(t!==c&&(this.prevLead=c,this.lead=t,t.show(),c)){c.instance&&c.scheduleRender(),t.scheduleRender(),t.resumeFrom=c,n&&(t.resumeFrom.preserveOpacity=!0),c.snapshot&&(t.snapshot=c.snapshot,t.snapshot.latestValues=c.animationValues||c.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&c.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:c}=t;n.onExitComplete&&n.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function bhe(e,t,n){let c="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(c=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(c+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:p,rotateY:y,skewX:m,skewY:f}=n;l&&(c=`perspective(${l}px) ${c}`),u&&(c+=`rotate(${u}deg) `),p&&(c+=`rotateX(${p}deg) `),y&&(c+=`rotateY(${y}deg) `),m&&(c+=`skewX(${m}deg) `),f&&(c+=`skewY(${f}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(c+=`scale(${d}, ${h})`),c||"none"}const ZL=["","X","Y","Z"],whe=1e3;let Che=0;function XL(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function hq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=X$(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ke,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&hq(c)}function uq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=Che++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jhe),this.nodes.forEach(zhe),this.nodes.forEach(Vhe),this.nodes.forEach($he)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new yhe)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new fw),this.eventHandlers.get(s).add(d)}notifyListeners(s,...d){const h=this.eventHandlers.get(s);h&&h.notify(...d)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=C$(s)&&!k0e(s),this.instance=s;const{layoutId:d,layout:h,visualElement:l}=this.options;if(l&&!l.current&&l.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let u,p=0;const y=()=>this.root.updateBlockedByResize=!1;ke.read(()=>{p=window.innerWidth}),e(s,()=>{const m=window.innerWidth;m!==p&&(p=m,this.root.updateBlockedByResize=!0,u&&u(),u=khe(y,250),eL.hasAnimatedSinceResize&&(eL.hasAnimatedSinceResize=!1,this.nodes.forEach(hN)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&l&&(d||h)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const f=this.options.transition||l.getDefaultTransition()||Bhe,{onLayoutAnimationStart:g,onLayoutAnimationComplete:M}=l.getProps(),x=!this.targetLayout||!lq(this.targetLayout,m),v=!p&&y;if(this.options.layoutRoot||this.resumeFrom||v||p&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...$w(f,"layout"),onPlay:g,onComplete:M};(l.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(u,v)}else p||hN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Phe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hq(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(dN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(lN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ahe),this.nodes.forEach(Nhe),this.nodes.forEach(She)):this.nodes.forEach(lN),this.clearAllSnapshots();const d=De.now();Se.delta=ft(0,1e3/60,d-Se.timestamp),Se.timestamp=d,Se.isProcessing=!0,HL.update.process(Se),HL.preRender.process(Se),HL.render.process(Se),Se.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Aw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qhe),this.sharedNodes.forEach(The)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ke.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ke.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ve(this.snapshot.measuredBox.x)&&!Ve(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=_e(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(d=!1),d&&this.instance){const h=c(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!dq(this.projectionDelta),h=this.getTransformTemplate(),l=h?h(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;s&&this.instance&&(d||wc(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return s&&(h=this.removeTransform(h)),Rhe(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return _e();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Fhe))){const{scroll:l}=this.root;l&&(Wc(d.x,l.offset.x),Wc(d.y,l.offset.y))}return d}removeElementScroll(s){const d=_e();if(Ee(d,s),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const l=this.path[h],{scroll:u,options:p}=l;l!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Ee(d,s),Wc(d.x,u.offset.x),Wc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const h=_e();Ee(h,s);for(let l=0;l<this.path.length;l++){const u=this.path[l];!d&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Gc(h,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),wc(u.latestValues)&&Gc(h,u.latestValues)}return wc(this.latestValues)&&Gc(h,this.latestValues),h}removeTransform(s){const d=_e();Ee(d,s);for(let h=0;h<this.path.length;h++){const l=this.path[h];if(!l.instance||!wc(l.latestValues))continue;ew(l.latestValues)&&l.updateSnapshot();const u=_e(),p=l.measurePageBox();Ee(u,p),nN(d,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return wc(this.latestValues)&&nN(d,this.latestValues),d}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Se.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(s||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:p}=this.options;if(!(!this.layout||!(u||p))){if(this.resolvedRelativeTargetAt=Se.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),V1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_e(),this.targetWithTransforms=_e()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Kle(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ee(this.target,this.layout.layoutBox),O$(this.target,this.targetDelta)):Ee(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_e(),this.relativeTargetOrigin=_e(),V1(this.relativeTargetOrigin,this.target,y.target),Ee(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ew(this.parent.latestValues)||E$(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const s=this.getLead(),d=!!this.resumingFrom||this!==s;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Se.timestamp&&(h=!1),h)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Ee(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;ile(this.layoutCorrected,this.treeScale,this.path,d),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=_e());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(eN(this.prevProjectionDelta.x,this.projectionDelta.x),eN(this.prevProjectionDelta.y,this.projectionDelta.y)),z1(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!sN(this.projectionDelta.x,this.prevProjectionDelta.x)||!sN(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kc(),this.projectionDelta=Kc(),this.projectionDeltaWithTransform=Kc()}setAnimationOrigin(s,d=!1){const h=this.snapshot,l=h?h.latestValues:{},u={...this.latestValues},p=Kc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=_e(),m=h?h.source:void 0,f=this.layout?this.layout.source:void 0,g=m!==f,M=this.getStack(),x=!M||M.members.length<=1,v=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(Dhe));this.animationProgress=0;let L;this.mixTargetDelta=w=>{const C=w/1e3;uN(p.x,s.x,C),uN(p.y,s.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(V1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Hhe(this.relativeTarget,this.relativeTargetOrigin,y,C),L&&Lhe(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=_e()),Ee(L,this.relativeTarget)),g&&(this.animationValues=u,fhe(u,l,this.latestValues,C,v,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ke.update(()=>{eL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zc(0)),this.currentAnimation=uhe(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(whe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:d,target:h,layout:l,latestValues:u}=s;if(!(!d||!h||!l)){if(this!==s&&this.layout&&l&&pq(this.options.animationType,this.layout.layoutBox,l.layoutBox)){h=this.target||_e();const p=Ve(this.layout.layoutBox.x);h.x.min=s.target.x.min,h.x.max=h.x.min+p;const y=Ve(this.layout.layoutBox.y);h.y.min=s.target.y.min,h.y.max=h.y.min+y}Ee(d,h),Gc(d,u),z1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Ihe),this.sharedNodes.get(s).add(d);const l=d.options.initialPromotionConfig;d.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(d):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:d,preserveFollowOpacity:h}={}){const l=this.getStack();l&&l.promote(this,h),s&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let d=!1;const{latestValues:h}=s;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const l={};h.z&&XL("z",s,l,this.animationValues);for(let u=0;u<ZL.length;u++)XL(`rotate${ZL[u]}`,s,l,this.animationValues),XL(`skew${ZL[u]}`,s,l,this.animationValues);s.render();for(const u in l)s.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);s.scheduleRender()}applyProjectionStyles(s,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Q_(d?.pointerEvents)||"",s.transform=h?h(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Q_(d?.pointerEvents)||""),this.hasProjected&&!wc(this.latestValues)&&(s.transform=h?h({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let p=bhe(this.projectionDeltaWithTransform,this.treeScale,u);h&&(p=h(u,p)),s.transform=p;const{x:y,y:m}=this.projectionDelta;s.transformOrigin=`${y.origin*100}% ${m.origin*100}% 0`,l.animationValues?s.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const f in R1){if(u[f]===void 0)continue;const{correct:g,applyTo:M,isCSSVariable:x}=R1[f],v=p==="none"?u[f]:g(u[f],l);if(M){const L=M.length;for(let w=0;w<L;w++)s[M[w]]=v}else x?this.options.visualElement.renderState.vars[f]=v:s[f]=v}this.options.layoutId&&(s.pointerEvents=l===this?Q_(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(dN),this.root.sharedNodes.clear()}}}function Nhe(e){e.updateLayout()}function She(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:c}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?We(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Ve(p);p.min=n[u].min,p.max=p.min+y}):pq(i,t.layoutBox,n)&&We(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Ve(n[u]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+y)});const s=Kc();z1(s,n,t.layoutBox);const d=Kc();r?z1(d,e.applyTransform(c,!0),t.measuredBox):z1(d,n,t.layoutBox);const h=!dq(s);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:y}=u;if(p&&y){const m=_e();V1(m,t.layoutBox,p.layoutBox);const f=_e();V1(f,n,y.layoutBox),lq(m,f)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=f,e.relativeTargetOrigin=m,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:s,hasLayoutChanged:h,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function jhe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function $he(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qhe(e){e.clearSnapshot()}function dN(e){e.clearMeasurements()}function lN(e){e.isLayoutDirty=!1}function Ahe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function hN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zhe(e){e.resolveTargetDelta()}function Vhe(e){e.calcProjection()}function Phe(e){e.resetSkewAndRotation()}function The(e){e.removeLeadSnapshot()}function uN(e,t,n){e.translate=fe(t.translate,0,n),e.scale=fe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pN(e,t,n,c){e.min=fe(t.min,n.min,c),e.max=fe(t.max,n.max,c)}function Hhe(e,t,n,c){pN(e.x,t.x,n.x,c),pN(e.y,t.y,n.y,c)}function Dhe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Bhe={duration:.45,ease:[.4,0,.1,1]},yN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),kN=yN("applewebkit/")&&!yN("chrome/")?Math.round:Ze;function mN(e){e.min=kN(e.min),e.max=kN(e.max)}function Rhe(e){mN(e.x),mN(e.y)}function pq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Gle(rN(t),rN(n),.2)}function Fhe(e){return e!==e.root&&e.scroll?.wasRoot}const Ehe=uq({attachResizeListener:(e,t)=>F1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),YL={current:void 0},yq=uq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!YL.current){const e=new Ehe({});e.mount(window),e.setOptions({layoutScroll:!0}),YL.current=e}return YL.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ohe={pan:{Feature:she},drag:{Feature:rhe,ProjectionNode:yq,MeasureLayout:iq}};function fN(e,t,n){const{props:c}=e;e.animationState&&c.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=c[i];r&&ke.postRender(()=>r(t,G1(t)))}class Uhe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=l0e(t,(n,c)=>(fN(this.node,c,"Start"),i=>fN(this.node,i,"End"))))}unmount(){}}class Whe extends Vt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=O1(F1(this.node.current,"focus",()=>this.onFocus()),F1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function gN(e,t,n){const{props:c}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&c.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=c[i];r&&ke.postRender(()=>r(t,G1(t)))}class Ghe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=y0e(t,(n,c)=>(gN(this.node,c,"Start"),(i,{success:r})=>gN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const rw=new WeakMap,JL=new WeakMap,Khe=e=>{const t=rw.get(e.target);t&&t(e)},Zhe=e=>{e.forEach(Khe)};function Xhe({root:e,...t}){const n=e||document;JL.has(n)||JL.set(n,{});const c=JL.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Zhe,{root:e,...t})),c[i]}function Yhe(e,t,n){const c=Xhe(t);return rw.set(e,n),c.observe(e),()=>{rw.delete(e),c.unobserve(e)}}const Jhe={some:0,all:1};class Qhe extends Vt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:c,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:c,threshold:typeof i=="number"?i:Jhe[i]},d=h=>{const{isIntersecting:l}=h;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),y=l?u:p;y&&y(h)};return Yhe(this.node.current,s,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eue(t,n))&&this.startObserver()}unmount(){}}function eue({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tue={inView:{Feature:Qhe},tap:{Feature:Ghe},focus:{Feature:Whe},hover:{Feature:Uhe}},aue={layout:{ProjectionNode:yq,MeasureLayout:iq}},nue={...Rle,...tue,...Ohe,...aue},Ow=nle(nue,mle);function kq(e){const t=zt(()=>zc(e)),{isStatic:n}=k.useContext(kL);if(n){const[,c]=k.useState(e);k.useEffect(()=>t.on("change",c),[])}return t}function mq(e,t){const n=kq(t()),c=()=>n.set(t());return c(),pw(()=>{const i=()=>ke.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),vt(c)}}),n}function oue(e){q1.current=[],e();const t=mq(q1.current,e);return q1.current=void 0,t}function cue(e,t,n,c){if(typeof e=="function")return oue(e);const i=typeof t=="function"?t:m0e(t,n,c);return Array.isArray(e)?vN(e,i):vN([e],([r])=>i(r))}function vN(e,t){const n=zt(()=>[]);return mq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class iue{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(c=>{c.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const rue=()=>new iue;function sue(){return zt(rue)}const fq=k.createContext(null);function due(e,t,n,c){if(!c)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=c>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],h=s.layout,l=fe(h.min,h.max,.5);return r===1&&d.layout.max+n>l||r===-1&&d.layout.min+n<l?_2e(e,i,i+r):e}function lue({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=zt(()=>Ow[t]),h=[],l=k.useRef(!1);et(!!i,"Reorder.Group must be provided a values prop","reorder-values");const u={axis:n,registerItem:(p,y)=>{const m=h.findIndex(f=>p===f.value);m!==-1?h[m].layout=y[n]:h.push({value:p,layout:y[n]}),h.sort(pue)},updateOrder:(p,y,m)=>{if(l.current)return;const f=due(h,p,y,m);h!==f&&(l.current=!0,c(f.map(uue).filter(g=>i.indexOf(g)!==-1)))}};return k.useEffect(()=>{l.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(fq.Provider,{value:u,children:e})})}const hue=k.forwardRef(lue);function uue(e){return e.value}function pue(e,t){return e.layout.min-t.layout.min}function MN(e,t=0){return je(e)?e:kq(t)}function yue({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const h=zt(()=>Ow[c]),l=k.useContext(fq),u={x:MN(t.x),y:MN(t.y)},p=cue([u.x,u.y],([g,M])=>g||M?1:"unset");et(!!l,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:m,updateOrder:f}=l;return o.jsx(h,{drag:y,...s,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:p},layout:r,onDrag:(g,M)=>{const{velocity:x}=M;x[y]&&f(n,u[y].get(),x[y]),i&&i(g,M)},onLayoutMeasure:g=>m(n,g),ref:d,ignoreStrict:!0,children:e})}const kue=k.forwardRef(yue),lL=[o.jsx(j1,{size:18}),o.jsx(Ct,{size:18}),o.jsx(N1,{size:18}),o.jsx(Nt,{size:18}),o.jsx(v1,{size:18}),o.jsx(g1,{size:18})],mue=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,h]=k.useState(e??[]);return k.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((l,u)=>{if(l.icon==null&&(l.icon=lL[u%lL.length]),typeof l.text=="string"&&l.text.includes("/")){const p=String(l.text).split("/"),y=p[0].trim(),f=p.slice(1).join("/").trim().match(/^(\d+)(.*)$/);if(f){const g=f[1],M=f[2]??"",x=g.padStart(3,"0");l.text=`${y} / ${x}${M}`}}}),h(e)):h([])},[e]),o.jsxs("div",{className:`trend-list ${c??""}`,draggable:n,style:{position:"relative"},children:[o.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),o.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:o.jsx(hue,{axis:"y",values:d,onReorder:l=>{h(l),t?.(l)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((l,u)=>o.jsx(fue,{value:l,index:u,itemsDraggable:s},String(l.id)))})}),n&&o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:o.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function fue({value:e,index:t}){const n=sue(),c=lL[t%lL.length]??null;return o.jsx(kue,{value:e,dragListener:!1,dragControls:n,style:{listStyle:"none"},onDragStart:()=>{try{document.body.classList.add("is-dragging")}catch{}},onDragEnd:()=>{try{document.body.classList.remove("is-dragging")}catch{}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("div",{className:"reorder-handle","aria-hidden":!0,onPointerDown:i=>n.start(i),style:{width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",userSelect:"none"},children:o.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:o.jsxs("g",{fill:"currentColor",children:[o.jsx("circle",{cx:"8",cy:"6",r:"2"}),o.jsx("circle",{cx:"16",cy:"6",r:"2"}),o.jsx("circle",{cx:"8",cy:"12",r:"2"}),o.jsx("circle",{cx:"16",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),o.jsx("div",{style:{flex:1},children:o.jsx(Pj,{title:e.title,subtitle:e.subtitle,text:e.text,background:e.background,titleStyle:e.titleStyle,subtitleStyle:e.subtitleStyle,textStyle:e.textStyle,itemStyle:e.itemStyle,icon:e.icon??c})})]})})}function gue(e,t){return t.required?t.type==="checkbox"&&!e?{isValid:!1,error:`${t.label} est requis`}:!e||typeof e=="string"&&e.trim()===""?{isValid:!1,error:`${t.label} est requis`}:null:null}function vue(e){return!e||typeof e=="string"&&e.trim()===""}function Mue(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function xue(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function _ue(e,t){const n=Number(e);return isNaN(n)?{isValid:!1,error:"Doit être un nombre valide"}:t.validation?.min!==void 0&&n<Number(t.validation.min)?{isValid:!1,error:`Doit être ≥ ${t.validation.min}`}:t.validation?.max!==void 0&&n>Number(t.validation.max)?{isValid:!1,error:`Doit être ≤ ${t.validation.max}`}:null}function Lue(e,t){return t.validation?.minDate&&new Date(e)<new Date(t.validation.minDate)?{isValid:!1,error:`Doit être après ${t.validation.minDate}`}:t.validation?.maxDate&&new Date(e)>new Date(t.validation.maxDate)?{isValid:!1,error:`Doit être avant ${t.validation.maxDate}`}:null}function Iue(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),c=e.type;if(!n.some(i=>c.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${c}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function bue(e,t){return t.validation?t.validation.minLength&&e.length<t.validation.minLength?{isValid:!1,error:`Minimum ${t.validation.minLength} caractères`}:t.validation.maxLength&&e.length>t.validation.maxLength?{isValid:!1,error:`Maximum ${t.validation.maxLength} caractères`}:t.validation.pattern&&!new RegExp(t.validation.pattern).test(e)?{isValid:!1,error:"Format invalide"}:null:null}function hL(e,t){const n=gue(e,t);if(n)return n;if(vue(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=Mue(c);if(r)return r;break}case"url":{const r=xue(c);if(r)return r;break}case"number":{const r=_ue(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=Lue(e,t);if(r)return r;break}case"file":{const r=Iue(e,t);if(r)return r;break}}const i=bue(c,t);return i||{isValid:!0}}function gq(e,t){const n={};let c=!0;for(const i of t){const r=hL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const wue="_formContainer_14ads_1",Cue="_headerLine_14ads_17",Nue="_formTitle_14ads_25",Sue="_formDescription_14ads_30",jue="_sectionTitle_14ads_37",$ue="_sectionHelp_14ads_44",que="_fieldHelp_14ads_50",Aue="_gridContainer_14ads_58",zue="_fieldGridItem_14ads_70",Vue="_sectionFull_14ads_105",Pue="_formFooter_14ads_110",Tue="_footerLeft_14ads_118",Hue="_footerRight_14ads_119",Due="_cancelLink_14ads_125",Bue="_submitButton_14ads_136",Rue="_fieldLabel_14ads_148",Fue="_inputWrapper_14ads_163",Eue="_inputInner_14ads_187",Oue="_hasPrefix_14ads_196",Uue="_inputBase_14ads_196",Wue="_iconPrefix_14ads_292",Gue="_iconSuffix_14ads_293",Kue="_passwordToggle_14ads_319",Zue="_fieldError_14ads_365",Xue="_fieldInvalid_14ads_372",ye={formContainer:wue,headerLine:Cue,formTitle:Nue,formDescription:Sue,sectionTitle:jue,sectionHelp:$ue,fieldHelp:que,gridContainer:Aue,fieldGridItem:zue,sectionFull:Vue,formFooter:Pue,footerLeft:Tue,footerRight:Hue,cancelLink:Due,submitButton:Bue,fieldLabel:Rue,inputWrapper:Fue,inputInner:Eue,hasPrefix:Oue,inputBase:Uue,iconPrefix:Wue,iconSuffix:Gue,passwordToggle:Kue,fieldError:Zue,fieldInvalid:Xue},vq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=k.useState(!1),h=e.type==="password",l=e.attributes?.showPasswordToggle??!0,u=h?s?"text":"password":e.type,p=e.attributes?.iconComponent??(e.attributes?.icon?mt[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",m=f=>{n(f.target.value)};return o.jsxs("div",{className:ye.inputWrapper,children:[o.jsx("label",{className:`${ye.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${ye.inputInner} ${p&&y==="prefix"?ye.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:ye.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${ye.inputBase} ${i?ye.fieldInvalid:""}`,value:t??"",onChange:m,onBlur:c,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),h&&l&&o.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:ye.passwordToggle,onClick:()=>d(f=>!f),children:s?o.jsx(I1,{size:16}):o.jsx(b1,{size:16})}),p&&y==="suffix"&&!h&&o.jsx("span",{className:ye.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:ye.fieldError,children:i})]})},Yue="_fieldGroup_yb3zi_7",Jue="_fieldLabel_yb3zi_11",Que="_required_yb3zi_17",epe="_fieldInput_yb3zi_22",tpe="_fieldInvalid_yb3zi_40",ape="_fieldValid_yb3zi_44",npe="_fieldError_yb3zi_48",ope="_radioGroup_yb3zi_57",jt={fieldGroup:Yue,fieldLabel:Jue,required:Que,fieldInput:epe,fieldInvalid:tpe,fieldValid:ape,fieldError:npe,radioGroup:ope},vL=({field:e,children:t,error:n,touched:c})=>{const i=c&&n;return o.jsxs("div",{className:jt.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&o.jsx("label",{className:`${jt.fieldLabel} ${e.required?jt.required:""}`,children:e.label}),t,i&&o.jsx("span",{className:jt.fieldError,children:n})]})},Mq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,h=["form-control",jt.fieldInput,s?jt.fieldInvalid:"",d?jt.fieldValid:""].filter(Boolean).join(" ");return o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("textarea",{className:h,placeholder:e.placeholder,value:t||"",onChange:l=>n(l.target.value),onBlur:c,rows:4})})},cpe="_wrapper_117u4_1",ipe="_wrapperInvalid_117u4_15",rpe="_nativeSelect_117u4_19",spe="_display_117u4_30",dpe="_topLabel_117u4_37",lpe="_valueLine_117u4_45",hpe="_valuePlaceholder_117u4_53",upe="_valueActive_117u4_57",ppe="_caret_117u4_61",ype="_error_117u4_75",kpe="_optionStyle_117u4_89",Oe={wrapper:cpe,wrapperInvalid:ipe,nativeSelect:rpe,display:spe,topLabel:dpe,valueLine:lpe,valuePlaceholder:hpe,valueActive:upe,caret:ppe,error:ype,optionStyle:kpe},Uw=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=!!(r&&i),d=e.label||"",h=e.placeholder||"",l=e.options?.find(u=>String(u.value)===String(t))?.label??"";return o.jsxs("div",{className:`${Oe.wrapper} ${s?Oe.wrapperInvalid:""} ${t?Oe.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Oe.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:c,"aria-invalid":s,"aria-label":d,children:[o.jsx("option",{value:"",disabled:!0,hidden:!0,children:h||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>o.jsx("option",{value:u.value,className:Oe.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Oe.display,children:[d&&o.jsx("span",{className:Oe.topLabel,children:d}),o.jsx("span",{className:`${Oe.valueLine} ${t?Oe.valueActive:Oe.valuePlaceholder}`,children:t?l:h}),o.jsx("span",{className:Oe.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Oe.error,children:i})]})},xq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),_q=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("div",{className:jt.radioGroup,children:e.options?.map(s=>o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"radio",className:"form-check-input",id:`${e.name}-${s.value}`,name:e.name,value:s.value,checked:t===s.value,onChange:d=>n(d.target.value),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),mpe="_fileInputContainer_r2guc_3",fpe="_customFileInput_r2guc_8",gpe="_fileInputLabel_r2guc_12",vpe="_dragOver_r2guc_39",Mpe="_uploadIcon_r2guc_44",xpe="_uploadText_r2guc_50",_pe="_uploadHint_r2guc_56",Lpe="_fileList_r2guc_60",Ipe="_fileListTitle_r2guc_69",bpe="_fileItem_r2guc_80",wpe="_fileIcon_r2guc_96",Cpe="_fileName_r2guc_102",Npe="_fileSize_r2guc_108",Spe="_removeButton_r2guc_114",jpe="_errorText_r2guc_129",qe={fileInputContainer:mpe,customFileInput:fpe,fileInputLabel:gpe,dragOver:vpe,uploadIcon:Mpe,uploadText:xpe,uploadHint:_pe,fileList:Lpe,fileListTitle:Ipe,fileItem:bpe,fileIcon:wpe,fileName:Cpe,fileSize:Npe,removeButton:Spe,errorText:jpe},Lq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=k.useRef(null),[d,h]=k.useState(!1),l=M=>{n(M.target.files)},u=()=>{s.current&&s.current.click()},p=M=>{M.preventDefault(),h(!0)},y=()=>{h(!1)},m=M=>{M.preventDefault(),h(!1),M.dataTransfer.files&&M.dataTransfer.files.length>0&&n(M.dataTransfer.files)},f=M=>{if(!t)return;const x=Array.from(t);x.splice(M,1);const v=new DataTransfer;x.forEach(L=>v.items.add(L)),n(v.files)},g=M=>{if(M===0)return"0 Bytes";const x=1024,v=["Bytes","KB","MB","GB"],L=Math.floor(Math.log(M)/Math.log(x));return parseFloat((M/Math.pow(x,L)).toFixed(2))+" "+v[L]};return o.jsxs("div",{className:`${qe.fileInputContainer} ${r&&i?qe.hasError:""}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:l,onBlur:c,ref:s,className:qe.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${qe.fileInputLabel} ${d?qe.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:m,onClick:u,tabIndex:0,children:[o.jsx("div",{className:qe.uploadIcon,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),o.jsx("path",{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"})]})}),o.jsx("div",{className:qe.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:qe.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:qe.fileList,children:[o.jsx("div",{className:qe.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((M,x)=>o.jsxs("li",{className:qe.fileItem,children:[o.jsx("div",{className:qe.fileIcon,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:o.jsx("path",{d:"M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3z"})})}),o.jsx("div",{className:qe.fileName,children:M.name}),o.jsx("div",{className:qe.fileSize,children:g(M.size)}),o.jsx("button",{type:"button",className:qe.removeButton,onClick:v=>{v.stopPropagation(),f(x)},"aria-label":`Supprimer ${M.name}`,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"}),o.jsx("path",{fillRule:"evenodd",d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"})]})})]},x))})]}),r&&i&&o.jsx("div",{className:qe.errorText,children:i})]})},$pe="_container_ecah4_2",qpe="_label_ecah4_6",Ape="_requiredIndicator_ecah4_13",zpe="_input_ecah4_18",Vpe="_inputError_ecah4_49",Ppe="_errorMessage_ecah4_58",Rc={container:$pe,label:qpe,requiredIndicator:Ape,input:zpe,inputError:Vpe,errorMessage:Ppe},Iq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r,labelColor:s="black",backgroundColor:d="white"})=>{const h=e.type==="month"?"month":e.type==="week"?"week":e.type==="time"?"time":e.type==="datetime-local"?"datetime-local":"date";return o.jsxs("div",{className:Rc.container,children:[o.jsxs("label",{htmlFor:e.name,className:Rc.label,style:{color:s},children:[e.label,e.required&&o.jsx("span",{className:Rc.requiredIndicator,children:"*"})]}),o.jsx("input",{type:h,id:e.name,name:e.name,value:t||"",onChange:l=>n(l.target.value),onBlur:c,className:`${Rc.input} ${r&&i?Rc.inputError:""}`,style:{color:s,backgroundColor:d},min:e.validation?.min,max:e.validation?.max,step:e.type==="time"?e.attributes?.step:void 0,disabled:e.disabled}),r&&i&&o.jsx("div",{className:Rc.errorMessage,children:i})]})},Tpe="_rangeContainer_cyqk3_3",Hpe={rangeContainer:Tpe},bq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${Hpe.rangeContainer}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:c,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Dpe="_colorPickerContainer_1wxgj_2",Bpe="_colorInput_1wxgj_19",Rpe="_colorValue_1wxgj_39",QL={colorPickerContainer:Dpe,colorInput:Bpe,colorValue:Rpe},wq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:"mb-3",children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsxs("div",{className:QL.colorPickerContainer,children:[o.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:c,className:QL.colorInput}),o.jsx("span",{className:QL.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Cq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return o.jsx(Lq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(Iq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(bq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(wq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(Mq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(Uw,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(xq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(_q,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(vq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var eI,xN;function Fpe(){if(xN)return eI;xN=1;function e(){this.__data__=[],this.size=0}return eI=e,eI}var tI,_N;function Nq(){if(_N)return tI;_N=1;function e(t,n){return t===n||t!==t&&n!==n}return tI=e,tI}var aI,LN;function ML(){if(LN)return aI;LN=1;var e=Nq();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return aI=t,aI}var nI,IN;function Epe(){if(IN)return nI;IN=1;var e=ML(),t=Array.prototype,n=t.splice;function c(i){var r=this.__data__,s=e(r,i);if(s<0)return!1;var d=r.length-1;return s==d?r.pop():n.call(r,s,1),--this.size,!0}return nI=c,nI}var oI,bN;function Ope(){if(bN)return oI;bN=1;var e=ML();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return oI=t,oI}var cI,wN;function Upe(){if(wN)return cI;wN=1;var e=ML();function t(n){return e(this.__data__,n)>-1}return cI=t,cI}var iI,CN;function Wpe(){if(CN)return iI;CN=1;var e=ML();function t(n,c){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,c])):i[r][1]=c,this}return iI=t,iI}var rI,NN;function xL(){if(NN)return rI;NN=1;var e=Fpe(),t=Epe(),n=Ope(),c=Upe(),i=Wpe();function r(s){var d=-1,h=s==null?0:s.length;for(this.clear();++d<h;){var l=s[d];this.set(l[0],l[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,rI=r,rI}var sI,SN;function Gpe(){if(SN)return sI;SN=1;var e=xL();function t(){this.__data__=new e,this.size=0}return sI=t,sI}var dI,jN;function Kpe(){if(jN)return dI;jN=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return dI=e,dI}var lI,$N;function Zpe(){if($N)return lI;$N=1;function e(t){return this.__data__.get(t)}return lI=e,lI}var hI,qN;function Xpe(){if(qN)return hI;qN=1;function e(t){return this.__data__.has(t)}return hI=e,hI}var uI,AN;function Sq(){if(AN)return uI;AN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return uI=e,uI}var pI,zN;function Mt(){if(zN)return pI;zN=1;var e=Sq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return pI=n,pI}var yI,VN;function Ww(){if(VN)return yI;VN=1;var e=Mt(),t=e.Symbol;return yI=t,yI}var kI,PN;function Ype(){if(PN)return kI;PN=1;var e=Ww(),t=Object.prototype,n=t.hasOwnProperty,c=t.toString,i=e?e.toStringTag:void 0;function r(s){var d=n.call(s,i),h=s[i];try{s[i]=void 0;var l=!0}catch{}var u=c.call(s);return l&&(d?s[i]=h:delete s[i]),u}return kI=r,kI}var mI,TN;function Jpe(){if(TN)return mI;TN=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return mI=n,mI}var fI,HN;function _L(){if(HN)return fI;HN=1;var e=Ww(),t=Ype(),n=Jpe(),c="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:c:r&&r in Object(d)?t(d):n(d)}return fI=s,fI}var gI,DN;function jq(){if(DN)return gI;DN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return gI=e,gI}var vI,BN;function $q(){if(BN)return vI;BN=1;var e=_L(),t=jq(),n="[object AsyncFunction]",c="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var h=e(d);return h==c||h==i||h==n||h==r}return vI=s,vI}var MI,RN;function Qpe(){if(RN)return MI;RN=1;var e=Mt(),t=e["__core-js_shared__"];return MI=t,MI}var xI,FN;function eye(){if(FN)return xI;FN=1;var e=Qpe(),t=function(){var c=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}();function n(c){return!!t&&t in c}return xI=n,xI}var _I,EN;function qq(){if(EN)return _I;EN=1;var e=Function.prototype,t=e.toString;function n(c){if(c!=null){try{return t.call(c)}catch{}try{return c+""}catch{}}return""}return _I=n,_I}var LI,ON;function tye(){if(ON)return LI;ON=1;var e=$q(),t=eye(),n=jq(),c=qq(),i=/[\\^$.*+?()[\]{}|]/g,r=/^\[object .+?Constructor\]$/,s=Function.prototype,d=Object.prototype,h=s.toString,l=d.hasOwnProperty,u=RegExp("^"+h.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var m=e(y)?u:r;return m.test(c(y))}return LI=p,LI}var II,UN;function aye(){if(UN)return II;UN=1;function e(t,n){return t?.[n]}return II=e,II}var bI,WN;function r1(){if(WN)return bI;WN=1;var e=tye(),t=aye();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return bI=n,bI}var wI,GN;function Gw(){if(GN)return wI;GN=1;var e=r1(),t=Mt(),n=e(t,"Map");return wI=n,wI}var CI,KN;function LL(){if(KN)return CI;KN=1;var e=r1(),t=e(Object,"create");return CI=t,CI}var NI,ZN;function nye(){if(ZN)return NI;ZN=1;var e=LL();function t(){this.__data__=e?e(null):{},this.size=0}return NI=t,NI}var SI,XN;function oye(){if(XN)return SI;XN=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return SI=e,SI}var jI,YN;function cye(){if(YN)return jI;YN=1;var e=LL(),t="__lodash_hash_undefined__",n=Object.prototype,c=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return c.call(s,r)?s[r]:void 0}return jI=i,jI}var $I,JN;function iye(){if(JN)return $I;JN=1;var e=LL(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return $I=c,$I}var qI,QN;function rye(){if(QN)return qI;QN=1;var e=LL(),t="__lodash_hash_undefined__";function n(c,i){var r=this.__data__;return this.size+=this.has(c)?0:1,r[c]=e&&i===void 0?t:i,this}return qI=n,qI}var AI,eS;function sye(){if(eS)return AI;eS=1;var e=nye(),t=oye(),n=cye(),c=iye(),i=rye();function r(s){var d=-1,h=s==null?0:s.length;for(this.clear();++d<h;){var l=s[d];this.set(l[0],l[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,AI=r,AI}var zI,tS;function dye(){if(tS)return zI;tS=1;var e=sye(),t=xL(),n=Gw();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return zI=c,zI}var VI,aS;function lye(){if(aS)return VI;aS=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return VI=e,VI}var PI,nS;function IL(){if(nS)return PI;nS=1;var e=lye();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return PI=t,PI}var TI,oS;function hye(){if(oS)return TI;oS=1;var e=IL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return TI=t,TI}var HI,cS;function uye(){if(cS)return HI;cS=1;var e=IL();function t(n){return e(this,n).get(n)}return HI=t,HI}var DI,iS;function pye(){if(iS)return DI;iS=1;var e=IL();function t(n){return e(this,n).has(n)}return DI=t,DI}var BI,rS;function yye(){if(rS)return BI;rS=1;var e=IL();function t(n,c){var i=e(this,n),r=i.size;return i.set(n,c),this.size+=i.size==r?0:1,this}return BI=t,BI}var RI,sS;function Aq(){if(sS)return RI;sS=1;var e=dye(),t=hye(),n=uye(),c=pye(),i=yye();function r(s){var d=-1,h=s==null?0:s.length;for(this.clear();++d<h;){var l=s[d];this.set(l[0],l[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,RI=r,RI}var FI,dS;function kye(){if(dS)return FI;dS=1;var e=xL(),t=Gw(),n=Aq(),c=200;function i(r,s){var d=this.__data__;if(d instanceof e){var h=d.__data__;if(!t||h.length<c-1)return h.push([r,s]),this.size=++d.size,this;d=this.__data__=new n(h)}return d.set(r,s),this.size=d.size,this}return FI=i,FI}var EI,lS;function mye(){if(lS)return EI;lS=1;var e=xL(),t=Gpe(),n=Kpe(),c=Zpe(),i=Xpe(),r=kye();function s(d){var h=this.__data__=new e(d);this.size=h.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=c,s.prototype.has=i,s.prototype.set=r,EI=s,EI}var OI,hS;function fye(){if(hS)return OI;hS=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return OI=t,OI}var UI,uS;function gye(){if(uS)return UI;uS=1;function e(t){return this.__data__.has(t)}return UI=e,UI}var WI,pS;function vye(){if(pS)return WI;pS=1;var e=Aq(),t=fye(),n=gye();function c(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return c.prototype.add=c.prototype.push=t,c.prototype.has=n,WI=c,WI}var GI,yS;function Mye(){if(yS)return GI;yS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length;++c<i;)if(n(t[c],c,t))return!0;return!1}return GI=e,GI}var KI,kS;function xye(){if(kS)return KI;kS=1;function e(t,n){return t.has(n)}return KI=e,KI}var ZI,mS;function zq(){if(mS)return ZI;mS=1;var e=vye(),t=Mye(),n=xye(),c=1,i=2;function r(s,d,h,l,u,p){var y=h&c,m=s.length,f=d.length;if(m!=f&&!(y&&f>m))return!1;var g=p.get(s),M=p.get(d);if(g&&M)return g==d&&M==s;var x=-1,v=!0,L=h&i?new e:void 0;for(p.set(s,d),p.set(d,s);++x<m;){var w=s[x],C=d[x];if(l)var b=y?l(C,w,x,d,s,p):l(w,C,x,s,d,p);if(b!==void 0){if(b)continue;v=!1;break}if(L){if(!t(d,function(_,I){if(!n(L,I)&&(w===_||u(w,_,h,l,p)))return L.push(I)})){v=!1;break}}else if(!(w===C||u(w,C,h,l,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return ZI=r,ZI}var XI,fS;function _ye(){if(fS)return XI;fS=1;var e=Mt(),t=e.Uint8Array;return XI=t,XI}var YI,gS;function Lye(){if(gS)return YI;gS=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return YI=e,YI}var JI,vS;function Iye(){if(vS)return JI;vS=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return JI=e,JI}var QI,MS;function bye(){if(MS)return QI;MS=1;var e=Ww(),t=_ye(),n=Nq(),c=zq(),i=Lye(),r=Iye(),s=1,d=2,h="[object Boolean]",l="[object Date]",u="[object Error]",p="[object Map]",y="[object Number]",m="[object RegExp]",f="[object Set]",g="[object String]",M="[object Symbol]",x="[object ArrayBuffer]",v="[object DataView]",L=e?e.prototype:void 0,w=L?L.valueOf:void 0;function C(b,_,I,j,N,S,A){switch(I){case v:if(b.byteLength!=_.byteLength||b.byteOffset!=_.byteOffset)return!1;b=b.buffer,_=_.buffer;case x:return!(b.byteLength!=_.byteLength||!S(new t(b),new t(_)));case h:case l:case y:return n(+b,+_);case u:return b.name==_.name&&b.message==_.message;case m:case g:return b==_+"";case p:var B=i;case f:var T=j&s;if(B||(B=r),b.size!=_.size&&!T)return!1;var V=A.get(b);if(V)return V==_;j|=d,A.set(b,_);var $=c(B(b),B(_),j,N,S,A);return A.delete(b),$;case M:if(w)return w.call(b)==w.call(_)}return!1}return QI=C,QI}var eb,xS;function wye(){if(xS)return eb;xS=1;function e(t,n){for(var c=-1,i=n.length,r=t.length;++c<i;)t[r+c]=n[c];return t}return eb=e,eb}var tb,_S;function Kw(){if(_S)return tb;_S=1;var e=Array.isArray;return tb=e,tb}var ab,LS;function Cye(){if(LS)return ab;LS=1;var e=wye(),t=Kw();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return ab=n,ab}var nb,IS;function Nye(){if(IS)return nb;IS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length,r=0,s=[];++c<i;){var d=t[c];n(d,c,t)&&(s[r++]=d)}return s}return nb=e,nb}var ob,bS;function Sye(){if(bS)return ob;bS=1;function e(){return[]}return ob=e,ob}var cb,wS;function jye(){if(wS)return cb;wS=1;var e=Nye(),t=Sye(),n=Object.prototype,c=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return c.call(s,d)}))}:t;return cb=r,cb}var ib,CS;function $ye(){if(CS)return ib;CS=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return ib=e,ib}var rb,NS;function bL(){if(NS)return rb;NS=1;function e(t){return t!=null&&typeof t=="object"}return rb=e,rb}var sb,SS;function qye(){if(SS)return sb;SS=1;var e=_L(),t=bL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return sb=c,sb}var db,jS;function Aye(){if(jS)return db;jS=1;var e=qye(),t=bL(),n=Object.prototype,c=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&c.call(s,"callee")&&!i.call(s,"callee")};return db=r,db}var m1={exports:{}},lb,$S;function zye(){if($S)return lb;$S=1;function e(){return!1}return lb=e,lb}m1.exports;var qS;function Vq(){return qS||(qS=1,function(e,t){var n=Mt(),c=zye(),i=t&&!t.nodeType&&t,r=i&&!0&&e&&!e.nodeType&&e,s=r&&r.exports===i,d=s?n.Buffer:void 0,h=d?d.isBuffer:void 0,l=h||c;e.exports=l}(m1,m1.exports)),m1.exports}var hb,AS;function Vye(){if(AS)return hb;AS=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(c,i){var r=typeof c;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(c))&&c>-1&&c%1==0&&c<i}return hb=n,hb}var ub,zS;function Pq(){if(zS)return ub;zS=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return ub=t,ub}var pb,VS;function Pye(){if(VS)return pb;VS=1;var e=_L(),t=Pq(),n=bL(),c="[object Arguments]",i="[object Array]",r="[object Boolean]",s="[object Date]",d="[object Error]",h="[object Function]",l="[object Map]",u="[object Number]",p="[object Object]",y="[object RegExp]",m="[object Set]",f="[object String]",g="[object WeakMap]",M="[object ArrayBuffer]",x="[object DataView]",v="[object Float32Array]",L="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",I="[object Uint8ClampedArray]",j="[object Uint16Array]",N="[object Uint32Array]",S={};S[v]=S[L]=S[w]=S[C]=S[b]=S[_]=S[I]=S[j]=S[N]=!0,S[c]=S[i]=S[M]=S[r]=S[x]=S[s]=S[d]=S[h]=S[l]=S[u]=S[p]=S[y]=S[m]=S[f]=S[g]=!1;function A(B){return n(B)&&t(B.length)&&!!S[e(B)]}return pb=A,pb}var yb,PS;function Tye(){if(PS)return yb;PS=1;function e(t){return function(n){return t(n)}}return yb=e,yb}var f1={exports:{}};f1.exports;var TS;function Hye(){return TS||(TS=1,function(e,t){var n=Sq(),c=t&&!t.nodeType&&t,i=c&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===c,s=r&&n.process,d=function(){try{var h=i&&i.require&&i.require("util").types;return h||s&&s.binding&&s.binding("util")}catch{}}();e.exports=d}(f1,f1.exports)),f1.exports}var kb,HS;function Tq(){if(HS)return kb;HS=1;var e=Pye(),t=Tye(),n=Hye(),c=n&&n.isTypedArray,i=c?t(c):e;return kb=i,kb}var mb,DS;function Dye(){if(DS)return mb;DS=1;var e=$ye(),t=Aye(),n=Kw(),c=Vq(),i=Vye(),r=Tq(),s=Object.prototype,d=s.hasOwnProperty;function h(l,u){var p=n(l),y=!p&&t(l),m=!p&&!y&&c(l),f=!p&&!y&&!m&&r(l),g=p||y||m||f,M=g?e(l.length,String):[],x=M.length;for(var v in l)(u||d.call(l,v))&&!(g&&(v=="length"||m&&(v=="offset"||v=="parent")||f&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,x)))&&M.push(v);return M}return mb=h,mb}var fb,BS;function Bye(){if(BS)return fb;BS=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return fb=t,fb}var gb,RS;function Rye(){if(RS)return gb;RS=1;function e(t,n){return function(c){return t(n(c))}}return gb=e,gb}var vb,FS;function Fye(){if(FS)return vb;FS=1;var e=Rye(),t=e(Object.keys,Object);return vb=t,vb}var Mb,ES;function Eye(){if(ES)return Mb;ES=1;var e=Bye(),t=Fye(),n=Object.prototype,c=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))c.call(r,d)&&d!="constructor"&&s.push(d);return s}return Mb=i,Mb}var xb,OS;function Oye(){if(OS)return xb;OS=1;var e=$q(),t=Pq();function n(c){return c!=null&&t(c.length)&&!e(c)}return xb=n,xb}var _b,US;function Uye(){if(US)return _b;US=1;var e=Dye(),t=Eye(),n=Oye();function c(i){return n(i)?e(i):t(i)}return _b=c,_b}var Lb,WS;function Wye(){if(WS)return Lb;WS=1;var e=Cye(),t=jye(),n=Uye();function c(i){return e(i,n,t)}return Lb=c,Lb}var Ib,GS;function Gye(){if(GS)return Ib;GS=1;var e=Wye(),t=1,n=Object.prototype,c=n.hasOwnProperty;function i(r,s,d,h,l,u){var p=d&t,y=e(r),m=y.length,f=e(s),g=f.length;if(m!=g&&!p)return!1;for(var M=m;M--;){var x=y[M];if(!(p?x in s:c.call(s,x)))return!1}var v=u.get(r),L=u.get(s);if(v&&L)return v==s&&L==r;var w=!0;u.set(r,s),u.set(s,r);for(var C=p;++M<m;){x=y[M];var b=r[x],_=s[x];if(h)var I=p?h(_,b,x,s,r,u):h(b,_,x,r,s,u);if(!(I===void 0?b===_||l(b,_,d,h,u):I)){w=!1;break}C||(C=x=="constructor")}if(w&&!C){var j=r.constructor,N=s.constructor;j!=N&&"constructor"in r&&"constructor"in s&&!(typeof j=="function"&&j instanceof j&&typeof N=="function"&&N instanceof N)&&(w=!1)}return u.delete(r),u.delete(s),w}return Ib=i,Ib}var bb,KS;function Kye(){if(KS)return bb;KS=1;var e=r1(),t=Mt(),n=e(t,"DataView");return bb=n,bb}var wb,ZS;function Zye(){if(ZS)return wb;ZS=1;var e=r1(),t=Mt(),n=e(t,"Promise");return wb=n,wb}var Cb,XS;function Xye(){if(XS)return Cb;XS=1;var e=r1(),t=Mt(),n=e(t,"Set");return Cb=n,Cb}var Nb,YS;function Yye(){if(YS)return Nb;YS=1;var e=r1(),t=Mt(),n=e(t,"WeakMap");return Nb=n,Nb}var Sb,JS;function Jye(){if(JS)return Sb;JS=1;var e=Kye(),t=Gw(),n=Zye(),c=Xye(),i=Yye(),r=_L(),s=qq(),d="[object Map]",h="[object Object]",l="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",m=s(e),f=s(t),g=s(n),M=s(c),x=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=l||c&&v(new c)!=u||i&&v(new i)!=p)&&(v=function(L){var w=r(L),C=w==h?L.constructor:void 0,b=C?s(C):"";if(b)switch(b){case m:return y;case f:return d;case g:return l;case M:return u;case x:return p}return w}),Sb=v,Sb}var jb,QS;function Qye(){if(QS)return jb;QS=1;var e=mye(),t=zq(),n=bye(),c=Gye(),i=Jye(),r=Kw(),s=Vq(),d=Tq(),h=1,l="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,m=y.hasOwnProperty;function f(g,M,x,v,L,w){var C=r(g),b=r(M),_=C?u:i(g),I=b?u:i(M);_=_==l?p:_,I=I==l?p:I;var j=_==p,N=I==p,S=_==I;if(S&&s(g)){if(!s(M))return!1;C=!0,j=!1}if(S&&!j)return w||(w=new e),C||d(g)?t(g,M,x,v,L,w):n(g,M,_,x,v,L,w);if(!(x&h)){var A=j&&m.call(g,"__wrapped__"),B=N&&m.call(M,"__wrapped__");if(A||B){var T=A?g.value():g,V=B?M.value():M;return w||(w=new e),L(T,V,x,v,w)}}return S?(w||(w=new e),c(g,M,x,v,L,w)):!1}return jb=f,jb}var $b,ej;function e4e(){if(ej)return $b;ej=1;var e=Qye(),t=bL();function n(c,i,r,s,d){return c===i?!0:c==null||i==null||!t(c)&&!t(i)?c!==c&&i!==i:e(c,i,r,s,n,d)}return $b=n,$b}var qb,tj;function t4e(){if(tj)return qb;tj=1;var e=e4e();function t(n,c){return e(n,c)}return qb=t,qb}var a4e=t4e();const n4e=a.getDefaultExportFromCjs(a4e),o4e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:h})=>{const[l,u]=k.useState(t),[p,y]=k.useState({}),[m,f]=k.useState({}),[g,M]=k.useState(!1),x=k.useRef(t);k.useEffect(()=>{n4e(x.current,t)||(u(t),x.current=t)},[t]);const v=(I,j)=>{const N={...l,[I]:j};if(u(N),m[I]){const S=e.fields.find(A=>A.name===I);if(S){const A=hL(j,S);y(B=>({...B,[I]:A.isValid?"":A.error}))}}},L=I=>{if(!m[I]){f(N=>({...N,[I]:!0}));const j=e.fields.find(N=>N.name===I);if(j){const N=hL(l[I],j);y(S=>({...S,[I]:N.isValid?"":N.error}))}}},w=async I=>{I.preventDefault(),M(!0);const j=e.fields.reduce((S,A)=>(A.type!=="section"&&(S[A.name]=!0),S),{});f(j);const N=gq(l,e.fields.filter(S=>S.type!=="section"));if(y(N.errors),N.isValid)try{await n(l)}catch(S){console.error("Erreur lors de la soumission:",S),y(A=>({...A,__global:"Une erreur est survenue lors de la soumission"}))}M(!1)},C=h?mt[h]:null,b=i&&mt[i]||e.submitIcon&&mt[e.submitIcon]||null,_=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:ye.formContainer,children:[o.jsx("div",{className:ye.headerLine,children:o.jsx("h2",{className:ye.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:ye.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${ye.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:w,children:[o.jsx("div",{className:ye.gridContainer,style:{gridTemplateColumns:`repeat(${_}, minmax(0, 1fr))`},children:e.fields.map(I=>{if(I.type==="section")return o.jsxs("div",{className:ye.sectionFull,children:[o.jsx("h5",{className:ye.sectionTitle,children:I.label}),I.help&&o.jsx("p",{className:ye.sectionHelp,children:I.help})]},I.name);const N={gridColumn:`span ${Math.max(1,Math.min(_,I.gridCol??_))}`};return o.jsxs("div",{className:ye.fieldGridItem,style:N,children:[o.jsx(Cq,{field:I,value:l[I.name],onChange:S=>v(I.name,S),onBlur:()=>L(I.name),error:p[I.name],touched:m[I.name]}),I.help&&o.jsx("small",{className:ye.fieldHelp,children:I.help})]},I.name)})}),o.jsxs("div",{className:ye.formFooter,children:[o.jsx("div",{className:ye.footerLeft,children:s&&o.jsxs("button",{type:"button",className:ye.cancelLink,onClick:s,children:[C&&o.jsx(C,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:ye.footerRight,children:o.jsx(tL,{type:"submit",variant:"primary",size:"md",className:ye.submitButton,disabled:g,children:g?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[b&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(b,{size:16,className:"me-2"}),c||e.submitText||"Valider",b&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(b,{size:16,className:"ms-2"})]})})})]})]})]})};function c4e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const aj=new Map,i4e=({path:e,style:t,width:n=24,height:c=24,keepColors:i=!1,onClick:r})=>{const[s,d]=k.useState("");return k.useEffect(()=>{e&&(async()=>{try{let l=aj.get(e);l||(l=fetch(e).then(f=>{if(!f.ok)throw new Error(`Failed to load ${e}`);return f.text()}),aj.set(e,l));let u=await l;const p=t?.width||`${n}px`,y=t?.height||`${c}px`;i||(u=u.replace(/fill="[^"]*"/g,'fill="currentColor"'),u=u.replace(/fill='[^']*'/g,"fill='currentColor'"));const m=i?`width="${p}" height="${y}"`:`width="${p}" height="${y}" fill="currentColor"`;u=u.replace(/<svg/,`<svg ${m}`),d(u)}catch(l){console.error(`Failed to load icon: ${e}`,l)}})()},[e,t?.width,t?.height,n,c]),s?o.jsx("span",{onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t?.color||"inherit",...t},dangerouslySetInnerHTML:{__html:s}}):null},r4e="_container_1gljv_85",s4e="_tableWrapper_1gljv_111",d4e="_tableControls_1gljv_117",l4e="_controlsRight_1gljv_128",h4e="_limitedRows_1gljv_151",u4e="_table_1gljv_111",p4e="_headerCell_1gljv_206",y4e="_headerContent_1gljv_220",k4e="_headerWords_1gljv_229",m4e="_headerWord_1gljv_229",f4e="_cellContent_1gljv_276",g4e="_alignLeft_1gljv_286",v4e="_alignCenter_1gljv_290",M4e="_alignRight_1gljv_294",x4e="_tableCell_1gljv_298",_4e="_tableRow_1gljv_308",L4e="_emptyRow_1gljv_385",I4e="_toggleFiltersButton_1gljv_393",b4e="_toggleSortButton_1gljv_394",w4e="_buttonTextCompact_1gljv_415",C4e="_uppercaseSmall_1gljv_450",N4e="_filtersPanel_1gljv_463",S4e="_filtersPanelInline_1gljv_481",j4e="_filtersPanelHorizontal_1gljv_492",$4e="_filtersRow_1gljv_492",q4e="_filtersActionsHorizontal_1gljv_525",A4e="_filterItemInline_1gljv_542",z4e="_filterLabel_1gljv_571",V4e="_filterInput_1gljv_576",P4e="_filterSelect_1gljv_577",T4e="_operatorSelect_1gljv_578",H4e="_operatorInput_1gljv_579",D4e="_activeFilterTag_1gljv_597",B4e="_actionsGroup_1gljv_609",R4e="_applyButton_1gljv_615",F4e="_cancelButton_1gljv_625",E4e="_columnSorterContainer_1gljv_649",O4e="_sorterControls_1gljv_654",U4e="_sortDropdownWrapper_1gljv_659",W4e="_sortDropdown_1gljv_659",G4e="_sortDropdownHeader_1gljv_679",K4e="_closeButton_1gljv_688",Z4e="_sortDropdownContent_1gljv_703",X4e="_sortDropdownItem_1gljv_709",Y4e="_sortDirectionButtons_1gljv_734",J4e="_sortDirectionButton_1gljv_734",Q4e="_activeSort_1gljv_757",e5e="_sortActions_1gljv_764",t5e="_paginationButton_1gljv_842",a5e="_pageSizeSelect_1gljv_844",n5e="_topPagination_1gljv_853",o5e="_paginationContainer_1gljv_861",c5e="_leftGroup_1gljv_874",i5e="_pageSizeControls_1gljv_882",r5e="_paginationInfo_1gljv_908",s5e="_paginationControls_1gljv_916",d5e="_disabledButton_1gljv_947",l5e="_activeButton_1gljv_952",h5e="_navigationButton_1gljv_962",u5e="_operatorFilterContainer_1gljv_1010",p5e="_rangeSeparator_1gljv_1016",y5e="_activeFiltersSection_1gljv_1179",k5e="_activeFiltersRow_1gljv_1184",m5e="_activeFiltersList_1gljv_1192",f5e="_clearAllButton_1gljv_1200",g5e="_removeFilterButton_1gljv_1221",v5e="_sortIndicator_1gljv_1272",M5e="_active_1gljv_349",x5e="_clearSortButton_1gljv_1371",_5e="_loaderSpinner_1gljv_2743",L5e="_loaderSpinnerSmall_1gljv_2755",I5e="_paginationLoading_1gljv_2772",b5e="_loadingButton_1gljv_2780",w5e="_loadingIndicator_1gljv_2791",z={container:r4e,tableWrapper:s4e,tableControls:d4e,controlsRight:l4e,limitedRows:h4e,table:u4e,headerCell:p4e,headerContent:y4e,headerWords:k4e,headerWord:m4e,cellContent:f4e,alignLeft:g4e,alignCenter:v4e,alignRight:M4e,tableCell:x4e,tableRow:_4e,emptyRow:L4e,toggleFiltersButton:I4e,toggleSortButton:b4e,buttonTextCompact:w4e,uppercaseSmall:C4e,filtersPanel:N4e,filtersPanelInline:S4e,filtersPanelHorizontal:j4e,filtersRow:$4e,filtersActionsHorizontal:q4e,filterItemInline:A4e,filterLabel:z4e,filterInput:V4e,filterSelect:P4e,operatorSelect:T4e,operatorInput:H4e,activeFilterTag:D4e,actionsGroup:B4e,applyButton:R4e,cancelButton:F4e,columnSorterContainer:E4e,sorterControls:O4e,sortDropdownWrapper:U4e,sortDropdown:W4e,sortDropdownHeader:G4e,closeButton:K4e,sortDropdownContent:Z4e,sortDropdownItem:X4e,sortDirectionButtons:Y4e,sortDirectionButton:J4e,activeSort:Q4e,sortActions:e5e,paginationButton:t5e,pageSizeSelect:a5e,topPagination:n5e,paginationContainer:o5e,leftGroup:c5e,pageSizeControls:i5e,paginationInfo:r5e,paginationControls:s5e,disabledButton:d5e,activeButton:l5e,navigationButton:h5e,operatorFilterContainer:u5e,rangeSeparator:p5e,activeFiltersSection:y5e,activeFiltersRow:k5e,activeFiltersList:m5e,clearAllButton:f5e,removeFilterButton:g5e,sortIndicator:v5e,active:M5e,clearSortButton:x5e,loaderSpinner:_5e,loaderSpinnerSmall:L5e,paginationLoading:I5e,loadingButton:b5e,loadingIndicator:w5e},C5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:c,className:z.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),N5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:c,className:z.filterInput}),S5e=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState([]);k.useEffect(()=>{(async()=>{if(e.asyncOptions)try{const h=await e.asyncOptions();r(h??[])}catch(h){console.error("Erreur chargement options MultiSelect:",h),r([])}else r(e.options??[])})()},[e]);const s=d=>{const h=Array.from(d.target.selectedOptions,l=>l.value);n(h)};return o.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:c,className:z.filterMultiSelect,children:i.map((d,h)=>o.jsx("option",{value:String(d.value),children:d.label},h))})},nj=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState(t||""),s=d=>{const h=d.target.value===""?"":Number(d.target.value);r(h),n(h)};return o.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:z.filterInput})},j5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState([]),[s,d]=k.useState(!1);k.useEffect(()=>{(async()=>{if(e.asyncOptions){d(!0);try{const u=await e.asyncOptions();r(u)}catch(u){console.error("Error loading options:",u)}finally{d(!1)}}else r(e.options||[])})()},[e]);const h=l=>{const u=l.target.value;n(u)};return s?o.jsx("div",{children:"Chargement..."}):o.jsxs("select",{value:String(t||""),onChange:h,disabled:c,className:z.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(l=>o.jsx("option",{value:l.value,children:l.label},l.value))]})},$5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState("");k.useEffect(()=>{r(typeof t=="string"?t:String(t||""))},[t]);const s=d=>{const h=d.target.value;r(h),n(h)};return o.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:z.filterInput})},q5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState(t?.operator||""),[s,d]=k.useState(t?.value||"");k.useEffect(()=>{i&&s&&n({operator:i,value:s})},[i,s,n]);const h=u=>{r(u.target.value)},l=u=>{d(u.target.value)};return o.jsxs("div",{className:z.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:h,disabled:c,className:z.operatorSelect,children:[o.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>o.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),o.jsx("input",{type:"text",value:s,onChange:l,placeholder:"Valeur",disabled:c||!i,className:z.operatorInput})]})},A5e=({value:e,onChange:t,disabled:n})=>{const c=e||{},i=s=>{t({...c,start:s.target.value})},r=s=>{t({...c,end:s.target.value})};return o.jsxs("div",{className:z.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:z.filterInput}),o.jsx("span",{className:z.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:z.filterInput})]})},z5e=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx($5e,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(nj,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(nj,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(j5e,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(q5e,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(S5e,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(N5e,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx(A5e,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(C5e,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},Hq=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=k.useState([]),[d,h]=k.useState(()=>{const f={};return e.forEach(g=>{g.type==="daterange"?f[g.id]={start:"",end:""}:f[g.id]=g.defaultValue??""}),f});k.useEffect(()=>{if(!i)return;const f={...d??{}};e.forEach(g=>{g.id in f||(f[g.id]=g.type==="daterange"?{start:"",end:""}:g.defaultValue??"")}),(t||[]).forEach(g=>{!g||!g.id||(f[g.id]=g.value)}),h(f),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(f=>f.id))]);const l=i?t:r,u=k.useCallback((f,g)=>{h(M=>({...M,[f]:g}))},[]),p=k.useCallback(async()=>{const f=[],g={...d};for(const[M,x]of Object.entries(g)){const v=e.find(C=>C.id===M);if(!v)continue;let L=x;try{typeof x=="function"&&(L=await x(g)),typeof v.executeOnApply=="function"&&(L=await v.executeOnApply(L,g))}catch{continue}if(v.type==="daterange"){const C=L?.start??"",b=L?.end??"",_=typeof C=="string"?C.trim()==="":!C,I=typeof b=="string"?b.trim()==="":!b;if(_&&I)continue}L==null||typeof L=="string"&&L.trim()===""||Array.isArray(L)&&L.length===0||typeof L=="object"&&!Array.isArray(L)&&Object.keys(L).length===0||f.push({id:M,type:v.type,value:L,label:v.label})}return i?n?.(f):(s(f),c?.(f)),f},[d,e,i,n,c]),y=k.useCallback(f=>{h(g=>({...g,[f]:void 0})),u(f,void 0)},[u]),m=k.useCallback(()=>{const f={};e.forEach(g=>{g.type==="daterange"?f[g.id]={start:"",end:""}:f[g.id]=g.defaultValue??""}),h(f),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:l,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:m}},V5e=(e,t)=>{if(e==null)return!1;const n=t.value;if(n==null)return!1;switch(t.type){case"text":case"search":return String(e).toLowerCase().includes(String(n).toLowerCase());case"number":case"range":return Number(e)===Number(n);case"select":case"multiselect":return Array.isArray(n)?n.includes(e)||n.map(c=>String(c)).includes(String(e)):String(e)===String(n);case"boolean":return!!e==!!n;case"date":return new Date(e).getTime()===new Date(String(n)).getTime();case"daterange":try{if(!n||typeof n!="object")return!1;const c=n;if(!c.start||!c.end)return!1;const i=c.start,r=c.end;if(typeof i!="string"||typeof r!="string"||!i.trim()||!r.trim())return!1;const s=new Date(e).getTime(),d=new Date(i).getTime(),h=new Date(r).getTime();return isNaN(s)||isNaN(d)||isNaN(h)?!1:s>=d&&s<=h}catch(c){return console.error("Error processing daterange filter:",c),!1}case"operator":if(typeof n=="object"&&n!==null){const c=n;if(!("operator"in c)||!("value"in c))return!1;const{operator:i,value:r}=c,s=Number(e),d=Number(r);if(isNaN(s)||isNaN(d))return String(e).includes(String(r));switch(i){case"equals":return s===d;case"gt":return s>d;case"lt":return s<d;case"gte":return s>=d;case"lte":return s<=d;default:return String(e).includes(String(r))}}return!1;default:return String(e).toLowerCase().includes(String(n).toLowerCase())}};function Dq(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),h=(n||"").trim().toLowerCase(),l=k.useMemo(()=>{let g=e;return h&&(g=g.filter(M=>t.some(x=>{const v=M.data[x.id];return v==null?!1:String(v).toLowerCase().includes(h)}))),s.length>0&&(g=g.filter(M=>s.every(x=>{try{const v=M.data[x.id];return V5e(v,x)}catch(v){return console.error("Error applying filter:",v),!1}}))),g},[e,t,h,s]),u=k.useMemo(()=>{if(!c?.key)return l;const g=c.key;return[...l].sort((M,x)=>{const v=M.data[g],L=x.data[g];if(v==null)return 1;if(L==null)return-1;if(typeof v=="number"&&typeof L=="number")return c.direction==="desc"?L-v:v-L;if(v instanceof Date&&L instanceof Date){const C=v.getTime()-L.getTime();return c.direction==="desc"?-C:C}const w=String(v).localeCompare(String(L),void 0,{numeric:!0,sensitivity:"base"});return c.direction==="desc"?-w:w})},[l,c]),p=u,y=Math.ceil(u.length/d),m=0,f=Math.min(i*d,u.length);return{paginatedData:p,sortedData:u,filteredData:l,totalPages:y,startIndex:m,endIndex:f}}const Bq=({value:e})=>e,Rq=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),Fq=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),Eq=({value:e})=>{if(!e)return null;const t={success:"success-badge",warning:"warning-badge",error:"error-badge",info:"info-badge",default:"default-badge"},n=typeof e=="object"?e.type:"default",c=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},c)},Oq=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},Uq=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),Wq=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),Gq=({value:e})=>k.createElement("div",{className:"image-container"},k.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),sw={renderers:{text:Bq,email:Rq,link:Fq,badge:Eq,date:Oq,number:Uq,currency:Wq,image:Gq},icons:{sortAsc:k.createElement(jc,{className:"sort-icon active",size:14}),sortDesc:k.createElement(qt,{className:"sort-icon active",size:14}),sortDefault:k.createElement(Yc,{className:"sort-icon",size:14})}},P5e=(e,t)=>{sw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),sw.renderers[e]=t},T5e=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1,debounceTimeout:r=300,expanded:s,onToggle:d,panelPlacement:h="top",onPanelHeightChange:l,label:u="Advanced-Filters",applyLabel:p="Apply",cancelLabel:y="Cancel",clearLabel:m="Clear",applyDisabled:f=!1,loading:g=!1})=>{const[M,x]=k.useState(!1),v=typeof s=="boolean"?s:M,{appliedFilters:L,tempFilters:w,updateFilter:C,applyFilters:b,clearAllFilters:_}=Hq({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),I=k.useRef(null),j=k.useRef(null);k.useEffect(()=>{if(v&&I.current){const V=I.current.getBoundingClientRect().height;l?.(V)}else l?.(0)},[v,e,w,l]);const N=()=>{typeof s=="boolean"?d?.(!s):x(V=>{const $=!V;return d?.($),$})},S=()=>e.map(V=>{const $=w?.[V.id];return $==null||typeof $=="string"&&$.trim()===""?null:{id:V.id,label:V.label,value:$}}).filter(Boolean),A=async()=>{let V;try{V=await b()}catch{V=void 0}let $=[];V&&Array.isArray(V)&&V.length>0?$=V:L&&L.length>0?$=L:$=S(),n?.($),c?.($)},B=()=>{d?.(!1),typeof s!="boolean"&&x(!1)},T=()=>{_(),n?.([]),c?.([])};return k.useEffect(()=>{const V=q=>{v&&j.current&&(j.current.contains(q.target)||(d?.(!1),typeof s!="boolean"&&x(!1)))},$=q=>{q.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&x(!1))};return v&&(document.addEventListener("pointerdown",V),document.addEventListener("keydown",$)),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("keydown",$)}},[v,s,d]),o.jsxs("div",{className:z.advancedFiltersContainer,ref:j,children:[o.jsxs("button",{className:`${z.toggleFiltersButton} ${L.length>0?z.active:""} ${v?z.toggleFiltersButtonOpen:""} ${g?z.loadingButton:""}`,onClick:N,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:g,children:[g?o.jsx("span",{className:z.loaderSpinnerSmall}):o.jsx(wt,{size:14}),o.jsx("span",{className:z.buttonTextCompact,children:u}),L.length>0&&!g&&o.jsx("span",{className:z.filterCountBadge,"aria-hidden":!0,children:L.length}),g&&o.jsx("span",{className:z.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:I,className:`${z.filtersPanel} ${h==="top"?`${z.filtersPanelInline} ${z.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:z.filtersRow,children:e.map(V=>o.jsxs("div",{className:`${z.filterItem} ${z.filterItemInline}`,children:[o.jsxs("label",{className:z.filterLabel,children:[V.label,V.required&&o.jsx("span",{className:z.required,children:"*"})]}),o.jsx(z5e,{config:V,value:w[V.id],onChange:$=>C(V.id,$),disabled:V.disabled})]},V.id))}),o.jsxs("div",{className:z.filtersActionsHorizontal,children:[o.jsx("div",{className:z.activeFiltersSection,children:L.length>0&&o.jsxs("div",{className:z.activeFiltersRow,children:[o.jsx("span",{className:z.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:z.activeFiltersList,children:L.map(V=>o.jsxs("div",{className:z.activeFilterTag,children:[V.label??V.id,o.jsx("button",{className:z.removeFilterButton,onClick:()=>C(V.id,void 0),"aria-label":`Supprimer ${V.id}`,type:"button",children:"×"})]},V.id))}),o.jsxs("button",{className:z.clearAllButton,onClick:T,type:"button",children:[o.jsx(Ke,{size:12})," ",m]})]})}),o.jsxs("div",{className:z.actionsGroup,children:[o.jsx("button",{className:z.cancelButton,onClick:B,type:"button",disabled:g,children:y}),o.jsx("button",{className:`${z.applyButton} ${g?z.loadingButton:""}`,onClick:A,type:"button",disabled:f||g,"aria-disabled":f||g,children:g?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:z.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},oj=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},H5e=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=k.useState(!1),d=e.filter(f=>f.sortable),h=k.useRef(null),l=t?.key!==null&&t?.key!==void 0,u=(f,g)=>{n({key:f,direction:g}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(f=>!f),m=()=>{s(!1)};return k.useEffect(()=>{if(!r)return;const f=M=>{if(!h.current)return;const x=M.target;x&&!h.current.contains(x)&&s(!1)},g=M=>{M.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",f),document.addEventListener("keydown",g),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",g)}},[r]),k.useEffect(()=>{const f=document.querySelector("[data-table-wrapper]");if(!f)return;const g=f.style.overflow??"";return r?f.style.overflow="hidden":f.style.overflow=g,()=>{f.style.overflow=g}},[r]),o.jsx("div",{className:z.columnSorterContainer,ref:h,children:o.jsx("div",{className:z.sorterControls,children:d.length>0&&o.jsxs("div",{className:z.sortDropdownWrapper,ref:h,children:[o.jsxs("button",{className:`${z.toggleSortButton} ${r?z.toggleSortButtonOpen:""} ${l?z.active:""} ${i?z.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:z.loaderSpinnerSmall}):o.jsx(Yc,{size:14}),o.jsx("span",{className:`${z.buttonTextCompact} ${oj(c)?z.uppercaseSmall:""}`,children:c}),l&&!i&&o.jsx("div",{className:z.sortIndicator,children:t?.direction==="asc"?o.jsx(jc,{size:12}):o.jsx(qt,{size:12})})]}),r&&o.jsxs("div",{className:`${z.sortDropdown} ${z.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:z.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:z.closeButton,onClick:m,"aria-label":"Fermer",type:"button",children:o.jsx(Ke,{size:16})})]}),o.jsx("div",{className:z.sortDropdownContent,children:d.map(f=>{const g=String(f.label??f.id),M=oj(g);return o.jsxs("div",{className:z.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:x=>{x.key==="Enter"&&u(f.id,"asc")},children:[o.jsx("span",{className:`${z.columnSorterLabel} ${M?z.uppercaseSmall:""}`,title:g,"aria-label":g,children:g}),o.jsxs("div",{className:z.sortDirectionButtons,children:[o.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===f.id&&t?.direction==="asc"?z.activeSort:""}`,onClick:()=>u(f.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(jc,{size:12})}),o.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===f.id&&t?.direction==="desc"?z.activeSort:""}`,onClick:()=>u(f.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:o.jsx(qt,{size:12})})]})]},f.id)})}),l&&o.jsx("div",{className:z.sortActions,children:o.jsxs("button",{className:z.clearSortButton,onClick:p,type:"button",children:[o.jsx(bt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},D5e=({currentPage:e,totalPages:t,pageSize:n,totalItems:c,itemLabel:i="items",onPageChange:r,onPageSizeChange:s,loading:d=!1})=>{const h=Math.max(1,Math.floor(t)),l=Math.min(Math.max(1,Math.floor(e)),h),u=()=>{l>1&&r(l-1)},p=()=>{if(l<t){const g=l+1;r(g)}},y=c>0?(l-1)*n+1:0,m=c>0?Math.min(l*n,c):0,f=()=>{const g=[];let x=Math.max(1,l-Math.floor(2.5)),v=x+5-1;v>h&&(v=h,x=Math.max(1,v-5+1));for(let L=x;L<=v;L++)g.push(L);return g};return o.jsxs("div",{className:z.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:z.leftGroup,children:s&&o.jsx("div",{className:z.pageSizeControls,children:o.jsx("select",{value:n,onChange:g=>s(Number(g.target.value)),className:z.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(g=>o.jsx("option",{value:g,children:g},g))})})}),o.jsx("div",{className:z.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:z.paginationLoading,children:[o.jsx("span",{className:z.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${m} ${i}`}),o.jsxs("div",{className:z.paginationControls,children:[o.jsx("button",{onClick:u,disabled:l===1||d,className:`${z.paginationButton} ${z.navigationButton} ${l===1?z.disabledButton:""} ${d?z.loadingButton:""}`,"aria-label":"Page précédente",children:d&&l>1?o.jsx("span",{className:z.loaderSpinnerSmall}):"«"}),f().map(g=>o.jsx("button",{onClick:()=>r(g),disabled:d,"aria-current":l===g?"page":void 0,className:`${z.paginationButton} ${l===g?z.activeButton:""} ${d?z.loadingButton:""}`,children:d&&l===g?o.jsx("span",{className:z.loaderSpinnerSmall}):g},g)),o.jsx("button",{onClick:p,disabled:d||l>=h,className:`${z.paginationButton} ${z.navigationButton} ${d?z.loadingButton:""} ${l>=h?z.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:z.loaderSpinnerSmall}):"»"})]})]})},B5e=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const c=n.toLowerCase();return c.charAt(0).toUpperCase()+c.slice(1)},R5e=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},F5e=({columns:e})=>o.jsx("thead",{className:z.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?z.alignRight:t.align==="left"?z.alignLeft:z.alignCenter,i=t.preserveHeaderCase===!0,r=B5e(String(t.label??""),i),s=R5e(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${z.headerCell} ${c}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",title:t.a11yConfig?.mode==="guide"?t.a11yConfig.description:t.a11yConfig?.mode==="key"?t.a11yConfig.key:void 0,children:o.jsx("div",{className:z.headerContent,children:s?o.jsx("div",{className:z.headerWords,children:d.map((h,l)=>o.jsx("span",{className:z.headerWord,children:h},l))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),E5e=({value:e,row:t,column:n})=>{const c=n.align==="right"?z.alignRight:n.align==="left"?z.alignLeft:z.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${z.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:z.cellContent,children:i})})},O5e=({row:e,rowId:t,columns:n,onRowClick:c,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:h,...l}=s||{},u={backgroundColor:d,...l,"--row-accent":h??"transparent"};return o.jsx("tr",{className:`${z.tableRow} ${c?z.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(E5e,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},U5e=({data:e,columns:t,onRowClick:n,startIndex:c,searchTerm:i,getRowStyle:r})=>e.length===0?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,className:z.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(O5e,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),Kq=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:c,searchTerm:i="",className:r="",filterConfig:s=[],externalFilters:d=[],onFiltersChange:h,onApplyFilters:l,onSort:u,filtersControlled:p=!1,debounceTimeout:y=300,getRowStyle:m,background:f,onPageSizeChange:g,onPageChange:M,itemLabel:x="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:L,sortLabel:w="Sort",applyLabel:C="Apply",cancelLabel:b="Cancel",clearLabel:_="Clear",applyDisabled:I=!1,paginationLoading:j=!1,filtersLoading:N=!1,sortLoading:S=!1,totalCount:A=null})=>{const[B,T]=k.useState({key:null,direction:"asc"}),[V,$]=k.useState(n.currentPage??1),[q,P]=k.useState(n.pageSize??10),[H,D]=k.useState(!1),E=k.useRef(null),[G,oe]=k.useState([]),ae=p?d:G,Me=p?[]:G;k.useEffect(()=>{const de=n.currentPage??1,Tt=n.pageSize??10;de!==V&&$(de),Tt!==q&&P(Tt)},[n.currentPage,n.pageSize]);const{paginatedData:me,sortedData:Ce,totalPages:he,startIndex:Y}=Dq(t,e,i,B,V,q,Me),ee=Ce.length,ie=typeof A=="number"&&A>=0?A:ee;let ue=he;typeof A=="number"&&A>=0&&(ue=Math.max(1,Math.ceil(A/q)));const re=ee>10;k.useEffect(()=>{const de=Math.max(1,Math.floor(ue));V>de&&$(de),V<1&&$(1)},[ue]);const W=de=>{p||oe(de),h?.(de),$(1),M?.(1)},O=de=>{p||oe(de),l?.(de),$(1),M?.(1),E.current&&E.current.style.setProperty("--filters-panel-height","0px")},ne=de=>{M?.(de),$(de)},we=de=>{P(de),$(1),g?.(de),M?.(1)},Be=de=>{E.current&&E.current.style.setProperty("--filters-panel-height",`${Math.round(de)}px`)},ge=de=>{T(de),u?.(de)},$e=de=>{D(de),!de&&E.current&&E.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(ae?.length??0)>0&&D(!0)},[ae]),k.useEffect(()=>{s.length>0&&ae.length>0&&D(!0)},[s.length,ae.length]);const Pc=(ae?.length??0)>0&&L?L:v;return o.jsxs("div",{ref:E,className:`${z.container} ${r} ${H?z.filtersOpen:""}`,style:{background:f,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:z.tableControls,children:o.jsxs("div",{className:z.controlsRight,children:[o.jsx(H5e,{columns:e,onSort:ge,label:w,sortConfig:B,loading:S}),s.length>0&&o.jsx(T5e,{filters:s,externalFilters:ae,onFiltersChange:W,onApply:O,isControlled:p,debounceTimeout:y,expanded:H,onToggle:$e,panelPlacement:"top",onPanelHeightChange:Be,label:Pc,applyLabel:C,cancelLabel:b,clearLabel:_,applyDisabled:I,loading:N})]})}),o.jsx("div",{className:z.topPagination,children:o.jsx(D5e,{currentPage:V,totalPages:ue,pageSize:q,totalItems:ie,itemLabel:x,onPageChange:ne,onPageSizeChange:we,loading:j})}),o.jsx("div",{className:`${z.tableWrapper} ${re?z.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:z.table,children:[o.jsx(F5e,{columns:e}),o.jsx(U5e,{data:me,columns:e,onRowClick:c,startIndex:Y,getRowStyle:m,searchTerm:i})]})})]})};function W5e(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=k.useMemo(()=>{if(n===null||typeof n>"u")return null;const p=Number(n);if(!Number.isFinite(p)||p<=0)return 1;const y=Number(r);return!Number.isFinite(y)||y<=0?1:Math.max(1,Math.ceil(p/y))},[n,r]),h=s>1,l=d===null?!1:s<d,u=p=>{typeof p=="number"&&(p<1||p<s&&!h||p>s&&!l||c?.(p))};return o.jsx(Kq,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const G5e="_mpRoot_31595_1",K5e="_mpHeader_31595_22",Z5e="_mpTitle_31595_31",X5e="_mpList_31595_35",Y5e="_mpVertical_31595_41",J5e="_mpHorizontal_31595_46",Q5e="_mpItem_31595_55",eke="_mpClickable_31595_95",tke="_mpLeft_31595_117",ake="_mpIcon_31595_125",nke="_mpMeta_31595_140",oke="_mpLabel_31595_145",cke="_mpDate_31595_154",ike="_mpRight_31595_160",rke="_mpValue_31595_168",ske="_mpHint_31595_176",dke="_mpBadge_31595_180",lke="_mpBadgeTop_31595_199",hke="_mpBadgeSub_31595_206",uke="_mpBadgeSmall_31595_213",pke="_mpPill_31595_229",yke="_mpRounded_31595_232",kke="_mpCompact_31595_236",mke="_compactItemWrapper_31595_252",fke="_mpSummaryRoot_31595_265",gke="_mpSummaryInner_31595_269",vke="_mpSummaryFlex_31595_284",Mke="_mpSummaryCardWrapperHorizontal_31595_292",xke="_mpSummaryCardWrapper_31595_292",_ke="_mpSummaryCardHorizontal_31595_303",Lke="_mpSummaryCard_31595_292",Ike="_mpSummaryValue_31595_321",bke="_mpSummaryLabel_31595_327",wke="_mpSummaryBadge_31595_338",Cke="_mpSummaryBadgeSub_31595_357",Nke="_mpEmpty_31595_365",Ske="_mpSummaryVertical_31595_372",jke="_mpIconSquare_31595_380",Z={mpRoot:G5e,mpHeader:K5e,mpTitle:Z5e,mpList:X5e,mpVertical:Y5e,mpHorizontal:J5e,mpItem:Q5e,mpClickable:eke,mpLeft:tke,mpIcon:ake,mpMeta:nke,mpLabel:oke,mpDate:cke,mpRight:ike,mpValue:rke,mpHint:ske,mpBadge:dke,mpBadgeTop:lke,mpBadgeSub:hke,mpBadgeSmall:uke,mpPill:pke,mpRounded:yke,mpCompact:kke,compactItemWrapper:mke,mpSummaryRoot:fke,mpSummaryInner:gke,mpSummaryFlex:vke,mpSummaryCardWrapperHorizontal:Mke,mpSummaryCardWrapper:xke,mpSummaryCardHorizontal:_ke,mpSummaryCard:Lke,mpSummaryValue:Ike,mpSummaryLabel:bke,mpSummaryBadge:wke,mpSummaryBadgeSub:Cke,mpEmpty:Nke,mpSummaryVertical:Ske,mpIconSquare:jke},$t=(e,t=1)=>{if(!e||typeof e!="string")return`rgba(124, 58, 237, ${t})`;const n=e.trim();if(n.toLowerCase()==="transparent")return"rgba(0,0,0,0)";if(/^rgba?\(/i.test(n))return/^rgba\(/i.test(n)?n.replace(/rgba\(([^)]+),\s*([0-9.]+)\s*\)$/,(d,h)=>`rgba(${h.split(",").map(u=>u.trim()).slice(0,3).join(", ")}, ${t})`):n;let c=n.replace("#","").toLowerCase();if(c.length===3&&(c=c.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(c))return`rgba(124, 58, 237, ${t})`;const i=parseInt(c.slice(0,2),16),r=parseInt(c.slice(2,4),16),s=parseInt(c.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},$ke=({item:e,shape:t,onItemClick:n,color:c,renderItem:i})=>{const r=k.useCallback(()=>{n?.(e)},[n,e]),s=[Z.mpItem,t==="pill"?Z.mpPill:Z.mpRounded,n?Z.mpClickable:""].filter(Boolean).join(" ");if(i)return o.jsx("div",{className:s,role:n?"button":"group",tabIndex:n?0:-1,onClick:r,onKeyDown:y=>{n&&(y.key==="Enter"||y.key===" ")&&(n(e),y.preventDefault())},"aria-label":n?`Voir les détails de ${e.label}`:void 0,children:i(e)});const d=n?"button":"div",h=n?{onClick:r,className:s,type:"button","aria-label":`Voir les détails de ${e.label}`}:{className:s,role:"group"},l=e.iconComponent,u=e.iconSquareBg,p=e.iconColor;return o.jsxs(d,{...h,children:[o.jsxs("div",{className:Z.mpLeft,children:[l?o.jsx("div",{className:Z.mpIconSquare,style:{background:u??$t(p??c??"#7c3aed",1),border:`1px solid ${$t(p??c??"#7c3aed",.18)}`,color:p??"#ffffff"},children:k.createElement(l,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?o.jsx("div",{className:Z.mpIcon,children:e.icon}):null,o.jsxs("div",{className:Z.mpMeta,children:[o.jsx("div",{className:Z.mpLabel,children:e.label}),e.subLabel&&o.jsx("div",{className:Z.mpDate,children:e.subLabel}),e.date&&o.jsx("div",{className:Z.mpDate,children:e.date})]})]}),o.jsxs("div",{className:Z.mpRight,children:[o.jsx("div",{className:Z.mpValue,style:{color:e.valueColor??c??void 0},children:e.value}),e.badge?o.jsxs("div",{className:[Z.mpBadge,e.badge.small?Z.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??$t(e.badge.color||c||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":$t(e.badge.color||c||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[o.jsx("div",{className:Z.mpBadgeTop,children:e.badge.text}),e.badge.subText&&o.jsx("div",{className:Z.mpBadgeSub,children:e.badge.subText})]}):e.hint?o.jsx("div",{className:Z.mpHint,children:e.hint}):null]})]})},qke=k.memo($ke),cj=({title:e,right:t})=>!e&&!t?null:o.jsxs("div",{className:Z.mpHeader,children:[o.jsx("div",{className:Z.mpTitle,children:e}),o.jsx("div",{children:t})]}),ij=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Ake=({item:e})=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:14,borderRadius:12,minHeight:88,boxSizing:"border-box",background:e.bgColor??"transparent",border:`1px solid ${e.borderColor??"transparent"}`,boxShadow:"0 4px 10px rgba(15,23,42,0.03)"},children:[o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[o.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),o.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),o.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??ij("#7c3aed",.12),border:`1px solid ${ij(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?k.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),zke=({item:e,bg:t,onClick:n,width:c,height:i,extraStyle:r})=>o.jsxs("div",{className:Z.mpSummaryCard,style:{background:t,width:c??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[o.jsx("div",{className:Z.mpSummaryLabel,children:e.label}),o.jsx("div",{className:Z.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&o.jsxs("div",{className:Z.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:Z.mpSummaryBadgeSub,children:e.badge.subText})]})]}),rj=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},sj=e=>o.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[o.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?o.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[o.jsx("div",{style:{fontWeight:900,fontSize:"clamp(16px, 1.6vw, 20px)",color:e.valueColor,lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.value}),e.badge?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:rj("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:rj("#7c3aed",.12)}`,color:e.badge.textColor||"#0f172a",fontWeight:700,fontSize:"clamp(12px, 1.2vw, 14px)",width:"120px",height:"52px",textAlign:"center",boxSizing:"border-box",overflow:"hidden",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",lineHeight:1.2,flexShrink:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:800,lineHeight:1.2,letterSpacing:"0.02em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.text}),e.badge.subText?o.jsx("div",{style:{fontSize:13,marginTop:4,fontWeight:700,letterSpacing:"0.01em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.subText}):null]}):null]})]}),dj=(e,t)=>{try{if(typeof e=="function"){const n=e(t);if(n!==void 0)return n}}catch{}try{return k.createElement(e,{item:t})}catch(n){return console.warn("chooseDefaultRender: impossible de rendre CompactRenderer",n),null}},Vke=e=>{switch(e){case"image":return t=>k.createElement(Ake,{item:t});case"pertinence":return t=>k.createElement(zke,{item:t});case"alternateHorizontal":return t=>dj(sj,t);case"compact":return t=>dj(sj,t);case"summary":return;case"default":default:return}},Zq=({item:e,orientation:t,bg:n,border:c,valueColor:i,onClick:r,width:s,height:d,extraStyle:h})=>{const u=t==="horizontal"?Z.mpSummaryCardHorizontal:Z.mpSummaryCard;return o.jsxs("div",{className:u,style:{background:n,border:`1px solid ${c}`,width:s??void 0,height:d??void 0,...h??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&o.jsxs("div",{className:Z.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:Z.mpSummaryBadgeSub,children:e.badge.subText})]}),o.jsx("div",{className:Z.mpSummaryValue,style:{color:i},children:e.value}),o.jsx("div",{className:Z.mpSummaryLabel,children:e.label})]})},Pke=["transparent","transparent","transparent","transparent"],Tke=["transparent","transparent","transparent","transparent"],Hke=["#059669","#2563eb","#b45309","#7c3aed"],Dke=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Xq=e=>{const{items:t=[],layout:n="vertical",orientation:c="auto",shape:i="rounded",color:r="#7c3aed",compact:s=!1,title:d,onItemClick:h,className:l="",loading:u=!1,emptyMessage:p="Aucun élément",renderItem:y,summary:m=!1,summaryBgColors:f=Pke,summaryBorderColors:g=Tke,summaryValueColors:M=Hke,preset:x,background:v}=e,{itemsContainerStyle:L,itemsContainerClassName:w,summaryGridColumns:C,compactItemWidth:b,compactItemHeight:_,compactItemStyle:I,summaryCardWidth:j,summaryCardHeight:N,summaryCardStyle:S}=e,A=n==="vertical",B={"--mp-accent":r,"--mp-accent-soft":Dke(r,.08),"--mp-bg-primary":v},T=[Z.mpRoot,A?Z.mpVertical:Z.mpHorizontal,s?Z.mpCompact:"",m?Z.mpSummaryRoot:"",c!=="auto"?c==="vertical"?Z.mpOrientationVertical:Z.mpOrientationHorizontal:"",l].filter(Boolean).join(" "),V=k.useMemo(()=>y||(Vke(x)??void 0),[y,x]);if(m){const $=c==="horizontal"?Z.mpSummaryFlex:Z.mpSummaryVertical,P={...(C?{display:"grid",gridTemplateColumns:`repeat(${C}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...L??{}};return o.jsxs("div",{className:T,style:B,"aria-busy":u,children:[d&&o.jsx(cj,{title:d}),o.jsx("div",{className:Z.mpSummaryInner,children:o.jsx("div",{className:`${$} ${w??""}`,style:P,children:t.length===0?o.jsx("div",{className:Z.mpEmpty,children:p}):t.map((H,D)=>{const E=H.bgColor??f[D%f.length],G=H.borderColor??g[D%g.length],oe=H.valueColor??M[D%M.length];return V?o.jsx("div",{className:c==="horizontal"?Z.mpSummaryCardWrapperHorizontal:Z.mpSummaryCardWrapper,style:{width:j??void 0,height:N??void 0,...S??{}},children:V(H,D)},H.id):o.jsx(Zq,{item:H,orientation:c==="horizontal"?"horizontal":"vertical",bg:E,border:G,valueColor:oe,onClick:h,width:j??void 0,height:N??void 0,extraStyle:S},H.id)})})})]})}return o.jsxs("div",{className:T,style:B,"aria-busy":u,children:[d&&o.jsx(cj,{title:d}),o.jsx("div",{className:Z.mpList,style:L,children:u?o.jsx("div",{className:Z.mpEmpty,children:"Chargement…"}):t.length===0?o.jsx("div",{className:Z.mpEmpty,children:p}):t.map($=>{const q=s?{width:b??void 0,height:_??void 0,boxSizing:"border-box",...I??{}}:void 0;return o.jsx("div",{className:s?Z.compactItemWrapper:void 0,style:q,children:o.jsx(qke,{item:$,shape:i,onItemClick:h,color:r,renderItem:V?P=>V(P,t.indexOf(P)):void 0})},$.id)})})]})};k.memo(Xq);const Bke=({a11yConfig:e,width:t,height:n,colors:c={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:i={},placeholder:r="Loading Chart",style:s,className:d="",children:h,padding:l="1rem",variant:u="default",showBorder:p=!1,titleKey:y,leftTitleKey:m})=>{const f=t?typeof t=="number"?`${t}px`:t:void 0,g=n?typeof n=="number"?`${n}px`:n:void 0,M=r&&typeof r=="object"&&!k.isValidElement(r)&&("text"in r||"subtext"in r||"icon"in r||"background"in r||"iconSize"in r),x=M?r:void 0,v=x?.icon?mt[x.icon]:void 0,L=28,w=x?.iconSize??L,C=["chart-container",`variant-${u}`,p?"with-border":"",d].filter(Boolean).join(" "),b=c.contentBackground??void 0,_=typeof l=="number"?`${l}px`:l;return o.jsxs("div",{className:C,style:{width:f,height:g,color:c.text,background:c.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:_,...s},children:[o.jsxs("div",{className:"chart-header",children:[o.jsxs("div",{title:Q(e,m||y),className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.left,i.leftSubtitle&&o.jsx("div",{className:"chart-subtitle-left",children:i.leftSubtitle})]}),o.jsx("div",{className:"chart-title-right",children:i.right})]}),o.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:b},children:h||(M&&x?o.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[v&&o.jsx("div",{className:"placeholder-icon",style:{width:w,height:w},children:o.jsx(v,{color:x.iconColor??"currentColor",size:typeof w=="number"?w:parseInt(String(w),10)||L})}),x.text&&o.jsx("div",{className:"placeholder-text",children:x.text}),x.subtext&&o.jsx("div",{className:"placeholder-subtext",children:x.subtext})]}):o.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:r}))})]})},Zw=({id:e,size:t="100%",background:n,icon:c,text:i,subtext:r,onClose:s,onClick:d,style:h,className:l="",colorTextPrimary:u,colorTextSub:p,model:y,fontSize:m,fontWeight:f,a11yConfig:g,titleKey:M})=>{const x=c||y?.icon,v=typeof x=="string",L=v?mt[x]:null,w=v?null:x;return o.jsxs("div",{id:e,className:`alert ${l}`,style:{width:typeof t=="number"?`${t}px`:t,background:n||y?.background,pointerEvents:"auto",...h},role:"alert",onClick:d,title:Q(g,M),children:[L&&o.jsx(L,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),w!=null&&o.jsx("span",{className:"alert-icon",style:{display:"flex",alignItems:"center",color:u||y?.colorTextPrimary,flexShrink:0},children:w}),o.jsxs("div",{className:"alert-content",children:[o.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary,fontSize:m,fontWeight:f},children:i}),r&&o.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&o.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},Yq=k.createContext(null),Rke=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,Fke=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:c,containerStyle:i})=>{const[r,s]=k.useState([]),d=k.useRef(new Map),h=k.useRef(null),l=k.useRef(null),u=k.useRef(n);k.useEffect(()=>()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear()},[]);const p=(_,I)=>{const j=I===void 0||I===0?t:I;if(j===-1)return;const N=window.setTimeout(()=>{f(_)},j);d.current.set(_,N)},y=_=>{const I=d.current.get(_);I&&(window.clearTimeout(I),d.current.delete(_))},m=_=>{const I=Rke(),j={..._,id:I,createdAt:Date.now()};return s(N=>{const S=[j,...N],A=u.current;return typeof A=="number"&&A>=0&&S.length>A?(S.slice(A).forEach(T=>y(T.id)),S.slice(0,A)):S}),p(I,_.duration),I},f=_=>{y(_),s(I=>I.filter(j=>j.id!==_))},g=(_,I)=>{s(j=>j.map(N=>N.id===_?{...N,...I}:N))},M=()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear(),s([])},x=_=>{l.current=_},v=()=>r.slice(),L=k.useMemo(()=>({showAlert:m,dismissAlert:f,updateAlert:g,clearAlerts:M,setContainerRef:x,getAlertsSnapshot:v}),[r]),w=l.current,C=o.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:10001,padding:"8px 4px"},children:o.jsx(b0e,{mode:"popLayout",children:r.map(_=>o.jsx(Ow.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{type:"spring",damping:25,stiffness:300},style:{width:"100%",pointerEvents:"auto",boxShadow:"0 6px 20px rgba(0, 0, 0, 0.12)",borderRadius:"8px",marginBottom:"6px",backgroundColor:_.background||_.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:o.jsx(Zw,{id:_.id,text:_.text,subtext:_.subtext,icon:_.icon,background:"transparent",colorTextPrimary:_.colorTextPrimary,colorTextSub:_.colorTextSub,model:_.model,onClose:()=>f(_.id),size:"100%",style:{boxShadow:"none"}})},_.id))})}),b=o.jsx("div",{ref:_=>{l.current||(h.current=_)},className:c,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:C});return o.jsxs(Yq.Provider,{value:L,children:[w?lw.createPortal(C,w):b,e]})},Eke=()=>{const e=k.useContext(Yq);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},Oke={default:{background:"#f3f4f6",icon:"Info",colorTextPrimary:"#111827",colorTextSub:"#4b5563"},info:{background:"#dbeafe",icon:"Info",colorTextPrimary:"#1e40af",colorTextSub:"#3b82f6"},success:{background:"#dcfce7",icon:"CheckCircle2",colorTextPrimary:"#166534",colorTextSub:"#22c55e"},warning:{background:"#fef3c7",icon:"AlertTriangle",colorTextPrimary:"#92400e",colorTextSub:"#f59e0b"},error:{background:"#fee2e2",icon:"XCircle",colorTextPrimary:"#991b1b",colorTextSub:"#ef4444"}},Uke="_container_18zbo_1",Wke="_icon_18zbo_9",Gke="_selectWrapper_18zbo_23",Ab={container:Uke,icon:Wke,selectWrapper:Gke},Kke=({options:e,defaultValue:t,onChange:n,label:c})=>{const[i,r]=k.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return o.jsxs("div",{className:Ab.container,children:[o.jsxs("div",{className:Ab.icon,children:[o.jsx(x1,{size:18}),o.jsx("p",{children:c})]}),o.jsx("div",{className:Ab.selectWrapper,children:o.jsx(Uw,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},Zke=250,Xke=k.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:c,afterOpen:i,beforeClose:r,afterClose:s,style:d,className:h="",children:l,closeOnOverlayClick:u=!0,showCloseButton:p=!0},y)=>{const[m,f]=k.useState(!1),[g,M]=k.useState(!1),x=k.useRef(null),v=k.useRef(null),L=k.useRef(null),w=k.useRef(null);k.useEffect(()=>{const _=x.current;if(!_)return;const I=_.parentElement;return I?(window.getComputedStyle(I).position==="static"&&(I.setAttribute("data-scp-prev-position",I.style.position??""),I.style.position="relative",I.setAttribute("data-scp-position-changed","true")),()=>{if(I.getAttribute("data-scp-position-changed")==="true"){const N=I.getAttribute("data-scp-prev-position")??"";I.style.position=N,I.removeAttribute("data-scp-position-changed"),I.removeAttribute("data-scp-prev-position")}}):void 0},[]),k.useImperativeHandle(y,()=>({open:()=>{m||(c?.(),M(!1),f(!0))},close:()=>{m&&(r?.(),M(!1),f(!1))},toggle:()=>{m?(r?.(),M(!1),f(!1)):(c?.(),M(!1),f(!0))}}),[m,c,r]),k.useEffect(()=>{const _=v.current;w.current&&(window.clearTimeout(w.current),w.current=null);const I=j=>{if(j.target===_&&!(j.propertyName!=="transform"&&j.propertyName!=="opacity"))if(m){M(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}};return _&&(_.addEventListener("transitionend",I),w.current=window.setTimeout(()=>{if(m){M(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}},Zke+60)),m&&(L.current=document.activeElement),()=>{_&&_.removeEventListener("transitionend",I),w.current&&(window.clearTimeout(w.current),w.current=null)}},[m,i,s]),k.useEffect(()=>{const _=I=>{I.key==="Escape"&&m&&(r?.(),M(!1),f(!1))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[m,r]);const C=()=>{u&&(r?.(),M(!1),f(!1))},b=typeof n=="number"?`${n}px`:n;return o.jsxs("div",{ref:x,className:`scp-inline-root ${m?"open":""}`,"aria-hidden":!m,children:[o.jsx("div",{className:`scp-overlay ${m?"visible":""}`,onMouseDown:C,role:"presentation"}),o.jsxs("aside",{className:`scp-panel ${m?"in":"out"} ${g?"interactive":""} ${h}`,style:{width:b,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[o.jsxs("div",{className:"scp-header",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"scp-title",children:e}),t&&o.jsx("div",{className:"scp-subtitle",children:t})]}),p&&o.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),M(!1),f(!1)},children:o.jsx(Ke,{size:18})})]}),o.jsx("div",{className:"scp-body",children:l})]})]})});function Yke(e){const t=k.useRef("");k.useEffect(()=>{if(e){t.current=document.body.style.overflow,document.body.style.overflow="hidden";return}document.body.style.overflow=t.current||""},[e])}const Jke="_container_1pfsp_1",Qke="_title_1pfsp_8",lj={container:Jke,title:Qke},e3e=({title:e,fontSize:t,barColor:n,className:c="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return o.jsx("div",{className:`${lj.container} ${c}`,style:r,children:o.jsx("h2",{className:lj.title,children:e})})},t3e="_modalOverlay_1878x_1",a3e="_modalContainer_1878x_16",n3e="_modalTitle_1878x_29",o3e="_modalInput_1878x_38",c3e="_modalTextarea_1878x_39",i3e="_modalActions_1878x_70",r3e="_cancelBtn_1878x_77",s3e="_saveBtn_1878x_99",d3e="_inputError_1878x_141",l3e="_inlineAlert_1878x_146",Ye={modalOverlay:t3e,modalContainer:a3e,modalTitle:n3e,modalInput:o3e,modalTextarea:c3e,modalActions:i3e,cancelBtn:r3e,saveBtn:s3e,inputError:d3e,inlineAlert:l3e},Vc=({isOpen:e,onClose:t,onSave:n,title:c="Ajouter un élément",fields:i,initialValues:r={},errorMessage:s="",disableSave:d,onFieldChange:h,confirmText:l="Valider",cancelText:u="Annuler"})=>{const[p,y]=k.useState({}),m=k.useRef(null),[f,g]=k.useState(!1),[M,x]=k.useState(!1),v=k.useRef(null);if(k.useEffect(()=>{if(!e)return;const _={};for(const I of i)_[I.name]=Object.prototype.hasOwnProperty.call(r,I.name)?r[I.name]:"";return y(_),requestAnimationFrame(()=>{m.current?.focus();const I=m.current;if(I&&typeof I.selectionStart=="number"){const j=String(I.value??"").length;I.setSelectionRange(j,j)}}),()=>{v.current&&(window.clearTimeout(v.current),v.current=null)}},[e]),k.useEffect(()=>{s&&e?(x(!0),v.current&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{x(!1),v.current=null},3e3)):(x(!1),v.current&&(window.clearTimeout(v.current),v.current=null))},[s,e]),!e)return null;const L=(_,I)=>{y(j=>({...j,[_]:I})),h&&h(_,I)},w=async()=>{if(!Object.values(p).some(_=>_===""||_===void 0))try{g(!0);const _=await n(p);if(typeof _=="string"&&_==="duplicate-same"){g(!1);return}y({}),g(!1),t()}catch(_){console.error("AddItemModal onSave error:",_),g(!1),t()}},C=_=>{_.target===_.currentTarget&&t()},b=_=>_.stopPropagation();return o.jsx("div",{className:Ye.modalOverlay,onMouseDown:C,role:"dialog","aria-modal":"true",children:o.jsxs("div",{className:Ye.modalContainer,onMouseDown:b,onClick:b,children:[o.jsx("h2",{className:Ye.modalTitle,children:c}),i.map((_,I)=>{const j=p[_.name]??"",N=I===0&&!!s,S={name:_.name,placeholder:_.placeholder||_.label,value:String(j),onChange:A=>L(_.name,A.target.value),className:_.type==="textarea"?`${Ye.modalTextarea} ${N?Ye.inputError:""}`:`${Ye.modalInput} ${N?Ye.inputError:""}`,tabIndex:0,disabled:f};return I===0&&(S.ref=A=>{m.current=A}),o.jsxs("div",{style:{marginBottom:8},children:[_.type==="textarea"?o.jsx("textarea",{rows:_.rows||4,...S}):o.jsx("input",{type:_.type||"text",...S}),I===0&&M&&s&&o.jsx("div",{style:{marginTop:8},children:o.jsx(Zw,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>x(!1),className:Ye.inlineAlert})})]},_.name)}),o.jsxs("div",{className:Ye.modalActions,children:[o.jsx("button",{className:Ye.cancelBtn,onClick:t,type:"button",disabled:f,children:u}),o.jsx("button",{className:Ye.saveBtn,onClick:w,type:"button",disabled:f||!!d,children:f?"En cours...":l})]})]})})},h3e=({title:e,keyCount:t,onAddKey:n,a11yConfig:c})=>{const[i,r]=k.useState(!1),s=d=>{const h=d.key;n&&h&&n(h)};return o.jsxs("div",{className:"header-container",children:[o.jsxs("div",{className:"header-info",children:[o.jsx("h1",{title:Q(c,e),children:e}),o.jsxs("p",{children:[t," clés"]})]}),o.jsxs("button",{onClick:()=>r(!0),className:"add-key-button",children:[o.jsx($c,{className:"add-key-icon"}),"Clé"]}),o.jsx(Vc,{isOpen:i,title:"Ajouter une clé",onClose:()=>r(!1),onSave:s,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},u3e=({modules:e,onEdit:t,onDelete:n,onAddModule:c,onSelectModule:i,addModalFields:r,addModalTitle:s})=>{const[d,h]=k.useState(!1),[l,u]=k.useState(null),[p,y]=k.useState(null),[m,f]=k.useState(!1),g=()=>h(!0),M=()=>h(!1),x=_=>{if(c){const I=_.code?.trim()||_.id?.trim(),j=_.title?.trim(),N=I||j||String(Date.now()),S=j||I||`Module ${N}`;c({id:N,title:S,subtitle:"",translations:{}})}M()},v=(_,I)=>{_.stopPropagation(),u(I)},L=()=>u(null),w=_=>{if(!l){L();return}const I={...l,title:_.title||l.title,subtitle:""};t&&t(I),L()},C=(_,I)=>{_.stopPropagation(),n&&n(I)},b=_=>{y(_.id),i&&i(_)};return m?o.jsx("div",{className:"module-sidebar collapsed",children:o.jsx(Qc,{size:20,className:"menu-toggle",onClick:()=>f(!1)})}):o.jsxs("div",{className:"module-sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),o.jsxs("div",{className:"header-actions",children:[o.jsx(Jc,{size:18,className:"header-folder",onClick:g}),o.jsx(Qc,{size:18,className:"header-menu",onClick:()=>f(!0)})]})]}),o.jsx("hr",{className:"divider"}),o.jsx("div",{className:"module-list",children:e.map(_=>{const I=Object.keys(_.translations||{}).length,j=I>0||_.id===p;return o.jsxs("div",{className:`module-item ${_.id===p?"selected":""}`,onClick:()=>b(_),role:"button",tabIndex:0,onKeyDown:N=>{N.key==="Enter"&&b(_)},children:[o.jsxs("div",{className:"module-left",children:[o.jsx(w1,{size:16,className:"item-folder"}),o.jsxs("div",{className:"module-info",children:[o.jsxs("div",{className:"module-title",children:[_.title,j&&o.jsxs("span",{className:"count",children:[" ",I," "]})]}),_.subtitle?o.jsx("div",{className:"module-subtitle",children:_.subtitle}):null]})]}),o.jsxs("div",{className:"module-actions",children:[t&&o.jsx(e1,{onClick:N=>v(N,_),color:"#777",size:16}),n&&o.jsx(dt,{onClick:N=>C(N,_.id),color:"#777",size:16})]})]},_.id)})}),o.jsx(Vc,{isOpen:d,onClose:M,onSave:x,title:s||"Ajouter un module",fields:r&&r.length?r.map(_=>({name:_.name,label:_.label,type:_.type,placeholder:_.placeholder,rows:_.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),l&&o.jsx(Vc,{isOpen:!!l,onClose:L,onSave:w,title:"Éditer le module",initialValues:{title:l.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},Jq=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:c="left",iconColor:i="#9ca3af",a11yConfig:r,className:s})=>o.jsxs("div",{className:`search-container icon-${c}`,title:Q(r,e),children:[o.jsx("div",{className:"search-icon-wrapper",children:o.jsx(S1,{className:"search-icon",color:i})}),o.jsx("input",{type:"text",placeholder:e,value:t,onChange:d=>n?.(d.target.value),className:`search-input ${s}`})]}),p3e=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:c,onEditKey:i,onEditTranslation:r,onDeleteTranslation:s,onAddTranslation:d,draggable:h=!1,checkDuplicateLocal:l})=>{const[u,p]=k.useState(!1),[y,m]=k.useState(""),[f,g]=k.useState(null),[M,x]=k.useState(""),[v,L]=k.useState(""),[w,C]=k.useState(!1),[b,_]=k.useState(!1),[I,j]=k.useState(null),[N,S]=k.useState(!1),A=t.map(D=>D.language),B=n.filter(D=>!A.includes(D.code)),T=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),m(""),L(""),p(!1))},V=(D,E)=>{g(D),x(E)},$=D=>{r?.(e,D,M),g(null),x("")},q=()=>{g(null),x("")},P=async D=>{const E=D.name?.trim();if(E){if(j(null),S(!1),E===e||!i)return C(!1),"ok";try{const G=await i(e,E);if(typeof G=="string"&&G==="ok")C(!1),j(null);else{if(typeof G=="string"&&G==="duplicate-same")return j("Une clé existe déjà dans ce module."),S(!0),"duplicate-same";if(typeof G=="string"&&G==="duplicate-other")return C(!1),j(null),"duplicate-other";C(!1)}}catch(G){console.error("Erreur handleRenameSave:",G),j("Erreur lors du renommage.")}}},H=(D,E)=>{if(D!=="name")return;const G=E.trim();j(null),S(!1),G&&typeof l=="function"&&(l(G,e)?(j("Une clé existe déjà dans ce module."),S(!0)):(j(null),S(!1)))};return o.jsxs("div",{className:`translation-key ${b?"collapsed":"expanded"} ${h?"draggable":""}`,children:[o.jsxs("div",{className:"card-header",children:[o.jsxs("div",{className:"header-left",children:[o.jsx("button",{className:"collapse-button",onClick:()=>_(!b),title:b?"Déplier":"Replier",children:b?o.jsx(L1,{className:"collapse-icon"}):o.jsx(qt,{className:"collapse-icon"})}),o.jsx("h3",{className:"card-title",title:e,children:e})]}),o.jsxs("div",{className:"header-actions",children:[o.jsx("button",{className:"action-button",onClick:D=>{D.stopPropagation(),C(!0)},title:"Renommer la clé",children:o.jsx(yt,{className:"action-icon"})}),o.jsx("button",{onClick:D=>{D.stopPropagation(),c?.(e)},className:"action-button delete",title:"Supprimer la clé",children:o.jsx(dt,{className:"action-icon"})})]})]}),o.jsx("div",{className:`translations-container ${b?"":"expanded"}`,children:!h&&o.jsxs(o.Fragment,{children:[t.map(D=>o.jsxs("div",{className:"translation-row",children:[o.jsx("div",{className:"language-code",children:D.language}),o.jsx("div",{className:"translation-content",children:f===D.language?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"text",value:M,onChange:E=>x(E.target.value),className:"edit-input",autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&$(D.language),E.key==="Escape"&&q()}}),o.jsx("button",{onClick:()=>$(D.language),className:"save-button",disabled:!M.trim(),children:"Enregistrer"}),o.jsx("button",{onClick:q,className:"cancel-button",children:o.jsx(Ke,{className:"action-icon"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"translation-text",title:D.value,children:D.value}),o.jsx("button",{onClick:()=>V(D.language,D.value),className:"edit-button",title:"Éditer la traduction",children:o.jsx(yt,{className:"action-icon"})}),o.jsx("button",{onClick:()=>s?.(e,D.language),className:"delete-translation-button",title:"Supprimer la traduction",children:o.jsx(Ke,{className:"action-icon"})})]})})]},D.language)),u?o.jsxs("div",{className:"add-language-row",children:[o.jsx("div",{className:"language-code",children:"+"}),o.jsxs("div",{className:"add-language-content",children:[o.jsx("div",{className:"language-select-container",children:o.jsxs("select",{value:y,onChange:D=>m(D.target.value),className:"language-select",children:[o.jsx("option",{value:"",children:"Sélectionnez la langue"}),B.map(D=>o.jsxs("option",{value:D.code,children:[D.name," (",D.code,")"]},D.code))]})}),y&&o.jsx("input",{type:"text",value:v,onChange:D=>L(D.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:D=>{D.key==="Enter"&&T(),D.key==="Escape"&&(p(!1),m(""),L(""))}}),o.jsx("button",{onClick:T,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),o.jsx("button",{onClick:()=>{p(!1),m(""),L("")},className:"cancel-button",children:o.jsx(Ke,{className:"action-icon"})})]})]}):o.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:B.length===0,children:[o.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),h&&o.jsxs("div",{className:"drag-overlay",children:[o.jsx(a.Move,{size:24,strokeWidth:1.5}),o.jsx("span",{children:"Glisser pour réorganiser"})]}),o.jsx(Vc,{isOpen:w,onClose:()=>{C(!1),j(null),S(!1)},onSave:P,onFieldChange:H,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:I||"",disableSave:N})]})},y3e="_wrapper_1wvht_1",k3e="_leftGroup_1wvht_12",m3e="_filterButton_1wvht_21",f3e="_open_1wvht_42",g3e="_filterIcon_1wvht_42",v3e="_infoText_1wvht_58",M3e="_pickerContainer_1wvht_66",x3e="_srOnly_1wvht_79",_3e="_pickerLabel_1wvht_91",L3e="_datetime_1wvht_98",I3e="_rightGroup_1wvht_107",b3e="_searchInputWrap_1wvht_116",w3e="_searchInput_1wvht_116",C3e="_searchIcon_1wvht_152",Pe={wrapper:y3e,leftGroup:k3e,filterButton:m3e,open:f3e,filterIcon:g3e,infoText:v3e,pickerContainer:M3e,srOnly:x3e,pickerLabel:_3e,datetime:L3e,rightGroup:I3e,searchInputWrap:b3e,searchInput:w3e,searchIcon:C3e};function N3e({onDateChange:e,onSearch:t,initialDate:n}){const[c,i]=k.useState(!1),[r,s]=k.useState(n??""),d=k.useRef(null);k.useEffect(()=>{function p(y){const m=y.target;d.current&&m&&!d.current.contains(m)&&i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),k.useEffect(()=>{n&&s(n)},[n]);const h=()=>i(p=>!p),l=p=>{const y=p.target.value;s(y),e?.(y)},u=p=>{t?.(p.target.value)};return o.jsxs("div",{className:Pe.wrapper,ref:d,children:[o.jsxs("div",{className:Pe.leftGroup,children:[o.jsxs("button",{type:"button",className:`${Pe.filterButton} ${c?Pe.open:""}`,onClick:h,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[o.jsx("span",{children:"Entry time"}),o.jsx("svg",{className:Pe.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),o.jsx("div",{className:Pe.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),c&&o.jsxs("div",{className:Pe.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[o.jsx("label",{className:Pe.pickerLabel,htmlFor:"entry-datetime",children:o.jsx("span",{className:Pe.srOnly,children:"Choisir la date et l’heure"})}),o.jsx("input",{id:"entry-datetime",className:Pe.datetime,type:"datetime-local",value:r,onChange:l,"aria-label":"Date et heure d’entrée"})]})]}),o.jsx("div",{className:Pe.rightGroup,children:o.jsxs("div",{className:Pe.searchInputWrap,children:[o.jsx("input",{className:Pe.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),o.jsx("svg",{className:Pe.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z"})})]})})]})}const S3e=({className:e="",style:t={},title:n,titleClassName:c="",titleStyle:i,data:r,lineClasses:s={},renderCell:d,bg:h,titleBg:l,titleColor:u,itemBg:p,emptyContent:y,colGap:m="1rem"})=>{const f=Array.isArray(r)?r:[],g=f.length===0,M=f.every(w=>typeof w=="string"),x=f.some(w=>Array.isArray(w)),v=(w,C,b)=>d?d(w,C,b):o.jsx("span",{className:"slb-cell-text",children:w}),L=m?{"--col-gap":m}:void 0;return g?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:h??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{...i,background:l??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-empty",children:y??null})]}):M&&!x?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:h??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:l??void 0,color:u??void 0},children:n}),o.jsx("ul",{className:"slb-list",children:f.map((w,C)=>o.jsx("li",{className:`slb-item ${s[C]||""}`,style:{background:p??void 0},children:v(w,C,0)},C))})]}):o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:h??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:l??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-grid",style:L,children:f.map((w,C)=>{const b=s[C]||"";if(Array.isArray(w)){const[_,I]=w;return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(_,C,0)}),o.jsx("div",{className:"slb-grid-right",children:v(I,C,1)})]},C)}return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(w,C,0)}),o.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},C)})})]})},j3e=({className:e="",style:t={},title:n,titleColor:c,data:i=[],badgeColor:r="#0ea5e9",badgeColors:s={},badgePadding:d="8px 16px",badgeWidth:h,itemBg:l,lineClasses:u={},colGap:p="1rem"})=>{const y=i.some(f=>Array.isArray(f)),m=p?{"--col-gap":p}:void 0;return o.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&o.jsx("div",{className:"clb-title",style:c?{color:c}:void 0,children:n}),o.jsx("div",{className:"clb-grid",style:m,children:i.map((f,g)=>{const M=u[g]||"";if(Array.isArray(f)){const[x,v]=f,L=s[g]||r;return o.jsxs("div",{className:`clb-row ${M}`,style:{background:l??void 0},children:[o.jsx("div",{className:"clb-badge-col",children:o.jsx("div",{className:"counter-badge",style:{background:L,padding:d,width:h,minWidth:h},children:x})}),o.jsx("div",{className:"clb-text",children:v})]},g)}return y?o.jsxs("div",{className:`clb-row ${M}`,style:{background:l??void 0},children:[o.jsx("div",{className:"clb-badge-col clb-empty-badge"}),o.jsx("div",{className:"clb-text",children:f})]},g):o.jsx("div",{className:`clb-fullrow ${M}`,style:{background:l??void 0},children:o.jsx("span",{children:f})},g)})})]})},$3e=({className:e="",style:t={},title:n,items:c=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:h,colGap:l="1rem"})=>{const u=l?{"--col-gap":l}:void 0;return o.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&o.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),o.jsx("div",{className:"tlb-grid",style:u,children:c.map((p,y)=>{const m=d[y]||"";return o.jsxs("div",{className:`tlb-row ${m}`,style:{background:s??void 0},children:[o.jsx("div",{className:"tlb-label",children:p.label}),o.jsxs("div",{className:"tlb-value-group",children:[o.jsx("div",{className:"tlb-icon-col",children:h?h(p):p.icon??null}),o.jsxs("div",{className:"tlb-value-wrap",children:[o.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&o.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},q3e=({className:e="",style:t={},children:n,gap:c="1rem"})=>o.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":c},children:k.Children.map(n,i=>o.jsx("div",{className:"frc-item",children:i}))}),A3e=({className:e="",style:t={},children:n,gap:c="1rem",background:i="#D9EEF5"})=>o.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":c},children:k.Children.map(n,r=>o.jsx("div",{className:"lcc-cell",children:r}))}),z3e="_overlay_3x4or_2",V3e="_fadeIn_3x4or_1",P3e="_popup_3x4or_17",T3e="_slideUp_3x4or_1",H3e="_header_3x4or_28",D3e="_body_3x4or_40",B3e="_footer_3x4or_51",R3e="_cancelButton_3x4or_59",F3e="_confirmButton_3x4or_77",E3e="_warning_3x4or_97",O3e="_danger_3x4or_106",U3e="_info_3x4or_115",_t={overlay:z3e,fadeIn:V3e,popup:P3e,slideUp:T3e,header:H3e,body:D3e,footer:B3e,cancelButton:R3e,confirmButton:F3e,warning:E3e,danger:O3e,info:U3e},W3e=({isOpen:e,title:t,message:n,onConfirm:c,onCancel:i,confirmText:r="Confirmer",cancelText:s="Annuler",type:d="warning"})=>{if(!e)return null;const h=u=>{u.target===u.currentTarget&&i()},l=u=>{u.key==="Escape"&&i(),u.key==="Enter"&&u.ctrlKey&&c()};return o.jsx("div",{className:_t.overlay,onClick:h,onKeyDown:l,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:o.jsxs("div",{className:`${_t.popup} ${_t[d]}`,children:[o.jsx("div",{className:_t.header,children:o.jsx("h3",{id:"confirmation-title",children:t})}),o.jsx("div",{className:_t.body,children:o.jsx("p",{id:"confirmation-message",children:n})}),o.jsxs("div",{className:_t.footer,children:[o.jsx("button",{className:_t.cancelButton,onClick:i,type:"button",children:s}),o.jsx("button",{className:_t.confirmButton,onClick:c,type:"button",autoFocus:!0,children:r})]})]})})},G3e=()=>{const[e,t]=k.useState({isOpen:!1,title:"",message:"",onConfirm:null}),n=k.useCallback((r,s,d)=>{t({isOpen:!0,title:r,message:s,onConfirm:d})},[]),c=k.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=k.useCallback(()=>{e.onConfirm?.(),c()},[e.onConfirm,c]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:c,handleConfirm:i}},K3e="_container_1l44m_1",Z3e="_selectButton_1l44m_7",X3e="_disabled_1l44m_22",Y3e="_error_1l44m_39",J3e="_outline_1l44m_52",Q3e="_filled_1l44m_58",eme="_sm_1l44m_67",tme="_md_1l44m_73",ame="_lg_1l44m_79",nme="_buttonContent_1l44m_85",ome="_label_1l44m_93",cme="_placeholder_1l44m_103",ime="_iconsContainer_1l44m_108",rme="_loadingSpinner_1l44m_115",sme="_spin_1l44m_1",dme="_arrowIcon_1l44m_133",lme="_arrowIconOpen_1l44m_141",hme="_dropdown_1l44m_146",ume="_dropdownIn_1l44m_1",pme="_searchContainer_1l44m_171",yme="_searchInputWrapper_1l44m_177",kme="_searchIcon_1l44m_183",mme="_searchInput_1l44m_177",fme="_optionsList_1l44m_208",gme="_noResults_1l44m_231",vme="_option_1l44m_208",Mme="_optionHighlighted_1l44m_261",xme="_optionSelected_1l44m_266",_me="_optionDisabled_1l44m_277",Lme="_optionLabel_1l44m_283",Ime="_checkIcon_1l44m_291",bme="_widthFull_1l44m_299",wme="_width64_1l44m_302",Cme="_width80_1l44m_305",Nme="_width96_1l44m_308",se={container:K3e,selectButton:Z3e,disabled:X3e,error:Y3e,default:"_default_1l44m_48",outline:J3e,filled:Q3e,sm:eme,md:tme,lg:ame,buttonContent:nme,label:ome,placeholder:cme,iconsContainer:ime,loadingSpinner:rme,spin:sme,arrowIcon:dme,arrowIconOpen:lme,dropdown:hme,dropdownIn:ume,searchContainer:pme,searchInputWrapper:yme,searchIcon:kme,searchInput:mme,optionsList:fme,noResults:gme,option:vme,optionHighlighted:Mme,optionSelected:xme,optionDisabled:_me,optionLabel:Lme,checkIcon:Ime,widthFull:bme,width64:wme,width80:Cme,width96:Nme},Sme=({options:e,value:t,onChange:n,placeholder:c="Sélectionner une option...",disabled:i=!1,loading:r=!1,error:s=!1,className:d="",size:h="md",variant:l="default",width:u="w-full"})=>{const[p,y]=k.useState(!1),[m,f]=k.useState(""),[g,M]=k.useState(0),[x,v]=k.useState({top:0,left:0,width:0}),L=k.useRef(null),w=k.useRef(null),C=k.useRef(null),b=k.useMemo(()=>m?e.filter($=>$.label.toLowerCase().includes(m.toLowerCase())):e,[e,m]),_=e.find($=>$.value===t),I=k.useCallback(()=>{if(L.current){const $=L.current.getBoundingClientRect();v({top:$.top,left:$.left,width:$.width})}},[]);k.useEffect(()=>(p&&(I(),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I)),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}),[p,I]),k.useEffect(()=>{const $=q=>{L.current&&!L.current.contains(q.target)&&w.current&&!w.current.contains(q.target)&&(y(!1),f(""))};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]),k.useEffect(()=>{M(0)},[b]);const j=$=>{$.disabled||(n?.($.value,$),y(!1),f(""))},N=$=>{f($.target.value),p||y(!0)},S=$=>{if(!p){($.key==="ArrowDown"||$.key==="Enter")&&y(!0);return}switch($.key){case"ArrowDown":$.preventDefault(),M(q=>q<b.length-1?q+1:q);break;case"ArrowUp":$.preventDefault(),M(q=>q>0?q-1:q);break;case"Enter":$.preventDefault(),b[g]&&j(b[g]);break;case"Escape":y(!1),f("");break}},A=()=>[se.selectButton,se[h],se[l],i?se.disabled:"",s?se.error:"",d].filter(Boolean).join(" "),B=()=>{switch(u){case"w-64":return se.width64;case"w-80":return se.width80;case"w-96":return se.width96;default:return se.widthFull}},T=($,q)=>[se.option,q===g?se.optionHighlighted:"",$.value===t?se.optionSelected:"",$.disabled?se.optionDisabled:""].filter(Boolean).join(" "),V={position:"fixed",top:x.top+(L.current?.offsetHeight||0)+4,left:x.left,width:x.width,zIndex:9999};return o.jsxs("div",{className:`${se.container} ${B()}`,children:[o.jsx("button",{ref:L,className:A(),onClick:()=>!i&&y(!p),onKeyDown:S,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:o.jsxs("div",{className:se.buttonContent,children:[o.jsx("span",{className:`${se.label} ${_?"":se.placeholder}`,children:_?_.label:c}),o.jsxs("div",{className:se.iconsContainer,children:[r&&o.jsx("div",{className:se.loadingSpinner}),o.jsx("svg",{className:`${se.arrowIcon} ${p?se.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&lw.createPortal(o.jsxs("div",{className:`${se.dropdown} ${B()}`,style:V,ref:w,children:[o.jsx("div",{className:se.searchContainer,children:o.jsxs("div",{className:se.searchInputWrapper,children:[o.jsx("svg",{className:se.searchIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),o.jsx("input",{ref:C,type:"text",value:m,onChange:N,placeholder:"Rechercher...",className:se.searchInput,autoFocus:!0})]})}),o.jsx("div",{className:se.optionsList,children:b.length===0?o.jsx("div",{className:se.noResults,children:"Aucun résultat trouvé"}):o.jsx("ul",{role:"listbox",children:b.map(($,q)=>o.jsx("li",{className:T($,q),onClick:()=>j($),onMouseEnter:()=>M(q),role:"option","aria-selected":$.value===t,"aria-disabled":$.disabled,children:o.jsxs("div",{className:se.buttonContent,children:[o.jsx("span",{className:se.optionLabel,title:$.label,children:$.label}),$.value===t&&o.jsx("svg",{className:se.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]})},$.value))})})]}),document.body)]})},jme="_container_uq7pt_1",$me="_item_uq7pt_7",qme="_mainValue_uq7pt_13",Ame="_label_uq7pt_17",zme="_subValue_uq7pt_22",Vme="_subValueWrapper_uq7pt_27",Pme="_subSeparator_uq7pt_32",Ue={container:jme,item:$me,mainValue:qme,label:Ame,subValue:zme,subValueWrapper:Vme,subSeparator:Pme},Tme=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:c="28px",valueFontWeight:i=700,subFontSize:r="16px",subFontWeight:s=600,backgroundColor:d="#ffffff",labelColor:h="#6b7280",valueColor:l="#000000"})=>{const u=(p,y,m)=>{const[f,g]=p.split("/").map(M=>M.trim());return o.jsxs("span",{className:Ue.subValueWrapper,children:[o.jsx("span",{className:Ue.subLeft,style:{color:y},children:f}),o.jsx("span",{className:Ue.subSeparator,children:" / "}),o.jsx("span",{className:Ue.subRight,style:{color:m},children:g})]})};return o.jsxs("div",{className:Ue.container,style:{backgroundColor:d},children:[e&&o.jsxs("div",{className:Ue.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ue.mainValue,style:{fontSize:c,fontWeight:i,color:l},children:e}),o.jsx("div",{className:Ue.label,style:{color:h},children:"DMS"})]}),t.map((p,y)=>o.jsxs("div",{className:Ue.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ue.mainValue,style:{fontSize:c,fontWeight:i,color:l},children:p.value}),o.jsx("div",{className:Ue.label,style:{color:h},children:p.label}),o.jsx("div",{className:Ue.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},Hme="_encours_16ist_1",Dme="_header_16ist_19",Bme="_iconWrap_16ist_27",Rme="_title_16ist_36",Fme="_items_16ist_47",Eme="_spaceEvenly_16ist_56",Ome="_item_16ist_47",Ume="_valueContainer_16ist_86",Wme="_value_16ist_86",Gme="_label_16ist_108",ot={encours:Hme,header:Dme,iconWrap:Bme,title:Rme,items:Fme,spaceEvenly:Eme,item:Ome,valueContainer:Ume,value:Wme,label:Gme},Sc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function Kme(e,t){const n={},c={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=Sc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=Sc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(c.color=e.labelColor),e.labelFontSize!==void 0?c.fontSize=Sc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(c.fontSize=Sc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?c.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(c.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:c}}function Zme(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Xme(e){const{title:t,titleColor:n,titleFontSize:c,titleFontWeight:i,icon:r,iconSize:s=18,iconColor:d,defaultValueFontSize:h,defaultValueFontWeight:l,defaultLabelFontSize:u,defaultLabelFontWeight:p,data:y,style:m,bg:f="#ffffff",width:g,gap:M,className:x,ariaLabel:v}=e,L=r?mt[r]:void 0,w={background:f,width:Sc(g),...m},C={};n&&(C.color=n),c!==void 0&&(C.fontSize=Sc(c)),i!==void 0&&(C.fontWeight=i);const b={};return d&&(b.color=d),o.jsxs("section",{className:`${ot.encours} ${x??""}`,style:w,"aria-label":v??t,children:[o.jsxs("div",{className:ot.header,children:[o.jsx("div",{className:ot.iconWrap,"aria-hidden":!0,style:b,children:L?o.jsx(L,{size:typeof s=="number"?s:void 0}):o.jsx(Zme,{})}),o.jsx("div",{className:ot.title,style:C,children:t})]}),o.jsx("div",{className:`${ot.items} ${M===void 0?ot.spaceEvenly:""}`,role:"list",style:M!==void 0?{gap:`${M}px`}:{},children:y.map((_,I)=>{const{valueStyle:j,labelStyle:N}=Kme(_,{defaultValueFontSize:h,defaultValueFontWeight:l,defaultLabelFontSize:u,defaultLabelFontWeight:p});return o.jsx("div",{className:ot.item,role:"listitem",style:{..._.background?{background:_.background}:{},..._.width?{width:Sc(_.width)}:{}},children:o.jsxs("div",{className:ot.valueContainer,children:[o.jsx("div",{className:ot.value,style:j,children:_.value}),_.label&&o.jsx("div",{className:ot.label,style:N,children:_.label})]})},`${String(_.label??_.value)}-${I}`)})})]})}const Yme=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M480-360 280-559h400z"})),Jme=k.memo(Yme),Qme=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"m280-400 200-201 200 201z"})),e6e=k.memo(Qme),t6e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},J.createElement("path",{fill:"#0087BD",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm3.983-3.55q.1 0 .192-.033a.36.36 0 0 0 .158-.117l4.117-4.133q.15-.15.15-.35a.54.54 0 0 0-.15-.367.52.52 0 0 0-.358-.133.5.5 0 0 0-.359.15l-3.75 3.75L5.35 7.583a.48.48 0 0 0-.7 0q-.15.15-.15.367 0 .216.15.35l1.983 2a.48.48 0 0 0 .35.15"})),a6e=k.memo(t6e),n6e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},J.createElement("path",{fill:"#1E2122",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm0-1h10V3H3z"})),o6e=k.memo(n6e),c6e=({items:e,onSave:t,loading:n,disabled:c,saveLabel:i,savingLabel:r,buttonTitle:s,size:d=16,colors:h={bg:"#DADADA",activeBg:"var(--color-primary)",circle:"#FFFFFF",icon:"#1C1B1F",icon2:"#FFFFFF"},style:l,a11yConfig:u})=>{const[p,y]=k.useState(!1),[m,f]=k.useState(e),[g,M]=k.useState(!1);if(k.useEffect(()=>{M(!0)},[]),k.useEffect(()=>{f(e)},[e]),!g)return null;const x=(w,C)=>{C<4||f(b=>b.map(_=>_.component_key===w?{..._,visible:!_.visible}:_))},v=()=>{t(m),y(!1)},L=Q(u,s);return o.jsxs("div",{style:{position:"relative",display:"inline-block",...l},children:[o.jsxs("div",{onClick:()=>{c||y(!p)},style:{display:"flex",alignItems:"center",cursor:c?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:L,children:[o.jsx(Aj,{width:d,height:d,fill:h?.icon||"currentColor",style:{transition:"color 0.2s"}}),p?o.jsx(e6e,{width:d,height:d,fill:h?.icon||"currentColor"}):o.jsx(Jme,{width:d,height:d,fill:h?.icon||"currentColor"})]}),p&&o.jsxs("div",{style:{position:"absolute",top:"120%",right:0,minWidth:260,background:"#fff",borderRadius:"0.25rem",boxShadow:"0px 3px 7px 0px rgba(17, 20, 21, 0.05),0px 14px 14px 0px rgba(17, 20, 21, 0.04),0px 30px 18px 0px rgba(17, 20, 21, 0.03), 0px 54px 22px 0px rgba(17, 20, 21, 0.01),0px 85px 24px 0px rgba(17, 20, 21, 0)",zIndex:235465456,padding:"0 0 0.5rem 0"},children:[o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:m.map((w,C)=>o.jsxs(k.Fragment,{children:[o.jsxs("li",{onClick:()=>x(w.component_key,C),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:C<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:b=>{C>=4&&(b.currentTarget.style.background="#F9FAFB")},onMouseLeave:b=>{C>=4&&(b.currentTarget.style.background="transparent")},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:w.visible?o.jsx(a6e,{width:20,height:20,fill:h?.activeBg||"var(--color-primary, #008FBB)"}):o.jsx(o6e,{width:20,height:20,fill:"#D1D5DB"})}),o.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:w.label})]}),C===3&&o.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},w.component_key))}),o.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{type:"button",onClick:v,disabled:n,style:{padding:"6px 16px",borderRadius:4,border:"none",background:"var(--color-primary, #008FBB)",color:"#fff",fontSize:"14px",fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"opacity 0.2s",opacity:n?.7:1},children:n?r:i})})]})]})},i6e="_container_zhny9_1",r6e="_card_zhny9_15",s6e="_footer_zhny9_33",d6e="_noPaddingMobile_zhny9_51",ei={container:i6e,card:r6e,footer:s6e,noPaddingMobile:d6e},l6e="_board_95t8m_1",h6e="_clickable_95t8m_21",u6e="_sideBar_95t8m_26",p6e="_boardContent_95t8m_32",y6e="_orange_95t8m_40",k6e="_red_95t8m_44",m6e="_green_95t8m_48",f6e="_grey_95t8m_52",g6e="_lightGrey_95t8m_56",v6e="_big_95t8m_61",M6e="_medium_95t8m_66",x6e="_headerRow_95t8m_70",_6e="_iconWrapper_95t8m_75",L6e="_headerTitle_95t8m_80",I6e="_valueArea_95t8m_89",b6e="_titleWhite_95t8m_99",w6e="_titleBlack_95t8m_103",C6e="_valueWhite_95t8m_108",N6e="_valueBlack_95t8m_112",S6e="_valueBlue_95t8m_116",j6e="_bars_95t8m_121",$6e="_bar_95t8m_121",q6e="_barDark_95t8m_135",A6e="_barDim_95t8m_139",z6e="_predictionSection_95t8m_143",V6e="_predictionHeader_95t8m_155",P6e="_predictionBody_95t8m_162",T6e="_hasPrediction_95t8m_170",Ae={board:l6e,clickable:h6e,sideBar:u6e,boardContent:p6e,orange:y6e,red:k6e,green:m6e,grey:f6e,lightGrey:g6e,big:v6e,medium:M6e,headerRow:x6e,iconWrapper:_6e,headerTitle:L6e,valueArea:I6e,titleWhite:b6e,titleBlack:w6e,valueWhite:C6e,valueBlack:N6e,valueBlue:S6e,bars:j6e,bar:$6e,barDark:q6e,barDim:A6e,predictionSection:z6e,predictionHeader:V6e,predictionBody:P6e,hasPrediction:T6e},H6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Ae.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Ae.bar} ${r<c?"":e?Ae.barDark:Ae.barDim}`},r))})},St=({a11yConfig:e,iconName:t,label:n,value:c,backgroundColor:i="green",bars:r,lightBars:s=5,size:d="big",valueScale:h,width:l,height:u,className:p="",style:y,titleColor:m="white",valueColor:f="white",titleFontSize:g,titleFontWeight:M,valueFontSize:x,valueFontWeight:v,barColor:L,justifyContent:w="space-between",alignItems:C="flex-start",cardGap:b="",onClick:_,iconColor:I,titleKey:j,predictionValue:N,predictionLabel:S})=>{const A=r!=="none",B=r==="endingDark",{padding:T,...V}=y||{},$=l===void 0&&u===void 0&&i===void 0&&Object.keys(V).length===0?void 0:{...l!==void 0?{width:l}:{},...u!==void 0?{height:u}:{},...i!==void 0?{backgroundColor:i}:{},...V},q=`${Ae.board} ${Ae[d]} ${N!==void 0?Ae.hasPrediction:""} ${p}`;return o.jsxs("div",{className:q,onClick:_,style:h!==void 0?{...$,"--ds-value-scale":h}:$,children:[L&&o.jsx("div",{className:Ae.sideBar,style:{backgroundColor:L}}),o.jsxs("div",{className:Ae.boardContent,style:{padding:T,gap:b},children:[o.jsxs("div",{className:Ae.headerRow,style:{justifyContent:w,alignItems:C},children:[t&&o.jsx("div",{className:Ae.iconWrapper,style:{color:I},children:t}),o.jsx("div",{className:`${Ae.headerTitle} header-title-data-board`,children:o.jsx("span",{title:Q(e,j),"aria-label":e?.description,style:{color:m,...g?{fontSize:g}:{},...M?{fontWeight:M}:{}},children:n})}),A?o.jsx(H6e,{endingDark:B,lightCount:s}):null]}),o.jsx("div",{className:Ae.valueArea,style:{color:f,...x?{fontSize:x}:{},...v?{fontWeight:v}:{}},children:c})]}),N!==void 0&&o.jsxs("div",{className:Ae.predictionSection,children:[o.jsx("div",{className:Ae.predictionHeader,children:S??"PRED."}),o.jsx("div",{className:Ae.predictionBody,children:N})]})]})},D6e="_wrapper_1ydle_10",B6e="_hosp_1ydle_19",R6e="_headerRow_1ydle_54",F6e="_iconWrapper_1ydle_61",E6e="_headerTitle_1ydle_67",O6e="_hospValue_1ydle_76",U6e="_side_1ydle_88",W6e="_mini_1ydle_100",G6e="_miniLabel_1ydle_131",K6e="_miniValue_1ydle_140",Z6e="_miniBars_1ydle_150",X6e="_bars_1ydle_155",Y6e="_bar_1ydle_155",J6e="_barDark_1ydle_169",Q6e="_barDim_1ydle_173",ze={wrapper:D6e,hosp:B6e,headerRow:R6e,iconWrapper:F6e,headerTitle:E6e,hospValue:O6e,side:U6e,mini:W6e,miniLabel:G6e,miniValue:K6e,miniBars:Z6e,bars:X6e,bar:Y6e,barDark:J6e,barDim:Q6e},e8e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${ze.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${ze.bar} ${r<c?"":e?ze.barDark:ze.barDim}`},r))})},Qq=({left:e,right:t,className:n="",style:c,miniTilesCount:i=3})=>{const r=e.bars??"endingDark",s=r!=="none",d=r==="endingDark",h={...c,"--mini-tiles-count":i};return o.jsxs("div",{className:`${ze.wrapper} ${n} data-four-boards`,style:h,children:[o.jsxs("div",{className:`${ze.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},title:Q(e.a11yConfig,e.titleKey),children:[o.jsxs("div",{className:ze.headerRow,children:[o.jsxs("div",{className:`${ze.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&o.jsx("span",{style:{color:e.iconColor},children:e.iconName}),o.jsx("span",{className:ze.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},title:Q(e.a11yConfig,e.titleKey),children:e.label})]}),s?o.jsx(e8e,{endingDark:d,lightCount:e.lightBars??5}):null]}),o.jsx("div",{className:ze.hospValue,style:{color:e.valueColor||"white",...e.valueScale!==void 0?{"--ds-value-scale":e.valueScale}:{},...e.valueFontSize?{fontSize:e.valueFontSize}:{},...e.valueFontWeight?{fontWeight:e.valueFontWeight}:{}},children:e.value})]}),o.jsx("div",{className:ze.side,children:t.map((l,u)=>o.jsxs("div",{className:`${ze.mini} ${l.className||""} icon-wrapper-data-four-boards`,onClick:l.onClick,style:{...l.width?{width:l.width}:{},...l.height?{height:l.height}:{},...l.backgroundColor?{backgroundColor:l.backgroundColor}:{},...l.style||{}},title:Q(l.a11yConfig,l.titleKey),children:[o.jsxs("span",{className:ze.miniLabel,style:{color:l.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...l.titleFontSize?{fontSize:l.titleFontSize}:{},...l.titleFontWeight?{fontWeight:l.titleFontWeight}:{}},title:Q(l.a11yConfig,l.titleKey),children:[l.iconName&&o.jsx("span",{style:{color:l.iconColor},children:l.iconName}),l.label]}),o.jsx("span",{className:`${ze.miniValue} mini-value-data-four-boards`,style:{color:l.valueColor||"white",textAlign:"right",...l.valueScale!==void 0?{"--ds-value-scale":l.valueScale}:{},...l.valueFontSize?{fontSize:l.valueFontSize}:{},...l.valueFontWeight?{fontWeight:l.valueFontWeight}:{}},children:l.value}),o.jsx("div",{className:ze.miniBars})]},l.id??`${l.label}-${u}`))})]})},t8e=({items:e,footerLabel:t,width:n,height:c,size:i=320,style:r,className:s="",backgroundColor:d,titleFontSize:h,titleFontWeight:l,valueFontSize:u,valueFontWeight:p,noPaddingLeftRight:y=!1,onItemClick:m})=>{const f={width:n??i,height:c,backgroundColor:d??"var(--ds-navy)",...r},g=e[0],M=e[1],x=e.slice(2,5);return o.jsxs("div",{style:f,className:`${ei.container} ${y?ei.noPaddingMobile:""} ${s}`,children:[o.jsxs("div",{className:ei.card,children:[g?o.jsx(St,{a11yConfig:g.a11yConfig,label:g.label,value:g.value,backgroundColor:g.backgroundColor,bars:g.bars,lightBars:g.lightBars,size:g.size??"big",valueScale:g.valueScale,width:g.width,height:g.height,titleColor:"white",valueColor:"white",titleFontSize:g.titleFontSize??h,titleFontWeight:g.titleFontWeight??l,valueFontSize:g.valueFontSize??u,valueFontWeight:g.valueFontWeight??p,titleKey:g.titleKey,onClick:v=>m?.(0,v)}):null,M&&x.length>0?o.jsx(Qq,{left:{a11yConfig:M.a11yConfig,id:M.id,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,valueScale:M.valueScale,width:M.width,height:M.height,titleFontSize:M.titleFontSize??h,titleFontWeight:M.titleFontWeight??l,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,titleKey:M.titleKey,onClick:v=>m?.(1,v)},right:x.map((v,L)=>({a11yConfig:v.a11yConfig,id:v.id,label:v.label,value:v.value,backgroundColor:v.backgroundColor,bars:v.bars,lightBars:v.lightBars,valueScale:v.valueScale,width:v.width,height:v.height,titleFontSize:v.titleFontSize??h,titleFontWeight:v.titleFontWeight??l,valueFontSize:v.valueFontSize??u,valueFontWeight:v.valueFontWeight??p,titleKey:v.titleKey,onClick:w=>m?.(2+L,w)}))}):M&&x.length===0?o.jsx(St,{a11yConfig:M.a11yConfig,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,size:M.size??"big",valueScale:M.valueScale,width:M.width,height:M.height,titleColor:"white",valueColor:"white",titleFontSize:M.titleFontSize??h,titleFontWeight:M.titleFontWeight??l,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,onClick:v=>m?.(1,v)}):null]}),t&&o.jsx("div",{className:ei.footer,children:t})]})},a8e=({x:e,y:t,width:n,payload:c,fontSize:i,fontWeight:r,stroke:s})=>o.jsx("g",{transform:`translate(${e},${t})`,children:o.jsx("foreignObject",{x:-n,y:-35,width:n,height:70,style:{overflow:"visible"},children:o.jsx("div",{style:{fontSize:i,fontWeight:r,color:s,lineHeight:"1.2",display:"flex",justifyContent:"flex-end",textAlign:"right",alignItems:"center",height:"100%",width:"100%",paddingRight:"8px",boxSizing:"border-box"},children:o.jsx("span",{style:{overflowWrap:"break-word",whiteSpace:"normal",display:"block",maxWidth:"100%"},children:c.value})})})}),n8e=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:c=!0,backgroundColor:i="transparent",legendTextColor:r="var(--color-text)",barHeight:s=40,yAxisWidth:d=120,fontSize:h="12px",fontWeight:l="400",domain:u,xAxisLabel:p,margin:y={top:20,right:60,bottom:40,left:0},valueFormatter:m,tickFormatter:f,labelDataKey:g="percentage"})=>{const M=(y.top??20)+(y.bottom??40)+e.length*(s+20),x=Math.max(M,t),v=k.useMemo(()=>{if(!e||e.length===0)return d;const _=(parseFloat(h)||12)*.7,j=Math.max(...e.map(N=>(N.label||"").length))*_+16;return Math.min(Math.max(j,40),d)},[e,h,d]),L=b=>f?f(b):b?.toString()||"",w=b=>m&&g==="value"?m(b):b==null||b===""?"":g==="percentage"?`${b}%`:b.toString(),C=(b,_,I)=>{if(typeof b!="number")return b;const j=m?m(b):b.toString(),N=I?.payload?.percentage;return typeof N=="number"&&Number.isFinite(N)&&g==="percentage"?`${j} (${N.toFixed(1)}%)`:j};return o.jsx("div",{style:{backgroundColor:i,width:"100%"},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:x,children:o.jsxs(a.BarChart,{data:e,layout:"vertical",margin:y,children:[o.jsx(a.CartesianGrid,{opacity:.4,stroke:"#E5E7EB",vertical:!1,horizontal:!0}),o.jsx(a.XAxis,{type:"number",domain:u||[0,"auto"],axisLine:!1,tickLine:!1,fontSize:h,fontWeight:l,stroke:r,tickFormatter:L,label:p?{value:p,position:"insideBottom",offset:-10,style:{textAnchor:"middle",fill:r,fontSize:12,fontWeight:"500"}}:void 0}),o.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:v,interval:0,fontSize:h,fontWeight:l,tick:o.jsx(a8e,{fontSize:h,fontWeight:l,stroke:r})}),c&&o.jsx(a.Tooltip,{formatter:C,labelStyle:{color:"var(--color-text)"}}),o.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s,children:o.jsx(a.LabelList,{dataKey:g,position:"right",offset:10,formatter:w,fill:r,fontSize:h,fontWeight:l})})]})})})},o8e="_menu_10i6j_1",c8e="_menuRow_10i6j_18",i8e="_separator_10i6j_33",r8e="_rowLabel_10i6j_39",s8e="_rowLeadingIcon_10i6j_47",d8e="_rowIcon_10i6j_54",Fc={menu:o8e,menuRow:c8e,separator:i8e,rowLabel:r8e,rowLeadingIcon:s8e,rowIcon:d8e},l8e=k.forwardRef(function({isVisible:t,onClose:n,items:c,style:i,position:r,bg:s},d){const h=k.useRef(null),l=d||h;if(k.useEffect(()=>{if(!t)return;const y=m=>{l.current&&!l.current.contains(m.target)&&n?.()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[t,n]),!t)return null;const p={...{top:r?.top,left:r?.left,right:r?.right,bottom:r?.bottom},...s&&{backgroundColor:s},...i};return o.jsx("div",{ref:l,role:"menu",className:Fc.menu,style:p,children:c.map(y=>{if(y.type==="separator")return o.jsx("hr",{className:Fc.separator},y.id);const m=y,f=m.color?{color:m.color}:{},g=m.closeOnClick!==!1;return o.jsxs("button",{role:"menuitem",className:Fc.menuRow,style:f,onClick:()=>{m.onClick?.(),g&&n?.()},children:[o.jsxs("span",{className:Fc.rowLabel,children:[m.leadingIcon&&o.jsx("span",{className:Fc.rowLeadingIcon,children:m.leadingIcon}),o.jsx("span",{children:m.label})]}),m.icon&&o.jsx("span",{className:Fc.rowIcon,children:m.icon})]},m.id)})})}),eA=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:c,profileHref:i,profileLinkTarget:r="_self",backgroundColor:s="transparent",textColor:d="inherit",roleColor:h="#888",avatarSize:l="32px",padding:u="10px",gap:p="12px",emailFontSize:y="14px",emailFontWeight:m=600,roleFontSize:f="12px",roleFontWeight:g,avatarColor:M="#5b8fb9",backgroundColorAvatar:x="#f1f4f5",dropdownMenuItems:v,dropdownMenuStyle:L,dropdownMenuOffset:w,statusDotColor:C,a11yConfig:b,style:_,className:I=""})=>{const{user:j}=ht(),N=e||j,{currentTheme:S,switchTheme:A}=pL(),B=k.useRef(null),T=k.useRef(null),[V,$]=k.useState(!1),[q,P]=k.useState({}),H=k.useMemo(()=>{const Y=[],ee=({variant:ue})=>ue==="sun"?o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})}):o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(Y.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),Y.push({id:"sep-profile",type:"separator"}));const ie=S==="dark";return Y.push({id:"theme",type:"action",label:ie?"Mode clair":"Mode sombre",icon:o.jsx(ee,{variant:ie?"sun":"moon"}),onClick:()=>{A(ie?"light":"dark")}}),(t||c)&&(Y.push({id:"sep-theme",type:"separator"}),Y.push({id:"logout",type:"action",label:"Se déconnecter",danger:!0,onClick:()=>{if(t){if(typeof window>"u")return;n==="_blank"?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t);return}c?.()}})),Y},[S,t,n,c,i,r,A]),D=v??H,E=()=>{if(!B.current){$(Y=>!Y);return}if(!V){const Y=B.current.getBoundingClientRect(),ee=window.innerWidth,ie=window.innerHeight,ue=200,re=200,W=4,O=w?.x??0,ne=w?.y??0,Be=ee-Y.right>=ue+W;P(Be?{top:Y.bottom-re+ne,left:Y.right+W+O}:{bottom:ie-Y.top+ne,left:Y.left+O})}$(Y=>!Y)};if(k.useEffect(()=>{if(!V||!B.current)return;const Y=()=>{const ee=B.current.getBoundingClientRect(),ie=window.innerWidth,ue=window.innerHeight,re=200,W=200,O=4,ne=w?.x??0,we=w?.y??0,ge=ie-ee.right>=re+O;P(ge?{top:ee.bottom-W+we,left:ee.right+O+ne}:{bottom:ue-ee.top+we,left:ee.left+ne})};return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),()=>{window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y)}},[V,w]),k.useEffect(()=>{if(!V||!B.current||!T.current)return;const Y=()=>{const ie=B.current.getBoundingClientRect(),ue=T.current.getBoundingClientRect(),re=w?.x??0,W=w?.y??0;P(O=>O.left!==void 0&&O.top!==void 0&&O.left>=ie.right-1?{top:ie.bottom-ue.height+W,left:O.left+re}:O)},ee=requestAnimationFrame(()=>{setTimeout(Y,0)});return()=>cancelAnimationFrame(ee)},[V,w]),!N)return null;const G=N,oe=parseInt(l,10)||40,ae=`${oe*.375}px`,Me=`${oe*1.375}px`,me=`${oe*.2}px`,Ce=`${oe*.6}px`,he=()=>{const Y=parseInt(l,10)||40,ee=Math.max(8,Y*.34375),ie=Math.max(2,Y*.05);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[G.image?o.jsx("img",{src:G.image,alt:`${G.prenom} ${G.nom}`,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):o.jsxs("div",{style:{width:l,height:l,position:"relative",borderRadius:"50%",backgroundColor:x,overflow:"hidden",userSelect:"none"},children:[o.jsx("div",{style:{width:ae,height:ae,borderRadius:"50%",backgroundColor:M,position:"absolute",top:me,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),o.jsx("div",{style:{width:Me,height:Me,borderRadius:"50%",backgroundColor:M,position:"absolute",top:Ce,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),C&&o.jsx("div",{style:{position:"absolute",bottom:ie,right:ie,width:`${ee}px`,height:`${ee}px`,borderRadius:"50%",backgroundColor:C,border:"2px solid white",zIndex:10}})]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[o.jsx("span",{style:{fontWeight:m,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:G.email,children:G.email}),o.jsx("span",{style:{color:h,fontSize:f,fontWeight:g,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:G.role,children:G.role})]})]})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:B,className:`user-info ${I}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:u,backgroundColor:s,gap:p,color:d,width:"100%",boxSizing:"border-box",cursor:"pointer",userSelect:"none",..._},onClick:E,title:Q(b,G.role),role:"button",tabIndex:0,children:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:o.jsx(he,{})})}),o.jsx(l8e,{ref:T,isVisible:V,onClose:()=>$(!1),items:D,style:L,position:q})]})},h8e="_navItem_16uqf_1",u8e="_label_16uqf_14",p8e="_icon_16uqf_26",h1={navItem:h8e,label:u8e,icon:p8e},Xw=({label:e,labelKey:t,onClick:n,href:c,isActive:i,icon:r,style:s,className:d="",highlightColor:h="#00aec7",color:l="#333",activeColor:u="#00aec7",highlightBackgroundColor:p="rgba(0, 0, 0, 0.05)",fontSize:y="15px",fontWeight:m="500",sidebarCollapsed:f=!1,padding:g="10px 16px",borderWidth:M="4px",iconGap:x="12px",disabled:v=!1,disabledColor:L,a11yConfig:w})=>{const C=()=>{v||n?.()},b=o.jsxs(o.Fragment,{children:[r&&o.jsx("span",{className:h1.icon,style:{marginRight:f?0:x},children:r}),!f&&o.jsx("span",{className:h1.label,children:e})]}),_=()=>{if(!i)return"transparent";const j=N=>{const S=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(N);return S?{r:parseInt(S[1],16),g:parseInt(S[2],16),b:parseInt(S[3],16)}:null};if(h.startsWith("#")){const N=j(h);if(N)return`rgba(${N.r}, ${N.g}, ${N.b}, 0.08)`}else if(h.startsWith("rgb")){const N=h.match(/\d+/g);if(N&&N.length>=3)return`rgba(${N[0]}, ${N[1]}, ${N[2]}, 0.08)`}return p},I={onClick:C,className:`${h1.navItem} ${i?h1.active:""} ${d} ${v?h1.disabled:""}`,style:{padding:g,color:i?u:v?L||"#999":l,borderLeft:i?`${M} solid ${h}`:`${M} solid transparent`,backgroundColor:_(),fontSize:y,fontWeight:m,cursor:v?"not-allowed":"pointer",textDecoration:"none",...s},"aria-disabled":v};return c&&!n&&!v?o.jsx("a",{href:c,...I,title:Q(w,t),children:b}):o.jsx("div",{...I,role:n?"button":void 0,tabIndex:n&&!v?0:void 0,title:Q(w,t),children:b})},y8e="_navbar_agnn2_1",k8e="_topSection_agnn2_9",m8e="_sectionsContainer_agnn2_14",f8e="_sectionTitle_agnn2_20",g8e="_sectionItems_agnn2_25",v8e="_bottomSection_agnn2_30",M8e="_versionContainer_agnn2_49",ut={navbar:y8e,topSection:k8e,sectionsContainer:m8e,sectionTitle:f8e,sectionItems:g8e,bottomSection:v8e,versionContainer:M8e},x8e=({logoProps:e,logoSpacing:t,navItems:n,padding:c="24px 16px",sectionSpacing:i="32px",itemSpacing:r="4px",backgroundColor:s="#fff",highlightColor:d="#00aec7",highlightBackgroundColor:h="rgba(0, 0, 0, 0.05)",version:l,navSectionStyle:u,navLinkStyle:p,navItemPadding:y="10px 16px",navItemBorderWidth:m="4px",navItemIconGap:f="12px",navItemFontSize:g="15px",navItemFontWeight:M="500",navItemColor:x,sectionTitlePadding:v="16px",sectionTitleFontSize:L="11px",sectionTitleColor:w="#999",sectionTitleWeight:C="500",versionFontSize:b="12px",versionFontWeight:_="400",versionColor:I="#999",userInfoProps:j,style:N,className:S="",width:A="280px",showLogo:B=!0,versionA11yConfig:T,displayNone:V=!1})=>{const $=ht(),q=$.activeNav,P=$.setActiveNav,H=$.user,D=j.user||H;return o.jsxs("div",{className:`${ut.navbar} ${S}`,style:{width:A,backgroundColor:s,padding:c,display:V?"none":"flex",...N},children:[o.jsxs("div",{className:ut.topSection,style:{gap:t},children:[B&&o.jsx("div",{className:ut.logoContainer,children:o.jsx(uL,{...e})}),o.jsx("div",{className:ut.sectionsContainer,style:{gap:i},children:n.map((E,G)=>o.jsxs("div",{className:ut.section,children:[E.title&&o.jsx("div",{className:ut.sectionTitle,title:Q(E.a11yConfig,E.titleKey),style:{fontSize:L,color:w,padding:v,fontWeight:C,border:"4px solid transparent",...u},children:E.title}),o.jsx("div",{className:ut.sectionItems,style:{gap:r},children:E.items.map(oe=>o.jsx(Xw,{...oe,isActive:oe.isActive===null?oe.isActive:q===oe.id,onClick:()=>{oe.onClick&&oe.onClick(),oe.isActive==null&&P(oe.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:h,padding:y,borderWidth:m,iconGap:f,fontSize:g,fontWeight:M,color:x,style:p},oe.id))})]},G))})]}),o.jsxs("div",{className:ut.bottomSection,style:{gap:t},children:[o.jsx(eA,{...j,user:D}),l&&o.jsx("div",{className:ut.versionContainer,title:Q(T,l),style:{fontSize:b,fontWeight:_,color:I},children:l})]})]})},_8e="_container_4qege_1",L8e="_titleContainer_4qege_10",I8e="_title_4qege_10",b8e="_inlineToggleContainer_4qege_24",w8e="_rightContentContainer_4qege_30",u1={container:_8e,titleContainer:L8e,title:I8e,inlineToggleContainer:b8e,rightContentContainer:w8e},C8e=({className:e="",style:t,fontSize:n="20px",fontWeight:c="bold",color:i="#000",padding:r="0",margin:s,backgroundColor:d,width:h,height:l,border:u,borderRadius:p,navItems:y,formatTitle:m=M=>M,rightContent:f,inlineToggle:g})=>{const{activeNav:M}=ht(),x=y.find(L=>L.id===M),v=m(x?x.label:M);return v?o.jsxs("div",{className:`${u1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:h,height:l,border:u,borderRadius:p,...t},children:[o.jsxs("div",{className:u1.titleContainer,children:[o.jsx("div",{className:u1.title,style:{fontSize:n,fontWeight:c,color:i},children:v}),g&&o.jsx("div",{className:u1.inlineToggleContainer,children:g})]}),f&&o.jsx("div",{className:u1.rightContentContainer,children:f})]}):null},N8e="_navItem_1hg26_1",S8e="_navItemIcon_1hg26_21",j8e="_navItemLabel_1hg26_29",$8e="_navItemCount_1hg26_36",q8e="_navItemIndicator_1hg26_49",p1={navItem:N8e,navItemIcon:S8e,navItemLabel:j8e,navItemCount:$8e,navItemIndicator:q8e},tA=({a11yConfig:e,label:t,isActive:n,onClick:c,href:i,labelKey:r,icon:s,count:d,activeColor:h="#00aec7",inactiveColor:l="#666",activeBackgroundColor:u="transparent",countBackgroundColor:p,countColor:y="#fff",countBorderRadius:m="10px",countPadding:f="2px 6px",countFontSize:g="12px",countFontWeight:M="500",indicatorColor:x="#00aec7",indicatorHeight:v="3px",padding:L="8px 4px",fontSize:w="14px",fontWeight:C="500",gap:b="8px",style:_,className:I="",disabled:j=!1,onNavigate:N})=>{const S=()=>{j||(c?.(),i&&(N?N(i):window.location.href=i))};return o.jsxs("div",{className:`${p1.navItem} ${I}`,onClick:S,title:Q(e,r),style:{gap:b,padding:L,color:n?h:l,backgroundColor:n?u:"transparent",fontSize:w,fontWeight:C,..._},children:[s&&o.jsx("span",{className:p1.navItemIcon,children:s}),o.jsx("span",{className:p1.navItemLabel,children:t}),d!==void 0&&o.jsx("span",{className:p1.navItemCount,style:{backgroundColor:p,color:y,borderRadius:m,padding:f,fontSize:g,fontWeight:M},children:d}),n&&!j&&o.jsx("div",{className:p1.navItemIndicator,style:{height:v,backgroundColor:x}})]})},A8e="_container_13hsa_1",z8e="_groupHeader_13hsa_8",V8e="_groupHeaderLeft_13hsa_18",P8e="_groupIcon_13hsa_23",T8e="_dropdown_13hsa_29",H8e="_item_13hsa_42",D8e="_itemIcon_13hsa_65",B8e="_chevron_13hsa_72",R8e="_chevronOpen_13hsa_79",pt={container:A8e,groupHeader:z8e,groupHeaderLeft:V8e,groupIcon:P8e,dropdown:T8e,item:H8e,itemIcon:D8e,chevron:B8e,chevronOpen:R8e},F8e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M480-344 240-584l43-43 197 197 197-197 43 43z"})),P1=k.memo(F8e),aA=({groups:e,activeItemId:t,onItemClick:n,style:c,className:i,bgColor:r="transparent",color:s="var(--color-text)",headerBgColor:d="var(--color-indicator)",headerColor:h="var(--color-text)",headerBorderBottomColor:l="var(--color-border)",dropdownBgColor:u="var(--color-background)",itemBgColor:p="transparent",itemHoverBgColor:y="rgba(0,0,0,0.05)",itemColor:m="var(--color-text)",itemActiveColor:f="var(--color-primary)",itemActiveBorderColor:g="var(--color-primary)",itemDividerColor:M="var(--color-border)",iconColor:x="#555555",activeIconColor:v="var(--color-primary)",headerIconColor:L="var(--color-text)",chevronColor:w="var(--color-text)",iconSize:C=22,headerPadding:b="14px 20px",itemPadding:_="14px 20px",iconGap:I=14,borderRadius:j=0})=>{const[N,S]=k.useState(""),A=k.useRef(null);k.useEffect(()=>{const T=V=>{A.current&&!A.current.contains(V.target)&&S("")};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const B={backgroundColor:r,color:s,borderRadius:j,...c};return o.jsx("nav",{ref:A,className:[pt.container,i].filter(Boolean).join(" "),style:B,children:e.map(T=>{const V=N===T.id,$={backgroundColor:d,color:h,padding:b,borderBottom:`1px solid ${l}`,gap:I},q={backgroundColor:u};return o.jsxs("div",{children:[o.jsxs("div",{className:pt.groupHeader,style:$,onClick:()=>S(V?"":T.id),role:"button","aria-expanded":V,children:[o.jsxs("div",{className:pt.groupHeaderLeft,style:{gap:I},children:[T.icon&&o.jsx("span",{className:pt.groupIcon,style:{color:L,width:C,height:C},children:T.icon}),o.jsx("span",{children:T.label})]}),o.jsx("span",{className:[pt.chevron,V?pt.chevronOpen:""].join(" "),style:{color:w},children:o.jsx(P1,{width:18,height:18})})]}),V&&o.jsx("div",{className:pt.dropdown,style:q,children:T.items.map(P=>{const H=P.id===t,D={padding:_,gap:I,color:H?f:m,backgroundColor:p,"--item-border-width":H?"4px":"1px","--item-border-color":H?g:M};return o.jsxs("div",{className:pt.item,style:D,onClick:()=>{n?.(T.id,P.id),S("")},role:"menuitem",onMouseEnter:E=>{H||(E.currentTarget.style.backgroundColor=y)},children:[P.icon&&o.jsx("span",{className:pt.itemIcon,style:{color:H?v:x,width:C,height:C},children:P.icon}),o.jsx("span",{children:P.label})]},P.id)})})]},T.id)})})},E8e="_subheaderContent_1glo8_1",O8e="_navContainer_1glo8_11",U8e="_rightContent_1glo8_45",zb={subheaderContent:E8e,navContainer:O8e,rightContent:U8e},W8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:c,width:i,height:r="auto",border:s,borderBottom:d="none",itemGap:h="24px",actionsGap:l="16px",itemPadding:u="12px 0",itemFontSize:p="14px",itemFontWeight:y="500",activeItemColor:m="#00aec7",inactiveItemColor:f="#5c6975",indicatorHeight:g="3px",showDraggable:M=!1,showLegend:x=!1,showData:v=!1,className:L="",style:w,countBackgroundColor:C,countColor:b,countBorderRadius:_,countPadding:I,countFontSize:j,countFontWeight:N,navContainerClassName:S,navContainerStyle:A,rightContentClassName:B,rightContentStyle:T,rightActions:V,activeSwitcherColor:$,inactiveSwitcherColor:q,isMobile:P=!1,onNavigate:H})=>{const{activeSubNav:D,setActiveSubNav:E,navCounts:G,activeNav:oe}=ht();if(P){const ae=e.find(me=>me.id===D)||e[0],Me=[{id:"current-group",label:ae?.label||oe?.toUpperCase()||"MENU",icon:ae?.icon,items:e.map(me=>({id:me.id,label:me.label,icon:me.icon}))}];return o.jsx("div",{className:L,style:w,children:o.jsx(aA,{groups:Me,activeItemId:D,onItemClick:(me,Ce)=>{const he=e.find(Y=>Y.id===Ce);he&&(he.onClick&&he.onClick(),he.href&&(H?H(he.href):he.onNavigate?he.onNavigate(he.href):window.location.href=he.href),E(Ce))},headerBgColor:t})})}return o.jsxs("div",{className:`${zb.subheaderContent} ${L}`,style:{backgroundColor:t,padding:n,margin:c,width:i,height:r,border:s,borderBottom:d,...w},children:[o.jsx("div",{className:`${zb.navContainer} ${S||""}`,style:{gap:h,...A},children:e.map(ae=>{const Me=ae.count!==void 0?ae.count:G[ae.id],me=D===ae.id||ae.isActive;return o.jsx(tA,{...ae,onNavigate:H||ae.onNavigate,count:Me,isActive:me,onClick:()=>{ae.onClick&&ae.onClick(),E(ae.id)},activeColor:m,inactiveColor:f,countBackgroundColor:C,countColor:b,countBorderRadius:_,countPadding:I,countFontSize:j,countFontWeight:N,indicatorColor:m,indicatorHeight:g,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:ae.style},ae.id)})}),o.jsxs("div",{className:`${zb.rightContent} ${B||""}`,style:{gap:l,...T},children:[M&&o.jsx(aL,{size:20,colors:{bg:$,activeBg:q,icon:"#1C1B1F",icon2:"#FFFFFF"}}),x&&o.jsx(nL,{size:20,colors:{bg:$,activeBg:q,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&o.jsx(oL,{size:20,colors:{bg:$,activeBg:q,icon:"#1C1B1F",icon2:"#FFFFFF"}}),V]})]})},G8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:c="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:h=""})=>{const[l,u]=k.useState(!1),{currentTheme:p,switchTheme:y}=pL(),m=p!="dark",f=()=>{y(m?"dark":"light"),e?.()};return k.useEffect(()=>{u(!0)},[]),!l||!p?o.jsx(o.Fragment,{}):o.jsx("div",{className:`theme-switcher ${h}`,onClick:f,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i,padding:r,borderRadius:s,transition:"all 0.3s ease",...d},children:m?o.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},K8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[c,i]=k.useState({sortBy:e,sortOrder:t,filters:{}}),r=k.useCallback(s=>{let d="asc";c.sortBy===s&&(d=c.sortOrder==="asc"?"desc":"asc");const h={...c,sortBy:s,sortOrder:d};i(h),n(s,d)},[c,n]);return{tableState:c,handleSort:r}},Z8e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M440-800v487L216-537l-56 57 320 320 320-320-56-57-224 224v-487z"})),X8e=k.memo(Z8e),Y8e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487z"})),J8e=k.memo(Y8e),Q8e=({columns:e,sortBy:t,sortOrder:n,onSort:c,removeLabelSpan:i=!1})=>o.jsx("thead",{children:o.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,h=!!r.sortable;return o.jsx("th",{className:`${r.className||""}${h?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>h&&c(String(r.key)),title:Q(r.a11yConfig,r.titleKey),children:o.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:o.jsx("span",{children:r.label}),h&&o.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?o.jsx(J8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):o.jsx(X8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),efe=({data:e,columns:t,rowKey:n,onRowClick:c,isLoading:i,text:r,rowStyle:s,rowClassName:d,renderSeparator:h})=>!e.length&&!i?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:o.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):o.jsx("tbody",{children:e.map((l,u)=>{const p=l[n],y=typeof p=="string"||typeof p=="number"?p:u,m=h?h(l):null;return o.jsx("tr",{onClick:()=>c&&c(l),style:{cursor:c?"pointer":"default",...s?s(l):{}},className:d?d(l,u):"",children:m?o.jsx("td",{colSpan:t.length,children:m}):t.map((f,g)=>o.jsx("td",{style:{width:f.width,textAlign:f.align||"left"},className:f.className,children:f.render?f.render(l):l[f.key]},`${String(f.key)}-${g}`))},y)})}),tfe=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:c,hasMore:i,text:r,isLoading:s})=>{const{page:d,pageSize:h,total:l}=e,u=h===-1?l:h,p=Math.ceil(l/u)||1,y=Math.min(Math.max(1,d),p),m=l===0?0:(y-1)*u+1,f=Math.min(y*u,l),g=x=>{t({page:x})},M=k.useMemo(()=>{if(p<=6)return Array.from({length:p},(j,N)=>N+1);const L=Math.max(y-1,1),w=Math.min(y+1,p),C=L>2,b=w<p-2,_=1,I=p;if(!C&&b)return[...Array.from({length:5},(S,A)=>A+1),"...",p];if(C&&!b){const N=Array.from({length:5},(S,A)=>p-5+A+1);return[_,"...",...N]}if(C&&b){const j=Array.from({length:w-L+1},(N,S)=>L+S);return[_,"...",...j,"...",I]}return[]},[y,p]);return o.jsxs("div",{className:"table-pagination",children:[o.jsx("div",{className:"pagination-summary",children:l>0?o.jsx("span",{children:r?.itemsRange?r.itemsRange(m,f,l):o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:[m,"–",f]})," ","sur ",o.jsx("b",{children:l.toLocaleString()})," éléments"]})}):o.jsx("span",{children:r?.noResults||"0 résultats"})}),o.jsx("div",{className:"pagination-spacer"}),!c&&h!==-1&&p>1&&o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:()=>g(1),disabled:y===1,title:r?.first||"Premier",children:"<<"}),o.jsx("button",{className:"pagination-btn",onClick:()=>g(y-1),disabled:y===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((x,v)=>x==="..."?o.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},v):o.jsx("button",{className:`pagination-btn ${x===y?"active":""}`,onClick:()=>g(x),children:x},v)),o.jsx("button",{className:"pagination-btn",onClick:()=>g(y+1),disabled:y===p,title:r?.next||"Suivant",children:">"}),o.jsx("button",{className:"pagination-btn",onClick:()=>g(p),disabled:y===p,title:r?.last||"Dernier",children:">>"})]}),!c&&n&&i&&o.jsx("div",{className:"pagination-load-more",children:o.jsx("button",{className:"btn-load-more",onClick:n,disabled:s,style:{padding:"8px 16px",backgroundColor:"white",border:"1px solid #ddd",borderRadius:"6px",cursor:s?"wait":"pointer",color:"#555",fontWeight:600},children:s?r?.loading||"Chargement...":r?.loadMore||"Charger plus"})})]})},nA=({data:e,columns:t,isLoading:n,pagination:c,onPaginationChange:i,onSortChange:r,rowKey:s,loaderSize:d=40,stickyHeader:h=!0,height:l,minHeight:u="200px",text:p,onLoadMore:y,infiniteScroll:m,hasMore:f,tableState:g,className:M,style:x,rowStyle:v,onRowClick:L,rowClassName:w,titleKey:C,removeLabelSpan:b=!1,a11yConfig:_,renderSeparator:I})=>{const j=k.useMemo(()=>({...p}),[p]),N=k.useRef(null);k.useEffect(()=>{if(!m||!y||!f||n)return;const $=new IntersectionObserver(q=>{q[0].isIntersecting&&y()},{threshold:.1});return N.current&&$.observe(N.current),()=>$.disconnect()},[m,y,f,n]);const{tableState:S,handleSort:A}=K8e({initialSortBy:null,onSortChange:r}),B=(g?.sortBy!==void 0?g.sortBy:S.sortBy)??void 0,T=g?.sortOrder!==void 0?g.sortOrder:S.sortOrder,V=$=>{const q=B,P=T;let H="asc";q===$&&(H=P==="asc"?"desc":"asc"),g?.sortBy!==void 0?r($,H):A($)};return o.jsxs("div",{className:`table-container ${M||""}`,style:x,title:Q(_,C),children:[o.jsxs("div",{className:"table-frame",style:{height:l??void 0,minHeight:u??void 0},children:[n&&o.jsx("div",{className:"table-loader-overlay",children:o.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),o.jsxs("div",{className:`table-wrapper ${h?"sticky-header":""}`,children:[o.jsxs("table",{className:"data-table",children:[o.jsx(Q8e,{columns:t,sortBy:B,sortOrder:T,onSort:V,removeLabelSpan:b}),o.jsx(efe,{data:e,columns:t.map($=>({...$,render:$.render?q=>$.render(q,{}):void 0})),rowKey:s,onRowClick:L,isLoading:n,text:j,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:w,renderSeparator:I})]}),m&&o.jsx("div",{ref:N,style:{height:20,margin:10}})]})]}),o.jsx(tfe,{state:c,onPaginationChange:i,text:j,onLoadMore:y,infiniteScroll:m,hasMore:f,isLoading:n})]})},afe="_datePickerContainer_1941b_3",nfe="_label_1941b_16",ofe="_displayNode_1941b_23",cfe="_datePickerButton_1941b_30",ife="_datePickerButtonDisabled_1941b_50",rfe="_datePickerButtonOpen_1941b_59",sfe="_datePickerLabel_1941b_68",dfe="_placeholder_1941b_79",lfe="_chevron_1941b_83",hfe="_errorMessage_1941b_91",ufe="_dropdown_1941b_96",pfe="_calendarHeader_1941b_120",yfe="_navButton_1941b_129",kfe="_headerSelectors_1941b_148",mfe="_monthSelector_1941b_156",ffe="_yearSelector_1941b_157",gfe="_selectorButton_1941b_161",vfe="_selectorChevron_1941b_178",Mfe="_selectorChevronOpen_1941b_183",xfe="_monthDropdown_1941b_187",_fe="_yearDropdown_1941b_188",Lfe="_monthItem_1941b_208",Ife="_yearItem_1941b_209",bfe="_monthItemSelected_1941b_231",wfe="_yearItemSelected_1941b_232",Cfe="_weekdays_1941b_236",Nfe="_weekday_1941b_236",Sfe="_calendarGrid_1941b_252",jfe="_dateCell_1941b_260",$fe="_dateCellSelected_1941b_283",qfe="_dateCellOtherMonth_1941b_287",Afe="_dateCellOtherMonthSelected_1941b_291",zfe="_calendarFooter_1941b_295",Vfe="_cancelButton_1941b_303",Pfe="_applyButton_1941b_304",Tfe="_timePickerContainer_1941b_348",Hfe="_timeGroup_1941b_357",Dfe="_timeLabel_1941b_364",Bfe="_timeInputWrapper_1941b_370",Rfe="_timeInput_1941b_370",Ffe="_timeSeparator_1941b_398",U={datePickerContainer:afe,label:nfe,displayNode:ofe,datePickerButton:cfe,datePickerButtonDisabled:ife,datePickerButtonOpen:rfe,datePickerLabel:sfe,placeholder:dfe,chevron:lfe,errorMessage:hfe,dropdown:ufe,calendarHeader:pfe,navButton:yfe,headerSelectors:kfe,monthSelector:mfe,yearSelector:ffe,selectorButton:gfe,selectorChevron:vfe,selectorChevronOpen:Mfe,monthDropdown:xfe,yearDropdown:_fe,monthItem:Lfe,yearItem:Ife,monthItemSelected:bfe,yearItemSelected:wfe,weekdays:Cfe,weekday:Nfe,calendarGrid:Sfe,dateCell:jfe,dateCellSelected:$fe,dateCellOtherMonth:qfe,dateCellOtherMonthSelected:Afe,calendarFooter:zfe,cancelButton:Vfe,applyButton:Pfe,timePickerContainer:Tfe,timeGroup:Hfe,timeLabel:Dfe,timeInputWrapper:Bfe,timeInput:Rfe,timeSeparator:Ffe},hj=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],Efe=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],dw=({value:e,onChange:t,label:n,placeholder:c="Sélectionner une date...",className:i="",fullWidth:r=!0,disabled:s=!1,error:d,buttonHeight:h="2.75rem",buttonPadding:l="0.75rem 1rem 0.75rem 1rem",dropdownMaxHeight:u="auto",fontSize:p="0.875rem",iconSize:y="1.5rem",labelMarginBottom:m="0.5rem",errorMarginTop:f="0.25rem",dropdownMarginTop:g="0.25rem",itemPadding:M="0.5rem 0.75rem",fontWeight:x="400",buttonBgColor:v,buttonBorderColor:L,buttonTextColor:w,dropdownBgColor:C="#ffffff",itemHoverColor:b,selectedItemBgColor:_,iconColor:I,errorColor:j,labelColor:N,placeholderColor:S,borderRadius:A="var(--radius-content)",borderWidth:B="0.0625rem",boxShadow:T="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:V="0.2s",transitionTiming:$="ease",dateCellSize:q="2.5rem",headerTextColor:P="#6c757d",weekdayTextColor:H="#6c757d",currentMonthDateColor:D="#212529",otherMonthDateColor:E="#adb5bd",selectedDateBgColor:G="#00A6D9",selectedDateTextColor:oe="#ffffff",cancelButtonBgColor:ae="#e9ecef",cancelButtonTextColor:Me="#212529",applyButtonBgColor:me="#00A6D9",applyButtonTextColor:Ce="#ffffff",width:he,displayNode:Y=void 0,displayMode:ee="auto",displayNodeAriaLabel:ie,dropdownPosition:ue="bottom",dropdownAlignment:re="right",dropdownWidth:W,withBorder:O=!1,icon:ne,precision:we="day",hoursLabel:Be="Heures",minutesLabel:ge="Minutes",lowerLimit:$e=null,upperLimit:Pt=null,months:Pc,weekdays:de,cancelText:Tt="Annuler",applyText:wL="Appliquer",prevMonthAriaLabel:xe="Mois précédent",nextMonthAriaLabel:Ht="Mois suivant",calendarAriaLabel:rA="Sélecteur de date",openedAriaLabel:sA="Ouvrir le sélecteur de date",selectedDateAriaLabel:dA="Date sélectionnée: ",locale:Yw="fr-FR",rotateIcon:lA=!0})=>{const Dt=R=>{if(R instanceof Date)return isNaN(R.getTime())?null:R;if(typeof R=="string"&&R){const X=new Date(R);return isNaN(X.getTime())?null:X}return null},[tt,Bt]=k.useState(!1),[Tc,hA]=k.useState({top:0,left:0,width:0}),[le,s1]=k.useState(Dt(e)||new Date),[CL,NL]=k.useState(Dt(e)),[SL,jL]=k.useState(Dt(e)?.getHours()??0),[$L,qL]=k.useState(Dt(e)?.getMinutes()??0),[AL,Hc]=k.useState(!1),[zL,Dc]=k.useState(!1),VL=k.useRef(null),K1=k.useRef(null),PL=k.useRef(null),TL=k.useRef(null);k.useEffect(()=>{const R=Dt(e);NL(R),R&&(s1(R),jL(R.getHours()),qL(R.getMinutes()))},[e]);const Bc=k.useCallback(()=>{if(K1.current){const R=K1.current.getBoundingClientRect();hA({top:R.top,left:R.left,width:R.width})}},[]);k.useEffect(()=>(tt&&(Bc(),window.addEventListener("scroll",Bc,!0),window.addEventListener("resize",Bc)),()=>{window.removeEventListener("scroll",Bc,!0),window.removeEventListener("resize",Bc)}),[tt,Bc]),k.useEffect(()=>{const R=X=>{if(VL.current&&!VL.current.contains(X.target)){const Ie=document.getElementById("datepicker-dropdown");if(Ie&&Ie.contains(X.target))return;Bt(!1),Hc(!1),Dc(!1)}PL.current&&!PL.current.contains(X.target)&&Hc(!1),TL.current&&!TL.current.contains(X.target)&&Dc(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);const Jw=R=>new Date(R.getFullYear(),R.getMonth()+1,0).getDate(),uA=R=>{const X=new Date(R.getFullYear(),R.getMonth(),1).getDay();return X===0?6:X-1},pA=()=>{const R=[],X=uA(le),Ie=Jw(le),Z1=new Date(le.getFullYear(),le.getMonth()-1,1),xt=Jw(Z1);for(let Xe=X-1;Xe>=0;Xe--)R.push(new Date(le.getFullYear(),le.getMonth()-1,xt-Xe));for(let Xe=1;Xe<=Ie;Xe++)R.push(new Date(le.getFullYear(),le.getMonth(),Xe));const d1=42-R.length;for(let Xe=1;Xe<=d1;Xe++)R.push(new Date(le.getFullYear(),le.getMonth()+1,Xe));return R},yA=(R,X)=>!R||!X?!1:R.getDate()===X.getDate()&&R.getMonth()===X.getMonth()&&R.getFullYear()===X.getFullYear(),kA=R=>R.getMonth()===le.getMonth()&&R.getFullYear()===le.getFullYear(),mA=()=>{s1(new Date(le.getFullYear(),le.getMonth()-1,1))},fA=()=>{s1(new Date(le.getFullYear(),le.getMonth()+1,1))},gA=R=>{if(!s){const X=new Date(R);X.setHours(SL),X.setMinutes($L),NL(X)}},vA=()=>{if(!s){if(CL){const R=new Date(CL);R.setHours(SL),R.setMinutes($L),t(R)}else t(null);Bt(!1)}},MA=()=>{const R=Dt(e);NL(R),R&&(jL(R.getHours()),qL(R.getMinutes())),Bt(!1)},xA=R=>{s1(new Date(le.getFullYear(),R,1)),Hc(!1)},_A=R=>{s1(new Date(R,le.getMonth(),1)),Dc(!1)},LA=()=>{const R=le.getFullYear(),X=[];for(let Ie=R-10;Ie<=R+10;Ie++)X.push(Ie);return X},IA=R=>{if(!s)switch(R.key){case"Enter":case" ":R.preventDefault(),Bt(!tt);break;case"Escape":Bt(!1),Hc(!1),Dc(!1);break;case"Tab":tt&&(Bt(!1),Hc(!1),Dc(!1));break}},bA={width:he||(r?"100%":"auto"),fontSize:p,fontWeight:x},wA={height:h,padding:l,backgroundColor:v||"#ffffff",border:O?void 0:"none",borderColor:d?j||"#dc3545":L||"#dee2e6",color:w||"#212529",borderRadius:A,borderWidth:B,fontWeight:x,transition:`all ${V} ${$}`},CA={backgroundColor:C||"#ffffff",maxHeight:u,borderRadius:A,borderWidth:B,boxShadow:T,transition:`opacity ${V} ${$}, transform ${V} ${$}`,position:"fixed",top:ue==="bottom"?Tc.top+(K1.current?.offsetHeight||0)+parseFloat(g.replace("rem",""))*16:"auto",bottom:ue==="top"?window.innerHeight-Tc.top+parseFloat(g.replace("rem",""))*16:"auto",left:re==="left"?Tc.left:"auto",right:re==="right"?window.innerWidth-(Tc.left+Tc.width):"auto",width:W||(r?Tc.width:"auto"),zIndex:10001},Qw={width:y,height:y,color:I||"#6c757d","--icon-rotation":lA&&tt?"rotate(180deg)":"rotate(0deg)"},NA={color:N||"#212529",marginBottom:m,fontWeight:x},SA={color:S||"#6c757d"},jA={color:j||"#dc3545",marginTop:f},$A=pA(),at=Dt(e),eC=at?we==="minutes"?`${at.toLocaleDateString(Yw)} ${at.getHours().toString().padStart(2,"0")}:${at.getMinutes().toString().padStart(2,"0")}`:at.toLocaleDateString(Yw):"",qA=!!Y&&(ee==="icon"||ee==="auto"&&!at),AA=ie||(at?`${dA}${eC}`:sA);return o.jsxs("div",{className:`${U.datePickerContainer} ${i}`,ref:VL,style:bA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&o.jsx("label",{className:U.label,style:NA,children:n}),o.jsxs("button",{ref:K1,type:"button",onClick:()=>!s&&Bt(!tt),onKeyDown:IA,className:`
|
|
8170
8170
|
${U.datePickerButton}
|
|
8171
8171
|
${tt?U.datePickerButtonOpen:""}
|
|
8172
8172
|
${s?U.datePickerButtonDisabled:""}
|
|
8173
|
-
`,style:wA,disabled:s,"aria-expanded":tt,"aria-haspopup":"dialog","aria-label":AA,"aria-labelledby":n?`${n}-label`:void 0,children:[qA?o.jsx("span",{className:U.displayNode,"aria-hidden":!0,children:Y}):o.jsx("span",{className:`${U.datePickerLabel} ${at?"":U.placeholder}`,style:at?void 0:SA,children:at?eC:c}),ne?o.jsx("span",{className:U.chevron,style:Qw,children:ne}):o.jsx(P1,{fill:"var(--color-text)",className:`${U.chevron} ${tt?U.chevronOpen:""}`,style:Qw})]}),d&&o.jsx("div",{className:U.errorMessage,style:jA,children:d}),tt&&!s&&lw.createPortal(o.jsxs("div",{id:"datepicker-dropdown",className:U.dropdown,style:CA,role:"dialog","aria-label":rA,children:[o.jsxs("div",{className:U.calendarHeader,children:[o.jsx("button",{type:"button",className:U.navButton,onClick:mA,"aria-label":xe,children:"‹"}),o.jsxs("div",{className:U.headerSelectors,children:[o.jsxs("div",{className:U.monthSelector,ref:PL,children:[o.jsxs("button",{type:"button",className:U.selectorButton,onClick:()=>Hc(!AL),style:{color:P,"--hover-color":b},children:[(Pc||hj)[le.getMonth()],o.jsx(P1,{fill:"var(--color-text)",className:`${U.selectorChevron} ${AL?U.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),AL&&o.jsx("div",{className:U.monthDropdown,children:(Pc||hj).map((R,X)=>o.jsx("button",{type:"button",className:`${U.monthItem} ${le.getMonth()===X?U.monthItemSelected:""}`,onClick:()=>xA(X),style:{padding:M,backgroundColor:le.getMonth()===X?_||"#e7f1ff":C},onMouseEnter:Ie=>{b&&le.getMonth()!==X&&(Ie.currentTarget.style.backgroundColor=b)},onMouseLeave:Ie=>{b&&(Ie.currentTarget.style.backgroundColor=le.getMonth()===X?_||"#e7f1ff":C)},children:R},X))})]}),o.jsxs("div",{className:U.yearSelector,ref:TL,children:[o.jsxs("button",{type:"button",className:U.selectorButton,onClick:()=>Dc(!zL),style:{color:P,"--hover-color":b},children:[le.getFullYear(),o.jsx(P1,{fill:"var(--color-text)",className:`${U.selectorChevron} ${zL?U.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),zL&&o.jsx("div",{className:U.yearDropdown,children:LA().map(R=>o.jsx("button",{type:"button",className:`${U.yearItem} ${le.getFullYear()===R?U.yearItemSelected:""}`,onClick:()=>_A(R),style:{padding:M,backgroundColor:le.getFullYear()===R?_||"#e7f1ff":C},onMouseEnter:X=>{b&&le.getFullYear()!==R&&(X.currentTarget.style.backgroundColor=b)},onMouseLeave:X=>{b&&(X.currentTarget.style.backgroundColor=le.getFullYear()===R?_||"#e7f1ff":C)},children:R},R))})]})]}),o.jsx("button",{type:"button",className:U.navButton,onClick:fA,"aria-label":Ht,children:"›"})]}),o.jsx("div",{className:U.weekdays,children:(de||Efe).map(R=>o.jsx("div",{className:U.weekday,style:{color:H},children:R},R))}),o.jsx("div",{className:U.calendarGrid,children:$A.map((R,X)=>{if(!R)return null;const Ie=yA(R,CL),Z1=kA(R),xt=!!($e&&R<$e||Pt&&R>Pt);return o.jsx("button",{type:"button",className:`${U.dateCell} ${Ie?U.dateCellSelected:""} ${Ie?U.dateCellOtherMonthSelected:""} ${Z1?"":U.dateCellOtherMonth} ${xt?U.dateCellDisabled:""}`,onClick:()=>!xt&&gA(R),disabled:xt,style:{width:q,height:q,color:Ie?oe:Z1?D:
|
|
8173
|
+
`,style:wA,disabled:s,"aria-expanded":tt,"aria-haspopup":"dialog","aria-label":AA,"aria-labelledby":n?`${n}-label`:void 0,children:[qA?o.jsx("span",{className:U.displayNode,"aria-hidden":!0,children:Y}):o.jsx("span",{className:`${U.datePickerLabel} ${at?"":U.placeholder}`,style:at?void 0:SA,children:at?eC:c}),ne?o.jsx("span",{className:U.chevron,style:Qw,children:ne}):o.jsx(P1,{fill:"var(--color-text)",className:`${U.chevron} ${tt?U.chevronOpen:""}`,style:Qw})]}),d&&o.jsx("div",{className:U.errorMessage,style:jA,children:d}),tt&&!s&&lw.createPortal(o.jsxs("div",{id:"datepicker-dropdown",className:U.dropdown,style:CA,role:"dialog","aria-label":rA,children:[o.jsxs("div",{className:U.calendarHeader,children:[o.jsx("button",{type:"button",className:U.navButton,onClick:mA,"aria-label":xe,children:"‹"}),o.jsxs("div",{className:U.headerSelectors,children:[o.jsxs("div",{className:U.monthSelector,ref:PL,children:[o.jsxs("button",{type:"button",className:U.selectorButton,onClick:()=>Hc(!AL),style:{color:P,"--hover-color":b},children:[(Pc||hj)[le.getMonth()],o.jsx(P1,{fill:"var(--color-text)",className:`${U.selectorChevron} ${AL?U.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),AL&&o.jsx("div",{className:U.monthDropdown,children:(Pc||hj).map((R,X)=>o.jsx("button",{type:"button",className:`${U.monthItem} ${le.getMonth()===X?U.monthItemSelected:""}`,onClick:()=>xA(X),style:{padding:M,backgroundColor:le.getMonth()===X?_||"#e7f1ff":C},onMouseEnter:Ie=>{b&&le.getMonth()!==X&&(Ie.currentTarget.style.backgroundColor=b)},onMouseLeave:Ie=>{b&&(Ie.currentTarget.style.backgroundColor=le.getMonth()===X?_||"#e7f1ff":C)},children:R},X))})]}),o.jsxs("div",{className:U.yearSelector,ref:TL,children:[o.jsxs("button",{type:"button",className:U.selectorButton,onClick:()=>Dc(!zL),style:{color:P,"--hover-color":b},children:[le.getFullYear(),o.jsx(P1,{fill:"var(--color-text)",className:`${U.selectorChevron} ${zL?U.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),zL&&o.jsx("div",{className:U.yearDropdown,children:LA().map(R=>o.jsx("button",{type:"button",className:`${U.yearItem} ${le.getFullYear()===R?U.yearItemSelected:""}`,onClick:()=>_A(R),style:{padding:M,backgroundColor:le.getFullYear()===R?_||"#e7f1ff":C},onMouseEnter:X=>{b&&le.getFullYear()!==R&&(X.currentTarget.style.backgroundColor=b)},onMouseLeave:X=>{b&&(X.currentTarget.style.backgroundColor=le.getFullYear()===R?_||"#e7f1ff":C)},children:R},R))})]})]}),o.jsx("button",{type:"button",className:U.navButton,onClick:fA,"aria-label":Ht,children:"›"})]}),o.jsx("div",{className:U.weekdays,children:(de||Efe).map(R=>o.jsx("div",{className:U.weekday,style:{color:H},children:R},R))}),o.jsx("div",{className:U.calendarGrid,children:$A.map((R,X)=>{if(!R)return null;const Ie=yA(R,CL),Z1=kA(R),xt=!!($e&&R<$e||Pt&&R>Pt);return o.jsx("button",{type:"button",className:`${U.dateCell} ${Ie?U.dateCellSelected:""} ${Ie?U.dateCellOtherMonthSelected:""} ${Z1?"":U.dateCellOtherMonth} ${xt?U.dateCellDisabled:""}`,onClick:()=>!xt&&gA(R),disabled:xt,style:{width:q,height:q,color:Ie?oe:Z1?D:E,backgroundColor:Ie?G:"transparent",opacity:xt?.4:1,cursor:xt?"not-allowed":"pointer"},onMouseEnter:d1=>{!Ie&&!xt&&b&&(d1.currentTarget.style.backgroundColor=b)},onMouseLeave:d1=>{Ie||(d1.currentTarget.style.backgroundColor="transparent")},children:R.getDate()},X)})}),we==="minutes"&&o.jsxs("div",{className:U.timePickerContainer,children:[o.jsxs("div",{className:U.timeGroup,children:[o.jsx("span",{className:U.timeLabel,children:Be}),o.jsx("div",{className:U.timeInputWrapper,children:o.jsx("input",{type:"number",min:"0",max:"23",value:SL,onChange:R=>{const X=parseInt(R.target.value);!isNaN(X)&&X>=0&&X<=23&&jL(X)},className:U.timeInput})})]}),o.jsx("span",{className:U.timeSeparator,children:":"}),o.jsxs("div",{className:U.timeGroup,children:[o.jsx("span",{className:U.timeLabel,children:ge}),o.jsx("div",{className:U.timeInputWrapper,children:o.jsx("input",{type:"number",min:"0",max:"59",value:$L,onChange:R=>{const X=parseInt(R.target.value);!isNaN(X)&&X>=0&&X<=59&&qL(X)},className:U.timeInput})})]})]}),o.jsxs("div",{className:U.calendarFooter,children:[o.jsx("button",{type:"button",className:U.cancelButton,onClick:MA,style:{backgroundColor:ae,color:Me,borderRadius:A,padding:M},children:Tt}),o.jsx("button",{type:"button",className:U.applyButton,onClick:vA,style:{backgroundColor:me,color:Ce,borderRadius:A,padding:M},children:wL})]})]}),document.body)]})},Ofe="_selectContainer_1ptm9_1",Ufe="_label_1ptm9_15",Wfe="_selectButton_1ptm9_23",Gfe="_selectButtonDisabled_1ptm9_43",Kfe="_selectButtonOpen_1ptm9_48",Zfe="_selectButtonContent_1ptm9_58",Xfe="_selectIcon_1ptm9_66",Yfe="_selectLabel_1ptm9_72",Jfe="_placeholder_1ptm9_79",Qfe="_chevron_1ptm9_84",ege="_errorMessage_1ptm9_93",tge="_dropdown_1ptm9_99",age="_dropdownContent_1ptm9_123",nge="_item_1ptm9_129",oge="_itemSelected_1ptm9_151",cge="_itemContent_1ptm9_155",ige="_itemIcon_1ptm9_162",rge="_itemLabel_1ptm9_168",be={selectContainer:Ofe,label:Ufe,selectButton:Wfe,selectButtonDisabled:Gfe,selectButtonOpen:Kfe,selectButtonContent:Zfe,selectIcon:Xfe,selectLabel:Yfe,placeholder:Jfe,chevron:Qfe,errorMessage:ege,dropdown:tge,dropdownContent:age,item:nge,itemSelected:oge,itemContent:cge,itemIcon:ige,itemLabel:rge},oA=({items:e,value:t,onChange:n,label:c,placeholder:i="Sélectionner...",className:r="",fullWidth:s=!0,disabled:d=!1,error:h,buttonHeight:l="var(--select-button-height, 2.75rem)",buttonPadding:u="var(--select-button-padding, 0.75rem)",dropdownMaxHeight:p="var(--select-dropdown-max-height, 15rem)",fontSize:y="var(--select-font-size, 0.875rem)",fontWeight:m,iconSize:f="var(--select-icon-size, 1.5rem)",labelMarginBottom:g="var(--select-label-margin-bottom, 0.5rem)",errorMarginTop:M="var(--select-error-margin-top, 0.25rem)",dropdownMarginTop:x="var(--select-dropdown-margin-top, 0.25rem)",itemPadding:v="var(--select-item-padding, 0.5rem 0.75rem)",gap:L="var(--select-gap, 0.5rem)",buttonBgColor:w,buttonBorderColor:C,buttonTextColor:b,dropdownBgColor:_,itemHoverColor:I,selectedItemBgColor:j,iconColor:N,errorColor:S,labelColor:A,placeholderColor:B,border:T,borderRadius:V="var(--select-border-radius, 0.5rem)",borderWidth:$="var(--select-border-width, 0.0625rem)",boxShadow:q="var(--select-box-shadow, 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1))",transitionDuration:P="var(--select-transition-duration, 0.2s)",transitionTiming:H="var(--select-transition-timing, ease)",scrollbarWidth:D="var(--select-scrollbar-width, 0.375rem)",scrollbarTrackColor:E="var(--select-scrollbar-track-color, #f1f1f1)",scrollbarThumbColor:G="var(--select-scrollbar-thumb-color, #c1c1c1)",width:oe,minWidth:ae,dropdownPosition:Me="bottom",dropdownAlignment:me="right",dropdownWidth:Ce,a11yConfig:he,titleKey:Y})=>{const[ee,ie]=k.useState(!1),ue=k.useRef(null),re=e.find(xe=>xe.value===t);k.useEffect(()=>{const xe=Ht=>{ue.current&&!ue.current.contains(Ht.target)&&ie(!1)};return document.addEventListener("mousedown",xe),()=>document.removeEventListener("mousedown",xe)},[]);const W=xe=>{d||(n(xe),ie(!1))},O=xe=>{if(!d)switch(xe.key){case"Enter":case" ":xe.preventDefault(),ie(!ee);break;case"Escape":ie(!1);break;case"Tab":ee&&ie(!1);break}},ne={width:oe||(s?"100%":"auto"),minWidth:ae,fontSize:y},we={height:l,padding:u,backgroundColor:w||"var(--select-button-bg-color, #ffffff)",border:T,borderColor:h?S||"var(--select-error-color, #dc3545)":C||"var(--select-button-border-color, #dee2e6)",color:b||"var(--select-button-text-color, #212529)",borderRadius:V,borderWidth:$,transition:`all ${P} ${H}`,fontWeight:m},Be={backgroundColor:_||"var(--select-dropdown-bg-color, #ffffff)",maxHeight:p,borderRadius:V,borderWidth:$,boxShadow:q,transition:`opacity ${P} ${H}, transform ${P} ${H}`,position:"absolute",top:Me==="bottom"?"100%":"auto",bottom:Me==="top"?"100%":"auto",left:me==="left"?0:"auto",right:me==="right"?0:"auto",width:Ce||(s?"100%":"auto"),marginTop:Me==="bottom"?x:0,marginBottom:Me==="top"?x:0,zIndex:1001},ge={width:f,height:f,color:N||"var(--select-icon-color, #6c757d)","--icon-rotation":ee?"rotate(180deg)":"rotate(0deg)"},$e={color:A||"var(--select-label-color, #212529)",marginBottom:g},Pt={color:B||"var(--select-placeholder-color, #6c757d)"},Pc={color:S||"var(--select-error-color, #dc3545)",marginTop:M},de={padding:v,transition:`background-color ${P} ${H}`,fontWeight:m},Tt={gap:L},wL={"--scrollbar-width":D,"--scrollbar-track-color":E,"--scrollbar-thumb-color":G};return o.jsxs("div",{className:`${be.selectContainer} ${r}`,ref:ue,style:ne,"data-fullwidth":s,"data-disabled":d,"data-error":!!h,title:Q(he,Y),children:[c&&o.jsx("label",{className:be.label,style:$e,children:c}),o.jsxs("button",{type:"button",onClick:()=>!d&&ie(!ee),onKeyDown:O,className:`
|
|
8174
8174
|
${be.selectButton}
|
|
8175
8175
|
${ee?be.selectButtonOpen:""}
|
|
8176
8176
|
${d?be.selectButtonDisabled:""}
|
|
8177
8177
|
`,style:we,disabled:d,"aria-expanded":ee,"aria-haspopup":"listbox","aria-labelledby":c?`${c}-label`:void 0,children:[o.jsxs("div",{className:be.selectButtonContent,style:Tt,children:[re?.icon&&o.jsx("span",{className:be.selectIcon,style:ge,children:re.icon}),o.jsx("span",{className:`${be.selectLabel} ${re?"":be.placeholder}`,style:re?void 0:Pt,children:re?re.label:i})]}),o.jsx(P1,{fill:"var(--color-text)",className:`${be.chevron} ${ee?be.chevronOpen:""}`,style:ge})]}),h&&o.jsx("div",{className:be.errorMessage,style:Pc,children:h}),ee&&!d&&o.jsx("div",{className:be.dropdown,style:Be,role:"listbox","aria-label":c||"Options de sélection",children:o.jsx("div",{className:be.dropdownContent,style:wL,children:e.map(xe=>o.jsx("button",{type:"button",onClick:()=>W(xe.value),className:`
|
|
8178
8178
|
${be.item}
|
|
8179
8179
|
${t===xe.value?be.itemSelected:""}
|
|
8180
|
-
`,style:{...de,backgroundColor:t===xe.value?j||"#F0F4F6":"transparent"},onMouseEnter:Ht=>{I&&(Ht.currentTarget.style.backgroundColor=I)},onMouseLeave:Ht=>{I&&(Ht.currentTarget.style.backgroundColor=t===xe.value?j||"#F0F4F6":"transparent")},role:"option","aria-selected":t===xe.value,children:o.jsxs("div",{className:be.itemContent,style:Tt,children:[xe.icon&&o.jsx("span",{className:be.itemIcon,style:ge,children:xe.icon}),o.jsx("span",{className:be.itemLabel,children:xe.label})]})},xe.value))})})]})},sge="_filterBar_1hlqe_3",dge="_label_1hlqe_11",uj={filterBar:sge,label:dge},lge=({label:e="Filtres",startDate:t,endDate:n,granularity:c,onStartDateChange:i,onEndDateChange:r,onGranularityChange:s,granularityItems:d,startDatePlaceholder:h="Date début",endDatePlaceholder:l="Date fin",granularityPlaceholder:u="Sélectionner...",className:p="",disabled:y=!1,gap:m="0.75rem",labelFontSize:f="0.875rem",labelFontWeight:g="400",labelColor:M="#212529",labelMarginRight:x="1rem",startDateWidth:v,endDateWidth:L,selectWidth:w,datePickerProps:C={},selectProps:b={},rightContent:_,extraContent:I})=>{const j={fontSize:f,fontWeight:g,color:M,marginRight:x},N={gap:m};return o.jsxs("div",{className:`${uj.filterBar} ${p}`,style:N,children:[e&&o.jsx("span",{className:uj.label,style:j,children:e}),o.jsx(dw,{value:t,onChange:i,placeholder:h,fullWidth:!1,disabled:y,label:void 0,width:v,...C}),o.jsx(dw,{value:n,onChange:r,placeholder:l,fullWidth:!1,disabled:y,label:void 0,width:L,...C}),o.jsx(oA,{items:d,value:c,onChange:s,placeholder:u,fullWidth:!1,disabled:y,label:void 0,width:w,...b}),I,_&&o.jsx("div",{style:{marginLeft:"auto"},children:_})]})},hge="_container_1x6mq_16",uge="_disabled_1x6mq_26",pge="_predStyle_1x6mq_32",yge="_realStyle_1x6mq_36",kge="_predGap_1x6mq_40",mge="_realGap_1x6mq_44",fge="_big_1x6mq_49",gge="_medium_1x6mq_53",vge="_iconWrapper_1x6mq_58",Mge="_predRelative_1x6mq_68",xge="_realRelative_1x6mq_72",_ge="_iconImg_1x6mq_76",Lge="_content_1x6mq_84",Ige="_header_1x6mq_93",bge="_predJustify_1x6mq_99",wge="_realJustify_1x6mq_103",Cge="_predHeaderLineHeight_1x6mq_116",Nge="_realHeaderLineHeight_1x6mq_120",Sge="_title_1x6mq_129",jge="_titleBlack_1x6mq_144",$ge="_titleWhite_1x6mq_148",qge="_subtitle_1x6mq_153",Age="_valueRowHorizontal_1x6mq_163",zge="_valueRowVertical_1x6mq_171",Vge="_singleValue_1x6mq_180",Pge="_primaryRow_1x6mq_184",Tge="_maxBadge_1x6mq_191",Hge="_valuePrimary_1x6mq_203",Dge="_valuePrimaryBlack_1x6mq_210",Bge="_valuePrimaryWhite_1x6mq_214",Rge="_valueSlash_1x6mq_219",Fge="_valueSecondary_1x6mq_226",Ege="_valueSecondaryBlue_1x6mq_232",Oge="_valueSecondaryWhite_1x6mq_236",Uge="_valueSecondaryBlack_1x6mq_240",Wge="_valueStacked_1x6mq_245",Gge="_stackedTop_1x6mq_254",Kge="_stackedBottom_1x6mq_255",pe={container:hge,disabled:uge,predStyle:pge,realStyle:yge,predGap:kge,realGap:mge,big:fge,medium:gge,iconWrapper:vge,predRelative:Mge,realRelative:xge,iconImg:_ge,content:Lge,header:Ige,predJustify:bge,realJustify:wge,predHeaderLineHeight:Cge,realHeaderLineHeight:Nge,title:Sge,titleBlack:jge,titleWhite:$ge,subtitle:qge,valueRowHorizontal:Age,valueRowVertical:zge,singleValue:Vge,primaryRow:Pge,maxBadge:Tge,valuePrimary:Hge,valuePrimaryBlack:Dge,valuePrimaryWhite:Bge,valueSlash:Rge,valueSecondary:Fge,valueSecondaryBlue:Ege,valueSecondaryWhite:Oge,valueSecondaryBlack:Uge,valueStacked:Wge,stackedTop:Gge,stackedBottom:Kge},Zge=({a11yConfig:e,iconName:t,title:n,subtitle:c,showSubtitle:i,realised:r="-",prediction:s="-",size:d="big",titleColor:h="black",valueColor:l="blue",realValueColor:u,className:p="",style:y="",variant:m="horizontal",showMax:f=!1,titleFontSize:g,titleFontWeight:M,subtitleFontSize:x,subtitleFontWeight:v,primaryFontSize:L,primaryFontWeight:w,secondaryFontSize:C,secondaryFontWeight:b,backgroundColor:_="#f2f9fc",gap:I="",disabled:j=!1,positionRelative:N="",justifyContent:S="",headerLineHeight:A="",headerMinHeight:B="",contentSpace:T="",titleKey:V,subtitleKey:$,subtitleA11yKey:q,maxBadgeKey:P,maxBadgeA11yKey:H,predictionKey:D,predictionA11yKey:F,realisedKey:G,realisedA11yKey:oe})=>{const ae=i!==void 0?i:!!c,Me=`${pe.container} ${pe[d]} ${pe[y]} ${j?pe.disabled:""}`,me=l==="white"?pe.valuePrimaryWhite:pe.valuePrimaryBlack,Ce=l==="blue"?pe.valueSecondaryBlue:l==="white"?pe.valueSecondaryWhite:pe.valueSecondaryBlack,he=re=>re===void 0?void 0:typeof re=="number"?`${re}px`:re,Y=re=>re===void 0?void 0:re,ee=m==="vertical",ie=s!=null&&s!==""&&s!=="-"&&s!=="—",ue=ee?pe.valueRowVertical:pe.valueRowHorizontal;return o.jsxs("div",{className:`${Me} ${p}`,style:{backgroundColor:_},children:[t&&o.jsx("div",{className:`${pe.iconWrapper} ${pe[N]}`,children:t}),o.jsxs("div",{className:`${pe.content} ${pe[I]} ${ie?"":pe.singleValue} content-indicator-v2`,style:{justifyContent:T},children:[o.jsx("div",{className:`${pe.header} ${pe[S]} ${pe[A]} header-indicator-v2`,style:{minHeight:B},children:o.jsx("h6",{className:`${pe.title}`,style:{fontSize:he(g),fontWeight:Y(M),color:h},title:Q(e,V),children:n})}),ae&&c?o.jsx("div",{className:"subtitle-container",children:o.jsx("span",{className:pe.subtitle,style:{fontSize:he(x),fontWeight:Y(v)},title:Q(e,$,q),children:c})}):null,o.jsxs("div",{className:`${ue} count-indicator-v2`,children:[o.jsxs("div",{className:pe.primaryRow,children:[f&&o.jsx("span",{className:`${pe.maxBadge} max-badge-indicator-v2`,title:Q(e,P,H),children:"MAX"}),o.jsx("span",{className:`${pe.valuePrimary} ${me}`,style:{fontSize:he(L||(!ie&&ee?"1.75rem":void 0)),fontWeight:Y(w),color:u||void 0},title:Q(e,G,oe),children:r})]}),ie&&o.jsxs(o.Fragment,{children:[!ee&&o.jsx("span",{className:pe.valueSlash,style:{fontSize:he(C),fontWeight:Y(b)},children:"/"}),o.jsx("span",{className:`${pe.valueSecondary} ${Ce}`,style:{fontSize:he(C),fontWeight:Y(b)},title:Q(e,D,F),children:s})]})]})]})]})},Xge="_banner_f10in_2",Yge="_iep_f10in_14",Jge="_groupSmall_f10in_24",Qge="_genre_f10in_34",e7e="_gravite_f10in_42",t7e="_orientationContainer_f10in_48",a7e="_service_f10in_61",n7e="_roomBedContainer_f10in_71",o7e="_room_f10in_71",c7e="_bed_f10in_87",i7e="_bedUf_f10in_92",r7e="_statusContainer_f10in_97",s7e="_status_f10in_97",d7e="_centeredWarn_f10in_124",Te={banner:Xge,iep:Yge,groupSmall:Jge,genre:Qge,gravite:e7e,orientationContainer:t7e,service:a7e,roomBedContainer:n7e,room:o7e,bed:c7e,bedUf:i7e,statusContainer:r7e,status:s7e,centeredWarn:d7e},l7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},J.createElement("mask",{id:"a",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},J.createElement("path",{fill:"#D9D9D9",d:"M0 0h16v16H0z"})),J.createElement("g",{mask:"url(#a)"},J.createElement("path",{fill:"#C60000",d:"M.666 14 7.999 1.333 15.333 14zm2.3-1.333h10.067L7.999 4zm5.508-.859a.65.65 0 0 0 .192-.475.65.65 0 0 0-.192-.475.65.65 0 0 0-.475-.191.65.65 0 0 0-.475.191.65.65 0 0 0-.191.475q0 .285.191.475A.65.65 0 0 0 8 12a.65.65 0 0 0 .475-.192M7.333 10h1.333V6.667H7.333z"}))),pj=k.memo(l7e),h7e=({patient:e,genre:t,gravite:n,bed:c,bed_uf:i,room:r,orientation:s,status:d,backgroundColor:h="#ffffff",primaryFontColor:l="#111827",secondaryFontColor:u="#6b7280",statusFontColor:p="#0284c7",statusBackgroundColor:y="#e0f2fe",genreBackgroundColor:m="#9ca3af",genreFontSize:f,style:g,warn:M=!1,warnMessage:x,warnColor:v="#F94134"})=>o.jsxs("div",{className:Te.banner,style:{backgroundColor:h,...g},children:[o.jsxs("div",{className:Te.iep,children:[o.jsx("div",{style:{color:u},children:e.iep??"--"}),o.jsxs("div",{style:{color:l},children:[((e.nom||"").trim().split(/\s+/)[0]||"").substring(0,3).toUpperCase(),"."," ",((e.prenom||"").trim().split(/\s+/)[0]||"").substring(0,3).toLowerCase().replace(/^./,L=>L.toUpperCase()),".(",e.age,")"]})]}),o.jsxs("div",{className:Te.groupSmall,children:[o.jsx("span",{className:`${Te.genre} genre-info-banner`,style:{color:"#ffffff",background:m,fontSize:f},children:t??"--"}),o.jsx("span",{className:`${Te.gravite} gravite-info-banner`,children:n??"--"})]}),o.jsx("div",{className:Te.orientationContainer,children:o.jsx("div",{className:Te.service,style:{color:l},children:s??"--"})}),o.jsxs("div",{className:Te.roomBedContainer,children:[i&&o.jsx("span",{className:Te.bedUf,children:i}),o.jsx("span",{className:Te.room,children:r??"--"}),o.jsx("span",{className:Te.bed,children:c??"--"})]}),o.jsxs("div",{className:Te.statusContainer,children:[d?o.jsx("div",{className:`${Te.status} status-info-banner`,style:{color:p,backgroundColor:y},children:d}):M&&o.jsxs("div",{className:Te.centeredWarn,style:{textTransform:"uppercase"},children:[o.jsx(pj,{color:v,width:20,height:20,style:{marginRight:"6px"}}),o.jsx("span",{style:{color:v,fontSize:"12px",fontWeight:600},children:x})]}),d&&M&&o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",color:v,fontSize:"10px",fontWeight:400,marginTop:"4px",textTransform:"uppercase"},children:[o.jsx(pj,{color:v,width:12,height:12,style:{marginRight:"4px"}}),o.jsx("span",{children:x})]})]})]}),u7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M200-200v-240h60v180h180v60zm500-320v-180H520v-60h240v240z"})),p7e=k.memo(u7e),y7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231z"})),cA=k.memo(y7e),k7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M440-440v240h-60v-180H200v-60zm140-320v180h180v60H520v-240z"})),m7e=k.memo(k7e),f7e="_overlay_1uxex_1",g7e="_container_1uxex_11",v7e="_fullscreen_1uxex_24",M7e="_header_1uxex_30",x7e="_headerActions_1uxex_42",_7e="_iconButton_1uxex_47",L7e="_body_1uxex_58",I7e="_sidebar_1uxex_65",b7e="_content_1uxex_91",w7e="_contentHeader_1uxex_98",C7e="_childrenWrapper_1uxex_114",N7e="_footer_1uxex_138",S7e="_baseButton_1uxex_146",j7e="_noOverlay_1uxex_160",$7e="_contained_1uxex_168",Ne={overlay:f7e,container:g7e,fullscreen:v7e,header:M7e,headerActions:x7e,iconButton:_7e,body:L7e,sidebar:I7e,content:b7e,contentHeader:w7e,childrenWrapper:C7e,footer:N7e,baseButton:S7e,noOverlay:j7e,contained:$7e},q7e=({headerText:e,headerTextColor:t="var(--color-text)",backgroundColor:n="var(--color-background)",headerFontSize:c="1rem",headerFontWeight:i="600",isOpen:r,onClose:s,leftButton:d,rightButton:h,children:l,contentTitle:u,contentBackgroundColor:p="var(--color-content-background)",sideContent:y,hideMaximize:m=!1,hideHeader:f=!1,hideSidebar:g=!1,onDelete:M,deleteLabel:x="Supprimer",width:v="75%",maxWidth:L="none",height:w="85%",maxHeight:C="85%",borderRadius:b="0.5rem",childrenPadding:_="1rem",overflow:I="auto",contentHeaderAction:j,contentFooterAction:N,hideFooter:S=!1,hideOverlay:A=!1,position:B,a11yConfig:T})=>{const[V,$]=k.useState(!1),q=k.useRef(null);if(k.useEffect(()=>{if(!r||!A)return;const H=D=>{(D.type==="scroll"||D.type==="wheel"||D.type==="touchmove"||q.current&&!q.current.contains(D.target))&&s()};return document.addEventListener("mousedown",H),document.addEventListener("scroll",H,!0),document.addEventListener("wheel",H,{passive:!0,capture:!0}),document.addEventListener("touchmove",H,{passive:!0,capture:!0}),()=>{document.removeEventListener("mousedown",H),document.removeEventListener("scroll",H,!0),document.removeEventListener("wheel",H,!0),document.removeEventListener("touchmove",H,!0)}},[r,A,s]),!r)return null;const P=(H,D=!1)=>o.jsx(tL,{onClick:H.disabled?void 0:H.onClick,className:Ne.baseButton,disabled:H.disabled,style:{background:H.backgroundColor??(D?"#008FBB":"#ffffff"),color:H.textColor??(D?"#ffffff":"#374151"),border:H.borderColor||D?"none":void 0,cursor:H.disabled?H.cursor??"not-allowed":H.cursor??"pointer",filter:H.disabled?H.filter??"grayscale(0.5)":H.filter??"none",opacity:H.disabled?.65:1},title:Q(H.a11yConfig,H.text),children:H.text});return o.jsx("div",{className:A?Ne.noOverlay:Ne.overlay,onClick:s,children:o.jsxs("div",{ref:q,className:`${Ne.container} ${V?Ne.fullscreen:""} ${A?Ne.contained:""}`,onClick:H=>H.stopPropagation(),style:{width:V?"100%":v,maxWidth:V?"none":L,height:V?"100%":w,maxHeight:V?"100%":C,borderRadius:V?"0":b,overflow:I,...B||{}},children:[!f&&o.jsxs("header",{className:Ne.header,style:{backgroundColor:n},children:[o.jsx("h2",{style:{fontSize:c,fontWeight:i,color:t},title:Q(T,e),children:e}),o.jsxs("div",{className:Ne.headerActions,children:[!m&&o.jsx("button",{onClick:()=>$(!V),className:Ne.iconButton,title:V?"Réduire":"Agrandir",children:V?o.jsx(m7e,{width:22,height:22,fill:t}):o.jsx(p7e,{width:22,height:22,fill:t})}),o.jsx("button",{onClick:s,className:Ne.iconButton,title:"Fermer",children:o.jsx(cA,{width:22,height:22,fill:t})})]})]}),o.jsxs("div",{className:Ne.body,style:{overflow:I},children:[y&&!g&&o.jsx("aside",{className:Ne.sidebar,children:y}),o.jsxs("main",{className:Ne.content,style:{backgroundColor:p,overflow:I},children:[u&&o.jsxs("header",{className:Ne.contentHeader,style:{backgroundColor:n},children:[o.jsx("span",{style:{color:t},children:u}),j]}),o.jsx("div",{className:Ne.childrenWrapper,style:{padding:_,overflow:I},children:l})]})]}),!S&&o.jsxs("footer",{className:Ne.footer,style:{backgroundColor:n},children:[M&&o.jsx(tL,{onClick:M,className:Ne.baseButton,style:{background:"#fee2e2",color:"#ef4444",marginRight:"auto",border:"none"},children:x}),N,P(d),P(h,!0)]})]})})},A7e="_container_1vb1c_1",z7e="_searchWrapper_1vb1c_10",V7e="_navItems_1vb1c_17",Vb={container:A7e,searchWrapper:z7e,navItems:V7e},P7e=({items:e,activeId:t,activeColor:n="#00aec7",backgroundColor:c="#fff",textColor:i="#000",onItemClick:r,searchValue:s="",onSearchChange:d,searchPlaceholder:h="Rechercher",width:l="100%",className:u=""})=>o.jsxs("div",{className:`${Vb.container} ${u}`,style:{width:l,backgroundColor:c,color:i},children:[o.jsx("div",{className:Vb.searchWrapper,children:o.jsx(Jq,{value:s,onChange:d,placeholder:h,iconPosition:"right",iconColor:"var(--color-text)"})}),o.jsx("div",{className:Vb.navItems,children:e.map(p=>o.jsx(Xw,{id:p.id,label:p.label,icon:p.icon,isActive:t===p.id,onClick:()=>r?.(p.id),activeColor:n,color:i,fontWeight:"600",fontSize:"0.75rem",padding:"0.75rem 1rem",iconGap:"0.5rem"},p.id))})]}),T7e=({modules:e,selectedModuleId:t,onSelectModule:n,onAddModule:c,onItemAdd:i,onEditModule:r,onDeleteModule:s,onReorder:d,title:h="Modules",titleKey:l,addModuleTitle:u="Ajouter un module",addModuleLabel:p="Titre",addModulePlaceholder:y="Nom du module",renameModuleTitle:m="Renommer le module",renameModuleLabel:f="Titre",renameModulePlaceholder:g="Nom du module",confirmText:M="Valider",cancelText:x="Annuler",headerLabel:v,headerLabelKey:L,showAddIcon:w=!0,showCount:C=!0,showToggle:b=!1,showActions:_=!0,onToggle:I,a11yConfig:j})=>{const[N,S]=k.useState(!1),[A,B]=k.useState(null),[T,V]=k.useState(null),[$,q]=k.useState(null),[P,H]=k.useState(null),D=()=>{H(W=>W===null?"asc":W==="asc"?"desc":null),I&&I()},F=k.useMemo(()=>P?[...e].sort((W,O)=>{const ne=W.title.toLowerCase(),we=O.title.toLowerCase();return P==="asc"?ne.localeCompare(we):we.localeCompare(ne)}):e,[e,P]),G=()=>S(!0),oe=()=>S(!1),ae=W=>{const O=W.title?.trim();O&&c&&c(O),oe()},Me=(W,O)=>{W.stopPropagation(),B(O)},me=()=>B(null),Ce=W=>{const O=W.title?.trim();A&&O&&r&&r(A,O),me()},he=(W,O)=>{W.stopPropagation(),s&&s(O)},Y=(W,O)=>{W.stopPropagation(),i&&i(O)},ee=(W,O)=>{V(O),W.dataTransfer.effectAllowed="move"},ie=(W,O)=>{T!==null&&(W.preventDefault(),W.dataTransfer.dropEffect="move",O!==$&&q(O))},ue=(W,O)=>{if(W.preventDefault(),T===null||T===O||!d)return;const ne=[...F],[we]=ne.splice(T,1);ne.splice(O,0,we),H(null),d(ne),V(null),q(null)},re=()=>{V(null),q(null)};return o.jsxs("div",{className:"module-sidebar-v2",children:[o.jsx("div",{className:"sidebar-header",children:v?o.jsxs("div",{className:"header-label-container",onClick:D,children:[o.jsx("div",{className:"header-label",title:Q(j,L),children:v}),P==="asc"?o.jsx(Xc,{size:12,className:"header-toggle-icon",strokeWidth:3}):o.jsx(Zc,{size:12,className:"header-toggle-icon",strokeWidth:3})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"header-title",title:Q(j,l),children:[b&&(P==="asc"?o.jsx(Xc,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:D}):o.jsx(Zc,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:D})),h," ",C&&`(${F.length})`]}),w&&o.jsx(Jc,{size:18,className:"add-view-icon",onClick:G})]})}),o.jsx("div",{className:"module-list",children:F.map((W,O)=>o.jsxs("div",{className:`module-item ${W.id===t?"selected":""} ${$===O&&T!==O?"drag-over":""} ${T===O?"dragging":""}`,onClick:()=>n&&n(W),draggable:!!d,onDragStart:d?ne=>ee(ne,O):void 0,onDragOver:d?ne=>ie(ne,O):void 0,onDrop:d?ne=>ue(ne,O):void 0,onDragEnd:d?re:void 0,children:[W.icon||o.jsx(C1,{size:18,className:"drag-handle"}),o.jsxs("div",{className:"module-content",title:Q(W.a11yConfig,W.titleKey),children:[o.jsx("div",{className:"module-title",children:W.title}),W.subtitle&&o.jsx("div",{className:"module-subtitle",children:W.subtitle})]}),typeof W.count<"u"&&o.jsx("span",{className:"module-count",children:W.count}),_&&o.jsxs("div",{className:"module-actions",children:[i&&o.jsx($c,{size:14,className:"action-icon add",onClick:ne=>Y(ne,W)}),r&&o.jsx(kt,{size:12,className:"action-icon edit",onClick:ne=>Me(ne,W)}),s&&o.jsx(dt,{size:12,className:"action-icon delete",onClick:ne=>he(ne,W)})]})]},W.id))}),o.jsx(Vc,{isOpen:N,onClose:oe,onSave:ae,title:u,fields:[{name:"title",label:p,placeholder:y}],confirmText:M,cancelText:x}),A&&o.jsx(Vc,{isOpen:!!A,onClose:me,onSave:Ce,title:m,initialValues:{title:A.title},fields:[{name:"title",label:f,placeholder:g}],confirmText:M,cancelText:x})]})},H7e=({keyName:e,translations:t,availableLanguages:n,onChange:c,onRename:i,onDelete:r,a11yConfig:s})=>{const[d,h]=k.useState(!1),[l,u]=k.useState(e),[p,y]=k.useState(null),[m,f]=k.useState(""),[g,M]=k.useState(!1),[x,v]=k.useState(""),[L,w]=k.useState(""),C=k.useMemo(()=>{const $={};return Array.isArray(t)&&t.forEach(q=>{q&&q.language&&($[q.language.toUpperCase()]=q.value)}),$},[t]),b=k.useMemo(()=>n,[n]),_=()=>{h(!1),l!==e&&l.trim()!==""?i&&i(l.trim()):u(e)},I=$=>{$.key==="Enter"?_():$.key==="Escape"&&(u(e),h(!1))},j=$=>{const q=$.toUpperCase();y(q),f(C[q]||"")},N=()=>{p&&(c(p,m),y(null),f(""))},S=$=>{$.key==="Enter"?N():$.key==="Escape"&&(y(null),f(""))},A=()=>{M(!0),b.length>0&&v(b[0].toUpperCase()),w("")},B=()=>{x&&L.trim()&&(c(x,L.trim()),M(!1),v(""),w(""))},T=()=>{M(!1),v(""),w("")},V=$=>{$.key==="Enter"?B():$.key==="Escape"&&T()};return o.jsxs("div",{className:"translation-key-v2",children:[o.jsxs("div",{className:"header",children:[d?o.jsx("input",{className:"key-name-input",value:l,onChange:$=>u($.target.value),onBlur:_,onKeyDown:I,autoFocus:!0}):o.jsx("h3",{className:"header-title",title:Q(s,e),children:e}),o.jsxs("div",{className:"header-actions",children:[o.jsx(kt,{size:16,className:"action-icon edit",onClick:()=>h(!0)}),o.jsx(dt,{size:16,className:"action-icon delete",onClick:r})]})]}),o.jsxs("div",{className:"translations-list",children:[n.map($=>{const q=$.toUpperCase(),P=C[q]||"",H=p===q;return o.jsxs("div",{className:"lang-row",children:[o.jsx("div",{className:"lang-label",children:q}),H?o.jsx("input",{className:"translation-input editing",value:m,onChange:D=>f(D.target.value),onBlur:N,onKeyDown:S,placeholder:"Entrez la traduction...",autoFocus:!0}):o.jsx("div",{className:`translation-value ${P?"":"empty"}`,onClick:()=>j($),title:"Cliquer pour éditer",children:P||"Cliquer pour ajouter..."})]},$)}),g?o.jsxs("div",{className:"lang-row add-row",children:[o.jsx("select",{className:"lang-select",value:x,onChange:$=>v($.target.value),children:b.map($=>o.jsx("option",{value:$.toUpperCase(),children:$.toUpperCase()},$))}),o.jsx("input",{className:"translation-input editing",value:L,onChange:$=>w($.target.value),onKeyDown:V,placeholder:"Mot",autoFocus:!0}),o.jsxs("div",{className:"add-actions",children:[o.jsx(_1,{size:18,className:"action-icon confirm",onClick:B}),o.jsx(Ke,{size:18,className:"action-icon cancel",onClick:T})]})]}):b.length>0&&o.jsxs("button",{className:"add-translation-btn",onClick:A,children:[o.jsx($c,{size:16}),o.jsx("span",{children:"Ajouter"})]})]})]})},D7e="_overlay_1jz4r_1",B7e="_modal_1jz4r_15",R7e="_body_1jz4r_27",F7e="_footer_1jz4r_46",E7e="_confirmButton_1jz4r_55",O7e="_danger_1jz4r_75",U7e="_cancelButton_1jz4r_83",Lt={overlay:D7e,modal:B7e,body:R7e,footer:F7e,confirmButton:E7e,danger:O7e,cancelButton:U7e},W7e=({isOpen:e,message:t,onConfirm:n,onCancel:c,confirmText:i="Confirmer",cancelText:r="Annuler",isDanger:s=!1,hideFooter:d=!1,secondaryConfirmText:h,onSecondaryConfirm:l})=>e?o.jsx("div",{className:Lt.overlay,onClick:c,children:o.jsxs("div",{className:Lt.modal,onClick:u=>u.stopPropagation(),children:[o.jsx("div",{className:Lt.body,children:typeof t=="string"?o.jsx("p",{children:t}):t}),!d&&o.jsxs("div",{className:Lt.footer,children:[i&&o.jsx("button",{className:`${Lt.confirmButton} ${s?Lt.danger:""}`,onClick:n,children:i}),h&&l&&o.jsx("button",{className:Lt.confirmButton,onClick:l,children:h}),r&&o.jsx("button",{className:Lt.cancelButton,onClick:c,children:r})]})]})}):null,G7e="_card_1ildr_1",K7e="_topIcon_1ildr_17",Z7e="_title_1ildr_24",X7e="_text_1ildr_31",Y7e="_bottomIcon_1ildr_37",y1={card:G7e,topIcon:K7e,title:Z7e,text:X7e,bottomIcon:Y7e},J7e=({topIcon:e,title:t,text:n,bottomIcon:c,onClick:i,className:r="",headerTextColor:s="#000",textColor:d="#4b5563",backgroundColor:h="#fff",a11yConfig:l})=>o.jsxs("div",{className:`${y1.card} ${r}`,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,style:{backgroundColor:h},title:Q(l,t),children:[e&&o.jsx("div",{className:y1.topIcon,children:e}),o.jsx("h3",{className:y1.title,style:{color:s},children:t}),o.jsx("p",{className:y1.text,style:{color:d},children:n}),c&&o.jsx("div",{className:y1.bottomIcon,children:c})]}),Q7e="_container_1bmmf_1",eve="_disabled_1bmmf_9",tve="_selectBox_1bmmf_14",ave="_selectBoxOpen_1bmmf_36",nve="_tagsContainer_1bmmf_41",ove="_tagsContainerWrap_1bmmf_51",cve="_tag_1bmmf_41",ive="_tagLabel_1bmmf_72",rve="_removeBtnContainer_1bmmf_78",sve="_removeBtn_1bmmf_78",dve="_searchInput_1bmmf_103",lve="_placeholder_1bmmf_123",hve="_actions_1bmmf_130",uve="_clearBtn_1bmmf_137",pve="_chevron_1bmmf_159",yve="_chevronOpen_1bmmf_165",kve="_dropdown_1bmmf_169",mve="_option_1bmmf_183",fve="_optionHeader_1bmmf_196",gve="_noOptions_1bmmf_212",vve="_overflowBlock_1bmmf_219",Mve="_overflowEllipsis_1bmmf_226",xve="_overflowBadge_1bmmf_233",_ve="_overflowBadgeWrap_1bmmf_256",Lve="_overflowDropdown_1bmmf_262",Ive="_overflowDropdownItem_1bmmf_278",bve="_overflowDropdownItemLabel_1bmmf_289",wve="_overflowDropdownItemRemove_1bmmf_296",ce={container:Q7e,disabled:eve,selectBox:tve,selectBoxOpen:ave,tagsContainer:nve,tagsContainerWrap:ove,tag:cve,tagLabel:ive,removeBtnContainer:rve,removeBtn:sve,searchInput:dve,placeholder:lve,actions:hve,clearBtn:uve,chevron:pve,chevronOpen:yve,dropdown:kve,option:mve,optionHeader:fve,noOptions:gve,overflowBlock:vve,overflowEllipsis:Mve,overflowBadge:xve,overflowBadgeWrap:_ve,overflowDropdown:Lve,overflowDropdownItem:Ive,overflowDropdownItemLabel:bve,overflowDropdownItemRemove:wve},Cve=({options:e,noOptionsMessage:t="",value:n,onChange:c,placeholder:i="Sélectionner...",isSearchable:r=!0,className:s="",disabled:d=!1,allowWrap:h=!1})=>{const[l,u]=k.useState(!1),[p,y]=k.useState(""),m=k.useRef(null),f=k.useRef(null),g=k.useRef(null),M=k.useRef(null),[x,v]=k.useState(null),[L,w]=k.useState(!1),C=k.useRef([]),b=k.useRef(null),_=k.useMemo(()=>{const q=new Map(e.map(P=>[P.value,P]));return n.map(P=>q.get(P)).filter(P=>P!==void 0)},[e,n]),I=k.useMemo(()=>e.filter(q=>!n.includes(q.value)),[e,n]),j=k.useMemo(()=>{let q=I;return p&&(q=q.filter(P=>P.label.toLowerCase().includes(p.toLowerCase()))),q.filter((P,H)=>{if(!P.isHeader)return!0;for(let D=H+1;D<q.length&&!q[D].isHeader;D++)return!0;return!1})},[I,p]);k.useEffect(()=>{const q=P=>{const H=P.target;m.current&&!m.current.contains(H)&&(u(!1),y(""),v(null),w(!1))};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]),k.useEffect(()=>{if(h)return;if(_.length===0){v(null),C.current=[];return}_.length>C.current.length&&v(null);const q=()=>{const F=g.current,G=M.current;if(!F||!G)return;const oe=G.getBoundingClientRect().width,ae=G.querySelector(`.${ce.actions}`),Me=ae?ae.getBoundingClientRect().width:80,me=56,Ce=r?80:0,he=16,Y=Array.from(F.querySelectorAll(`.${ce.tag}`));Y.length===_.length&&(C.current=Y.map(ge=>{const $e=ge.getBoundingClientRect(),Pt=ge.scrollWidth;return Math.max($e.width,Pt,ge.offsetWidth||0)}));const ee=C.current,ie=ee.length>0?ee.reduce((ge,$e)=>ge+$e,0)/ee.length:120,ue=_.length<=ee.length?ee.slice(0,_.length):[...ee,...Array(_.length-ee.length).fill(ie)],re=4,W=Math.max(0,oe-Me-Ce-he);let O=0,ne=0;for(let ge=0;ge<_.length;ge++){const $e=ue[ge]??120;if(O+$e+re>W)break;O+=$e+re,ne++}if(ne>=_.length){v(null);return}const we=Math.max(0,oe-me-Me-Ce-he);O=0;let Be=0;for(let ge=0;ge<_.length;ge++){const $e=ue[ge]??120;if(O+$e+re>we)break;O+=$e+re,Be++}Be<_.length&&Be>0?v(Be):v(null)},P=requestAnimationFrame(()=>{q()}),H=setTimeout(q,100),D=new ResizeObserver(()=>{q()});return M.current&&D.observe(M.current),()=>{cancelAnimationFrame(P),clearTimeout(H),D.disconnect()}},[_,r,l,h]);const N=()=>{if(d)return;const q=!l;q&&w(!1),u(q),q&&r&&setTimeout(()=>f.current?.focus(),0)},S=q=>{if(n.includes(q.value))return;w(!1);const P=[..._,q];c(P),y(""),v(null),u(!1)},A=q=>{q.preventDefault(),q.stopPropagation(),w(P=>!P)},B=x!=null&&x<_.length?_.slice(x):[],T=(q,P)=>{P.stopPropagation();const H=_.filter(D=>D.value!==q);c(H)},V=q=>{q.stopPropagation(),c([])},$=q=>{q.stopPropagation(),l||u(!0)};return o.jsxs("div",{className:`${ce.container} ${s} ${d?ce.disabled:""}`,ref:m,children:[o.jsxs("div",{ref:M,className:`${ce.selectBox} ${l?ce.selectBoxOpen:""}`,onClick:N,role:"combobox","aria-expanded":l,"aria-haspopup":"listbox",children:[o.jsxs("div",{className:`${ce.tagsContainer} ${h?ce.tagsContainerWrap:""}`,ref:g,children:[x!==null&&x>0?_.slice(0,x).map((q,P)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:q.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:H=>T(q.value,H),"aria-label":`Supprimer ${q.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${q.value}-${P}`)):_.map((q,P)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:q.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:H=>T(q.value,H),"aria-label":`Supprimer ${q.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${q.value}-${P}`)),r?o.jsx("input",{ref:f,type:"text",className:ce.searchInput,placeholder:_.length===0?i:"",value:p,onChange:q=>{y(q.target.value),l||u(!0)},onClick:$,disabled:d}):_.length===0&&o.jsx("span",{className:ce.placeholder,children:i})]}),!h&&x!==null&&x<_.length&&o.jsxs("div",{className:ce.overflowBlock,children:[o.jsx("span",{className:ce.overflowEllipsis,children:"..."}),o.jsxs("div",{className:ce.overflowBadgeWrap,children:[o.jsx("button",{ref:b,type:"button",className:ce.overflowBadge,onClick:A,"aria-label":`Afficher ${B.length} éléments cachés`,children:B.length}),L&&B.length>0&&o.jsx("div",{className:ce.overflowDropdown,role:"list","aria-label":"Éléments cachés",children:B.map((q,P)=>o.jsxs("div",{className:ce.overflowDropdownItem,children:[o.jsx("span",{className:ce.overflowDropdownItemLabel,children:q.label}),o.jsx("button",{type:"button",className:ce.overflowDropdownItemRemove,onClick:H=>{H.stopPropagation(),T(q.value,H)},"aria-label":`Supprimer ${q.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},`hidden-${q.value}-${P}`))})]})]}),o.jsxs("div",{className:ce.actions,children:[_.length>0&&o.jsx("button",{type:"button",className:ce.clearBtn,onClick:V,"aria-label":"Effacer tout",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:o.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),o.jsx("svg",{className:`${ce.chevron} ${l?ce.chevronOpen:""}`,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),l&&!d&&o.jsx("div",{className:ce.dropdown,role:"listbox",children:j.length>0?j.map((q,P)=>o.jsx("div",{className:`${ce.option} ${q.isHeader?ce.optionHeader:""}`,onClick:()=>!q.isHeader&&S(q),role:"option","aria-selected":!1,children:q.label},`opt-${q.value}-${P}`)):o.jsx("div",{className:ce.noOptions,children:t})})]})},Nve="_container_h7jek_1",Sve={container:Nve},jve=({a11yConfigs:e=[],titleKeys:t=[],labels:n=[],data:c=[],selectedUfs:i=[],icons:r=[],lastCardTextColor:s="black",boardColors:d={}})=>{const h=k.useMemo(()=>{const p=i.length===0?c:c.filter(m=>m&&i.includes(String(m.uf).replace(/^0+/,""))),y=new Set;return p.filter(m=>{if(!m||!m.uf)return!1;const f=String(m.uf).replace(/^0+/,"");return y.has(f)?!1:(y.add(f),!0)})},[c,i]),l=k.useMemo(()=>h.reduce((p,y)=>({disponibles:p.disponibles+(y.totalAvailable??y.disponibles??0),homme:p.homme+(y.availableMen??y.disponibleHomme??0),femme:p.femme+(y.availableWomen??y.disponibleFemme??0),indifferencie:p.indifferencie+(y.availableIndifferentSex??y.indifferences??0),sorties:p.sorties+(y.outToday??y.sortie24??0)}),{disponibles:0,homme:0,femme:0,indifferencie:0,sorties:0}),[h]),u=p=>d.disponibles?d.disponibles:p>3?"#35994E":p>=1?"#EF6C00":"#C62828";return o.jsxs("div",{className:Sve.container,children:[o.jsx(St,{a11yConfig:e[0],titleKey:t[0],label:n[0],value:l.disponibles.toLocaleString("fr-FR"),iconName:r[0],backgroundColor:u(l.disponibles),valueFontSize:"2.5rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"white",valueColor:"white",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[1],titleKey:t[1],label:n[1],value:l.homme.toLocaleString("fr-FR"),iconName:r[1],backgroundColor:d.homme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[2],titleKey:t[2],label:n[2],value:l.femme.toLocaleString("fr-FR"),iconName:r[2],backgroundColor:d.femme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[3],titleKey:t[3],label:n[3],value:l.indifferencie.toLocaleString("fr-FR"),iconName:r[3],backgroundColor:d.indifferencie??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[4],titleKey:t[4],label:n[4],value:l.sorties.toLocaleString("fr-FR"),iconName:r[4],backgroundColor:d.sorties??"#F2F9FC",valueFontSize:"3rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:s,valueColor:s,titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}})]})},$ve="_container_1pt6c_1",qve="_chartContainer_1pt6c_14",Ave="_legend_1pt6c_22",zve="_legendItem_1pt6c_29",Vve="_leftSection_1pt6c_41",Pve="_colorIndicator_1pt6c_47",Tve="_label_1pt6c_54",Hve="_rightSection_1pt6c_60",Dve="_ratio_1pt6c_66",Bve="_value1_1pt6c_73",Rve="_separator_1pt6c_78",Fve="_value2_1pt6c_82",Eve="_statusIndicator_1pt6c_87",Ove="_inactive_1pt6c_102",He={container:$ve,chartContainer:qve,legend:Ave,legendItem:zve,leftSection:Vve,colorIndicator:Pve,label:Tve,rightSection:Hve,ratio:Dve,value1:Bve,separator:Rve,value2:Fve,statusIndicator:Eve,inactive:Ove},yj=Math.PI/180,Uve=({data:e,height:t=400,bg:n,backgroundColor:c,color:i,fontSize:r,fontWeight:s,padding:d,margin:h,borderRadius:l,className:u="",style:p={},labelColor:y,ratioColor:m,separatorColor:f,borderColor:g,hideDonut:M=!0,hideColorIndicator:x=!1})=>{const[v,L]=k.useState(new Set(e.map(N=>N.nom))),w=N=>{const S=new Set(v);S.has(N)?S.size>1&&S.delete(N):S.add(N),L(S)},C={...p,"--bg-color":n||c||"transparent","--text-color":i||"inherit","--font-size":r||"14px","--font-weight":s||"400","--padding":d||"0","--margin":h||"0","--border-radius":l||"0","--label-color":y||"inherit","--ratio-color":m||"inherit","--separator-color":f||"#03a9f4","--border-color":g||"#e0e0e0"},b=k.useMemo(()=>e.map(N=>({...N,displayValue:v.has(N.nom)?N.value:0})),[e,v]),_=k.useMemo(()=>e.every(N=>N.value===0),[e]),I=k.useMemo(()=>_?1:b.reduce((N,S)=>N+S.displayValue,0)||1,[_,b]),j=k.useCallback(({cx:N,cy:S,midAngle:A,innerRadius:B,outerRadius:T,value:V})=>{if(V===0||_)return null;const $=B+(T-B)*.5,q=N+$*Math.cos(-A*yj),P=S+$*Math.sin(-A*yj),H=Math.round(V/I*100);return o.jsx(a.Text,{x:q,y:P,fill:"white",textAnchor:"middle",dominantBaseline:"central",fontSize:12,fontWeight:"bold",children:`${H}%`})},[I,_]);return o.jsxs("div",{className:`${He.container} ${u}`,style:C,children:[!M&&o.jsx("div",{className:He.chartContainer,style:{height:t/2+100},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:"100%",children:o.jsx(a.PieChart,{children:o.jsx(a.Pie,{data:_?[{displayValue:1,color:"#A3C2CB"}]:b,cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:0,dataKey:"displayValue",stroke:"white",strokeWidth:_?0:2,startAngle:90,endAngle:450,labelLine:!1,label:j,isAnimationActive:!1,children:_?o.jsx(a.Cell,{fill:"#A3C2CB"}):b.map((N,S)=>o.jsx(a.Cell,{fill:N.color},`cell-${S}`))})})})}),o.jsx("div",{className:He.legend,children:e.map((N,S)=>{const A=v.has(N.nom);return o.jsxs("div",{className:`${He.legendItem} ${!M&&!A?He.inactive:""}`,onClick:()=>w(N.nom),style:{cursor:"pointer",transition:"opacity 0.2s"},children:[o.jsxs("div",{className:He.leftSection,children:[!x&&o.jsx("div",{className:He.colorIndicator,style:{backgroundColor:N.color,opacity:M||A?1:.3}}),o.jsx("span",{className:He.label,style:{opacity:M||A?1:.5},children:N.nom})]}),o.jsxs("div",{className:He.rightSection,style:{opacity:M||A?1:.5},children:[o.jsxs("div",{className:He.ratio,children:[o.jsx("span",{className:He.value1,children:N.value1}),o.jsx("span",{className:He.separator,children:"/"}),o.jsx("span",{className:He.value2,children:N.value2})]}),N.statusColor&&o.jsx("div",{className:He.statusIndicator,style:{backgroundColor:N.statusColor}})]})]},`legend-${S}`)})})]})},Wve="_container_1pc4v_1",Gve="_leftGroup_1pc4v_10",Kve="_iconBtn_1pc4v_16",ti={container:Wve,leftGroup:Gve,iconBtn:Kve},Zve=e=>J.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},J.createElement("path",{d:"M3 12h18M3 6h18M3 18h18"})),Xve=k.memo(Zve),Yve=e=>J.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},J.createElement("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8m-4-6-4-4-4 4m4-4v13"})),iA=k.memo(Yve),Jve=({menuIcon:e,logoProps:t,actionIcon:n,style:c,className:i,bgColor:r="var(--header-bg)",color:s="var(--color-text)",borderBottomColor:d="var(--color-border)",borderBottomWidth:h=1,height:l="8vh",onMenuClick:u,onActionClick:p})=>{const y={backgroundColor:r,color:s,borderBottom:`${h}px solid ${d}`,height:l,...c};return o.jsxs("header",{className:[ti.container,i].filter(Boolean).join(" "),style:y,children:[o.jsxs("div",{className:ti.leftGroup,children:[o.jsx("button",{className:ti.iconBtn,onClick:u,"aria-label":"Menu",style:{color:"inherit"},children:e??o.jsx(Xve,{width:22,height:22})}),o.jsx(uL,{...t,size:"medium"})]}),o.jsx("button",{className:ti.iconBtn,onClick:p,"aria-label":"Action",style:{color:"inherit"},children:n??o.jsx(iA,{width:22,height:22})})]})},Qve="_container_24g3e_1",e9e="_iconBtn_24g3e_10",t9e="_title_24g3e_22",ai={container:Qve,iconBtn:e9e,title:t9e},a9e=({title:e="Menu",closeIcon:t,actionIcon:n,style:c,className:i,titleStyle:r,bgColor:s="var(--header-bg)",color:d="var(--color-text)",borderBottomColor:h="transparent",borderBottomWidth:l=0,height:u="8vh",onClose:p,onAction:y})=>{const m={backgroundColor:s,color:d,borderBottom:`${l}px solid ${h}`,height:u,...c};return o.jsxs("div",{className:[ai.container,i].filter(Boolean).join(" "),style:m,children:[o.jsx("button",{className:ai.iconBtn,onClick:p,"aria-label":"Fermer",style:{color:"inherit"},children:t??o.jsx(cA,{width:22,height:22})}),o.jsx("span",{className:ai.title,style:{fontWeight:"var(--font-weight-h)",fontSize:"var(--h5)",...r},children:e.toUpperCase()}),o.jsx("button",{className:ai.iconBtn,onClick:y,"aria-label":"Partager",style:{color:"inherit"},children:n??o.jsx(iA,{width:22,height:22})})]})},n9e=({title:e,countLabel:t="UF",actionIcon:n=o.jsx(dt,{size:16}),onAction:c,items:i=[],onItemClick:r,activeColor:s="#0083bb",id:d,children:h})=>{const l=k.useMemo(()=>i.filter(u=>u.active).length,[i]);return o.jsxs(o9e,{id:d,children:[o.jsxs(c9e,{children:[o.jsxs(i9e,{children:[o.jsx(r9e,{children:e}),o.jsxs(s9e,{children:["(",l," ",t,")"]})]}),c&&o.jsx(d9e,{onClick:c,title:"Action",children:n})]}),o.jsx(l9e,{children:o.jsx(h9e,{children:i.map(u=>o.jsx(p9e,{item:u,activeColor:s,onItemClick:r},u.id))})}),h&&o.jsx(y9e,{children:h})]})},o9e=te.div`
|
|
8180
|
+
`,style:{...de,backgroundColor:t===xe.value?j||"#F0F4F6":"transparent"},onMouseEnter:Ht=>{I&&(Ht.currentTarget.style.backgroundColor=I)},onMouseLeave:Ht=>{I&&(Ht.currentTarget.style.backgroundColor=t===xe.value?j||"#F0F4F6":"transparent")},role:"option","aria-selected":t===xe.value,children:o.jsxs("div",{className:be.itemContent,style:Tt,children:[xe.icon&&o.jsx("span",{className:be.itemIcon,style:ge,children:xe.icon}),o.jsx("span",{className:be.itemLabel,children:xe.label})]})},xe.value))})})]})},sge="_filterBar_1hlqe_3",dge="_label_1hlqe_11",uj={filterBar:sge,label:dge},lge=({label:e="Filtres",startDate:t,endDate:n,granularity:c,onStartDateChange:i,onEndDateChange:r,onGranularityChange:s,granularityItems:d,startDatePlaceholder:h="Date début",endDatePlaceholder:l="Date fin",granularityPlaceholder:u="Sélectionner...",className:p="",disabled:y=!1,gap:m="0.75rem",labelFontSize:f="0.875rem",labelFontWeight:g="400",labelColor:M="#212529",labelMarginRight:x="1rem",startDateWidth:v,endDateWidth:L,selectWidth:w,datePickerProps:C={},selectProps:b={},rightContent:_,extraContent:I})=>{const j={fontSize:f,fontWeight:g,color:M,marginRight:x},N={gap:m};return o.jsxs("div",{className:`${uj.filterBar} ${p}`,style:N,children:[e&&o.jsx("span",{className:uj.label,style:j,children:e}),o.jsx(dw,{value:t,onChange:i,placeholder:h,fullWidth:!1,disabled:y,label:void 0,width:v,...C}),o.jsx(dw,{value:n,onChange:r,placeholder:l,fullWidth:!1,disabled:y,label:void 0,width:L,...C}),o.jsx(oA,{items:d,value:c,onChange:s,placeholder:u,fullWidth:!1,disabled:y,label:void 0,width:w,...b}),I,_&&o.jsx("div",{style:{marginLeft:"auto"},children:_})]})},hge="_container_1x6mq_16",uge="_disabled_1x6mq_26",pge="_predStyle_1x6mq_32",yge="_realStyle_1x6mq_36",kge="_predGap_1x6mq_40",mge="_realGap_1x6mq_44",fge="_big_1x6mq_49",gge="_medium_1x6mq_53",vge="_iconWrapper_1x6mq_58",Mge="_predRelative_1x6mq_68",xge="_realRelative_1x6mq_72",_ge="_iconImg_1x6mq_76",Lge="_content_1x6mq_84",Ige="_header_1x6mq_93",bge="_predJustify_1x6mq_99",wge="_realJustify_1x6mq_103",Cge="_predHeaderLineHeight_1x6mq_116",Nge="_realHeaderLineHeight_1x6mq_120",Sge="_title_1x6mq_129",jge="_titleBlack_1x6mq_144",$ge="_titleWhite_1x6mq_148",qge="_subtitle_1x6mq_153",Age="_valueRowHorizontal_1x6mq_163",zge="_valueRowVertical_1x6mq_171",Vge="_singleValue_1x6mq_180",Pge="_primaryRow_1x6mq_184",Tge="_maxBadge_1x6mq_191",Hge="_valuePrimary_1x6mq_203",Dge="_valuePrimaryBlack_1x6mq_210",Bge="_valuePrimaryWhite_1x6mq_214",Rge="_valueSlash_1x6mq_219",Fge="_valueSecondary_1x6mq_226",Ege="_valueSecondaryBlue_1x6mq_232",Oge="_valueSecondaryWhite_1x6mq_236",Uge="_valueSecondaryBlack_1x6mq_240",Wge="_valueStacked_1x6mq_245",Gge="_stackedTop_1x6mq_254",Kge="_stackedBottom_1x6mq_255",pe={container:hge,disabled:uge,predStyle:pge,realStyle:yge,predGap:kge,realGap:mge,big:fge,medium:gge,iconWrapper:vge,predRelative:Mge,realRelative:xge,iconImg:_ge,content:Lge,header:Ige,predJustify:bge,realJustify:wge,predHeaderLineHeight:Cge,realHeaderLineHeight:Nge,title:Sge,titleBlack:jge,titleWhite:$ge,subtitle:qge,valueRowHorizontal:Age,valueRowVertical:zge,singleValue:Vge,primaryRow:Pge,maxBadge:Tge,valuePrimary:Hge,valuePrimaryBlack:Dge,valuePrimaryWhite:Bge,valueSlash:Rge,valueSecondary:Fge,valueSecondaryBlue:Ege,valueSecondaryWhite:Oge,valueSecondaryBlack:Uge,valueStacked:Wge,stackedTop:Gge,stackedBottom:Kge},Zge=({a11yConfig:e,iconName:t,title:n,subtitle:c,showSubtitle:i,realised:r="-",prediction:s="-",size:d="big",titleColor:h="black",valueColor:l="blue",realValueColor:u,className:p="",style:y="",variant:m="horizontal",showMax:f=!1,titleFontSize:g,titleFontWeight:M,subtitleFontSize:x,subtitleFontWeight:v,primaryFontSize:L,primaryFontWeight:w,secondaryFontSize:C,secondaryFontWeight:b,backgroundColor:_="#f2f9fc",gap:I="",disabled:j=!1,positionRelative:N="",justifyContent:S="",headerLineHeight:A="",headerMinHeight:B="",contentSpace:T="",titleKey:V,subtitleKey:$,subtitleA11yKey:q,maxBadgeKey:P,maxBadgeA11yKey:H,predictionKey:D,predictionA11yKey:E,realisedKey:G,realisedA11yKey:oe})=>{const ae=i!==void 0?i:!!c,Me=`${pe.container} ${pe[d]} ${pe[y]} ${j?pe.disabled:""}`,me=l==="white"?pe.valuePrimaryWhite:pe.valuePrimaryBlack,Ce=l==="blue"?pe.valueSecondaryBlue:l==="white"?pe.valueSecondaryWhite:pe.valueSecondaryBlack,he=re=>re===void 0?void 0:typeof re=="number"?`${re}px`:re,Y=re=>re===void 0?void 0:re,ee=m==="vertical",ie=s!=null&&s!==""&&s!=="-"&&s!=="—",ue=ee?pe.valueRowVertical:pe.valueRowHorizontal;return o.jsxs("div",{className:`${Me} ${p}`,style:{backgroundColor:_},children:[t&&o.jsx("div",{className:`${pe.iconWrapper} ${pe[N]}`,children:t}),o.jsxs("div",{className:`${pe.content} ${pe[I]} ${ie?"":pe.singleValue} content-indicator-v2`,style:{justifyContent:T},children:[o.jsx("div",{className:`${pe.header} ${pe[S]} ${pe[A]} header-indicator-v2`,style:{minHeight:B},children:o.jsx("h6",{className:`${pe.title}`,style:{fontSize:he(g),fontWeight:Y(M),color:h},title:Q(e,V),children:n})}),ae&&c?o.jsx("div",{className:"subtitle-container",children:o.jsx("span",{className:pe.subtitle,style:{fontSize:he(x),fontWeight:Y(v)},title:Q(e,$,q),children:c})}):null,o.jsxs("div",{className:`${ue} count-indicator-v2`,children:[o.jsxs("div",{className:pe.primaryRow,children:[f&&o.jsx("span",{className:`${pe.maxBadge} max-badge-indicator-v2`,title:Q(e,P,H),children:"MAX"}),o.jsx("span",{className:`${pe.valuePrimary} ${me}`,style:{fontSize:he(L||(!ie&&ee?"1.75rem":void 0)),fontWeight:Y(w),color:u||void 0},title:Q(e,G,oe),children:r})]}),ie&&o.jsxs(o.Fragment,{children:[!ee&&o.jsx("span",{className:pe.valueSlash,style:{fontSize:he(C),fontWeight:Y(b)},children:"/"}),o.jsx("span",{className:`${pe.valueSecondary} ${Ce}`,style:{fontSize:he(C),fontWeight:Y(b)},title:Q(e,D,E),children:s})]})]})]})]})},Xge="_banner_f10in_2",Yge="_iep_f10in_14",Jge="_groupSmall_f10in_24",Qge="_genre_f10in_34",e7e="_gravite_f10in_42",t7e="_orientationContainer_f10in_48",a7e="_service_f10in_61",n7e="_roomBedContainer_f10in_71",o7e="_room_f10in_71",c7e="_bed_f10in_87",i7e="_bedUf_f10in_92",r7e="_statusContainer_f10in_97",s7e="_status_f10in_97",d7e="_centeredWarn_f10in_124",Te={banner:Xge,iep:Yge,groupSmall:Jge,genre:Qge,gravite:e7e,orientationContainer:t7e,service:a7e,roomBedContainer:n7e,room:o7e,bed:c7e,bedUf:i7e,statusContainer:r7e,status:s7e,centeredWarn:d7e},l7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},J.createElement("mask",{id:"a",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},J.createElement("path",{fill:"#D9D9D9",d:"M0 0h16v16H0z"})),J.createElement("g",{mask:"url(#a)"},J.createElement("path",{fill:"#C60000",d:"M.666 14 7.999 1.333 15.333 14zm2.3-1.333h10.067L7.999 4zm5.508-.859a.65.65 0 0 0 .192-.475.65.65 0 0 0-.192-.475.65.65 0 0 0-.475-.191.65.65 0 0 0-.475.191.65.65 0 0 0-.191.475q0 .285.191.475A.65.65 0 0 0 8 12a.65.65 0 0 0 .475-.192M7.333 10h1.333V6.667H7.333z"}))),pj=k.memo(l7e),h7e=({patient:e,genre:t,gravite:n,bed:c,bed_uf:i,room:r,orientation:s,status:d,backgroundColor:h="#ffffff",primaryFontColor:l="#111827",secondaryFontColor:u="#6b7280",statusFontColor:p="#0284c7",statusBackgroundColor:y="#e0f2fe",genreBackgroundColor:m="#9ca3af",genreFontSize:f,style:g,warn:M=!1,warnMessage:x,warnColor:v="#F94134"})=>o.jsxs("div",{className:Te.banner,style:{backgroundColor:h,...g},children:[o.jsxs("div",{className:Te.iep,children:[o.jsx("div",{style:{color:u},children:e.iep??"--"}),o.jsxs("div",{style:{color:l},children:[((e.nom||"").trim().split(/\s+/)[0]||"").substring(0,3).toUpperCase(),"."," ",((e.prenom||"").trim().split(/\s+/)[0]||"").substring(0,3).toLowerCase().replace(/^./,L=>L.toUpperCase()),".(",e.age,")"]})]}),o.jsxs("div",{className:Te.groupSmall,children:[o.jsx("span",{className:`${Te.genre} genre-info-banner`,style:{color:"#ffffff",background:m,fontSize:f},children:t??"--"}),o.jsx("span",{className:`${Te.gravite} gravite-info-banner`,children:n??"--"})]}),o.jsx("div",{className:Te.orientationContainer,children:o.jsx("div",{className:Te.service,style:{color:l},children:s??"--"})}),o.jsxs("div",{className:Te.roomBedContainer,children:[i&&o.jsx("span",{className:Te.bedUf,children:i}),o.jsx("span",{className:Te.room,children:r??"--"}),o.jsx("span",{className:Te.bed,children:c??"--"})]}),o.jsxs("div",{className:Te.statusContainer,children:[d?o.jsx("div",{className:`${Te.status} status-info-banner`,style:{color:p,backgroundColor:y},children:d}):M&&o.jsxs("div",{className:Te.centeredWarn,style:{textTransform:"uppercase"},children:[o.jsx(pj,{color:v,width:20,height:20,style:{marginRight:"6px"}}),o.jsx("span",{style:{color:v,fontSize:"12px",fontWeight:600},children:x})]}),d&&M&&o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",color:v,fontSize:"10px",fontWeight:400,marginTop:"4px",textTransform:"uppercase"},children:[o.jsx(pj,{color:v,width:12,height:12,style:{marginRight:"4px"}}),o.jsx("span",{children:x})]})]})]}),u7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M200-200v-240h60v180h180v60zm500-320v-180H520v-60h240v240z"})),p7e=k.memo(u7e),y7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231z"})),cA=k.memo(y7e),k7e=e=>J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},J.createElement("path",{d:"M440-440v240h-60v-180H200v-60zm140-320v180h180v60H520v-240z"})),m7e=k.memo(k7e),f7e="_overlay_1uxex_1",g7e="_container_1uxex_11",v7e="_fullscreen_1uxex_24",M7e="_header_1uxex_30",x7e="_headerActions_1uxex_42",_7e="_iconButton_1uxex_47",L7e="_body_1uxex_58",I7e="_sidebar_1uxex_65",b7e="_content_1uxex_91",w7e="_contentHeader_1uxex_98",C7e="_childrenWrapper_1uxex_114",N7e="_footer_1uxex_138",S7e="_baseButton_1uxex_146",j7e="_noOverlay_1uxex_160",$7e="_contained_1uxex_168",Ne={overlay:f7e,container:g7e,fullscreen:v7e,header:M7e,headerActions:x7e,iconButton:_7e,body:L7e,sidebar:I7e,content:b7e,contentHeader:w7e,childrenWrapper:C7e,footer:N7e,baseButton:S7e,noOverlay:j7e,contained:$7e},q7e=({headerText:e,headerTextColor:t="var(--color-text)",backgroundColor:n="var(--color-background)",headerFontSize:c="1rem",headerFontWeight:i="600",isOpen:r,onClose:s,leftButton:d,rightButton:h,children:l,contentTitle:u,contentBackgroundColor:p="var(--color-content-background)",sideContent:y,hideMaximize:m=!1,hideHeader:f=!1,hideSidebar:g=!1,onDelete:M,deleteLabel:x="Supprimer",width:v="75%",maxWidth:L="none",height:w="85%",maxHeight:C="85%",borderRadius:b="0.5rem",childrenPadding:_="1rem",overflow:I="auto",contentHeaderAction:j,contentFooterAction:N,hideFooter:S=!1,hideOverlay:A=!1,position:B,a11yConfig:T})=>{const[V,$]=k.useState(!1),q=k.useRef(null);if(k.useEffect(()=>{if(!r||!A)return;const H=D=>{(D.type==="scroll"||D.type==="wheel"||D.type==="touchmove"||q.current&&!q.current.contains(D.target))&&s()};return document.addEventListener("mousedown",H),document.addEventListener("scroll",H,!0),document.addEventListener("wheel",H,{passive:!0,capture:!0}),document.addEventListener("touchmove",H,{passive:!0,capture:!0}),()=>{document.removeEventListener("mousedown",H),document.removeEventListener("scroll",H,!0),document.removeEventListener("wheel",H,!0),document.removeEventListener("touchmove",H,!0)}},[r,A,s]),!r)return null;const P=(H,D=!1)=>o.jsx(tL,{onClick:H.disabled?void 0:H.onClick,className:Ne.baseButton,disabled:H.disabled,style:{background:H.backgroundColor??(D?"#008FBB":"#ffffff"),color:H.textColor??(D?"#ffffff":"#374151"),border:H.borderColor||D?"none":void 0,cursor:H.disabled?H.cursor??"not-allowed":H.cursor??"pointer",filter:H.disabled?H.filter??"grayscale(0.5)":H.filter??"none",opacity:H.disabled?.65:1},title:Q(H.a11yConfig,H.text),children:H.text});return o.jsx("div",{className:A?Ne.noOverlay:Ne.overlay,onClick:s,children:o.jsxs("div",{ref:q,className:`${Ne.container} ${V?Ne.fullscreen:""} ${A?Ne.contained:""}`,onClick:H=>H.stopPropagation(),style:{width:V?"100%":v,maxWidth:V?"none":L,height:V?"100%":w,maxHeight:V?"100%":C,borderRadius:V?"0":b,overflow:I,...B||{}},children:[!f&&o.jsxs("header",{className:Ne.header,style:{backgroundColor:n},children:[o.jsx("h2",{style:{fontSize:c,fontWeight:i,color:t},title:Q(T,e),children:e}),o.jsxs("div",{className:Ne.headerActions,children:[!m&&o.jsx("button",{onClick:()=>$(!V),className:Ne.iconButton,title:V?"Réduire":"Agrandir",children:V?o.jsx(m7e,{width:22,height:22,fill:t}):o.jsx(p7e,{width:22,height:22,fill:t})}),o.jsx("button",{onClick:s,className:Ne.iconButton,title:"Fermer",children:o.jsx(cA,{width:22,height:22,fill:t})})]})]}),o.jsxs("div",{className:Ne.body,style:{overflow:I},children:[y&&!g&&o.jsx("aside",{className:Ne.sidebar,children:y}),o.jsxs("main",{className:Ne.content,style:{backgroundColor:p,overflow:I},children:[u&&o.jsxs("header",{className:Ne.contentHeader,style:{backgroundColor:n},children:[o.jsx("span",{style:{color:t},children:u}),j]}),o.jsx("div",{className:Ne.childrenWrapper,style:{padding:_,overflow:I},children:l})]})]}),!S&&o.jsxs("footer",{className:Ne.footer,style:{backgroundColor:n},children:[M&&o.jsx(tL,{onClick:M,className:Ne.baseButton,style:{background:"#fee2e2",color:"#ef4444",marginRight:"auto",border:"none"},children:x}),N,P(d),P(h,!0)]})]})})},A7e="_container_1vb1c_1",z7e="_searchWrapper_1vb1c_10",V7e="_navItems_1vb1c_17",Vb={container:A7e,searchWrapper:z7e,navItems:V7e},P7e=({items:e,activeId:t,activeColor:n="#00aec7",backgroundColor:c="#fff",textColor:i="#000",onItemClick:r,searchValue:s="",onSearchChange:d,searchPlaceholder:h="Rechercher",width:l="100%",className:u=""})=>o.jsxs("div",{className:`${Vb.container} ${u}`,style:{width:l,backgroundColor:c,color:i},children:[o.jsx("div",{className:Vb.searchWrapper,children:o.jsx(Jq,{value:s,onChange:d,placeholder:h,iconPosition:"right",iconColor:"var(--color-text)"})}),o.jsx("div",{className:Vb.navItems,children:e.map(p=>o.jsx(Xw,{id:p.id,label:p.label,icon:p.icon,isActive:t===p.id,onClick:()=>r?.(p.id),activeColor:n,color:i,fontWeight:"600",fontSize:"0.75rem",padding:"0.75rem 1rem",iconGap:"0.5rem"},p.id))})]}),T7e=({modules:e,selectedModuleId:t,onSelectModule:n,onAddModule:c,onItemAdd:i,onEditModule:r,onDeleteModule:s,onReorder:d,title:h="Modules",titleKey:l,addModuleTitle:u="Ajouter un module",addModuleLabel:p="Titre",addModulePlaceholder:y="Nom du module",renameModuleTitle:m="Renommer le module",renameModuleLabel:f="Titre",renameModulePlaceholder:g="Nom du module",confirmText:M="Valider",cancelText:x="Annuler",headerLabel:v,headerLabelKey:L,showAddIcon:w=!0,showCount:C=!0,showToggle:b=!1,showActions:_=!0,onToggle:I,a11yConfig:j})=>{const[N,S]=k.useState(!1),[A,B]=k.useState(null),[T,V]=k.useState(null),[$,q]=k.useState(null),[P,H]=k.useState(null),D=()=>{H(W=>W===null?"asc":W==="asc"?"desc":null),I&&I()},E=k.useMemo(()=>P?[...e].sort((W,O)=>{const ne=W.title.toLowerCase(),we=O.title.toLowerCase();return P==="asc"?ne.localeCompare(we):we.localeCompare(ne)}):e,[e,P]),G=()=>S(!0),oe=()=>S(!1),ae=W=>{const O=W.title?.trim();O&&c&&c(O),oe()},Me=(W,O)=>{W.stopPropagation(),B(O)},me=()=>B(null),Ce=W=>{const O=W.title?.trim();A&&O&&r&&r(A,O),me()},he=(W,O)=>{W.stopPropagation(),s&&s(O)},Y=(W,O)=>{W.stopPropagation(),i&&i(O)},ee=(W,O)=>{V(O),W.dataTransfer.effectAllowed="move"},ie=(W,O)=>{T!==null&&(W.preventDefault(),W.dataTransfer.dropEffect="move",O!==$&&q(O))},ue=(W,O)=>{if(W.preventDefault(),T===null||T===O||!d)return;const ne=[...E],[we]=ne.splice(T,1);ne.splice(O,0,we),H(null),d(ne),V(null),q(null)},re=()=>{V(null),q(null)};return o.jsxs("div",{className:"module-sidebar-v2",children:[o.jsx("div",{className:"sidebar-header",children:v?o.jsxs("div",{className:"header-label-container",onClick:D,children:[o.jsx("div",{className:"header-label",title:Q(j,L),children:v}),P==="asc"?o.jsx(Xc,{size:12,className:"header-toggle-icon",strokeWidth:3}):o.jsx(Zc,{size:12,className:"header-toggle-icon",strokeWidth:3})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"header-title",title:Q(j,l),children:[b&&(P==="asc"?o.jsx(Xc,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:D}):o.jsx(Zc,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:D})),h," ",C&&`(${E.length})`]}),w&&o.jsx(Jc,{size:18,className:"add-view-icon",onClick:G})]})}),o.jsx("div",{className:"module-list",children:E.map((W,O)=>o.jsxs("div",{className:`module-item ${W.id===t?"selected":""} ${$===O&&T!==O?"drag-over":""} ${T===O?"dragging":""}`,onClick:()=>n&&n(W),draggable:!!d,onDragStart:d?ne=>ee(ne,O):void 0,onDragOver:d?ne=>ie(ne,O):void 0,onDrop:d?ne=>ue(ne,O):void 0,onDragEnd:d?re:void 0,children:[W.icon||o.jsx(C1,{size:18,className:"drag-handle"}),o.jsxs("div",{className:"module-content",title:Q(W.a11yConfig,W.titleKey),children:[o.jsx("div",{className:"module-title",children:W.title}),W.subtitle&&o.jsx("div",{className:"module-subtitle",children:W.subtitle})]}),typeof W.count<"u"&&o.jsx("span",{className:"module-count",children:W.count}),_&&o.jsxs("div",{className:"module-actions",children:[i&&o.jsx($c,{size:14,className:"action-icon add",onClick:ne=>Y(ne,W)}),r&&o.jsx(kt,{size:12,className:"action-icon edit",onClick:ne=>Me(ne,W)}),s&&o.jsx(dt,{size:12,className:"action-icon delete",onClick:ne=>he(ne,W)})]})]},W.id))}),o.jsx(Vc,{isOpen:N,onClose:oe,onSave:ae,title:u,fields:[{name:"title",label:p,placeholder:y}],confirmText:M,cancelText:x}),A&&o.jsx(Vc,{isOpen:!!A,onClose:me,onSave:Ce,title:m,initialValues:{title:A.title},fields:[{name:"title",label:f,placeholder:g}],confirmText:M,cancelText:x})]})},H7e=({keyName:e,translations:t,availableLanguages:n,onChange:c,onRename:i,onDelete:r,a11yConfig:s})=>{const[d,h]=k.useState(!1),[l,u]=k.useState(e),[p,y]=k.useState(null),[m,f]=k.useState(""),[g,M]=k.useState(!1),[x,v]=k.useState(""),[L,w]=k.useState(""),C=k.useMemo(()=>{const $={};return Array.isArray(t)&&t.forEach(q=>{q&&q.language&&($[q.language.toUpperCase()]=q.value)}),$},[t]),b=k.useMemo(()=>n,[n]),_=()=>{h(!1),l!==e&&l.trim()!==""?i&&i(l.trim()):u(e)},I=$=>{$.key==="Enter"?_():$.key==="Escape"&&(u(e),h(!1))},j=$=>{const q=$.toUpperCase();y(q),f(C[q]||"")},N=()=>{p&&(c(p,m),y(null),f(""))},S=$=>{$.key==="Enter"?N():$.key==="Escape"&&(y(null),f(""))},A=()=>{M(!0),b.length>0&&v(b[0].toUpperCase()),w("")},B=()=>{x&&L.trim()&&(c(x,L.trim()),M(!1),v(""),w(""))},T=()=>{M(!1),v(""),w("")},V=$=>{$.key==="Enter"?B():$.key==="Escape"&&T()};return o.jsxs("div",{className:"translation-key-v2",children:[o.jsxs("div",{className:"header",children:[d?o.jsx("input",{className:"key-name-input",value:l,onChange:$=>u($.target.value),onBlur:_,onKeyDown:I,autoFocus:!0}):o.jsx("h3",{className:"header-title",title:Q(s,e),children:e}),o.jsxs("div",{className:"header-actions",children:[o.jsx(kt,{size:16,className:"action-icon edit",onClick:()=>h(!0)}),o.jsx(dt,{size:16,className:"action-icon delete",onClick:r})]})]}),o.jsxs("div",{className:"translations-list",children:[n.map($=>{const q=$.toUpperCase(),P=C[q]||"",H=p===q;return o.jsxs("div",{className:"lang-row",children:[o.jsx("div",{className:"lang-label",children:q}),H?o.jsx("input",{className:"translation-input editing",value:m,onChange:D=>f(D.target.value),onBlur:N,onKeyDown:S,placeholder:"Entrez la traduction...",autoFocus:!0}):o.jsx("div",{className:`translation-value ${P?"":"empty"}`,onClick:()=>j($),title:"Cliquer pour éditer",children:P||"Cliquer pour ajouter..."})]},$)}),g?o.jsxs("div",{className:"lang-row add-row",children:[o.jsx("select",{className:"lang-select",value:x,onChange:$=>v($.target.value),children:b.map($=>o.jsx("option",{value:$.toUpperCase(),children:$.toUpperCase()},$))}),o.jsx("input",{className:"translation-input editing",value:L,onChange:$=>w($.target.value),onKeyDown:V,placeholder:"Mot",autoFocus:!0}),o.jsxs("div",{className:"add-actions",children:[o.jsx(_1,{size:18,className:"action-icon confirm",onClick:B}),o.jsx(Ke,{size:18,className:"action-icon cancel",onClick:T})]})]}):b.length>0&&o.jsxs("button",{className:"add-translation-btn",onClick:A,children:[o.jsx($c,{size:16}),o.jsx("span",{children:"Ajouter"})]})]})]})},D7e="_overlay_1jz4r_1",B7e="_modal_1jz4r_15",R7e="_body_1jz4r_27",F7e="_footer_1jz4r_46",E7e="_confirmButton_1jz4r_55",O7e="_danger_1jz4r_75",U7e="_cancelButton_1jz4r_83",Lt={overlay:D7e,modal:B7e,body:R7e,footer:F7e,confirmButton:E7e,danger:O7e,cancelButton:U7e},W7e=({isOpen:e,message:t,onConfirm:n,onCancel:c,confirmText:i="Confirmer",cancelText:r="Annuler",isDanger:s=!1,hideFooter:d=!1,secondaryConfirmText:h,onSecondaryConfirm:l})=>e?o.jsx("div",{className:Lt.overlay,onClick:c,children:o.jsxs("div",{className:Lt.modal,onClick:u=>u.stopPropagation(),children:[o.jsx("div",{className:Lt.body,children:typeof t=="string"?o.jsx("p",{children:t}):t}),!d&&o.jsxs("div",{className:Lt.footer,children:[i&&o.jsx("button",{className:`${Lt.confirmButton} ${s?Lt.danger:""}`,onClick:n,children:i}),h&&l&&o.jsx("button",{className:Lt.confirmButton,onClick:l,children:h}),r&&o.jsx("button",{className:Lt.cancelButton,onClick:c,children:r})]})]})}):null,G7e="_card_1ildr_1",K7e="_topIcon_1ildr_17",Z7e="_title_1ildr_24",X7e="_text_1ildr_31",Y7e="_bottomIcon_1ildr_37",y1={card:G7e,topIcon:K7e,title:Z7e,text:X7e,bottomIcon:Y7e},J7e=({topIcon:e,title:t,text:n,bottomIcon:c,onClick:i,className:r="",headerTextColor:s="#000",textColor:d="#4b5563",backgroundColor:h="#fff",a11yConfig:l})=>o.jsxs("div",{className:`${y1.card} ${r}`,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,style:{backgroundColor:h},title:Q(l,t),children:[e&&o.jsx("div",{className:y1.topIcon,children:e}),o.jsx("h3",{className:y1.title,style:{color:s},children:t}),o.jsx("p",{className:y1.text,style:{color:d},children:n}),c&&o.jsx("div",{className:y1.bottomIcon,children:c})]}),Q7e="_container_1bmmf_1",eve="_disabled_1bmmf_9",tve="_selectBox_1bmmf_14",ave="_selectBoxOpen_1bmmf_36",nve="_tagsContainer_1bmmf_41",ove="_tagsContainerWrap_1bmmf_51",cve="_tag_1bmmf_41",ive="_tagLabel_1bmmf_72",rve="_removeBtnContainer_1bmmf_78",sve="_removeBtn_1bmmf_78",dve="_searchInput_1bmmf_103",lve="_placeholder_1bmmf_123",hve="_actions_1bmmf_130",uve="_clearBtn_1bmmf_137",pve="_chevron_1bmmf_159",yve="_chevronOpen_1bmmf_165",kve="_dropdown_1bmmf_169",mve="_option_1bmmf_183",fve="_optionHeader_1bmmf_196",gve="_noOptions_1bmmf_212",vve="_overflowBlock_1bmmf_219",Mve="_overflowEllipsis_1bmmf_226",xve="_overflowBadge_1bmmf_233",_ve="_overflowBadgeWrap_1bmmf_256",Lve="_overflowDropdown_1bmmf_262",Ive="_overflowDropdownItem_1bmmf_278",bve="_overflowDropdownItemLabel_1bmmf_289",wve="_overflowDropdownItemRemove_1bmmf_296",ce={container:Q7e,disabled:eve,selectBox:tve,selectBoxOpen:ave,tagsContainer:nve,tagsContainerWrap:ove,tag:cve,tagLabel:ive,removeBtnContainer:rve,removeBtn:sve,searchInput:dve,placeholder:lve,actions:hve,clearBtn:uve,chevron:pve,chevronOpen:yve,dropdown:kve,option:mve,optionHeader:fve,noOptions:gve,overflowBlock:vve,overflowEllipsis:Mve,overflowBadge:xve,overflowBadgeWrap:_ve,overflowDropdown:Lve,overflowDropdownItem:Ive,overflowDropdownItemLabel:bve,overflowDropdownItemRemove:wve},Cve=({options:e,noOptionsMessage:t="",value:n,onChange:c,placeholder:i="Sélectionner...",isSearchable:r=!0,className:s="",disabled:d=!1,allowWrap:h=!1})=>{const[l,u]=k.useState(!1),[p,y]=k.useState(""),m=k.useRef(null),f=k.useRef(null),g=k.useRef(null),M=k.useRef(null),[x,v]=k.useState(null),[L,w]=k.useState(!1),C=k.useRef([]),b=k.useRef(null),_=k.useMemo(()=>{const q=new Map(e.map(P=>[P.value,P]));return n.map(P=>q.get(P)).filter(P=>P!==void 0)},[e,n]),I=k.useMemo(()=>e.filter(q=>!n.includes(q.value)),[e,n]),j=k.useMemo(()=>{let q=I;return p&&(q=q.filter(P=>P.label.toLowerCase().includes(p.toLowerCase()))),q.filter((P,H)=>{if(!P.isHeader)return!0;for(let D=H+1;D<q.length&&!q[D].isHeader;D++)return!0;return!1})},[I,p]);k.useEffect(()=>{const q=P=>{const H=P.target;m.current&&!m.current.contains(H)&&(u(!1),y(""),v(null),w(!1))};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]),k.useEffect(()=>{if(h)return;if(_.length===0){v(null),C.current=[];return}_.length>C.current.length&&v(null);const q=()=>{const E=g.current,G=M.current;if(!E||!G)return;const oe=G.getBoundingClientRect().width,ae=G.querySelector(`.${ce.actions}`),Me=ae?ae.getBoundingClientRect().width:80,me=56,Ce=r?80:0,he=16,Y=Array.from(E.querySelectorAll(`.${ce.tag}`));Y.length===_.length&&(C.current=Y.map(ge=>{const $e=ge.getBoundingClientRect(),Pt=ge.scrollWidth;return Math.max($e.width,Pt,ge.offsetWidth||0)}));const ee=C.current,ie=ee.length>0?ee.reduce((ge,$e)=>ge+$e,0)/ee.length:120,ue=_.length<=ee.length?ee.slice(0,_.length):[...ee,...Array(_.length-ee.length).fill(ie)],re=4,W=Math.max(0,oe-Me-Ce-he);let O=0,ne=0;for(let ge=0;ge<_.length;ge++){const $e=ue[ge]??120;if(O+$e+re>W)break;O+=$e+re,ne++}if(ne>=_.length){v(null);return}const we=Math.max(0,oe-me-Me-Ce-he);O=0;let Be=0;for(let ge=0;ge<_.length;ge++){const $e=ue[ge]??120;if(O+$e+re>we)break;O+=$e+re,Be++}Be<_.length&&Be>0?v(Be):v(null)},P=requestAnimationFrame(()=>{q()}),H=setTimeout(q,100),D=new ResizeObserver(()=>{q()});return M.current&&D.observe(M.current),()=>{cancelAnimationFrame(P),clearTimeout(H),D.disconnect()}},[_,r,l,h]);const N=()=>{if(d)return;const q=!l;q&&w(!1),u(q),q&&r&&setTimeout(()=>f.current?.focus(),0)},S=q=>{if(n.includes(q.value))return;w(!1);const P=[..._,q];c(P),y(""),v(null),u(!1)},A=q=>{q.preventDefault(),q.stopPropagation(),w(P=>!P)},B=x!=null&&x<_.length?_.slice(x):[],T=(q,P)=>{P.stopPropagation();const H=_.filter(D=>D.value!==q);c(H)},V=q=>{q.stopPropagation(),c([])},$=q=>{q.stopPropagation(),l||u(!0)};return o.jsxs("div",{className:`${ce.container} ${s} ${d?ce.disabled:""}`,ref:m,children:[o.jsxs("div",{ref:M,className:`${ce.selectBox} ${l?ce.selectBoxOpen:""}`,onClick:N,role:"combobox","aria-expanded":l,"aria-haspopup":"listbox",children:[o.jsxs("div",{className:`${ce.tagsContainer} ${h?ce.tagsContainerWrap:""}`,ref:g,children:[x!==null&&x>0?_.slice(0,x).map((q,P)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:q.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:H=>T(q.value,H),"aria-label":`Supprimer ${q.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${q.value}-${P}`)):_.map((q,P)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:q.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:H=>T(q.value,H),"aria-label":`Supprimer ${q.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${q.value}-${P}`)),r?o.jsx("input",{ref:f,type:"text",className:ce.searchInput,placeholder:_.length===0?i:"",value:p,onChange:q=>{y(q.target.value),l||u(!0)},onClick:$,disabled:d}):_.length===0&&o.jsx("span",{className:ce.placeholder,children:i})]}),!h&&x!==null&&x<_.length&&o.jsxs("div",{className:ce.overflowBlock,children:[o.jsx("span",{className:ce.overflowEllipsis,children:"..."}),o.jsxs("div",{className:ce.overflowBadgeWrap,children:[o.jsx("button",{ref:b,type:"button",className:ce.overflowBadge,onClick:A,"aria-label":`Afficher ${B.length} éléments cachés`,children:B.length}),L&&B.length>0&&o.jsx("div",{className:ce.overflowDropdown,role:"list","aria-label":"Éléments cachés",children:B.map((q,P)=>o.jsxs("div",{className:ce.overflowDropdownItem,children:[o.jsx("span",{className:ce.overflowDropdownItemLabel,children:q.label}),o.jsx("button",{type:"button",className:ce.overflowDropdownItemRemove,onClick:H=>{H.stopPropagation(),T(q.value,H)},"aria-label":`Supprimer ${q.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},`hidden-${q.value}-${P}`))})]})]}),o.jsxs("div",{className:ce.actions,children:[_.length>0&&o.jsx("button",{type:"button",className:ce.clearBtn,onClick:V,"aria-label":"Effacer tout",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:o.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),o.jsx("svg",{className:`${ce.chevron} ${l?ce.chevronOpen:""}`,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),l&&!d&&o.jsx("div",{className:ce.dropdown,role:"listbox",children:j.length>0?j.map((q,P)=>o.jsx("div",{className:`${ce.option} ${q.isHeader?ce.optionHeader:""}`,onClick:()=>!q.isHeader&&S(q),role:"option","aria-selected":!1,children:q.label},`opt-${q.value}-${P}`)):o.jsx("div",{className:ce.noOptions,children:t})})]})},Nve="_container_h7jek_1",Sve={container:Nve},jve=({a11yConfigs:e=[],titleKeys:t=[],labels:n=[],data:c=[],selectedUfs:i=[],icons:r=[],lastCardTextColor:s="black",boardColors:d={}})=>{const h=k.useMemo(()=>{const p=i.length===0?c:c.filter(m=>m&&i.includes(String(m.uf).replace(/^0+/,""))),y=new Set;return p.filter(m=>{if(!m||!m.uf)return!1;const f=String(m.uf).replace(/^0+/,"");return y.has(f)?!1:(y.add(f),!0)})},[c,i]),l=k.useMemo(()=>h.reduce((p,y)=>({disponibles:p.disponibles+(y.totalAvailable??y.disponibles??0),homme:p.homme+(y.availableMen??y.disponibleHomme??0),femme:p.femme+(y.availableWomen??y.disponibleFemme??0),indifferencie:p.indifferencie+(y.availableIndifferentSex??y.indifferences??0),sorties:p.sorties+(y.outToday??y.sortie24??0)}),{disponibles:0,homme:0,femme:0,indifferencie:0,sorties:0}),[h]),u=p=>d.disponibles?d.disponibles:p>3?"#35994E":p>=1?"#EF6C00":"#C62828";return o.jsxs("div",{className:Sve.container,children:[o.jsx(St,{a11yConfig:e[0],titleKey:t[0],label:n[0],value:l.disponibles.toLocaleString("fr-FR"),iconName:r[0],backgroundColor:u(l.disponibles),valueFontSize:"2.5rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"white",valueColor:"white",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[1],titleKey:t[1],label:n[1],value:l.homme.toLocaleString("fr-FR"),iconName:r[1],backgroundColor:d.homme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[2],titleKey:t[2],label:n[2],value:l.femme.toLocaleString("fr-FR"),iconName:r[2],backgroundColor:d.femme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[3],titleKey:t[3],label:n[3],value:l.indifferencie.toLocaleString("fr-FR"),iconName:r[3],backgroundColor:d.indifferencie??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(St,{a11yConfig:e[4],titleKey:t[4],label:n[4],value:l.sorties.toLocaleString("fr-FR"),iconName:r[4],backgroundColor:d.sorties??"#F2F9FC",valueFontSize:"3rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:s,valueColor:s,titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}})]})},$ve="_container_1pt6c_1",qve="_chartContainer_1pt6c_14",Ave="_legend_1pt6c_22",zve="_legendItem_1pt6c_29",Vve="_leftSection_1pt6c_41",Pve="_colorIndicator_1pt6c_47",Tve="_label_1pt6c_54",Hve="_rightSection_1pt6c_60",Dve="_ratio_1pt6c_66",Bve="_value1_1pt6c_73",Rve="_separator_1pt6c_78",Fve="_value2_1pt6c_82",Eve="_statusIndicator_1pt6c_87",Ove="_inactive_1pt6c_102",He={container:$ve,chartContainer:qve,legend:Ave,legendItem:zve,leftSection:Vve,colorIndicator:Pve,label:Tve,rightSection:Hve,ratio:Dve,value1:Bve,separator:Rve,value2:Fve,statusIndicator:Eve,inactive:Ove},yj=Math.PI/180,Uve=({data:e,height:t=400,bg:n,backgroundColor:c,color:i,fontSize:r,fontWeight:s,padding:d,margin:h,borderRadius:l,className:u="",style:p={},labelColor:y,ratioColor:m,separatorColor:f,borderColor:g,hideDonut:M=!0,hideColorIndicator:x=!1})=>{const[v,L]=k.useState(new Set(e.map(N=>N.nom))),w=N=>{const S=new Set(v);S.has(N)?S.size>1&&S.delete(N):S.add(N),L(S)},C={...p,"--bg-color":n||c||"transparent","--text-color":i||"inherit","--font-size":r||"14px","--font-weight":s||"400","--padding":d||"0","--margin":h||"0","--border-radius":l||"0","--label-color":y||"inherit","--ratio-color":m||"inherit","--separator-color":f||"#03a9f4","--border-color":g||"#e0e0e0"},b=k.useMemo(()=>e.map(N=>({...N,displayValue:v.has(N.nom)?N.value:0})),[e,v]),_=k.useMemo(()=>e.every(N=>N.value===0),[e]),I=k.useMemo(()=>_?1:b.reduce((N,S)=>N+S.displayValue,0)||1,[_,b]),j=k.useCallback(({cx:N,cy:S,midAngle:A,innerRadius:B,outerRadius:T,value:V})=>{if(V===0||_)return null;const $=B+(T-B)*.5,q=N+$*Math.cos(-A*yj),P=S+$*Math.sin(-A*yj),H=Math.round(V/I*100);return o.jsx(a.Text,{x:q,y:P,fill:"white",textAnchor:"middle",dominantBaseline:"central",fontSize:12,fontWeight:"bold",children:`${H}%`})},[I,_]);return o.jsxs("div",{className:`${He.container} ${u}`,style:C,children:[!M&&o.jsx("div",{className:He.chartContainer,style:{height:t/2+100},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:"100%",children:o.jsx(a.PieChart,{children:o.jsx(a.Pie,{data:_?[{displayValue:1,color:"#A3C2CB"}]:b,cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:0,dataKey:"displayValue",stroke:"white",strokeWidth:_?0:2,startAngle:90,endAngle:450,labelLine:!1,label:j,isAnimationActive:!1,children:_?o.jsx(a.Cell,{fill:"#A3C2CB"}):b.map((N,S)=>o.jsx(a.Cell,{fill:N.color},`cell-${S}`))})})})}),o.jsx("div",{className:He.legend,children:e.map((N,S)=>{const A=v.has(N.nom);return o.jsxs("div",{className:`${He.legendItem} ${!M&&!A?He.inactive:""}`,onClick:()=>w(N.nom),style:{cursor:"pointer",transition:"opacity 0.2s"},children:[o.jsxs("div",{className:He.leftSection,children:[!x&&o.jsx("div",{className:He.colorIndicator,style:{backgroundColor:N.color,opacity:M||A?1:.3}}),o.jsx("span",{className:He.label,style:{opacity:M||A?1:.5},children:N.nom})]}),o.jsxs("div",{className:He.rightSection,style:{opacity:M||A?1:.5},children:[o.jsxs("div",{className:He.ratio,children:[o.jsx("span",{className:He.value1,children:N.value1}),o.jsx("span",{className:He.separator,children:"/"}),o.jsx("span",{className:He.value2,children:N.value2})]}),N.statusColor&&o.jsx("div",{className:He.statusIndicator,style:{backgroundColor:N.statusColor}})]})]},`legend-${S}`)})})]})},Wve="_container_1pc4v_1",Gve="_leftGroup_1pc4v_10",Kve="_iconBtn_1pc4v_16",ti={container:Wve,leftGroup:Gve,iconBtn:Kve},Zve=e=>J.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},J.createElement("path",{d:"M3 12h18M3 6h18M3 18h18"})),Xve=k.memo(Zve),Yve=e=>J.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},J.createElement("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8m-4-6-4-4-4 4m4-4v13"})),iA=k.memo(Yve),Jve=({menuIcon:e,logoProps:t,actionIcon:n,style:c,className:i,bgColor:r="var(--header-bg)",color:s="var(--color-text)",borderBottomColor:d="var(--color-border)",borderBottomWidth:h=1,height:l="8vh",onMenuClick:u,onActionClick:p})=>{const y={backgroundColor:r,color:s,borderBottom:`${h}px solid ${d}`,height:l,...c};return o.jsxs("header",{className:[ti.container,i].filter(Boolean).join(" "),style:y,children:[o.jsxs("div",{className:ti.leftGroup,children:[o.jsx("button",{className:ti.iconBtn,onClick:u,"aria-label":"Menu",style:{color:"inherit"},children:e??o.jsx(Xve,{width:22,height:22})}),o.jsx(uL,{...t,size:"medium"})]}),o.jsx("button",{className:ti.iconBtn,onClick:p,"aria-label":"Action",style:{color:"inherit"},children:n??o.jsx(iA,{width:22,height:22})})]})},Qve="_container_24g3e_1",e9e="_iconBtn_24g3e_10",t9e="_title_24g3e_22",ai={container:Qve,iconBtn:e9e,title:t9e},a9e=({title:e="Menu",closeIcon:t,actionIcon:n,style:c,className:i,titleStyle:r,bgColor:s="var(--header-bg)",color:d="var(--color-text)",borderBottomColor:h="transparent",borderBottomWidth:l=0,height:u="8vh",onClose:p,onAction:y})=>{const m={backgroundColor:s,color:d,borderBottom:`${l}px solid ${h}`,height:u,...c};return o.jsxs("div",{className:[ai.container,i].filter(Boolean).join(" "),style:m,children:[o.jsx("button",{className:ai.iconBtn,onClick:p,"aria-label":"Fermer",style:{color:"inherit"},children:t??o.jsx(cA,{width:22,height:22})}),o.jsx("span",{className:ai.title,style:{fontWeight:"var(--font-weight-h)",fontSize:"var(--h5)",...r},children:e.toUpperCase()}),o.jsx("button",{className:ai.iconBtn,onClick:y,"aria-label":"Partager",style:{color:"inherit"},children:n??o.jsx(iA,{width:22,height:22})})]})},n9e=({title:e,countLabel:t="UF",actionIcon:n=o.jsx(dt,{size:16}),onAction:c,items:i=[],onItemClick:r,activeColor:s="#0083bb",id:d,children:h})=>{const l=k.useMemo(()=>i.filter(u=>u.active).length,[i]);return o.jsxs(o9e,{id:d,children:[o.jsxs(c9e,{children:[o.jsxs(i9e,{children:[o.jsx(r9e,{children:e}),o.jsxs(s9e,{children:["(",l," ",t,")"]})]}),c&&o.jsx(d9e,{onClick:c,title:"Action",children:n})]}),o.jsx(l9e,{children:o.jsx(h9e,{children:i.map(u=>o.jsx(p9e,{item:u,activeColor:s,onItemClick:r},u.id))})}),h&&o.jsx(y9e,{children:h})]})},o9e=te.div`
|
|
8181
8181
|
background: white;
|
|
8182
8182
|
border: 1px solid #ddd;
|
|
8183
8183
|
border-radius: 4px;
|
|
@@ -8602,9 +8602,9 @@
|
|
|
8602
8602
|
&:hover {
|
|
8603
8603
|
opacity: 1;
|
|
8604
8604
|
}
|
|
8605
|
-
`,E9e="
|
|
8606
|
-
${
|
|
8607
|
-
${H?
|
|
8608
|
-
${q?
|
|
8605
|
+
`,E9e="_patientCard_19ibb_1",O9e="_notAllowedCursor_19ibb_16",U9e="_innerPadding_19ibb_26",W9e="_noFooterMargin_19ibb_33",G9e="_topArea_19ibb_37",K9e="_small_19ibb_46",Z9e="_header_19ibb_59",X9e="_headerLeft_19ibb_66",Y9e="_headerRight_19ibb_72",J9e="_uf_19ibb_77",Q9e="_rmBadge_19ibb_85",eMe="_roomBed_19ibb_100",tMe="_content_19ibb_107",aMe="_body_19ibb_119",nMe="_upperBodyContent_19ibb_141",oMe="_patientInfo_19ibb_151",cMe="_iep_19ibb_156",iMe="_name_19ibb_161",rMe="_birthName_19ibb_168",sMe="_firstNames_19ibb_173",dMe="_dobAge_19ibb_178",lMe="_duration_19ibb_183",hMe="_comment_19ibb_189",uMe="_timeline_19ibb_196",pMe="_destination_19ibb_200",yMe="_arrow_19ibb_212",kMe="_progressBar_19ibb_221",mMe="_progressFill_19ibb_231",fMe="_progressDate_19ibb_241",gMe="_footer_19ibb_252",vMe="_actionsLeft_19ibb_261",MMe="_actionsRight_19ibb_262",xMe="_iconWrap_19ibb_268",_Me="_centerLabelHuge_19ibb_287",LMe="_labelYellow_19ibb_294",IMe="_expectedBottom_19ibb_313",bMe="_expectedPrefix_19ibb_321",wMe="_expectedDate_19ibb_327",CMe="_notesView_19ibb_348",NMe="_notesHeader_19ibb_356",SMe="_notesTitle_19ibb_362",jMe="_notesList_19ibb_368",$Me="_noteItem_19ibb_374",qMe="_reservationView_19ibb_379",AMe="_reservationNote_19ibb_391",zMe="_bottomArea_19ibb_396",VMe="_bottomLeftSymbol_19ibb_404",F={patientCard:E9e,notAllowedCursor:O9e,innerPadding:U9e,noFooterMargin:W9e,topArea:G9e,small:K9e,header:Z9e,headerLeft:X9e,headerRight:Y9e,uf:J9e,rmBadge:Q9e,roomBed:eMe,content:tMe,body:aMe,upperBodyContent:nMe,patientInfo:oMe,iep:cMe,name:iMe,birthName:rMe,firstNames:sMe,dobAge:dMe,duration:lMe,comment:hMe,timeline:uMe,destination:pMe,arrow:yMe,progressBar:kMe,progressFill:mMe,progressDate:fMe,footer:gMe,actionsLeft:vMe,actionsRight:MMe,iconWrap:xMe,centerLabelHuge:_Me,labelYellow:LMe,expectedBottom:IMe,expectedPrefix:bMe,expectedDate:wMe,notesView:CMe,notesHeader:NMe,notesTitle:SMe,notesList:jMe,noteItem:$Me,reservationView:qMe,reservationNote:AMe,bottomArea:zMe,bottomLeftSymbol:VMe},PMe=({size:e="large",className:t="",customStyle:n,topAreaStyle:c,headerLeft:i,headerRight:r,centerHugeLabel:s,iep:d,nameLine:h,birthName:l,birthNamePrefix:u,firstNamesLine:p,dobAgeLine:y,stayDuration:m,comment:f,expectedDate:g,expectedDatePrefix:M,showTimeline:x=!1,destination:v,progress:L=0,progressTrackColor:w,progressFillColor:C,progressLabel:b,showFooter:_=!1,leftIcons:I=[],rightIcons:j=[],activeView:N="default",notesHeaderTitle:S,notesHeaderIcon:A,notesList:B=[],reservationNote:T,isYellowLabel:V=!1,bottomLeftSymbol:$,cursorNotAllowed:q=!1,rmBadge:P})=>{const H=e==="small",D=`
|
|
8606
|
+
${F.patientCard}
|
|
8607
|
+
${H?F.small:""}
|
|
8608
|
+
${q?F.notAllowedCursor:""}
|
|
8609
8609
|
${t}
|
|
8610
|
-
`.trim();return o.jsx("div",{className:D,style:n,children:o.jsxs("div",{className:
|
|
8610
|
+
`.trim();return o.jsx("div",{className:D,style:n,children:o.jsxs("div",{className:F.innerPadding,children:[o.jsxs("div",{className:`${F.topArea} ${_?"":F.noFooterMargin}`,style:c,children:[o.jsx("div",{className:F.header,children:P?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:F.headerLeft,children:o.jsxs("div",{className:F.uf,children:[i,r&&` - ${r}`]})}),o.jsx("div",{className:F.headerRight,children:o.jsx("div",{className:F.rmBadge,children:P})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:F.headerLeft,children:i&&o.jsx("div",{className:F.uf,children:i})}),o.jsx("div",{className:F.headerRight,children:r&&o.jsx("span",{className:F.roomBed,children:r})})]})}),o.jsxs("div",{className:F.content,children:[o.jsxs("div",{className:F.body,children:[N==="default"&&o.jsxs(o.Fragment,{children:[s&&o.jsx("div",{className:`${F.centerLabelHuge} ${V?F.labelYellow:""}`,children:s}),o.jsxs("div",{className:F.upperBodyContent,children:[o.jsxs("div",{className:F.patientInfo,children:[d&&o.jsx("div",{className:F.iep,children:d}),h&&o.jsx("div",{className:F.name,children:h}),l&&o.jsxs("div",{className:F.birthName,children:["(",u?`${u} ${l}`:l,")"]}),p&&o.jsx("div",{className:F.firstNames,children:p}),y&&o.jsx("div",{className:F.dobAge,children:y})]}),m&&o.jsx("div",{className:F.duration,children:m}),f&&o.jsx("div",{className:F.comment,children:f})]}),g&&o.jsxs("div",{className:F.expectedBottom,children:[M&&o.jsx("div",{className:F.expectedPrefix,children:M}),o.jsx("div",{className:F.expectedDate,children:g})]})]}),N==="notes"&&o.jsxs("div",{className:F.notesView,children:[o.jsxs("div",{className:F.notesHeader,children:[A,o.jsx("span",{className:F.notesTitle,children:S})]}),o.jsx("div",{className:F.notesList,children:B.map((E,G)=>o.jsx("div",{className:F.noteItem,children:E},G))})]}),N==="reservation"&&o.jsxs("div",{className:F.reservationView,children:[o.jsx("div",{className:F.upperBodyContent,children:o.jsxs("div",{className:F.patientInfo,children:[d&&o.jsx("div",{className:F.iep,children:d}),h&&o.jsx("div",{className:F.name,children:h}),l&&o.jsxs("div",{className:F.birthName,children:["(",u?`${u} ${l}`:l,")"]}),p&&o.jsx("div",{className:F.firstNames,children:p}),y&&o.jsx("div",{className:F.dobAge,children:y})]})}),T&&o.jsx("div",{className:F.reservationNote,children:T})]})]}),($||x)&&o.jsxs("div",{className:F.bottomArea,children:[$&&o.jsx("div",{className:F.bottomLeftSymbol,children:$}),x&&o.jsxs("div",{className:F.timeline,children:[v&&N!=="reservation"&&o.jsxs("div",{className:F.destination,children:[o.jsx("span",{className:F.arrow,children:"→"}),o.jsx("span",{children:v.prefix}),o.jsx("strong",{children:v.name}),o.jsx("span",{children:v.suffix})]}),o.jsxs("div",{className:F.progressBar,style:w?{backgroundColor:w}:void 0,children:[o.jsx("div",{className:F.progressFill,style:{width:`${L}%`,backgroundColor:C}}),b&&o.jsx("span",{className:F.progressDate,children:b})]})]})]})]})]}),_&&o.jsxs("div",{className:F.footer,children:[o.jsx("div",{className:F.actionsLeft,children:I.map((E,G)=>o.jsx("div",{className:F.iconWrap,children:E},`left-${G}`))}),o.jsx("div",{className:F.actionsRight,children:j.map((E,G)=>o.jsx("div",{className:F.iconWrap,children:E},`right-${G}`))})]})]})})},TMe=({title:e,titleBold:t,titleKey:n,items:c,className:i="",width:r,style:s,labelStyle:d,valueStyle:h,headerStyle:l,a11yConfig:u,onItemClick:p,onDeleteItem:y})=>{const m={width:r||"100%",...s};return o.jsxs("div",{className:`data-list-v2-container ${i}`,style:m,children:[(e||t)&&o.jsx("div",{className:"data-list-v2-header",style:l,children:o.jsxs("h2",{className:"header-title",title:Q(u,n),children:[e&&o.jsx("span",{className:"title-regular",children:e}),t&&o.jsx("span",{className:"title-bold",children:t})]})}),o.jsx("div",{className:"data-list-v2-content",children:c.map(f=>o.jsxs("div",{className:`data-list-v2-item ${p?"interactive":""} ${f.showValueLine?"with-value-line":""}`,onClick:()=>p?.(f),children:[o.jsx("div",{className:"item-label-col",style:d,children:o.jsx("div",{className:"item-label",title:Q(f.a11yConfig,f.labelKey),children:f.label})}),o.jsxs("div",{className:"item-value-col",style:h,children:[o.jsx("div",{className:"item-value",title:Q(f.a11yConfig,f.valueKey),children:f.value}),y&&o.jsx("div",{className:"item-delete-action",onClick:g=>{g.stopPropagation(),y(f)},children:o.jsx(dt,{size:16})})]})]},f.id))})]})},HMe=({id:e,data:t,children:n,className:c,onDragStart:i,onDragEnd:r})=>{const s=h=>{h.dataTransfer.setData("text/plain",e),t&&h.dataTransfer.setData("application/json",JSON.stringify(t)),h.dataTransfer.effectAllowed="move",i&&i(h,t)},d=h=>{r&&r(h)};return o.jsx("div",{draggable:!0,onDragStart:s,onDragEnd:d,style:{cursor:"grab"},className:c,children:n})},DMe=({id:e,onDrop:t,children:n,className:c="",activeClassName:i="is-drag-over"})=>{const[r,s]=k.useState(!1),d=k.useRef(0),h=m=>{m.preventDefault(),d.current+=1,d.current>0&&s(!0)},l=m=>{m.preventDefault(),m.dataTransfer.dropEffect="move"},u=m=>{m.preventDefault(),d.current-=1,d.current===0&&s(!1)},p=m=>{m.preventDefault(),s(!1),d.current=0;const f=m.dataTransfer.getData("text/plain");let g;try{const M=m.dataTransfer.getData("application/json");M&&(g=JSON.parse(M))}catch(M){console.error("Failed to parse drag data",M)}f&&t(f,g)},y=`${c} ${r?i:""}`.trim();return o.jsx("div",{onDragEnter:h,onDragOver:l,onDragLeave:u,onDrop:p,className:y,"data-droppable-id":e,children:n})};exports.LineChart=a.LineChart;exports.PeriodRange=a.PeriodRange;exports.SimpleBarChart=a.SimpleBarChart;exports.ActionCard=J7e;exports.AddItemModal=Vc;exports.Alert=Zw;exports.AlertsProvider=Fke;exports.BadgeList=Mj;exports.BadgeRenderer=Eq;exports.Button=tL;exports.ChartContainer=Bke;exports.CheckboxInput=xq;exports.CircularProgress=Pb;exports.ColorInput=wq;exports.ComponentVisibilityManager=Db;exports.ComponentVisibilityToggle=c6e;exports.ConfirmationModal=W7e;exports.ConfirmationPopup=W3e;exports.CounterListBox=j3e;exports.CurrencyRenderer=Wq;exports.DashboardSummary=Tme;exports.DataBoard=St;exports.DataFourBoards=Qq;exports.DataListV2=TMe;exports.DateInput=Iq;exports.DatePicker=dw;exports.DateRenderer=Oq;exports.DayStatCard=l2e;exports.DayStatCardV2=t8e;exports.DonutChartRatio=Uve;exports.Draggable=HMe;exports.DraggableProvider=y2e;exports.DraggableSwitcherButton=aL;exports.Droppable=DMe;exports.DynamicForm=o4e;exports.DynamicIcon=i4e;exports.DynamicInput=Cq;exports.EmailRenderer=Rq;exports.Encours=Xme;exports.EntryControl=N3e;exports.FileInput=Lq;exports.FilterBar=lge;exports.FiltreEtiquette=Cve;exports.FlexRowContainer=q3e;exports.Grid=Lj;exports.Header=M2e;exports.HorizontalBarChart=n8e;exports.IconText=zj;exports.ImageRenderer=Gq;exports.IndicatorItemV2=Zge;exports.InfoBanner=h7e;exports.InputWrapper=vL;exports.LegendFilterProvider=m2e;exports.LegendFilterSwitcherButton=nL;exports.LinkRenderer=Fq;exports.ListContentContainer=A3e;exports.Logo=uL;exports.MetricsPanel=Xq;exports.MobileMenuHeader=a9e;exports.MobileNavMenu=aA;exports.MobileTopBar=Jve;exports.ModuleHeader=h3e;exports.ModuleSideBar=u3e;exports.ModuleSideBarV2=T7e;exports.NavBar=Ij;exports.NavBarV2=x8e;exports.NavItem=Tb;exports.NavItemV2=Xw;exports.NavProvider=h2e;exports.NumberRenderer=Uq;exports.PatientCard=PMe;exports.PatientDetailsPanel=q9e;exports.PatientInfoCard=z9e;exports.PeriodSelect=Kke;exports.PopUp=q7e;exports.RadioInput=_q;exports.RangeInput=bq;exports.ScrollableHorizontale=Vj;exports.SearchBar=Jq;exports.Select=oA;exports.SelectFilter=Sme;exports.SelectInput=Uw;exports.SettingNavBar=P7e;exports.ShowDataProvider=f2e;exports.ShowDataSwitcherButton=oL;exports.SideComponent=Xke;exports.SimpleListBox=S3e;exports.Slider=k9e;exports.SubHeaderContent=W8e;exports.SubHeaderNavItem=tA;exports.SubHeaderTitle=C8e;exports.SubNavBar=x2e;exports.SummaryAvailable=jve;exports.SummaryCard=Zq;exports.Switcher=E1;exports.TableLayout=nA;exports.TableauDynamique=Kq;exports.TableauDynamiqueSafePagination=W5e;exports.TableauxComponent=nA;exports.TextInput=vq;exports.TextRenderer=Bq;exports.TextareaInput=Mq;exports.ThemeProvider=u2e;exports.ThemeSwitcher=G8e;exports.ThemeSwitcherButton=Hb;exports.TimePicker=x9e;exports.Title=e3e;exports.TranslationKey=p3e;exports.TranslationKeyV2=H7e;exports.TrendItem=Pj;exports.TrendList=mue;exports.TrendListBox=$3e;exports.UnitGrid=n9e;exports.UserInfo=eA;exports.alertModels=Oke;exports.getA11yTooltip=Q;exports.getFormSchema=c4e;exports.hexToRgba=$t;exports.registerRenderer=P5e;exports.tableConfig=sw;exports.useAlerts=Eke;exports.useBodyScrollLock=Yke;exports.useConfirmationPopup=G3e;exports.useDraggableSwitcher=Nj;exports.useFilters=Hq;exports.useLegendFilterSwitcher=jj;exports.useNavigation=ht;exports.useShowDataSwitcher=qj;exports.useTableData=Dq;exports.useThemeContext=wj;exports.useThemeSwitcher=pL;exports.validateField=hL;exports.validateForm=gq;
|