@foodpilot/foods 0.3.71 → 0.3.72

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.
@@ -7,7 +7,7 @@ export type HeroBlockProps = {
7
7
  subtitle?: FlexibleString;
8
8
  description?: JSX.Element;
9
9
  callToAction?: FlexibleButtonType;
10
- image?: JSX.Element;
10
+ imageUrl?: string;
11
11
  sxProps?: SxProps;
12
12
  };
13
13
  export declare const HeroBlock: (props: HeroBlockProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,6 @@
1
- type LightIndicatorBlockProps = {
1
+ export type LightIndicatorBlockProps = {
2
2
  title: string;
3
3
  subtitle?: string;
4
4
  description: string;
5
5
  };
6
6
  export declare const LightIndicatorBlock: (props: LightIndicatorBlockProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
package/dist/main.js CHANGED
@@ -44083,7 +44083,7 @@ const pie = (e) => {
44083
44083
  }
44084
44084
  );
44085
44085
  }, mie = (e) => {
44086
- const { title: t, subtitle: n, description: o, image: r, callToAction: i, sxProps: a = {} } = e, l = Re();
44086
+ const { title: t, subtitle: n, description: o, imageUrl: r, callToAction: i, sxProps: a = {} } = e, l = Re();
44087
44087
  return /* @__PURE__ */ p.jsxs(
44088
44088
  te,
44089
44089
  {
@@ -44094,6 +44094,7 @@ const pie = (e) => {
44094
44094
  background: l.palette.background.paper,
44095
44095
  borderRadius: "16px",
44096
44096
  overflow: "hidden",
44097
+ justifyContent: "space-between",
44097
44098
  gap: "3rem",
44098
44099
  ...a
44099
44100
  },
@@ -44143,7 +44144,14 @@ const pie = (e) => {
44143
44144
  width: 500,
44144
44145
  mb: "-8px"
44145
44146
  },
44146
- children: r
44147
+ children: /* @__PURE__ */ p.jsx(
44148
+ "img",
44149
+ {
44150
+ src: r,
44151
+ alt: "description",
44152
+ style: { width: "100%", height: "auto", minWidth: 500 }
44153
+ }
44154
+ )
44147
44155
  }
44148
44156
  )
44149
44157
  ]
package/dist/main.umd.cjs CHANGED
@@ -371,7 +371,7 @@ const theme2 = createTheme({ palette: {
371
371
  * (c) 2017-2022 chartjs-plugin-datalabels contributors
372
372
  * Released under the MIT license
373
373
  */var Rb=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),kl={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
374
- `)):Array.isArray(n)?e.push.apply(e,n):yt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var o=[].concat(t),r=o.length,i=e.font,a=0,l;for(e.font=n.string,l=0;l<r;++l)a=Math.max(e.measureText(o[l]).width,a);return e.font=i,{height:r*n.lineHeight,width:a}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),o=[],r,i,a,l;for(r=0,a=t.length;r<a;++r)l=t[r],i=n.indexOf(l),i===-1?o.push([l,1]):n.splice(i,1);for(r=0,a=n.length;r<a;++r)o.push([n[r],-1]);return o},rasterize:function(e){return Math.round(e*Rb)/Rb}};function u2(e,t){var n=t.x,o=t.y;if(n===null)return{x:0,y:-1};if(o===null)return{x:1,y:0};var r=e.x-n,i=e.y-o,a=Math.sqrt(r*r+i*i);return{x:a?r/a:0,y:a?i/a:-1}}function Lz(e,t,n,o,r){switch(r){case"center":n=o=0;break;case"bottom":n=0,o=1;break;case"right":n=1,o=0;break;case"left":n=-1,o=0;break;case"top":n=0,o=-1;break;case"start":n=-n,o=-o;break;case"end":break;default:r*=Math.PI/180,n=Math.cos(r),o=Math.sin(r);break}return{x:e,y:t,vx:n,vy:o}}var Az=0,Ob=1,Eb=2,kb=4,Ib=8;function gu(e,t,n){var o=Az;return e<n.left?o|=Ob:e>n.right&&(o|=Eb),t<n.top?o|=Ib:t>n.bottom&&(o|=kb),o}function Vz(e,t){for(var n=e.x0,o=e.y0,r=e.x1,i=e.y1,a=gu(n,o,t),l=gu(r,i,t),c,d,u;!(!(a|l)||a&l);)c=a||l,c&Ib?(d=n+(r-n)*(t.top-o)/(i-o),u=t.top):c&kb?(d=n+(r-n)*(t.bottom-o)/(i-o),u=t.bottom):c&Eb?(u=o+(i-o)*(t.right-n)/(r-n),d=t.right):c&Ob&&(u=o+(i-o)*(t.left-n)/(r-n),d=t.left),c===a?(n=d,o=u,a=gu(n,o,t)):(r=d,i=u,l=gu(r,i,t));return{x0:n,x1:r,y0:o,y1:i}}function mu(e,t){var n=t.anchor,o=e,r,i;return t.clamp&&(o=Vz(o,t.area)),n==="start"?(r=o.x0,i=o.y0):n==="end"?(r=o.x1,i=o.y1):(r=(o.x0+o.x1)/2,i=(o.y0+o.y1)/2),Lz(r,i,e.vx,e.vy,t.align)}var bu={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,o=Math.cos(n),r=Math.sin(n),i=e.innerRadius,a=e.outerRadius;return mu({x0:e.x+o*i,y0:e.y+r*i,x1:e.x+o*a,y1:e.y+r*a,vx:o,vy:r},t)},point:function(e,t){var n=u2(e,t.origin),o=n.x*e.options.radius,r=n.y*e.options.radius;return mu({x0:e.x-o,y0:e.y-r,x1:e.x+o,y1:e.y+r,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=u2(e,t.origin),o=e.x,r=e.y,i=0,a=0;return e.horizontal?(o=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(r=Math.min(e.y,e.base),a=Math.abs(e.base-e.y)),mu({x0:o,y0:r+a,x1:o+i,y1:r,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=u2(e,t.origin);return mu({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Sr=kl.rasterize;function Fz(e){var t=e.borderWidth||0,n=e.padding,o=e.size.height,r=e.size.width,i=-r/2,a=-o/2;return{frame:{x:i-n.left-t,y:a-n.top-t,w:r+n.width+t*2,h:o+n.height+t*2},text:{x:i,y:a,w:r,h:o}}}function $z(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var o=n.getBasePixel();return e.horizontal?{x:o,y:null}:{x:null,y:o}}function Nz(e){return e instanceof ki?bu.arc:e instanceof wl?bu.point:e instanceof Sl?bu.bar:bu.fallback}function Bz(e,t,n,o,r,i){var a=Math.PI/2;if(i){var l=Math.min(i,r/2,o/2),c=t+l,d=n+l,u=t+o-l,f=n+r-l;e.moveTo(t,d),c<u&&d<f?(e.arc(c,d,l,-Math.PI,-a),e.arc(u,d,l,-a,0),e.arc(u,f,l,0,a),e.arc(c,f,l,a,Math.PI)):c<u?(e.moveTo(c,n),e.arc(u,d,l,-a,a),e.arc(c,d,l,a,Math.PI+a)):d<f?(e.arc(c,d,l,-Math.PI,0),e.arc(c,f,l,0,Math.PI)):e.arc(c,d,l,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,o,r)}function Hz(e,t,n){var o=n.backgroundColor,r=n.borderColor,i=n.borderWidth;!o&&(!r||!i)||(e.beginPath(),Bz(e,Sr(t.x)+i/2,Sr(t.y)+i/2,Sr(t.w)-i,Sr(t.h)-i,n.borderRadius),e.closePath(),o&&(e.fillStyle=o,e.fill()),r&&i&&(e.strokeStyle=r,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function zz(e,t,n){var o=n.lineHeight,r=e.w,i=e.x,a=e.y+o/2;return t==="center"?i+=r/2:(t==="end"||t==="right")&&(i+=r),{h:o,w:r,x:i,y:a}}function Wz(e,t,n){var o=e.shadowBlur,r=n.stroked,i=Sr(n.x),a=Sr(n.y),l=Sr(n.w);r&&e.strokeText(t,i,a,l),n.filled&&(o&&r&&(e.shadowBlur=0),e.fillText(t,i,a,l),o&&r&&(e.shadowBlur=o))}function Uz(e,t,n,o){var r=o.textAlign,i=o.color,a=!!i,l=o.font,c=t.length,d=o.textStrokeColor,u=o.textStrokeWidth,f=d&&u,h;if(!(!c||!a&&!f))for(n=zz(n,r,l),e.font=l.string,e.textAlign=r,e.textBaseline="middle",e.shadowBlur=o.textShadowBlur,e.shadowColor=o.textShadowColor,a&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=d),h=0,c=t.length;h<c;++h)Wz(e,t[h],{stroked:f,filled:a,w:n.w,x:n.x,y:n.y+n.h*h})}var jb=function(e,t,n,o){var r=this;r._config=e,r._index=o,r._model=null,r._rects=null,r._ctx=t,r._el=n};Xo(jb.prototype,{_modelize:function(e,t,n,o){var r=this,i=r._index,a=gn(Qt([n.font,{}],o,i)),l=Qt([n.color,nn.color],o,i);return{align:Qt([n.align,"center"],o,i),anchor:Qt([n.anchor,"center"],o,i),area:o.chart.chartArea,backgroundColor:Qt([n.backgroundColor,null],o,i),borderColor:Qt([n.borderColor,null],o,i),borderRadius:Qt([n.borderRadius,0],o,i),borderWidth:Qt([n.borderWidth,0],o,i),clamp:Qt([n.clamp,!1],o,i),clip:Qt([n.clip,!1],o,i),color:l,display:e,font:a,lines:t,offset:Qt([n.offset,4],o,i),opacity:Qt([n.opacity,1],o,i),origin:$z(r._el,o),padding:Mn(Qt([n.padding,4],o,i)),positioner:Nz(r._el),rotation:Qt([n.rotation,0],o,i)*(Math.PI/180),size:kl.textSize(r._ctx,t,a),textAlign:Qt([n.textAlign,"start"],o,i),textShadowBlur:Qt([n.textShadowBlur,0],o,i),textShadowColor:Qt([n.textShadowColor,l],o,i),textStrokeColor:Qt([n.textStrokeColor,l],o,i),textStrokeWidth:Qt([n.textStrokeWidth,0],o,i)}},update:function(e){var t=this,n=null,o=null,r=t._index,i=t._config,a,l,c,d=Qt([i.display,!0],e,r);d&&(a=e.dataset.data[r],l=ct(Wt(i.formatter,[a,e]),a),c=yt(l)?[]:kl.toTextLines(l),c.length&&(n=t._modelize(d,c,i,e),o=Fz(n))),t._model=n,t._rects=o},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,o=e.ctx,r=n._model,i=n._rects,a;this.visible()&&(o.save(),r.clip&&(a=r.area,o.beginPath(),o.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),o.clip()),o.globalAlpha=kl.bound(0,r.opacity,1),o.translate(Sr(t.x),Sr(t.y)),o.rotate(r.rotation),Hz(o,i.frame,r),Uz(o,r.lines,i.text,r),o.restore())}});var Zz=Number.MIN_SAFE_INTEGER||-9007199254740991,qz=Number.MAX_SAFE_INTEGER||9007199254740991;function Il(e,t,n){var o=Math.cos(n),r=Math.sin(n),i=t.x,a=t.y;return{x:i+o*(e.x-i)-r*(e.y-a),y:a+r*(e.x-i)+o*(e.y-a)}}function _b(e,t){var n=qz,o=Zz,r=t.origin,i,a,l,c,d;for(i=0;i<e.length;++i)a=e[i],l=a.x-r.x,c=a.y-r.y,d=t.vx*l+t.vy*c,n=Math.min(n,d),o=Math.max(o,d);return{min:n,max:o}}function vu(e,t){var n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n*n+o*o);return{vx:(t.x-e.x)/r,vy:(t.y-e.y)/r,origin:e,ln:r}}var Db=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Xo(Db.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,o=t._rect;return e=Il(e,t.center(),-t._rotation),!(e.x<o.x-n||e.y<o.y-n||e.x>o.x+o.w+n*2||e.y>o.y+o.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),o=[vu(t[0],t[1]),vu(t[0],t[3])],r,i,a;for(this._rotation!==e._rotation&&o.push(vu(n[0],n[1]),vu(n[0],n[3])),r=0;r<o.length;++r)if(i=_b(t,o[r]),a=_b(n,o[r]),i.max<a.min||a.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,o=e.center();return[Il({x:t.x,y:t.y},o,n),Il({x:t.x+t.w,y:t.y},o,n),Il({x:t.x+t.w,y:t.y+t.h},o,n),Il({x:t.x,y:t.y+t.h},o,n)]}});function Lb(e,t,n){var o=t.positioner(e,t),r=o.vx,i=o.vy;if(!r&&!i)return{x:o.x,y:o.y};var a=n.w,l=n.h,c=t.rotation,d=Math.abs(a/2*Math.cos(c))+Math.abs(l/2*Math.sin(c)),u=Math.abs(a/2*Math.sin(c))+Math.abs(l/2*Math.cos(c)),f=1/Math.max(Math.abs(r),Math.abs(i));return d*=r*f,u*=i*f,d+=t.offset*r,u+=t.offset*i,{x:o.x+d,y:o.y+u}}function Gz(e,t){var n,o,r,i;for(n=e.length-1;n>=0;--n)for(r=e[n].$layout,o=n-1;o>=0&&r._visible;--o)i=e[o].$layout,i._visible&&r._box.intersects(i._box)&&t(r,i);return e}function Yz(e){var t,n,o,r,i,a,l;for(t=0,n=e.length;t<n;++t)o=e[t],r=o.$layout,r._visible&&(l=new Proxy(o._el,{get:(c,d)=>c.getProps([d],!0)[d]}),i=o.geometry(),a=Lb(l,o.model(),i),r._box.update(a,i,o.rotation()));return Gz(e,function(c,d){var u=c._hidable,f=d._hidable;u&&f||f?d._visible=!1:u&&(c._visible=!1)})}var jl={prepare:function(e){var t=[],n,o,r,i,a;for(n=0,r=e.length;n<r;++n)for(o=0,i=e[n].length;o<i;++o)a=e[n][o],t.push(a),a.$layout={_box:new Db,_hidable:!1,_visible:!0,_set:n,_idx:a._index};return t.sort(function(l,c){var d=l.$layout,u=c.$layout;return d._idx===u._idx?u._set-d._set:u._idx-d._idx}),this.update(t),t},update:function(e){var t=!1,n,o,r,i,a;for(n=0,o=e.length;n<o;++n)r=e[n],i=r.model(),a=r.$layout,a._hidable=i&&i.display==="auto",a._visible=r.visible(),t|=a._hidable;t&&Yz(e)},lookup:function(e,t){var n,o;for(n=e.length-1;n>=0;--n)if(o=e[n].$layout,o&&o._visible&&o._box.contains(t))return e[n];return null},draw:function(e,t){var n,o,r,i,a,l;for(n=0,o=t.length;n<o;++n)r=t[n],i=r.$layout,i._visible&&(a=r.geometry(),l=Lb(r._el,r.model(),a),i._box.update(l,a,r.rotation()),r.draw(e,l))}},Kz=function(e){if(yt(e))return null;var t=e,n,o,r;if(St(e))if(!yt(e.label))t=e.label;else if(!yt(e.r))t=e.r;else for(t="",n=Object.keys(e),r=0,o=n.length;r<o;++r)t+=(r!==0?", ":"")+n[r]+": "+e[n[r]];return""+t},Xz={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:Kz,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Gn="$datalabels",Ab="$default";function Qz(e,t){var n=e.datalabels,o={},r=[],i,a;return n===!1?null:(n===!0&&(n={}),t=Xo({},[t,n]),i=t.labels||{},a=Object.keys(i),delete t.labels,a.length?a.forEach(function(l){i[l]&&r.push(Xo({},[t,i[l],{_key:l}]))}):r.push(t),o=r.reduce(function(l,c){return $t(c.listeners||{},function(d,u){l[u]=l[u]||{},l[u][c._key||Ab]=d}),delete c.listeners,l},{}),{labels:r,listeners:o})}function p2(e,t,n,o){if(t){var r=n.$context,i=n.$groups,a;t[i._set]&&(a=t[i._set][i._key],a&&Wt(a,[r,o])===!0&&(e[Gn]._dirty=!0,n.update(r)))}}function Jz(e,t,n,o,r){var i,a;!n&&!o||(n?o?n!==o&&(a=i=!0):a=!0:i=!0,a&&p2(e,t.leave,n,r),i&&p2(e,t.enter,o,r))}function eW(e,t){var n=e[Gn],o=n._listeners,r,i;if(!(!o.enter&&!o.leave)){if(t.type==="mousemove")i=jl.lookup(n._labels,t);else if(t.type!=="mouseout")return;r=n._hovered,n._hovered=i,Jz(e,o,r,i,t)}}function tW(e,t){var n=e[Gn],o=n._listeners.click,r=o&&jl.lookup(n._labels,t);r&&p2(e,o,r,t)}var nW={id:"datalabels",defaults:Xz,beforeInit:function(e){e[Gn]={_actives:[]}},beforeUpdate:function(e){var t=e[Gn];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var o=t.index,r=e[Gn],i=r._datasets[o]=[],a=e.isDatasetVisible(o),l=e.data.datasets[o],c=Qz(l,n),d=t.meta.data||[],u=e.ctx,f,h,g,m,b,v,x,C;for(u.save(),f=0,g=d.length;f<g;++f)if(x=d[f],x[Gn]=[],a&&x&&e.getDataVisibility(f)&&!x.skip)for(h=0,m=c.labels.length;h<m;++h)b=c.labels[h],v=b._key,C=new jb(b,u,x,f),C.$groups={_set:o,_key:v||Ab},C.$context={active:!1,chart:e,dataIndex:f,dataset:l,datasetIndex:o},C.update(C.$context),x[Gn].push(C),i.push(C);u.restore(),Xo(r._listeners,c.listeners,{merger:function(S,P,w){P[S]=P[S]||{},P[S][t.index]=w[S],r._listened=!0}})},afterUpdate:function(e){e[Gn]._labels=jl.prepare(e[Gn]._datasets)},afterDatasetsDraw:function(e){jl.draw(e,e[Gn]._labels)},beforeEvent:function(e,t){if(e[Gn]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":eW(e,n);break;case"click":tW(e,n);break}}},afterEvent:function(e){var t=e[Gn],n=t._actives,o=t._actives=e.getActiveElements(),r=kl.arrayDiff(n,o),i,a,l,c,d,u,f;for(i=0,a=r.length;i<a;++i)if(d=r[i],d[1])for(f=d[0].element[Gn]||[],l=0,c=f.length;l<c;++l)u=f[l],u.$context.active=d[1]===1,u.update(u.$context);(t._dirty||r.length)&&(jl.update(t._labels),e.render()),delete t._dirty}};const oW=e=>{const{values:t,color:n,theme:o,updateCurrentSelectedPoint:r,...i}=e;return{...i,data:rW(t,n),options:iW(o,r),plugins:[aW]}},rW=(e,t)=>({datasets:[{data:e,backgroundColor:t,pointStyle:"circle",pointRadius:8,pointHoverRadius:9}],labels:Array.from(e.map(n=>n.label))}),iW=(e,t)=>({plugins:{datalabels:{color:"#403d58",formatter:function(o){return o.label},align:"right",padding:{left:25},font:{weight:600,size:12,family:e.typography.fontFamily}},legend:{display:!1,usePointStyle:!0},tooltip:{enabled:!1,external:sW}},scales:{x:{beginAtZero:!0,grace:"15%",linear:!0,border:{dash:[5,5]}},y:{beginAtZero:!0,linear:!0,grace:"20%",border:{dash:[5,5]}}},layout:{padding:{left:25,right:25,top:15,bottom:15}},onHover:(o,r)=>{if(o.type==="click"){if(r.length){t(r[0].index,o.x,o.y);return}t(null,null,null)}}}),Vb={opacity:"0",position:"absolute",backgroundColor:"#393A36",color:"#fff",borderRadius:"4px",padding:"6px",pointerEvents:"none",textAlign:"center",fontSize:"10px",fontWeight:"600",minWidth:"30px"},sW=e=>{const{chart:t,tooltip:n}=e;let o=document.getElementById("chartjs-tooltip-x");o||(o=document.createElement("div"),o.id="chartjs-tooltip-x",Object.assign(o.style,Vb),document.body.appendChild(o));let r=document.getElementById("chartjs-tooltip-y");if(r||(r=document.createElement("div"),r.id="chartjs-tooltip-y",Object.assign(r.style,Vb),document.body.appendChild(r)),n.opacity===0){o.style.opacity="0",r.style.opacity="0";return}if(n.dataPoints){const b=n.dataPoints[0],{x:v,y:x}=b.raw;o.textContent=`${v.toFixed(3)}`,r.textContent=`${x.toFixed(3)}`}const i=t.canvas.getBoundingClientRect(),a=t.scales.x,c=t.scales.y.bottom+i.top+window.scrollY,d=a.left+i.left+window.scrollX,u=i.left+window.scrollX+n.caretX-o.offsetWidth/2,f=c;o.style.left=`${u}px`,o.style.top=`${f}px`,o.style.opacity="1";const h=d-r.offsetWidth,g=i.top+window.scrollY+n.caretY-r.offsetHeight/2;r.style.left=`${h}px`,r.style.top=`${g}px`,r.style.opacity="1"},aW={id:"crosshair",defaults:{width:1,color:"#000000",dash:[],tooltipBackground:"#f5f5f5",tooltipTextColor:"#000000",tooltipFontSize:10,tooltipPadding:6,tooltipRadius:4},afterInit:e=>{e.crosshair={x:0,y:0,draw:!1,xValue:null,yValue:null}},afterEvent:(e,t)=>{const{inChartArea:n}=t,o=e.getElementsAtEventForMode(t.event,"nearest",{intersect:!0},!1);if(o.length){const r=o[0].index,i=e.data.datasets[0].data[r],{x:a,y:l}=o[0].element;e.crosshair={x:a,y:l,draw:n,xValue:i.x,yValue:i.y}}else e.crosshair.draw=!1;e.draw()},beforeDatasetsDraw:e=>{var d,u,f,h,g,m,b,v;const{ctx:t,crosshair:n}=e;if(!n)return;const{bottom:o,left:r}=e.chartArea,{x:i,y:a,draw:l}=n;if(!l)return;t.save(),t.beginPath(),t.lineWidth=((u=(d=e.options.plugins)==null?void 0:d.crosshair)==null?void 0:u.width)??1,t.strokeStyle=((h=(f=e.options.plugins)==null?void 0:f.crosshair)==null?void 0:h.color)??"#000000";const c=((m=(g=e.options.plugins)==null?void 0:g.crosshair)==null?void 0:m.dash)??[];t.setLineDash(c.filter(x=>x!==void 0)),t.moveTo(i,a),t.lineTo(i,o),t.moveTo(r,a),t.lineTo(i,a),t.stroke(),t.font=`${((v=(b=e.options.plugins)==null?void 0:b.crosshair)==null?void 0:v.tooltipFontSize)??10}px ${t.font.split(" ").slice(-1)}`,t.textAlign="center",t.textBaseline="middle",t.restore()}};Cl.register(...jB,nW);const lW=e=>{const t=(i,a,l)=>{var u;if(i===null||!((u=e.values)!=null&&u[i])||a===null||l===null){e.onPointSelection(null);return}const d={point:e.values[i],absoluteCoordinate:{x:a,y:l}};e.onPointSelection(d)},n="#F6A500",o=Ee(),r=oW({...e,color:o.palette.primary[500]??n,theme:o,updateCurrentSelectedPoint:t});return p.jsxs(ne,{sx:{backgroundColor:o.custom.grey[200],borderRadius:"8px",border:`1px solid ${o.custom.grey[500]}`,padding:"12px"},children:[e.y,p.jsx(FB,{...r}),p.jsx(ne,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.x})]})},Fb=e=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),y.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"#D1CFCE",strokeWidth:2})),$b=e=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("rect",{width:20,height:20,rx:4,fill:"url(#paint0_linear_2034_7850)"}),y.createElement("path",{d:"M8.32244 13.9335L4.56689 10.178L5.36133 9.38351L8.32244 12.3446L14.628 6.03906L15.4224 6.83351L8.32244 13.9335Z",fill:"white"}),y.createElement("defs",null,y.createElement("linearGradient",{id:"paint0_linear_2034_7850",x1:7.58928,y1:755124e-13,x2:7.58928,y2:20,gradientUnits:"userSpaceOnUse"},y.createElement("stop",{stopColor:"#484945"}),y.createElement("stop",{offset:1,stopColor:"#2A2B27"})))),cW=W(Yo)(()=>({":hover":{background:Me[400]}})),dW=e=>{const{values:t,...n}=e,{onChange:o,...r}=n,i=Object.entries(t);return p.jsx(P1,{children:i.map(([a,l],c)=>p.jsx(Cs,{control:p.jsx(cW,{...r,checkedIcon:p.jsx($b,{}),icon:p.jsx(Fb,{}),disableRipple:!0,onChange:(d,u)=>{const f={};f[a]={name:l.name,state:u},o(f)}}),sx:{gap:"1rem"},label:l.name,checked:l.state},`${a}-${c}`))})},uW=(e,t,n)=>Object.entries(t).flatMap(r=>{const[i,a]=r;if(a.state===!1)return[];const l=Number(i),c=e.find(d=>d.id===l);return c?[c]:[n({id:l,name:a.name})]}),pW=(e,t)=>{const n={};return e.reduce((r,i)=>{const a=t.some(l=>l.id===i.id);return r[i.id]={name:i.name,state:a},r},n)},fW=W(Yo)(()=>({":hover":{background:Me[400]}})),hW=e=>{const{values:t,onChange:n,FormGroupProps:o,FormControlLabelProps:r,CheckboxProps:i}=e,a=Object.entries(t);return p.jsx(P1,{...o,children:a.map(([l,c],d)=>p.jsx(Cs,{sx:{gap:"1rem"},checked:c.state,...r,label:c.name,control:p.jsx(fW,{checkedIcon:p.jsx($b,{}),icon:p.jsx(Fb,{}),disableRipple:!0,...i,onChange:(u,f)=>{const h={...t};h[l]={...h[l],name:c.name,state:f},n(h)}})},`${l}-${d}`))})},Nb=e=>{const{values:t,selectedItems:n,onChange:o,getId:r=d=>d.id,getName:i=d=>d.name,...a}=e,l=(n==null?void 0:n.map(d=>r(d)))??[],c=t.reduce((d,u)=>{const f=r(u),h=l.includes(f),g=n===void 0?!1:h;return d[f]={name:i(u),state:g,rawData:u},d},{});return p.jsx(hW,{values:c,onChange:d=>{const u=Object.values(d).flatMap(f=>f.state===!1?[]:f.rawData);return o(u)},...a})},gW=e=>{const{title:t,subtitle:n,description:o,image:r,callToAction:i,sxProps:a={}}=e,l=Ee();return p.jsxs(ne,{sx:{display:"flex",maxWidth:"1200px",border:`1px solid ${Me[500]}`,background:l.palette.background.paper,borderRadius:"16px",overflow:"hidden",gap:"3rem",...a},children:[p.jsxs(ne,{sx:{padding:"48px 0 48px 48px"},children:[p.jsx(Ms,{defaultVariant:"h2",text:t}),n&&p.jsx(Ms,{defaultVariant:"h5",text:n,typographyProps:{color:l.custom.grey[2e3],lineHeight:"1.625rem"}}),o&&p.jsx(ne,{my:"1.5rem",children:o}),i&&p.jsx(Ja,{buttonOptions:i,defaultOptions:{sx:{display:"inline-flex",gap:"12px",padding:"24px"},variant:"primary",endIcon:p.jsx(Gt,{size:2,icon:"arrowRight"})}})]}),r&&p.jsx(ne,{sx:{width:500,mb:"-8px"},children:r})]})},f2=e=>{const{title:t,description:n,imageSrc:o,onClick:r,isFirst:i=!1,readMoreText:a="Lire l’article"}=e,l=Ee();return p.jsxs(Oe,{direction:i?"column":"row",sx:{border:`1px solid ${Me[500]}`,borderRadius:"16px",overflow:"hidden"},children:[p.jsx(ne,{sx:{lineHeight:0},children:p.jsx(Bm,{onClick:r,sx:{display:"block",minWidth:235,"&:hover":{cursor:"pointer"}},children:p.jsx("img",{style:{width:"100%",height:"auto"},src:o,alt:t})})}),p.jsxs(Oe,{sx:{backgroundColor:l.palette.background.paper,width:"100%",padding:"1.5rem"},children:[p.jsx(he,{variant:"h3",mb:"0.2rem",children:t}),p.jsx(he,{variant:"body",mb:"1rem",children:n}),p.jsxs(rt,{sx:{display:"inline-flex",alignSelf:"flex-start",fontWeight:700,gap:"12px"},variant:"text",onClick:r,children:[p.jsx(he,{fontWeight:700,fontSize:"0.875rem",children:a}),p.jsx(Gt,{size:2,icon:"arrowRight"})]})]})]})},mW=e=>{const{articles:t=[],sxProps:n={}}=e,[o,...r]=t;return p.jsx(Oe,{sx:n,children:p.jsxs(ne,{sx:{display:"flex",flexDirection:"row",gap:"20px"},children:[p.jsx(ne,{children:p.jsx(f2,{...o})}),p.jsx(Oe,{justifyContent:"space-between",children:r.map((i,a)=>p.jsx(f2,{...i},`article-${a}`))})]})})},bW=e=>{const{title:t,children:n,objectives:o=[],tooltipMessage:r}=e,i=Ee();return p.jsxs(Oe,{sx:{borderRadius:"12px",border:`1px solid ${i.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:i.palette.background.paper},children:[p.jsxs(ne,{display:"flex",children:[p.jsx(he,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),r&&p.jsx(Gt,{size:3,icon:"information"})]}),p.jsx(ne,{fontWeight:700,display:"flex",gap:"0.5rem",mb:"1rem",children:n}),p.jsx(Oe,{sx:{"> div:not(:last-of-type)":{mb:"1rem"}},children:o.map((a,l)=>p.jsxs(Oe,{flexDirection:"row",alignItems:"center",gap:".5rem",children:[p.jsx(he,{variant:"small-medium",children:a.objective}),p.jsx(d6,{boxProps:{sx:{padding:"0.1rem 0.5rem"}},children:a.component})]},l))})]})},Bb=W(({className:e,...t})=>p.jsx(qt,{...t,arrow:!0,classes:{popper:e}}))(e=>({[`& .${Co.arrow}`]:{color:"#FFF"},[`& .${Co.tooltip}`]:{padding:"12px 16px 12px 16px",borderRadius:"8px",backgroundColor:"#FFF"}})),vW=e=>{const{title:t,subtitle:n,description:o}=e,r=Ee();return p.jsxs(Oe,{sx:{borderRadius:"12px",border:`1px solid ${r.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:r.palette.background.paper},children:[p.jsxs(Oe,{flexDirection:"row",children:[p.jsx(he,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),n&&p.jsx(xW,{text:n})]}),p.jsx(Oe,{children:p.jsx(he,{variant:"body-medium",children:p.jsx(ne,{dangerouslySetInnerHTML:{__html:o}})})})]})};function xW(e){const{text:t}=e;return p.jsx(Bb,{title:p.jsx(he,{variant:"body-medium",children:t}),placement:"right",children:p.jsx(ne,{children:p.jsx(Gt,{size:3,icon:"information"})})})}const yW=e=>{const{value:t,maxLength:n,...o}=e,r=t.map((u,f)=>t.slice(0,f+1).reduce((h,g)=>{const m=h.length+g.length;if(m>n){const b=n-m,v=[...h.words,g.slice(0,b)].filter(Boolean);return{length:m,words:v,rest:t.length-v.length}}return{...h,length:m,words:[...h.words,g]}},{length:0,words:[],rest:0})),i=r[r.length-1],l=t[t.length-1].length===i.words[i.words.length-1].length?"":"…",c=i.words.join(", "),d=i.rest>0?`${c}… +${i.rest}`:c+l;return p.jsx(he,{...o,children:d})},CW=e=>{const{value:t,maxLength:n,separator:o=",",...r}=e;if(n===0)return p.jsx(he,{...r,children:""});const i=t.join("").length;if(n>i)return p.jsx(he,{...r,children:t.join(o)});let a=0;const l=t.reduce((x,C)=>{const S=a+C.length,P={low:a,high:S};return a=S,x.push(P),x},[]),c=l.findIndex(x=>x.low<n&&n<=x.high),d=c+1,u=l.length-d,h=l[c].high===n?"":"…",g=d*o.length,m=t.join(o).slice(0,n-1+g),b=u?`+${u}`:"",v=`${m}${h} ${b}`;return p.jsx(he,{...r,children:v})},wW=e=>{const{setOpen:t,options:n,onValidate:o,onCancel:r,canValidate:i=!0,confirmAction:a,cancelText:l,validateText:c,...d}=e,[u,f]=X.useState(!1),h=()=>t(!1),g=()=>{f(!1)},m=()=>{r&&r(),h()},b=()=>{if(!a){o&&o(),h();return}u?(f(!1),o&&o(),h()):f(!0)};return p.jsxs(Fa,{onClose:m,...d,fullWidth:!0,maxWidth:"md",scroll:"body",children:[p.jsxs(Qc,{sx:zb,children:[n.title,p.jsx(rt,{variant:"text",endIcon:p.jsx(Md,{}),onClick:m})]}),p.jsx(ne,{sx:{width:"100%"},children:n.content}),p.jsx(Hb,{onCancelAction:m,onConfirmAction:b,canValidate:i,cancelText:l,validateText:c}),a&&p.jsx(SW,{openConfirmAction:u,onCancel:g,onValidate:b,confirmAction:a,cancelText:l,validateText:c})]})},SW=e=>{const{confirmAction:t,onCancel:n,onValidate:o,openConfirmAction:r,cancelText:i,validateText:a}=e;return p.jsxs(Fa,{open:r,onClose:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Me[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},children:[p.jsxs(Qc,{sx:zb,children:[t.title,p.jsx(rt,{variant:"text",endIcon:p.jsx(Md,{}),onClick:n})]}),p.jsx(ne,{sx:{padding:"32px",width:"100%"},children:t.content}),p.jsx(Hb,{onCancelAction:n,onConfirmAction:o,cancelText:t.cancelText??i,validateText:t.validateText??a})]})},Hb=e=>{const{onCancelAction:t,onConfirmAction:n,canValidate:o=!0,cancelText:r,validateText:i}=e;return p.jsxs(T1,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:`1px solid ${Me[500]}`,minHeight:"68px",paddingInline:"1rem",padding:"28px 32px 32px 32px"},children:[p.jsx(rt,{variant:"text",onClick:t,children:r}),p.jsx(rt,{variant:"primary",onClick:n,disabled:!o,children:i})]})},zb={display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Me[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},TW=W(_a)(({theme:e})=>({fontFamily:e.typography.fontFamily,...e.typography.body})),$s=X.forwardRef(function(e,t){const n=Ee(),{sx:o,error:r,...i}=e;return p.jsx(TW,{...i,sx:{color:r?n.custom.red[600]:n.custom.grey[2800],border:r?`1px solid ${n.custom.red[600]}`:`1px solid ${n.custom.grey[1400]}`,backgroundColor:r?n.custom.red[100]:"inherit",borderRadius:"16px",paddingInline:"20px",...o}})}),PW=e=>{const{title:t,unit:n,placeholder:o,value:r,description:i,error:a,required:l,...c}=e,d=l?"*":"",u=Ee(),f=X.useRef(!1),h=f.current&&a,[g,m]=X.useState(!1),[b,v]=X.useState(!1),[x,C]=X.useState(!1);X.useEffect(()=>{const M=S(P,e.setMinMaxError);m(M);const O=S(w,e.setMinError);v(O);const E=S(R,e.setMaxError);C(E)},[r]);const S=(M,O)=>{const E=M();return O!==void 0&&O(E),E},P=()=>{if(e.min===void 0&&e.max===void 0||r===void 0||r==="")return!1;const M=Number(r);return!(e.min!==void 0&&M>e.min&&e.max!==void 0&&M<e.max)},w=()=>e.min===void 0||r===void 0||r===""?!1:!(e.min<Number(r)&&e.max===void 0),R=()=>e.max===void 0||r===void 0||r===""?!1:!(e.max>Number(r)&&e.min===void 0);return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[p.jsx(he,{variant:"h5",children:`${t}${d} :`}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[p.jsx($s,{...c,type:"number",style:{minWidth:"150px",width:"10%",borderColor:h?u.palette.error.main:"inherit",backgroundColor:h?u.palette.error.light:"inherit"},placeholder:o,value:r,onChange:M=>{f.current=!0,c.onChange&&c.onChange(M)}}),p.jsx(he,{variant:"body",children:n})]}),(!!e.minMaxErrorMessage&&g||!!e.minErrorMessage&&b||!!e.maxErrorMessage&&x)&&p.jsxs(he,{variant:"body",style:{color:u.custom.red[600]},children:[!!e.minMaxErrorMessage&&g&&e.minMaxErrorMessage,!!e.minErrorMessage&&b&&e.minErrorMessage,!!e.maxErrorMessage&&x&&e.maxErrorMessage]}),p.jsx(he,{variant:"body",children:i})]})},MW=e=>{const{unit:t,sx:n,...o}=e;return p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[p.jsx($s,{type:"number",sx:{minWidth:"125px",width:"10%",...n},...o}),p.jsx(he,{variant:"body",children:t})]})};function RW(e){const t=Ee(),n={height:"40px",padding:"0px 6px 0px 20px",...t.custom.searchBox,minWidth:"350px"},o={height:"20px",padding:"0px",width:"100%","&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{padding:"0"}},r={height:"48px",padding:"0px 16px 0px 24px",borderTop:"1px solid "+t.custom.grey[500],borderBottom:"1px solid "+t.custom.grey[500],background:t.custom.grey[200]},i={"&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{width:"100%",height:"48px",padding:"0",border:"none"}};return p.jsxs(Oe,{direction:"row",useFlexGap:!0,gap:"10px",justifyContent:"space-between",alignItems:"center",sx:e.variant==="standalone"?n:r,children:[p.jsx(ur,{label:"",type:"search",placeholder:e.placeholder,value:e.value,onChange:a=>{e.onChange(a.target.value)},sx:e.variant==="standalone"?o:i}),p.jsx(PL,{})]})}const OW=X.forwardRef(function(t,n){const{title:o,placeholder:r,value:i,description:a,sx:l,error:c,required:d,...u}=t,f=d?"*":"",h=Ee(),g=X.useRef(!1),m=g.current&&c;return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[p.jsx(he,{variant:"h5",children:`${o}${f} :`}),p.jsx($s,{...u,sx:{width:"70%",borderColor:m?h.custom.red[600]:"inherit",backgroundColor:m?h.custom.red[100]:"inherit",...l},placeholder:r,value:i,onChange:b=>{g.current=!0,u.onChange&&u.onChange(b)}}),p.jsx(he,{variant:"body",children:a})]})});function EW(e){return p.jsxs("div",{children:[p.jsx(he,{variant:"body-bold",sx:{marginBottom:"16px"},children:e.header}),p.jsxs(Oe,{direction:"column",useFlexGap:!0,gap:"12px",children:[p.jsxs(Oe,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[p.jsx(Yo,{checked:!0,sx:{width:"20px",height:"20px"}}),p.jsx(he,{variant:"body",children:e.allText})]}),e.values.map((t,n)=>p.jsxs(Oe,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[p.jsx(Yo,{checked:!1,sx:{width:"20px",height:"20px"}}),p.jsx(he,{variant:"body",children:t})]},n))]})]})}function kW(e){return p.jsxs(Oe,{direction:"column",useFlexGap:!0,gap:"12px",alignItems:"flex-start",children:[p.jsx(he,{variant:"body-bold",children:e.header}),p.jsx(Oe,{direction:"row",useFlexGap:!0,gap:"8px",flexWrap:"wrap",children:e.values.map((t,n)=>p.jsxs(Oe,{direction:"row",useFlexGap:!0,gap:"4px",sx:{height:"28px",borderRadius:"4px",background:"#EFEDEC",paddingLeft:"8px"},alignItems:"center",children:[p.jsx(he,{variant:"body",children:t}),p.jsx(Rt,{sx:{width:"20px",height:"20px"},children:p.jsx(U1,{sx:{width:"16px",height:"16px"}})})]},n))}),p.jsx(rt,{variant:"text",startIcon:p.jsx(mL,{}),children:e.addText})]})}const Wb=e=>{const t=Ee(),{steps:n,currentStep:o=0,icons:r=[],clickable:i=!1,onClick:a}=e;return p.jsxs(ne,{display:"inline-flex",position:"relative",children:[p.jsx(Oe,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(n??r.length).keys()].map(l=>{const c=l<=o;return p.jsx(Pd,{size:"medium",border:`1px solid ${t.custom.grey[500]}`,color:c?"#FFF":t.custom.grey[2800],bgcolor:c?t.custom.grey[2800]:"#FFF",sx:{fill:c?"#FFF":t.custom.grey[2800],cursor:i?"pointer":"default","&:hover":i?{fill:"#FFF",color:"#FFF",bgcolor:t.custom.grey[c?2800:2e3]}:{}},onClick:()=>{i&&a&&a(l)},children:r&&r[l]?r[l]:l+1},l)})}),p.jsx(oo,{sx:{backgroundColor:t.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},Ub=e=>y.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M11.021 7.69411H0.333496V6.30524H11.021L6.021 1.30522L7.00016 0.333008L13.6668 6.99967L7.00016 13.6663L6.021 12.6941L11.021 7.69411Z",fill:"white"})),Zb=e=>y.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M2.97919 7.69411L7.97921 12.6941L7.00004 13.6663L0.333374 6.99967L7.00004 0.333008L7.97921 1.30522L2.97919 6.30524H13.6667V7.69411H2.97919Z",fill:"#B06803"})),qb=e=>{var t;return p.jsxs(Oe,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{minHeight:"96px",zIndex:1e3,position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px"},children:[p.jsx(IW,{title:e.title,subtitle:e.subtitle}),p.jsx(Wb,{icons:e.icons,steps:e.steps??((t=e.icons)==null?void 0:t.length)??0,currentStep:e.currentPage,clickable:e.navigable,onClick:e.onNavigate}),p.jsx(_W,{onPageForward:e.onPageForward,onPageBack:e.onPageBack,nextPageText:e.nextPageText,previousPageText:e.previousPageText,currentPage:e.currentPage,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:e.savingState,closeable:e.closeable,onClose:e.onClose})]})},IW=e=>{const t=Ee();return p.jsx(Oe,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:p.jsxs(Oe,{gap:"4px",children:[p.jsx(he,{variant:"h3",children:e.title}),e.subtitle&&p.jsx(he,{variant:"body",color:t.custom.grey[2e3],children:e.subtitle})]})})},jW=e=>{const t=Ee(),n=e.saving?o6:n6,o=e.saving?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},r=p.jsx(n,{sx:{width:"24px",color:t.custom.grey[2e3],...o}}),i=p.jsx(ne,{padding:"12px 16px",textAlign:"center",children:p.jsx(he,{variant:"body",children:e.saving?e.savingMessage:e.savedMessage})});return p.jsx(el,{icon:r,body:i,size:"260px"})},_W=e=>{const t=Ee(),n=p.jsx(rt,{variant:"primary",disabled:e.validateSteps&&!e.validateSteps[e.currentPage],endIcon:p.jsx(Ub,{}),onClick:e.onPageForward,children:e.nextPageText}),o=p.jsxs(ne,{padding:"12px 16px",children:[p.jsx(he,{variant:"body-bold",children:e.warningText||""}),p.jsx("br",{}),p.jsx(he,{variant:"body",children:e.validateStepsTexts&&e.validateStepsTexts[e.currentPage]||""})]});return p.jsxs(Oe,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[p.jsx(ne,{sx:{">*":{display:"flex"}},children:e.savingState&&p.jsx(jW,{...e.savingState})}),p.jsxs(Oe,{direction:"row",gap:"20px",children:[e.previousPageText&&p.jsx(rt,{variant:"text",startIcon:p.jsx(Zb,{}),onClick:e.onPageBack,children:e.previousPageText}),e.validateSteps&&!e.validateSteps[e.currentPage]?e.nextPageText&&p.jsx(el,{icon:n,body:o,size:"260px"}):e.nextPageText&&n]}),e.closeable&&p.jsx(rt,{variant:"white-filled",onClick:e.onClose,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:t.custom.grey[400]},"&:active":{background:t.custom.grey[600]}},children:p.jsx(t6,{sx:{width:"20px",color:t.custom.grey[2800]}})})]})},h2=e=>{const t=Ee(),{title:n,titleSize:o,badge:r}=e,a=o||"h1";return p.jsxs(Oe,{direction:"row",alignItems:"center",gap:"16px",children:[typeof r=="number"?p.jsx(Pd,{size:"big",children:r}):p.jsx(Oe,{width:"40px",alignItems:"center",color:t.custom.grey[2800],children:p.jsx(Oe,{sx:{transform:"scale(250%)"},children:r})}),p.jsx(he,{variant:a,children:n})]})},DW=e=>{const{title:t,subtitle:n,pages:o,pageIndexToDisplay:r=0,savingState:i,closeable:a=!0}=e,l=o.map(u=>u.icon),c=o[r],d=(Array.isArray(c.content)?c.content:[c.content]).map((u,f)=>p.jsx(X.Fragment,{children:u},f));return p.jsxs(p.Fragment,{children:[p.jsx(qb,{title:t,subtitle:n,icons:l,steps:o.length,currentPage:r,nextPageText:e.nextPageText,previousPageText:e.previousPageText,onPageForward:e.onPageForward,onPageBack:e.onPageBack,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:i,navigable:e.navigable,onNavigate:e.onNavigate,closeable:a,onClose:e.onClose}),p.jsx(Oe,{direction:"column",alignItems:"center",children:p.jsxs("div",{style:{width:"1024px"},children:[p.jsxs(Oe,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[c.title&&p.jsx(h2,{title:c.title,badge:c.icon??r+1}),c.subTitle&&p.jsx(he,{variant:"h4",children:c.subTitle}),c.subTitle&&p.jsx(oo,{}),c.info]}),c.usesBaseLayout===!1?p.jsx(p.Fragment,{children:d}):p.jsx(LW,{children:d})]})})]})},LW=e=>{const{children:t}=e,n=Array.isArray(t)?t:[t];return p.jsx("div",{children:n.map((o,r)=>p.jsx(X.Fragment,{children:o},r))})},AW=({sx:e={},...t})=>p.jsx(ne,{sx:{boxShadow:"0px 2px 8px 0px #2A2B270A",border:`1px solid ${Me[500]}`,borderRadius:"16px",backgroundColor:"#FFFFFF",padding:"2rem",height:"fit-content",...e},...t}),VW=e=>{const{title:t,hint:n,indicator:o,children:r,...i}=e;return p.jsx(wo,{width:"100%",padding:"32px",...i,children:p.jsxs(Oe,{gap:"32px",children:[p.jsxs(Oe,{direction:"row",alignItems:"start",gap:"32px",children:[p.jsx(he,{variant:"h4",flex:1,children:t}),o&&p.jsx(yd,{value:o.value,unit:o.unit,sx:{top:"-12px",right:"-12px"}})]}),p.jsxs(Oe,{gap:"24px",children:[r,n&&p.jsx(p6,{children:p.jsx(ne,{dangerouslySetInnerHTML:{__html:n}})})]})]})})},FW=()=>{const[e,t]=X.useState({isLocked:!1}),n=u=>{t({isLocked:!0,message:u})},o=()=>{t({isLocked:!1})},[r,i]=X.useState({isLocked:!1}),a=u=>{i({isLocked:!0,message:u})},l=()=>{i({isLocked:!1})};return{forwardLock:e,lockForward:n,unlockForward:o,previousLock:r,lockPrevious:a,unlockPrevious:l,lockAll:u=>{n(u),a(u)},unlockAll:()=>{o(),l()}}},Gb=X.createContext(null),Yb=e=>{const{children:t,startingPage:n=0,...o}=e,[r,i]=X.useState(!1),[a,l]=X.useState(!1),[c,d]=X.useState(n),u=e.pages.length,f=e.pages[c]??null,h=FW(),[g,m]=X.useState(!1),b={...o,...h,isSaving:r,setSaving:i,selectedPage:f,selectedPageIndex:c,setPage:d,maxPage:u,formSaved:g,setFormSaved:m,isError:a,setError:l};return p.jsx(Gb.Provider,{value:b,children:t})},ji=()=>{const e=X.useContext(Gb);if(e)return e;throw new Error("useFormBaseContext must be used within an FormBaseContextProvider")},$W=()=>{const{selectedPageIndex:e,setPage:t,onPageChange:n,pages:o,previousLock:r,forwardLock:i,maxPage:a,setFormSaved:l,isLoading:c}=ji(),d=Ee(),u={selected:{color:"#FFF",background:d.custom.grey[2800],hover:{color:"#FFF",background:d.custom.grey[2800]}},locked:{color:d.custom.grey[500],background:"#FFF",hover:{color:d.custom.grey[500],background:"#FFF"}},default:{color:d.custom.grey[2800],background:"#FFF",hover:{color:"#FFF",background:d.custom.grey[2e3]}}};return c?p.jsx(ys,{}):p.jsxs(ne,{display:"inline-flex",position:"relative",children:[p.jsx(Oe,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(a)].map((f,h)=>{var S;const g=r.isLocked&&h<e,m=i.isLocked&&h>e,b=g||m,x=h===e?u.selected:u[b?"locked":"default"],C=((S=o[h])==null?void 0:S.icon)??h+1;return p.jsx(Pd,{size:"medium",border:`1px solid ${d.custom.grey[500]}`,color:x.color,bgcolor:x.background,sx:{fill:x.color,cursor:b?"default":"pointer","&:hover":{fill:x.hover.color,color:x.hover.color,bgcolor:x.hover.background}},onClick:()=>{h===e||b||(l(!1),t(h),n==null||n(h,e))},children:C},`page-top-display-${h}`)})}),p.jsx(oo,{sx:{backgroundColor:d.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},NW=()=>{const{textOptions:e,isLoading:t}=ji(),n=Ee();return p.jsx(Oe,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:p.jsxs(Oe,{gap:"4px",children:[p.jsx(he,{variant:"h3",children:t?p.jsx(ys,{size:"18px"}):e.title}),e.subtitle&&p.jsx(he,{variant:"body",color:n.custom.grey[2e3],children:e.subtitle})]})})},BW=()=>{const e=Ee(),{isSaving:t,textOptions:n,isError:o}=ji(),r=t?o6:o?RL:n6,i=t?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},a=p.jsx(r,{sx:{width:"24px",color:o?e.custom.red[600]:e.custom.grey[2e3],...i}}),l=p.jsx(ne,{padding:"12px 16px",textAlign:"center",children:p.jsx(he,{variant:"body-medium",children:t?n.syncingMessage:o?n.errorDefaultMessage:n.savingDefaultMessage})});return p.jsx(el,{icon:a,body:l,size:"260px"})},HW=()=>{const{confirmExit:e,selectedPageIndex:t,setPage:n,maxPage:o,forwardLock:r,previousLock:i,textOptions:a,onClose:l,onValidate:c,onPageChange:d,showSync:u,setFormSaved:f,openConfirmDialog:h,isLoading:g}=ji(),m=Ee(),v=t===o-1&&a.finalPage?a.finalPage:a.nextPage,x=p.jsx(rt,{variant:"primary",disabled:r.isLocked||g,endIcon:p.jsx(Ub,{}),onClick:()=>{if(t===o-1){f(!0),c==null||c();return}return f(!1),d==null||d(t+1,t),n(t+1)},children:v}),C=p.jsxs(ne,{padding:"12px 16px",children:[p.jsx(he,{variant:"body-bold",children:a.warningText?a.warningText:""}),p.jsx("br",{}),p.jsx(he,{variant:"body",children:r.isLocked&&r.message||""})]});return p.jsxs(Oe,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[p.jsx(ne,{sx:{">*":{display:"flex"}},children:u&&p.jsx(BW,{})}),p.jsxs(Oe,{direction:"row",gap:"20px",children:[a.previousPage&&p.jsx(rt,{sx:{minWidth:"90px"},variant:"text",disabled:i.isLocked||g,startIcon:i.isLocked||g?null:p.jsx(Zb,{}),onClick:()=>{if(f(!1),t===0){d==null||d(t,t);return}return d==null||d(t-1,t),n(t-1)},children:a.previousPage}),r.isLocked?v&&p.jsx(el,{icon:x,body:C,size:"260px",leftPosition:130}):v&&x]}),l&&p.jsx(rt,{variant:"white-filled",onClick:e?h:l,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:m.custom.grey[400]},"&:active":{background:m.custom.grey[600]}},children:p.jsx(t6,{sx:{width:"20px",color:m.custom.grey[2800]}})})]})},zW=()=>p.jsxs(ne,{sx:{zIndex:1e3,minHeight:"96px",position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px",display:"grid",gridTemplateColumns:"1fr 50% 1fr",gridTemplateRows:"1fr",alignItems:"center"},children:[p.jsx(ne,{sx:{gridColumn:"1 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"left"},children:p.jsx(NW,{})}),p.jsx(ne,{sx:{gridColumn:"2 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"center"},children:p.jsx($W,{})}),p.jsx(ne,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:p.jsx(HW,{})})]}),WW=()=>{const{selectedPage:e,selectedPageIndex:t,isLoading:n}=ji(),o=e.icon??t+1,r=e.title,i=e.subtitle;return n?p.jsx(UW,{}):p.jsx(Oe,{direction:"column",alignItems:"center",children:p.jsxs("div",{style:{width:"1024px"},children:[p.jsxs(Oe,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[r&&p.jsx(h2,{title:r,badge:o}),i&&p.jsxs(p.Fragment,{children:[p.jsx(he,{variant:"h4",children:i}),p.jsx(oo,{})]})]}),e.content]})})},UW=()=>p.jsx(ne,{sx:{marginLeft:"auto",marginRight:"auto",width:"fit-content",marginTop:"5%",marginBottom:"5%"},children:p.jsx(ys,{})}),ZW=e=>{const t=Ee(),{onClose:n,open:o,confirmOptions:r}=e,i=()=>{r.onConfirm(),n()},a=()=>{r.onCancel(),n()};return p.jsxs(Fa,{fullWidth:!0,maxWidth:"xs",open:o,onClose:n,sx:{".MuiPaper-rounded":{borderRadius:"12px"}},children:[p.jsxs(Qc,{sx:{borderBottom:`1px solid ${t.custom.grey[500]}`},children:[p.jsxs(ne,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:"68px"},children:[p.jsx(he,{variant:"h3",children:r.titleText}),p.jsx(rt,{variant:"text",endIcon:p.jsx(Md,{}),onClick:n})]}),(r==null?void 0:r.infoText)&&p.jsx(he,{sx:{marginBlock:1.5},children:r.infoText})]}),p.jsxs(Oe,{flexDirection:"column",alignItems:"center",p:3,gap:"1rem",children:[p.jsx(rt,{variant:"primary",onClick:i,children:r.confirmText}),p.jsx(rt,{onClick:a,children:r.cancelText})]})]})},qW=()=>{const{confirmExit:e,formSaved:t}=ji(),n=o=>{o.preventDefault()};return X.useEffect(()=>{if(e)return window.removeEventListener("beforeunload",n),t===!1&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t,e]),p.jsxs(p.Fragment,{children:[p.jsx(zW,{}),p.jsx(WW,{})]})},GW=e=>{const[t,n]=X.useState(!1);return p.jsxs(Yb,{...e,openConfirmDialog:()=>n(!0),children:[p.jsx(qW,{}),e.confirmExit&&p.jsx(ZW,{open:t,onClose:()=>n(!1),confirmOptions:e.confirmOptions})]})};/**
374
+ `)):Array.isArray(n)?e.push.apply(e,n):yt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var o=[].concat(t),r=o.length,i=e.font,a=0,l;for(e.font=n.string,l=0;l<r;++l)a=Math.max(e.measureText(o[l]).width,a);return e.font=i,{height:r*n.lineHeight,width:a}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),o=[],r,i,a,l;for(r=0,a=t.length;r<a;++r)l=t[r],i=n.indexOf(l),i===-1?o.push([l,1]):n.splice(i,1);for(r=0,a=n.length;r<a;++r)o.push([n[r],-1]);return o},rasterize:function(e){return Math.round(e*Rb)/Rb}};function u2(e,t){var n=t.x,o=t.y;if(n===null)return{x:0,y:-1};if(o===null)return{x:1,y:0};var r=e.x-n,i=e.y-o,a=Math.sqrt(r*r+i*i);return{x:a?r/a:0,y:a?i/a:-1}}function Lz(e,t,n,o,r){switch(r){case"center":n=o=0;break;case"bottom":n=0,o=1;break;case"right":n=1,o=0;break;case"left":n=-1,o=0;break;case"top":n=0,o=-1;break;case"start":n=-n,o=-o;break;case"end":break;default:r*=Math.PI/180,n=Math.cos(r),o=Math.sin(r);break}return{x:e,y:t,vx:n,vy:o}}var Az=0,Ob=1,Eb=2,kb=4,Ib=8;function gu(e,t,n){var o=Az;return e<n.left?o|=Ob:e>n.right&&(o|=Eb),t<n.top?o|=Ib:t>n.bottom&&(o|=kb),o}function Vz(e,t){for(var n=e.x0,o=e.y0,r=e.x1,i=e.y1,a=gu(n,o,t),l=gu(r,i,t),c,d,u;!(!(a|l)||a&l);)c=a||l,c&Ib?(d=n+(r-n)*(t.top-o)/(i-o),u=t.top):c&kb?(d=n+(r-n)*(t.bottom-o)/(i-o),u=t.bottom):c&Eb?(u=o+(i-o)*(t.right-n)/(r-n),d=t.right):c&Ob&&(u=o+(i-o)*(t.left-n)/(r-n),d=t.left),c===a?(n=d,o=u,a=gu(n,o,t)):(r=d,i=u,l=gu(r,i,t));return{x0:n,x1:r,y0:o,y1:i}}function mu(e,t){var n=t.anchor,o=e,r,i;return t.clamp&&(o=Vz(o,t.area)),n==="start"?(r=o.x0,i=o.y0):n==="end"?(r=o.x1,i=o.y1):(r=(o.x0+o.x1)/2,i=(o.y0+o.y1)/2),Lz(r,i,e.vx,e.vy,t.align)}var bu={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,o=Math.cos(n),r=Math.sin(n),i=e.innerRadius,a=e.outerRadius;return mu({x0:e.x+o*i,y0:e.y+r*i,x1:e.x+o*a,y1:e.y+r*a,vx:o,vy:r},t)},point:function(e,t){var n=u2(e,t.origin),o=n.x*e.options.radius,r=n.y*e.options.radius;return mu({x0:e.x-o,y0:e.y-r,x1:e.x+o,y1:e.y+r,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=u2(e,t.origin),o=e.x,r=e.y,i=0,a=0;return e.horizontal?(o=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(r=Math.min(e.y,e.base),a=Math.abs(e.base-e.y)),mu({x0:o,y0:r+a,x1:o+i,y1:r,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=u2(e,t.origin);return mu({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Sr=kl.rasterize;function Fz(e){var t=e.borderWidth||0,n=e.padding,o=e.size.height,r=e.size.width,i=-r/2,a=-o/2;return{frame:{x:i-n.left-t,y:a-n.top-t,w:r+n.width+t*2,h:o+n.height+t*2},text:{x:i,y:a,w:r,h:o}}}function $z(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var o=n.getBasePixel();return e.horizontal?{x:o,y:null}:{x:null,y:o}}function Nz(e){return e instanceof ki?bu.arc:e instanceof wl?bu.point:e instanceof Sl?bu.bar:bu.fallback}function Bz(e,t,n,o,r,i){var a=Math.PI/2;if(i){var l=Math.min(i,r/2,o/2),c=t+l,d=n+l,u=t+o-l,f=n+r-l;e.moveTo(t,d),c<u&&d<f?(e.arc(c,d,l,-Math.PI,-a),e.arc(u,d,l,-a,0),e.arc(u,f,l,0,a),e.arc(c,f,l,a,Math.PI)):c<u?(e.moveTo(c,n),e.arc(u,d,l,-a,a),e.arc(c,d,l,a,Math.PI+a)):d<f?(e.arc(c,d,l,-Math.PI,0),e.arc(c,f,l,0,Math.PI)):e.arc(c,d,l,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,o,r)}function Hz(e,t,n){var o=n.backgroundColor,r=n.borderColor,i=n.borderWidth;!o&&(!r||!i)||(e.beginPath(),Bz(e,Sr(t.x)+i/2,Sr(t.y)+i/2,Sr(t.w)-i,Sr(t.h)-i,n.borderRadius),e.closePath(),o&&(e.fillStyle=o,e.fill()),r&&i&&(e.strokeStyle=r,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function zz(e,t,n){var o=n.lineHeight,r=e.w,i=e.x,a=e.y+o/2;return t==="center"?i+=r/2:(t==="end"||t==="right")&&(i+=r),{h:o,w:r,x:i,y:a}}function Wz(e,t,n){var o=e.shadowBlur,r=n.stroked,i=Sr(n.x),a=Sr(n.y),l=Sr(n.w);r&&e.strokeText(t,i,a,l),n.filled&&(o&&r&&(e.shadowBlur=0),e.fillText(t,i,a,l),o&&r&&(e.shadowBlur=o))}function Uz(e,t,n,o){var r=o.textAlign,i=o.color,a=!!i,l=o.font,c=t.length,d=o.textStrokeColor,u=o.textStrokeWidth,f=d&&u,h;if(!(!c||!a&&!f))for(n=zz(n,r,l),e.font=l.string,e.textAlign=r,e.textBaseline="middle",e.shadowBlur=o.textShadowBlur,e.shadowColor=o.textShadowColor,a&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=d),h=0,c=t.length;h<c;++h)Wz(e,t[h],{stroked:f,filled:a,w:n.w,x:n.x,y:n.y+n.h*h})}var jb=function(e,t,n,o){var r=this;r._config=e,r._index=o,r._model=null,r._rects=null,r._ctx=t,r._el=n};Xo(jb.prototype,{_modelize:function(e,t,n,o){var r=this,i=r._index,a=gn(Qt([n.font,{}],o,i)),l=Qt([n.color,nn.color],o,i);return{align:Qt([n.align,"center"],o,i),anchor:Qt([n.anchor,"center"],o,i),area:o.chart.chartArea,backgroundColor:Qt([n.backgroundColor,null],o,i),borderColor:Qt([n.borderColor,null],o,i),borderRadius:Qt([n.borderRadius,0],o,i),borderWidth:Qt([n.borderWidth,0],o,i),clamp:Qt([n.clamp,!1],o,i),clip:Qt([n.clip,!1],o,i),color:l,display:e,font:a,lines:t,offset:Qt([n.offset,4],o,i),opacity:Qt([n.opacity,1],o,i),origin:$z(r._el,o),padding:Mn(Qt([n.padding,4],o,i)),positioner:Nz(r._el),rotation:Qt([n.rotation,0],o,i)*(Math.PI/180),size:kl.textSize(r._ctx,t,a),textAlign:Qt([n.textAlign,"start"],o,i),textShadowBlur:Qt([n.textShadowBlur,0],o,i),textShadowColor:Qt([n.textShadowColor,l],o,i),textStrokeColor:Qt([n.textStrokeColor,l],o,i),textStrokeWidth:Qt([n.textStrokeWidth,0],o,i)}},update:function(e){var t=this,n=null,o=null,r=t._index,i=t._config,a,l,c,d=Qt([i.display,!0],e,r);d&&(a=e.dataset.data[r],l=ct(Wt(i.formatter,[a,e]),a),c=yt(l)?[]:kl.toTextLines(l),c.length&&(n=t._modelize(d,c,i,e),o=Fz(n))),t._model=n,t._rects=o},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,o=e.ctx,r=n._model,i=n._rects,a;this.visible()&&(o.save(),r.clip&&(a=r.area,o.beginPath(),o.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),o.clip()),o.globalAlpha=kl.bound(0,r.opacity,1),o.translate(Sr(t.x),Sr(t.y)),o.rotate(r.rotation),Hz(o,i.frame,r),Uz(o,r.lines,i.text,r),o.restore())}});var Zz=Number.MIN_SAFE_INTEGER||-9007199254740991,qz=Number.MAX_SAFE_INTEGER||9007199254740991;function Il(e,t,n){var o=Math.cos(n),r=Math.sin(n),i=t.x,a=t.y;return{x:i+o*(e.x-i)-r*(e.y-a),y:a+r*(e.x-i)+o*(e.y-a)}}function _b(e,t){var n=qz,o=Zz,r=t.origin,i,a,l,c,d;for(i=0;i<e.length;++i)a=e[i],l=a.x-r.x,c=a.y-r.y,d=t.vx*l+t.vy*c,n=Math.min(n,d),o=Math.max(o,d);return{min:n,max:o}}function vu(e,t){var n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n*n+o*o);return{vx:(t.x-e.x)/r,vy:(t.y-e.y)/r,origin:e,ln:r}}var Db=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Xo(Db.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,o=t._rect;return e=Il(e,t.center(),-t._rotation),!(e.x<o.x-n||e.y<o.y-n||e.x>o.x+o.w+n*2||e.y>o.y+o.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),o=[vu(t[0],t[1]),vu(t[0],t[3])],r,i,a;for(this._rotation!==e._rotation&&o.push(vu(n[0],n[1]),vu(n[0],n[3])),r=0;r<o.length;++r)if(i=_b(t,o[r]),a=_b(n,o[r]),i.max<a.min||a.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,o=e.center();return[Il({x:t.x,y:t.y},o,n),Il({x:t.x+t.w,y:t.y},o,n),Il({x:t.x+t.w,y:t.y+t.h},o,n),Il({x:t.x,y:t.y+t.h},o,n)]}});function Lb(e,t,n){var o=t.positioner(e,t),r=o.vx,i=o.vy;if(!r&&!i)return{x:o.x,y:o.y};var a=n.w,l=n.h,c=t.rotation,d=Math.abs(a/2*Math.cos(c))+Math.abs(l/2*Math.sin(c)),u=Math.abs(a/2*Math.sin(c))+Math.abs(l/2*Math.cos(c)),f=1/Math.max(Math.abs(r),Math.abs(i));return d*=r*f,u*=i*f,d+=t.offset*r,u+=t.offset*i,{x:o.x+d,y:o.y+u}}function Gz(e,t){var n,o,r,i;for(n=e.length-1;n>=0;--n)for(r=e[n].$layout,o=n-1;o>=0&&r._visible;--o)i=e[o].$layout,i._visible&&r._box.intersects(i._box)&&t(r,i);return e}function Yz(e){var t,n,o,r,i,a,l;for(t=0,n=e.length;t<n;++t)o=e[t],r=o.$layout,r._visible&&(l=new Proxy(o._el,{get:(c,d)=>c.getProps([d],!0)[d]}),i=o.geometry(),a=Lb(l,o.model(),i),r._box.update(a,i,o.rotation()));return Gz(e,function(c,d){var u=c._hidable,f=d._hidable;u&&f||f?d._visible=!1:u&&(c._visible=!1)})}var jl={prepare:function(e){var t=[],n,o,r,i,a;for(n=0,r=e.length;n<r;++n)for(o=0,i=e[n].length;o<i;++o)a=e[n][o],t.push(a),a.$layout={_box:new Db,_hidable:!1,_visible:!0,_set:n,_idx:a._index};return t.sort(function(l,c){var d=l.$layout,u=c.$layout;return d._idx===u._idx?u._set-d._set:u._idx-d._idx}),this.update(t),t},update:function(e){var t=!1,n,o,r,i,a;for(n=0,o=e.length;n<o;++n)r=e[n],i=r.model(),a=r.$layout,a._hidable=i&&i.display==="auto",a._visible=r.visible(),t|=a._hidable;t&&Yz(e)},lookup:function(e,t){var n,o;for(n=e.length-1;n>=0;--n)if(o=e[n].$layout,o&&o._visible&&o._box.contains(t))return e[n];return null},draw:function(e,t){var n,o,r,i,a,l;for(n=0,o=t.length;n<o;++n)r=t[n],i=r.$layout,i._visible&&(a=r.geometry(),l=Lb(r._el,r.model(),a),i._box.update(l,a,r.rotation()),r.draw(e,l))}},Kz=function(e){if(yt(e))return null;var t=e,n,o,r;if(St(e))if(!yt(e.label))t=e.label;else if(!yt(e.r))t=e.r;else for(t="",n=Object.keys(e),r=0,o=n.length;r<o;++r)t+=(r!==0?", ":"")+n[r]+": "+e[n[r]];return""+t},Xz={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:Kz,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},Gn="$datalabels",Ab="$default";function Qz(e,t){var n=e.datalabels,o={},r=[],i,a;return n===!1?null:(n===!0&&(n={}),t=Xo({},[t,n]),i=t.labels||{},a=Object.keys(i),delete t.labels,a.length?a.forEach(function(l){i[l]&&r.push(Xo({},[t,i[l],{_key:l}]))}):r.push(t),o=r.reduce(function(l,c){return $t(c.listeners||{},function(d,u){l[u]=l[u]||{},l[u][c._key||Ab]=d}),delete c.listeners,l},{}),{labels:r,listeners:o})}function p2(e,t,n,o){if(t){var r=n.$context,i=n.$groups,a;t[i._set]&&(a=t[i._set][i._key],a&&Wt(a,[r,o])===!0&&(e[Gn]._dirty=!0,n.update(r)))}}function Jz(e,t,n,o,r){var i,a;!n&&!o||(n?o?n!==o&&(a=i=!0):a=!0:i=!0,a&&p2(e,t.leave,n,r),i&&p2(e,t.enter,o,r))}function eW(e,t){var n=e[Gn],o=n._listeners,r,i;if(!(!o.enter&&!o.leave)){if(t.type==="mousemove")i=jl.lookup(n._labels,t);else if(t.type!=="mouseout")return;r=n._hovered,n._hovered=i,Jz(e,o,r,i,t)}}function tW(e,t){var n=e[Gn],o=n._listeners.click,r=o&&jl.lookup(n._labels,t);r&&p2(e,o,r,t)}var nW={id:"datalabels",defaults:Xz,beforeInit:function(e){e[Gn]={_actives:[]}},beforeUpdate:function(e){var t=e[Gn];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var o=t.index,r=e[Gn],i=r._datasets[o]=[],a=e.isDatasetVisible(o),l=e.data.datasets[o],c=Qz(l,n),d=t.meta.data||[],u=e.ctx,f,h,g,m,b,v,x,C;for(u.save(),f=0,g=d.length;f<g;++f)if(x=d[f],x[Gn]=[],a&&x&&e.getDataVisibility(f)&&!x.skip)for(h=0,m=c.labels.length;h<m;++h)b=c.labels[h],v=b._key,C=new jb(b,u,x,f),C.$groups={_set:o,_key:v||Ab},C.$context={active:!1,chart:e,dataIndex:f,dataset:l,datasetIndex:o},C.update(C.$context),x[Gn].push(C),i.push(C);u.restore(),Xo(r._listeners,c.listeners,{merger:function(S,P,w){P[S]=P[S]||{},P[S][t.index]=w[S],r._listened=!0}})},afterUpdate:function(e){e[Gn]._labels=jl.prepare(e[Gn]._datasets)},afterDatasetsDraw:function(e){jl.draw(e,e[Gn]._labels)},beforeEvent:function(e,t){if(e[Gn]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":eW(e,n);break;case"click":tW(e,n);break}}},afterEvent:function(e){var t=e[Gn],n=t._actives,o=t._actives=e.getActiveElements(),r=kl.arrayDiff(n,o),i,a,l,c,d,u,f;for(i=0,a=r.length;i<a;++i)if(d=r[i],d[1])for(f=d[0].element[Gn]||[],l=0,c=f.length;l<c;++l)u=f[l],u.$context.active=d[1]===1,u.update(u.$context);(t._dirty||r.length)&&(jl.update(t._labels),e.render()),delete t._dirty}};const oW=e=>{const{values:t,color:n,theme:o,updateCurrentSelectedPoint:r,...i}=e;return{...i,data:rW(t,n),options:iW(o,r),plugins:[aW]}},rW=(e,t)=>({datasets:[{data:e,backgroundColor:t,pointStyle:"circle",pointRadius:8,pointHoverRadius:9}],labels:Array.from(e.map(n=>n.label))}),iW=(e,t)=>({plugins:{datalabels:{color:"#403d58",formatter:function(o){return o.label},align:"right",padding:{left:25},font:{weight:600,size:12,family:e.typography.fontFamily}},legend:{display:!1,usePointStyle:!0},tooltip:{enabled:!1,external:sW}},scales:{x:{beginAtZero:!0,grace:"15%",linear:!0,border:{dash:[5,5]}},y:{beginAtZero:!0,linear:!0,grace:"20%",border:{dash:[5,5]}}},layout:{padding:{left:25,right:25,top:15,bottom:15}},onHover:(o,r)=>{if(o.type==="click"){if(r.length){t(r[0].index,o.x,o.y);return}t(null,null,null)}}}),Vb={opacity:"0",position:"absolute",backgroundColor:"#393A36",color:"#fff",borderRadius:"4px",padding:"6px",pointerEvents:"none",textAlign:"center",fontSize:"10px",fontWeight:"600",minWidth:"30px"},sW=e=>{const{chart:t,tooltip:n}=e;let o=document.getElementById("chartjs-tooltip-x");o||(o=document.createElement("div"),o.id="chartjs-tooltip-x",Object.assign(o.style,Vb),document.body.appendChild(o));let r=document.getElementById("chartjs-tooltip-y");if(r||(r=document.createElement("div"),r.id="chartjs-tooltip-y",Object.assign(r.style,Vb),document.body.appendChild(r)),n.opacity===0){o.style.opacity="0",r.style.opacity="0";return}if(n.dataPoints){const b=n.dataPoints[0],{x:v,y:x}=b.raw;o.textContent=`${v.toFixed(3)}`,r.textContent=`${x.toFixed(3)}`}const i=t.canvas.getBoundingClientRect(),a=t.scales.x,c=t.scales.y.bottom+i.top+window.scrollY,d=a.left+i.left+window.scrollX,u=i.left+window.scrollX+n.caretX-o.offsetWidth/2,f=c;o.style.left=`${u}px`,o.style.top=`${f}px`,o.style.opacity="1";const h=d-r.offsetWidth,g=i.top+window.scrollY+n.caretY-r.offsetHeight/2;r.style.left=`${h}px`,r.style.top=`${g}px`,r.style.opacity="1"},aW={id:"crosshair",defaults:{width:1,color:"#000000",dash:[],tooltipBackground:"#f5f5f5",tooltipTextColor:"#000000",tooltipFontSize:10,tooltipPadding:6,tooltipRadius:4},afterInit:e=>{e.crosshair={x:0,y:0,draw:!1,xValue:null,yValue:null}},afterEvent:(e,t)=>{const{inChartArea:n}=t,o=e.getElementsAtEventForMode(t.event,"nearest",{intersect:!0},!1);if(o.length){const r=o[0].index,i=e.data.datasets[0].data[r],{x:a,y:l}=o[0].element;e.crosshair={x:a,y:l,draw:n,xValue:i.x,yValue:i.y}}else e.crosshair.draw=!1;e.draw()},beforeDatasetsDraw:e=>{var d,u,f,h,g,m,b,v;const{ctx:t,crosshair:n}=e;if(!n)return;const{bottom:o,left:r}=e.chartArea,{x:i,y:a,draw:l}=n;if(!l)return;t.save(),t.beginPath(),t.lineWidth=((u=(d=e.options.plugins)==null?void 0:d.crosshair)==null?void 0:u.width)??1,t.strokeStyle=((h=(f=e.options.plugins)==null?void 0:f.crosshair)==null?void 0:h.color)??"#000000";const c=((m=(g=e.options.plugins)==null?void 0:g.crosshair)==null?void 0:m.dash)??[];t.setLineDash(c.filter(x=>x!==void 0)),t.moveTo(i,a),t.lineTo(i,o),t.moveTo(r,a),t.lineTo(i,a),t.stroke(),t.font=`${((v=(b=e.options.plugins)==null?void 0:b.crosshair)==null?void 0:v.tooltipFontSize)??10}px ${t.font.split(" ").slice(-1)}`,t.textAlign="center",t.textBaseline="middle",t.restore()}};Cl.register(...jB,nW);const lW=e=>{const t=(i,a,l)=>{var u;if(i===null||!((u=e.values)!=null&&u[i])||a===null||l===null){e.onPointSelection(null);return}const d={point:e.values[i],absoluteCoordinate:{x:a,y:l}};e.onPointSelection(d)},n="#F6A500",o=Ee(),r=oW({...e,color:o.palette.primary[500]??n,theme:o,updateCurrentSelectedPoint:t});return p.jsxs(ne,{sx:{backgroundColor:o.custom.grey[200],borderRadius:"8px",border:`1px solid ${o.custom.grey[500]}`,padding:"12px"},children:[e.y,p.jsx(FB,{...r}),p.jsx(ne,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.x})]})},Fb=e=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),y.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"#D1CFCE",strokeWidth:2})),$b=e=>y.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("rect",{width:20,height:20,rx:4,fill:"url(#paint0_linear_2034_7850)"}),y.createElement("path",{d:"M8.32244 13.9335L4.56689 10.178L5.36133 9.38351L8.32244 12.3446L14.628 6.03906L15.4224 6.83351L8.32244 13.9335Z",fill:"white"}),y.createElement("defs",null,y.createElement("linearGradient",{id:"paint0_linear_2034_7850",x1:7.58928,y1:755124e-13,x2:7.58928,y2:20,gradientUnits:"userSpaceOnUse"},y.createElement("stop",{stopColor:"#484945"}),y.createElement("stop",{offset:1,stopColor:"#2A2B27"})))),cW=W(Yo)(()=>({":hover":{background:Me[400]}})),dW=e=>{const{values:t,...n}=e,{onChange:o,...r}=n,i=Object.entries(t);return p.jsx(P1,{children:i.map(([a,l],c)=>p.jsx(Cs,{control:p.jsx(cW,{...r,checkedIcon:p.jsx($b,{}),icon:p.jsx(Fb,{}),disableRipple:!0,onChange:(d,u)=>{const f={};f[a]={name:l.name,state:u},o(f)}}),sx:{gap:"1rem"},label:l.name,checked:l.state},`${a}-${c}`))})},uW=(e,t,n)=>Object.entries(t).flatMap(r=>{const[i,a]=r;if(a.state===!1)return[];const l=Number(i),c=e.find(d=>d.id===l);return c?[c]:[n({id:l,name:a.name})]}),pW=(e,t)=>{const n={};return e.reduce((r,i)=>{const a=t.some(l=>l.id===i.id);return r[i.id]={name:i.name,state:a},r},n)},fW=W(Yo)(()=>({":hover":{background:Me[400]}})),hW=e=>{const{values:t,onChange:n,FormGroupProps:o,FormControlLabelProps:r,CheckboxProps:i}=e,a=Object.entries(t);return p.jsx(P1,{...o,children:a.map(([l,c],d)=>p.jsx(Cs,{sx:{gap:"1rem"},checked:c.state,...r,label:c.name,control:p.jsx(fW,{checkedIcon:p.jsx($b,{}),icon:p.jsx(Fb,{}),disableRipple:!0,...i,onChange:(u,f)=>{const h={...t};h[l]={...h[l],name:c.name,state:f},n(h)}})},`${l}-${d}`))})},Nb=e=>{const{values:t,selectedItems:n,onChange:o,getId:r=d=>d.id,getName:i=d=>d.name,...a}=e,l=(n==null?void 0:n.map(d=>r(d)))??[],c=t.reduce((d,u)=>{const f=r(u),h=l.includes(f),g=n===void 0?!1:h;return d[f]={name:i(u),state:g,rawData:u},d},{});return p.jsx(hW,{values:c,onChange:d=>{const u=Object.values(d).flatMap(f=>f.state===!1?[]:f.rawData);return o(u)},...a})},gW=e=>{const{title:t,subtitle:n,description:o,imageUrl:r,callToAction:i,sxProps:a={}}=e,l=Ee();return p.jsxs(ne,{sx:{display:"flex",maxWidth:"1200px",border:`1px solid ${Me[500]}`,background:l.palette.background.paper,borderRadius:"16px",overflow:"hidden",justifyContent:"space-between",gap:"3rem",...a},children:[p.jsxs(ne,{sx:{padding:"48px 0 48px 48px"},children:[p.jsx(Ms,{defaultVariant:"h2",text:t}),n&&p.jsx(Ms,{defaultVariant:"h5",text:n,typographyProps:{color:l.custom.grey[2e3],lineHeight:"1.625rem"}}),o&&p.jsx(ne,{my:"1.5rem",children:o}),i&&p.jsx(Ja,{buttonOptions:i,defaultOptions:{sx:{display:"inline-flex",gap:"12px",padding:"24px"},variant:"primary",endIcon:p.jsx(Gt,{size:2,icon:"arrowRight"})}})]}),r&&p.jsx(ne,{sx:{width:500,mb:"-8px"},children:p.jsx("img",{src:r,alt:"description",style:{width:"100%",height:"auto",minWidth:500}})})]})},f2=e=>{const{title:t,description:n,imageSrc:o,onClick:r,isFirst:i=!1,readMoreText:a="Lire l’article"}=e,l=Ee();return p.jsxs(Oe,{direction:i?"column":"row",sx:{border:`1px solid ${Me[500]}`,borderRadius:"16px",overflow:"hidden"},children:[p.jsx(ne,{sx:{lineHeight:0},children:p.jsx(Bm,{onClick:r,sx:{display:"block",minWidth:235,"&:hover":{cursor:"pointer"}},children:p.jsx("img",{style:{width:"100%",height:"auto"},src:o,alt:t})})}),p.jsxs(Oe,{sx:{backgroundColor:l.palette.background.paper,width:"100%",padding:"1.5rem"},children:[p.jsx(he,{variant:"h3",mb:"0.2rem",children:t}),p.jsx(he,{variant:"body",mb:"1rem",children:n}),p.jsxs(rt,{sx:{display:"inline-flex",alignSelf:"flex-start",fontWeight:700,gap:"12px"},variant:"text",onClick:r,children:[p.jsx(he,{fontWeight:700,fontSize:"0.875rem",children:a}),p.jsx(Gt,{size:2,icon:"arrowRight"})]})]})]})},mW=e=>{const{articles:t=[],sxProps:n={}}=e,[o,...r]=t;return p.jsx(Oe,{sx:n,children:p.jsxs(ne,{sx:{display:"flex",flexDirection:"row",gap:"20px"},children:[p.jsx(ne,{children:p.jsx(f2,{...o})}),p.jsx(Oe,{justifyContent:"space-between",children:r.map((i,a)=>p.jsx(f2,{...i},`article-${a}`))})]})})},bW=e=>{const{title:t,children:n,objectives:o=[],tooltipMessage:r}=e,i=Ee();return p.jsxs(Oe,{sx:{borderRadius:"12px",border:`1px solid ${i.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:i.palette.background.paper},children:[p.jsxs(ne,{display:"flex",children:[p.jsx(he,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),r&&p.jsx(Gt,{size:3,icon:"information"})]}),p.jsx(ne,{fontWeight:700,display:"flex",gap:"0.5rem",mb:"1rem",children:n}),p.jsx(Oe,{sx:{"> div:not(:last-of-type)":{mb:"1rem"}},children:o.map((a,l)=>p.jsxs(Oe,{flexDirection:"row",alignItems:"center",gap:".5rem",children:[p.jsx(he,{variant:"small-medium",children:a.objective}),p.jsx(d6,{boxProps:{sx:{padding:"0.1rem 0.5rem"}},children:a.component})]},l))})]})},Bb=W(({className:e,...t})=>p.jsx(qt,{...t,arrow:!0,classes:{popper:e}}))(e=>({[`& .${Co.arrow}`]:{color:"#FFF"},[`& .${Co.tooltip}`]:{padding:"12px 16px 12px 16px",borderRadius:"8px",backgroundColor:"#FFF"}})),vW=e=>{const{title:t,subtitle:n,description:o}=e,r=Ee();return p.jsxs(Oe,{sx:{borderRadius:"12px",border:`1px solid ${r.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:r.palette.background.paper},children:[p.jsxs(Oe,{flexDirection:"row",children:[p.jsx(he,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),n&&p.jsx(xW,{text:n})]}),p.jsx(Oe,{children:p.jsx(he,{variant:"body-medium",children:p.jsx(ne,{dangerouslySetInnerHTML:{__html:o}})})})]})};function xW(e){const{text:t}=e;return p.jsx(Bb,{title:p.jsx(he,{variant:"body-medium",children:t}),placement:"right",children:p.jsx(ne,{children:p.jsx(Gt,{size:3,icon:"information"})})})}const yW=e=>{const{value:t,maxLength:n,...o}=e,r=t.map((u,f)=>t.slice(0,f+1).reduce((h,g)=>{const m=h.length+g.length;if(m>n){const b=n-m,v=[...h.words,g.slice(0,b)].filter(Boolean);return{length:m,words:v,rest:t.length-v.length}}return{...h,length:m,words:[...h.words,g]}},{length:0,words:[],rest:0})),i=r[r.length-1],l=t[t.length-1].length===i.words[i.words.length-1].length?"":"…",c=i.words.join(", "),d=i.rest>0?`${c}… +${i.rest}`:c+l;return p.jsx(he,{...o,children:d})},CW=e=>{const{value:t,maxLength:n,separator:o=",",...r}=e;if(n===0)return p.jsx(he,{...r,children:""});const i=t.join("").length;if(n>i)return p.jsx(he,{...r,children:t.join(o)});let a=0;const l=t.reduce((x,C)=>{const S=a+C.length,P={low:a,high:S};return a=S,x.push(P),x},[]),c=l.findIndex(x=>x.low<n&&n<=x.high),d=c+1,u=l.length-d,h=l[c].high===n?"":"…",g=d*o.length,m=t.join(o).slice(0,n-1+g),b=u?`+${u}`:"",v=`${m}${h} ${b}`;return p.jsx(he,{...r,children:v})},wW=e=>{const{setOpen:t,options:n,onValidate:o,onCancel:r,canValidate:i=!0,confirmAction:a,cancelText:l,validateText:c,...d}=e,[u,f]=X.useState(!1),h=()=>t(!1),g=()=>{f(!1)},m=()=>{r&&r(),h()},b=()=>{if(!a){o&&o(),h();return}u?(f(!1),o&&o(),h()):f(!0)};return p.jsxs(Fa,{onClose:m,...d,fullWidth:!0,maxWidth:"md",scroll:"body",children:[p.jsxs(Qc,{sx:zb,children:[n.title,p.jsx(rt,{variant:"text",endIcon:p.jsx(Md,{}),onClick:m})]}),p.jsx(ne,{sx:{width:"100%"},children:n.content}),p.jsx(Hb,{onCancelAction:m,onConfirmAction:b,canValidate:i,cancelText:l,validateText:c}),a&&p.jsx(SW,{openConfirmAction:u,onCancel:g,onValidate:b,confirmAction:a,cancelText:l,validateText:c})]})},SW=e=>{const{confirmAction:t,onCancel:n,onValidate:o,openConfirmAction:r,cancelText:i,validateText:a}=e;return p.jsxs(Fa,{open:r,onClose:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Me[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},children:[p.jsxs(Qc,{sx:zb,children:[t.title,p.jsx(rt,{variant:"text",endIcon:p.jsx(Md,{}),onClick:n})]}),p.jsx(ne,{sx:{padding:"32px",width:"100%"},children:t.content}),p.jsx(Hb,{onCancelAction:n,onConfirmAction:o,cancelText:t.cancelText??i,validateText:t.validateText??a})]})},Hb=e=>{const{onCancelAction:t,onConfirmAction:n,canValidate:o=!0,cancelText:r,validateText:i}=e;return p.jsxs(T1,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:`1px solid ${Me[500]}`,minHeight:"68px",paddingInline:"1rem",padding:"28px 32px 32px 32px"},children:[p.jsx(rt,{variant:"text",onClick:t,children:r}),p.jsx(rt,{variant:"primary",onClick:n,disabled:!o,children:i})]})},zb={display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Me[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},TW=W(_a)(({theme:e})=>({fontFamily:e.typography.fontFamily,...e.typography.body})),$s=X.forwardRef(function(e,t){const n=Ee(),{sx:o,error:r,...i}=e;return p.jsx(TW,{...i,sx:{color:r?n.custom.red[600]:n.custom.grey[2800],border:r?`1px solid ${n.custom.red[600]}`:`1px solid ${n.custom.grey[1400]}`,backgroundColor:r?n.custom.red[100]:"inherit",borderRadius:"16px",paddingInline:"20px",...o}})}),PW=e=>{const{title:t,unit:n,placeholder:o,value:r,description:i,error:a,required:l,...c}=e,d=l?"*":"",u=Ee(),f=X.useRef(!1),h=f.current&&a,[g,m]=X.useState(!1),[b,v]=X.useState(!1),[x,C]=X.useState(!1);X.useEffect(()=>{const M=S(P,e.setMinMaxError);m(M);const O=S(w,e.setMinError);v(O);const E=S(R,e.setMaxError);C(E)},[r]);const S=(M,O)=>{const E=M();return O!==void 0&&O(E),E},P=()=>{if(e.min===void 0&&e.max===void 0||r===void 0||r==="")return!1;const M=Number(r);return!(e.min!==void 0&&M>e.min&&e.max!==void 0&&M<e.max)},w=()=>e.min===void 0||r===void 0||r===""?!1:!(e.min<Number(r)&&e.max===void 0),R=()=>e.max===void 0||r===void 0||r===""?!1:!(e.max>Number(r)&&e.min===void 0);return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[p.jsx(he,{variant:"h5",children:`${t}${d} :`}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[p.jsx($s,{...c,type:"number",style:{minWidth:"150px",width:"10%",borderColor:h?u.palette.error.main:"inherit",backgroundColor:h?u.palette.error.light:"inherit"},placeholder:o,value:r,onChange:M=>{f.current=!0,c.onChange&&c.onChange(M)}}),p.jsx(he,{variant:"body",children:n})]}),(!!e.minMaxErrorMessage&&g||!!e.minErrorMessage&&b||!!e.maxErrorMessage&&x)&&p.jsxs(he,{variant:"body",style:{color:u.custom.red[600]},children:[!!e.minMaxErrorMessage&&g&&e.minMaxErrorMessage,!!e.minErrorMessage&&b&&e.minErrorMessage,!!e.maxErrorMessage&&x&&e.maxErrorMessage]}),p.jsx(he,{variant:"body",children:i})]})},MW=e=>{const{unit:t,sx:n,...o}=e;return p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[p.jsx($s,{type:"number",sx:{minWidth:"125px",width:"10%",...n},...o}),p.jsx(he,{variant:"body",children:t})]})};function RW(e){const t=Ee(),n={height:"40px",padding:"0px 6px 0px 20px",...t.custom.searchBox,minWidth:"350px"},o={height:"20px",padding:"0px",width:"100%","&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{padding:"0"}},r={height:"48px",padding:"0px 16px 0px 24px",borderTop:"1px solid "+t.custom.grey[500],borderBottom:"1px solid "+t.custom.grey[500],background:t.custom.grey[200]},i={"&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{width:"100%",height:"48px",padding:"0",border:"none"}};return p.jsxs(Oe,{direction:"row",useFlexGap:!0,gap:"10px",justifyContent:"space-between",alignItems:"center",sx:e.variant==="standalone"?n:r,children:[p.jsx(ur,{label:"",type:"search",placeholder:e.placeholder,value:e.value,onChange:a=>{e.onChange(a.target.value)},sx:e.variant==="standalone"?o:i}),p.jsx(PL,{})]})}const OW=X.forwardRef(function(t,n){const{title:o,placeholder:r,value:i,description:a,sx:l,error:c,required:d,...u}=t,f=d?"*":"",h=Ee(),g=X.useRef(!1),m=g.current&&c;return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[p.jsx(he,{variant:"h5",children:`${o}${f} :`}),p.jsx($s,{...u,sx:{width:"70%",borderColor:m?h.custom.red[600]:"inherit",backgroundColor:m?h.custom.red[100]:"inherit",...l},placeholder:r,value:i,onChange:b=>{g.current=!0,u.onChange&&u.onChange(b)}}),p.jsx(he,{variant:"body",children:a})]})});function EW(e){return p.jsxs("div",{children:[p.jsx(he,{variant:"body-bold",sx:{marginBottom:"16px"},children:e.header}),p.jsxs(Oe,{direction:"column",useFlexGap:!0,gap:"12px",children:[p.jsxs(Oe,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[p.jsx(Yo,{checked:!0,sx:{width:"20px",height:"20px"}}),p.jsx(he,{variant:"body",children:e.allText})]}),e.values.map((t,n)=>p.jsxs(Oe,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[p.jsx(Yo,{checked:!1,sx:{width:"20px",height:"20px"}}),p.jsx(he,{variant:"body",children:t})]},n))]})]})}function kW(e){return p.jsxs(Oe,{direction:"column",useFlexGap:!0,gap:"12px",alignItems:"flex-start",children:[p.jsx(he,{variant:"body-bold",children:e.header}),p.jsx(Oe,{direction:"row",useFlexGap:!0,gap:"8px",flexWrap:"wrap",children:e.values.map((t,n)=>p.jsxs(Oe,{direction:"row",useFlexGap:!0,gap:"4px",sx:{height:"28px",borderRadius:"4px",background:"#EFEDEC",paddingLeft:"8px"},alignItems:"center",children:[p.jsx(he,{variant:"body",children:t}),p.jsx(Rt,{sx:{width:"20px",height:"20px"},children:p.jsx(U1,{sx:{width:"16px",height:"16px"}})})]},n))}),p.jsx(rt,{variant:"text",startIcon:p.jsx(mL,{}),children:e.addText})]})}const Wb=e=>{const t=Ee(),{steps:n,currentStep:o=0,icons:r=[],clickable:i=!1,onClick:a}=e;return p.jsxs(ne,{display:"inline-flex",position:"relative",children:[p.jsx(Oe,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(n??r.length).keys()].map(l=>{const c=l<=o;return p.jsx(Pd,{size:"medium",border:`1px solid ${t.custom.grey[500]}`,color:c?"#FFF":t.custom.grey[2800],bgcolor:c?t.custom.grey[2800]:"#FFF",sx:{fill:c?"#FFF":t.custom.grey[2800],cursor:i?"pointer":"default","&:hover":i?{fill:"#FFF",color:"#FFF",bgcolor:t.custom.grey[c?2800:2e3]}:{}},onClick:()=>{i&&a&&a(l)},children:r&&r[l]?r[l]:l+1},l)})}),p.jsx(oo,{sx:{backgroundColor:t.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},Ub=e=>y.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M11.021 7.69411H0.333496V6.30524H11.021L6.021 1.30522L7.00016 0.333008L13.6668 6.99967L7.00016 13.6663L6.021 12.6941L11.021 7.69411Z",fill:"white"})),Zb=e=>y.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M2.97919 7.69411L7.97921 12.6941L7.00004 13.6663L0.333374 6.99967L7.00004 0.333008L7.97921 1.30522L2.97919 6.30524H13.6667V7.69411H2.97919Z",fill:"#B06803"})),qb=e=>{var t;return p.jsxs(Oe,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{minHeight:"96px",zIndex:1e3,position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px"},children:[p.jsx(IW,{title:e.title,subtitle:e.subtitle}),p.jsx(Wb,{icons:e.icons,steps:e.steps??((t=e.icons)==null?void 0:t.length)??0,currentStep:e.currentPage,clickable:e.navigable,onClick:e.onNavigate}),p.jsx(_W,{onPageForward:e.onPageForward,onPageBack:e.onPageBack,nextPageText:e.nextPageText,previousPageText:e.previousPageText,currentPage:e.currentPage,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:e.savingState,closeable:e.closeable,onClose:e.onClose})]})},IW=e=>{const t=Ee();return p.jsx(Oe,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:p.jsxs(Oe,{gap:"4px",children:[p.jsx(he,{variant:"h3",children:e.title}),e.subtitle&&p.jsx(he,{variant:"body",color:t.custom.grey[2e3],children:e.subtitle})]})})},jW=e=>{const t=Ee(),n=e.saving?o6:n6,o=e.saving?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},r=p.jsx(n,{sx:{width:"24px",color:t.custom.grey[2e3],...o}}),i=p.jsx(ne,{padding:"12px 16px",textAlign:"center",children:p.jsx(he,{variant:"body",children:e.saving?e.savingMessage:e.savedMessage})});return p.jsx(el,{icon:r,body:i,size:"260px"})},_W=e=>{const t=Ee(),n=p.jsx(rt,{variant:"primary",disabled:e.validateSteps&&!e.validateSteps[e.currentPage],endIcon:p.jsx(Ub,{}),onClick:e.onPageForward,children:e.nextPageText}),o=p.jsxs(ne,{padding:"12px 16px",children:[p.jsx(he,{variant:"body-bold",children:e.warningText||""}),p.jsx("br",{}),p.jsx(he,{variant:"body",children:e.validateStepsTexts&&e.validateStepsTexts[e.currentPage]||""})]});return p.jsxs(Oe,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[p.jsx(ne,{sx:{">*":{display:"flex"}},children:e.savingState&&p.jsx(jW,{...e.savingState})}),p.jsxs(Oe,{direction:"row",gap:"20px",children:[e.previousPageText&&p.jsx(rt,{variant:"text",startIcon:p.jsx(Zb,{}),onClick:e.onPageBack,children:e.previousPageText}),e.validateSteps&&!e.validateSteps[e.currentPage]?e.nextPageText&&p.jsx(el,{icon:n,body:o,size:"260px"}):e.nextPageText&&n]}),e.closeable&&p.jsx(rt,{variant:"white-filled",onClick:e.onClose,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:t.custom.grey[400]},"&:active":{background:t.custom.grey[600]}},children:p.jsx(t6,{sx:{width:"20px",color:t.custom.grey[2800]}})})]})},h2=e=>{const t=Ee(),{title:n,titleSize:o,badge:r}=e,a=o||"h1";return p.jsxs(Oe,{direction:"row",alignItems:"center",gap:"16px",children:[typeof r=="number"?p.jsx(Pd,{size:"big",children:r}):p.jsx(Oe,{width:"40px",alignItems:"center",color:t.custom.grey[2800],children:p.jsx(Oe,{sx:{transform:"scale(250%)"},children:r})}),p.jsx(he,{variant:a,children:n})]})},DW=e=>{const{title:t,subtitle:n,pages:o,pageIndexToDisplay:r=0,savingState:i,closeable:a=!0}=e,l=o.map(u=>u.icon),c=o[r],d=(Array.isArray(c.content)?c.content:[c.content]).map((u,f)=>p.jsx(X.Fragment,{children:u},f));return p.jsxs(p.Fragment,{children:[p.jsx(qb,{title:t,subtitle:n,icons:l,steps:o.length,currentPage:r,nextPageText:e.nextPageText,previousPageText:e.previousPageText,onPageForward:e.onPageForward,onPageBack:e.onPageBack,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:i,navigable:e.navigable,onNavigate:e.onNavigate,closeable:a,onClose:e.onClose}),p.jsx(Oe,{direction:"column",alignItems:"center",children:p.jsxs("div",{style:{width:"1024px"},children:[p.jsxs(Oe,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[c.title&&p.jsx(h2,{title:c.title,badge:c.icon??r+1}),c.subTitle&&p.jsx(he,{variant:"h4",children:c.subTitle}),c.subTitle&&p.jsx(oo,{}),c.info]}),c.usesBaseLayout===!1?p.jsx(p.Fragment,{children:d}):p.jsx(LW,{children:d})]})})]})},LW=e=>{const{children:t}=e,n=Array.isArray(t)?t:[t];return p.jsx("div",{children:n.map((o,r)=>p.jsx(X.Fragment,{children:o},r))})},AW=({sx:e={},...t})=>p.jsx(ne,{sx:{boxShadow:"0px 2px 8px 0px #2A2B270A",border:`1px solid ${Me[500]}`,borderRadius:"16px",backgroundColor:"#FFFFFF",padding:"2rem",height:"fit-content",...e},...t}),VW=e=>{const{title:t,hint:n,indicator:o,children:r,...i}=e;return p.jsx(wo,{width:"100%",padding:"32px",...i,children:p.jsxs(Oe,{gap:"32px",children:[p.jsxs(Oe,{direction:"row",alignItems:"start",gap:"32px",children:[p.jsx(he,{variant:"h4",flex:1,children:t}),o&&p.jsx(yd,{value:o.value,unit:o.unit,sx:{top:"-12px",right:"-12px"}})]}),p.jsxs(Oe,{gap:"24px",children:[r,n&&p.jsx(p6,{children:p.jsx(ne,{dangerouslySetInnerHTML:{__html:n}})})]})]})})},FW=()=>{const[e,t]=X.useState({isLocked:!1}),n=u=>{t({isLocked:!0,message:u})},o=()=>{t({isLocked:!1})},[r,i]=X.useState({isLocked:!1}),a=u=>{i({isLocked:!0,message:u})},l=()=>{i({isLocked:!1})};return{forwardLock:e,lockForward:n,unlockForward:o,previousLock:r,lockPrevious:a,unlockPrevious:l,lockAll:u=>{n(u),a(u)},unlockAll:()=>{o(),l()}}},Gb=X.createContext(null),Yb=e=>{const{children:t,startingPage:n=0,...o}=e,[r,i]=X.useState(!1),[a,l]=X.useState(!1),[c,d]=X.useState(n),u=e.pages.length,f=e.pages[c]??null,h=FW(),[g,m]=X.useState(!1),b={...o,...h,isSaving:r,setSaving:i,selectedPage:f,selectedPageIndex:c,setPage:d,maxPage:u,formSaved:g,setFormSaved:m,isError:a,setError:l};return p.jsx(Gb.Provider,{value:b,children:t})},ji=()=>{const e=X.useContext(Gb);if(e)return e;throw new Error("useFormBaseContext must be used within an FormBaseContextProvider")},$W=()=>{const{selectedPageIndex:e,setPage:t,onPageChange:n,pages:o,previousLock:r,forwardLock:i,maxPage:a,setFormSaved:l,isLoading:c}=ji(),d=Ee(),u={selected:{color:"#FFF",background:d.custom.grey[2800],hover:{color:"#FFF",background:d.custom.grey[2800]}},locked:{color:d.custom.grey[500],background:"#FFF",hover:{color:d.custom.grey[500],background:"#FFF"}},default:{color:d.custom.grey[2800],background:"#FFF",hover:{color:"#FFF",background:d.custom.grey[2e3]}}};return c?p.jsx(ys,{}):p.jsxs(ne,{display:"inline-flex",position:"relative",children:[p.jsx(Oe,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(a)].map((f,h)=>{var S;const g=r.isLocked&&h<e,m=i.isLocked&&h>e,b=g||m,x=h===e?u.selected:u[b?"locked":"default"],C=((S=o[h])==null?void 0:S.icon)??h+1;return p.jsx(Pd,{size:"medium",border:`1px solid ${d.custom.grey[500]}`,color:x.color,bgcolor:x.background,sx:{fill:x.color,cursor:b?"default":"pointer","&:hover":{fill:x.hover.color,color:x.hover.color,bgcolor:x.hover.background}},onClick:()=>{h===e||b||(l(!1),t(h),n==null||n(h,e))},children:C},`page-top-display-${h}`)})}),p.jsx(oo,{sx:{backgroundColor:d.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},NW=()=>{const{textOptions:e,isLoading:t}=ji(),n=Ee();return p.jsx(Oe,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:p.jsxs(Oe,{gap:"4px",children:[p.jsx(he,{variant:"h3",children:t?p.jsx(ys,{size:"18px"}):e.title}),e.subtitle&&p.jsx(he,{variant:"body",color:n.custom.grey[2e3],children:e.subtitle})]})})},BW=()=>{const e=Ee(),{isSaving:t,textOptions:n,isError:o}=ji(),r=t?o6:o?RL:n6,i=t?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},a=p.jsx(r,{sx:{width:"24px",color:o?e.custom.red[600]:e.custom.grey[2e3],...i}}),l=p.jsx(ne,{padding:"12px 16px",textAlign:"center",children:p.jsx(he,{variant:"body-medium",children:t?n.syncingMessage:o?n.errorDefaultMessage:n.savingDefaultMessage})});return p.jsx(el,{icon:a,body:l,size:"260px"})},HW=()=>{const{confirmExit:e,selectedPageIndex:t,setPage:n,maxPage:o,forwardLock:r,previousLock:i,textOptions:a,onClose:l,onValidate:c,onPageChange:d,showSync:u,setFormSaved:f,openConfirmDialog:h,isLoading:g}=ji(),m=Ee(),v=t===o-1&&a.finalPage?a.finalPage:a.nextPage,x=p.jsx(rt,{variant:"primary",disabled:r.isLocked||g,endIcon:p.jsx(Ub,{}),onClick:()=>{if(t===o-1){f(!0),c==null||c();return}return f(!1),d==null||d(t+1,t),n(t+1)},children:v}),C=p.jsxs(ne,{padding:"12px 16px",children:[p.jsx(he,{variant:"body-bold",children:a.warningText?a.warningText:""}),p.jsx("br",{}),p.jsx(he,{variant:"body",children:r.isLocked&&r.message||""})]});return p.jsxs(Oe,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[p.jsx(ne,{sx:{">*":{display:"flex"}},children:u&&p.jsx(BW,{})}),p.jsxs(Oe,{direction:"row",gap:"20px",children:[a.previousPage&&p.jsx(rt,{sx:{minWidth:"90px"},variant:"text",disabled:i.isLocked||g,startIcon:i.isLocked||g?null:p.jsx(Zb,{}),onClick:()=>{if(f(!1),t===0){d==null||d(t,t);return}return d==null||d(t-1,t),n(t-1)},children:a.previousPage}),r.isLocked?v&&p.jsx(el,{icon:x,body:C,size:"260px",leftPosition:130}):v&&x]}),l&&p.jsx(rt,{variant:"white-filled",onClick:e?h:l,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:m.custom.grey[400]},"&:active":{background:m.custom.grey[600]}},children:p.jsx(t6,{sx:{width:"20px",color:m.custom.grey[2800]}})})]})},zW=()=>p.jsxs(ne,{sx:{zIndex:1e3,minHeight:"96px",position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px",display:"grid",gridTemplateColumns:"1fr 50% 1fr",gridTemplateRows:"1fr",alignItems:"center"},children:[p.jsx(ne,{sx:{gridColumn:"1 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"left"},children:p.jsx(NW,{})}),p.jsx(ne,{sx:{gridColumn:"2 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"center"},children:p.jsx($W,{})}),p.jsx(ne,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:p.jsx(HW,{})})]}),WW=()=>{const{selectedPage:e,selectedPageIndex:t,isLoading:n}=ji(),o=e.icon??t+1,r=e.title,i=e.subtitle;return n?p.jsx(UW,{}):p.jsx(Oe,{direction:"column",alignItems:"center",children:p.jsxs("div",{style:{width:"1024px"},children:[p.jsxs(Oe,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[r&&p.jsx(h2,{title:r,badge:o}),i&&p.jsxs(p.Fragment,{children:[p.jsx(he,{variant:"h4",children:i}),p.jsx(oo,{})]})]}),e.content]})})},UW=()=>p.jsx(ne,{sx:{marginLeft:"auto",marginRight:"auto",width:"fit-content",marginTop:"5%",marginBottom:"5%"},children:p.jsx(ys,{})}),ZW=e=>{const t=Ee(),{onClose:n,open:o,confirmOptions:r}=e,i=()=>{r.onConfirm(),n()},a=()=>{r.onCancel(),n()};return p.jsxs(Fa,{fullWidth:!0,maxWidth:"xs",open:o,onClose:n,sx:{".MuiPaper-rounded":{borderRadius:"12px"}},children:[p.jsxs(Qc,{sx:{borderBottom:`1px solid ${t.custom.grey[500]}`},children:[p.jsxs(ne,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:"68px"},children:[p.jsx(he,{variant:"h3",children:r.titleText}),p.jsx(rt,{variant:"text",endIcon:p.jsx(Md,{}),onClick:n})]}),(r==null?void 0:r.infoText)&&p.jsx(he,{sx:{marginBlock:1.5},children:r.infoText})]}),p.jsxs(Oe,{flexDirection:"column",alignItems:"center",p:3,gap:"1rem",children:[p.jsx(rt,{variant:"primary",onClick:i,children:r.confirmText}),p.jsx(rt,{onClick:a,children:r.cancelText})]})]})},qW=()=>{const{confirmExit:e,formSaved:t}=ji(),n=o=>{o.preventDefault()};return X.useEffect(()=>{if(e)return window.removeEventListener("beforeunload",n),t===!1&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t,e]),p.jsxs(p.Fragment,{children:[p.jsx(zW,{}),p.jsx(WW,{})]})},GW=e=>{const[t,n]=X.useState(!1);return p.jsxs(Yb,{...e,openConfirmDialog:()=>n(!0),children:[p.jsx(qW,{}),e.confirmExit&&p.jsx(ZW,{open:t,onClose:()=>n(!1),confirmOptions:e.confirmOptions})]})};/**
375
375
  * table-core
376
376
  *
377
377
  * Copyright (c) TanStack
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "0.3.71",
4
+ "version": "0.3.72",
5
5
  "type": "module",
6
6
  "main": "./dist/main.umd.cjs",
7
7
  "module": "./dist/main.js",